diff --git a/portal-ui/src/screens/Console/Common/FormComponents/InputUnitMenu/InputUnitMenu.tsx b/portal-ui/src/screens/Console/Common/FormComponents/InputUnitMenu/InputUnitMenu.tsx index b149812e0..9137c85ee 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/InputUnitMenu/InputUnitMenu.tsx +++ b/portal-ui/src/screens/Console/Common/FormComponents/InputUnitMenu/InputUnitMenu.tsx @@ -18,14 +18,14 @@ import React, { Fragment } from "react"; import { Theme } from "@mui/material/styles"; import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; -import { selectorTypes } from "../SelectWrapper/SelectWrapper"; +import { SelectorType } from "mds"; import { Menu, MenuItem } from "@mui/material"; interface IInputUnitBox { classes: any; id: string; unitSelected: string; - unitsList: selectorTypes[]; + unitsList: SelectorType[]; disabled?: boolean; onUnitChange?: (newValue: string) => void; } diff --git a/portal-ui/src/screens/Console/Common/FormComponents/SelectWrapper/SelectWrapper.tsx b/portal-ui/src/screens/Console/Common/FormComponents/SelectWrapper/SelectWrapper.tsx deleted file mode 100644 index 402ef9591..000000000 --- a/portal-ui/src/screens/Console/Common/FormComponents/SelectWrapper/SelectWrapper.tsx +++ /dev/null @@ -1,144 +0,0 @@ -// This file is part of MinIO Console Server -// Copyright (c) 2021 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 React from "react"; -import Grid from "@mui/material/Grid"; -import { - FormControl, - InputBase, - InputLabel, - MenuItem, - Select, - SelectChangeEvent, - Tooltip, -} from "@mui/material"; -import { Theme } from "@mui/material/styles"; -import createStyles from "@mui/styles/createStyles"; -import withStyles from "@mui/styles/withStyles"; -import { fieldBasic, tooltipHelper } from "../common/styleLibrary"; -import { HelpIcon } from "mds"; - -export interface selectorTypes { - label: string; - value: string; -} - -interface SelectProps { - options: selectorTypes[]; - value: string; - label: string; - id: string; - name: string; - tooltip?: string; - onChange: (e: SelectChangeEvent) => void; - disabled?: boolean; - classes: any; -} - -const styles = (theme: Theme) => - createStyles({ - ...fieldBasic, - ...tooltipHelper, - fieldContainer: { - display: "flex", - "@media (max-width: 600px)": { - flexFlow: "column", - }, - }, - }); - -const SelectStyled = withStyles((theme: Theme) => - createStyles({ - root: { - height: 38, - lineHeight: 1, - "label + &": { - marginTop: theme.spacing(3), - }, - }, - input: { - height: 38, - position: "relative", - color: "#07193E", - fontSize: 13, - fontWeight: 600, - padding: "8px 20px 10px 10px", - border: "#e5e5e5 1px solid", - borderRadius: 4, - display: "flex", - alignItems: "center", - "&:hover": { - borderColor: "#393939", - }, - "&:focus": { - backgroundColor: "#fff", - }, - }, - }), -)(InputBase); - -const SelectWrapper = ({ - classes, - id, - name, - onChange, - options, - label, - tooltip = "", - value, - disabled = false, -}: SelectProps) => { - return ( - - - {label !== "" && ( - - {label} - {tooltip !== "" && ( -
- -
- -
-
-
- )} -
- )} - - - -
-
- ); -}; - -export default withStyles(styles)(SelectWrapper); diff --git a/portal-ui/src/screens/Console/Support/ApiKeyRegister.tsx b/portal-ui/src/screens/Console/Support/ApiKeyRegister.tsx index 4743747df..780c05f82 100644 --- a/portal-ui/src/screens/Console/Support/ApiKeyRegister.tsx +++ b/portal-ui/src/screens/Console/Support/ApiKeyRegister.tsx @@ -14,42 +14,27 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -import React, { Fragment, useCallback, useEffect, useState } from "react"; -import { Box } from "@mui/material"; -import { Button, OnlineRegistrationIcon } from "mds"; -import { FormTitle } from "./utils"; -import InputBoxWrapper from "../Common/FormComponents/InputBoxWrapper/InputBoxWrapper"; -import GetApiKeyModal from "./GetApiKeyModal"; -import RegisterHelpBox from "./RegisterHelpBox"; +import React, { useCallback, useEffect, useState } from "react"; +import { Box, Button, FormLayout, InputBox, OnlineRegistrationIcon } from "mds"; +import { useNavigate } from "react-router-dom"; import { SubnetLoginRequest, SubnetLoginResponse } from "../License/types"; -import api from "../../../common/api"; import { useAppDispatch } from "../../../store"; import { setErrorSnackMessage, setServerNeedsRestart, } from "../../../systemSlice"; import { ErrorResponseHandler } from "../../../common/types"; -import { spacingUtils } from "../Common/FormComponents/common/styleLibrary"; -import { Theme } from "@mui/material/styles"; -import createStyles from "@mui/styles/createStyles"; -import withStyles from "@mui/styles/withStyles"; -import { useNavigate } from "react-router-dom"; +import { modalStyleUtils } from "../Common/FormComponents/common/styleLibrary"; import { IAM_PAGES } from "../../../common/SecureComponent/permissions"; +import GetApiKeyModal from "./GetApiKeyModal"; +import RegisterHelpBox from "./RegisterHelpBox"; +import api from "../../../common/api"; interface IApiKeyRegister { - classes: any; registerEndpoint: string; } -const styles = (theme: Theme) => - createStyles({ - sizedLabel: { - minWidth: "75px", - }, - ...spacingUtils, - }); - -const ApiKeyRegister = ({ classes, registerEndpoint }: IApiKeyRegister) => { +const ApiKeyRegister = ({ registerEndpoint }: IApiKeyRegister) => { const navigate = useNavigate(); const [showApiKeyModal, setShowApiKeyModal] = useState(false); @@ -92,108 +77,66 @@ const ApiKeyRegister = ({ classes, registerEndpoint }: IApiKeyRegister) => { }; return ( - - - } - title={`Register cluster with API key`} - /> - + } + containerPadding={false} + withBorders={false} + helpBox={} + > - - - Use your MinIO Subscription Network API Key to register this - cluster. - - - ) => - setApiKey(event.target.value) - } - label="API Key" - value={apiKey} - /> - - -