Skip to content

Commit 1b826e4

Browse files
bexsoftcesnietor
authored andcommitted
Components cleanup (minio#3079)
Removed old component wrappers and replaced them with their mds equivalent components: - InputBoxWrapper - CommentBoxWrapper - CheckboxWrapper - PredefinedList Signed-off-by: Benjamin Perez <[email protected]>
1 parent 31289bf commit 1b826e4

File tree

16 files changed

+228
-903
lines changed

16 files changed

+228
-903
lines changed

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

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

1717
import React, { useState } from "react";
18-
import { AddNewTagIcon, Button } from "mds";
19-
import { Grid } from "@mui/material";
18+
import { AddNewTagIcon, Box, Button, FormLayout, Grid, InputBox } from "mds";
2019
import { Theme } from "@mui/material/styles";
2120
import createStyles from "@mui/styles/createStyles";
2221
import withStyles from "@mui/styles/withStyles";
@@ -25,7 +24,6 @@ import {
2524
modalStyleUtils,
2625
spacingUtils,
2726
} from "../../Common/FormComponents/common/styleLibrary";
28-
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
2927
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
3028
import { setModalErrorSnackMessage } from "../../../../systemSlice";
3129
import { useAppDispatch } from "../../../../store";
@@ -96,35 +94,31 @@ const AddBucketTagModal = ({
9694
}}
9795
titleIcon={<AddNewTagIcon />}
9896
>
99-
<Grid container>
100-
<div className={classes.spacerBottom}>
97+
<FormLayout withBorders={false} containerPadding={false}>
98+
<Box sx={{ marginBottom: 15 }}>
10199
<strong>Bucket</strong>: {bucketName}
102-
</div>
103-
<Grid item xs={12} className={classes.formFieldRow}>
104-
<InputBoxWrapper
105-
value={newKey}
106-
label={"New Tag Key"}
107-
id={"newTagKey"}
108-
name={"newTagKey"}
109-
placeholder={"Enter New Tag Key"}
110-
onChange={(e: any) => {
111-
setNewKey(e.target.value);
112-
}}
113-
/>
114-
</Grid>
115-
<Grid item xs={12} className={classes.formFieldRow}>
116-
<InputBoxWrapper
117-
value={newLabel}
118-
label={"New Tag Label"}
119-
id={"newTagLabel"}
120-
name={"newTagLabel"}
121-
placeholder={"Enter New Tag Label"}
122-
onChange={(e: any) => {
123-
setNewLabel(e.target.value);
124-
}}
125-
/>
126-
</Grid>
127-
<Grid item xs={12} className={classes.modalButtonBar}>
100+
</Box>
101+
<InputBox
102+
value={newKey}
103+
label={"New Tag Key"}
104+
id={"newTagKey"}
105+
name={"newTagKey"}
106+
placeholder={"Enter New Tag Key"}
107+
onChange={(e: any) => {
108+
setNewKey(e.target.value);
109+
}}
110+
/>
111+
<InputBox
112+
value={newLabel}
113+
label={"New Tag Label"}
114+
id={"newTagLabel"}
115+
name={"newTagLabel"}
116+
placeholder={"Enter New Tag Label"}
117+
onChange={(e: any) => {
118+
setNewLabel(e.target.value);
119+
}}
120+
/>
121+
<Grid item xs={12} sx={modalStyleUtils.modalButtonBar}>
128122
<Button
129123
id={"clear"}
130124
type="button"
@@ -144,7 +138,7 @@ const AddBucketTagModal = ({
144138
label={"Save"}
145139
/>
146140
</Grid>
147-
</Grid>
141+
</FormLayout>
148142
</ModalWrapper>
149143
);
150144
};

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

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

1717
import React, { Fragment, useEffect, useState } from "react";
18-
import { Select, InputBox, Switch, FormLayout, Tooltip, Grid } from "mds";
18+
import {
19+
FormLayout,
20+
Grid,
21+
InputBox,
22+
ReadBox,
23+
Select,
24+
Switch,
25+
Tooltip,
26+
} from "mds";
1927
import { Theme } from "@mui/material/styles";
2028
import createStyles from "@mui/styles/createStyles";
2129
import withStyles from "@mui/styles/withStyles";
@@ -27,7 +35,6 @@ import {
2735
wizardCommon,
2836
} from "../../Common/FormComponents/common/styleLibrary";
2937
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
30-
import PredefinedList from "../../Common/FormComponents/PredefinedList/PredefinedList";
3138
import GenericWizard from "../../Common/GenericWizard/GenericWizard";
3239
import { getBytes, k8sScalarUnitsExcluding } from "../../../../common/utils";
3340
import InputUnitMenu from "../../Common/FormComponents/InputUnitMenu/InputUnitMenu";
@@ -325,10 +332,12 @@ const AddBulkReplicationModal = ({
325332
componentRender: (
326333
<Fragment>
327334
<Grid item xs={12}>
328-
<PredefinedList
335+
<ReadBox
336+
sx={{ width: "100%" }}
329337
label="Local Buckets to replicate"
330-
content={bucketsToAlter.join(", ")}
331-
/>
338+
>
339+
{bucketsToAlter.join(", ")}
340+
</ReadBox>
332341
</Grid>
333342
<h4>Remote Endpoint Configuration</h4>
334343
<span className={classes.descriptionText}>

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import {
2727
IconButton,
2828
Tooltip,
2929
Grid,
30+
Checkbox,
3031
} from "mds";
3132
import { niceBytes } from "../../../../../../common/utils";
3233
import SpecificVersionPill from "./SpecificVersionPill";
33-
import CheckboxWrapper from "../../../../Common/FormComponents/CheckboxWrapper/CheckboxWrapper";
3434
import { BucketObject } from "api/consoleApi";
3535

3636
interface IFileVersionItem {
@@ -242,24 +242,19 @@ const FileVersionItem = ({
242242
<Grid container>
243243
<Grid item xs md={4} className={"versionContainer"}>
244244
{checkable && (
245-
<CheckboxWrapper
245+
<Checkbox
246246
checked={isChecked}
247247
id={`select-${versionInfo.version_id}`}
248-
label={""}
249248
name={`select-${versionInfo.version_id}`}
250249
onChange={(e) => {
251250
e.stopPropagation();
252-
e.preventDefault();
253251
onCheck(versionInfo.version_id || "");
254252
}}
255253
value={versionInfo.version_id || ""}
256254
disabled={versionInfo.is_delete_marker}
257-
overrideCheckboxStyles={{
258-
paddingLeft: 0,
259-
height: 34,
260-
width: 25,
255+
sx={{
256+
width: "initial",
261257
}}
262-
noTopMargin
263258
/>
264259
)}
265260
{displayFileIconName(fileName, true)} v{index.toString()}

portal-ui/src/screens/Console/Common/FormComponents/CheckboxWrapper/CheckboxWrapper.tsx

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

0 commit comments

Comments
 (0)