aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/pages/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-03-01 20:57:43 +0100
committerGitHub <noreply@github.com>2022-03-01 20:57:43 +0100
commit2dbe0fd5fc3f3f74848df9499cddf32663e771ee (patch)
treefa162059dd8732ab3d6b22fb6df1fa10a353985f /webui/src/pages/bug
parent08e00b4eb8f8cf8e614cae8dee46862a398f465d (diff)
parent8229e80d1eeee73bd4eab46c90d9f97f802ab063 (diff)
downloadgit-bug-2dbe0fd5fc3f3f74848df9499cddf32663e771ee.tar.gz
Merge pull request #750 from MichaelMure/sandhose/webui-upgrade
Upgrade webui dependencies
Diffstat (limited to 'webui/src/pages/bug')
-rw-r--r--webui/src/pages/bug/Bug.tsx4
-rw-r--r--webui/src/pages/bug/BugQuery.tsx16
-rw-r--r--webui/src/pages/bug/CommentForm.graphql4
-rw-r--r--webui/src/pages/bug/CommentForm.tsx11
-rw-r--r--webui/src/pages/bug/EditCommentForm.tsx11
-rw-r--r--webui/src/pages/bug/LabelChange.tsx6
-rw-r--r--webui/src/pages/bug/Message.tsx18
-rw-r--r--webui/src/pages/bug/MessageHistoryDialog.tsx54
-rw-r--r--webui/src/pages/bug/SetStatus.tsx6
-rw-r--r--webui/src/pages/bug/SetTitle.tsx6
-rw-r--r--webui/src/pages/bug/Timeline.tsx4
-rw-r--r--webui/src/pages/bug/TimelineQuery.tsx4
-rw-r--r--webui/src/pages/bug/labels/LabelMenu.tsx31
-rw-r--r--webui/src/pages/bug/labels/SetLabel.graphql24
14 files changed, 98 insertions, 101 deletions
diff --git a/webui/src/pages/bug/Bug.tsx b/webui/src/pages/bug/Bug.tsx
index b32b0948..f5b97cc2 100644
--- a/webui/src/pages/bug/Bug.tsx
+++ b/webui/src/pages/bug/Bug.tsx
@@ -1,6 +1,4 @@
-import React from 'react';
-
-import { makeStyles } from '@material-ui/core/styles';
+import makeStyles from '@mui/styles/makeStyles';
import BugTitleForm from 'src/components/BugTitleForm/BugTitleForm';
import IfLoggedIn from 'src/components/IfLoggedIn/IfLoggedIn';
diff --git a/webui/src/pages/bug/BugQuery.tsx b/webui/src/pages/bug/BugQuery.tsx
index 5d459c42..244b0836 100644
--- a/webui/src/pages/bug/BugQuery.tsx
+++ b/webui/src/pages/bug/BugQuery.tsx
@@ -1,20 +1,18 @@
-import React from 'react';
-import { RouteComponentProps } from 'react-router-dom';
-
-import CircularProgress from '@material-ui/core/CircularProgress';
+import CircularProgress from '@mui/material/CircularProgress';
+import * as React from 'react';
+import { useParams } from 'react-router-dom';
import NotFoundPage from '../notfound/NotFoundPage';
import Bug from './Bug';
import { useGetBugQuery } from './BugQuery.generated';
-type Props = RouteComponentProps<{
- id: string;
-}>;
+const BugQuery: React.FC = () => {
+ const params = useParams<'id'>();
+ if (params.id === undefined) throw new Error('missing route parameters');
-const BugQuery: React.FC<Props> = ({ match }: Props) => {
const { loading, error, data } = useGetBugQuery({
- variables: { id: match.params.id },
+ variables: { id: params.id },
});
if (loading) return <CircularProgress />;
if (!data?.repository?.bug) return <NotFoundPage />;
diff --git a/webui/src/pages/bug/CommentForm.graphql b/webui/src/pages/bug/CommentForm.graphql
index 33d21193..f4b61850 100644
--- a/webui/src/pages/bug/CommentForm.graphql
+++ b/webui/src/pages/bug/CommentForm.graphql
@@ -1,5 +1,7 @@
mutation AddComment($input: AddCommentInput!) {
addComment(input: $input) {
- operation { id }
+ operation {
+ id
+ }
}
}
diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx
index 6d917889..f80b89e1 100644
--- a/webui/src/pages/bug/CommentForm.tsx
+++ b/webui/src/pages/bug/CommentForm.tsx
@@ -1,8 +1,9 @@
-import React, { useState, useRef } from 'react';
-
-import Button from '@material-ui/core/Button';
-import Paper from '@material-ui/core/Paper';
-import { makeStyles, Theme } from '@material-ui/core/styles';
+import Button from '@mui/material/Button';
+import Paper from '@mui/material/Paper';
+import { Theme } from '@mui/material/styles';
+import makeStyles from '@mui/styles/makeStyles';
+import * as React from 'react';
+import { useState, useRef } from 'react';
import CommentInput from '../../components/CommentInput/CommentInput';
import CloseBugButton from 'src/components/CloseBugButton';
diff --git a/webui/src/pages/bug/EditCommentForm.tsx b/webui/src/pages/bug/EditCommentForm.tsx
index 8fa659b3..4da051e6 100644
--- a/webui/src/pages/bug/EditCommentForm.tsx
+++ b/webui/src/pages/bug/EditCommentForm.tsx
@@ -1,8 +1,9 @@
-import React, { useState, useRef } from 'react';
-
-import Button from '@material-ui/core/Button';
-import Paper from '@material-ui/core/Paper';
-import { makeStyles, Theme } from '@material-ui/core/styles';
+import Button from '@mui/material/Button';
+import Paper from '@mui/material/Paper';
+import { Theme } from '@mui/material/styles';
+import makeStyles from '@mui/styles/makeStyles';
+import * as React from 'react';
+import { useState, useRef } from 'react';
import CommentInput from '../../components/CommentInput/CommentInput';
diff --git a/webui/src/pages/bug/LabelChange.tsx b/webui/src/pages/bug/LabelChange.tsx
index 868d8c9b..6b356d14 100644
--- a/webui/src/pages/bug/LabelChange.tsx
+++ b/webui/src/pages/bug/LabelChange.tsx
@@ -1,7 +1,5 @@
-import React from 'react';
-
-import { Typography } from '@material-ui/core';
-import { makeStyles } from '@material-ui/core/styles';
+import { Typography } from '@mui/material';
+import makeStyles from '@mui/styles/makeStyles';
import Author from 'src/components/Author';
import Date from 'src/components/Date';
diff --git a/webui/src/pages/bug/Message.tsx b/webui/src/pages/bug/Message.tsx
index 51087faa..a5dbbff0 100644
--- a/webui/src/pages/bug/Message.tsx
+++ b/webui/src/pages/bug/Message.tsx
@@ -1,11 +1,11 @@
-import React, { useState } from 'react';
-
-import IconButton from '@material-ui/core/IconButton';
-import Paper from '@material-ui/core/Paper';
-import Tooltip from '@material-ui/core/Tooltip/Tooltip';
-import { makeStyles } from '@material-ui/core/styles';
-import EditIcon from '@material-ui/icons/Edit';
-import HistoryIcon from '@material-ui/icons/History';
+import EditIcon from '@mui/icons-material/Edit';
+import HistoryIcon from '@mui/icons-material/History';
+import IconButton from '@mui/material/IconButton';
+import Paper from '@mui/material/Paper';
+import Tooltip from '@mui/material/Tooltip/Tooltip';
+import makeStyles from '@mui/styles/makeStyles';
+import * as React from 'react';
+import { useState } from 'react';
import Author, { Avatar } from 'src/components/Author';
import Content from 'src/components/Content';
@@ -97,6 +97,7 @@ function HistoryMenuToggleButton({ bugId, commentId }: HistBtnProps) {
aria-haspopup="true"
onClick={handleClickOpen}
className={classes.headerActions}
+ size="large"
>
<HistoryIcon />
</IconButton>
@@ -149,6 +150,7 @@ function Message({ bug, op }: Props) {
className={classes.headerActions}
aria-label="edit message"
onClick={() => editComment(comment.id)}
+ size="large"
>
<EditIcon />
</IconButton>
diff --git a/webui/src/pages/bug/MessageHistoryDialog.tsx b/webui/src/pages/bug/MessageHistoryDialog.tsx
index df8915d9..77f82d86 100644
--- a/webui/src/pages/bug/MessageHistoryDialog.tsx
+++ b/webui/src/pages/bug/MessageHistoryDialog.tsx
@@ -1,27 +1,24 @@
+import CloseIcon from '@mui/icons-material/Close';
+import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
+import MuiAccordion from '@mui/material/Accordion';
+import MuiAccordionDetails from '@mui/material/AccordionDetails';
+import MuiAccordionSummary from '@mui/material/AccordionSummary';
+import CircularProgress from '@mui/material/CircularProgress';
+import Dialog from '@mui/material/Dialog';
+import MuiDialogContent from '@mui/material/DialogContent';
+import MuiDialogTitle from '@mui/material/DialogTitle';
+import Grid from '@mui/material/Grid';
+import IconButton from '@mui/material/IconButton';
+import Tooltip from '@mui/material/Tooltip/Tooltip';
+import Typography from '@mui/material/Typography';
+import { Theme } from '@mui/material/styles';
+import { WithStyles } from '@mui/styles';
+import createStyles from '@mui/styles/createStyles';
+import withStyles from '@mui/styles/withStyles';
import moment from 'moment';
-import React from 'react';
+import * as React from 'react';
import Moment from 'react-moment';
-import MuiAccordion from '@material-ui/core/Accordion';
-import MuiAccordionDetails from '@material-ui/core/AccordionDetails';
-import MuiAccordionSummary from '@material-ui/core/AccordionSummary';
-import CircularProgress from '@material-ui/core/CircularProgress';
-import Dialog from '@material-ui/core/Dialog';
-import MuiDialogContent from '@material-ui/core/DialogContent';
-import MuiDialogTitle from '@material-ui/core/DialogTitle';
-import Grid from '@material-ui/core/Grid';
-import IconButton from '@material-ui/core/IconButton';
-import Tooltip from '@material-ui/core/Tooltip/Tooltip';
-import Typography from '@material-ui/core/Typography';
-import {
- createStyles,
- Theme,
- withStyles,
- WithStyles,
-} from '@material-ui/core/styles';
-import CloseIcon from '@material-ui/icons/Close';
-import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
-
import Content from '../../components/Content';
import { AddCommentFragment } from './MessageCommentFragment.generated';
@@ -50,13 +47,14 @@ export interface DialogTitleProps extends WithStyles<typeof styles> {
const DialogTitle = withStyles(styles)((props: DialogTitleProps) => {
const { children, classes, onClose, ...other } = props;
return (
- <MuiDialogTitle disableTypography className={classes.root} {...other}>
+ <MuiDialogTitle className={classes.root} {...other}>
<Typography variant="h6">{children}</Typography>
{onClose ? (
<IconButton
aria-label="close"
className={classes.closeButton}
onClick={onClose}
+ size="large"
>
<CloseIcon />
</IconButton>
@@ -141,7 +139,7 @@ function MessageHistoryDialog({ bugId, commentId, open, onClose }: Props) {
Loading...
</DialogTitle>
<DialogContent dividers>
- <Grid container justify="center">
+ <Grid container justifyContent="center">
<CircularProgress />
</Grid>
</DialogContent>
@@ -179,12 +177,10 @@ function MessageHistoryDialog({ bugId, commentId, open, onClose }: Props) {
const history = comment?.history.slice().reverse();
const editCount = history?.length === undefined ? 0 : history?.length - 1;
- const handleChange = (panel: string) => (
- event: React.ChangeEvent<{}>,
- newExpanded: boolean
- ) => {
- setExpanded(newExpanded ? panel : false);
- };
+ const handleChange =
+ (panel: string) => (event: React.ChangeEvent<{}>, newExpanded: boolean) => {
+ setExpanded(newExpanded ? panel : false);
+ };
const getSummary = (index: number, date: Date) => {
const desc =
diff --git a/webui/src/pages/bug/SetStatus.tsx b/webui/src/pages/bug/SetStatus.tsx
index f231b917..dfe07071 100644
--- a/webui/src/pages/bug/SetStatus.tsx
+++ b/webui/src/pages/bug/SetStatus.tsx
@@ -1,7 +1,5 @@
-import React from 'react';
-
-import { Typography } from '@material-ui/core';
-import { makeStyles } from '@material-ui/core/styles';
+import { Typography } from '@mui/material';
+import makeStyles from '@mui/styles/makeStyles';
import { Status } from '../../gqlTypes';
import Author from 'src/components/Author';
diff --git a/webui/src/pages/bug/SetTitle.tsx b/webui/src/pages/bug/SetTitle.tsx
index 057062f7..3ec04a0c 100644
--- a/webui/src/pages/bug/SetTitle.tsx
+++ b/webui/src/pages/bug/SetTitle.tsx
@@ -1,7 +1,5 @@
-import React from 'react';
-
-import { Typography } from '@material-ui/core';
-import { makeStyles } from '@material-ui/core/styles';
+import { Typography } from '@mui/material';
+import makeStyles from '@mui/styles/makeStyles';
import Author from 'src/components/Author';
import Date from 'src/components/Date';
diff --git a/webui/src/pages/bug/Timeline.tsx b/webui/src/pages/bug/Timeline.tsx
index 60459a53..fc88edd7 100644
--- a/webui/src/pages/bug/Timeline.tsx
+++ b/webui/src/pages/bug/Timeline.tsx
@@ -1,6 +1,4 @@
-import React from 'react';
-
-import { makeStyles } from '@material-ui/core/styles';
+import makeStyles from '@mui/styles/makeStyles';
import { BugFragment } from './Bug.generated';
import LabelChange from './LabelChange';
diff --git a/webui/src/pages/bug/TimelineQuery.tsx b/webui/src/pages/bug/TimelineQuery.tsx
index d66c665b..ab9e4cd6 100644
--- a/webui/src/pages/bug/TimelineQuery.tsx
+++ b/webui/src/pages/bug/TimelineQuery.tsx
@@ -1,6 +1,4 @@
-import React from 'react';
-
-import CircularProgress from '@material-ui/core/CircularProgress';
+import CircularProgress from '@mui/material/CircularProgress';
import { BugFragment } from './Bug.generated';
import Timeline from './Timeline';
diff --git a/webui/src/pages/bug/labels/LabelMenu.tsx b/webui/src/pages/bug/labels/LabelMenu.tsx
index 645f472c..909068fb 100644
--- a/webui/src/pages/bug/labels/LabelMenu.tsx
+++ b/webui/src/pages/bug/labels/LabelMenu.tsx
@@ -1,13 +1,14 @@
-import React, { useEffect, useRef, useState } from 'react';
-
-import { IconButton } from '@material-ui/core';
-import Menu from '@material-ui/core/Menu';
-import MenuItem from '@material-ui/core/MenuItem';
-import TextField from '@material-ui/core/TextField';
-import { makeStyles, withStyles } from '@material-ui/core/styles';
-import { darken } from '@material-ui/core/styles/colorManipulator';
-import CheckIcon from '@material-ui/icons/Check';
-import SettingsIcon from '@material-ui/icons/Settings';
+import CheckIcon from '@mui/icons-material/Check';
+import SettingsIcon from '@mui/icons-material/Settings';
+import { IconButton } from '@mui/material';
+import Menu from '@mui/material/Menu';
+import MenuItem from '@mui/material/MenuItem';
+import TextField from '@mui/material/TextField';
+import { darken } from '@mui/material/styles';
+import makeStyles from '@mui/styles/makeStyles';
+import withStyles from '@mui/styles/withStyles';
+import * as React from 'react';
+import { useEffect, useRef, useState } from 'react';
import { Color } from '../../../gqlTypes';
import {
@@ -108,7 +109,7 @@ function FilterDropdown({
const [open, setOpen] = useState(false);
const [filter, setFilter] = useState<string>('');
const buttonRef = useRef<HTMLButtonElement>(null);
- const searchRef = useRef<HTMLButtonElement>(null);
+ const searchRef = useRef<HTMLInputElement>(null);
const classes = useStyles({ active: false });
useEffect(() => {
@@ -124,6 +125,7 @@ function FilterDropdown({
onClick={() => setOpen(!open)}
className={classes.gearBtn}
disableRipple
+ size="large"
>
<SettingsIcon fontSize={'small'} />
</IconButton>
@@ -131,8 +133,6 @@ function FilterDropdown({
<Menu
className={classes.menu}
- getContentAnchorEl={null}
- ref={searchRef}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'left',
@@ -146,7 +146,6 @@ function FilterDropdown({
setOpen(false);
onClose();
}}
- onExited={() => setFilter('')}
anchorEl={buttonRef.current}
PaperProps={{
style: {
@@ -154,9 +153,13 @@ function FilterDropdown({
width: '25ch',
},
}}
+ TransitionProps={{
+ onExited: () => setFilter(''),
+ }}
>
{hasFilter && (
<CustomTextField
+ inputRef={searchRef}
onChange={(e) => {
const { value } = e.target;
setFilter(value);
diff --git a/webui/src/pages/bug/labels/SetLabel.graphql b/webui/src/pages/bug/labels/SetLabel.graphql
index 44dfae11..6f4ad510 100644
--- a/webui/src/pages/bug/labels/SetLabel.graphql
+++ b/webui/src/pages/bug/labels/SetLabel.graphql
@@ -1,13 +1,19 @@
mutation SetLabel($input: ChangeLabelInput) {
- changeLabels(input: $input) {
- results{
- status,
- label{
- name,
- color{R},
- color{G},
- color{B}
- }
+ changeLabels(input: $input) {
+ results {
+ status
+ label {
+ name
+ color {
+ R
}
+ color {
+ G
+ }
+ color {
+ B
+ }
+ }
}
+ }
}