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

Updates material-ui and react npm libraries #630

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
334 changes: 179 additions & 155 deletions frontend/package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^3.1.0",
"@material-ui/core": "^3.8.1",
"@material-ui/icons": "^3.0.1",
"@types/js-yaml": "^3.11.2",
"codemirror": "^5.40.2",
Expand All @@ -12,10 +12,11 @@
"dagre": "^0.8.2",
"http-proxy-middleware": "^0.19.0",
"immer": "^1.7.4",
"jss": "^10.0.0-alpha.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we using jss?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is a workaround for mui/material-ui#14040. Once that issue is fixed, we should be able to remove this direct dep

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah interesting.
You can consider using an older version (e.g. 3.7.x) that moves us very close to being updated without needing this hack. Keep in mind that even with the latest, we'll be outdated again in just a week or two. Up to you tho.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set it to 3.7.1 so we don't need the workaround, but we'll need to remember to update it in the future

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. It's good to update all of our dependencies every now and then if the update is cheap.

"js-yaml": "^3.12.0",
"portable-fetch": "^3.0.0",
"re-resizable": "^4.9.0",
"react": "^16.5.2",
"react": "^16.7.0",
"react-codemirror2": "^5.1.0",
"react-dom": "^16.5.2",
"react-dropzone": "^5.1.0",
Expand Down Expand Up @@ -60,7 +61,7 @@
"@types/js-yaml": "^3.11.2",
"@types/lodash": "^4.14.117",
"@types/node": "^10.10.1",
"@types/react": "^16.4.14",
"@types/react": "^16.7.18",
"@types/react-dom": "^16.0.7",
"@types/react-router-dom": "^4.3.1",
"@types/react-test-renderer": "^16.0.2",
Expand Down
6 changes: 3 additions & 3 deletions frontend/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions frontend/src/Css.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ const palette = {
export const theme = createMuiTheme({
overrides: {
MuiButton: {
disabled: {
backgroundColor: 'initial',
},
flat: {
fontSize: fontsize.base,
fontWeight: 'bold',
Expand All @@ -105,6 +102,9 @@ export const theme = createMuiTheme({
color: color.theme,
},
root: {
'&$disabled': {
backgroundColor: 'initial',
},
color: color.theme,
marginRight: 10,
padding: '0 8px'
Expand All @@ -130,11 +130,11 @@ export const theme = createMuiTheme({
marginLeft: 0,
marginTop: 0,
},
focused: {
marginLeft: 0,
marginTop: 0,
},
root: {
'&$focused': {
marginLeft: 0,
marginTop: 0,
},
fontSize: fontsize.base,
marginLeft: 5,
marginTop: -8,
Expand Down Expand Up @@ -167,6 +167,7 @@ export const theme = createMuiTheme({
typography: {
fontFamily: fonts.main,
fontSize: fontsize.base + ' !important' as any,
useNextVariants: true,
},
});

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/atoms/Input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ describe('Input', () => {
const value = 'some input value';

it('renders with the right styles by default', () => {
const tree = shallow(<Input onChange={handleChange('fieldname')} value={value} />);
const tree = shallow(<Input onChange={handleChange('fieldname')} value={value} variant='outlined' />);
expect(toJson(tree)).toMatchSnapshot();
});

it('accepts height and width as prop overrides', () => {
const tree = shallow(<Input height={123} width={456} onChange={handleChange('fieldname')} value={value} />);
const tree = shallow(<Input height={123} width={456} onChange={handleChange('fieldname')} value={value} variant='outlined' />);
expect(toJson(tree)).toMatchSnapshot();
});
});
8 changes: 4 additions & 4 deletions frontend/src/atoms/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
*/

import * as React from 'react';
import TextField, { TextFieldProps } from '@material-ui/core/TextField';
import TextField, { OutlinedTextFieldProps } from '@material-ui/core/TextField';
import { commonCss } from '../Css';

interface InputProps extends TextFieldProps {
interface InputProps extends OutlinedTextFieldProps {
height?: number | string;
width?: number;
}

export default (props: InputProps) => {
const { height, width, ...rest } = props;
const { height, variant, width, ...rest } = props;
return (
<TextField variant='outlined' className={commonCss.textField} spellCheck={false}
<TextField variant={variant} className={commonCss.textField} spellCheck={false}
style={{
height: !!props.multiline ? 'auto' : (height || 40),
maxWidth: 600,
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/atoms/__snapshots__/BusyButton.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`BusyButton renders a primary outlined buton 1`] = `
className="MuiButtonBase-root-27 MuiButton-root-1 MuiButton-text-3 MuiButton-textPrimary-4 MuiButton-flat-6 MuiButton-flatPrimary-7 root"
disabled={false}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
Expand Down Expand Up @@ -35,6 +36,7 @@ exports[`BusyButton renders disabled 1`] = `
className="MuiButtonBase-root-27 MuiButtonBase-disabled-28 MuiButton-root-1 MuiButton-text-3 MuiButton-textSecondary-5 MuiButton-flat-6 MuiButton-flatSecondary-8 MuiButton-disabled-21 root"
disabled={true}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
Expand Down Expand Up @@ -78,6 +80,7 @@ exports[`BusyButton renders with a title and icon 1`] = `
className="MuiButtonBase-root-27 MuiButton-root-1 MuiButton-text-3 MuiButton-textSecondary-5 MuiButton-flat-6 MuiButton-flatSecondary-8 root"
disabled={false}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
Expand Down Expand Up @@ -124,6 +127,7 @@ exports[`BusyButton renders with a title and icon, and busy 1`] = `
className="MuiButtonBase-root-27 MuiButtonBase-disabled-28 MuiButton-root-1 MuiButton-text-3 MuiButton-textSecondary-5 MuiButton-flat-6 MuiButton-flatSecondary-8 MuiButton-disabled-21 root rootBusy"
disabled={true}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
Expand Down Expand Up @@ -192,6 +196,7 @@ exports[`BusyButton renders with just a title 1`] = `
className="MuiButtonBase-root-27 MuiButton-root-1 MuiButton-text-3 MuiButton-textSecondary-5 MuiButton-flat-6 MuiButton-flatSecondary-8 root"
disabled={false}
onBlur={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
Expand Down
116 changes: 64 additions & 52 deletions frontend/src/atoms/__snapshots__/MD2Tabs.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ exports[`Input gracefully handles an out of bound selectedTab value 1`] = `
disabled={false}
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
Expand All @@ -130,37 +131,42 @@ exports[`Input gracefully handles an out of bound selectedTab value 1`] = `
tab1
</span>
</span>
<WithStyles(TouchRipple)
center={false}
innerRef={[Function]}
<NoSsr
defer={false}
fallback={null}
>
<TouchRipple
<WithStyles(TouchRipple)
center={false}
classes={
Object {
"child": "MuiTouchRipple-child-34",
"childLeaving": "MuiTouchRipple-childLeaving-35",
"childPulsate": "MuiTouchRipple-childPulsate-36",
"ripple": "MuiTouchRipple-ripple-31",
"ripplePulsate": "MuiTouchRipple-ripplePulsate-33",
"rippleVisible": "MuiTouchRipple-rippleVisible-32",
"root": "MuiTouchRipple-root-30",
}
}
innerRef={[Function]}
>
<TransitionGroup
childFactory={[Function]}
className="MuiTouchRipple-root-30"
component="span"
enter={true}
exit={true}
<TouchRipple
center={false}
classes={
Object {
"child": "MuiTouchRipple-child-34",
"childLeaving": "MuiTouchRipple-childLeaving-35",
"childPulsate": "MuiTouchRipple-childPulsate-36",
"ripple": "MuiTouchRipple-ripple-31",
"ripplePulsate": "MuiTouchRipple-ripplePulsate-33",
"rippleVisible": "MuiTouchRipple-rippleVisible-32",
"root": "MuiTouchRipple-root-30",
}
}
>
<span
<TransitionGroup
childFactory={[Function]}
className="MuiTouchRipple-root-30"
/>
</TransitionGroup>
</TouchRipple>
</WithStyles(TouchRipple)>
component="span"
enter={true}
exit={true}
>
<span
className="MuiTouchRipple-root-30"
/>
</TransitionGroup>
</TouchRipple>
</WithStyles(TouchRipple)>
</NoSsr>
</button>
</ButtonBase>
</WithStyles(ButtonBase)>
Expand Down Expand Up @@ -248,6 +254,7 @@ exports[`Input gracefully handles an out of bound selectedTab value 1`] = `
disabled={false}
onBlur={[Function]}
onClick={[Function]}
onContextMenu={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
Expand All @@ -267,37 +274,42 @@ exports[`Input gracefully handles an out of bound selectedTab value 1`] = `
tab2
</span>
</span>
<WithStyles(TouchRipple)
center={false}
innerRef={[Function]}
<NoSsr
defer={false}
fallback={null}
>
<TouchRipple
<WithStyles(TouchRipple)
center={false}
classes={
Object {
"child": "MuiTouchRipple-child-34",
"childLeaving": "MuiTouchRipple-childLeaving-35",
"childPulsate": "MuiTouchRipple-childPulsate-36",
"ripple": "MuiTouchRipple-ripple-31",
"ripplePulsate": "MuiTouchRipple-ripplePulsate-33",
"rippleVisible": "MuiTouchRipple-rippleVisible-32",
"root": "MuiTouchRipple-root-30",
}
}
innerRef={[Function]}
>
<TransitionGroup
childFactory={[Function]}
className="MuiTouchRipple-root-30"
component="span"
enter={true}
exit={true}
<TouchRipple
center={false}
classes={
Object {
"child": "MuiTouchRipple-child-34",
"childLeaving": "MuiTouchRipple-childLeaving-35",
"childPulsate": "MuiTouchRipple-childPulsate-36",
"ripple": "MuiTouchRipple-ripple-31",
"ripplePulsate": "MuiTouchRipple-ripplePulsate-33",
"rippleVisible": "MuiTouchRipple-rippleVisible-32",
"root": "MuiTouchRipple-root-30",
}
}
>
<span
<TransitionGroup
childFactory={[Function]}
className="MuiTouchRipple-root-30"
/>
</TransitionGroup>
</TouchRipple>
</WithStyles(TouchRipple)>
component="span"
enter={true}
exit={true}
>
<span
className="MuiTouchRipple-root-30"
/>
</TransitionGroup>
</TouchRipple>
</WithStyles(TouchRipple)>
</NoSsr>
</button>
</ButtonBase>
</WithStyles(ButtonBase)>
Expand Down
Loading