Skip to content

Commit 07932a9

Browse files
MananTankarcoraven
authored andcommitted
minor changes
1 parent bd9df94 commit 07932a9

File tree

8 files changed

+23
-33
lines changed

8 files changed

+23
-33
lines changed

apps/dashboard/.storybook/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ const config: StorybookConfig = {
3030
experimentalRSC: true,
3131
},
3232
};
33-
export default config;
33+
export default config;

apps/dashboard/.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ function StoryLayout(props: {
106106
function ToasterSetup() {
107107
const { theme } = useTheme();
108108
return <Toaster richColors theme={theme === "light" ? "light" : "dark"} />;
109-
}
109+
}

apps/dashboard/public/assets/examples/example.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[
22
{
3+
"name": "Your Collection #1",
4+
"description": "Remember to replace this description",
5+
"image": "ipfs://NewUriToReplace/1.png",
36
"attributes": [
47
{
58
"trait_type": "Background",
@@ -29,12 +32,12 @@
2932
"trait_type": "Top lid",
3033
"value": "High"
3134
}
32-
],
33-
"description": "Remember to replace this description",
34-
"image": "ipfs://NewUriToReplace/1.png",
35-
"name": "Your Collection #1"
35+
]
3636
},
3737
{
38+
"name": "Your Collection #2",
39+
"description": "Remember to replace this description",
40+
"image": "ipfs://NewUriToReplace/2.png",
3841
"attributes": [
3942
{
4043
"trait_type": "Background",
@@ -64,9 +67,6 @@
6467
"trait_type": "Top lid",
6568
"value": "Middle"
6669
}
67-
],
68-
"description": "Remember to replace this description",
69-
"image": "ipfs://NewUriToReplace/2.png",
70-
"name": "Your Collection #2"
70+
]
7171
}
7272
]

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 }[];
40+
topics: { 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 }[];
79+
topics?: { id: string; filters: object | null }[];
8080
description?: string;
8181
isPaused?: boolean;
8282
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { getFiltersFromSearchParams, normalizeTimeISOString } from "@/lib/time";
1818
type SearchParams = {
1919
from?: string;
2020
to?: string;
21+
webhook?: string;
2122
interval?: "day" | "week";
2223
};
2324

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

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Textarea } from "@/components/ui/textarea";
1717
const TOPIC_IDS_THAT_SUPPORT_FILTERS = [
1818
"insight.event.confirmed",
1919
"insight.transaction.confirmed",
20-
] as const;
20+
];
2121

2222
interface TopicSelectorModalProps {
2323
open: boolean;
@@ -37,11 +37,7 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
3737
() => {
3838
const initialFilters: Record<string, string> = {};
3939
props.selectedTopics.forEach((topic) => {
40-
if (
41-
(topic.id.startsWith("insight.event.") ||
42-
topic.id.startsWith("insight.transaction.")) &&
43-
topic.filters
44-
) {
40+
if (topic.filters) {
4541
initialFilters[topic.id] = JSON.stringify(topic.filters, null, 2);
4642
}
4743
});
@@ -86,16 +82,11 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
8682
}
8783

8884
function handleSave() {
89-
// Validate and parse JSON filters for insight topics
9085
const processedSelection = tempSelection.map((topic) => {
91-
if (
92-
(topic.id.startsWith("insight.event.") ||
93-
topic.id.startsWith("insight.transaction.")) &&
94-
topicFilters[topic.id]
95-
) {
86+
const filters = topicFilters[topic.id];
87+
if (filters) {
9688
try {
97-
const parsedFilters = JSON.parse(topicFilters[topic.id]);
98-
return { ...topic, filters: parsedFilters };
89+
return { ...topic, filters: JSON.parse(filters) };
9990
} catch (_error) {
10091
toast.error(`Invalid JSON in filters for ${topic.id}`);
10192
throw new Error(`Invalid JSON in filters for ${topic.id}`);
@@ -113,11 +104,7 @@ export function TopicSelectorModal(props: TopicSelectorModalProps) {
113104
// Reset filter texts to original values
114105
const originalFilters: Record<string, string> = {};
115106
props.selectedTopics.forEach((topic) => {
116-
if (
117-
(topic.id.startsWith("insight.event.") ||
118-
topic.id.startsWith("insight.transaction.")) &&
119-
topic.filters
120-
) {
107+
if (topic.filters) {
121108
originalFilters[topic.id] = JSON.stringify(topic.filters, null, 2);
122109
}
123110
});

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ const formSchema = z.object({
4545
}),
4646
isPaused: z.boolean().default(false),
4747
topics: z
48-
.array(z.object({ id: z.string(), filters: z.object({}).optional() }))
48+
.array(
49+
z.object({ id: z.string(), filters: z.union([z.object({}), z.null()]) }),
50+
)
4951
.min(1, "At least one topic is required"),
5052
});
5153

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ function SortDropdown(props: {
384384
<DropdownMenuTrigger asChild>
385385
<Button className="gap-1.5 rounded-full bg-card" variant="outline">
386386
<ArrowUpDownIcon className="size-4 text-muted-foreground" />
387-
<span className="hidden lg:inline">Sort by</span>
387+
<span>Sort by</span>
388388
</Button>
389389
</DropdownMenuTrigger>
390390
<DropdownMenuContent

0 commit comments

Comments
 (0)