diff --git a/pkg/acl/endpoints.go b/pkg/acl/endpoints.go index fe7c59568..d7c61ae59 100644 --- a/pkg/acl/endpoints.go +++ b/pkg/acl/endpoints.go @@ -26,6 +26,9 @@ var ( notificationEndpoints = "/notification-endpoints" notificationEndpointsAddAny = "/notification-endpoints/add/:service" notificationEndpointsAdd = "/notification-endpoints/add" + tiers = "/tiers" + tiersAddAny = "/tiers/add/:service" + tiersAdd = "/tiers/add" users = "/users" usersDetail = "/users/:userName+" groups = "/groups" @@ -294,6 +297,9 @@ var endpointRules = map[string]ConfigurationActionSet{ notificationEndpoints: configurationActionSet, notificationEndpointsAdd: configurationActionSet, notificationEndpointsAddAny: configurationActionSet, + tiers: configurationActionSet, + tiersAdd: configurationActionSet, + tiersAddAny: configurationActionSet, users: usersActionSet, usersDetail: usersActionSet, groups: groupsActionSet, diff --git a/pkg/acl/endpoints_test.go b/pkg/acl/endpoints_test.go index 9a3f3cfb0..0e163c9c5 100644 --- a/pkg/acl/endpoints_test.go +++ b/pkg/acl/endpoints_test.go @@ -70,7 +70,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) { "admin:*", }, }, - want: 26, + want: 29, }, { name: "all s3 endpoints", @@ -89,7 +89,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) { "s3:*", }, }, - want: 28, + want: 31, }, { name: "Console User - default endpoints", diff --git a/portal-ui/public/aws-logo.svg b/portal-ui/public/aws-logo.svg new file mode 100644 index 000000000..4715937ff --- /dev/null +++ b/portal-ui/public/aws-logo.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + diff --git a/portal-ui/public/azure-logo.svg b/portal-ui/public/azure-logo.svg new file mode 100644 index 000000000..52c32ac3b --- /dev/null +++ b/portal-ui/public/azure-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/portal-ui/public/gcs-logo.svg b/portal-ui/public/gcs-logo.svg new file mode 100644 index 000000000..81b7d2454 --- /dev/null +++ b/portal-ui/public/gcs-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/portal-ui/public/minio-logo.svg b/portal-ui/public/minio-logo.svg new file mode 100644 index 000000000..000ae4aa9 --- /dev/null +++ b/portal-ui/public/minio-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file 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 db71f4d3e..3e0ae64a9 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts +++ b/portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts @@ -376,6 +376,17 @@ export const settingsCommon = { backContainer: { margin: "20px 38px 0", }, + mainCont: { + paddingLeft: 50, + paddingRight: 50, + }, + mainTitle: { + fontSize: 18, + color: "#000", + fontWeight: 600, + marginBottom: 10, + marginTop: 10, + }, }; export const typesSelection = { diff --git a/portal-ui/src/screens/Console/Configurations/ConfigurationMain.tsx b/portal-ui/src/screens/Console/Configurations/ConfigurationMain.tsx index 5f3a52378..a4775e094 100644 --- a/portal-ui/src/screens/Console/Configurations/ConfigurationMain.tsx +++ b/portal-ui/src/screens/Console/Configurations/ConfigurationMain.tsx @@ -20,7 +20,6 @@ import { Grid } from "@material-ui/core"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import { containerForHeader } from "../Common/FormComponents/common/styleLibrary"; import ConfigurationsList from "./ConfigurationPanels/ConfigurationsList"; -import ListTiersConfiguration from "./TiersConfiguration/ListTiersConfiguration"; import { AppState } from "../../../store"; import { connect } from "react-redux"; import { ISessionResponse } from "../types"; @@ -67,15 +66,6 @@ const ConfigurationMain = ({ > - { - setSelectedTab(2); - }} - > - - @@ -85,12 +75,6 @@ const ConfigurationMain = ({ )} - {selectedTab === 2 && distributedSetup && ( - -

Tiers

- -
- )} diff --git a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/AddTierConfiguration.tsx b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/AddTierConfiguration.tsx index ee671b483..ff5b4f0c5 100644 --- a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/AddTierConfiguration.tsx +++ b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/AddTierConfiguration.tsx @@ -16,18 +16,28 @@ import React, { Fragment, useEffect, useState, useCallback } from "react"; import { connect } from "react-redux"; +import get from "lodash/get"; import Grid from "@material-ui/core/Grid"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import { Button } from "@material-ui/core"; -import api from "../../../../common/api"; import { setErrorSnackMessage } from "../../../../actions"; import { modalBasic, settingsCommon, } from "../../Common/FormComponents/common/styleLibrary"; import { ErrorResponseHandler } from "../../../../common/types"; +import api from "../../../../common/api"; import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper"; import FileSelector from "../../Common/FormComponents/FileSelector/FileSelector"; +import BackSettingsIcon from "../../../../icons/BackSettingsIcon"; +import PageHeader from "../../Common/PageHeader/PageHeader"; +import { + azureServiceName, + gcsServiceName, + minioServiceName, + s3ServiceName, + tierTypes, +} from "./utils"; const styles = (theme: Theme) => createStyles({ @@ -50,20 +60,62 @@ const styles = (theme: Theme) => ...settingsCommon.settingsFormContainer, height: "calc(100vh - 422px)", }, + lambdaNotif: { + background: + "linear-gradient(90deg, rgba(249,249,250,1) 0%, rgba(250,250,251,1) 68%, rgba(254,254,254,1) 100%)", + border: "#E5E5E5 1px solid", + borderRadius: 5, + height: 80, + display: "flex", + alignItems: "center", + justifyContent: "start", + marginBottom: 16, + marginRight: 8, + cursor: "pointer", + padding: 0, + overflow: "hidden", + }, + lambdaNotifIcon: { + backgroundColor: "#FEFEFE", + display: "flex", + alignItems: "center", + justifyContent: "center", + width: 80, + height: 80, + + "& img": { + maxWidth: 46, + maxHeight: 46, + }, + }, + lambdaNotifTitle: { + color: "#07193E", + fontSize: 16, + fontFamily: "Lato,sans-serif", + paddingLeft: 18, + }, + mainCont: { + maxWidth: 1180, + paddingLeft: 38, + paddingRight: 38, + }, + backTo: { + margin: "20px 0px 0", + }, }); interface IAddNotificationEndpointProps { - saveAndRefresh: any; setErrorSnackMessage: typeof setErrorSnackMessage; classes: any; - type: string; + match: any; + history: any; } const AddTierConfiguration = ({ - saveAndRefresh, classes, setErrorSnackMessage, - type, + match, + history, }: IAddNotificationEndpointProps) => { //Local States const [saving, setSaving] = useState(false); @@ -87,6 +139,8 @@ const AddTierConfiguration = ({ const [titleSelection, setTitleSelection] = useState(""); + const type = get(match, "params.service", "s3"); + // Validations const [isFormValid, setIsFormValid] = useState(true); const [nameInputError, setNameInputError] = useState(""); @@ -164,7 +218,8 @@ const AddTierConfiguration = ({ .invoke("POST", `/api/v1/admin/tiers`, payload) .then(() => { setSaving(false); - saveAndRefresh(); + + history.push("/tiers"); }) .catch((err: ErrorResponseHandler) => { setSaving(false); @@ -178,10 +233,10 @@ const AddTierConfiguration = ({ bucket, encodedCreds, endpoint, + history, name, prefix, region, - saveAndRefresh, saving, secretKey, setErrorSnackMessage, @@ -283,158 +338,206 @@ const AddTierConfiguration = ({ setName(e.target.value.toUpperCase()); }; + const backClick = () => { + history.push("/tiers/add"); + }; + + const targetElement = tierTypes.find((item) => item.serviceName === type); + return ( -
- - {titleSelection} - Add Tier Configuration + + + + - - - {type !== "" && ( - - - ) => { - setEndpoint(e.target.value); - }} - /> - {(type === "s3" || type === "minio") && ( + {type !== "" && ( + + + {targetElement && ( +
+
+ {targetElement.targetTitle} +
+ +
+ + {titleSelection ? titleSelection : ""} Tier Configuration + +
+
+ )} +
+
+ )} + + + + + {type !== "" && ( + ) => { - setAccessKey(e.target.value); + setEndpoint(e.target.value); + }} + /> + {(type === s3ServiceName || type === minioServiceName) && ( + + + ) => { + setAccessKey(e.target.value); + }} + /> + + ) => { + setSecretKey(e.target.value); + }} + /> + + )} + {type === gcsServiceName && ( + + { + setEncodedCreds(encodedValue); + setCreds(fileName); + }} + value={creds} + /> + + )} + {type === azureServiceName && ( + + + ) => { + setAccountName(e.target.value); + }} + /> + + ) => { + setAccountKey(e.target.value); + }} + /> + + )} + ) => { + setBucket(e.target.value); }} /> ) => { - setSecretKey(e.target.value); + setPrefix(e.target.value); }} /> + ) => { + setRegion(e.target.value); + }} + /> + {type === s3ServiceName || + (type === minioServiceName && ( + + ) => { + setStorageClass(e.target.value); + }} + /> + ))} )} - {type === "gcs" && ( - - { - setEncodedCreds(encodedValue); - setCreds(fileName); - }} - value={creds} - /> - - )} - {type === "azure" && ( - - ) => { - setAccountName(e.target.value); - }} - /> - ) => { - setAccountKey(e.target.value); - }} - /> - - )} - ) => { - setBucket(e.target.value); - }} - /> - ) => { - setPrefix(e.target.value); - }} - /> - ) => { - setRegion(e.target.value); - }} - /> - {type === "s3" || - (type === "minio" && ( - ) => { - 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 001a14ec9..5d7fff061 100644 --- a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/ListTiersConfiguration.tsx +++ b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/ListTiersConfiguration.tsx @@ -35,16 +35,15 @@ import { ITierElement, ITierResponse } from "./types"; import { ErrorResponseHandler } from "../../../../common/types"; import api from "../../../../common/api"; import TableWrapper from "../../Common/TableWrapper/TableWrapper"; -import SlideOptions from "../../Common/SlideOptions/SlideOptions"; -import BackSettingsIcon from "../../../../icons/BackSettingsIcon"; -import AddTierConfiguration from "./AddTierConfiguration"; + import UpdateTierCredentiasModal from "./UpdateTierCredentiasModal"; import RefreshIcon from "../../../../icons/RefreshIcon"; import SearchIcon from "../../../../icons/SearchIcon"; -import history from "../../../../history"; +import PageHeader from "../../Common/PageHeader/PageHeader"; interface IListTiersConfig { classes: any; + history: any; setErrorSnackMessage: typeof setErrorSnackMessage; } @@ -65,7 +64,7 @@ const styles = (theme: Theme) => lineHeight: "24px", }, customConfigurationPage: { - height: "calc(100vh - 410px)", + height: "calc(100vh - 210px)", scrollbarWidth: "none" as const, "&::-webkit-scrollbar": { display: "none", @@ -76,7 +75,6 @@ const styles = (theme: Theme) => }, actionsTray: { ...actionsTray.actionsTray, - padding: "0 38px", }, customTitle: { ...settingsCommon.customTitle, @@ -86,18 +84,17 @@ const styles = (theme: Theme) => const ListTiersConfiguration = ({ classes, + history, setErrorSnackMessage, }: IListTiersConfig) => { const [records, setRecords] = useState([]); const [filter, setFilter] = useState(""); const [isLoading, setIsLoading] = useState(true); - const [currentPanel, setCurrentPanel] = useState(0); const [updateCredentialsOpen, setUpdateCredentialsOpen] = useState(false); const [selectedTier, setSelectedTier] = useState({ type: "unsupported", }); - const [type, setType] = useState(""); useEffect(() => { if (isLoading) { @@ -127,17 +124,8 @@ const ListTiersConfiguration = ({ return getItemName.indexOf(filter) >= 0 || getItemType.indexOf(filter) >= 0; }); - const backClick = () => { - setCurrentPanel(currentPanel - 1); - }; - const addTier = () => { - setCurrentPanel(1); - }; - - const tierAdded = () => { - setCurrentPanel(0); - setIsLoading(true); + history.push("/tiers/add"); }; const renderTierName = (item: ITierElement) => { @@ -194,11 +182,6 @@ const ListTiersConfiguration = ({ setUpdateCredentialsOpen(false); }; - const typeSelect = (typeItem: string) => { - setType(typeItem); - setCurrentPanel(2); - }; - return ( {updateCredentialsOpen && ( @@ -208,238 +191,107 @@ const ListTiersConfiguration = ({ closeModalAndRefresh={closeTierCredentials} /> )} - - - -
- - - - { - setFilter(event.target.value); - }} - InputProps={{ - disableUnderline: true, - startAdornment: ( - - - - ), - }} - /> - { - setIsLoading(true); - }} - > - - - - - -
-
- - { - setSelectedTier(tierData); - setUpdateCredentialsOpen(true); - }, - }, - ]} - columns={[ - { - label: "Tier Name", - elementKey: "type", - renderFunction: renderTierName, - renderFullObject: true, - }, - { - label: "Type", - elementKey: "type", - width: 150, - }, - { - label: "Endpoint", - elementKey: "type", - renderFunction: renderTierEndpoint, - renderFullObject: true, - }, - { - label: "Bucket", - elementKey: "type", - renderFunction: renderTierBucket, - renderFullObject: true, - }, - { - label: "Prefix", - elementKey: "type", - renderFunction: renderTierPrefix, - renderFullObject: true, - }, - { - label: "Region", - elementKey: "type", - renderFunction: renderTierRegion, - renderFullObject: true, - }, - ]} - isLoading={isLoading} - records={filteredRecords} - entityName="Tiers" - idField="service_name" - customPaperHeight={classes.customConfigurationPage} - noBackground - /> - -
- , - - - - - - - Add Tier Configuration - - - - -
- - - - - -
-
-
-
-
-
, - - - - - - {currentPanel === 2 && ( - - )} - - , - ]} - currentSlide={currentPanel} + + + + + + { + setFilter(event.target.value); + }} + InputProps={{ + disableUnderline: true, + startAdornment: ( + + + + ), + }} /> -
+ { + setIsLoading(true); + }} + > + + + +
+ +
+
+ + { + setSelectedTier(tierData); + setUpdateCredentialsOpen(true); + }, + }, + ]} + columns={[ + { + label: "Tier Name", + elementKey: "type", + renderFunction: renderTierName, + renderFullObject: true, + }, + { + label: "Type", + elementKey: "type", + width: 150, + }, + { + label: "Endpoint", + elementKey: "type", + renderFunction: renderTierEndpoint, + renderFullObject: true, + }, + { + label: "Bucket", + elementKey: "type", + renderFunction: renderTierBucket, + renderFullObject: true, + }, + { + label: "Prefix", + elementKey: "type", + renderFunction: renderTierPrefix, + renderFullObject: true, + }, + { + label: "Region", + elementKey: "type", + renderFunction: renderTierRegion, + renderFullObject: true, + }, + ]} + isLoading={isLoading} + records={filteredRecords} + entityName="Tiers" + idField="service_name" + customPaperHeight={classes.customConfigurationPage} + /> +
-
+
); diff --git a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/TierTypeSelector.tsx b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/TierTypeSelector.tsx new file mode 100644 index 000000000..140338cb1 --- /dev/null +++ b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/TierTypeSelector.tsx @@ -0,0 +1,120 @@ +// 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, { Fragment } from "react"; +import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; +import Grid from "@material-ui/core/Grid"; +import { + actionsTray, + containerForHeader, + searchField, + settingsCommon, + typesSelection, +} from "../../Common/FormComponents/common/styleLibrary"; +import PageHeader from "../../Common/PageHeader/PageHeader"; +import { tierTypes } from "./utils"; + +interface ITypeTiersConfig { + classes: any; + history: any; +} + +const styles = (theme: Theme) => + createStyles({ + ...actionsTray, + ...searchField, + ...settingsCommon, + ...typesSelection, + ...containerForHeader(theme.spacing(4)), + strongText: { + fontWeight: 700, + }, + keyName: { + marginLeft: 5, + }, + iconText: { + lineHeight: "24px", + }, + customConfigurationPage: { + height: "calc(100vh - 410px)", + scrollbarWidth: "none" as const, + "&::-webkit-scrollbar": { + display: "none", + }, + }, + lambdaContainer: { + padding: "15px 0", + }, + actionsTray: { + ...actionsTray.actionsTray, + padding: "0 38px", + }, + customTitle: { + ...settingsCommon.customTitle, + marginTop: 0, + }, + }); + +const TierTypeSelector = ({ classes, history }: ITypeTiersConfig) => { + + const typeSelect = (selectName: string) => { + history.push(`/tiers/add/${selectName}`); + }; + + return ( + + + + + + Pick a supported Configuration + + + + +
+ {tierTypes.map((tierType, index) => ( + + ))} +
+
+
+
+
+
+
+ ); +}; + +export default withStyles(styles)(TierTypeSelector); diff --git a/portal-ui/src/screens/Console/Configurations/TiersConfiguration/utils.tsx b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/utils.tsx new file mode 100644 index 000000000..68b2e52f7 --- /dev/null +++ b/portal-ui/src/screens/Console/Configurations/TiersConfiguration/utils.tsx @@ -0,0 +1,43 @@ +// 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 . + +export const minioServiceName = "minio"; +export const gcsServiceName = "gcs"; +export const s3ServiceName = "s3"; +export const azureServiceName = "azure"; + +export const tierTypes = [ + { + serviceName: minioServiceName, + targetTitle: "MinIO", + logo: "/minio-logo.svg", + }, + { + serviceName: gcsServiceName, + targetTitle: "Google Cloud Storage", + logo: "/gcs-logo.svg", + }, + { + serviceName: s3ServiceName, + targetTitle: "AWS S3", + logo: "/aws-logo.svg", + }, + { + serviceName: azureServiceName, + targetTitle: "Azure", + logo: "/azure-logo.svg", + }, +]; diff --git a/portal-ui/src/screens/Console/Console.tsx b/portal-ui/src/screens/Console/Console.tsx index c7e0eaba8..aa4801d63 100644 --- a/portal-ui/src/screens/Console/Console.tsx +++ b/portal-ui/src/screens/Console/Console.tsx @@ -59,6 +59,9 @@ import AddTenant from "./Tenants/AddTenant/AddTenant"; import NotificationEndpoints from "./NotificationEndpoints/NotificationEndpoints"; import AddNotificationEndpoint from "./NotificationEndpoints/AddNotificationEndpoint"; import NotificationTypeSelector from "./NotificationEndpoints/NotificationTypeSelector"; +import ListTiersConfiguration from "./Configurations/TiersConfiguration/ListTiersConfiguration"; +import TierTypeSelector from "./Configurations/TiersConfiguration/TierTypeSelector"; +import AddTierConfiguration from "./Configurations/TiersConfiguration/AddTierConfiguration"; const drawerWidth = 245; @@ -293,6 +296,18 @@ const Console = ({ component: NotificationEndpoints, path: "/notification-endpoints", }, + { + component: AddTierConfiguration, + path: "/tiers/add/:service", + }, + { + component: TierTypeSelector, + path: "/tiers/add", + }, + { + component: ListTiersConfiguration, + path: "/tiers", + }, { component: Account, path: "/account", diff --git a/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/SingleRepWidget.tsx b/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/SingleRepWidget.tsx index 8c91b9b90..39f9eb8d4 100644 --- a/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/SingleRepWidget.tsx +++ b/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/SingleRepWidget.tsx @@ -27,10 +27,7 @@ import { widgetDetailsToPanel } from "../utils"; import { CircularProgress } from "@material-ui/core"; import { ErrorResponseHandler } from "../../../../../common/types"; import api from "../../../../../common/api"; -import { - prettyNumber, - representationNumber, -} from "../../../../../common/utils"; +import { representationNumber } from "../../../../../common/utils"; interface ISingleRepWidget { classes: any; diff --git a/portal-ui/src/screens/Console/Menu/Menu.tsx b/portal-ui/src/screens/Console/Menu/Menu.tsx index 5f280db8d..4fd757d89 100644 --- a/portal-ui/src/screens/Console/Menu/Menu.tsx +++ b/portal-ui/src/screens/Console/Menu/Menu.tsx @@ -39,6 +39,7 @@ import { GroupsIcon, IAMPoliciesIcon, LambdaIcon, + TiersIcon, TraceIcon, UsersIcon, VersionIcon, @@ -375,6 +376,14 @@ const Menu = ({ name: "Notification Endpoints", icon: , }, + { + group: "common", + type: "item", + component: NavLink, + to: "/tiers", + name: "Tiers", + icon: , + }, { group: "Tools", type: "item", diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/AddNotificationEndpoint.tsx b/portal-ui/src/screens/Console/NotificationEndpoints/AddNotificationEndpoint.tsx index 9e6328f5e..06c4c010c 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/AddNotificationEndpoint.tsx +++ b/portal-ui/src/screens/Console/NotificationEndpoints/AddNotificationEndpoint.tsx @@ -225,8 +225,8 @@ const AddNotificationEndpoint = ({
- {targetElement ? targetElement.targetTitle : ""} Lambda - Notification Target + {targetElement ? targetElement.targetTitle : ""} + Notification Endpoint
diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/ListNotificationEndpoints.tsx b/portal-ui/src/screens/Console/NotificationEndpoints/ListNotificationEndpoints.tsx index d37966083..be0dc5c5b 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/ListNotificationEndpoints.tsx +++ b/portal-ui/src/screens/Console/NotificationEndpoints/ListNotificationEndpoints.tsx @@ -31,7 +31,6 @@ import { import { notificationTransform } from "./utils"; import { AddIcon } from "../../../icons"; import TableWrapper from "../Common/TableWrapper/TableWrapper"; -import AddNotificationEndpoint from "./AddNotificationEndpoint"; import { setErrorSnackMessage } from "../../../actions"; import { actionsTray, @@ -41,9 +40,6 @@ import { } from "../Common/FormComponents/common/styleLibrary"; import { ErrorResponseHandler } from "../../../common/types"; import api from "../../../common/api"; -import SlideOptions from "../Common/SlideOptions/SlideOptions"; -import BackSettingsIcon from "../../../icons/BackSettingsIcon"; -import NotificationTypeSelector from "./NotificationTypeSelector"; import RefreshIcon from "../../../icons/RefreshIcon"; import SearchIcon from "../../../icons/SearchIcon"; import history from "../../../history"; @@ -88,8 +84,6 @@ const ListNotificationEndpoints = ({ const [records, setRecords] = useState([]); const [filter, setFilter] = useState(""); const [isLoading, setIsLoading] = useState(false); - const [currentPanel, setCurrentPanel] = useState(0); - const [service, setService] = useState(""); //Effects // load records on mount @@ -142,21 +136,6 @@ const ListNotificationEndpoints = ({ ); }; - const openNewLambdaSelector = () => { - setCurrentPanel(1); - }; - - const backClick = () => { - setService(""); - setCurrentPanel(currentPanel - 1); - }; - - const saveAndRefresh = () => { - setIsLoading(true); - setCurrentPanel(0); - setService(""); - }; - return ( @@ -202,49 +181,30 @@ const ListNotificationEndpoints = ({
- - - - - - - , - - - - - - - - , - ]} - currentSlide={currentPanel} - /> + + + + + + +
diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/NotificationEndpoints.tsx b/portal-ui/src/screens/Console/NotificationEndpoints/NotificationEndpoints.tsx index db9d554c4..a370a7a6e 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/NotificationEndpoints.tsx +++ b/portal-ui/src/screens/Console/NotificationEndpoints/NotificationEndpoints.tsx @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -import React, { Fragment, useState } from "react"; +import React, { Fragment } from "react"; import PageHeader from "../Common/PageHeader/PageHeader"; import { Grid } from "@material-ui/core"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; @@ -47,8 +47,6 @@ const NotificationEndpoints = ({ session, distributedSetup, }: INotificationEndpoints) => { - const [selectedTab, setSelectedTab] = useState(0); - return ( diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/NotificationTypeSelector.tsx b/portal-ui/src/screens/Console/NotificationEndpoints/NotificationTypeSelector.tsx index 47cb8a4ab..f8e88414b 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/NotificationTypeSelector.tsx +++ b/portal-ui/src/screens/Console/NotificationEndpoints/NotificationTypeSelector.tsx @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -import React, { Fragment, useState } from "react"; +import React, { Fragment } from "react"; import Grid from "@material-ui/core/Grid"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import { servicesList } from "./utils"; @@ -34,17 +34,6 @@ const withLogos = servicesList.filter((elService) => elService.logo !== ""); const styles = (theme: Theme) => createStyles({ ...settingsCommon, - mainCont: { - paddingLeft: 50, - paddingRight: 50, - }, - mainTitle: { - fontSize: 18, - color: "#000", - fontWeight: 600, - marginBottom: 10, - marginTop: 10, - }, ...typesSelection, });