Skip to content

Commit d94af48

Browse files
author
Benjamin Perez
committed
Updated console to use React 17
1 parent 0749c87 commit d94af48

File tree

23 files changed

+781
-18690
lines changed

23 files changed

+781
-18690
lines changed

portal-ui/bindata_assetfs.go

Lines changed: 123 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/package-lock.json

Lines changed: 0 additions & 17878 deletions
This file was deleted.

portal-ui/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@types/jest": "24.0.23",
1313
"@types/lodash": "^4.14.149",
1414
"@types/node": "12.12.8",
15-
"@types/react": "16.9.11",
15+
"@types/react": "17.0.0",
1616
"@types/react-copy-to-clipboard": "^4.3.0",
1717
"@types/react-dom": "16.9.4",
1818
"@types/react-redux": "^7.1.5",
@@ -30,14 +30,14 @@
3030
"local-storage-fallback": "^4.1.1",
3131
"lodash": "^4.17.19",
3232
"moment": "^2.24.0",
33-
"react": "^16.13.1",
33+
"react": "17.0.0",
3434
"react-app-rewire-hot-loader": "^2.0.1",
3535
"react-app-rewired": "^2.1.6",
3636
"react-async-hook": "^3.6.1",
3737
"react-chartjs-2": "^2.9.0",
3838
"react-codemirror2": "^7.1.0",
3939
"react-copy-to-clipboard": "^5.0.2",
40-
"react-dom": "^16.12.0",
40+
"react-dom": "17.0.0",
4141
"react-hot-loader": "^4.13.0",
4242
"react-moment": "^0.9.7",
4343
"react-redux": "^7.1.3",
@@ -50,7 +50,6 @@
5050
"redux-thunk": "^2.3.0",
5151
"superagent": "^5.1.0",
5252
"typeface-roboto": "^0.0.75",
53-
"typescript": "3.6.4",
5453
"use-debounce": "^5.0.1",
5554
"websocket": "^1.0.31"
5655
},
@@ -77,6 +76,7 @@
7776
},
7877
"proxy": "http://localhost:9090/",
7978
"devDependencies": {
80-
"prettier": "^1.19.1"
79+
"prettier": "^1.19.1",
80+
"typescript": "^4.1.2"
8181
}
8282
}

portal-ui/src/common/Copyright.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import React from 'react'
1+
import React from "react";
22
import Typography from "@material-ui/core/Typography";
33
import Link from "@material-ui/core/Link";
44

55
export default function Copyright() {
6-
return (
7-
<Typography variant="body2" color="textSecondary" align="center">
8-
{'Copyright © '}
9-
<Link color="inherit" href="https://material-ui.com/">
6+
return (
7+
<Typography variant="body2" color="textSecondary" align="center">
8+
{"Copyright © "}
9+
<Link color="inherit" href="https://material-ui.com/">
1010
MinIO
11-
</Link>{' '}
12-
{new Date().getFullYear()}
13-
{'.'}
11+
</Link>{" "}
12+
{new Date().getFullYear()}
13+
{"."}
1414
</Typography>
15-
);
15+
);
1616
}

portal-ui/src/common/MinTablePaginationActions.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
createStyles,
2020
makeStyles,
2121
Theme,
22-
useTheme
22+
useTheme,
2323
} from "@material-ui/core/styles";
2424
import React from "react";
2525
import { IconButton } from "@material-ui/core";
@@ -31,8 +31,8 @@ const useStyles1 = makeStyles((theme: Theme) =>
3131
createStyles({
3232
root: {
3333
flexShrink: 0,
34-
marginLeft: theme.spacing(2.5)
35-
}
34+
marginLeft: theme.spacing(2.5),
35+
},
3636
})
3737
);
3838

portal-ui/src/common/Title.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
3-
import Typography from '@material-ui/core/Typography';
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import Typography from "@material-ui/core/Typography";
44

55
export default function Title(props: React.Props<any>) {
66
return (

portal-ui/src/icons/PermissionIcon.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,25 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import React from "react";
18-
import {SvgIcon} from "@material-ui/core";
18+
import { SvgIcon } from "@material-ui/core";
1919
class PermissionIcon extends React.Component {
20-
render() {
21-
return (<SvgIcon>
22-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 16">
23-
<title>ic_permissions</title>
24-
<g id="Layer_2" data-name="Layer 2">
25-
<g id="Layer_1-2" data-name="Layer 1">
26-
<polygon className="cls-1" points="14 16 7.035 12.13 0 16 0 0 14 0 14 16"/>
27-
</g>
28-
</g>
29-
</svg>
30-
</SvgIcon>)
31-
}
20+
render() {
21+
return (
22+
<SvgIcon>
23+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 16">
24+
<title>ic_permissions</title>
25+
<g id="Layer_2" data-name="Layer 2">
26+
<g id="Layer_1-2" data-name="Layer 1">
27+
<polygon
28+
className="cls-1"
29+
points="14 16 7.035 12.13 0 16 0 0 14 0 14 16"
30+
/>
31+
</g>
32+
</g>
33+
</svg>
34+
</SvgIcon>
35+
);
36+
}
3237
}
3338

3439
export default PermissionIcon;

portal-ui/src/screens/Console/Buckets/Buckets.tsx

Lines changed: 15 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -15,113 +15,33 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import React from "react";
18-
import {
19-
createStyles,
20-
StyledProps,
21-
Theme,
22-
withStyles,
23-
} from "@material-ui/core/styles";
18+
import { createStyles, Theme } from "@material-ui/core/styles";
2419

2520
import history from "../../../history";
26-
import {
27-
Route,
28-
RouteComponentProps,
29-
Router,
30-
Switch,
31-
withRouter,
32-
} from "react-router-dom";
21+
import { Route, Router, Switch, withRouter } from "react-router-dom";
3322
import { connect } from "react-redux";
3423
import { AppState } from "../../../store";
3524
import { setMenuOpen } from "../../../actions";
36-
import { ThemedComponentProps } from "@material-ui/core/styles/withTheme";
3725
import NotFoundPage from "../../NotFoundPage";
3826
import ListBuckets from "./ListBuckets/ListBuckets";
3927
import ViewBucket from "./ViewBucket/ViewBucket";
4028

41-
const styles = (theme: Theme) =>
42-
createStyles({
43-
root: {
44-
display: "flex",
45-
},
46-
toolbar: {
47-
background: theme.palette.background.default,
48-
color: "black",
49-
paddingRight: 24, // keep right padding when drawer closed
50-
},
51-
toolbarIcon: {
52-
display: "flex",
53-
alignItems: "center",
54-
justifyContent: "flex-end",
55-
padding: "0 8px",
56-
...theme.mixins.toolbar,
57-
},
58-
appBar: {
59-
zIndex: theme.zIndex.drawer + 1,
60-
transition: theme.transitions.create(["width", "margin"], {
61-
easing: theme.transitions.easing.sharp,
62-
duration: theme.transitions.duration.leavingScreen,
63-
}),
64-
},
65-
66-
menuButton: {
67-
marginRight: 36,
68-
},
69-
menuButtonHidden: {
70-
display: "none",
71-
},
72-
title: {
73-
flexGrow: 1,
74-
},
75-
appBarSpacer: {
76-
height: "5px",
77-
},
78-
content: {
79-
flexGrow: 1,
80-
height: "100vh",
81-
overflow: "auto",
82-
},
83-
container: {
84-
paddingTop: theme.spacing(4),
85-
paddingBottom: theme.spacing(4),
86-
},
87-
paper: {
88-
padding: theme.spacing(2),
89-
display: "flex",
90-
overflow: "auto",
91-
flexDirection: "column",
92-
},
93-
fixedHeight: {
94-
minHeight: 240,
95-
},
96-
});
97-
9829
const mapState = (state: AppState) => ({
9930
open: state.system.sidebarOpen,
10031
});
10132

10233
const connector = connect(mapState, { setMenuOpen });
10334

104-
interface BucketsProps {
105-
open: boolean;
106-
title: string;
107-
classes: any;
108-
setMenuOpen: typeof setMenuOpen;
109-
}
110-
111-
class Buckets extends React.Component<
112-
BucketsProps & RouteComponentProps & StyledProps & ThemedComponentProps
113-
> {
114-
render() {
115-
return (
116-
<Router history={history}>
117-
<Switch>
118-
<Route path="/buckets/:bucketName" component={ViewBucket} />
119-
<Route path="/" component={ListBuckets} />
120-
<Route component={NotFoundPage} />
121-
</Switch>
122-
</Router>
123-
);
124-
}
125-
}
126-
127-
export default withRouter(connector(withStyles(styles)(Buckets)));
35+
const Buckets = () => {
36+
return (
37+
<Router history={history}>
38+
<Switch>
39+
<Route path="/buckets/:bucketName" component={ViewBucket} />
40+
<Route path="/" component={ListBuckets} />
41+
<Route component={NotFoundPage} />
42+
</Switch>
43+
</Router>
44+
);
45+
};
46+
47+
export default withRouter(connector(Buckets));

portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/DeleteTagModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface IDeleteTagModal {
1919
currentTags: any;
2020
bucketName: string;
2121
versionId: string;
22-
selectedTag: [string, string];
22+
selectedTag: string[];
2323
onCloseAndUpdate: (refresh: boolean) => void;
2424
selectedObject: string;
2525
classes: any;

portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ObjectDetails/ObjectDetails.tsx

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const ObjectDetails = ({
160160
const [retentionModalOpen, setRetentionModalOpen] = useState<boolean>(false);
161161
const [tagModalOpen, setTagModalOpen] = useState<boolean>(false);
162162
const [deleteTagModalOpen, setDeleteTagModalOpen] = useState<boolean>(false);
163-
const [selectedTag, setSelectedTag] = useState<[string, string]>(["", ""]);
163+
const [selectedTag, setSelectedTag] = useState<string[]>(["", ""]);
164164
const [legalholdOpen, setLegalholdOpen] = useState<boolean>(false);
165165
const [actualInfo, setActualInfo] = useState<IFileInfo>(emptyFile);
166166
const [versions, setVersions] = useState<IFileInfo[]>([]);
@@ -431,25 +431,26 @@ const ObjectDetails = ({
431431
</Grid>
432432
<Grid item xs={12} className={classes.tagsContainer}>
433433
<div className={classes.tagText}>Tags:</div>
434-
{tagKeys.map((tagKey, index) => {
435-
const tag = get(actualInfo, `tags.${tagKey}`, "");
436-
if (tag !== "") {
437-
return (
438-
<Chip
439-
key={`chip-${index}`}
440-
className={classes.tag}
441-
size="small"
442-
label={`${tagKey} : ${tag}`}
443-
color="primary"
444-
deleteIcon={<CloseIcon />}
445-
onDelete={() => {
446-
deleteTag(tagKey, tag);
447-
}}
448-
/>
449-
);
450-
}
451-
return null;
452-
})}
434+
{tagKeys &&
435+
tagKeys.map((tagKey, index) => {
436+
const tag = get(actualInfo, `tags.${tagKey}`, "");
437+
if (tag !== "") {
438+
return (
439+
<Chip
440+
key={`chip-${index}`}
441+
className={classes.tag}
442+
size="small"
443+
label={`${tagKey} : ${tag}`}
444+
color="primary"
445+
deleteIcon={<CloseIcon />}
446+
onDelete={() => {
447+
deleteTag(tagKey, tag);
448+
}}
449+
/>
450+
);
451+
}
452+
return null;
453+
})}
453454
<Chip
454455
className={classes.tag}
455456
icon={<AddIcon />}

0 commit comments

Comments
 (0)