@burdenoff/microfe-eventfullymanaged 2026.1110.12 → 2026.1110.13
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/eventfullymanaged/api/eventApi.d.ts +116 -0
- package/dist/eventfullymanaged/api/eventApi.js +421 -309
- package/dist/eventfullymanaged/api/eventApi.js.map +1 -1
- package/dist/eventfullymanaged/pages/events/EventDetailPage.js +334 -283
- package/dist/eventfullymanaged/pages/events/EventDetailPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js +109 -64
- package/dist/eventfullymanaged/pages/modules/AttendeeProfilePage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/EventTemplatesSection.d.ts +7 -0
- package/dist/eventfullymanaged/pages/modules/EventTemplatesSection.js +173 -0
- package/dist/eventfullymanaged/pages/modules/EventTemplatesSection.js.map +1 -0
- package/dist/eventfullymanaged/pages/modules/EventsPage.js +186 -184
- package/dist/eventfullymanaged/pages/modules/EventsPage.js.map +1 -1
- package/dist/eventfullymanaged/pages/modules/WorkflowsPage.js +250 -140
- package/dist/eventfullymanaged/pages/modules/WorkflowsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useAutomationRuleRunsQuery as e, useAutomationRulesQuery as t, useDeleteAutomationRuleMutation as n, useDeleteWorkflowTemplateMutation as r, useUpsertAutomationRuleMutation as ee, useUpsertWorkflowTemplateMutation as i, useWorkflowTemplatesQuery as a } from "../../api/eventApi.js";
|
|
2
2
|
import { Pagination as o, usePagination as s } from "../../components/Pagination.js";
|
|
3
3
|
import { useEventfullyManaged as c } from "../../context/EventfullyManagedContext.js";
|
|
4
4
|
import { describeError as l, mutationSucceeded as u } from "../../lib/mutationResult.js";
|
|
5
5
|
import { notify as d } from "../../lib/toast.js";
|
|
6
6
|
import { useMemo as f, useState as p } from "react";
|
|
7
7
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
|
-
import { Megaphone as
|
|
9
|
-
import { Badge as
|
|
8
|
+
import { Megaphone as te, Play as ne, Ticket as re, Trash2 as g, Zap as ie } from "lucide-react";
|
|
9
|
+
import { Badge as _, Button as v, EmphasisPanel as ae, GlassCard as y, GradientText as oe, Input as b, NextSteps as x, PagePurpose as se } from "@burdenoff/fe-libs/ui";
|
|
10
10
|
// src/eventfullymanaged/pages/modules/WorkflowsPage.tsx
|
|
11
|
-
|
|
11
|
+
var S = [
|
|
12
|
+
{
|
|
13
|
+
value: "registration_opened",
|
|
14
|
+
label: "When registration opens"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
value: "registration_confirmed",
|
|
18
|
+
label: "When a registration is confirmed"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: "attendee_checked_in",
|
|
22
|
+
label: "When an attendee checks in"
|
|
23
|
+
}
|
|
24
|
+
], C = [{
|
|
25
|
+
value: "send_campaign",
|
|
26
|
+
label: "Send a campaign to the event audience"
|
|
27
|
+
}, {
|
|
28
|
+
value: "start_workflow",
|
|
29
|
+
label: "Start a FluidGrids workflow"
|
|
30
|
+
}], ce = (e) => S.find((t) => t.value === e)?.label ?? e;
|
|
31
|
+
function w(e) {
|
|
12
32
|
let t = e.toLowerCase();
|
|
13
33
|
return ["active"].includes(t) ? "success" : [
|
|
14
34
|
"inactive",
|
|
@@ -17,21 +37,32 @@ function O(e) {
|
|
|
17
37
|
"paused"
|
|
18
38
|
].includes(t) ? "warning" : "secondary";
|
|
19
39
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
function T(e) {
|
|
41
|
+
let t = e.toLowerCase();
|
|
42
|
+
return t === "succeeded" ? "success" : t === "failed" ? "warning" : "secondary";
|
|
43
|
+
}
|
|
44
|
+
var E = (e, t) => e.name ?? e.title ?? `${t} ${e.id}`, D = "flex h-10 w-full rounded-md border border-border-seam bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-ring";
|
|
45
|
+
function O() {
|
|
46
|
+
let { navigate: O } = c(), k = s({ pageSize: 10 }), A = s({ pageSize: 10 }), j = a({
|
|
47
|
+
limit: k.limit,
|
|
48
|
+
offset: k.offset
|
|
49
|
+
}), M = t({
|
|
50
|
+
limit: A.limit,
|
|
51
|
+
offset: A.offset
|
|
52
|
+
}), N = e({
|
|
53
|
+
limit: 100,
|
|
54
|
+
offset: 0
|
|
55
|
+
}), [le, { loading: P }] = i(), [F, { loading: I }] = ee(), [L, { loading: R }] = r(), [z, { loading: B }] = n(), [V, H] = p("Post-event follow-up"), [U, ue] = p("Welcome campaign"), [W, de] = p(S[0].value), [G, fe] = p(C[0].value), [K, pe] = p("Registration is open"), [q, J] = p("Book your seat now."), Y = f(() => j.data?.workflowTemplates.items ?? [], [j.data]), X = j.data?.workflowTemplates.total ?? 0, Z = f(() => M.data?.automationRules.items ?? [], [M.data]), Q = M.data?.automationRules.total ?? 0, $ = f(() => N.data?.automationRuleRuns.items ?? [], [N.data]), me = f(() => {
|
|
56
|
+
let e = /* @__PURE__ */ new Map();
|
|
57
|
+
for (let t of $) e.has(t.ruleId) || e.set(t.ruleId, t);
|
|
58
|
+
return e;
|
|
59
|
+
}, [$]), he = async () => {
|
|
60
|
+
if (!V.trim()) return;
|
|
30
61
|
let e = "Could not save workflow template";
|
|
31
62
|
try {
|
|
32
|
-
let t = await
|
|
33
|
-
name:
|
|
34
|
-
title:
|
|
63
|
+
let t = await le({ variables: { input: {
|
|
64
|
+
name: V,
|
|
65
|
+
title: V,
|
|
35
66
|
status: "active",
|
|
36
67
|
metadata: {}
|
|
37
68
|
} } });
|
|
@@ -40,34 +71,41 @@ function A() {
|
|
|
40
71
|
} catch (t) {
|
|
41
72
|
d.error(e, l(t));
|
|
42
73
|
}
|
|
43
|
-
},
|
|
74
|
+
}, ge = async () => {
|
|
44
75
|
if (!U.trim()) return;
|
|
45
|
-
let e = "Could not save automation rule"
|
|
76
|
+
let e = "Could not save automation rule", t = {
|
|
77
|
+
condition: { trigger: W },
|
|
78
|
+
action: G === "send_campaign" ? {
|
|
79
|
+
type: "send_campaign",
|
|
80
|
+
subject: K,
|
|
81
|
+
body: q
|
|
82
|
+
} : { type: "start_workflow" }
|
|
83
|
+
};
|
|
46
84
|
try {
|
|
47
|
-
let
|
|
48
|
-
name:
|
|
49
|
-
title:
|
|
85
|
+
let n = await F({ variables: { input: {
|
|
86
|
+
name: U,
|
|
87
|
+
title: U,
|
|
50
88
|
status: "active",
|
|
51
|
-
metadata:
|
|
89
|
+
metadata: t
|
|
52
90
|
} } });
|
|
53
|
-
if (!u(
|
|
54
|
-
d.success("Automation rule saved");
|
|
91
|
+
if (!u(n, n.data?.upsertAutomationRule?.id, e)) return;
|
|
92
|
+
d.success("Automation rule saved — it fires automatically from now on");
|
|
55
93
|
} catch (t) {
|
|
56
94
|
d.error(e, l(t));
|
|
57
95
|
}
|
|
58
|
-
},
|
|
96
|
+
}, _e = async (e) => {
|
|
59
97
|
let t = "Could not delete workflow template";
|
|
60
98
|
try {
|
|
61
|
-
let n = await
|
|
99
|
+
let n = await L({ variables: { id: e.id } }), r = n.data?.deleteWorkflowTemplate === !0;
|
|
62
100
|
if (!u(n, r ? e.id : void 0, t)) return;
|
|
63
101
|
d.success("Workflow template deleted");
|
|
64
102
|
} catch (e) {
|
|
65
103
|
d.error(t, l(e));
|
|
66
104
|
}
|
|
67
|
-
},
|
|
105
|
+
}, ve = async (e) => {
|
|
68
106
|
let t = "Could not delete automation rule";
|
|
69
107
|
try {
|
|
70
|
-
let n = await
|
|
108
|
+
let n = await z({ variables: { id: e.id } }), r = n.data?.deleteAutomationRule === !0;
|
|
71
109
|
if (!u(n, r ? e.id : void 0, t)) return;
|
|
72
110
|
d.success("Automation rule deleted");
|
|
73
111
|
} catch (e) {
|
|
@@ -77,160 +115,232 @@ function A() {
|
|
|
77
115
|
return /* @__PURE__ */ h("div", {
|
|
78
116
|
className: "space-y-6 p-6",
|
|
79
117
|
children: [
|
|
80
|
-
/* @__PURE__ */ m(
|
|
81
|
-
/* @__PURE__ */ h(
|
|
118
|
+
/* @__PURE__ */ m(se, { children: "Automation rules run for real: when the trigger you choose happens, the platform executes the action — sending the campaign through the notification platform, or starting a FluidGrids workflow — and records every run below. Workflow templates remain saved configuration you can attach to future automation work." }),
|
|
119
|
+
/* @__PURE__ */ h(ae, { children: [
|
|
82
120
|
/* @__PURE__ */ m("h1", {
|
|
83
121
|
className: "text-2xl font-bold text-text-primary",
|
|
84
|
-
children: /* @__PURE__ */ m(
|
|
122
|
+
children: /* @__PURE__ */ m(oe, { children: "Workflows" })
|
|
85
123
|
}),
|
|
86
124
|
/* @__PURE__ */ m("p", {
|
|
87
125
|
className: "mt-1 text-sm text-text-secondary",
|
|
88
|
-
children: "
|
|
126
|
+
children: "Create a rule: pick a trigger, pick an action, and the platform fires it automatically."
|
|
89
127
|
}),
|
|
90
128
|
/* @__PURE__ */ h("div", {
|
|
129
|
+
className: "mt-4 grid gap-3 sm:grid-cols-2",
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ m(b, {
|
|
132
|
+
value: U,
|
|
133
|
+
onChange: (e) => ue(e.target.value),
|
|
134
|
+
"aria-label": "Automation rule name",
|
|
135
|
+
placeholder: "Rule name"
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ m("select", {
|
|
138
|
+
value: W,
|
|
139
|
+
onChange: (e) => de(e.target.value),
|
|
140
|
+
"aria-label": "Automation trigger",
|
|
141
|
+
className: D,
|
|
142
|
+
children: S.map((e) => /* @__PURE__ */ m("option", {
|
|
143
|
+
value: e.value,
|
|
144
|
+
children: e.label
|
|
145
|
+
}, e.value))
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ m("select", {
|
|
148
|
+
value: G,
|
|
149
|
+
onChange: (e) => fe(e.target.value),
|
|
150
|
+
"aria-label": "Automation action",
|
|
151
|
+
className: D,
|
|
152
|
+
children: C.map((e) => /* @__PURE__ */ m("option", {
|
|
153
|
+
value: e.value,
|
|
154
|
+
children: e.label
|
|
155
|
+
}, e.value))
|
|
156
|
+
}),
|
|
157
|
+
G === "send_campaign" ? /* @__PURE__ */ m(b, {
|
|
158
|
+
value: K,
|
|
159
|
+
onChange: (e) => pe(e.target.value),
|
|
160
|
+
"aria-label": "Campaign subject",
|
|
161
|
+
placeholder: "Campaign subject"
|
|
162
|
+
}) : /* @__PURE__ */ m("p", {
|
|
163
|
+
className: "flex h-10 items-center text-xs text-text-secondary",
|
|
164
|
+
children: "The workflow linked to this rule in the workflow service is started."
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
}),
|
|
168
|
+
G === "send_campaign" ? /* @__PURE__ */ m(b, {
|
|
169
|
+
value: q,
|
|
170
|
+
onChange: (e) => J(e.target.value),
|
|
171
|
+
"aria-label": "Campaign message",
|
|
172
|
+
placeholder: "Campaign message",
|
|
173
|
+
className: "mt-3"
|
|
174
|
+
}) : null,
|
|
175
|
+
/* @__PURE__ */ m("div", {
|
|
91
176
|
className: "mt-4 flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
92
|
-
children:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
className: "
|
|
97
|
-
})
|
|
98
|
-
className: "flex items-center gap-2",
|
|
99
|
-
children: [/* @__PURE__ */ h(x, {
|
|
100
|
-
type: "button",
|
|
101
|
-
onClick: () => void Y(),
|
|
102
|
-
disabled: I,
|
|
103
|
-
children: [/* @__PURE__ */ m(_, { className: "h-4 w-4" }), I ? "Saving..." : "Add Template"]
|
|
104
|
-
}), /* @__PURE__ */ m(x, {
|
|
105
|
-
type: "button",
|
|
106
|
-
variant: "outline",
|
|
107
|
-
onClick: () => void X(),
|
|
108
|
-
disabled: R,
|
|
109
|
-
children: R ? "Saving rule..." : "Add Rule"
|
|
110
|
-
})]
|
|
111
|
-
})]
|
|
177
|
+
children: /* @__PURE__ */ h(v, {
|
|
178
|
+
type: "button",
|
|
179
|
+
onClick: () => void ge(),
|
|
180
|
+
disabled: I,
|
|
181
|
+
children: [/* @__PURE__ */ m(ie, { className: "h-4 w-4" }), I ? "Saving rule..." : "Add Rule"]
|
|
182
|
+
})
|
|
112
183
|
})
|
|
113
184
|
] }),
|
|
114
|
-
/* @__PURE__ */ h(
|
|
185
|
+
/* @__PURE__ */ h(y, {
|
|
115
186
|
treatment: "plain",
|
|
116
187
|
className: "border-border-seam p-5",
|
|
117
188
|
children: [/* @__PURE__ */ m("div", {
|
|
118
189
|
className: "flex items-center justify-between",
|
|
119
190
|
children: /* @__PURE__ */ m("h2", {
|
|
120
191
|
className: "text-lg font-semibold text-text-primary",
|
|
121
|
-
children:
|
|
192
|
+
children: M.loading ? "Loading automation rules…" : `Automation Rules (${Q})`
|
|
122
193
|
})
|
|
123
194
|
}), /* @__PURE__ */ h("div", {
|
|
124
195
|
className: "mt-4",
|
|
125
|
-
children: [
|
|
196
|
+
children: [Z.length === 0 && !M.loading ? /* @__PURE__ */ m("p", {
|
|
126
197
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
127
|
-
children: "No
|
|
198
|
+
children: "No automation rules configured."
|
|
128
199
|
}) : /* @__PURE__ */ m("ul", {
|
|
129
200
|
className: "space-y-2.5",
|
|
130
|
-
children:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
className: "
|
|
134
|
-
children:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
201
|
+
children: Z.map((e) => {
|
|
202
|
+
let t = me.get(e.id), n = e.metadata ?? {}, r = typeof n.condition == "object" && n.condition !== null ? String(n.condition.trigger ?? "") : "";
|
|
203
|
+
return /* @__PURE__ */ h("li", {
|
|
204
|
+
className: "flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3",
|
|
205
|
+
children: [/* @__PURE__ */ h("div", {
|
|
206
|
+
className: "min-w-0",
|
|
207
|
+
children: [/* @__PURE__ */ m("p", {
|
|
208
|
+
className: "truncate font-medium text-text-primary",
|
|
209
|
+
children: E(e, "Rule")
|
|
210
|
+
}), r ? /* @__PURE__ */ m("p", {
|
|
211
|
+
className: "truncate text-xs text-text-secondary",
|
|
212
|
+
children: ce(r)
|
|
213
|
+
}) : null]
|
|
214
|
+
}), /* @__PURE__ */ h("div", {
|
|
215
|
+
className: "flex shrink-0 items-center gap-2",
|
|
216
|
+
children: [
|
|
217
|
+
t ? /* @__PURE__ */ m(_, {
|
|
218
|
+
variant: T(t.status),
|
|
219
|
+
className: "uppercase",
|
|
220
|
+
title: t.trigger,
|
|
221
|
+
children: t.status
|
|
222
|
+
}) : /* @__PURE__ */ m(_, {
|
|
223
|
+
variant: "secondary",
|
|
224
|
+
className: "uppercase",
|
|
225
|
+
children: "Not run yet"
|
|
226
|
+
}),
|
|
227
|
+
e.status ? /* @__PURE__ */ m(_, {
|
|
228
|
+
variant: w(e.status),
|
|
229
|
+
className: "uppercase",
|
|
230
|
+
children: e.status
|
|
231
|
+
}) : null,
|
|
232
|
+
/* @__PURE__ */ m(v, {
|
|
233
|
+
type: "button",
|
|
234
|
+
size: "sm",
|
|
235
|
+
variant: "outline",
|
|
236
|
+
"aria-label": `Delete ${E(e, "Rule")}`,
|
|
237
|
+
disabled: B,
|
|
238
|
+
onClick: () => void ve(e),
|
|
239
|
+
children: /* @__PURE__ */ m(g, { className: "h-3.5 w-3.5" })
|
|
240
|
+
})
|
|
241
|
+
]
|
|
149
242
|
})]
|
|
150
|
-
})
|
|
151
|
-
}
|
|
243
|
+
}, e.id);
|
|
244
|
+
})
|
|
152
245
|
}), /* @__PURE__ */ m(o, {
|
|
153
|
-
offset:
|
|
154
|
-
limit:
|
|
155
|
-
loadedCount:
|
|
156
|
-
total:
|
|
157
|
-
onPrev:
|
|
158
|
-
onNext:
|
|
159
|
-
itemLabel: "
|
|
160
|
-
loading:
|
|
246
|
+
offset: A.offset,
|
|
247
|
+
limit: A.limit,
|
|
248
|
+
loadedCount: Z.length,
|
|
249
|
+
total: Q,
|
|
250
|
+
onPrev: A.prevPage,
|
|
251
|
+
onNext: A.nextPage,
|
|
252
|
+
itemLabel: "automation rules",
|
|
253
|
+
loading: M.loading
|
|
161
254
|
})]
|
|
162
255
|
})]
|
|
163
256
|
}),
|
|
164
|
-
/* @__PURE__ */ h(
|
|
257
|
+
/* @__PURE__ */ h(y, {
|
|
165
258
|
treatment: "plain",
|
|
166
259
|
className: "border-border-seam p-5",
|
|
167
|
-
children: [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
className: "
|
|
177
|
-
children:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
className: "flex
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ m("div", {
|
|
262
|
+
className: "flex items-center justify-between",
|
|
263
|
+
children: /* @__PURE__ */ m("h2", {
|
|
264
|
+
className: "text-lg font-semibold text-text-primary",
|
|
265
|
+
children: j.loading ? "Loading templates…" : `Templates (${X})`
|
|
266
|
+
})
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ h("div", {
|
|
269
|
+
className: "mt-4 flex flex-col gap-3 sm:flex-row sm:items-center",
|
|
270
|
+
children: [/* @__PURE__ */ m(b, {
|
|
271
|
+
value: V,
|
|
272
|
+
onChange: (e) => H(e.target.value),
|
|
273
|
+
"aria-label": "Workflow template name",
|
|
274
|
+
className: "flex-1"
|
|
275
|
+
}), /* @__PURE__ */ h(v, {
|
|
276
|
+
type: "button",
|
|
277
|
+
onClick: () => void he(),
|
|
278
|
+
disabled: P,
|
|
279
|
+
children: [/* @__PURE__ */ m(ne, { className: "h-4 w-4" }), P ? "Saving..." : "Add Template"]
|
|
280
|
+
})]
|
|
281
|
+
}),
|
|
282
|
+
/* @__PURE__ */ h("div", {
|
|
283
|
+
className: "mt-4",
|
|
284
|
+
children: [Y.length === 0 && !j.loading ? /* @__PURE__ */ m("p", {
|
|
285
|
+
className: "py-8 text-center text-sm text-text-secondary",
|
|
286
|
+
children: "No workflow templates configured."
|
|
287
|
+
}) : /* @__PURE__ */ m("ul", {
|
|
288
|
+
className: "space-y-2.5",
|
|
289
|
+
children: Y.map((e) => /* @__PURE__ */ h("li", {
|
|
290
|
+
className: "flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3",
|
|
291
|
+
children: [/* @__PURE__ */ m("p", {
|
|
292
|
+
className: "min-w-0 truncate font-medium text-text-primary",
|
|
293
|
+
children: E(e, "Template")
|
|
294
|
+
}), /* @__PURE__ */ h("div", {
|
|
295
|
+
className: "flex shrink-0 items-center gap-2",
|
|
296
|
+
children: [e.status ? /* @__PURE__ */ m(_, {
|
|
297
|
+
variant: w(e.status),
|
|
298
|
+
className: "uppercase",
|
|
299
|
+
children: e.status
|
|
300
|
+
}) : null, /* @__PURE__ */ m(v, {
|
|
301
|
+
type: "button",
|
|
302
|
+
size: "sm",
|
|
303
|
+
variant: "outline",
|
|
304
|
+
"aria-label": `Delete ${E(e, "Template")}`,
|
|
305
|
+
disabled: R,
|
|
306
|
+
onClick: () => void _e(e),
|
|
307
|
+
children: /* @__PURE__ */ m(g, { className: "h-3.5 w-3.5" })
|
|
308
|
+
})]
|
|
199
309
|
})]
|
|
200
|
-
})
|
|
201
|
-
},
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
})
|
|
212
|
-
|
|
310
|
+
}, e.id))
|
|
311
|
+
}), /* @__PURE__ */ m(o, {
|
|
312
|
+
offset: k.offset,
|
|
313
|
+
limit: k.limit,
|
|
314
|
+
loadedCount: Y.length,
|
|
315
|
+
total: X,
|
|
316
|
+
onPrev: k.prevPage,
|
|
317
|
+
onNext: k.nextPage,
|
|
318
|
+
itemLabel: "templates",
|
|
319
|
+
loading: j.loading
|
|
320
|
+
})]
|
|
321
|
+
})
|
|
322
|
+
]
|
|
213
323
|
}),
|
|
214
|
-
/* @__PURE__ */ m(
|
|
324
|
+
/* @__PURE__ */ m(x, {
|
|
215
325
|
storageKey: "eventfullymanaged-workflows",
|
|
216
326
|
title: "Related pages",
|
|
217
327
|
steps: [{
|
|
218
328
|
id: "wire-communication",
|
|
219
329
|
label: "Go to Communications",
|
|
220
|
-
description: "
|
|
221
|
-
icon: /* @__PURE__ */ m(
|
|
222
|
-
onClick: () =>
|
|
330
|
+
description: "Campaigns sent by rules appear there alongside manual sends.",
|
|
331
|
+
icon: /* @__PURE__ */ m(te, { className: "h-4 w-4" }),
|
|
332
|
+
onClick: () => O("/communication")
|
|
223
333
|
}, {
|
|
224
334
|
id: "automate-checkin",
|
|
225
335
|
label: "Go to Registration",
|
|
226
|
-
description: "
|
|
227
|
-
icon: /* @__PURE__ */ m(
|
|
228
|
-
onClick: () =>
|
|
336
|
+
description: "Registration and check-in are the trigger sources for your rules.",
|
|
337
|
+
icon: /* @__PURE__ */ m(re, { className: "h-4 w-4" }),
|
|
338
|
+
onClick: () => O("/registration")
|
|
229
339
|
}]
|
|
230
340
|
})
|
|
231
341
|
]
|
|
232
342
|
});
|
|
233
343
|
}
|
|
234
|
-
export {
|
|
344
|
+
export { O as default };
|
|
235
345
|
|
|
236
346
|
//# sourceMappingURL=WorkflowsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowsPage.js","names":["Badge","Badge$1","statusVariant","value","status","rowLabel","row","fallback","WorkflowsPage","useEventfullyManaged","templatePagination","usePagination","rulePagination","templatesQuery","useWorkflowTemplatesQuery","rulesQuery","useAutomationRulesQuery","upsertTemplate","creatingTemplate","useUpsertWorkflowTemplateMutation","upsertRule","creatingRule","useUpsertAutomationRuleMutation","deleteTemplate","deletingTemplate","useDeleteWorkflowTemplateMutation","deleteRule","deletingRule","useDeleteAutomationRuleMutation","templateName","setTemplateName","useState","templates","useMemo","templateTotal","rules","ruleTotal","onCreateTemplate","failureMessage","response","mutationSucceeded","error","describeError","onCreateRule","onDeleteTemplate","deleted","onDeleteRule","PagePurpose","EmphasisPanel","GradientText","Input","Button","Play","GlassCard","Trash2","Pagination","NextSteps","Megaphone","navigate","Ticket"],"sources":["../../../../src/eventfullymanaged/pages/modules/WorkflowsPage.tsx"],"sourcesContent":["import { Megaphone, Play, Ticket, Trash2 } from 'lucide-react';\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n Input,\n NextSteps,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport {\n useAutomationRulesQuery,\n useDeleteAutomationRuleMutation,\n useDeleteWorkflowTemplateMutation,\n useUpsertAutomationRuleMutation,\n useUpsertWorkflowTemplateMutation,\n useWorkflowTemplatesQuery,\n} from '../../api/eventApi';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\ntype SimpleRow = {\n id: string;\n name?: string | null;\n title?: string | null;\n status?: string | null;\n};\n\nfunction statusVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (['active'].includes(value)) return 'success';\n if (['inactive', 'disabled', 'archived', 'paused'].includes(value)) return 'warning';\n return 'secondary';\n}\n\nconst rowLabel = (row: SimpleRow, fallback: string): string => row.name ?? row.title ?? `${fallback} ${row.id}`;\n\nexport default function WorkflowsPage() {\n const { navigate } = useEventfullyManaged();\n\n const templatePagination = usePagination({ pageSize: 10 });\n const rulePagination = usePagination({ pageSize: 10 });\n\n const templatesQuery = useWorkflowTemplatesQuery({\n limit: templatePagination.limit,\n offset: templatePagination.offset,\n });\n const rulesQuery = useAutomationRulesQuery({ limit: rulePagination.limit, offset: rulePagination.offset });\n const [upsertTemplate, { loading: creatingTemplate }] = useUpsertWorkflowTemplateMutation();\n const [upsertRule, { loading: creatingRule }] = useUpsertAutomationRuleMutation();\n const [deleteTemplate, { loading: deletingTemplate }] = useDeleteWorkflowTemplateMutation();\n const [deleteRule, { loading: deletingRule }] = useDeleteAutomationRuleMutation();\n const [templateName, setTemplateName] = useState('Post-event follow-up');\n\n const templates = useMemo(\n () => (templatesQuery.data?.workflowTemplates.items ?? []) as SimpleRow[],\n [templatesQuery.data]\n );\n const templateTotal = templatesQuery.data?.workflowTemplates.total ?? 0;\n const rules = useMemo(() => (rulesQuery.data?.automationRules.items ?? []) as SimpleRow[], [rulesQuery.data]);\n const ruleTotal = rulesQuery.data?.automationRules.total ?? 0;\n\n const onCreateTemplate = async () => {\n if (!templateName.trim()) return;\n const failureMessage = 'Could not save workflow template';\n try {\n const response = await upsertTemplate({\n variables: { input: { name: templateName, title: templateName, status: 'active', metadata: {} } },\n });\n if (!mutationSucceeded(response, response.data?.upsertWorkflowTemplate?.id, failureMessage)) return;\n notify.success('Workflow template saved');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n const onCreateRule = async () => {\n if (!templateName.trim()) return;\n const failureMessage = 'Could not save automation rule';\n try {\n const response = await upsertRule({\n variables: {\n input: { name: `${templateName} Rule`, title: `${templateName} Rule`, status: 'active', metadata: {} },\n },\n });\n if (!mutationSucceeded(response, response.data?.upsertAutomationRule?.id, failureMessage)) return;\n notify.success('Automation rule saved');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n const onDeleteTemplate = async (row: SimpleRow) => {\n const failureMessage = 'Could not delete workflow template';\n try {\n const response = await deleteTemplate({ variables: { id: row.id } });\n const deleted = response.data?.deleteWorkflowTemplate === true;\n if (!mutationSucceeded(response, deleted ? row.id : undefined, failureMessage)) return;\n notify.success('Workflow template deleted');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n const onDeleteRule = async (row: SimpleRow) => {\n const failureMessage = 'Could not delete automation rule';\n try {\n const response = await deleteRule({ variables: { id: row.id } });\n const deleted = response.data?.deleteAutomationRule === true;\n if (!mutationSucceeded(response, deleted ? row.id : undefined, failureMessage)) return;\n notify.success('Automation rule deleted');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n Workflow templates and automation rules are saved here as configuration, but nothing runs them yet — there is no\n trigger engine behind this page. Use it to draft and organize what you want to automate; execution is a\n separate, not-yet-built capability.\n </PagePurpose>\n\n <EmphasisPanel>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Workflows</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Templates and rules are saved as drafts only — nothing is executed automatically yet.\n </p>\n <div className=\"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center\">\n <Input\n value={templateName}\n onChange={(e) => setTemplateName(e.target.value)}\n aria-label=\"Workflow template name\"\n className=\"flex-1\"\n />\n <div className=\"flex items-center gap-2\">\n <Button type=\"button\" onClick={() => void onCreateTemplate()} disabled={creatingTemplate}>\n <Play className=\"h-4 w-4\" />\n {creatingTemplate ? 'Saving...' : 'Add Template'}\n </Button>\n <Button type=\"button\" variant=\"outline\" onClick={() => void onCreateRule()} disabled={creatingRule}>\n {creatingRule ? 'Saving rule...' : 'Add Rule'}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {templatesQuery.loading ? 'Loading templates…' : `Templates (${templateTotal})`}\n </h2>\n </div>\n <div className=\"mt-4\">\n {templates.length === 0 && !templatesQuery.loading ? (\n <p className=\"py-8 text-center text-sm text-text-secondary\">No workflow templates configured.</p>\n ) : (\n <ul className=\"space-y-2.5\">\n {templates.map((row) => (\n <li\n key={row.id}\n className=\"flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3\"\n >\n <p className=\"min-w-0 truncate font-medium text-text-primary\">{rowLabel(row, 'Template')}</p>\n <div className=\"flex shrink-0 items-center gap-2\">\n {row.status ? (\n <Badge variant={statusVariant(row.status)} className=\"uppercase\">\n {row.status}\n </Badge>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n aria-label={`Delete ${rowLabel(row, 'Template')}`}\n disabled={deletingTemplate}\n onClick={() => void onDeleteTemplate(row)}\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n </li>\n ))}\n </ul>\n )}\n <Pagination\n offset={templatePagination.offset}\n limit={templatePagination.limit}\n loadedCount={templates.length}\n total={templateTotal}\n onPrev={templatePagination.prevPage}\n onNext={templatePagination.nextPage}\n itemLabel=\"templates\"\n loading={templatesQuery.loading}\n />\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {rulesQuery.loading ? 'Loading automation rules…' : `Automation Rules (${ruleTotal})`}\n </h2>\n </div>\n <div className=\"mt-4\">\n {rules.length === 0 && !rulesQuery.loading ? (\n <p className=\"py-8 text-center text-sm text-text-secondary\">No automation rules configured.</p>\n ) : (\n <ul className=\"space-y-2.5\">\n {rules.map((row) => (\n <li\n key={row.id}\n className=\"flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3\"\n >\n <p className=\"min-w-0 truncate font-medium text-text-primary\">{rowLabel(row, 'Rule')}</p>\n <div className=\"flex shrink-0 items-center gap-2\">\n {row.status ? (\n <Badge variant={statusVariant(row.status)} className=\"uppercase\">\n {row.status}\n </Badge>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n aria-label={`Delete ${rowLabel(row, 'Rule')}`}\n disabled={deletingRule}\n onClick={() => void onDeleteRule(row)}\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n </li>\n ))}\n </ul>\n )}\n <Pagination\n offset={rulePagination.offset}\n limit={rulePagination.limit}\n loadedCount={rules.length}\n total={ruleTotal}\n onPrev={rulePagination.prevPage}\n onNext={rulePagination.nextPage}\n itemLabel=\"automation rules\"\n loading={rulesQuery.loading}\n />\n </div>\n </GlassCard>\n\n <NextSteps\n storageKey=\"eventfullymanaged-workflows\"\n title=\"Related pages\"\n steps={[\n {\n id: 'wire-communication',\n label: 'Go to Communications',\n description: 'Announcements and campaigns are dispatched for real from there.',\n icon: <Megaphone className=\"h-4 w-4\" />,\n onClick: () => navigate('/communication'),\n },\n {\n id: 'automate-checkin',\n label: 'Go to Registration',\n description: 'Attendee registration and check-in actually run from there today.',\n icon: <Ticket className=\"h-4 w-4\" />,\n onClick: () => navigate('/registration'),\n },\n ]}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAiCA,SAASE,EAAc,GAA8D;CACnF,IAAMC,IAAQC,EAAO,YAAY;CAGjC,OAFI,CAAC,QAAQ,CAAC,CAAC,SAASD,CAAK,IAAU,YACnC;EAAC;EAAY;EAAY;EAAY;CAAQ,CAAC,CAAC,SAASA,CAAK,IAAU,YACpE;AACT;AAEA,IAAME,KAAY,GAAgB,MAA6BC,EAAI,QAAQA,EAAI,SAAS,GAAGC,EAAS,GAAGD,EAAI;AAE3G,SAAwBE,IAAgB;CACtC,IAAM,EAAE,gBAAaC,EAAqB,GAEpCC,IAAqBC,EAAc,EAAE,UAAU,GAAG,CAAC,GACn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AU9C,EAASC,GAAK,MAAM;SAC1C,UAAUqB;SACV,eAAe,KAAKmB,EAAaxC,CAAG;SAEpC,UAAA,kBAACgD,GAAD,EAAQ,WAAU,cAAe,CAAA;QAC3B,CAAA,CACL;OACH,CAAA,CAAA;MArBG,GAAAhD,EAAI,EAqBP,CACL;KACC,CAAA,GAEN,kBAACiD,GAAD;MACE,QAAQ3C,EAAe;MACvB,OAAOA,EAAe;MACtB,aAAauB,EAAM;MACnB,OAAOC;MACP,QAAQxB,EAAe;MACvB,QAAQA,EAAe;MACvB,WAAU;MACV,SAASG,EAAW;KACrB,CAAA,CACE;IACI,CAAA,CAAA;;GAEX,kBAACyC,GAAD;IACE,YAAW;IACX,OAAM;IACN,OAAO,CACL;KACE,IAAI;KACJ,OAAO;KACP,aAAa;KACb,MAAM,kBAACC,GAAD,EAAW,WAAU,UAAW,CAAA;KACtC,eAAeC,EAAS,gBAAgB;IAC1C,GACA;KACE,IAAI;KACJ,OAAO;KACP,aAAa;KACb,MAAM,kBAACC,GAAD,EAAQ,WAAU,UAAW,CAAA;KACnC,eAAeD,EAAS,eAAe;IACzC,CACF;GACD,CAAA;EACE;;AAET"}
|
|
1
|
+
{"version":3,"file":"WorkflowsPage.js","names":["Badge","Badge$1","TRIGGER_OPTIONS","ACTION_OPTIONS","triggerLabel","option","value","statusVariant","status","runVariant","rowLabel","row","fallback","selectClass","WorkflowsPage","useEventfullyManaged","templatePagination","usePagination","rulePagination","templatesQuery","useWorkflowTemplatesQuery","rulesQuery","useAutomationRulesQuery","runsQuery","useAutomationRuleRunsQuery","upsertTemplate","creatingTemplate","useUpsertWorkflowTemplateMutation","upsertRule","creatingRule","useUpsertAutomationRuleMutation","deleteTemplate","deletingTemplate","useDeleteWorkflowTemplateMutation","deleteRule","deletingRule","useDeleteAutomationRuleMutation","templateName","setTemplateName","useState","ruleName","setRuleName","ruleTrigger","setRuleTrigger","ruleAction","setRuleAction","ruleSubject","setRuleSubject","ruleBody","setRuleBody","templates","useMemo","templateTotal","rules","ruleTotal","runs","latestRunByRule","map","run","onCreateTemplate","failureMessage","response","mutationSucceeded","error","describeError","onCreateRule","metadata","onDeleteTemplate","deleted","onDeleteRule","PagePurpose","EmphasisPanel","GradientText","Input","Button","Zap","GlassCard","latestRun","trigger","Trash2","Pagination","Play","NextSteps","Megaphone","navigate","Ticket"],"sources":["../../../../src/eventfullymanaged/pages/modules/WorkflowsPage.tsx"],"sourcesContent":["import { Megaphone, Play, Ticket, Trash2, Zap } from 'lucide-react';\nimport {\n Badge,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n Input,\n NextSteps,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useMemo, useState } from 'react';\n\nimport {\n useAutomationRuleRunsQuery,\n useAutomationRulesQuery,\n useDeleteAutomationRuleMutation,\n useDeleteWorkflowTemplateMutation,\n useUpsertAutomationRuleMutation,\n useUpsertWorkflowTemplateMutation,\n useWorkflowTemplatesQuery,\n} from '../../api/eventApi';\nimport { Pagination, usePagination } from '../../components/Pagination';\nimport { useEventfullyManaged } from '../../context/EventfullyManagedContext';\nimport { describeError, mutationSucceeded } from '../../lib/mutationResult';\nimport { notify } from '../../lib/toast';\n\ntype SimpleRow = {\n id: string;\n name?: string | null;\n title?: string | null;\n status?: string | null;\n};\n\ntype RuleRunRow = {\n id: string;\n ruleId: string;\n trigger: string;\n actionType: string;\n status: string;\n createdAt: string;\n};\n\n/** Triggers the platform automation runner executes (BOFF-5893). */\nconst TRIGGER_OPTIONS = [\n { value: 'registration_opened', label: 'When registration opens' },\n { value: 'registration_confirmed', label: 'When a registration is confirmed' },\n { value: 'attendee_checked_in', label: 'When an attendee checks in' },\n] as const;\n\n/** Actions the runner can perform for a matched rule. */\nconst ACTION_OPTIONS = [\n { value: 'send_campaign', label: 'Send a campaign to the event audience' },\n { value: 'start_workflow', label: 'Start a FluidGrids workflow' },\n] as const;\n\nconst triggerLabel = (value: string): string =>\n TRIGGER_OPTIONS.find((option) => option.value === value)?.label ?? value;\n\nfunction statusVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (['active'].includes(value)) return 'success';\n if (['inactive', 'disabled', 'archived', 'paused'].includes(value)) return 'warning';\n return 'secondary';\n}\n\nfunction runVariant(status: string): 'success' | 'warning' | 'secondary' | 'info' {\n const value = status.toLowerCase();\n if (value === 'succeeded') return 'success';\n if (value === 'failed') return 'warning';\n return 'secondary';\n}\n\nconst rowLabel = (row: SimpleRow, fallback: string): string => row.name ?? row.title ?? `${fallback} ${row.id}`;\n\nconst selectClass =\n 'flex h-10 w-full rounded-md border border-border-seam bg-bg-surface px-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-ring';\n\nexport default function WorkflowsPage() {\n const { navigate } = useEventfullyManaged();\n\n const templatePagination = usePagination({ pageSize: 10 });\n const rulePagination = usePagination({ pageSize: 10 });\n\n const templatesQuery = useWorkflowTemplatesQuery({\n limit: templatePagination.limit,\n offset: templatePagination.offset,\n });\n const rulesQuery = useAutomationRulesQuery({ limit: rulePagination.limit, offset: rulePagination.offset });\n const runsQuery = useAutomationRuleRunsQuery({ limit: 100, offset: 0 });\n const [upsertTemplate, { loading: creatingTemplate }] = useUpsertWorkflowTemplateMutation();\n const [upsertRule, { loading: creatingRule }] = useUpsertAutomationRuleMutation();\n const [deleteTemplate, { loading: deletingTemplate }] = useDeleteWorkflowTemplateMutation();\n const [deleteRule, { loading: deletingRule }] = useDeleteAutomationRuleMutation();\n const [templateName, setTemplateName] = useState('Post-event follow-up');\n\n const [ruleName, setRuleName] = useState('Welcome campaign');\n const [ruleTrigger, setRuleTrigger] = useState<string>(TRIGGER_OPTIONS[0].value);\n const [ruleAction, setRuleAction] = useState<string>(ACTION_OPTIONS[0].value);\n const [ruleSubject, setRuleSubject] = useState('Registration is open');\n const [ruleBody, setRuleBody] = useState('Book your seat now.');\n\n const templates = useMemo(\n () => (templatesQuery.data?.workflowTemplates.items ?? []) as SimpleRow[],\n [templatesQuery.data]\n );\n const templateTotal = templatesQuery.data?.workflowTemplates.total ?? 0;\n const rules = useMemo(() => (rulesQuery.data?.automationRules.items ?? []) as SimpleRow[], [rulesQuery.data]);\n const ruleTotal = rulesQuery.data?.automationRules.total ?? 0;\n const runs = useMemo(() => (runsQuery.data?.automationRuleRuns.items ?? []) as RuleRunRow[], [runsQuery.data]);\n\n /** Latest run per rule — the at-a-glance \"did it ever fire\" signal. */\n const latestRunByRule = useMemo(() => {\n const map = new Map<string, RuleRunRow>();\n for (const run of runs) {\n if (!map.has(run.ruleId)) map.set(run.ruleId, run);\n }\n return map;\n }, [runs]);\n\n const onCreateTemplate = async () => {\n if (!templateName.trim()) return;\n const failureMessage = 'Could not save workflow template';\n try {\n const response = await upsertTemplate({\n variables: { input: { name: templateName, title: templateName, status: 'active', metadata: {} } },\n });\n if (!mutationSucceeded(response, response.data?.upsertWorkflowTemplate?.id, failureMessage)) return;\n notify.success('Workflow template saved');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n const onCreateRule = async () => {\n if (!ruleName.trim()) return;\n const failureMessage = 'Could not save automation rule';\n // The runner reads the structured config from metadata.condition/action\n // (wspace-eventfullymanaged-svc upsertSimpleEntity convention).\n const metadata: Record<string, unknown> = {\n condition: { trigger: ruleTrigger },\n action:\n ruleAction === 'send_campaign'\n ? { type: 'send_campaign', subject: ruleSubject, body: ruleBody }\n : { type: 'start_workflow' },\n };\n try {\n const response = await upsertRule({\n variables: { input: { name: ruleName, title: ruleName, status: 'active', metadata } },\n });\n if (!mutationSucceeded(response, response.data?.upsertAutomationRule?.id, failureMessage)) return;\n notify.success('Automation rule saved — it fires automatically from now on');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n const onDeleteTemplate = async (row: SimpleRow) => {\n const failureMessage = 'Could not delete workflow template';\n try {\n const response = await deleteTemplate({ variables: { id: row.id } });\n const deleted = response.data?.deleteWorkflowTemplate === true;\n if (!mutationSucceeded(response, deleted ? row.id : undefined, failureMessage)) return;\n notify.success('Workflow template deleted');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n const onDeleteRule = async (row: SimpleRow) => {\n const failureMessage = 'Could not delete automation rule';\n try {\n const response = await deleteRule({ variables: { id: row.id } });\n const deleted = response.data?.deleteAutomationRule === true;\n if (!mutationSucceeded(response, deleted ? row.id : undefined, failureMessage)) return;\n notify.success('Automation rule deleted');\n } catch (error) {\n notify.error(failureMessage, describeError(error));\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\">\n <PagePurpose>\n Automation rules run for real: when the trigger you choose happens, the platform executes the action — sending\n the campaign through the notification platform, or starting a FluidGrids workflow — and records every run below.\n Workflow templates remain saved configuration you can attach to future automation work.\n </PagePurpose>\n\n <EmphasisPanel>\n <h1 className=\"text-2xl font-bold text-text-primary\">\n <GradientText>Workflows</GradientText>\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Create a rule: pick a trigger, pick an action, and the platform fires it automatically.\n </p>\n <div className=\"mt-4 grid gap-3 sm:grid-cols-2\">\n <Input\n value={ruleName}\n onChange={(e) => setRuleName(e.target.value)}\n aria-label=\"Automation rule name\"\n placeholder=\"Rule name\"\n />\n <select\n value={ruleTrigger}\n onChange={(e) => setRuleTrigger(e.target.value)}\n aria-label=\"Automation trigger\"\n className={selectClass}\n >\n {TRIGGER_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n <select\n value={ruleAction}\n onChange={(e) => setRuleAction(e.target.value)}\n aria-label=\"Automation action\"\n className={selectClass}\n >\n {ACTION_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n {ruleAction === 'send_campaign' ? (\n <Input\n value={ruleSubject}\n onChange={(e) => setRuleSubject(e.target.value)}\n aria-label=\"Campaign subject\"\n placeholder=\"Campaign subject\"\n />\n ) : (\n <p className=\"flex h-10 items-center text-xs text-text-secondary\">\n The workflow linked to this rule in the workflow service is started.\n </p>\n )}\n </div>\n {ruleAction === 'send_campaign' ? (\n <Input\n value={ruleBody}\n onChange={(e) => setRuleBody(e.target.value)}\n aria-label=\"Campaign message\"\n placeholder=\"Campaign message\"\n className=\"mt-3\"\n />\n ) : null}\n <div className=\"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center\">\n <Button type=\"button\" onClick={() => void onCreateRule()} disabled={creatingRule}>\n <Zap className=\"h-4 w-4\" />\n {creatingRule ? 'Saving rule...' : 'Add Rule'}\n </Button>\n </div>\n </EmphasisPanel>\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {rulesQuery.loading ? 'Loading automation rules…' : `Automation Rules (${ruleTotal})`}\n </h2>\n </div>\n <div className=\"mt-4\">\n {rules.length === 0 && !rulesQuery.loading ? (\n <p className=\"py-8 text-center text-sm text-text-secondary\">No automation rules configured.</p>\n ) : (\n <ul className=\"space-y-2.5\">\n {rules.map((row) => {\n const latestRun = latestRunByRule.get(row.id);\n const metadata = (row as { metadata?: Record<string, unknown> | null }).metadata ?? {};\n const trigger =\n typeof metadata.condition === 'object' && metadata.condition !== null\n ? String((metadata.condition as Record<string, unknown>).trigger ?? '')\n : '';\n return (\n <li\n key={row.id}\n className=\"flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3\"\n >\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium text-text-primary\">{rowLabel(row, 'Rule')}</p>\n {trigger ? <p className=\"truncate text-xs text-text-secondary\">{triggerLabel(trigger)}</p> : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {latestRun ? (\n <Badge variant={runVariant(latestRun.status)} className=\"uppercase\" title={latestRun.trigger}>\n {latestRun.status}\n </Badge>\n ) : (\n <Badge variant=\"secondary\" className=\"uppercase\">\n Not run yet\n </Badge>\n )}\n {row.status ? (\n <Badge variant={statusVariant(row.status)} className=\"uppercase\">\n {row.status}\n </Badge>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n aria-label={`Delete ${rowLabel(row, 'Rule')}`}\n disabled={deletingRule}\n onClick={() => void onDeleteRule(row)}\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n </li>\n );\n })}\n </ul>\n )}\n <Pagination\n offset={rulePagination.offset}\n limit={rulePagination.limit}\n loadedCount={rules.length}\n total={ruleTotal}\n onPrev={rulePagination.prevPage}\n onNext={rulePagination.nextPage}\n itemLabel=\"automation rules\"\n loading={rulesQuery.loading}\n />\n </div>\n </GlassCard>\n\n <GlassCard treatment=\"plain\" className=\"border-border-seam p-5\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {templatesQuery.loading ? 'Loading templates…' : `Templates (${templateTotal})`}\n </h2>\n </div>\n <div className=\"mt-4 flex flex-col gap-3 sm:flex-row sm:items-center\">\n <Input\n value={templateName}\n onChange={(e) => setTemplateName(e.target.value)}\n aria-label=\"Workflow template name\"\n className=\"flex-1\"\n />\n <Button type=\"button\" onClick={() => void onCreateTemplate()} disabled={creatingTemplate}>\n <Play className=\"h-4 w-4\" />\n {creatingTemplate ? 'Saving...' : 'Add Template'}\n </Button>\n </div>\n <div className=\"mt-4\">\n {templates.length === 0 && !templatesQuery.loading ? (\n <p className=\"py-8 text-center text-sm text-text-secondary\">No workflow templates configured.</p>\n ) : (\n <ul className=\"space-y-2.5\">\n {templates.map((row) => (\n <li\n key={row.id}\n className=\"flex items-center justify-between gap-3 rounded-card border border-border-seam bg-bg-surface p-3\"\n >\n <p className=\"min-w-0 truncate font-medium text-text-primary\">{rowLabel(row, 'Template')}</p>\n <div className=\"flex shrink-0 items-center gap-2\">\n {row.status ? (\n <Badge variant={statusVariant(row.status)} className=\"uppercase\">\n {row.status}\n </Badge>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n aria-label={`Delete ${rowLabel(row, 'Template')}`}\n disabled={deletingTemplate}\n onClick={() => void onDeleteTemplate(row)}\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n </div>\n </li>\n ))}\n </ul>\n )}\n <Pagination\n offset={templatePagination.offset}\n limit={templatePagination.limit}\n loadedCount={templates.length}\n total={templateTotal}\n onPrev={templatePagination.prevPage}\n onNext={templatePagination.nextPage}\n itemLabel=\"templates\"\n loading={templatesQuery.loading}\n />\n </div>\n </GlassCard>\n\n <NextSteps\n storageKey=\"eventfullymanaged-workflows\"\n title=\"Related pages\"\n steps={[\n {\n id: 'wire-communication',\n label: 'Go to Communications',\n description: 'Campaigns sent by rules appear there alongside manual sends.',\n icon: <Megaphone className=\"h-4 w-4\" />,\n onClick: () => navigate('/communication'),\n },\n {\n id: 'automate-checkin',\n label: 'Go to Registration',\n description: 'Registration and check-in are the trigger sources for your rules.',\n icon: <Ticket className=\"h-4 w-4\" />,\n onClick: () => navigate('/registration'),\n },\n ]}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AA4CA,IAAME,IAAkB;CACtB;EAAE,OAAO;EAAuB,OAAO;CAA0B;CACjE;EAAE,OAAO;EAA0B,OAAO;CAAmC;CAC7E;EAAE,OAAO;EAAuB,OAAO;CAA6B;AACtE,GAGMC,IAAiB,CACrB;CAAE,OAAO;CAAiB,OAAO;AAAwC,GACzE;CAAE,OAAO;CAAkB,OAAO;AAA8B,CAClE,GAEMC,MAAgB,MACpBF,EAAgB,MAAM,MAAWG,EAAO,UAAUC,CAAK,CAAC,EAAE,SAASA;AAErE,SAASC,EAAc,GAA8D;CACnF,IAAMD,IAAQE,EAAO,YAAY;CAGjC,OAFI,CAAC,QAAQ,CAAC,CAAC,SAASF,CAAK,IAAU,YACnC;EAAC;EAAY;EAAY;EAAY;CAAQ,CAAC,CAAC,SAASA,CAAK,IAAU,YACpE;AACT;AAEA,SAASG,EAAW,GAA8D;CAChF,IAAMH,IAAQE,EAAO,YAAY;CAGjC,OAFIF,MAAU,cAAoB,YAC9BA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