Skip to content

Commit 083314e

Browse files
authored
Object Browser Refactor (#3066)
- Refactored navigation to be handled only with URL - Refactored & simplified websocket - Updated components to use mds - Fixed an issue with Anonymous access and file selection - Fixed an issue with anonymous access and download selection click - Fixed an issue with object details selection on root path from a bucket - Simplified reducer Signed-off-by: Benjamin Perez <[email protected]>
1 parent 078ce0e commit 083314e

File tree

16 files changed

+551
-669
lines changed

16 files changed

+551
-669
lines changed

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

Lines changed: 71 additions & 335 deletions
Large diffs are not rendered by default.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import { setErrorSnackMessage, setHelpName } from "../../../../systemSlice";
4646
import { useAppDispatch } from "../../../../store";
4747
import { useSelector } from "react-redux";
4848
import { selFeatures } from "../../consoleSlice";
49-
import { setLoadingObjects } from "../../ObjectBrowser/objectBrowserSlice";
5049
import PageHeaderWrapper from "../../Common/PageHeaderWrapper/PageHeaderWrapper";
5150
import { api } from "../../../../api";
5251
import { Bucket } from "../../../../api/consoleApi";
@@ -91,7 +90,6 @@ const ListBuckets = () => {
9190
if (res.data) {
9291
setLoading(false);
9392
setRecords(res.data.buckets || []);
94-
dispatch(setLoadingObjects(true));
9593
} else if (res.error) {
9694
setLoading(false);
9795
dispatch(setErrorSnackMessage(errorToHandler(res.error)));

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

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

1717
import React from "react";
18-
import { Theme } from "@mui/material/styles";
19-
import createStyles from "@mui/styles/createStyles";
20-
import { Button, ClosePanelIcon, Grid } from "mds";
21-
import makeStyles from "@mui/styles/makeStyles";
18+
import { Box, Button, ClosePanelIcon } from "mds";
2219

2320
interface IDetailsListPanel {
2421
open: boolean;
@@ -27,51 +24,44 @@ interface IDetailsListPanel {
2724
children: React.ReactNode;
2825
}
2926

30-
const useStyles = makeStyles((theme: Theme) =>
31-
createStyles({
32-
detailsList: {
33-
borderColor: "#EAEDEE",
34-
borderWidth: 0,
35-
borderStyle: "solid",
36-
borderRadius: 3,
37-
borderBottomLeftRadius: 0,
38-
borderBottomRightRadius: 0,
39-
width: 0,
40-
transitionDuration: "0.3s",
41-
overflowX: "hidden",
42-
overflowY: "auto",
43-
position: "relative",
44-
opacity: 0,
45-
marginLeft: -1,
46-
"&.open": {
47-
width: 300,
48-
minWidth: 300,
49-
borderLeftWidth: 1,
50-
opacity: 1,
51-
},
52-
"@media (max-width: 799px)": {
53-
"&.open": {
54-
width: "100%",
55-
minWidth: "100%",
56-
borderLeftWidth: 0,
57-
},
58-
},
59-
},
60-
}),
61-
);
62-
6327
const DetailsListPanel = ({
6428
open,
6529
closePanel,
6630
className = "",
6731
children,
6832
}: IDetailsListPanel) => {
69-
const classes = useStyles();
70-
7133
return (
72-
<Grid
73-
item
74-
className={`${classes.detailsList} ${open ? "open" : ""} ${className}`}
34+
<Box
35+
id={"details-panel"}
36+
sx={{
37+
borderColor: "#EAEDEE",
38+
borderWidth: 0,
39+
borderStyle: "solid",
40+
borderRadius: 3,
41+
borderBottomLeftRadius: 0,
42+
borderBottomRightRadius: 0,
43+
width: 0,
44+
transitionDuration: "0.3s",
45+
overflowX: "hidden",
46+
overflowY: "auto",
47+
position: "relative",
48+
opacity: 0,
49+
marginLeft: -1,
50+
"&.open": {
51+
width: 300,
52+
minWidth: 300,
53+
borderLeftWidth: 1,
54+
opacity: 1,
55+
},
56+
"@media (max-width: 799px)": {
57+
"&.open": {
58+
width: "100%",
59+
minWidth: "100%",
60+
borderLeftWidth: 0,
61+
},
62+
},
63+
}}
64+
className={`${open ? "open" : ""} ${className}`}
7565
>
7666
<Button
7767
variant={"text"}
@@ -90,7 +80,7 @@ const DetailsListPanel = ({
9080
}}
9181
/>
9282
{children}
93-
</Grid>
83+
</Box>
9484
);
9585
};
9686

0 commit comments

Comments
 (0)