From f02786001ce2959b014a4f162cf614e3c546e21f Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Wed, 5 Jul 2023 22:29:17 -0600 Subject: [PATCH] Migrated Groups Module components to mds (#2923) Signed-off-by: Benjamin Perez --- .../FormComponents/common/styleLibrary.ts | 6 - .../screens/Console/Groups/AddGroupMember.tsx | 77 ++- .../screens/Console/Groups/AddGroupScreen.tsx | 164 +++--- .../screens/Console/Groups/DeleteGroup.tsx | 18 +- .../Console/Groups/GroupDetailsHeader.tsx | 33 -- .../src/screens/Console/Groups/Groups.tsx | 73 +-- .../screens/Console/Groups/GroupsDetails.tsx | 534 +++++++++--------- .../screens/Console/Groups/UsersSelectors.tsx | 136 ++--- .../screens/Console/Policies/SetPolicy.tsx | 86 +-- .../src/screens/Console/Users/ListUsers.tsx | 54 +- .../src/screens/Console/Users/UserDetails.tsx | 4 +- portal-ui/tests/utils/elements.ts | 13 +- 12 files changed, 486 insertions(+), 712 deletions(-) delete mode 100644 portal-ui/src/screens/Console/Groups/GroupDetailsHeader.tsx diff --git a/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts b/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts index c1713b61c..12f9b2f15 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts +++ b/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts @@ -358,12 +358,6 @@ export const objectBrowserCommon = { // ** According to W3 spec, default minimum values for flex width flex-grow is "auto" (https://drafts.csswg.org/css-flexbox/#min-size-auto). So in this case we need to enforce the use of an absolute width. // "The preferred width of a box element child containing text content is currently the text without line breaks, leading to very unintuitive width and flex calculations → declare a width on a box element child with more than a few words (ever wonder why flexbox demos are all “1,2,3”?)" -export const selectorsCommon = { - multiSelectTable: { - height: 200, - }, -}; - export const settingsCommon: any = { settingsFormContainer: { padding: 38, diff --git a/portal-ui/src/screens/Console/Groups/AddGroupMember.tsx b/portal-ui/src/screens/Console/Groups/AddGroupMember.tsx index efab4bb37..1f5b7fd27 100644 --- a/portal-ui/src/screens/Console/Groups/AddGroupMember.tsx +++ b/portal-ui/src/screens/Console/Groups/AddGroupMember.tsx @@ -1,26 +1,31 @@ -import React, { useState } from "react"; -import UsersSelectors from "./UsersSelectors"; -import ModalWrapper from "../Common/ModalWrapper/ModalWrapper"; -import PredefinedList from "../Common/FormComponents/PredefinedList/PredefinedList"; -import Grid from "@mui/material/Grid"; -import { AddMembersToGroupIcon, Button } from "mds"; +// This file is part of MinIO Console Server +// Copyright (c) 2023 MinIO, Inc. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . -import { Theme } from "@mui/material/styles"; -import createStyles from "@mui/styles/createStyles"; -import { - formFieldStyles, - modalBasic, - modalStyleUtils, -} from "../Common/FormComponents/common/styleLibrary"; -import withStyles from "@mui/styles/withStyles"; +import React, { useState } from "react"; +import { AddMembersToGroupIcon, Button, FormLayout, Grid, ReadBox } from "mds"; +import { modalStyleUtils } from "../Common/FormComponents/common/styleLibrary"; import { encodeURLString } from "../../../common/utils"; import { setModalErrorSnackMessage } from "../../../systemSlice"; import { useAppDispatch } from "../../../store"; import { api } from "api"; import { errorToHandler } from "api/errors"; +import UsersSelectors from "./UsersSelectors"; +import ModalWrapper from "../Common/ModalWrapper/ModalWrapper"; type UserPickerModalProps = { - classes?: any; title?: string; preSelectedUsers?: string[]; selectedGroup?: string; @@ -30,21 +35,7 @@ type UserPickerModalProps = { groupStatus?: string; }; -const styles = (theme: Theme) => - createStyles({ - userSelector: { - "& .MuiPaper-root": { - padding: 0, - marginBottom: 15, - }, - }, - ...modalStyleUtils, - ...formFieldStyles, - ...modalBasic, - }); - const AddGroupMember = ({ - classes, title = "", groupStatus = "enabled", preSelectedUsers = [], @@ -77,21 +68,17 @@ const AddGroupMember = ({ title={title} titleIcon={} > - - -
- -
-
- -
-
-
- + + + {selectedGroup} + + + +