Skip to content

Commit dbffc5f

Browse files
authored
Migrated Site Replication Pages (#3011)
- Improved & Simplified UI elements Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent f4a9420 commit dbffc5f

File tree

10 files changed

+471
-604
lines changed

10 files changed

+471
-604
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
PageLayout,
3333
RadioGroup,
3434
Switch,
35+
SectionTitle,
3536
} from "mds";
3637
import { k8sScalarUnitsExcluding } from "../../../../../common/utils";
3738
import { AppState, useAppDispatch } from "../../../../../store";
@@ -44,7 +45,6 @@ import {
4445
} from "../../../../../systemSlice";
4546
import InputUnitMenu from "../../../Common/FormComponents/InputUnitMenu/InputUnitMenu";
4647
import TooltipWrapper from "../../../Common/TooltipWrapper/TooltipWrapper";
47-
import SectionTitle from "../../../Common/SectionTitle";
4848
import {
4949
resetForm,
5050
setEnableObjectLocking,
@@ -277,7 +277,7 @@ const AddBucket = () => {
277277
<Box sx={{ margin: "10px 0" }}>
278278
<BucketNamingRules errorList={validationResult} />
279279
</Box>
280-
<SectionTitle>Features</SectionTitle>
280+
<SectionTitle separator>Features</SectionTitle>
281281
<Box sx={{ marginTop: 10 }}>
282282
{!distributedSetup && (
283283
<Fragment>

portal-ui/src/screens/Console/Configurations/SiteReplication/AddReplicationSites.tsx

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

1717
import React, { Fragment, useEffect, useState } from "react";
18-
import Grid from "@mui/material/Grid";
19-
import { Box, LinearProgress } from "@mui/material";
2018
import { useNavigate } from "react-router-dom";
21-
import { BackLink, Button, ClustersIcon, HelpBox, PageLayout } from "mds";
19+
import {
20+
BackLink,
21+
Button,
22+
ClustersIcon,
23+
HelpBox,
24+
PageLayout,
25+
Box,
26+
Grid,
27+
ProgressBar,
28+
InputLabel,
29+
SectionTitle,
30+
} from "mds";
2231
import useApi from "../../Common/Hooks/useApi";
2332
import { IAM_PAGES } from "../../../../common/SecureComponent/permissions";
24-
import SectionTitle from "../../Common/SectionTitle";
2533
import {
2634
setErrorSnackMessage,
2735
setHelpName,
@@ -58,17 +66,18 @@ const isEmptyValue = (value: string): boolean => {
5866
const TableHeader = () => {
5967
return (
6068
<React.Fragment>
61-
<Box
62-
sx={{
63-
fontSize: "14px",
64-
marginLeft: "5px",
65-
}}
66-
>
67-
Site Name
69+
<Box>
70+
<InputLabel>Site Name</InputLabel>
71+
</Box>
72+
<Box>
73+
<InputLabel>Endpoint {"*"}</InputLabel>
74+
</Box>
75+
<Box>
76+
<InputLabel>Access Key {"*"}</InputLabel>
77+
</Box>
78+
<Box>
79+
<InputLabel>Secret Key {"*"}</InputLabel>
6880
</Box>
69-
<Box sx={{ fontSize: "14px", marginLeft: "5px" }}>Endpoint {"*"}</Box>
70-
<Box sx={{ fontSize: "14px", marginLeft: "5px" }}>Access Key {"*"}</Box>
71-
<Box sx={{ fontSize: "14px", marginLeft: "5px" }}>Secret Key {"*"}</Box>
7281
<Box> </Box>
7382
</React.Fragment>
7483
);
@@ -272,10 +281,10 @@ const AddReplicationSites = () => {
272281
>
273282
<SiteTypeHeader title={"This Site"} />
274283
<Box
284+
withBorders
275285
sx={{
276286
display: "grid",
277287
gridTemplateColumns: ".8fr 1.2fr .8fr .8fr .2fr",
278-
border: "1px solid #eaeaea",
279288
padding: "15px",
280289
gap: "10px",
281290
maxHeight: "430px",
@@ -330,10 +339,10 @@ const AddReplicationSites = () => {
330339
>
331340
<SiteTypeHeader title={"Peer Sites"} />
332341
<Box
342+
withBorders
333343
sx={{
334344
display: "grid",
335345
gridTemplateColumns: ".8fr 1.2fr .8fr .8fr .2fr",
336-
border: "1px solid #eaeaea",
337346
padding: "15px",
338347
gap: "10px",
339348
maxHeight: "430px",
@@ -421,11 +430,11 @@ const AddReplicationSites = () => {
421430
}}
422431
>
423432
<Box>
424-
<SectionTitle icon={<ClustersIcon />}>
433+
<SectionTitle separator icon={<ClustersIcon />}>
425434
Add Sites for Replication
426435
</SectionTitle>
427436

428-
{isSiteInfoLoading || isAdding ? <LinearProgress /> : null}
437+
{isSiteInfoLoading || isAdding ? <ProgressBar /> : null}
429438

430439
<Box
431440
sx={{
@@ -526,17 +535,6 @@ const AddReplicationSites = () => {
526535
flexFlow: "column",
527536
fontSize: "14px",
528537
flex: "2",
529-
"& .step-number": {
530-
color: "#ffffff",
531-
height: "25px",
532-
width: "25px",
533-
background: "#081C42",
534-
marginRight: "10px",
535-
textAlign: "center",
536-
fontWeight: 600,
537-
borderRadius: "50%",
538-
},
539-
540538
"& li": {
541539
fontSize: "14px",
542540
display: "flex",
@@ -547,15 +545,6 @@ const AddReplicationSites = () => {
547545
"&.step-text": {
548546
fontWeight: 400,
549547
},
550-
"&:before": {
551-
content: "' '",
552-
height: "7px",
553-
width: "7px",
554-
backgroundColor: "#2781B0",
555-
marginRight: "10px",
556-
marginTop: "12px",
557-
flexShrink: 0,
558-
},
559548
},
560549
}}
561550
>

portal-ui/src/screens/Console/Configurations/SiteReplication/EditSiteEndPoint.tsx

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

1717
import React, { useState } from "react";
18-
import { Button, EditIcon } from "mds";
19-
import { Box, DialogContentText } from "@mui/material";
20-
import Grid from "@mui/material/Grid";
21-
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
18+
import { Box, Button, EditIcon, Grid, InputBox, InputLabel } from "mds";
2219
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
2320
import useApi from "../../Common/Hooks/useApi";
2421
import {
2522
setErrorSnackMessage,
2623
setSnackBarMessage,
2724
} from "../../../../systemSlice";
2825
import { useAppDispatch } from "../../../../store";
29-
import withStyles from "@mui/styles/withStyles";
30-
import { Theme } from "@mui/material/styles";
31-
import createStyles from "@mui/styles/createStyles";
32-
import {
33-
formFieldStyles,
34-
modalStyleUtils,
35-
spacingUtils,
36-
} from "../../Common/FormComponents/common/styleLibrary";
26+
import { modalStyleUtils } from "../../Common/FormComponents/common/styleLibrary";
27+
import styled from "styled-components";
28+
import get from "lodash/get";
29+
30+
const SiteEndpointContainer = styled.div(({ theme }) => ({
31+
"& .alertText": {
32+
color: get(theme, "signalColors.danger", "#C51B3F"),
33+
},
34+
}));
3735

38-
const styles = (theme: Theme) =>
39-
createStyles({
40-
...modalStyleUtils,
41-
...formFieldStyles,
42-
...spacingUtils,
43-
});
4436
const EditSiteEndPoint = ({
4537
editSite = {},
4638
onClose,
4739
onComplete,
48-
classes = {},
4940
}: {
5041
editSite: any;
5142
onClose: () => void;
5243
onComplete: () => void;
53-
classes: any;
5444
}) => {
5545
const dispatch = useAppDispatch();
5646
const [editEndPointName, setEditEndPointName] = useState<string>("");
@@ -99,7 +89,7 @@ const EditSiteEndPoint = ({
9989
titleIcon={<EditIcon />}
10090
onClose={onClose}
10191
>
102-
<DialogContentText>
92+
<SiteEndpointContainer>
10393
<Box
10494
sx={{
10595
display: "flex",
@@ -118,8 +108,8 @@ const EditSiteEndPoint = ({
118108
</Box>
119109

120110
<Grid item xs={12}>
121-
<Box sx={{ marginBottom: "5px" }}> New Endpoint:</Box>
122-
<InputBoxWrapper
111+
<InputLabel sx={{ marginBottom: 5 }}>New Endpoint:</InputLabel>
112+
<InputBox
123113
id="edit-rep-peer-endpoint"
124114
name="edit-rep-peer-endpoint"
125115
placeholder={"https://dr.minio-storage:9000"}
@@ -130,31 +120,32 @@ const EditSiteEndPoint = ({
130120
value={editEndPointName}
131121
/>
132122
</Grid>
133-
<Grid item xs={12} marginBottom={"15px"}>
134-
<Box
135-
sx={{
136-
fontStyle: "italic",
137-
display: "flex",
138-
alignItems: "center",
139-
fontSize: "12px",
140-
marginTop: 2,
141-
}}
142-
>
143-
<Box sx={{ fontWeight: 600 }}>Note:</Box>{" "}
144-
<Box sx={{ marginLeft: 1, color: "red" }}>
145-
Access Key and Secret Key should be same on the new site/endpoint.
146-
</Box>
147-
</Box>
123+
<Grid
124+
item
125+
xs={12}
126+
sx={{
127+
marginBottom: 15,
128+
fontStyle: "italic",
129+
display: "flex",
130+
alignItems: "center",
131+
fontSize: "12px",
132+
marginTop: 2,
133+
}}
134+
>
135+
<strong>Note:</strong>&nbsp;
136+
<span className={"alertText"}>
137+
Access Key and Secret Key should be same on the new site/endpoint.
138+
</span>
148139
</Grid>
149-
</DialogContentText>
140+
</SiteEndpointContainer>
150141

151-
<Grid item xs={12} className={classes.modalButtonBar}>
142+
<Grid item xs={12} sx={modalStyleUtils.modalButtonBar}>
152143
<Button
153144
id={"close"}
154145
type="button"
155146
variant="regular"
156147
onClick={onClose}
157-
label={"Close"}
148+
label={"Cancel"}
158149
/>
159150
<Button
160151
id={"update"}
@@ -168,4 +159,4 @@ const EditSiteEndPoint = ({
168159
</ModalWrapper>
169160
);
170161
};
171-
export default withStyles(styles)(EditSiteEndPoint);
162+
export default EditSiteEndPoint;

portal-ui/src/screens/Console/Configurations/SiteReplication/EntityReplicationLookup.tsx

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

1717
import React, { useState } from "react";
18-
import { Box, Grid } from "@mui/material";
19-
import { Button, ClustersIcon, Loader } from "mds";
20-
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper";
21-
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
18+
import {
19+
Box,
20+
breakPoints,
21+
Button,
22+
ClustersIcon,
23+
Grid,
24+
Loader,
25+
Select,
26+
InputBox,
27+
} from "mds";
2228
import useApi from "../../Common/Hooks/useApi";
2329
import { StatsResponseType } from "./SiteReplicationStatus";
2430
import BucketEntityStatus from "./LookupStatus/BucketEntityStatus";
@@ -67,10 +73,12 @@ const EntityReplicationLookup = () => {
6773
sx={{
6874
display: "grid",
6975
alignItems: "center",
70-
gridTemplateColumns: {
71-
md: ".7fr .9fr 1.2fr .3fr",
72-
sm: "1.2fr .7fr .7fr .3fr",
73-
xs: "1fr",
76+
gridTemplateColumns: ".7fr .9fr 1.2fr .3fr",
77+
[`@media (max-width: ${breakPoints.sm}px)`]: {
78+
gridTemplateColumns: "1fr",
79+
},
80+
[`@media (max-width: ${breakPoints.md}px)`]: {
81+
gridTemplateColumns: "1.2fr .7fr .7fr .3fr",
7482
},
7583
gap: "15px",
7684
}}
@@ -80,17 +88,17 @@ const EntityReplicationLookup = () => {
8088
</Box>
8189
<Box
8290
sx={{
83-
marginLeft: {
84-
md: "-25px",
85-
xs: "0px",
91+
marginLeft: -25,
92+
[`@media (max-width: ${breakPoints.sm}px)`]: {
93+
marginLeft: 0,
8694
},
8795
}}
8896
>
89-
<SelectWrapper
97+
<Select
9098
id="replicationEntityLookup"
9199
name="replicationEntityLookup"
92-
onChange={(e) => {
93-
setEntityType(e.target.value);
100+
onChange={(value) => {
101+
setEntityType(value);
94102
setStatsLoaded(false);
95103
}}
96104
label=""
@@ -122,7 +130,7 @@ const EntityReplicationLookup = () => {
122130
flex: 2,
123131
}}
124132
>
125-
<InputBoxWrapper
133+
<InputBox
126134
id="replicationLookupEntityValue"
127135
name="replicationLookupEntityValue"
128136
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
@@ -159,10 +167,12 @@ const EntityReplicationLookup = () => {
159167
<Grid
160168
item
161169
xs={12}
162-
display={"flex"}
163-
alignItems={"center"}
164-
justifyContent={"center"}
165-
marginTop={"45px"}
170+
sx={{
171+
display: "flex",
172+
alignItems: "center",
173+
justifyContent: "center",
174+
marginTop: 45,
175+
}}
166176
>
167177
<Loader style={{ width: 25, height: 25 }} />
168178
</Grid>

0 commit comments

Comments
 (0)