Skip to content

Commit 489dea7

Browse files
committed
add insight filter selection to webhook creation and update
1 parent f33e31a commit 489dea7

File tree

8 files changed

+721
-31
lines changed

8 files changed

+721
-31
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/create-webhook-config-modal.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { ThirdwebClient } from "thirdweb";
12
import type { Topic } from "@/api/webhook-configs";
23
import { WebhookConfigModal } from "./webhook-config-modal";
34

@@ -7,15 +8,19 @@ interface CreateWebhookConfigModalProps {
78
teamSlug: string;
89
projectSlug: string;
910
topics: Topic[];
11+
client?: ThirdwebClient;
12+
supportedChainIds?: Array<number>;
1013
}
1114

1215
export function CreateWebhookConfigModal(props: CreateWebhookConfigModalProps) {
1316
return (
1417
<WebhookConfigModal
18+
client={props.client}
1519
mode="create"
1620
onOpenChange={props.onOpenChange}
1721
open={props.open}
1822
projectSlug={props.projectSlug}
23+
supportedChainIds={props.supportedChainIds}
1924
teamSlug={props.teamSlug}
2025
topics={props.topics}
2126
/>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { ThirdwebClient } from "thirdweb";
12
import type { Topic, WebhookConfig } from "@/api/webhook-configs";
23
import { WebhookConfigModal } from "./webhook-config-modal";
34

@@ -8,15 +9,19 @@ interface EditWebhookConfigModalProps {
89
projectSlug: string;
910
topics: Topic[];
1011
webhookConfig: WebhookConfig;
12+
client?: ThirdwebClient;
13+
supportedChainIds?: Array<number>;
1114
}
1215

1316
export function EditWebhookConfigModal(props: EditWebhookConfigModalProps) {
1417
return (
1518
<WebhookConfigModal
19+
client={props.client}
1620
mode="edit"
1721
onOpenChange={props.onOpenChange}
1822
open={props.open}
1923
projectSlug={props.projectSlug}
24+
supportedChainIds={props.supportedChainIds}
2025
teamSlug={props.teamSlug}
2126
topics={props.topics}
2227
webhookConfig={props.webhookConfig}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/overview.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import { redirect } from "next/navigation";
4+
import type { ThirdwebClient } from "thirdweb";
45
import type { WebhookSummaryStats } from "@/types/analytics";
56
import type {
67
Topic,
@@ -16,6 +17,8 @@ interface WebhooksOverviewProps {
1617
webhookConfigs: WebhookConfig[];
1718
topics: Topic[];
1819
metricsMap: Map<string, WebhookSummaryStats | null>;
20+
client?: ThirdwebClient;
21+
supportedChainIds?: Array<number>;
1922
}
2023

2124
export function WebhooksOverview({
@@ -26,6 +29,8 @@ export function WebhooksOverview({
2629
webhookConfigs,
2730
topics,
2831
metricsMap,
32+
client,
33+
supportedChainIds,
2934
}: WebhooksOverviewProps) {
3035
// Feature is enabled (matches server component behavior)
3136
const isFeatureEnabled = true;
@@ -38,9 +43,11 @@ export function WebhooksOverview({
3843
// Show full webhook functionality
3944
return (
4045
<WebhookConfigsTable
46+
client={client}
4147
metricsMap={metricsMap}
4248
projectId={projectId}
4349
projectSlug={projectSlug}
50+
supportedChainIds={supportedChainIds}
4451
teamId={teamId}
4552
teamSlug={teamSlug}
4653
topics={topics}

0 commit comments

Comments
 (0)