diff --git a/portal-ui/src/common/SecureComponent/permissions.ts b/portal-ui/src/common/SecureComponent/permissions.ts index e0c179c72..7499f0aac 100644 --- a/portal-ui/src/common/SecureComponent/permissions.ts +++ b/portal-ui/src/common/SecureComponent/permissions.ts @@ -204,10 +204,9 @@ export const IAM_PAGES = { /* Documentation **/ DOCUMENTATION: "/documentation", /* TBD ? */ - NOTIFICATIONS_ENDPOINTS: "/settings/notification-endpoints", - NOTIFICATIONS_ENDPOINTS_ADD: "/settings/notification-endpoints/add", - NOTIFICATIONS_ENDPOINTS_ADD_SERVICE: - "/settings/notification-endpoints/add/:service", + EVENT_DESTINATIONS: "/settings/event-destinations", + EVENT_DESTINATIONS_ADD: "/settings/event-destinations/add", + EVENT_DESTINATIONS_ADD_SERVICE: "/settings/event-destinations/add/:service", TIERS: "/settings/tiers", TIERS_ADD: "/settings/tiers/add", TIERS_ADD_SERVICE: "/settings/tiers/add/:service", @@ -412,15 +411,15 @@ export const IAM_PAGES_PERMISSIONS = { [IAM_PAGES.SETTINGS_VIEW]: [ IAM_SCOPES.ADMIN_CONFIG_UPDATE, // displays configuration list ], - [IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD_SERVICE]: [ + [IAM_PAGES.EVENT_DESTINATIONS_ADD_SERVICE]: [ IAM_SCOPES.ADMIN_SERVER_INFO, IAM_SCOPES.ADMIN_CONFIG_UPDATE, ], - [IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD]: [ + [IAM_PAGES.EVENT_DESTINATIONS_ADD]: [ IAM_SCOPES.ADMIN_SERVER_INFO, IAM_SCOPES.ADMIN_CONFIG_UPDATE, ], - [IAM_PAGES.NOTIFICATIONS_ENDPOINTS]: [ + [IAM_PAGES.EVENT_DESTINATIONS]: [ IAM_SCOPES.ADMIN_SERVER_INFO, // displays notifications endpoints IAM_SCOPES.ADMIN_CONFIG_UPDATE, // displays create notification button ], diff --git a/portal-ui/src/screens/Console/Common/ContentBox.tsx b/portal-ui/src/screens/Console/Common/ContentBox.tsx deleted file mode 100644 index 5c52617ae..000000000 --- a/portal-ui/src/screens/Console/Common/ContentBox.tsx +++ /dev/null @@ -1,40 +0,0 @@ -// This file is part of MinIO Console Server -// Copyright (c) 2022 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 { Box } from "@mui/material"; - -type Props = { - children: React.ReactNode; -}; - -const ContentBox: React.FC = ({ children }) => { - return ( - - {children} - - ); -}; - -export default ContentBox; diff --git a/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationForm.tsx b/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationForm.tsx index 6683a5a39..845a03351 100644 --- a/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationForm.tsx +++ b/portal-ui/src/screens/Console/Configurations/ConfigurationPanels/ConfigurationForm.tsx @@ -18,7 +18,7 @@ import React from "react"; import { useLocation } from "react-router-dom"; import Grid from "@mui/material/Grid"; import { configurationElements } from "../utils"; -import EditConfiguration from "../../NotificationEndpoints/CustomForms/EditConfiguration"; +import EditConfiguration from "../../EventDestinations/CustomForms/EditConfiguration"; const ConfigurationsList = () => { const { pathname = "" } = useLocation(); diff --git a/portal-ui/src/screens/Console/Console.tsx b/portal-ui/src/screens/Console/Console.tsx index acc293411..0f0ee9883 100644 --- a/portal-ui/src/screens/Console/Console.tsx +++ b/portal-ui/src/screens/Console/Console.tsx @@ -69,14 +69,14 @@ const RegisterOperator = React.lazy(() => import("./Support/RegisterOperator")); const AddTenant = React.lazy(() => import("./Tenants/AddTenant/AddTenant")); -const NotificationEndpoints = React.lazy( - () => import("./NotificationEndpoints/NotificationEndpoints") +const EventDestinations = React.lazy( + () => import("./EventDestinations/EventDestinations") ); -const AddNotificationEndpoint = React.lazy( - () => import("./NotificationEndpoints/AddNotificationEndpoint") +const AddEventDestination = React.lazy( + () => import("./EventDestinations/AddEventDestination") ); -const NotificationTypeSelector = React.lazy( - () => import("./NotificationEndpoints/NotificationTypeSelector") +const EventTypeSelector = React.lazy( + () => import("./EventDestinations/EventTypeSelector") ); const ListTiersConfiguration = React.lazy( @@ -425,16 +425,16 @@ const Console = ({ classes }: IConsoleProps) => { path: IAM_PAGES.SETTINGS, }, { - component: AddNotificationEndpoint, - path: IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD_SERVICE, + component: AddEventDestination, + path: IAM_PAGES.EVENT_DESTINATIONS_ADD_SERVICE, }, { - component: NotificationTypeSelector, - path: IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD, + component: EventTypeSelector, + path: IAM_PAGES.EVENT_DESTINATIONS_ADD, }, { - component: NotificationEndpoints, - path: IAM_PAGES.NOTIFICATIONS_ENDPOINTS, + component: EventDestinations, + path: IAM_PAGES.EVENT_DESTINATIONS, }, { component: AddTierConfiguration, diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/AddNotificationEndpoint.tsx b/portal-ui/src/screens/Console/EventDestinations/AddEventDestination.tsx similarity index 95% rename from portal-ui/src/screens/Console/NotificationEndpoints/AddNotificationEndpoint.tsx rename to portal-ui/src/screens/Console/EventDestinations/AddEventDestination.tsx index bce86e816..ebe6b20d3 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/AddNotificationEndpoint.tsx +++ b/portal-ui/src/screens/Console/EventDestinations/AddEventDestination.tsx @@ -29,7 +29,7 @@ import { notifyMysql, notifyPostgres, removeEmptyFields, - servicesList, + destinationList, } from "./utils"; import { modalBasic, @@ -110,7 +110,7 @@ interface IAddNotificationEndpointProps { classes: any; } -const AddNotificationEndpoint = ({ +const AddEventDestination = ({ saveAndRefresh, classes, }: IAddNotificationEndpointProps) => { @@ -134,7 +134,7 @@ const AddNotificationEndpoint = ({ .then(() => { setSaving(false); dispatch(setServerNeedsRestart(true)); - navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS); + navigate(IAM_PAGES.EVENT_DESTINATIONS); }) .catch((err: ErrorResponseHandler) => { setSaving(false); @@ -175,7 +175,7 @@ const AddNotificationEndpoint = ({ } } - const targetElement = servicesList.find( + const targetElement = destinationList.find( (element) => element.actionTrigger === service ); @@ -186,7 +186,7 @@ const AddNotificationEndpoint = ({ navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD)} + onClick={() => navigate(IAM_PAGES.EVENT_DESTINATIONS_ADD)} /> } @@ -230,7 +230,7 @@ const AddNotificationEndpoint = ({ type="submit" variant="callAction" disabled={saving} - label={"Save Notification Target"} + label={"Save Event Destination"} /> @@ -242,4 +242,4 @@ const AddNotificationEndpoint = ({ ); }; -export default withStyles(styles)(AddNotificationEndpoint); +export default withStyles(styles)(AddEventDestination); diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/ConfTargetGeneric.tsx b/portal-ui/src/screens/Console/EventDestinations/ConfTargetGeneric.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/ConfTargetGeneric.tsx rename to portal-ui/src/screens/Console/EventDestinations/ConfTargetGeneric.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/ConfirmDeleteTargetModal.tsx b/portal-ui/src/screens/Console/EventDestinations/ConfirmDeleteDestinationModal.tsx similarity index 90% rename from portal-ui/src/screens/Console/NotificationEndpoints/ConfirmDeleteTargetModal.tsx rename to portal-ui/src/screens/Console/EventDestinations/ConfirmDeleteDestinationModal.tsx index cb84a3fab..1f2e79258 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/ConfirmDeleteTargetModal.tsx +++ b/portal-ui/src/screens/Console/EventDestinations/ConfirmDeleteDestinationModal.tsx @@ -3,7 +3,7 @@ import ConfirmDialog from "../Common/ModalWrapper/ConfirmDialog"; import { ConfirmModalIcon } from "mds"; import { DialogContentText } from "@mui/material"; -const ConfirmDeleteTargetModal = ({ +const ConfirmDeleteDestinationModal = ({ onConfirm, onClose, serviceName, @@ -36,4 +36,4 @@ const ConfirmDeleteTargetModal = ({ ); }; -export default ConfirmDeleteTargetModal; +export default ConfirmDeleteDestinationModal; diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/CustomForms/ConfMySql.tsx b/portal-ui/src/screens/Console/EventDestinations/CustomForms/ConfMySql.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/CustomForms/ConfMySql.tsx rename to portal-ui/src/screens/Console/EventDestinations/CustomForms/ConfMySql.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/CustomForms/ConfPostgres.tsx b/portal-ui/src/screens/Console/EventDestinations/CustomForms/ConfPostgres.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/CustomForms/ConfPostgres.tsx rename to portal-ui/src/screens/Console/EventDestinations/CustomForms/ConfPostgres.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/CustomForms/EditConfiguration.tsx b/portal-ui/src/screens/Console/EventDestinations/CustomForms/EditConfiguration.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/CustomForms/EditConfiguration.tsx rename to portal-ui/src/screens/Console/EventDestinations/CustomForms/EditConfiguration.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/CustomForms/ResetConfigurationModal.tsx b/portal-ui/src/screens/Console/EventDestinations/CustomForms/ResetConfigurationModal.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/CustomForms/ResetConfigurationModal.tsx rename to portal-ui/src/screens/Console/EventDestinations/CustomForms/ResetConfigurationModal.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/NotificationEndpoints.tsx b/portal-ui/src/screens/Console/EventDestinations/EventDestinations.tsx similarity index 84% rename from portal-ui/src/screens/Console/NotificationEndpoints/NotificationEndpoints.tsx rename to portal-ui/src/screens/Console/EventDestinations/EventDestinations.tsx index 370f78c8e..03154f906 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/NotificationEndpoints.tsx +++ b/portal-ui/src/screens/Console/EventDestinations/EventDestinations.tsx @@ -20,16 +20,16 @@ import React, { Fragment } from "react"; import withSuspense from "../Common/Components/withSuspense"; const ListNotificationEndpoints = withSuspense( - React.lazy(() => import("./ListNotificationEndpoints")) + React.lazy(() => import("./ListEventDestinations")) ); -const NotificationEndpoints = () => { +const EventDestinations = () => { return ( - + ); }; -export default NotificationEndpoints; +export default EventDestinations; diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/NotificationTypeSelector.tsx b/portal-ui/src/screens/Console/EventDestinations/EventTypeSelector.tsx similarity index 50% rename from portal-ui/src/screens/Console/NotificationEndpoints/NotificationTypeSelector.tsx rename to portal-ui/src/screens/Console/EventDestinations/EventTypeSelector.tsx index c1bd5d0e7..ce6bd5cdd 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/NotificationTypeSelector.tsx +++ b/portal-ui/src/screens/Console/EventDestinations/EventTypeSelector.tsx @@ -19,14 +19,13 @@ import { Theme } from "@mui/material/styles"; import { useNavigate } from "react-router-dom"; import createStyles from "@mui/styles/createStyles"; import withStyles from "@mui/styles/withStyles"; -import { servicesList } from "./utils"; +import { destinationList, DestType } from "./utils"; import { settingsCommon, typesSelection, } from "../Common/FormComponents/common/styleLibrary"; import PageLayout from "../Common/Layout/PageLayout"; import { IAM_PAGES } from "../../../common/SecureComponent/permissions"; -import ContentBox from "../Common/ContentBox"; import { Box } from "@mui/material"; import NotificationEndpointTypeSelectorHelpBox from "../Account/NotificationEndpointTypeSelectorHelpBox"; import { BackLink, PageHeader } from "mds"; @@ -35,7 +34,16 @@ interface INotificationTypeSelector { classes: any; } -const withLogos = servicesList.filter((elService) => elService.logo !== ""); +const withLogos = destinationList.filter((elService) => elService.logo !== ""); +const database = withLogos.filter( + (elService) => elService.category === DestType.DB +); +const queue = withLogos.filter( + (elService) => elService.category === DestType.Queue +); +const functions = withLogos.filter( + (elService) => elService.category === DestType.Func +); const styles = (theme: Theme) => createStyles({ @@ -43,7 +51,7 @@ const styles = (theme: Theme) => ...typesSelection, }); -const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => { +const EventTypeSelector = ({ classes }: INotificationTypeSelector) => { const navigate = useNavigate(); return ( @@ -51,8 +59,8 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => { label={ navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS)} + label={"Event Destinations"} + onClick={() => navigate(IAM_PAGES.EVENT_DESTINATIONS)} /> } @@ -62,8 +70,8 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => { { border: "1px solid #eaeaea", }} > - + - Select Target Type + Queue - {withLogos.map((item) => { + {queue.map((item) => { return ( { navigate( - `${IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD}/${item.actionTrigger}` + `${IAM_PAGES.EVENT_DESTINATIONS_ADD}/${item.actionTrigger}` ); }} > @@ -102,7 +110,67 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => { ); })} - + + Database + + + {database.map((item) => { + return ( + { + navigate( + `${IAM_PAGES.EVENT_DESTINATIONS_ADD}/${item.actionTrigger}` + ); + }} + > + + + + + + {item.targetTitle} + + + ); + })} + + + Functions + + + {functions.map((item) => { + return ( + { + navigate( + `${IAM_PAGES.EVENT_DESTINATIONS_ADD}/${item.actionTrigger}` + ); + }} + > + + + + + + {item.targetTitle} + + + ); + })} + + @@ -110,4 +178,4 @@ const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => { ); }; -export default withStyles(styles)(NotificationTypeSelector); +export default withStyles(styles)(EventTypeSelector); diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/ListNotificationEndpoints.tsx b/portal-ui/src/screens/Console/EventDestinations/ListEventDestinations.tsx similarity index 93% rename from portal-ui/src/screens/Console/NotificationEndpoints/ListNotificationEndpoints.tsx rename to portal-ui/src/screens/Console/EventDestinations/ListEventDestinations.tsx index 83d25707a..e39cf789e 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/ListNotificationEndpoints.tsx +++ b/portal-ui/src/screens/Console/EventDestinations/ListEventDestinations.tsx @@ -51,7 +51,7 @@ import { setServerNeedsRestart, } from "../../../systemSlice"; import { useAppDispatch } from "../../../store"; -import ConfirmDeleteTargetModal from "./ConfirmDeleteTargetModal"; +import ConfirmDeleteDestinationModal from "./ConfirmDeleteDestinationModal"; import TooltipWrapper from "../Common/TooltipWrapper/TooltipWrapper"; interface IListNotificationEndpoints { @@ -82,7 +82,7 @@ const styles = (theme: Theme) => }, }); -const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => { +const ListEventDestinations = ({ classes }: IListNotificationEndpoints) => { const dispatch = useAppDispatch(); const navigate = useNavigate(); //Local States @@ -191,7 +191,7 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => { } @@ -200,14 +200,14 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => { }} /> - + } onClick={() => { - navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD); + navigate(IAM_PAGES.EVENT_DESTINATIONS_ADD); }} /> @@ -274,7 +274,7 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => { > } help={ @@ -288,10 +288,10 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => { To get started,{" "} { - navigate(IAM_PAGES.NOTIFICATIONS_ENDPOINTS_ADD); + navigate(IAM_PAGES.EVENT_DESTINATIONS_ADD); }} > - Add a Notification Target + Add an Event Destination . @@ -304,7 +304,7 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => { )} {isDelConfirmOpen ? ( - { resetNotificationConfig(selNotifyEndPoint); }} @@ -320,4 +320,4 @@ const ListNotificationEndpoints = ({ classes }: IListNotificationEndpoints) => { ); }; -export default withStyles(styles)(ListNotificationEndpoints); +export default withStyles(styles)(ListEventDestinations); diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/WebhookSettings/AddEndpointModal.tsx b/portal-ui/src/screens/Console/EventDestinations/WebhookSettings/AddEndpointModal.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/WebhookSettings/AddEndpointModal.tsx rename to portal-ui/src/screens/Console/EventDestinations/WebhookSettings/AddEndpointModal.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/WebhookSettings/DeleteWebhookEndpoint.tsx b/portal-ui/src/screens/Console/EventDestinations/WebhookSettings/DeleteWebhookEndpoint.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/WebhookSettings/DeleteWebhookEndpoint.tsx rename to portal-ui/src/screens/Console/EventDestinations/WebhookSettings/DeleteWebhookEndpoint.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/WebhookSettings/EditWebhookEndpoint.tsx b/portal-ui/src/screens/Console/EventDestinations/WebhookSettings/EditWebhookEndpoint.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/WebhookSettings/EditWebhookEndpoint.tsx rename to portal-ui/src/screens/Console/EventDestinations/WebhookSettings/EditWebhookEndpoint.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/WebhookSettings/WebhookSettings.tsx b/portal-ui/src/screens/Console/EventDestinations/WebhookSettings/WebhookSettings.tsx similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/WebhookSettings/WebhookSettings.tsx rename to portal-ui/src/screens/Console/EventDestinations/WebhookSettings/WebhookSettings.tsx diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/types.ts b/portal-ui/src/screens/Console/EventDestinations/types.ts similarity index 100% rename from portal-ui/src/screens/Console/NotificationEndpoints/types.ts rename to portal-ui/src/screens/Console/EventDestinations/types.ts diff --git a/portal-ui/src/screens/Console/NotificationEndpoints/utils.ts b/portal-ui/src/screens/Console/EventDestinations/utils.ts similarity index 97% rename from portal-ui/src/screens/Console/NotificationEndpoints/utils.ts rename to portal-ui/src/screens/Console/EventDestinations/utils.ts index 0bacb9217..772dc216e 100644 --- a/portal-ui/src/screens/Console/NotificationEndpoints/utils.ts +++ b/portal-ui/src/screens/Console/EventDestinations/utils.ts @@ -42,56 +42,72 @@ export const notificationTransform = ( }); }; -export const servicesList = [ +export class DestType { + static DB: string = "database"; + static Queue: string = "queue"; + static Func: string = "functions"; +} + +export const destinationList = [ { actionTrigger: notifyPostgres, targetTitle: "PostgreSQL", logo: "/postgres-logo.svg", + category: DestType.DB, }, { actionTrigger: notifyKafka, targetTitle: "Kafka", logo: "/kafka-logo.svg", + category: DestType.Queue, }, { actionTrigger: notifyAmqp, targetTitle: "AMQP", logo: "/amqp-logo.svg", + category: DestType.Queue, }, { actionTrigger: notifyMqtt, targetTitle: "MQTT", logo: "/mqtt-logo.svg", + category: DestType.Queue, }, { actionTrigger: notifyRedis, targetTitle: "Redis", logo: "/redis-logo.svg", + category: DestType.Queue, }, { actionTrigger: notifyNats, targetTitle: "NATS", logo: "/nats-logo.svg", + category: DestType.Queue, }, { actionTrigger: notifyMysql, targetTitle: "Mysql", logo: "/mysql-logo.svg", + category: DestType.DB, }, { actionTrigger: notifyElasticsearch, targetTitle: "Elastic Search", logo: "/elasticsearch-logo.svg", + category: DestType.DB, }, { actionTrigger: notifyWebhooks, targetTitle: "Webhook", logo: "/webhooks-logo.svg", + category: DestType.Func, }, { actionTrigger: notifyNsq, targetTitle: "NSQ", logo: "/nsq-logo.svg", + category: DestType.Queue, }, ]; diff --git a/portal-ui/src/screens/Console/valid-routes.ts b/portal-ui/src/screens/Console/valid-routes.ts index 01206a141..413fc188d 100644 --- a/portal-ui/src/screens/Console/valid-routes.ts +++ b/portal-ui/src/screens/Console/valid-routes.ts @@ -232,8 +232,8 @@ export const validRoutes = ( { group: "Administrator", component: NavLink, - to: IAM_PAGES.NOTIFICATIONS_ENDPOINTS, - name: "Notifications", + to: IAM_PAGES.EVENT_DESTINATIONS, + name: "Events", icon: LambdaIcon, id: "lambda", }, @@ -241,7 +241,7 @@ export const validRoutes = ( group: "Administrator", component: NavLink, to: IAM_PAGES.TIERS, - name: "Tiers", + name: "Tiering", icon: TiersIcon, id: "tiers", }, @@ -285,44 +285,38 @@ export const validRoutes = ( name: "Support", id: "support", icon: SupportMenuIcon, - children: [ - { - name: "Health", - id: "diagnostics", - component: NavLink, - icon: HealthMenuIcon, - to: IAM_PAGES.TOOLS_DIAGNOSTICS, - }, - { - name: "Performance", - id: "performance", - component: NavLink, - icon: PerformanceMenuIcon, - to: IAM_PAGES.TOOLS_SPEEDTEST, - }, - { - name: "Profile", - id: "profile", - component: NavLink, - icon: ProfileMenuIcon, - to: IAM_PAGES.PROFILE, - }, - - // { - // name: "Call Home", - // id: "callhome", - // component: NavLink, - // icon: CallHomeMenuIcon, - // to: IAM_PAGES.CALL_HOME, - // }, - { - name: "Inspect", - id: "inspectObjects", - to: IAM_PAGES.SUPPORT_INSPECT, - icon: InspectMenuIcon, - component: NavLink, - }, - ], + }, + { + group: "Subscription", + name: "Health", + id: "diagnostics", + component: NavLink, + icon: HealthMenuIcon, + to: IAM_PAGES.TOOLS_DIAGNOSTICS, + }, + { + group: "Subscription", + name: "Performance", + id: "performance", + component: NavLink, + icon: PerformanceMenuIcon, + to: IAM_PAGES.TOOLS_SPEEDTEST, + }, + { + group: "Subscription", + name: "Profile", + id: "profile", + component: NavLink, + icon: ProfileMenuIcon, + to: IAM_PAGES.PROFILE, + }, + { + group: "Subscription", + name: "Inspect", + id: "inspectObjects", + to: IAM_PAGES.SUPPORT_INSPECT, + icon: InspectMenuIcon, + component: NavLink, }, ]; diff --git a/portal-ui/tests/operator/login/login.ts b/portal-ui/tests/operator/login/login.ts index 570ddfcb7..8a4537784 100644 --- a/portal-ui/tests/operator/login/login.ts +++ b/portal-ui/tests/operator/login/login.ts @@ -16,7 +16,6 @@ import * as roles from "../../utils/roles"; import * as elements from "../../utils/elements"; -import { diagnosticsElement, supportElement } from "../../utils/elements-menu"; fixture("For user with default permissions").page("http://localhost:9090"); diff --git a/portal-ui/tests/permissions-1/notificationEndpoints.ts b/portal-ui/tests/permissions-1/notificationEndpoints.ts index 78dbbc433..e67261705 100644 --- a/portal-ui/tests/permissions-1/notificationEndpoints.ts +++ b/portal-ui/tests/permissions-1/notificationEndpoints.ts @@ -29,15 +29,15 @@ test("Notification Endpoints sidebar item exists", async (t) => { }); test("Add Notification Target button exists", async (t) => { - const addNotifTargetButtonExists = elements.addNotifTargetButton.exists; + const addNotifTargetButtonExists = elements.addEventDestination.exists; await t - .navigateTo("http://localhost:9090/settings/notification-endpoints") + .navigateTo("http://localhost:9090/settings/event-destinations") .expect(addNotifTargetButtonExists) .ok(); }); test("Add Notification Target button is clickable", async (t) => { await t - .navigateTo("http://localhost:9090/settings/notification-endpoints") - .click(elements.addNotifTargetButton); + .navigateTo("http://localhost:9090/settings/event-destinations") + .click(elements.addEventDestination); }); diff --git a/portal-ui/tests/permissions-2/inspect.ts b/portal-ui/tests/permissions-2/inspect.ts index e691762d8..bd66ca627 100644 --- a/portal-ui/tests/permissions-2/inspect.ts +++ b/portal-ui/tests/permissions-2/inspect.ts @@ -94,17 +94,9 @@ fixture("For user with Inspect permissions") test("Inspect page can be opened", async (t) => { await t.navigateTo(inspectScreenUrl); }); -test("Inspect sidebar item exists", async (t) => { - await t.expect(supportSidebarEl.exists).ok(); -}); test("Inspect link exists in Menu list", async (t) => { - await t - .expect(supportSidebarEl.exists) - .ok() - .click(supportSidebarEl) - .expect(inspectEl.exists) - .ok(); + await t.expect(inspectEl.exists).ok(); }); test("Form Input states verification", async (t) => { diff --git a/portal-ui/tests/permissions-3/admin.ts b/portal-ui/tests/permissions-3/admin.ts index 59462626e..96becf18c 100644 --- a/portal-ui/tests/permissions-3/admin.ts +++ b/portal-ui/tests/permissions-3/admin.ts @@ -25,7 +25,6 @@ import { monitoringElement, notificationEndpointsElement, serviceAcctsElement, - supportElement, tiersElement, usersElement, } from "../utils/elements-menu"; @@ -61,9 +60,6 @@ test("All sidebar items exist", async (t) => { .ok() .expect(tiersElement.exists) .ok() - .expect(supportElement.exists) - .ok() - .click(supportElement) .expect(elements.diagnosticsElement.exists) .ok() .expect(elements.performanceElement.exists) diff --git a/portal-ui/tests/permissions-3/logs.ts b/portal-ui/tests/permissions-3/logs.ts index 460c1044c..5f678e538 100644 --- a/portal-ui/tests/permissions-3/logs.ts +++ b/portal-ui/tests/permissions-3/logs.ts @@ -16,11 +16,7 @@ import * as roles from "../utils/roles"; import * as elements from "../utils/elements"; -import { - logsElement, - monitoringElement, - supportElement, -} from "../utils/elements-menu"; +import { logsElement, monitoringElement } from "../utils/elements-menu"; fixture("For user with Logs permissions") .page("http://localhost:9090") diff --git a/portal-ui/tests/permissions-4/watch.ts b/portal-ui/tests/permissions-4/watch.ts index 70d0627a9..5b3d1756c 100644 --- a/portal-ui/tests/permissions-4/watch.ts +++ b/portal-ui/tests/permissions-4/watch.ts @@ -16,13 +16,9 @@ import * as roles from "../utils/roles"; import * as elements from "../utils/elements"; -import * as functions from "../utils/functions"; -import { - watchElement, - monitoringElement, - supportElement, -} from "../utils/elements-menu"; import { bucketDropdownOptionFor } from "../utils/elements"; +import * as functions from "../utils/functions"; +import { monitoringElement, watchElement } from "../utils/elements-menu"; fixture("For user with Watch permissions") .page("http://localhost:9090") diff --git a/portal-ui/tests/permissions-5/diagnostics.ts b/portal-ui/tests/permissions-5/diagnostics.ts index 3b9cd6afe..37b4426c6 100644 --- a/portal-ui/tests/permissions-5/diagnostics.ts +++ b/portal-ui/tests/permissions-5/diagnostics.ts @@ -16,23 +16,13 @@ import * as roles from "../utils/roles"; import * as elements from "../utils/elements"; -import { diagnosticsElement, supportElement } from "../utils/elements-menu"; +import { diagnosticsElement } from "../utils/elements-menu"; import { ClientFunction } from "testcafe"; fixture("For user with Diagnostics permissions").page("http://localhost:9090"); -test("Support sidebar item exists", async (t) => { - await t.useRole(roles.diagnostics).expect(supportElement.exists).ok(); -}); - test("Diagnostics link exists in Tools page", async (t) => { - await t - .useRole(roles.diagnostics) - .expect(supportElement.exists) - .ok() - .click(supportElement) - .expect(diagnosticsElement.exists) - .ok(); + await t.useRole(roles.diagnostics).expect(diagnosticsElement.exists).ok(); }); test("Diagnostics page can be opened", async (t) => { diff --git a/portal-ui/tests/permissions-6/heal.ts b/portal-ui/tests/permissions-6/heal.ts index 637a4a635..fd99f28ad 100644 --- a/portal-ui/tests/permissions-6/heal.ts +++ b/portal-ui/tests/permissions-6/heal.ts @@ -16,13 +16,9 @@ import * as roles from "../utils/roles"; import * as elements from "../utils/elements"; -import * as functions from "../utils/functions"; -import { - drivesElement, - monitoringElement, - supportElement, -} from "../utils/elements-menu"; import { bucketDropdownOptionFor } from "../utils/elements"; +import * as functions from "../utils/functions"; +import { drivesElement, monitoringElement } from "../utils/elements-menu"; fixture("For user with Heal permissions") .page("http://localhost:9090") diff --git a/portal-ui/tests/utils/elements-menu.ts b/portal-ui/tests/utils/elements-menu.ts index 95bd9522e..8453c4e81 100644 --- a/portal-ui/tests/utils/elements-menu.ts +++ b/portal-ui/tests/utils/elements-menu.ts @@ -82,22 +82,14 @@ export const tiersElement = Selector(".MuiPaper-root") .find("ul") .child("#tiers"); -export const supportElement = Selector(".MuiPaper-root") +export const diagnosticsElement = Selector(".MuiPaper-root") .find("ul") - .child("#support"); -export const supportChildren = Selector("#support-children"); - -export const diagnosticsElement = supportChildren - .find("a") - .withAttribute("href", "/support/diagnostics"); -export const performanceElement = supportChildren - .find("a") - .withAttribute("href", "/support/speedtest"); -export const callHomeElement = supportChildren - .find("a") - .withAttribute("href", "/support/call-home"); -export const profileElement = supportChildren - .find("a") - .withAttribute("href", "/support/profile"); + .child("#diagnostics"); +export const performanceElement = Selector(".MuiPaper-root") + .find("ul") + .child("#performance"); +export const profileElement = Selector(".MuiPaper-root") + .find("ul") + .child("#profile"); export const licenseElement = sidebarItem.withAttribute("href", "/license"); diff --git a/portal-ui/tests/utils/elements.ts b/portal-ui/tests/utils/elements.ts index 53fa525a2..a04455d89 100644 --- a/portal-ui/tests/utils/elements.ts +++ b/portal-ui/tests/utils/elements.ts @@ -16,7 +16,6 @@ import * as constants from "./constants"; import { Selector } from "testcafe"; -import { IAM_PAGES } from "../../src/common/SecureComponent/permissions"; //---------------------------------------------------- // Buttons //---------------------------------------------------- @@ -32,35 +31,16 @@ export const createPolicyButton = Selector("button:enabled").withText("Create Policy"); export const saveButton = Selector("button:enabled").withText("Save"); export const deleteButton = Selector("button:enabled").withExactText("Delete"); -export const deleteIconButton = Selector("button:enabled").withAttribute( - "aria-label", - "Delete" -); -export const deleteIconButtonAlt = Selector("button:enabled").withAttribute( - "aria-label", - "delete" -); -export const configureBucketButton = Selector( - 'span[class*="MuiIconButton-root"]' -).withAttribute("aria-label", "Configure Bucket"); -export const addNotifTargetButton = Selector("button:enabled").withText( - "Add Notification Target" + +export const addEventDestination = Selector("button:enabled").withText( + "Add Event Destination" ); export const createTierButton = Selector("button:enabled").withText("Create Tier"); -export const createBucketButton = - Selector("button:enabled").withText("Create Bucket"); -export const deleteBucketButton = - Selector("button:enabled").withText("Delete Bucket"); export const createUserButton = Selector("button:enabled").withText("Create User"); export const createGroupButton = Selector("button:enabled").withText("Create Group"); -export const deleteGroupIconButton = Selector("span") - .withAttribute("aria-label", "Delete Group") - .find("button:enabled"); -export const editMembersButton = - Selector("button:enabled").withText("Edit Members"); export const addAccessRuleButton = Selector("button:enabled").withText("Add Access Rule"); export const startDiagnosticButton = @@ -68,17 +48,8 @@ export const startDiagnosticButton = export const startNewDiagnosticButton = Selector("#start-new-diagnostic"); export const downloadButton = Selector("button:enabled").withText("Download"); export const startButton = Selector("button:enabled").withText("Start"); -export const stopButton = Selector("button:enabled").withText("Stop"); export const assignPoliciesButton = Selector("button:enabled").withText("Assign Policies"); -//---------------------------------------------------- -// Links -//---------------------------------------------------- -export const logsLink = Selector("a").withText("Logs"); -export const watchLink = Selector("a").withText("Watch"); -export const traceLink = Selector("a").withText("Trace"); -export const healLink = Selector("a").withText("Heal"); -export const diagnosticsLink = Selector("a").withText("Diagnostics"); //---------------------------------------------------- // Switches