diff --git a/apps/dashboard/src/components/primitives/help-tooltip-indicator.tsx b/apps/dashboard/src/components/primitives/help-tooltip-indicator.tsx
index b712a1de004..e35dd7d29ef 100644
--- a/apps/dashboard/src/components/primitives/help-tooltip-indicator.tsx
+++ b/apps/dashboard/src/components/primitives/help-tooltip-indicator.tsx
@@ -16,9 +16,7 @@ export function HelpTooltipIndicator({ text, className, size = '5' }: HelpToolti
-
- {text}
-
+ {text}
);
}
diff --git a/apps/dashboard/src/pages/integrations/components/create-integration-sidebar.tsx b/apps/dashboard/src/pages/integrations/components/create-integration-sidebar.tsx
index 44db7f66103..5cede5f38c9 100644
--- a/apps/dashboard/src/pages/integrations/components/create-integration-sidebar.tsx
+++ b/apps/dashboard/src/pages/integrations/components/create-integration-sidebar.tsx
@@ -1,5 +1,5 @@
import { useNavigate, useParams } from 'react-router-dom';
-import { ChannelTypeEnum, providers as novuProviders } from '@novu/shared';
+import { providers as novuProviders } from '@novu/shared';
import { useCreateIntegration } from '@/hooks/use-create-integration';
import { useIntegrationList } from './hooks/use-integration-list';
import { useSidebarNavigationManager } from './hooks/use-sidebar-navigation-manager';
@@ -18,7 +18,6 @@ import { buildRoute, ROUTES } from '../../../utils/routes';
export type CreateIntegrationSidebarProps = {
isOpened: boolean;
onClose: () => void;
- scrollToChannel?: ChannelTypeEnum;
};
export function CreateIntegrationSidebar({ isOpened, onClose }: CreateIntegrationSidebarProps) {
@@ -56,12 +55,13 @@ export function CreateIntegrationSidebar({ isOpened, onClose }: CreateIntegratio
existingPrimaryIntegration,
isChannelSupportPrimary,
} = useIntegrationPrimaryModal({
- onSubmit,
+ onSubmit: handleCreateIntegration,
integrations,
channel: provider?.channel,
mode: 'create',
});
- async function onSubmit(data: IntegrationFormData) {
+
+ async function handleCreateIntegration(data: IntegrationFormData) {
if (!provider) return;
try {
diff --git a/apps/dashboard/src/pages/integrations/components/update-integration-sidebar.tsx b/apps/dashboard/src/pages/integrations/components/update-integration-sidebar.tsx
index 1b7b1b83b34..7aa5fa2c3bb 100644
--- a/apps/dashboard/src/pages/integrations/components/update-integration-sidebar.tsx
+++ b/apps/dashboard/src/pages/integrations/components/update-integration-sidebar.tsx
@@ -14,6 +14,7 @@ import { useDeleteIntegration } from '../../../hooks/use-delete-integration';
import { handleIntegrationError } from './utils/handle-integration-error';
import { useIntegrationPrimaryModal } from './hooks/use-integration-primary-modal';
import { useNavigate, useParams } from 'react-router-dom';
+import { ROUTES } from '../../../utils/routes';
type UpdateIntegrationSidebarProps = {
isOpened: boolean;
@@ -76,7 +77,7 @@ export function UpdateIntegrationSidebar({ isOpened, onClose }: UpdateIntegratio
}
onClose();
- } catch (error: any) {
+ } catch (error: unknown) {
handleIntegrationError(error, 'update');
}
}
@@ -89,14 +90,14 @@ export function UpdateIntegrationSidebar({ isOpened, onClose }: UpdateIntegratio
toast.success('Integration deleted successfully');
setIsDeleteDialogOpen(false);
onClose();
- } catch (error: any) {
+ } catch (error: unknown) {
handleIntegrationError(error, 'delete');
}
};
const handleClose = () => {
onClose();
- navigate('/integrations');
+ navigate(ROUTES.INTEGRATIONS);
};
if (!integration || !provider) return null;
diff --git a/apps/dashboard/src/pages/integrations/components/utils/handle-integration-error.ts b/apps/dashboard/src/pages/integrations/components/utils/handle-integration-error.ts
index 1376229bbf1..9684a905ac8 100644
--- a/apps/dashboard/src/pages/integrations/components/utils/handle-integration-error.ts
+++ b/apps/dashboard/src/pages/integrations/components/utils/handle-integration-error.ts
@@ -1,5 +1,6 @@
import { toast } from 'sonner';
import { CheckIntegrationResponseEnum } from '@/api/integrations';
+import * as Sentry from '@sentry/react';
export function handleIntegrationError(error: any, operation: 'update' | 'create' | 'delete') {
if (error?.message?.code === CheckIntegrationResponseEnum.INVALID_EMAIL) {
@@ -11,6 +12,8 @@ export function handleIntegrationError(error: any, operation: 'update' | 'create
description: error.message?.message,
});
} else {
+ Sentry.captureException(error);
+
toast.error(`Failed to ${operation} integration`, {
description: error?.message?.message || error?.message || `There was an error ${operation}ing the integration.`,
});