Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MUI V5 Migration #554

Merged
merged 26 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
37c04f4
Update MUI dependencies
sboleyn Sep 15, 2023
de1548b
Run preset-safe codemode to migrate to MUI v5
sboleyn Sep 21, 2023
890c7ce
Add elevation prop to MUI AppBar with variant outlined
sboleyn Oct 5, 2023
dbcf23d
Update breakpoint for dotmenu icon only
sboleyn Oct 17, 2023
d927a79
Remove deprecated Hidden component
sboleyn Oct 24, 2023
1f9de4a
Remove old @material-ui dependencies
sboleyn Oct 25, 2023
fef1a5d
Ran codemod to edit formcontrol variant default to standard if none i…
sboleyn Oct 26, 2023
92f6a41
Transform MUILink component by applying underline='hover'
sboleyn Oct 26, 2023
e79fdb3
Remove disableUnderline prop on OutlinedInput
sboleyn Oct 26, 2023
5360ba1
Fix missing scroll functionality on PageWrapper
sboleyn Oct 27, 2023
495bf06
Add padding to MUI Stepper
sboleyn Oct 30, 2023
0dd0323
Remove second onChange argument from MUI Switch
sboleyn Oct 30, 2023
6cd7bdb
Add sx prop to MUI Tab to handle background color and color when sele…
sboleyn Oct 31, 2023
b429d6a
Add size prop to MUI TextField in FormTextField
sboleyn Oct 31, 2023
d8bb178
Fix responsiveness of Type Field in Settings Webhooks
sboleyn Oct 31, 2023
024164d
Fix boolean assignment to className when turning on the running analy…
sboleyn Nov 1, 2023
d734ffb
Set DrawerItem ListItemIcon fontSize to medium when not nested
sboleyn Nov 1, 2023
b6684d5
Update @mui/lab dependency version
sboleyn Nov 14, 2023
eb3a4bf
Change MUI TextField and Select variants to outlined by setting to de…
sboleyn Nov 14, 2023
8a4e121
Remove second ThemeProvider wrapper from data jest test
sboleyn Nov 14, 2023
67260a5
Replace isXsDown with isSmDown
sboleyn Nov 15, 2023
9ad0da5
Fix bug hiding Refresh and Request Help between small and medium screens
sboleyn Nov 15, 2023
31071d4
Revert drawerPaper breakpoints
sboleyn Nov 15, 2023
0fad18b
Fix up(key) in drawerPaper breakpoints
sboleyn Nov 16, 2023
c12c5ab
Merge branch 'fix/drawer-paper-breakpoints'
sboleyn Nov 16, 2023
3d020e7
Fix drawer paper breakpoints again due to changes not being applied b…
sboleyn Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
11 changes: 9 additions & 2 deletions 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 All @@ -24,7 +29,9 @@ test("Data Table View renders", () => {
const component = renderer.create(
<RQWrapper>
<TestProviderWrapper>
<DataTableViewTest />
<ThemeProvider theme={theme}>
sboleyn marked this conversation as resolved.
Show resolved Hide resolved
<DataTableViewTest />
</ThemeProvider>
</TestProviderWrapper>
</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
8 changes: 4 additions & 4 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 @@ -37,10 +37,10 @@ const useStyles = makeStyles((theme) => ({
[theme.breakpoints.up("lg")]: {
psarando marked this conversation as resolved.
Show resolved Hide resolved
maxWidth: "25%",
},
[theme.breakpoints.down("lg")]: {
[theme.breakpoints.down("xl")]: {
maxWidth: "50%",
},
[theme.breakpoints.down("sm")]: {
[theme.breakpoints.down("md")]: {
sboleyn marked this conversation as resolved.
Show resolved Hide resolved
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
Loading
Loading