From 400892565db61c52ce23fcb627b3c01951c316cd Mon Sep 17 00:00:00 2001 From: Prakash Senthil Vel <23444145+prakashsvmx@users.noreply.github.com> Date: Sun, 28 Nov 2021 07:13:47 +0000 Subject: [PATCH] UX Tiers screen (#1258) --- .../FileSelector/FileSelector.tsx | 6 +- .../FormComponents/common/styleLibrary.ts | 19 ++ .../AddTierConfiguration.tsx | 302 ++++++++++-------- .../ListTiersConfiguration.tsx | 107 +++---- .../TiersConfiguration/TierTypeSelector.tsx | 14 +- ...dal.tsx => UpdateTierCredentialsModal.tsx} | 97 +++--- 6 files changed, 296 insertions(+), 249 deletions(-) rename portal-ui/src/screens/Console/Configurations/TiersConfiguration/{UpdateTierCredentiasModal.tsx => UpdateTierCredentialsModal.tsx} (72%) diff --git a/portal-ui/src/screens/Console/Common/FormComponents/FileSelector/FileSelector.tsx b/portal-ui/src/screens/Console/Common/FormComponents/FileSelector/FileSelector.tsx index dde66b421..b2b215b0f 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/FileSelector/FileSelector.tsx +++ b/portal-ui/src/screens/Console/Common/FormComponents/FileSelector/FileSelector.tsx @@ -112,9 +112,9 @@ const FileSelector = ({ {label !== "" && ( createStyles({ ...modalBasic, ...settingsCommon, + ...formFieldStyles, strongText: { fontWeight: 700, }, @@ -72,7 +76,6 @@ const styles = (theme: Theme) => alignItems: "center", justifyContent: "start", marginBottom: 16, - marginRight: 8, cursor: "pointer", padding: 0, overflow: "hidden", @@ -104,6 +107,11 @@ const styles = (theme: Theme) => backTo: { margin: "20px 0px 0", }, + formBox: { + border: "1px solid #EAEAEA", + padding: 15, + }, + ...fileInputStyles, }); interface IAddNotificationEndpointProps { @@ -340,22 +348,15 @@ const AddTierConfiguration = ({ setName(e.target.value.toUpperCase()); }; - const backClick = () => { - history.push("/tiers/add"); - }; - const targetElement = tierTypes.find((item) => item.serviceName === type); return ( - - - - + + + + {type !== "" && ( @@ -383,62 +384,71 @@ const AddTierConfiguration = ({ )} -
- - +
+ + {type !== "" && ( - - ) => { - setEndpoint(e.target.value); - }} - /> +
+ +
+
+ ) => { + setEndpoint(e.target.value); + }} + /> +
{(type === s3ServiceName || type === minioServiceName) && ( - - ) => { - setAccessKey(e.target.value); - }} - /> - - ) => { - setSecretKey(e.target.value); - }} - /> +
+ + ) => { + setAccessKey(e.target.value); + }} + /> +
+
+ + ) => { + setSecretKey(e.target.value); + }} + /> +
)} {type === gcsServiceName && ( - +
- +
)} {type === azureServiceName && ( - - ) => { - setAccountName(e.target.value); - }} - /> - - ) => { - setAccountKey(e.target.value); - }} - /> +
+ + ) => { + setAccountName(e.target.value); + }} + /> +
+
+ + ) => { + setAccountKey(e.target.value); + }} + /> +
)} - ) => { - setBucket(e.target.value); - }} - /> - ) => { - setPrefix(e.target.value); - }} - /> - ) => { - setRegion(e.target.value); - }} - /> +
+ ) => { + setBucket(e.target.value); + }} + /> +
+
+ ) => { + setPrefix(e.target.value); + }} + /> +
+
+ ) => { + setRegion(e.target.value); + }} + /> +
{type === s3ServiceName || (type === minioServiceName && ( - - ) => { - setStorageClass(e.target.value); - }} - /> +
+ + ) => { + setStorageClass(e.target.value); + }} + /> +
))}
)}
- - - - - + + + + +
-
+
); }; diff --git a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/ListTiersConfiguration.tsx b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/ListTiersConfiguration.tsx index 89285a9f6..bc2465048 100644 --- a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/ListTiersConfiguration.tsx +++ b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/ListTiersConfiguration.tsx @@ -20,15 +20,15 @@ import { connect } from "react-redux"; import { Theme } from "@mui/material/styles"; import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; -import { LinearProgress, TextField } from "@mui/material"; +import { LinearProgress } from "@mui/material"; import Grid from "@mui/material/Grid"; import Button from "@mui/material/Button"; -import InputAdornment from "@mui/material/InputAdornment"; import { actionsTray, containerForHeader, searchField, settingsCommon, + tableStyles, typesSelection, } from "../../Common/FormComponents/common/styleLibrary"; import { AddIcon, TiersIcon } from "../../../../icons"; @@ -38,13 +38,19 @@ import { ErrorResponseHandler } from "../../../../common/types"; import api from "../../../../common/api"; import TableWrapper from "../../Common/TableWrapper/TableWrapper"; -import UpdateTierCredentiasModal from "./UpdateTierCredentiasModal"; import RefreshIcon from "../../../../icons/RefreshIcon"; -import SearchIcon from "../../../../icons/SearchIcon"; import PageHeader from "../../Common/PageHeader/PageHeader"; import HelpBox from "../../../../common/HelpBox"; import BoxIconButton from "../../Common/BoxIconButton/BoxIconButton"; import AButton from "../../Common/AButton/AButton"; +import PageLayout from "../../Common/Layout/PageLayout"; +import SearchBox from "../../Common/SearchBox"; + +import withSuspense from "../../Common/Components/withSuspense"; + +const UpdateTierCredentialsModal = withSuspense( + React.lazy(() => import("./UpdateTierCredentialsModal")) +); interface IListTiersConfig { classes: any; @@ -59,25 +65,25 @@ const styles = (theme: Theme) => ...settingsCommon, ...typesSelection, ...containerForHeader(theme.spacing(4)), - strongText: { - fontWeight: 700, - }, - keyName: { - marginLeft: 5, - }, - iconText: { - lineHeight: "24px", - }, customConfigurationPage: { minHeight: 400, }, actionsTray: { ...actionsTray.actionsTray, }, - customTitle: { - ...settingsCommon.customTitle, - marginTop: 0, + searchField: { + ...searchField.searchField, + marginRight: "auto", + maxWidth: 380, }, + + rightActionButtons: { + display: "flex", + "& button": { + whiteSpace: "nowrap", + }, + }, + ...tableStyles, }); const ListTiersConfiguration = ({ @@ -183,61 +189,48 @@ const ListTiersConfiguration = ({ return ( {updateCredentialsOpen && ( - )} - + - { - setFilter(event.target.value); - }} - InputProps={{ - disableUnderline: true, - startAdornment: ( - - - - ), - }} - variant="standard" + onChange={setFilter} + classes={classes} /> - { - setIsLoading(true); - }} - size="large" - > - - - - - -
+ +
+ { + setIsLoading(true); + }} + size="large" + > + + + +
{isLoading && } {!isLoading && ( {records.length > 0 && ( - + )} - +
); }; diff --git a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/TierTypeSelector.tsx b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/TierTypeSelector.tsx index b843af134..cb21e79d7 100644 --- a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/TierTypeSelector.tsx +++ b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/TierTypeSelector.tsx @@ -29,6 +29,7 @@ import { import PageHeader from "../../Common/PageHeader/PageHeader"; import { tierTypes } from "./utils"; import BackLink from "../../../../common/BackLink"; +import PageLayout from "../../Common/Layout/PageLayout"; interface ITypeTiersConfig { classes: any; @@ -87,14 +88,13 @@ const TierTypeSelector = ({ classes, history }: ITypeTiersConfig) => { return ( - - - - - + + + + - +
{tierTypes.map((tierType, index) => (