@checkstack/integration-frontend 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/package.json +8 -8
- package/src/components/CreateSubscriptionDialog.tsx +45 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @checkstack/integration-frontend
|
|
2
2
|
|
|
3
|
+
## 0.2.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f676e11: Improve subscription creation UX by requiring event selection before showing provider configuration
|
|
8
|
+
|
|
9
|
+
The provider configuration section now waits for an event to be selected before rendering, preventing template validation errors when no payload properties are available yet.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [f676e11]
|
|
12
|
+
- @checkstack/ui@1.0.0
|
|
13
|
+
- @checkstack/common@0.6.2
|
|
14
|
+
- @checkstack/frontend-api@0.3.5
|
|
15
|
+
- @checkstack/integration-common@0.2.5
|
|
16
|
+
- @checkstack/signal-frontend@0.0.12
|
|
17
|
+
|
|
18
|
+
## 0.2.11
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [e5079e1]
|
|
23
|
+
- Updated dependencies [9551fd7]
|
|
24
|
+
- @checkstack/ui@0.5.3
|
|
25
|
+
|
|
3
26
|
## 0.2.10
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/integration-frontend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"checkstack": {
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"lint:code": "eslint . --max-warnings 0"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@checkstack/integration-common": "0.2.
|
|
16
|
-
"@checkstack/frontend-api": "0.3.
|
|
17
|
-
"@checkstack/signal-frontend": "0.0.
|
|
18
|
-
"@checkstack/common": "0.6.
|
|
19
|
-
"@checkstack/ui": "0.5.
|
|
15
|
+
"@checkstack/integration-common": "0.2.4",
|
|
16
|
+
"@checkstack/frontend-api": "0.3.4",
|
|
17
|
+
"@checkstack/signal-frontend": "0.0.11",
|
|
18
|
+
"@checkstack/common": "0.6.1",
|
|
19
|
+
"@checkstack/ui": "0.5.3",
|
|
20
20
|
"react": "^18.2.0",
|
|
21
21
|
"react-router-dom": "^6.22.0",
|
|
22
22
|
"lucide-react": "^0.344.0"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"typescript": "^5.0.0",
|
|
26
26
|
"@types/react": "^18.2.0",
|
|
27
|
-
"@checkstack/tsconfig": "0.0.
|
|
28
|
-
"@checkstack/scripts": "0.1.
|
|
27
|
+
"@checkstack/tsconfig": "0.0.3",
|
|
28
|
+
"@checkstack/scripts": "0.1.1"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -77,7 +77,7 @@ export const SubscriptionDialog = ({
|
|
|
77
77
|
const [name, setName] = useState("");
|
|
78
78
|
const [description, setDescription] = useState("");
|
|
79
79
|
const [providerConfig, setProviderConfig] = useState<Record<string, unknown>>(
|
|
80
|
-
{}
|
|
80
|
+
{},
|
|
81
81
|
);
|
|
82
82
|
const [selectedEventId, setSelectedEventId] = useState<string>("");
|
|
83
83
|
// Track whether DynamicForm fields are valid (all required fields filled)
|
|
@@ -86,18 +86,18 @@ export const SubscriptionDialog = ({
|
|
|
86
86
|
// Queries using hooks
|
|
87
87
|
const { data: events = [] } = client.listEventTypes.useQuery(
|
|
88
88
|
{},
|
|
89
|
-
{ enabled: open }
|
|
89
|
+
{ enabled: open },
|
|
90
90
|
);
|
|
91
91
|
|
|
92
92
|
const { data: connections = [], isLoading: loadingConnections } =
|
|
93
93
|
client.listConnections.useQuery(
|
|
94
94
|
{ providerId: selectedProvider?.qualifiedId ?? "" },
|
|
95
|
-
{ enabled: open && !!selectedProvider?.hasConnectionSchema }
|
|
95
|
+
{ enabled: open && !!selectedProvider?.hasConnectionSchema },
|
|
96
96
|
);
|
|
97
97
|
|
|
98
98
|
const { data: payloadSchemaData } = client.getEventPayloadSchema.useQuery(
|
|
99
99
|
{ eventId: selectedEventId },
|
|
100
|
-
{ enabled: open && !!selectedEventId }
|
|
100
|
+
{ enabled: open && !!selectedEventId },
|
|
101
101
|
);
|
|
102
102
|
|
|
103
103
|
const payloadProperties: PayloadProperty[] =
|
|
@@ -112,7 +112,9 @@ export const SubscriptionDialog = ({
|
|
|
112
112
|
},
|
|
113
113
|
onError: (error) => {
|
|
114
114
|
toast.error(
|
|
115
|
-
error instanceof Error
|
|
115
|
+
error instanceof Error
|
|
116
|
+
? error.message
|
|
117
|
+
: "Failed to create subscription",
|
|
116
118
|
);
|
|
117
119
|
setSaving(false);
|
|
118
120
|
},
|
|
@@ -127,7 +129,9 @@ export const SubscriptionDialog = ({
|
|
|
127
129
|
},
|
|
128
130
|
onError: (error) => {
|
|
129
131
|
toast.error(
|
|
130
|
-
error instanceof Error
|
|
132
|
+
error instanceof Error
|
|
133
|
+
? error.message
|
|
134
|
+
: "Failed to update subscription",
|
|
131
135
|
);
|
|
132
136
|
setSaving(false);
|
|
133
137
|
},
|
|
@@ -141,7 +145,9 @@ export const SubscriptionDialog = ({
|
|
|
141
145
|
},
|
|
142
146
|
onError: (error) => {
|
|
143
147
|
toast.error(
|
|
144
|
-
error instanceof Error
|
|
148
|
+
error instanceof Error
|
|
149
|
+
? error.message
|
|
150
|
+
: "Failed to delete subscription",
|
|
145
151
|
);
|
|
146
152
|
},
|
|
147
153
|
});
|
|
@@ -158,7 +164,7 @@ export const SubscriptionDialog = ({
|
|
|
158
164
|
if (open && subscription) {
|
|
159
165
|
// Find the provider for this subscription
|
|
160
166
|
const provider = providers.find(
|
|
161
|
-
(p) => p.qualifiedId === subscription.providerId
|
|
167
|
+
(p) => p.qualifiedId === subscription.providerId,
|
|
162
168
|
);
|
|
163
169
|
if (provider) {
|
|
164
170
|
setSelectedProvider(provider);
|
|
@@ -198,7 +204,7 @@ export const SubscriptionDialog = ({
|
|
|
198
204
|
if (!selectedProvider) return;
|
|
199
205
|
|
|
200
206
|
const hasCustomConfig = getProviderConfigExtension(
|
|
201
|
-
selectedProvider.qualifiedId
|
|
207
|
+
selectedProvider.qualifiedId,
|
|
202
208
|
);
|
|
203
209
|
const hasNoSchema =
|
|
204
210
|
!selectedProvider.configSchema ||
|
|
@@ -300,18 +306,18 @@ export const SubscriptionDialog = ({
|
|
|
300
306
|
} catch (error) {
|
|
301
307
|
console.error(
|
|
302
308
|
`Failed to fetch options for ${resolverName}:`,
|
|
303
|
-
error
|
|
309
|
+
error,
|
|
304
310
|
);
|
|
305
311
|
return [];
|
|
306
312
|
}
|
|
307
313
|
};
|
|
308
314
|
},
|
|
309
315
|
has: () => true, // All resolver names are valid
|
|
310
|
-
}
|
|
316
|
+
},
|
|
311
317
|
) as Record<
|
|
312
318
|
string,
|
|
313
319
|
(
|
|
314
|
-
formValues: Record<string, unknown
|
|
320
|
+
formValues: Record<string, unknown>,
|
|
315
321
|
) => Promise<{ value: string; label: string }[]>
|
|
316
322
|
>;
|
|
317
323
|
// Note: getOptionsMutation intentionally omitted - mutation objects change on every render
|
|
@@ -333,17 +339,17 @@ export const SubscriptionDialog = ({
|
|
|
333
339
|
{isEditMode
|
|
334
340
|
? `Edit ${selectedProvider?.displayName ?? "Subscription"}`
|
|
335
341
|
: step === "provider"
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
342
|
+
? "Select Provider"
|
|
343
|
+
: `Configure ${
|
|
344
|
+
selectedProvider?.displayName ?? "Subscription"
|
|
345
|
+
}`}
|
|
340
346
|
</DialogTitle>
|
|
341
347
|
<DialogDescription className="sr-only">
|
|
342
348
|
{isEditMode
|
|
343
349
|
? "Edit the settings for this integration subscription"
|
|
344
350
|
: step === "provider"
|
|
345
|
-
|
|
346
|
-
|
|
351
|
+
? "Choose a provider for your integration subscription"
|
|
352
|
+
: "Configure the subscription settings"}
|
|
347
353
|
</DialogDescription>
|
|
348
354
|
</DialogHeader>
|
|
349
355
|
|
|
@@ -462,7 +468,7 @@ export const SubscriptionDialog = ({
|
|
|
462
468
|
integrationRoutes.routes.connections,
|
|
463
469
|
{
|
|
464
470
|
providerId: selectedProvider.qualifiedId,
|
|
465
|
-
}
|
|
471
|
+
},
|
|
466
472
|
)}
|
|
467
473
|
>
|
|
468
474
|
Configure Connections
|
|
@@ -489,14 +495,30 @@ export const SubscriptionDialog = ({
|
|
|
489
495
|
</div>
|
|
490
496
|
)}
|
|
491
497
|
|
|
492
|
-
{/* Provider Config */}
|
|
498
|
+
{/* Provider Config - only show when event is selected */}
|
|
493
499
|
{selectedProvider &&
|
|
494
500
|
(() => {
|
|
495
501
|
// Check if provider has a custom config component
|
|
496
502
|
const extension = getProviderConfigExtension(
|
|
497
|
-
selectedProvider.qualifiedId
|
|
503
|
+
selectedProvider.qualifiedId,
|
|
498
504
|
);
|
|
499
505
|
|
|
506
|
+
// Require event selection before showing config with template support
|
|
507
|
+
if (!selectedEventId) {
|
|
508
|
+
// Only show message if provider has configuration options
|
|
509
|
+
if (extension || selectedProvider.configSchema) {
|
|
510
|
+
return (
|
|
511
|
+
<div className="border rounded-md p-4 bg-muted/50">
|
|
512
|
+
<p className="text-sm text-muted-foreground">
|
|
513
|
+
Select an event above to configure provider options
|
|
514
|
+
with template support.
|
|
515
|
+
</p>
|
|
516
|
+
</div>
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
return <></>;
|
|
520
|
+
}
|
|
521
|
+
|
|
500
522
|
if (extension) {
|
|
501
523
|
// Render custom component
|
|
502
524
|
const CustomConfig = extension.ConfigComponent;
|
|
@@ -597,8 +619,8 @@ export const SubscriptionDialog = ({
|
|
|
597
619
|
? "Saving..."
|
|
598
620
|
: "Creating..."
|
|
599
621
|
: isEditMode
|
|
600
|
-
|
|
601
|
-
|
|
622
|
+
? "Save Changes"
|
|
623
|
+
: "Create Subscription"}
|
|
602
624
|
</Button>
|
|
603
625
|
)}
|
|
604
626
|
</DialogFooter>
|