:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(alerts): explain pending destinations (#96776)
Vasco de Krijger09f895270b27
diff --git a/products/alerts/frontend/components/AlertNotificationDestinationEditor.test.tsx b/products/alerts/frontend/components/AlertNotificationDestinationEditor.test.tsxindex d8367a3a7cb4..5e2588ccdbd2 100644--- a/products/alerts/frontend/components/AlertNotificationDestinationEditor.test.tsx+++ b/products/alerts/frontend/components/AlertNotificationDestinationEditor.test.tsx@@ -25,6 +25,9 @@ jest.mock('@posthog/lemon-ui', () => ({LemonSelect: () => <select />,LemonSkeleton: () => <div>Loading integrations</div>,LemonTag: ({ children }: { children: ReactNode }) => <span>{children}</span>,+ Tooltip: ({ children, title }: { children: ReactNode; title: string }) => (+ <span data-tooltip={title}>{children}</span>+ ),}))jest.mock('lib/integrations/SlackIntegrationHelpers', () => ({@@ -123,4 +126,37 @@ describe('AlertNotificationDestinationEditor', () => {expect(onAdd).toHaveBeenCalledTimes(1)expect(onWizardKeyDown).not.toHaveBeenCalled()})++ it('explains how to save a pending destination', () => {+ render(+ <AlertNotificationDestinationEditor+ destinations={{+ showExisting: false,+ existingLoading: false,+ existing: [],+ pending: [{ key: 'webhook-0', title: 'Webhook', onRemove: jest.fn() }],+ }}+ notificationType={{ options: [], value: 'webhook', onChange: jest.fn() }}+ slack={{+ notificationType: 'slack',+ integrationsLoading: false,+ integrationsFailed: false,+ onRetryIntegrations: jest.fn(),+ integrations: [],+ channelValue: null,+ onChannelValueChange: jest.fn(),+ }}+ url={{+ input: { placeholder: 'https://example.com/webhook' },+ value: '',+ onChange: jest.fn(),+ }}+ add={{ onClick: jest.fn() }}+ />+ )++ expect(screen.getByText('Pending').closest('[data-tooltip]')?.getAttribute('data-tooltip')).toBe(+ 'Save this alert to add this destination.'+ )+ })})diff --git a/products/alerts/frontend/components/AlertNotificationDestinationEditor.tsx b/products/alerts/frontend/components/AlertNotificationDestinationEditor.tsxindex fd7b3aef3fbd..fb55f2ea7f0c 100644--- a/products/alerts/frontend/components/AlertNotificationDestinationEditor.tsx+++ b/products/alerts/frontend/components/AlertNotificationDestinationEditor.tsx@@ -10,6 +10,7 @@ import {LemonSkeleton,LemonTag,LemonTagType,+ Tooltip,} from '@posthog/lemon-ui'import { IntegrationChoice } from 'lib/components/CyclotronJob/integrations/IntegrationChoice'@@ -197,9 +198,11 @@ function PendingDestinations({<div className="flex-1 min-w-0"><div className="flex items-center gap-2 flex-wrap"><span className="text-sm font-medium truncate">{destination.title}</span>- <LemonTag type="warning" size="small">- Pending- </LemonTag>+ <Tooltip title="Save this alert to add this destination.">+ <LemonTag type="warning" size="small">+ Pending+ </LemonTag>+ </Tooltip></div>{destination.detail ? (<span className="text-xs text-muted-alt truncate block">{destination.detail}</span>