Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dashboard): remove delete integration option from novu demo and in-app #7634

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 (
<>
<IntegrationSheet isOpened={isOpened} onClose={handleClose} provider={provider} mode="update">
Expand All @@ -135,11 +139,12 @@ export function UpdateIntegrationSidebar({ isOpened }: UpdateIntegrationSidebarP
</div>

<div className="bg-background flex justify-between gap-2 border-t p-3">
{integration.channel !== ChannelTypeEnum.IN_APP && (
{isIntegrationDeletionAllowed && (
<Button variant="error" mode="ghost" isLoading={isDeleting} onClick={() => setIsDeleteDialogOpen(true)}>
Delete Integration
</Button>
)}

<Button
type="submit"
form="integration-configuration-form"
Expand Down
Loading