Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Browser Refactor #3066

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
406 changes: 71 additions & 335 deletions portal-ui/src/screens/Console/Buckets/BucketDetails/BrowserHandler.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import { setErrorSnackMessage, setHelpName } from "../../../../systemSlice";
import { useAppDispatch } from "../../../../store";
import { useSelector } from "react-redux";
import { selFeatures } from "../../consoleSlice";
import { setLoadingObjects } from "../../ObjectBrowser/objectBrowserSlice";
import PageHeaderWrapper from "../../Common/PageHeaderWrapper/PageHeaderWrapper";
import { api } from "../../../../api";
import { Bucket } from "../../../../api/consoleApi";
Expand Down Expand Up @@ -91,7 +90,6 @@ const ListBuckets = () => {
if (res.data) {
setLoading(false);
setRecords(res.data.buckets || []);
dispatch(setLoadingObjects(true));
} else if (res.error) {
setLoading(false);
dispatch(setErrorSnackMessage(errorToHandler(res.error)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import React from "react";
import { Theme } from "@mui/material/styles";
import createStyles from "@mui/styles/createStyles";
import { Button, ClosePanelIcon, Grid } from "mds";
import makeStyles from "@mui/styles/makeStyles";
import { Box, Button, ClosePanelIcon } from "mds";

interface IDetailsListPanel {
open: boolean;
Expand All @@ -27,51 +24,44 @@ interface IDetailsListPanel {
children: React.ReactNode;
}

const useStyles = makeStyles((theme: Theme) =>
createStyles({
detailsList: {
borderColor: "#EAEDEE",
borderWidth: 0,
borderStyle: "solid",
borderRadius: 3,
borderBottomLeftRadius: 0,
borderBottomRightRadius: 0,
width: 0,
transitionDuration: "0.3s",
overflowX: "hidden",
overflowY: "auto",
position: "relative",
opacity: 0,
marginLeft: -1,
"&.open": {
width: 300,
minWidth: 300,
borderLeftWidth: 1,
opacity: 1,
},
"@media (max-width: 799px)": {
"&.open": {
width: "100%",
minWidth: "100%",
borderLeftWidth: 0,
},
},
},
}),
);

const DetailsListPanel = ({
open,
closePanel,
className = "",
children,
}: IDetailsListPanel) => {
const classes = useStyles();

return (
<Grid
item
className={`${classes.detailsList} ${open ? "open" : ""} ${className}`}
<Box
id={"details-panel"}
sx={{
borderColor: "#EAEDEE",
borderWidth: 0,
borderStyle: "solid",
borderRadius: 3,
borderBottomLeftRadius: 0,
borderBottomRightRadius: 0,
width: 0,
transitionDuration: "0.3s",
overflowX: "hidden",
overflowY: "auto",
position: "relative",
opacity: 0,
marginLeft: -1,
"&.open": {
width: 300,
minWidth: 300,
borderLeftWidth: 1,
opacity: 1,
},
"@media (max-width: 799px)": {
"&.open": {
width: "100%",
minWidth: "100%",
borderLeftWidth: 0,
},
},
}}
className={`${open ? "open" : ""} ${className}`}
>
<Button
variant={"text"}
Expand All @@ -90,7 +80,7 @@ const DetailsListPanel = ({
}}
/>
{children}
</Grid>
</Box>
);
};

Expand Down
Loading
Loading