diff --git a/portal-ui/package.json b/portal-ui/package.json index 14e46fa555..2074aec4f3 100644 --- a/portal-ui/package.json +++ b/portal-ui/package.json @@ -18,7 +18,7 @@ "local-storage-fallback": "^4.1.1", "lodash": "^4.17.21", "luxon": "^3.3.0", - "mds": "https://github.com/minio/mds.git#v0.7.0", + "mds": "https://github.com/minio/mds.git#v0.8.1", "react": "^18.1.0", "react-component-export-image": "^1.0.6", "react-copy-to-clipboard": "^5.0.2", diff --git a/portal-ui/src/common/types.ts b/portal-ui/src/common/types.ts index 32829fafaf..7b4a327817 100644 --- a/portal-ui/src/common/types.ts +++ b/portal-ui/src/common/types.ts @@ -97,3 +97,8 @@ export interface IEmbeddedCustomStyles { inputBox: IEmbeddedInputBox; switch: IEmbeddedSwitch; } + +export interface SelectorTypes { + label: any; + value: string; +} diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessDetailsPanel.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessDetailsPanel.tsx index eac29ae799..9247f4520d 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessDetailsPanel.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessDetailsPanel.tsx @@ -17,18 +17,14 @@ import React, { Fragment, useEffect, useState } from "react"; import { useSelector } from "react-redux"; import { useNavigate, useParams } from "react-router-dom"; -import { Paper } from "@mui/material"; -import Tabs from "@mui/material/Tabs"; -import Tab from "@mui/material/Tab"; - -import { TabPanel } from "../../../shared/tabs"; -import TableWrapper from "../../Common/TableWrapper/TableWrapper"; +import { DataTable, SectionTitle, Tabs } from "mds"; +import { api } from "api"; +import { errorToHandler } from "api/errors"; import { CONSOLE_UI_RESOURCE, IAM_PAGES, IAM_SCOPES, } from "../../../../common/SecureComponent/permissions"; -import PanelTitle from "../../Common/PanelTitle/PanelTitle"; import { hasPermission, SecureComponent, @@ -38,15 +34,6 @@ import { setErrorSnackMessage, setHelpName } from "../../../../systemSlice"; import { selBucketDetailsLoading } from "./bucketDetailsSlice"; import { useAppDispatch } from "../../../../store"; import { Policy, ServiceAccounts } from "../../../../api/consoleApi"; -import { api } from "api"; -import { errorToHandler } from "api/errors"; - -function a11yProps(index: any) { - return { - id: `simple-tab-${index}`, - "aria-controls": `simple-tabpanel-${index}`, - }; -} const AccessDetails = () => { const dispatch = useAppDispatch(); @@ -55,7 +42,7 @@ const AccessDetails = () => { const loadingBucket = useSelector(selBucketDetailsLoading); - const [curTab, setCurTab] = useState(0); + const [curTab, setCurTab] = useState("simple-tab-0"); const [loadingPolicies, setLoadingPolicies] = useState(true); const [bucketPolicy, setBucketPolicy] = useState([]); const [loadingUsers, setLoadingUsers] = useState(true); @@ -158,65 +145,63 @@ const AccessDetails = () => { return ( - Access Audit + Access Audit , newValue: number) => { + currentTabOrPath={curTab} + onTabClick={(newValue: string) => { setCurTab(newValue); }} - indicatorColor="primary" - textColor="primary" - aria-label="cluster-tabs" - variant="scrollable" - scrollButtons="auto" - > - {displayPoliciesList && } - {displayUsersList && } - - - - - {bucketPolicy && ( - - )} - - - - - - - - - + horizontal + options={[ + { + tabConfig: { label: "Policies", id: "simple-tab-0" }, + content: ( + + {bucketPolicy && ( + + )} + + ), + }, + { + tabConfig: { label: "Users", id: "simple-tab-1" }, + content: ( + + + + ), + }, + ]} + /> ); }; diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx index 226d1073d5..e156ef625f 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx @@ -15,35 +15,22 @@ // along with this program. If not, see . import React, { Fragment, useEffect, useState } from "react"; +import { AddIcon, Button, DataTable, SectionTitle } from "mds"; import { useSelector } from "react-redux"; import { useParams } from "react-router-dom"; -import { Theme } from "@mui/material/styles"; -import { AddIcon, Button } from "mds"; -import createStyles from "@mui/styles/createStyles"; -import TableWrapper from "../../Common/TableWrapper/TableWrapper"; -import Grid from "@mui/material/Grid"; -import { - actionsTray, - containerForHeader, - objectBrowserCommon, - searchField, -} from "../../Common/FormComponents/common/styleLibrary"; +import { api } from "api"; +import { AccessRule as IAccessRule } from "api/consoleApi"; +import { errorToHandler } from "api/errors"; import { IAM_SCOPES } from "../../../../common/SecureComponent/permissions"; -import PanelTitle from "../../Common/PanelTitle/PanelTitle"; import { hasPermission, SecureComponent, } from "../../../../common/SecureComponent"; - -import withSuspense from "../../Common/Components/withSuspense"; import { setErrorSnackMessage, setHelpName } from "../../../../systemSlice"; -import makeStyles from "@mui/styles/makeStyles"; import { selBucketDetailsLoading } from "./bucketDetailsSlice"; import { useAppDispatch } from "../../../../store"; +import withSuspense from "../../Common/Components/withSuspense"; import TooltipWrapper from "../../Common/TooltipWrapper/TooltipWrapper"; -import { api } from "api"; -import { AccessRule as IAccessRule } from "api/consoleApi"; -import { errorToHandler } from "api/errors"; const AddAccessRuleModal = withSuspense( React.lazy(() => import("./AddAccessRule")), @@ -55,26 +42,8 @@ const EditAccessRuleModal = withSuspense( React.lazy(() => import("./EditAccessRule")), ); -const useStyles = makeStyles((theme: Theme) => - createStyles({ - "@global": { - ".rowLine:hover .iconFileElm": { - backgroundImage: "url(/images/ob_file_filled.svg)", - }, - ".rowLine:hover .iconFolderElm": { - backgroundImage: "url(/images/ob_folder_filled.svg)", - }, - }, - ...actionsTray, - ...searchField, - ...objectBrowserCommon, - ...containerForHeader, - }), -); - const AccessRule = () => { const dispatch = useAppDispatch(); - const classes = useStyles(); const params = useParams(); const loadingBucket = useSelector(selBucketDetailsLoading); @@ -196,60 +165,60 @@ const AccessRule = () => { initial={initialAccess} /> )} - - Anonymous Access - + +