From 1d152888d0c153c47a50d8020ce673db53dc0ba1 Mon Sep 17 00:00:00 2001 From: Manuel Luypaert Date: Tue, 30 Jan 2024 18:31:23 +0000 Subject: [PATCH] Code changes to match material-ui v3 to v4 migration --- .../src/components/elements/AutocompleteChip.js | 2 +- .../elements/AutocompleteSuggestion.js | 2 +- client/src/components/elements/ErrorBoundary.js | 4 ++-- client/src/components/elements/NotFound.js | 8 ++++---- client/src/components/elements/Page/index.js | 4 ++-- .../src/components/elements/SnackbarContent.js | 2 +- client/src/components/elements/TextField.js | 2 +- .../src/components/elements/ValidationError.js | 6 +++--- client/src/components/elements/index.js | 2 +- client/src/containers/Authenticate/Login.js | 4 ++-- client/src/containers/Authenticate/Profile.js | 2 +- .../src/containers/Authenticate/ProfileButton.js | 2 +- client/src/containers/Entity/EntityCreate.js | 10 +++++----- client/src/containers/Entity/EntityDirectory.js | 6 +++--- client/src/containers/Entity/EntityNotFound.js | 2 +- client/src/containers/Entity/EntityProfile.js | 16 ++++++++-------- client/src/containers/Footer.js | 2 +- client/src/containers/Gene/GeneAutocomplete.js | 4 ++-- client/src/containers/Gene/GeneProfile.js | 4 ++-- client/src/containers/Header/Logo.js | 6 +++--- client/src/containers/Header/index.js | 8 ++++---- client/src/containers/Home/index.js | 4 ++-- client/src/containers/Search/SearchBox.js | 10 +++++----- 23 files changed, 56 insertions(+), 56 deletions(-) diff --git a/client/src/components/elements/AutocompleteChip.js b/client/src/components/elements/AutocompleteChip.js index 7bb6be07..2e82f3e8 100644 --- a/client/src/components/elements/AutocompleteChip.js +++ b/client/src/components/elements/AutocompleteChip.js @@ -28,7 +28,7 @@ const styles = (theme) => ({ wbId: { fontSize: '0.8em', display: 'inline-block', - padding: `0 ${theme.spacing.unit / 2}px`, + padding: `0 ${theme.spacing(0.5)}px`, }, }); diff --git a/client/src/components/elements/AutocompleteSuggestion.js b/client/src/components/elements/AutocompleteSuggestion.js index a8c56f97..a178faf8 100644 --- a/client/src/components/elements/AutocompleteSuggestion.js +++ b/client/src/components/elements/AutocompleteSuggestion.js @@ -55,7 +55,7 @@ const styles = (theme) => ({ wbId: { fontSize: '0.8em', display: 'inline-block', - padding: `0 ${theme.spacing.unit / 2}px`, + padding: `0 ${theme.spacing(0.5)}px`, }, }); diff --git a/client/src/components/elements/ErrorBoundary.js b/client/src/components/elements/ErrorBoundary.js index 5084ca01..a4791415 100644 --- a/client/src/components/elements/ErrorBoundary.js +++ b/client/src/components/elements/ErrorBoundary.js @@ -26,8 +26,8 @@ class ErrorBoundary extends React.Component { return ( - A problem occurred - + A problem occurred + Please let us know. diff --git a/client/src/components/elements/NotFound.js b/client/src/components/elements/NotFound.js index 3f5fc001..e3c0201f 100644 --- a/client/src/components/elements/NotFound.js +++ b/client/src/components/elements/NotFound.js @@ -7,7 +7,7 @@ class NotFound extends Component { const { classes } = this.props; return (
- + Not Found {this.props.children} @@ -25,12 +25,12 @@ const styles = (theme) => ({ display: 'flex', flexDirection: 'column', alignItems: 'center', - margin: theme.spacing.unit * 5, + margin: theme.spacing(5), [theme.breakpoints.down('sm')]: { - margin: `${theme.spacing.unit * 5}px 0`, + margin: `${theme.spacing(5)}px 0`, }, '& > *': { - marginBottom: theme.spacing.unit * 2, + marginBottom: theme.spacing(2), }, }, }); diff --git a/client/src/components/elements/Page/index.js b/client/src/components/elements/Page/index.js index 039f871b..e9790886 100644 --- a/client/src/components/elements/Page/index.js +++ b/client/src/components/elements/Page/index.js @@ -33,7 +33,7 @@ pageRight.propTypes = { export const Page = withStyles((theme) => ({ root: { display: 'flex', - margin: theme.spacing.unit * 4, + margin: theme.spacing(4), [theme.breakpoints.down('sm')]: { flexDirection: 'column', }, @@ -46,7 +46,7 @@ export const PageLeft = withStyles((theme) => ({ flex: '0 0 auto', [theme.breakpoints.down('sm')]: { width: `100%`, - marginBottom: theme.spacing.unit * 4, + marginBottom: theme.spacing(4), }, }, }))(pageLeft); diff --git a/client/src/components/elements/SnackbarContent.js b/client/src/components/elements/SnackbarContent.js index e522a6a2..316cd879 100644 --- a/client/src/components/elements/SnackbarContent.js +++ b/client/src/components/elements/SnackbarContent.js @@ -44,7 +44,7 @@ const styles = (theme) => ({ }, iconVariant: { opacity: 0.9, - marginRight: theme.spacing.unit, + marginRight: theme.spacing(1), }, message: { display: 'flex', diff --git a/client/src/components/elements/TextField.js b/client/src/components/elements/TextField.js index 869a7956..eb54eb2e 100644 --- a/client/src/components/elements/TextField.js +++ b/client/src/components/elements/TextField.js @@ -5,7 +5,7 @@ const TextField = (props) => ; const styles = (theme) => ({ root: { - margin: `${theme.spacing.unit}px ${theme.spacing.unit / 4}px`, + margin: `${theme.spacing(1)}px ${theme.spacing(0.25)}px`, // display: 'block', }, }); diff --git a/client/src/components/elements/ValidationError.js b/client/src/components/elements/ValidationError.js index ec6f2ea9..4e6b7846 100644 --- a/client/src/components/elements/ValidationError.js +++ b/client/src/components/elements/ValidationError.js @@ -90,7 +90,7 @@ ValidationError.propTypes = { const styles = (theme) => ({ root: { - margin: `${theme.spacing.unit * 4}px 0`, + margin: `${theme.spacing(4)}px 0`, backgroundColor: theme.palette.background.default, }, message: { @@ -98,12 +98,12 @@ const styles = (theme) => ({ }, problems: { color: theme.palette.error.main, - marginTop: theme.spacing.unit * -2, + marginTop: theme.spacing(-2), backgroundColor: theme.palette.background.paper, }, actions: {}, leftIcon: { - marginRight: theme.spacing.unit, + marginRight: theme.spacing(1), }, }); diff --git a/client/src/components/elements/index.js b/client/src/components/elements/index.js index aa35b728..2221f04d 100644 --- a/client/src/components/elements/index.js +++ b/client/src/components/elements/index.js @@ -69,7 +69,7 @@ export const Dialog = withMobileDialog()( withStyles((theme) => ({ paper: { minWidth: '50%', - marginTop: theme.spacing.unit * -10, + marginTop: theme.spacing(-10), [theme.breakpoints.down('sm')]: { marginTop: 0, }, diff --git a/client/src/containers/Authenticate/Login.js b/client/src/containers/Authenticate/Login.js index 421b1eef..a4e0ab65 100644 --- a/client/src/containers/Authenticate/Login.js +++ b/client/src/containers/Authenticate/Login.js @@ -42,8 +42,8 @@ const styles = (theme) => ({ }, errorMessage: { backgroundColor: 'rgba(255, 255, 255, 0.6)', - margin: theme.spacing.unit * 2, - padding: theme.spacing.unit * 4, + margin: theme.spacing(2), + padding: theme.spacing(4), color: theme.palette.error.main, textAlign: 'left', fontFamily: 'monospace', diff --git a/client/src/containers/Authenticate/Profile.js b/client/src/containers/Authenticate/Profile.js index ca3b8deb..61928e0f 100644 --- a/client/src/containers/Authenticate/Profile.js +++ b/client/src/containers/Authenticate/Profile.js @@ -31,7 +31,7 @@ const styles = (theme) => ({ alignItems: 'center', }, actions: { - margin: theme.spacing.unit * 4, + margin: theme.spacing(4), }, }); diff --git a/client/src/containers/Authenticate/ProfileButton.js b/client/src/containers/Authenticate/ProfileButton.js index 07ae63dc..3ce0d92b 100644 --- a/client/src/containers/Authenticate/ProfileButton.js +++ b/client/src/containers/Authenticate/ProfileButton.js @@ -26,7 +26,7 @@ const styles = (theme) => ({ textTransform: 'none', }, icon: { - marginRight: theme.spacing.unit, + marginRight: theme.spacing(1), }, }); diff --git a/client/src/containers/Entity/EntityCreate.js b/client/src/containers/Entity/EntityCreate.js index 52e9c067..5430fb59 100644 --- a/client/src/containers/Entity/EntityCreate.js +++ b/client/src/containers/Entity/EntityCreate.js @@ -51,7 +51,7 @@ class EntityCreate extends Component {
- + Add {entityType} @@ -104,7 +104,7 @@ const styles = (theme) => ({ flexDirection: 'column', width: 150, '& > *': { - marginBottom: theme.spacing.unit, + marginBottom: theme.spacing(1), }, [theme.breakpoints.down('sm')]: { width: '100%', @@ -112,12 +112,12 @@ const styles = (theme) => ({ }, }, actions: { - marginTop: theme.spacing.unit * 2, + marginTop: theme.spacing(2), '& > *': { - marginRight: theme.spacing.unit, + marginRight: theme.spacing(1), width: 150, [theme.breakpoints.down('xs')]: { - width: `calc(50% - ${theme.spacing.unit}px)`, + width: `calc(50% - ${theme.spacing(1)}px)`, }, }, }, diff --git a/client/src/containers/Entity/EntityDirectory.js b/client/src/containers/Entity/EntityDirectory.js index 61352b12..c4a8f02d 100644 --- a/client/src/containers/Entity/EntityDirectory.js +++ b/client/src/containers/Entity/EntityDirectory.js @@ -47,7 +47,7 @@ const EntityDirectory = (props) => { {/* tables and charts */} {
- + Recent activities {renderHistory()} @@ -74,7 +74,7 @@ const styles = (theme) => ({ display: 'flex', justifyContent: 'start', alignItems: 'center', - marginBottom: theme.spacing.unit * 6, + marginBottom: theme.spacing(6), [theme.breakpoints.down('xs')]: { flexDirection: 'column', }, @@ -85,7 +85,7 @@ const styles = (theme) => ({ }, }, search: { - marginTop: theme.spacing.unit * 2, + marginTop: theme.spacing(2), }, main: { display: 'flex', diff --git a/client/src/containers/Entity/EntityNotFound.js b/client/src/containers/Entity/EntityNotFound.js index aa9e44cb..75cf0d4c 100644 --- a/client/src/containers/Entity/EntityNotFound.js +++ b/client/src/containers/Entity/EntityNotFound.js @@ -36,7 +36,7 @@ const styles = (theme) => ({ flexDirection: 'column', width: 200, '& > *': { - marginBottom: theme.spacing.unit, + marginBottom: theme.spacing(1), }, [theme.breakpoints.down('sm')]: { width: '100%', diff --git a/client/src/containers/Entity/EntityProfile.js b/client/src/containers/Entity/EntityProfile.js index da65c253..c723f1a8 100644 --- a/client/src/containers/Entity/EntityProfile.js +++ b/client/src/containers/Entity/EntityProfile.js @@ -35,7 +35,7 @@ const OPERATION_RESURRECT = 'resurrect'; class EntityProfile extends Component { renderStatus({ data, entityType }) { return data['status'] !== 'live' ? ( - + {data['status']} ) : null; @@ -159,7 +159,7 @@ class EntityProfile extends Component { - + {entityType} {wbId}{' '}