Skip to content

Commit 5e4ad55

Browse files
authored
Replaced CircularProgress component with new Loader (#1690)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent e01d8bc commit 5e4ad55

File tree

29 files changed

+223
-243
lines changed

29 files changed

+223
-243
lines changed

portal-ui/src/common/LoadingComponent.tsx

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

1717
import React from "react";
18-
import { CircularProgress, Grid } from "@mui/material";
18+
import { Grid } from "@mui/material";
19+
import Loader from "../screens/Console/Common/Loader/Loader";
1920

2021
const LoadingComponent = () => {
2122
return (
@@ -28,7 +29,7 @@ const LoadingComponent = () => {
2829
style={{ minHeight: "100vh" }}
2930
>
3031
<Grid item xs={3} style={{ textAlign: "center" }}>
31-
<CircularProgress />
32+
<Loader style={{ width: 35, height: 35 }} />
3233
<br />
3334
Loading...
3435
</Grid>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import React, { useEffect, useState } from "react";
1818
import { connect } from "react-redux";
19-
import { Button, LinearProgress, CircularProgress } from "@mui/material";
19+
import { Button, LinearProgress } from "@mui/material";
2020
import { Theme } from "@mui/material/styles";
2121
import createStyles from "@mui/styles/createStyles";
2222
import withStyles from "@mui/styles/withStyles";
@@ -36,6 +36,7 @@ import api from "../../../../common/api";
3636
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
3737
import RadioGroupSelector from "../../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
3838
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
39+
import Loader from "../../Common/Loader/Loader";
3940

4041
const styles = (theme: Theme) =>
4142
createStyles({
@@ -124,7 +125,7 @@ const SetRetentionConfig = ({
124125
}}
125126
>
126127
{loadingForm ? (
127-
<CircularProgress color="primary" size={16} variant="indeterminate" />
128+
<Loader style={{ width: 16, height: 16 }} />
128129
) : (
129130
<form
130131
noValidate

portal-ui/src/screens/Console/Buckets/BucketDetails/SummaryItems/ActionLink.tsx

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

1717
import React from "react";
18-
import { Button, CircularProgress } from "@mui/material";
18+
import { Button } from "@mui/material";
19+
import Loader from "../../../Common/Loader/Loader";
1920

2021
type ActionLinkProps = {
2122
isLoading: boolean;
@@ -54,11 +55,7 @@ const ActionLink = ({
5455
disableFocusRipple
5556
{...restProps}
5657
>
57-
{isLoading ? (
58-
<CircularProgress color="primary" size={16} variant="indeterminate" />
59-
) : (
60-
label
61-
)}
58+
{isLoading ? <Loader style={{ width: 16, height: 16 }} /> : label}
6259
</Button>
6360
);
6461
};

portal-ui/src/screens/Console/Buckets/BucketDetails/SummaryItems/BucketTags.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ import React, { useEffect, useState } from "react";
1717
import { Bucket } from "../../../Watch/types";
1818
import { ErrorResponseHandler } from "../../../../../common/types";
1919
import useApi from "../../../Common/Hooks/useApi";
20-
import { Box, CircularProgress } from "@mui/material";
20+
import { Box } from "@mui/material";
2121
import { IAM_SCOPES } from "../../../../../common/SecureComponent/permissions";
2222
import { SecureComponent } from "../../../../../common/SecureComponent";
2323
import get from "lodash/get";
2424
import Chip from "@mui/material/Chip";
2525
import CloseIcon from "@mui/icons-material/Close";
2626
import AddIcon from "@mui/icons-material/Add";
2727
import withSuspense from "../../../Common/Components/withSuspense";
28+
import Loader from "../../../Common/Loader/Loader";
2829

2930
const AddBucketTagModal = withSuspense(
3031
React.lazy(() => import("../AddBucketTagModal"))
@@ -89,9 +90,7 @@ const BucketTags = ({ setErrorSnackMessage, bucketName }: BucketTagProps) => {
8990

9091
return (
9192
<Box>
92-
{isLoading ? (
93-
<CircularProgress color="primary" size={16} variant="indeterminate" />
94-
) : null}
93+
{isLoading ? <Loader style={{ width: 16, height: 16 }} /> : null}
9594
<SecureComponent
9695
scopes={[IAM_SCOPES.S3_GET_BUCKET_TAGGING]}
9796
resource={bucketName}

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,6 @@ import InspectObject from "./InspectObject";
8080

8181
const styles = () =>
8282
createStyles({
83-
tag: {
84-
marginRight: 6,
85-
fontSize: 10,
86-
fontWeight: 700,
87-
"&.MuiChip-sizeSmall": {
88-
height: 18,
89-
},
90-
"& .min-icon": {
91-
height: 10,
92-
width: 10,
93-
},
94-
},
9583
ObjectDetailsTitle: {
9684
display: "flex",
9785
alignItems: "center",
@@ -117,20 +105,6 @@ const styles = () =>
117105
capitalizeFirst: {
118106
textTransform: "capitalize",
119107
},
120-
"@global": {
121-
".progressDetails": {
122-
paddingTop: 3,
123-
display: "inline-block",
124-
position: "relative",
125-
width: 18,
126-
height: 18,
127-
},
128-
".progressDetails > .MuiCircularProgress-root": {
129-
position: "absolute",
130-
left: 0,
131-
top: 3,
132-
},
133-
},
134108
...buttonsStyles,
135109
...actionsTray,
136110
...spacingUtils,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface BucketObject {
2121
last_modified: Date;
2222
content_type: string;
2323
version_id: string;
24-
delete_flag?:boolean;
24+
delete_flag?: boolean;
2525
}
2626

2727
export interface BucketObjectsList {

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

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -60,65 +60,10 @@ import SelectWrapper from "../../../../Common/FormComponents/SelectWrapper/Selec
6060

6161
const styles = (theme: Theme) =>
6262
createStyles({
63-
propertiesIcon: {
64-
marginLeft: 5,
65-
"& .min-icon": {
66-
height: 12,
67-
},
68-
},
69-
tag: {
70-
marginRight: 6,
71-
fontSize: 10,
72-
fontWeight: 700,
73-
"&.MuiChip-sizeSmall": {
74-
height: 18,
75-
},
76-
"& .min-icon": {
77-
height: 10,
78-
width: 10,
79-
},
80-
},
81-
search: {
82-
marginBottom: 8,
83-
"&.MuiFormControl-root": {
84-
marginRight: 0,
85-
},
86-
},
87-
capitalizeFirst: {
88-
textTransform: "capitalize",
89-
"& .min-icon": {
90-
width: 16,
91-
height: 16,
92-
},
93-
},
94-
titleCol: {
95-
width: "25%",
96-
},
97-
titleItem: {
98-
width: "35%",
99-
},
10063
versionsContainer: {
10164
border: "#EAEDEE 1px solid",
10265
padding: 10,
10366
},
104-
"@global": {
105-
".progressDetails": {
106-
paddingTop: 3,
107-
display: "inline-block",
108-
position: "relative",
109-
width: 18,
110-
height: 18,
111-
},
112-
".progressDetails > .MuiCircularProgress-root": {
113-
position: "absolute",
114-
left: 0,
115-
top: 3,
116-
},
117-
},
118-
tabsContainer: {
119-
border: "1px solid #eaeaea",
120-
borderTop: 0,
121-
},
12267
noBottomBorder: {
12368
borderBottom: 0,
12469
},

portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export const objectBrowserCommon = {
384384
},
385385
},
386386
additionalOptions: {
387-
paddingRight: "10px"
387+
paddingRight: "10px",
388388
},
389389
smallLabel: {
390390
color: "#9C9C9C",

portal-ui/src/screens/Console/Common/IconsScreen.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import * as cicons from "../../../icons";
3333
import * as micons from "../../../icons/SidebarMenus";
3434
import Loader from "./Loader/Loader";
3535

36-
3736
interface IIconsScreenSimple {
3837
classes: any;
3938
}
@@ -47,7 +46,7 @@ const styles = (theme: Theme) =>
4746
"& .min-loader": {
4847
width: 45,
4948
height: 45,
50-
}
49+
},
5150
},
5251
def: {},
5352
red: {
@@ -106,12 +105,12 @@ const IconsScreen = ({ classes }: IIconsScreenSimple) => {
106105
</Grid>
107106
<h1>Loaders</h1>
108107
<Grid
109-
container
110-
spacing={4}
111-
textAlign={"center"}
112-
className={clsx(classes.root, {
113-
[classes.red]: color === "red",
114-
})}
108+
container
109+
spacing={4}
110+
textAlign={"center"}
111+
className={clsx(classes.root, {
112+
[classes.red]: color === "red",
113+
})}
115114
>
116115
<Grid item xs={3}>
117116
<Loader />

0 commit comments

Comments
 (0)