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 (
- +
+ Database +
+
+ {database.map((item) => { + return ( + + ); + })} +
+
+ Functions +
+
+ {functions.map((item) => { + return ( + + ); + })} +
+
@@ -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) => {