From 2940e2bf59e0485c7e5fe2db44084ea30cc6408c Mon Sep 17 00:00:00 2001 From: Pawan Jain Date: Fri, 31 Jan 2025 20:00:34 +0530 Subject: [PATCH] fix: remove delete integration option from novu demo and in-app integrtaion --- .../integrations/components/update-integration-sidebar.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/components/integrations/components/update-integration-sidebar.tsx b/apps/dashboard/src/components/integrations/components/update-integration-sidebar.tsx index 6ceb7d910a4..f15e98c1e4e 100644 --- a/apps/dashboard/src/components/integrations/components/update-integration-sidebar.tsx +++ b/apps/dashboard/src/components/integrations/components/update-integration-sidebar.tsx @@ -15,6 +15,7 @@ import { IntegrationSheet } from './integration-sheet'; import { DeleteIntegrationModal } from './modals/delete-integration-modal'; import { SelectPrimaryIntegrationModal } from './modals/select-primary-integration-modal'; import { handleIntegrationError } from './utils/handle-integration-error'; +import { isDemoIntegration } from './utils/helpers'; type UpdateIntegrationSidebarProps = { isOpened: boolean; @@ -120,6 +121,9 @@ export function UpdateIntegrationSidebar({ isOpened }: UpdateIntegrationSidebarP if (!integration || !provider) return null; + const isIntegrationDeletionAllowed = + !isDemoIntegration(integration?.providerId) || integration?.channel !== ChannelTypeEnum.IN_APP; + return ( <> @@ -135,11 +139,12 @@ export function UpdateIntegrationSidebar({ isOpened }: UpdateIntegrationSidebarP
- {integration.channel !== ChannelTypeEnum.IN_APP && ( + {isIntegrationDeletionAllowed && ( )} +