From a5b768472086ee0f3c5f97b37c12a9e839ec8693 Mon Sep 17 00:00:00 2001 From: DonOmalVindula Date: Tue, 31 Oct 2023 15:38:36 +0530 Subject: [PATCH 1/2] Add config to disable email provider in super org --- .../pages/notification-channels.tsx | 46 +++++++++++-------- .../pages/wsfed-configuration.tsx | 31 +++---------- .../console/src/public/deployment.config.json | 2 +- 3 files changed, 34 insertions(+), 45 deletions(-) diff --git a/apps/console/src/features/notification-channels/pages/notification-channels.tsx b/apps/console/src/features/notification-channels/pages/notification-channels.tsx index 8387c55074e..c65e7375193 100644 --- a/apps/console/src/features/notification-channels/pages/notification-channels.tsx +++ b/apps/console/src/features/notification-channels/pages/notification-channels.tsx @@ -17,6 +17,7 @@ */ import Grid from "@oxygen-ui/react/Grid"; +import { OrganizationType } from "@wso2is/common"; import { IdentifiableComponentInterface } from "@wso2is/core/models"; import { PageLayout } from "@wso2is/react-components"; import React, { FunctionComponent, ReactElement } from "react"; @@ -26,6 +27,7 @@ import { Divider } from "semantic-ui-react"; import { ReactComponent as EmailIcon } from "../../../themes/default/assets/images/icons/email-icon.svg"; import { ReactComponent as SMSIcon } from "../../../themes/default/assets/images/icons/sms-icon.svg"; import { AppConstants, AppState, FeatureConfigInterface, history } from "../../core"; +import { useGetOrganizationType } from "../../organizations/hooks/use-get-organization-type"; import { SettingsSection } from "../settings/settings-section"; /** @@ -45,6 +47,8 @@ export const NotificationChannelPage: FunctionComponent state.config.ui.features); /** @@ -65,8 +69,10 @@ export const NotificationChannelPage: FunctionComponent - <> - { featureConfig.emailProviders?.enabled ? ( + { featureConfig.emailProviders?.enabled + && !(featureConfig?.emailProviders?.disabledFeatures?.includes("superTenantProvider") + && orgType === OrganizationType.SUPER_ORGANIZATION) && ( + <> - ) : null } -