diff --git a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts index e08791bbef6..06cea016399 100644 --- a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts +++ b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts @@ -30,7 +30,7 @@ export const PLATFORM_WEBHOOKS_MOCK_DATA: Record

Endpoints

+
onSearchChange(event.target.value)} /> + @@ -109,6 +111,7 @@ export const PlatformWebhooksEndpointList = ({ {filteredEndpoints.length === 0 ? ( @@ -171,15 +174,17 @@ export const PlatformWebhooksEndpointList = ({

{displayName}

{hasName && ( -

{endpoint.url}

+

+ {endpoint.url} +

)}
{formatEventCount(endpoint.eventTypes)} - + -

+

by {endpoint.createdBy}

diff --git a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksHeader.tsx b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksHeader.tsx index 1e1d08101d9..30acfbc864b 100644 --- a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksHeader.tsx +++ b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksHeader.tsx @@ -74,18 +74,7 @@ export const PlatformWebhooksHeader = ({ {headerDescription} - {hasSelectedEndpoint ? ( - endpointActions - ) : ( - <> - - - - )} + {hasSelectedEndpoint ? endpointActions : } diff --git a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksPage.tsx b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksPage.tsx index 513f2340c7c..388cfe7f814 100644 --- a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksPage.tsx +++ b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksPage.tsx @@ -128,9 +128,18 @@ export const PlatformWebhooksPage = ({ scope, endpointId }: PlatformWebhooksPage () => endpoints.find((endpoint) => endpoint.id === endpointIdPendingDelete) ?? null, [endpoints, endpointIdPendingDelete] ) + const endpointPendingDeleteHasName = endpointPendingDelete + ? endpointPendingDelete.name.trim().length > 0 + : false const endpointPendingDeleteDisplayName = endpointPendingDelete ? getWebhookEndpointDisplayName(endpointPendingDelete) : '' + let deleteEndpointDescription = 'This action cannot be undone.' + if (endpointPendingDelete) { + deleteEndpointDescription = endpointPendingDeleteHasName + ? `Deleting “${endpointPendingDeleteDisplayName}” stops all deliveries to the URL below. This can’t be undone.` + : 'Deleting this endpoint stops all deliveries to the URL below. This can’t be undone.' + } useEffect(() => { if (!platformWebhooksEnabled) { @@ -233,7 +242,7 @@ export const PlatformWebhooksPage = ({ scope, endpointId }: PlatformWebhooksPage setDeliverySearch('') } setEndpointIdPendingDelete(null) - toast.success(`Deleted endpoint "${endpointPendingDeleteDisplayName}"`) + toast.success('Endpoint deleted') } const handleUpsertEndpoint = (values: EndpointFormValues) => { @@ -333,14 +342,14 @@ export const PlatformWebhooksPage = ({ scope, endpointId }: PlatformWebhooksPage className="gap-x-2" onClick={() => setShowRegenerateSecretConfirm(true)} > - + Regenerate secret setEndpointIdPendingDelete(selectedEndpoint.id)} > - + Delete endpoint @@ -420,14 +429,13 @@ export const PlatformWebhooksPage = ({ scope, endpointId }: PlatformWebhooksPage Delete endpoint - - {endpointPendingDelete - ? endpointPendingDelete.name.trim().length > 0 - ? `This will delete endpoint "${endpointPendingDeleteDisplayName}" with URL ${endpointPendingDelete.url}. This action cannot be undone.` - : `This will delete endpoint ${endpointPendingDelete.url}. This action cannot be undone.` - : 'This action cannot be undone.'} - + {deleteEndpointDescription} + {endpointPendingDelete && ( +
+              {endpointPendingDelete.url}
+            
+ )} Cancel