@agent-native/dispatch 0.15.13 → 0.15.14
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/dist/actions/create-workspace-resource.d.ts +13 -13
- package/dist/actions/delete-destination.d.ts +12 -12
- package/dist/actions/delete-workspace-resource.d.ts +13 -13
- package/dist/actions/provider-api-register.d.ts +9 -9
- package/dist/actions/update-workspace-resource.d.ts +13 -13
- package/dist/components/messaging-setup-panel.d.ts.map +1 -1
- package/dist/components/messaging-setup-panel.js +96 -72
- package/dist/components/messaging-setup-panel.js.map +1 -1
- package/dist/routes/pages/approvals.d.ts.map +1 -1
- package/dist/routes/pages/approvals.js +13 -9
- package/dist/routes/pages/approvals.js.map +1 -1
- package/dist/routes/pages/destinations.d.ts.map +1 -1
- package/dist/routes/pages/destinations.js +33 -30
- package/dist/routes/pages/destinations.js.map +1 -1
- package/package.json +3 -3
- package/src/components/messaging-setup-panel.spec.tsx +51 -0
- package/src/components/messaging-setup-panel.tsx +601 -512
- package/src/routes/pages/approvals.tsx +75 -57
- package/src/routes/pages/destinations.tsx +107 -85
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destinations.js","sourceRoot":"","sources":["../../../src/routes/pages/destinations.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,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AC;gDACpB,GAAG,OAAO;gDACV,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK;6CAC1B,CAAC,CAAC,EAEL,WAAW,EAAE,CAAC,CAAC,iCAAiC,CAAC,GACjD,EACF,KAAC,MAAM,IACL,SAAS,EAAC,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CACZ,MAAM,CAAC,MAAM,CAAC;gDACZ,IAAI,EAAE,IAAI,CAAC,IAAI;gDACf,QAAQ,EAAE,IAAI,CAAC,QAA0C;gDACzD,WAAW,EAAE,IAAI,CAAC,WAAW;gDAC7B,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,SAAS;gDACtC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;6CAC/B,CAAC,EAEJ,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,YAExC,CAAC,CAAC,gCAAgC,CAAC,GAC7B,IACL,IACE,IACN,IACF,GACQ,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { TaskQueueHealth } from \"../../components/task-queue-health\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../../components/ui/alert-dialog\";\nimport { Button } from \"../../components/ui/button\";\nimport { Input } from \"../../components/ui/input\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../components/ui/select\";\nimport { Textarea } from \"../../components/ui/textarea\";\n\nexport function meta() {\n return [{ title: \"Destinations — Dispatch\" }];\n}\n\nfunction QuickSendRow({\n destination,\n}: {\n destination: { id: string; name: string };\n}) {\n const t = useT();\n const [text, setText] = useState(\"\");\n const send = useActionMutation(\"send-platform-message\", {\n onSuccess: () => {\n toast.success(t(\"dispatch.pages.messageSent\"));\n setText(\"\");\n },\n onError: (error) => {\n toast.error(\n error instanceof Error\n ? error.message\n : t(\"dispatch.pages.unableToSendMessage\"),\n );\n },\n });\n return (\n <div className=\"mt-3 flex gap-2\">\n <Input\n value={text}\n onChange={(event) => setText(event.target.value)}\n placeholder={t(\"dispatch.pages.quickTestMessage\")}\n />\n <Button\n onClick={() =>\n send.mutate({\n destinationId: destination.id,\n text: text || `Test message to ${destination.name}`,\n })\n }\n disabled={send.isPending}\n >\n {t(\"dispatch.pages.send\")}\n </Button>\n </div>\n );\n}\n\nexport default function DestinationsRoute() {\n const t = useT();\n const destinationsQuery = useActionQuery(\"list-destinations\", {});\n const { data } = destinationsQuery;\n const [form, setForm] = useState({\n name: \"\",\n platform: \"slack\",\n destination: \"\",\n threadRef: \"\",\n notes: \"\",\n });\n\n const upsert = useActionMutation(\"upsert-destination\", {\n onSuccess: () => {\n toast.success(t(\"dispatch.pages.destinationSaved\"));\n setForm((current) => ({\n ...current,\n name: \"\",\n destination: \"\",\n threadRef: \"\",\n notes: \"\",\n }));\n },\n });\n const remove = useActionMutation(\"delete-destination\", {\n onSuccess: () => toast.success(t(\"dispatch.pages.destinationRemoved\")),\n });\n\n return (\n <DispatchShell\n title={t(\"dispatch.nav.destinations\")}\n description={t(\"dispatch.pages.destinationsDescription\")}\n >\n <div className=\"flex flex-col gap-4\">\n <TaskQueueHealth />\n <div className=\"grid gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(0,0.9fr)]\">\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n {t(\"dispatch.pages.savedDestinations\")}\n </h2>\n {destinationsQuery.isError ? (\n <ActionQueryError\n className=\"mt-4\"\n error={destinationsQuery.error}\n onRetry={() => void destinationsQuery.refetch()}\n />\n ) : (\n <div className=\"mt-4 space-y-3\">\n {(data || []).map((destination: any) => (\n <div\n key={destination.id}\n className=\"rounded-xl border bg-muted/30 p-4\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-medium text-foreground\">\n {destination.name}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {destination.platform} · {destination.destination}\n {destination.threadRef\n ? ` · thread ${destination.threadRef}`\n : \"\"}\n </div>\n {destination.notes && (\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {destination.notes}\n </p>\n )}\n </div>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"outline\" size=\"sm\">\n {t(\"dispatch.pages.delete\")}\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {t(\"dispatch.pages.deleteDestinationTitle\")}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {t(\n \"dispatch.pages.deleteDestinationDescription\",\n {\n name: destination.name,\n },\n )}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>\n {t(\"dispatch.pages.cancel\")}\n </AlertDialogCancel>\n <AlertDialogAction\n onClick={() =>\n remove.mutate({ id: destination.id })\n }\n >\n {t(\"dispatch.pages.delete\")}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n <QuickSendRow destination={destination} />\n </div>\n ))}\n {(data?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-8 text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noDestinations\")}\n </div>\n )}\n </div>\n )}\n </section>\n\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n {t(\"dispatch.pages.addDestination\")}\n </h2>\n <div className=\"mt-4 space-y-3\">\n <Input\n value={form.name}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n name: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.dailyDigestChannel\")}\n />\n <Select\n value={form.platform}\n onValueChange={(value) =>\n setForm((current) => ({\n ...current,\n platform: value,\n }))\n }\n >\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"slack\">Slack</SelectItem>\n <SelectItem value=\"telegram\">Telegram</SelectItem>\n <SelectItem value=\"email\">Email</SelectItem>\n </SelectContent>\n </Select>\n <Input\n value={form.destination}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n destination: event.target.value,\n }))\n }\n placeholder={\n form.platform === \"slack\"\n ? \"C0123456789\"\n : form.platform === \"email\"\n ? \"teammate+qa@agent-native.test\"\n : \"123456789\"\n }\n />\n <Input\n value={form.threadRef}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n threadRef: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.optionalThreadOrTopicId\")}\n />\n <Textarea\n value={form.notes}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n notes: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.destinationNotes\")}\n />\n <Button\n className=\"w-full\"\n onClick={() =>\n upsert.mutate({\n name: form.name,\n platform: form.platform as \"slack\" | \"telegram\" | \"email\",\n destination: form.destination,\n threadRef: form.threadRef || undefined,\n notes: form.notes || undefined,\n })\n }\n disabled={!form.name || !form.destination}\n >\n {t(\"dispatch.pages.saveDestination\")}\n </Button>\n </div>\n </section>\n </div>\n </div>\n </DispatchShell>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"destinations.js","sourceRoot":"","sources":["../../../src/routes/pages/destinations.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,O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AAE,IAAI,CAAC,SAAS,IAAI,SAAS;4CACtC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;yCAC/B,CAAC,EAEJ,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,YAExC,CAAC,CAAC,gCAAgC,CAAC,GAC7B,IACL,GACa,IACT,IACV,GACQ,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useActionMutation,\n useActionQuery,\n} from \"@agent-native/core/client/hooks\";\nimport { useT } from \"@agent-native/core/client/i18n\";\nimport { IconChevronRight } from \"@tabler/icons-react\";\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\n\nimport { ActionQueryError } from \"../../components/action-query-error\";\nimport { DispatchShell } from \"../../components/dispatch-shell\";\nimport { TaskQueueHealth } from \"../../components/task-queue-health\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../../components/ui/alert-dialog\";\nimport { Button } from \"../../components/ui/button\";\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../components/ui/collapsible\";\nimport { Input } from \"../../components/ui/input\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"../../components/ui/select\";\nimport { Textarea } from \"../../components/ui/textarea\";\n\nexport function meta() {\n return [{ title: \"Destinations — Dispatch\" }];\n}\n\nfunction QuickSendRow({\n destination,\n}: {\n destination: { id: string; name: string };\n}) {\n const t = useT();\n const [text, setText] = useState(\"\");\n const send = useActionMutation(\"send-platform-message\", {\n onSuccess: () => {\n toast.success(t(\"dispatch.pages.messageSent\"));\n setText(\"\");\n },\n onError: (error) => {\n toast.error(\n error instanceof Error\n ? error.message\n : t(\"dispatch.pages.unableToSendMessage\"),\n );\n },\n });\n return (\n <div className=\"mt-3 flex gap-2\">\n <Input\n value={text}\n onChange={(event) => setText(event.target.value)}\n placeholder={t(\"dispatch.pages.quickTestMessage\")}\n />\n <Button\n onClick={() =>\n send.mutate({\n destinationId: destination.id,\n text: text || `Test message to ${destination.name}`,\n })\n }\n disabled={send.isPending}\n >\n {t(\"dispatch.pages.send\")}\n </Button>\n </div>\n );\n}\n\nexport default function DestinationsRoute() {\n const t = useT();\n const destinationsQuery = useActionQuery(\"list-destinations\", {});\n const { data } = destinationsQuery;\n const [form, setForm] = useState({\n name: \"\",\n platform: \"slack\",\n destination: \"\",\n threadRef: \"\",\n notes: \"\",\n });\n const [addOpen, setAddOpen] = useState(false);\n\n const upsert = useActionMutation(\"upsert-destination\", {\n onSuccess: () => {\n toast.success(t(\"dispatch.pages.destinationSaved\"));\n setForm((current) => ({\n ...current,\n name: \"\",\n destination: \"\",\n threadRef: \"\",\n notes: \"\",\n }));\n },\n });\n const remove = useActionMutation(\"delete-destination\", {\n onSuccess: () => toast.success(t(\"dispatch.pages.destinationRemoved\")),\n });\n\n return (\n <DispatchShell\n title={t(\"dispatch.nav.destinations\")}\n description={t(\"dispatch.pages.destinationsDescription\")}\n >\n <div className=\"flex flex-col gap-4\">\n <TaskQueueHealth />\n <section className=\"rounded-2xl border bg-card p-5\">\n <h2 className=\"text-lg font-semibold text-foreground\">\n {t(\"dispatch.pages.savedDestinations\")}\n </h2>\n {destinationsQuery.isError ? (\n <ActionQueryError\n className=\"mt-4\"\n error={destinationsQuery.error}\n onRetry={() => void destinationsQuery.refetch()}\n />\n ) : (\n <div className=\"mt-4 divide-y\">\n {(data || []).map((destination: any) => (\n <div key={destination.id} className=\"py-4 first:pt-0\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-medium text-foreground\">\n {destination.name}\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">\n {destination.platform} · {destination.destination}\n {destination.threadRef\n ? ` · thread ${destination.threadRef}`\n : \"\"}\n </div>\n {destination.notes && (\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {destination.notes}\n </p>\n )}\n </div>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"outline\" size=\"sm\">\n {t(\"dispatch.pages.delete\")}\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>\n {t(\"dispatch.pages.deleteDestinationTitle\")}\n </AlertDialogTitle>\n <AlertDialogDescription>\n {t(\"dispatch.pages.deleteDestinationDescription\", {\n name: destination.name,\n })}\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>\n {t(\"dispatch.pages.cancel\")}\n </AlertDialogCancel>\n <AlertDialogAction\n onClick={() =>\n remove.mutate({ id: destination.id })\n }\n >\n {t(\"dispatch.pages.delete\")}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n <Collapsible className=\"mt-3\">\n <CollapsibleTrigger className=\"group flex w-full cursor-pointer items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground\">\n <IconChevronRight className=\"h-3.5 w-3.5 transition-transform group-data-[state=open]:rotate-90\" />\n <span>Send a test message</span>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <QuickSendRow destination={destination} />\n </CollapsibleContent>\n </Collapsible>\n </div>\n ))}\n {(data?.length || 0) === 0 && (\n <div className=\"rounded-xl border border-dashed px-4 py-8 text-sm text-muted-foreground\">\n {t(\"dispatch.pages.noDestinations\")}\n </div>\n )}\n </div>\n )}\n </section>\n\n <Collapsible\n open={addOpen}\n onOpenChange={setAddOpen}\n className=\"rounded-2xl border bg-card\"\n >\n <CollapsibleTrigger className=\"group flex w-full cursor-pointer items-center justify-between gap-3 p-5 text-left hover:bg-muted/20\">\n <span>\n <span className=\"block text-lg font-semibold text-foreground\">\n {t(\"dispatch.pages.addDestination\")}\n </span>\n <span className=\"mt-1 block text-sm text-muted-foreground\">\n Save a reusable delivery target for scheduled or agent-sent\n messages.\n </span>\n </span>\n <IconChevronRight className=\"h-5 w-5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90\" />\n </CollapsibleTrigger>\n <CollapsibleContent className=\"border-t px-5 pb-5 pt-4\">\n <div className=\"space-y-3\">\n <Input\n value={form.name}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n name: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.dailyDigestChannel\")}\n />\n <Select\n value={form.platform}\n onValueChange={(value) =>\n setForm((current) => ({\n ...current,\n platform: value,\n }))\n }\n >\n <SelectTrigger>\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"slack\">Slack</SelectItem>\n <SelectItem value=\"telegram\">Telegram</SelectItem>\n <SelectItem value=\"email\">Email</SelectItem>\n </SelectContent>\n </Select>\n <Input\n value={form.destination}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n destination: event.target.value,\n }))\n }\n placeholder={\n form.platform === \"slack\"\n ? \"C0123456789\"\n : form.platform === \"email\"\n ? \"teammate+qa@agent-native.test\"\n : \"123456789\"\n }\n />\n <Input\n value={form.threadRef}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n threadRef: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.optionalThreadOrTopicId\")}\n />\n <Textarea\n value={form.notes}\n onChange={(event) =>\n setForm((current) => ({\n ...current,\n notes: event.target.value,\n }))\n }\n placeholder={t(\"dispatch.pages.destinationNotes\")}\n />\n <Button\n className=\"w-full\"\n onClick={() =>\n upsert.mutate({\n name: form.name,\n platform: form.platform as \"slack\" | \"telegram\" | \"email\",\n destination: form.destination,\n threadRef: form.threadRef || undefined,\n notes: form.notes || undefined,\n })\n }\n disabled={!form.name || !form.destination}\n >\n {t(\"dispatch.pages.saveDestination\")}\n </Button>\n </div>\n </CollapsibleContent>\n </Collapsible>\n </div>\n </DispatchShell>\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/dispatch",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.14",
|
|
4
4
|
"description": "Dispatch — workspace control plane for agent-native apps. Vault, integrations, destinations, scheduled jobs, and cross-app delegation, shipped as a single drop-in package.",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"tailwind-merge": "^3.5.0",
|
|
87
87
|
"vaul": "^1.1.2",
|
|
88
88
|
"zod": "^4.3.6",
|
|
89
|
-
"@agent-native/toolkit": "0.10.
|
|
89
|
+
"@agent-native/toolkit": "0.10.2"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@react-router/dev": "^8.1.0",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"typescript-7": "npm:typescript@^7.0.2",
|
|
101
101
|
"vite": "8.1.0",
|
|
102
102
|
"vitest": "^4.1.5",
|
|
103
|
-
"@agent-native/core": "0.
|
|
103
|
+
"@agent-native/core": "0.119.2"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"@agent-native/core": ">=0.8.0",
|
|
@@ -42,6 +42,9 @@ vi.mock("@agent-native/core/client/i18n", () => ({
|
|
|
42
42
|
useT: () => (key: string) =>
|
|
43
43
|
(
|
|
44
44
|
({
|
|
45
|
+
"messaging.managed.title": "Managed Slack workspaces",
|
|
46
|
+
"messaging.managed.description":
|
|
47
|
+
"Install managed Slack workspaces with channel identities.",
|
|
45
48
|
"messaging.managed.agentManifest": "Agent manifest",
|
|
46
49
|
"messaging.managed.agentManifestDescription":
|
|
47
50
|
"The Agent manifest enables Slack's Agent view and direct messages.",
|
|
@@ -133,6 +136,33 @@ describe("MessagingSetupPanel", () => {
|
|
|
133
136
|
expect(container.textContent).toContain("Email");
|
|
134
137
|
expect(container.textContent).toContain("Email description");
|
|
135
138
|
expect(container.textContent).not.toContain("Discord");
|
|
139
|
+
expect(
|
|
140
|
+
container.querySelector(
|
|
141
|
+
'a[href="/_agent-native/integrations/slack/manifest"]',
|
|
142
|
+
),
|
|
143
|
+
).toBeNull();
|
|
144
|
+
const slackTrigger = [...container.querySelectorAll("button")].find(
|
|
145
|
+
(button) => button.textContent?.includes("Slack"),
|
|
146
|
+
);
|
|
147
|
+
expect(slackTrigger).toBeDefined();
|
|
148
|
+
await act(async () => {
|
|
149
|
+
slackTrigger?.click();
|
|
150
|
+
await Promise.resolve();
|
|
151
|
+
});
|
|
152
|
+
const managedTrigger = [...container.querySelectorAll("button")].find(
|
|
153
|
+
(button) => button.textContent?.includes("Managed Slack workspaces"),
|
|
154
|
+
);
|
|
155
|
+
await act(async () => {
|
|
156
|
+
managedTrigger?.click();
|
|
157
|
+
await Promise.resolve();
|
|
158
|
+
});
|
|
159
|
+
const credentialsTrigger = [...container.querySelectorAll("button")].find(
|
|
160
|
+
(button) => button.textContent?.includes("Credentials"),
|
|
161
|
+
);
|
|
162
|
+
await act(async () => {
|
|
163
|
+
credentialsTrigger?.click();
|
|
164
|
+
await Promise.resolve();
|
|
165
|
+
});
|
|
136
166
|
expect(
|
|
137
167
|
container.querySelector(
|
|
138
168
|
'a[href="/_agent-native/integrations/slack/manifest"]',
|
|
@@ -198,6 +228,27 @@ describe("MessagingSetupPanel", () => {
|
|
|
198
228
|
});
|
|
199
229
|
|
|
200
230
|
expect(container.textContent).toContain("Connected");
|
|
231
|
+
const slackTrigger = [...container.querySelectorAll("button")].find(
|
|
232
|
+
(button) => button.textContent?.includes("Slack"),
|
|
233
|
+
);
|
|
234
|
+
await act(async () => {
|
|
235
|
+
slackTrigger?.click();
|
|
236
|
+
await Promise.resolve();
|
|
237
|
+
});
|
|
238
|
+
const managedTrigger = [...container.querySelectorAll("button")].find(
|
|
239
|
+
(button) => button.textContent?.includes("Managed Slack workspaces"),
|
|
240
|
+
);
|
|
241
|
+
await act(async () => {
|
|
242
|
+
managedTrigger?.click();
|
|
243
|
+
await Promise.resolve();
|
|
244
|
+
});
|
|
245
|
+
const credentialsTrigger = [...container.querySelectorAll("button")].find(
|
|
246
|
+
(button) => button.textContent?.includes("Credentials"),
|
|
247
|
+
);
|
|
248
|
+
await act(async () => {
|
|
249
|
+
credentialsTrigger?.click();
|
|
250
|
+
await Promise.resolve();
|
|
251
|
+
});
|
|
201
252
|
expect(container.textContent).toContain("Saved");
|
|
202
253
|
expect(
|
|
203
254
|
container.querySelector(
|