Skip to content

Commit 4f02f6e

Browse files
authored
chore: add webhook secret to table, fix api error (#7606)
1 parent 72f75ea commit 4f02f6e

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

apps/dashboard/src/@/api/webhook-configs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type WebhookConfigsResponse =
3737
};
3838

3939
interface CreateWebhookConfigRequest {
40-
topics: { id: string; filters: object | null }[];
40+
topicIdsWithFilters: { id: string; filters: object | null }[];
4141
destinationUrl: string;
4242
description: string;
4343
isPaused?: boolean;
@@ -76,7 +76,7 @@ type TopicsResponse =
7676

7777
interface UpdateWebhookConfigRequest {
7878
destinationUrl?: string;
79-
topics?: { id: string; filters: object | null }[];
79+
topicIdsWithFilters?: { id: string; filters: object | null }[];
8080
description?: string;
8181
isPaused?: boolean;
8282
}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/webhook-config-modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function WebhookConfigModal(props: WebhookConfigModalProps) {
9797
description: values.description,
9898
destinationUrl: values.destinationUrl,
9999
isPaused: values.isPaused,
100-
topics: processedTopics,
100+
topicIdsWithFilters: processedTopics,
101101
},
102102
projectIdOrSlug: props.projectSlug,
103103
teamIdOrSlug: props.teamSlug,
@@ -115,7 +115,7 @@ export function WebhookConfigModal(props: WebhookConfigModalProps) {
115115
description: values.description,
116116
destinationUrl: values.destinationUrl,
117117
isPaused: values.isPaused,
118-
topics: processedTopics,
118+
topicIdsWithFilters: processedTopics,
119119
},
120120
projectIdOrSlug: props.projectSlug,
121121
teamIdOrSlug: props.teamSlug,

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/webhook-configs-table.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export function WebhookConfigsTable(props: {
187187
<TableHead className="w-[150px]">Destination URL</TableHead>
188188
<TableHead>Topics</TableHead>
189189
<TableHead>Activity (24h)</TableHead>
190+
<TableHead>Webhook Secret</TableHead>
190191
<TableHead>Created</TableHead>
191192
<TableHead className="w-[50px]"></TableHead>
192193
</TableRow>
@@ -258,6 +259,22 @@ export function WebhookConfigsTable(props: {
258259
metrics={props.metricsMap.get(config.id) || null}
259260
/>
260261
</TableCell>
262+
<TableCell>
263+
{config.webhookSecret ? (
264+
<CopyTextButton
265+
className="max-w-[120px] text-sm text-muted-foreground font-mono justify-start p-0 h-auto"
266+
textToCopy={config.webhookSecret}
267+
textToShow={`...${config.webhookSecret.slice(-4)}`}
268+
variant="ghost"
269+
copyIconPosition="right"
270+
tooltip="Copy webhook secret"
271+
/>
272+
) : (
273+
<span className="text-sm text-muted-foreground">
274+
No secret
275+
</span>
276+
)}
277+
</TableCell>
261278
<TableCell className="text-muted-foreground">
262279
{config.createdAt
263280
? format(new Date(config.createdAt), "MMM d, yyyy")

0 commit comments

Comments
 (0)