Skip to content

Commit

Permalink
Merge pull request #554 from sboleyn/master
Browse files Browse the repository at this point in the history
MUI V5 Migration
  • Loading branch information
sboleyn authored Nov 17, 2023
2 parents ceda13e + 3d020e7 commit 14aa302
Show file tree
Hide file tree
Showing 395 changed files with 3,265 additions and 2,363 deletions.
48 changes: 25 additions & 23 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from "react";

import CyVerseAnnouncer from "components/announcer/CyVerseAnnouncer";
import { ThemeProvider } from "@material-ui/core/styles";
import { ThemeProvider, StyledEngineProvider } from "@mui/material/styles";

import theme from "../src/components/theme/default";

Expand Down Expand Up @@ -78,28 +78,30 @@ addDecorator((storyFn, context) => withConsole()(storyFn)(context));

export const decorators = [
(Story) => (
<ThemeProvider theme={theme}>
<ConfigProvider>
<MockConfig />
<UserProfileProvider>
<QueryClientProvider client={queryClient}>
<MockUserProfile />
<BootstrapInfoProvider>
<MockBootstrapInfo />

<I18nProviderWrapper>
<BagInfoProvider>
<MockBagInfo />
{Story()}
</BagInfoProvider>
</I18nProviderWrapper>

<CyVerseAnnouncer />
</BootstrapInfoProvider>
</QueryClientProvider>
</UserProfileProvider>
</ConfigProvider>
</ThemeProvider>
<StyledEngineProvider injectFirst>
<ThemeProvider theme={theme}>
<ConfigProvider>
<MockConfig />
<UserProfileProvider>
<QueryClientProvider client={queryClient}>
<MockUserProfile />
<BootstrapInfoProvider>
<MockBootstrapInfo />

<I18nProviderWrapper>
<BagInfoProvider>
<MockBagInfo />
{Story()}
</BagInfoProvider>
</I18nProviderWrapper>

<CyVerseAnnouncer />
</BootstrapInfoProvider>
</QueryClientProvider>
</UserProfileProvider>
</ConfigProvider>
</ThemeProvider>
</StyledEngineProvider>
),
];
export const parameters = {
Expand Down
1,624 changes: 1,133 additions & 491 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.7.2",
"@date-fns/upgrade": "^1.0.3",
"@material-ui/core": "^4.12.1",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.60",
"@material-ui/styles": "^4.11.4",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.9",
"@mui/lab": "^5.0.0-alpha.152",
"@mui/material": "^5.14.9",
"@mui/styles": "^5.14.9",
"@next/bundle-analyzer": "^12.3.4",
"@opentelemetry/api": "^1.0.4",
"@opentelemetry/exporter-jaeger": "^1.0.1",
Expand Down
7 changes: 6 additions & 1 deletion src/__tests__/analyses.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { AnalysesTableViewTest } from "../../stories/analyses/TableView.stories"
import { ConfigProvider } from "contexts/config";
import { I18nProviderWrapper } from "__mocks__/i18nProviderWrapper";
import { RQWrapper } from "../__mocks__/RQWrapper";

import { ThemeProvider } from "@mui/material/styles";
import theme from "components/theme/default";
beforeEach(() => {
mockAxios.reset();
});
Expand All @@ -19,7 +22,9 @@ test("renders Analyses Listing Table without crashing", () => {
<RQWrapper>
<I18nProviderWrapper>
<ConfigProvider>
<AnalysesTableViewTest />
<ThemeProvider theme={theme}>
<AnalysesTableViewTest />
</ThemeProvider>
</ConfigProvider>
</I18nProviderWrapper>
</RQWrapper>
Expand Down
7 changes: 6 additions & 1 deletion src/__tests__/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { UserProfileProvider } from "contexts/userProfile";
import { I18nProviderWrapper } from "__mocks__/i18nProviderWrapper";
import { RQWrapper } from "../__mocks__/RQWrapper";

import { ThemeProvider } from "@mui/material/styles";
import theme from "components/theme/default";

beforeEach(() => {
mockAxios.reset();
});
Expand All @@ -20,7 +23,9 @@ test("Collection view renders", () => {
<RQWrapper>
<UserProfileProvider>
<I18nProviderWrapper>
<View />
<ThemeProvider theme={theme}>
<View />
</ThemeProvider>
</I18nProviderWrapper>
</UserProfileProvider>
</RQWrapper>
Expand Down
7 changes: 6 additions & 1 deletion src/__tests__/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ import { I18nProviderWrapper } from "__mocks__/i18nProviderWrapper";
import { ConfigProvider } from "../contexts/config";
import { RQWrapper } from "../__mocks__/RQWrapper";

import { ThemeProvider } from "@mui/material/styles";
import theme from "components/theme/default";

beforeAll(async () => {
await preloadAll();
});

const TestProviderWrapper = ({ children }) => (
<RQWrapper>
<I18nProviderWrapper>
<ConfigProvider>{children}</ConfigProvider>
<ThemeProvider theme={theme}>
<ConfigProvider>{children}</ConfigProvider>
</ThemeProvider>
</I18nProviderWrapper>
</RQWrapper>
);
Expand Down
6 changes: 5 additions & 1 deletion src/__tests__/globalSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ import { I18nProviderWrapper } from "__mocks__/i18nProviderWrapper";
import { UserProfileProvider } from "../contexts/userProfile";
import { RQWrapper } from "../__mocks__/RQWrapper";
import { ConfigProvider } from "contexts/config";
import { ThemeProvider } from "@mui/material/styles";
import theme from "components/theme/default";

test("Search field renders", () => {
const component = renderer.create(
<RQWrapper>
<I18nProviderWrapper>
<UserProfileProvider>
<ConfigProvider>
<SearchField />
<ThemeProvider theme={theme}>
<SearchField />
</ThemeProvider>
</ConfigProvider>
</UserProfileProvider>
</I18nProviderWrapper>
Expand Down
9 changes: 8 additions & 1 deletion src/__tests__/rate.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import React from "react";
import ReactDOM from "react-dom";
import { RatingTest } from "../../stories/base/Rate.stories";
import { ThemeProvider } from "@mui/material/styles";
import theme from "components/theme/default";

it("renders rate without crashing", () => {
const div = document.createElement("div");
ReactDOM.render(<RatingTest />, div);
ReactDOM.render(
<ThemeProvider theme={theme}>
<RatingTest />
</ThemeProvider>,
div
);
ReactDOM.unmountComponentAtNode(div);
});
7 changes: 6 additions & 1 deletion src/__tests__/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import { EditAddonTest } from "../../stories/subscriptions/EditAddon.stories";
import { mockAxios } from "../../stories/axiosMock";
import { RQWrapper } from "../__mocks__/RQWrapper";

import { ThemeProvider } from "@mui/material/styles";
import theme from "components/theme/default";

beforeEach(() => {
mockAxios.reset();
});
Expand All @@ -31,7 +34,9 @@ const TestProviderWrapper = ({ children }) => (
<RQWrapper>
<I18nProviderWrapper>
<ConfigProvider>
<UserProfileProvider>{children}</UserProfileProvider>
<ThemeProvider theme={theme}>
<UserProfileProvider>{children}</UserProfileProvider>
</ThemeProvider>
</ConfigProvider>
</I18nProviderWrapper>
</RQWrapper>
Expand Down
10 changes: 8 additions & 2 deletions src/__tests__/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { I18nProviderWrapper } from "__mocks__/i18nProviderWrapper";
import { getAllPrivileges, getPrivilegeUpdates } from "components/teams/util";
import Privilege from "components/models/Privilege";
import { RQWrapper } from "../__mocks__/RQWrapper";
import { ThemeProvider } from "@mui/material/styles";
import theme from "components/theme/default";

beforeEach(() => {
mockAxios.reset();
Expand All @@ -25,7 +27,9 @@ test("Team view renders", () => {
<RQWrapper>
<UserProfileProvider>
<I18nProviderWrapper>
<View />
<ThemeProvider theme={theme}>
<View />
</ThemeProvider>
</I18nProviderWrapper>
</UserProfileProvider>
</RQWrapper>
Expand All @@ -38,7 +42,9 @@ test("Team search results renders", () => {
<RQWrapper>
<UserProfileProvider>
<I18nProviderWrapper>
<SearchResults />
<ThemeProvider theme={theme}>
<SearchResults />
</ThemeProvider>
</I18nProviderWrapper>
</UserProfileProvider>
</RQWrapper>
Expand Down
2 changes: 1 addition & 1 deletion src/components/analyses/AnalysisCommentDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
DialogContent,
DialogTitle,
InputAdornment,
} from "@material-ui/core";
} from "@mui/material";

function AnalysisCommentDialog(props) {
const {
Expand Down
4 changes: 2 additions & 2 deletions src/components/analyses/AnalysisStatusIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from "react";

import analysisStatus from "components/models/analysisStatus";
import { Avatar, useTheme } from "@material-ui/core";
import { Avatar, useTheme } from "@mui/material";
import palette from "components/theme/default/CyVersePalette";

import {
Expand All @@ -16,7 +16,7 @@ import {
Done as CompletedIcon,
Cancel as CancelledIcon,
Error as FailedIcon,
} from "@material-ui/icons";
} from "@mui/icons-material";

export default function AnalysisStatusIcon({ status }) {
const theme = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion src/components/analyses/PendingTerminationDlg.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from "react";

import buildID from "components/utils/DebugIDUtil";
import { Button, Typography } from "@material-ui/core";
import { Button, Typography } from "@mui/material";

import DEDialog from "components/utils/DEDialog";
import { useTranslation } from "i18n";
Expand Down
2 changes: 1 addition & 1 deletion src/components/analyses/RenameAnalysisDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
DialogContent,
DialogTitle,
InputAdornment,
} from "@material-ui/core";
} from "@mui/material";

function RenameAnalysisDialog(props) {
const {
Expand Down
5 changes: 3 additions & 2 deletions src/components/analyses/ShareWithSupportDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
RadioGroup,
TextField,
Typography,
} from "@material-ui/core";
} from "@mui/material";

const InfoGridValue = (props) => <Typography variant="body2" {...props} />;

Expand Down Expand Up @@ -98,7 +98,7 @@ function CompletedStateCondition({ outputCondition, handleConditionChange }) {
const { t } = useTranslation("analyses");

return (
<FormControl component="fieldset">
<FormControl variant="standard" component="fieldset">
<FormLabel component="legend">
{t("statusHelpOutputConditionHeader")}
</FormLabel>
Expand Down Expand Up @@ -335,6 +335,7 @@ function RunningStateSupport(props) {
event.preventDefault();
intercomShow();
}}
underline="hover"
/>
),
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/analyses/TerminateAnalysisDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from "react";

import buildID from "components/utils/DebugIDUtil";
import { Button, Typography } from "@material-ui/core";
import { Button, Typography } from "@mui/material";

import { groupBy } from "common/functions";
import DEDialog from "components/utils/DEDialog";
Expand Down
7 changes: 4 additions & 3 deletions src/components/analyses/ViceLogsViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import {
FormGroup,
Switch,
Toolbar,
makeStyles,
} from "@material-ui/core";
} from "@mui/material";

import RefreshIcon from "@material-ui/icons/Refresh";
import makeStyles from "@mui/styles/makeStyles";

import RefreshIcon from "@mui/icons-material/Refresh";

const useStyles = makeStyles((theme) => ({
toolbarItems: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/analyses/details/DetailsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getHost } from "components/utils/getHost";
import GridLabelValue from "components/utils/GridLabelValue";
import { useConfig } from "contexts/config";

import { Grid, Typography, useTheme } from "@material-ui/core";
import { Grid, Typography, useTheme } from "@mui/material";

const InfoGridValue = (props) => <Typography variant="body2" {...props} />;

Expand Down
10 changes: 5 additions & 5 deletions src/components/analyses/details/Drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import {

import buildID from "components/utils/DebugIDUtil";

import { Drawer, Typography } from "@material-ui/core";
import { Drawer, Typography } from "@mui/material";

import { makeStyles } from "@material-ui/core/styles";
import makeStyles from "@mui/styles/makeStyles";

const TABS = {
analysisInfo: "ANALYSIS INFORMATION",
Expand All @@ -34,13 +34,13 @@ const TABS = {

const useStyles = makeStyles((theme) => ({
drawerPaper: {
[theme.breakpoints.up("lg")]: {
[theme.breakpoints.up("xl")]: {
maxWidth: "25%",
},
[theme.breakpoints.down("lg")]: {
[theme.breakpoints.down("xl")]: {
maxWidth: "50%",
},
[theme.breakpoints.down("sm")]: {
[theme.breakpoints.down("md")]: {
maxWidth: "90%",
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/analyses/details/InfoPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import {
ListItem,
ListItemText,
Divider,
makeStyles,
Typography,
} from "@material-ui/core";
import { ExpandMore as ExpandMoreIcon } from "@material-ui/icons";
} from "@mui/material";
import makeStyles from "@mui/styles/makeStyles";
import { ExpandMore as ExpandMoreIcon } from "@mui/icons-material";

const useStyles = makeStyles((theme) => ({
heading: {
color: theme.palette.info,
[theme.breakpoints.down("sm")]: {
[theme.breakpoints.down("md")]: {
maxWidth: 150,
textOverflow: "ellipsis",
whiteSpace: "nowrap",
Expand Down
2 changes: 1 addition & 1 deletion src/components/analyses/details/ParamsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
TableContainer,
TableRow,
Typography,
} from "@material-ui/core";
} from "@mui/material";
import ErrorTypographyWithDialog from "components/error/ErrorTypographyWithDialog";
import DETableHead from "components/table/DETableHead";
import TableLoading from "components/table/TableLoading";
Expand Down
Loading

0 comments on commit 14aa302

Please sign in to comment.