@burdenoff/microfe-headshotmarketing 2026.928.2 โ 2026.1029.1
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/generated/global-types.d.ts +5145 -1627
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +464 -248
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +320 -292
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +21251 -468
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +20 -20
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/components/PageLayout.d.ts +5 -0
- package/dist/headshotmarketing/components/PageLayout.d.ts.map +1 -1
- package/dist/headshotmarketing/components/PageLayout.js +12 -6
- package/dist/headshotmarketing/components/PageLayout.js.map +1 -1
- package/dist/headshotmarketing/components/StatusBadge.d.ts.map +1 -1
- package/dist/headshotmarketing/components/StatusBadge.js +3 -0
- package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/AutomationPage.js +172 -167
- package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/TriggersPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/TriggersPage.js +127 -143
- package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.d.ts +16 -16
- package/dist/headshotmarketing/pages/automation/WorkflowActions.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js +104 -221
- package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.d.ts +16 -0
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +470 -549
- package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.d.ts +2 -0
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.js +19 -19
- package/dist/headshotmarketing/pages/automation/WorkflowCanvasNode.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.js +341 -164
- package/dist/headshotmarketing/pages/automation/WorkflowNodeConfigPanel.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.d.ts +13 -0
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js +294 -0
- package/dist/headshotmarketing/pages/automation/WorkflowRunsPanel.js.map +1 -0
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.d.ts +2 -0
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +198 -220
- package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/useAutomationData.d.ts +24 -0
- package/dist/headshotmarketing/pages/automation/useAutomationData.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/automation/useAutomationData.js +77 -0
- package/dist/headshotmarketing/pages/automation/useAutomationData.js.map +1 -0
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.d.ts +73 -16
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js +220 -80
- package/dist/headshotmarketing/pages/automation/workflowBuilderModel.js.map +1 -1
- package/dist/headshotmarketing/pages/automation/workflowCompiler.d.ts +51 -0
- package/dist/headshotmarketing/pages/automation/workflowCompiler.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/automation/workflowCompiler.js +453 -0
- package/dist/headshotmarketing/pages/automation/workflowCompiler.js.map +1 -0
- package/dist/headshotmarketing/utils/automationMapper.d.ts +50 -29
- package/dist/headshotmarketing/utils/automationMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/automationMapper.js +55 -99
- package/dist/headshotmarketing/utils/automationMapper.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,282 +1,260 @@
|
|
|
1
1
|
import { useHeadshotMarketing as e } from "../../context/HeadshotMarketingContext.js";
|
|
2
2
|
import { formatDate as t, formatNumber as n, formatPercentage as r } from "../../utils/helpers.js";
|
|
3
3
|
import { PageLayout as i } from "../../components/PageLayout.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { StatCard as a } from "../../components/StatCard.js";
|
|
5
|
+
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
6
|
+
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
7
|
+
import { FilterBar as ee } from "../../components/FilterBar.js";
|
|
7
8
|
import { QueryStateBoundary as c } from "../../components/QueryStateBoundary.js";
|
|
8
9
|
import { Pagination as l } from "../../components/Pagination.js";
|
|
9
10
|
import "../../components/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import { usePagination as d } from "../../hooks/usePagination.js";
|
|
11
|
+
import { usePagination as u } from "../../hooks/usePagination.js";
|
|
12
12
|
import "../../hooks/index.js";
|
|
13
|
-
import {
|
|
14
|
-
import { WorkflowRowControls as p } from "./WorkflowActions.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
13
|
+
import { describeTrigger as d, visibleStepCount as te, workflowBadgeStatus as f } from "../../utils/automationMapper.js";
|
|
14
|
+
import { WorkflowRowControls as p, WorkflowStatusToggle as ne, builderPathFor as m } from "./WorkflowActions.js";
|
|
15
|
+
import { useAutomationData as h } from "./useAutomationData.js";
|
|
16
|
+
import { useEffect as g, useMemo as _, useState as v } from "react";
|
|
17
|
+
import { CalendarClock as y, CheckCircle2 as b, Hand as x, Mail as S, Megaphone as C, Play as w, Plus as T, TrendingUp as E, UserPlus as D, Users as O, Zap as k } from "lucide-react";
|
|
18
|
+
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
19
|
+
import { EmphasisPanel as re, NextSteps as M, PagePurpose as N } from "@burdenoff/fe-libs/ui";
|
|
19
20
|
//#region src/headshotmarketing/pages/automation/WorkflowsPage.tsx
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
var P = {
|
|
22
|
+
LEAD_CREATED: D,
|
|
23
|
+
CONTACT_CREATED: O,
|
|
24
|
+
SCORE_THRESHOLD: E,
|
|
25
|
+
MANUAL: x,
|
|
26
|
+
DATE_BASED: y,
|
|
27
|
+
CAMPAIGN_EVENT: C
|
|
28
|
+
}, F = () => {
|
|
29
|
+
let { navigate: y, basePath: x } = e(), { workflows: C, stats: E, runsCapped: D, loading: O, error: F, refetch: I, upsertWorkflow: L, removeWorkflow: R } = h(), [z, B] = v(""), [V, H] = v("all"), [U, W] = v(null), G = _(() => C.filter((e) => {
|
|
30
|
+
let t = z.trim().toLowerCase(), n = !t || e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t), r = V === "all" || e.status === V;
|
|
31
|
+
return n && r;
|
|
28
32
|
}), [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
active: e,
|
|
38
|
-
totalEnrolled: t,
|
|
39
|
-
avgConversion: n
|
|
40
|
-
};
|
|
41
|
-
}, [V]), G = d({ initialPageSize: 10 }), { page: K, pageSize: q, setPage: J, setTotal: Y } = G;
|
|
42
|
-
m(() => {
|
|
43
|
-
Y(H.length);
|
|
44
|
-
}, [H.length, Y]), m(() => {
|
|
45
|
-
J(1);
|
|
33
|
+
C,
|
|
34
|
+
z,
|
|
35
|
+
V
|
|
36
|
+
]), K = C.filter((e) => e.status === "ACTIVE").length, q = D ? "+" : "", J = u({ initialPageSize: 10 }), { page: Y, pageSize: X, setPage: Z, setTotal: Q } = J;
|
|
37
|
+
g(() => {
|
|
38
|
+
Q(G.length);
|
|
39
|
+
}, [G.length, Q]), g(() => {
|
|
40
|
+
Z(1);
|
|
46
41
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
J
|
|
42
|
+
z,
|
|
43
|
+
V,
|
|
44
|
+
Z
|
|
51
45
|
]);
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
]),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return /* @__PURE__ */ C(i, {
|
|
65
|
-
title: "Workflows",
|
|
66
|
-
description: "Create and manage automation workflows",
|
|
67
|
-
actions: /* @__PURE__ */ C("button", {
|
|
68
|
-
onClick: () => D(O + "/automation/workflows/builder"),
|
|
69
|
-
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
70
|
-
children: [/* @__PURE__ */ S(y, { className: "h-4 w-4" }), "Create Workflow"]
|
|
46
|
+
let ie = _(() => G.slice((Y - 1) * X, (Y - 1) * X + X), [
|
|
47
|
+
G,
|
|
48
|
+
Y,
|
|
49
|
+
X
|
|
50
|
+
]), $ = () => y(m(x));
|
|
51
|
+
return /* @__PURE__ */ j(i, {
|
|
52
|
+
title: "Automation Workflows",
|
|
53
|
+
description: "Trigger-to-action automations that run on your CRM events",
|
|
54
|
+
actions: /* @__PURE__ */ j("button", {
|
|
55
|
+
onClick: $,
|
|
56
|
+
className: "inline-flex min-h-10 items-center gap-2 rounded-md bg-action-primary-bg px-3.5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bgHover",
|
|
57
|
+
children: [/* @__PURE__ */ A(T, { className: "h-4 w-4" }), "New Workflow"]
|
|
71
58
|
}),
|
|
72
59
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ A(N, { children: "Every automation you've built, in one list. Each workflow starts when its trigger fires โ a new lead, a new contact, a lead score reaching a threshold โ and runs its steps for that person. Switch a workflow on or off, open its runs to see every step it executed, and retry or cancel a run." }),
|
|
61
|
+
/* @__PURE__ */ A(M, {
|
|
75
62
|
storageKey: "headshotmarketing-workflows",
|
|
76
63
|
steps: [
|
|
77
64
|
{
|
|
78
65
|
id: "build",
|
|
79
66
|
label: "Build a workflow",
|
|
80
67
|
description: "Open the visual builder and wire a trigger to actions.",
|
|
81
|
-
icon: /* @__PURE__ */
|
|
82
|
-
onClick:
|
|
68
|
+
icon: /* @__PURE__ */ A(T, { className: "h-4 w-4" }),
|
|
69
|
+
onClick: $
|
|
83
70
|
},
|
|
84
71
|
{
|
|
85
72
|
id: "triggers",
|
|
86
73
|
label: "Review triggers",
|
|
87
74
|
description: "See the events that can start an automation.",
|
|
88
|
-
icon: /* @__PURE__ */
|
|
89
|
-
onClick: () =>
|
|
75
|
+
icon: /* @__PURE__ */ A(k, { className: "h-4 w-4" }),
|
|
76
|
+
onClick: () => y(x + "/automation/triggers")
|
|
90
77
|
},
|
|
91
78
|
{
|
|
92
79
|
id: "overview",
|
|
93
80
|
label: "Automation overview",
|
|
94
81
|
description: "Check overall automation health and performance.",
|
|
95
|
-
icon: /* @__PURE__ */
|
|
96
|
-
onClick: () =>
|
|
82
|
+
icon: /* @__PURE__ */ A(b, { className: "h-4 w-4" }),
|
|
83
|
+
onClick: () => y(x + "/automation")
|
|
97
84
|
}
|
|
98
85
|
]
|
|
99
86
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
className: "grid grid-cols-2 gap-4
|
|
87
|
+
/* @__PURE__ */ A(re, { children: /* @__PURE__ */ j("div", {
|
|
88
|
+
className: "grid grid-cols-2 gap-4 md:grid-cols-4",
|
|
102
89
|
children: [
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
className: "
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
className: "
|
|
122
|
-
|
|
123
|
-
})] }),
|
|
124
|
-
/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
125
|
-
className: "text-xs text-text-secondary",
|
|
126
|
-
children: "Avg Success"
|
|
127
|
-
}), /* @__PURE__ */ S("p", {
|
|
128
|
-
className: "text-2xl font-semibold text-text-primary",
|
|
129
|
-
children: r(W.avgConversion)
|
|
130
|
-
})] })
|
|
90
|
+
/* @__PURE__ */ A(a, {
|
|
91
|
+
title: "Active Workflows",
|
|
92
|
+
value: n(K),
|
|
93
|
+
icon: /* @__PURE__ */ A(k, { className: "h-4 w-4" })
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ A(a, {
|
|
96
|
+
title: "Runs This Month",
|
|
97
|
+
value: `${n(E.total.runsThisMonth)}${q}`,
|
|
98
|
+
icon: /* @__PURE__ */ A(w, { className: "h-4 w-4" })
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ A(a, {
|
|
101
|
+
title: "Emails Sent",
|
|
102
|
+
value: `${n(E.total.emailsSentThisMonth)}${q}`,
|
|
103
|
+
icon: /* @__PURE__ */ A(S, { className: "h-4 w-4" })
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ A(a, {
|
|
106
|
+
title: "Success Rate",
|
|
107
|
+
value: E.total.successRate === null ? "โ" : r(E.total.successRate),
|
|
108
|
+
icon: /* @__PURE__ */ A(b, { className: "h-4 w-4" })
|
|
109
|
+
})
|
|
131
110
|
]
|
|
132
111
|
}) }),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
searchValue:
|
|
135
|
-
onSearchChange:
|
|
112
|
+
/* @__PURE__ */ A(ee, {
|
|
113
|
+
searchValue: z,
|
|
114
|
+
onSearchChange: B,
|
|
136
115
|
searchPlaceholder: "Search workflows...",
|
|
137
|
-
filters: /* @__PURE__ */
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
/* @__PURE__ */ S("option", {
|
|
145
|
-
value: "all",
|
|
146
|
-
children: "All Statuses"
|
|
147
|
-
}),
|
|
148
|
-
/* @__PURE__ */ S("option", {
|
|
149
|
-
value: "active",
|
|
150
|
-
children: "Active"
|
|
151
|
-
}),
|
|
152
|
-
/* @__PURE__ */ S("option", {
|
|
153
|
-
value: "paused",
|
|
154
|
-
children: "Paused"
|
|
155
|
-
}),
|
|
156
|
-
/* @__PURE__ */ S("option", {
|
|
157
|
-
value: "draft",
|
|
158
|
-
children: "Draft"
|
|
159
|
-
})
|
|
160
|
-
]
|
|
161
|
-
}), /* @__PURE__ */ C("select", {
|
|
162
|
-
value: L,
|
|
163
|
-
onChange: (e) => R(e.target.value),
|
|
164
|
-
className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
|
|
165
|
-
children: [/* @__PURE__ */ S("option", {
|
|
116
|
+
filters: /* @__PURE__ */ j("select", {
|
|
117
|
+
value: V,
|
|
118
|
+
onChange: (e) => H(e.target.value),
|
|
119
|
+
"aria-label": "Filter by status",
|
|
120
|
+
className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ A("option", {
|
|
166
123
|
value: "all",
|
|
167
|
-
children: "All
|
|
168
|
-
}),
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
124
|
+
children: "All Statuses"
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ A("option", {
|
|
127
|
+
value: "ACTIVE",
|
|
128
|
+
children: "Active"
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ A("option", {
|
|
131
|
+
value: "PAUSED",
|
|
132
|
+
children: "Paused"
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ A("option", {
|
|
135
|
+
value: "DRAFT",
|
|
136
|
+
children: "Draft"
|
|
137
|
+
})
|
|
138
|
+
]
|
|
173
139
|
})
|
|
174
140
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
141
|
+
U && /* @__PURE__ */ A("div", {
|
|
142
|
+
role: "alert",
|
|
143
|
+
className: "rounded-lg border border-status-error-border bg-status-error-bg px-4 py-3 text-sm text-status-error-text",
|
|
144
|
+
children: U
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ A(c, {
|
|
147
|
+
loading: O,
|
|
148
|
+
error: F ?? void 0,
|
|
149
|
+
onRetry: () => void I(),
|
|
150
|
+
hasData: C.length > 0,
|
|
151
|
+
children: G.length === 0 ? /* @__PURE__ */ A(s, {
|
|
152
|
+
illustration: C.length === 0 ? "empty-generic" : "empty-search",
|
|
153
|
+
title: C.length === 0 ? "No workflows yet" : "No workflows match your filters",
|
|
154
|
+
description: C.length === 0 ? "Create your first workflow to automate repetitive marketing tasks." : "Try a different search term or status.",
|
|
155
|
+
action: C.length === 0 ? /* @__PURE__ */ j("button", {
|
|
156
|
+
onClick: $,
|
|
157
|
+
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bgHover",
|
|
158
|
+
children: [/* @__PURE__ */ A(T, { className: "h-4 w-4" }), "New Workflow"]
|
|
188
159
|
}) : void 0
|
|
189
|
-
}) : /* @__PURE__ */
|
|
190
|
-
className: "space-y-
|
|
191
|
-
children: [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
160
|
+
}) : /* @__PURE__ */ j("div", {
|
|
161
|
+
className: "space-y-3",
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ j("div", {
|
|
164
|
+
className: "hidden grid-cols-[minmax(0,2fr)_minmax(0,1.3fr)_64px_96px_88px_112px_40px] gap-3 px-5 text-xs font-medium text-text-secondary lg:grid",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ A("span", { children: "Workflow name" }),
|
|
167
|
+
/* @__PURE__ */ A("span", { children: "Trigger" }),
|
|
168
|
+
/* @__PURE__ */ A("span", { children: "Toggle" }),
|
|
169
|
+
/* @__PURE__ */ A("span", { children: "Status" }),
|
|
170
|
+
/* @__PURE__ */ A("span", { children: "Executions" }),
|
|
171
|
+
/* @__PURE__ */ A("span", { children: "Last run" }),
|
|
172
|
+
/* @__PURE__ */ A("span", {
|
|
173
|
+
className: "sr-only",
|
|
174
|
+
children: "Actions"
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
}),
|
|
178
|
+
ie.map((e) => {
|
|
179
|
+
let r = P[e.triggerType] ?? k, i = E.byWorkflow.get(e.id), a = i?.lastRunAt ? t(i.lastRunAt, "relative") : e.totalRuns > 0 ? "Earlier" : "Never", s = te(e.steps);
|
|
180
|
+
return /* @__PURE__ */ j("div", {
|
|
181
|
+
"data-testid": "workflow-row",
|
|
182
|
+
className: "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border-seam bg-gloss-card px-5 py-4 shadow-pop lg:grid-cols-[minmax(0,2fr)_minmax(0,1.3fr)_64px_96px_88px_112px_40px]",
|
|
197
183
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
184
|
+
/* @__PURE__ */ j("button", {
|
|
185
|
+
type: "button",
|
|
186
|
+
onClick: () => y(m(x, e.id)),
|
|
187
|
+
className: "min-w-0 text-left",
|
|
188
|
+
children: [/* @__PURE__ */ A("span", {
|
|
189
|
+
className: "block truncate text-sm font-semibold text-text-primary hover:underline",
|
|
202
190
|
children: e.name
|
|
203
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ j("span", {
|
|
192
|
+
className: "block truncate text-xs text-text-secondary",
|
|
193
|
+
children: [
|
|
194
|
+
s,
|
|
195
|
+
" step",
|
|
196
|
+
s === 1 ? "" : "s",
|
|
197
|
+
e.description ? ` ยท ${e.description}` : ""
|
|
198
|
+
]
|
|
199
|
+
})]
|
|
204
200
|
}),
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
className: "
|
|
207
|
-
children: e.description
|
|
208
|
-
}),
|
|
209
|
-
/* @__PURE__ */ C("div", {
|
|
210
|
-
className: "flex flex-wrap items-center gap-2 mt-3",
|
|
201
|
+
/* @__PURE__ */ j("div", {
|
|
202
|
+
className: "col-span-2 row-start-2 flex flex-wrap items-center gap-3 lg:col-span-1 lg:row-start-auto lg:contents",
|
|
211
203
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
className: "text-
|
|
214
|
-
children:
|
|
204
|
+
/* @__PURE__ */ j("span", {
|
|
205
|
+
className: "inline-flex w-fit items-center gap-1.5 rounded-md bg-bg-sunken px-2.5 py-1 text-xs font-medium text-text-primary",
|
|
206
|
+
children: [/* @__PURE__ */ A(r, { className: "h-3.5 w-3.5" }), d(e)]
|
|
215
207
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
|
|
218
|
-
|
|
208
|
+
/* @__PURE__ */ A(ne, {
|
|
209
|
+
workflow: e,
|
|
210
|
+
onWorkflowChanged: L,
|
|
211
|
+
onError: W
|
|
219
212
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
|
|
222
|
-
|
|
213
|
+
/* @__PURE__ */ A(o, {
|
|
214
|
+
status: f(e.status),
|
|
215
|
+
className: "w-fit"
|
|
223
216
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
className: "text-
|
|
226
|
-
children: [
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
]
|
|
231
|
-
})
|
|
232
|
-
]
|
|
233
|
-
}),
|
|
234
|
-
/* @__PURE__ */ C("div", {
|
|
235
|
-
className: "flex flex-wrap items-center gap-6 mt-3",
|
|
236
|
-
children: [
|
|
237
|
-
/* @__PURE__ */ C("div", {
|
|
238
|
-
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
239
|
-
children: [/* @__PURE__ */ S(b, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ C("span", { children: [n(e.enrolledCount), " enrolled"] })]
|
|
240
|
-
}),
|
|
241
|
-
/* @__PURE__ */ C("div", {
|
|
242
|
-
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
243
|
-
children: [/* @__PURE__ */ S(_, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ C("span", { children: [r(e.conversionRate), " success"] })]
|
|
217
|
+
/* @__PURE__ */ j("span", {
|
|
218
|
+
className: "text-sm tabular-nums text-text-primary",
|
|
219
|
+
children: [/* @__PURE__ */ j("span", {
|
|
220
|
+
className: "text-xs text-text-secondary lg:hidden",
|
|
221
|
+
children: ["Runs", " "]
|
|
222
|
+
}), n(e.totalRuns)]
|
|
244
223
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
-
className: "
|
|
247
|
-
children:
|
|
224
|
+
/* @__PURE__ */ A("span", {
|
|
225
|
+
className: "text-xs text-text-secondary",
|
|
226
|
+
children: a
|
|
248
227
|
})
|
|
249
228
|
]
|
|
250
229
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
className: "
|
|
253
|
-
children:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
230
|
+
/* @__PURE__ */ A("div", {
|
|
231
|
+
className: "col-start-2 row-start-1 justify-self-end lg:col-start-auto lg:row-start-auto",
|
|
232
|
+
children: /* @__PURE__ */ A(p, {
|
|
233
|
+
workflow: e,
|
|
234
|
+
onWorkflowChanged: L,
|
|
235
|
+
onWorkflowRemoved: R,
|
|
236
|
+
onRunsChanged: () => void I()
|
|
237
|
+
})
|
|
257
238
|
})
|
|
258
239
|
]
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
240
|
+
}, e.id);
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ A(l, {
|
|
243
|
+
page: J.page,
|
|
244
|
+
pageSize: J.pageSize,
|
|
245
|
+
total: J.total,
|
|
246
|
+
onPageChange: J.setPage,
|
|
247
|
+
onPageSizeChange: J.setPageSize,
|
|
248
|
+
disabled: O,
|
|
249
|
+
hideWhenSinglePage: !0
|
|
264
250
|
})
|
|
265
|
-
|
|
266
|
-
page: G.page,
|
|
267
|
-
pageSize: G.pageSize,
|
|
268
|
-
total: G.total,
|
|
269
|
-
onPageChange: G.setPage,
|
|
270
|
-
onPageSizeChange: G.setPageSize,
|
|
271
|
-
disabled: A,
|
|
272
|
-
hideWhenSinglePage: !0
|
|
273
|
-
})]
|
|
251
|
+
]
|
|
274
252
|
})
|
|
275
253
|
})
|
|
276
254
|
]
|
|
277
255
|
});
|
|
278
256
|
};
|
|
279
257
|
//#endregion
|
|
280
|
-
export {
|
|
258
|
+
export { F as WorkflowsPage };
|
|
281
259
|
|
|
282
260
|
//# sourceMappingURL=WorkflowsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkflowsPage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/WorkflowsPage.tsx"],"sourcesContent":["/**\n * Workflows Page\n * @module headshotmarketing/pages/automation\n */\n\nimport { useEffect, useMemo, useState, type FC } from \"react\";\nimport { Plus, Zap, Clock, CheckCircle2, Users } from \"lucide-react\";\nimport {\n PageLayout,\n StatusBadge,\n FilterBar,\n EmptyState,\n Pagination,\n QueryStateBoundary,\n} from \"../../components\";\nimport { PagePurpose, EmphasisPanel, NextSteps } from \"@burdenoff/fe-libs/ui\";\nimport {\n formatNumber,\n formatPercentage,\n formatDate,\n} from \"../../utils/helpers\";\nimport { toWorkflowModel } from \"../../utils/automationMapper\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport { useHeadshotmarketingBootstrap, usePagination } from \"../../hooks\";\nimport { WorkflowRowControls, type RawWorkflow } from \"./WorkflowActions\";\nimport type { Workflow } from \"../../types\";\n\nexport const WorkflowsPage: FC = () => {\n const { navigate, basePath } = useHeadshotMarketing();\n const { data, loading, error, refetch } = useHeadshotmarketingBootstrap();\n const [search, setSearch] = useState(\"\");\n const [statusFilter, setStatusFilter] = useState(\"all\");\n const [categoryFilter, setCategoryFilter] = useState(\"all\");\n\n const rawWorkflows = useMemo<RawWorkflow[]>(\n () => data?.headshotmarketingWorkflows.items ?? [],\n [data?.headshotmarketingWorkflows.items],\n );\n const rawById = useMemo(() => {\n const map = new Map<string, RawWorkflow>();\n for (const raw of rawWorkflows) map.set(raw.id, raw);\n return map;\n }, [rawWorkflows]);\n\n const workflows = useMemo<Workflow[]>(\n () =>\n rawWorkflows.map((item: Parameters<typeof toWorkflowModel>[0]) =>\n toWorkflowModel(item),\n ),\n [rawWorkflows],\n );\n\n const filtered = useMemo(\n () =>\n workflows.filter((w: Workflow) => {\n const matchesSearch =\n !search ||\n w.name.toLowerCase().includes(search.toLowerCase()) ||\n w.description.toLowerCase().includes(search.toLowerCase());\n const matchesStatus =\n statusFilter === \"all\" || w.status === statusFilter;\n const matchesCategory =\n categoryFilter === \"all\" || w.tags.some((t) => t === categoryFilter);\n return matchesSearch && matchesStatus && matchesCategory;\n }),\n [workflows, search, statusFilter, categoryFilter],\n );\n\n const allTags = [...new Set(workflows.flatMap((w: Workflow) => w.tags))];\n\n const summary = useMemo(() => {\n const active = workflows.filter((w) => w.status === \"active\").length;\n const totalEnrolled = workflows.reduce(\n (sum, w) => sum + w.enrolledCount,\n 0,\n );\n const avgConversion =\n workflows.length > 0\n ? workflows.reduce((sum, w) => sum + w.conversionRate, 0) /\n workflows.length\n : 0;\n return { total: workflows.length, active, totalEnrolled, avgConversion };\n }, [workflows]);\n\n const pagination = usePagination({ initialPageSize: 10 });\n const { page, pageSize, setPage, setTotal } = pagination;\n useEffect(() => {\n setTotal(filtered.length);\n }, [filtered.length, setTotal]);\n useEffect(() => {\n setPage(1);\n }, [search, statusFilter, categoryFilter, setPage]);\n const paged = useMemo(\n () =>\n filtered.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),\n [filtered, page, pageSize],\n );\n\n const triggerTypeIcons: Record<string, string> = {\n form_submit: \"๐\",\n event: \"โก\",\n schedule: \"๐
\",\n condition: \"๐\",\n tag_added: \"๐ท๏ธ\",\n webhook: \"๐\",\n };\n\n return (\n <PageLayout\n title=\"Workflows\"\n description=\"Create and manage automation workflows\"\n actions={\n <button\n onClick={() => navigate(basePath + \"/automation/workflows/builder\")}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n <Plus className=\"h-4 w-4\" />\n Create Workflow\n </button>\n }\n >\n <PagePurpose>\n Every automation you've built, in one list. Filter by status or\n category, then enable, pause or edit a workflow โ each one runs a\n trigger-to-action sequence so routine marketing happens without manual\n effort.\n </PagePurpose>\n\n <NextSteps\n storageKey=\"headshotmarketing-workflows\"\n steps={[\n {\n id: \"build\",\n label: \"Build a workflow\",\n description:\n \"Open the visual builder and wire a trigger to actions.\",\n icon: <Plus className=\"h-4 w-4\" />,\n onClick: () => navigate(basePath + \"/automation/workflows/builder\"),\n },\n {\n id: \"triggers\",\n label: \"Review triggers\",\n description: \"See the events that can start an automation.\",\n icon: <Zap className=\"h-4 w-4\" />,\n onClick: () => navigate(basePath + \"/automation/triggers\"),\n },\n {\n id: \"overview\",\n label: \"Automation overview\",\n description: \"Check overall automation health and performance.\",\n icon: <CheckCircle2 className=\"h-4 w-4\" />,\n onClick: () => navigate(basePath + \"/automation\"),\n },\n ]}\n />\n\n {/* Workflow summary โ primary emphasis zone */}\n <EmphasisPanel>\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-4\">\n <div>\n <p className=\"text-xs text-text-secondary\">Workflows</p>\n <p className=\"text-2xl font-semibold text-text-primary\">\n {formatNumber(summary.total)}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">Active</p>\n <p className=\"text-2xl font-semibold text-text-primary\">\n {formatNumber(summary.active)}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">Enrolled</p>\n <p className=\"text-2xl font-semibold text-text-primary\">\n {formatNumber(summary.totalEnrolled)}\n </p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">Avg Success</p>\n <p className=\"text-2xl font-semibold text-text-primary\">\n {formatPercentage(summary.avgConversion)}\n </p>\n </div>\n </div>\n </EmphasisPanel>\n\n <FilterBar\n searchValue={search}\n onSearchChange={setSearch}\n searchPlaceholder=\"Search workflows...\"\n filters={\n <div className=\"flex flex-nowrap items-center gap-2 overflow-x-auto\">\n <select\n value={statusFilter}\n onChange={(e) => setStatusFilter(e.target.value)}\n className=\"rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary\"\n >\n <option value=\"all\">All Statuses</option>\n <option value=\"active\">Active</option>\n <option value=\"paused\">Paused</option>\n <option value=\"draft\">Draft</option>\n </select>\n <select\n value={categoryFilter}\n onChange={(e) => setCategoryFilter(e.target.value)}\n className=\"rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary\"\n >\n <option value=\"all\">All Categories</option>\n {allTags.map((tag) => (\n <option key={tag} value={tag}>\n {tag}\n </option>\n ))}\n </select>\n </div>\n }\n />\n\n <QueryStateBoundary\n loading={loading}\n error={error}\n onRetry={refetch}\n hasData={Boolean(data)}\n >\n {filtered.length === 0 ? (\n <EmptyState\n illustration={\n workflows.length === 0 ? \"empty-generic\" : \"empty-search\"\n }\n title={\n workflows.length === 0\n ? \"No workflows yet\"\n : \"No workflows match your filters\"\n }\n description={\n workflows.length === 0\n ? \"Create your first workflow to automate repetitive marketing tasks.\"\n : \"Try a different search term, status or category.\"\n }\n action={\n workflows.length === 0 ? (\n <button\n onClick={() =>\n navigate(basePath + \"/automation/workflows/builder\")\n }\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n <Plus className=\"h-4 w-4\" />\n Create Workflow\n </button>\n ) : undefined\n }\n />\n ) : (\n <div className=\"space-y-4\">\n {paged.map((workflow: Workflow) => (\n <div\n key={workflow.id}\n className=\"rounded-lg border border-border-seam bg-gloss-card shadow-pop p-5 hover:bg-bg-sunken/50 transition-colors\"\n >\n <div className=\"flex items-start justify-between gap-3\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex flex-wrap items-center gap-3\">\n <h4 className=\"text-sm font-semibold text-text-primary\">\n {workflow.name}\n </h4>\n <StatusBadge status={workflow.status} />\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n {workflow.description}\n </p>\n\n {/* Trigger & Actions */}\n <div className=\"flex flex-wrap items-center gap-2 mt-3\">\n <span className=\"text-sm\">\n {triggerTypeIcons[workflow.trigger.type] || \"โ๏ธ\"}\n </span>\n <span className=\"text-xs text-text-primary font-medium\">\n {workflow.trigger.description}\n </span>\n <span className=\"text-xs text-text-secondary\">โ</span>\n <span className=\"text-xs text-text-secondary\">\n {workflow.actions.length} action\n {workflow.actions.length !== 1 ? \"s\" : \"\"}\n </span>\n </div>\n\n {/* Stats Row */}\n <div className=\"flex flex-wrap items-center gap-6 mt-3\">\n <div className=\"flex items-center gap-1.5 text-xs text-text-secondary\">\n <Users className=\"h-3.5 w-3.5\" />\n <span>\n {formatNumber(workflow.enrolledCount)} enrolled\n </span>\n </div>\n <div className=\"flex items-center gap-1.5 text-xs text-text-secondary\">\n <CheckCircle2 className=\"h-3.5 w-3.5\" />\n <span>\n {formatPercentage(workflow.conversionRate)} success\n </span>\n </div>\n <div className=\"flex items-center gap-1.5 text-xs text-text-secondary\">\n <Clock className=\"h-3.5 w-3.5\" />\n <span>\n {workflow.lastTriggeredAt\n ? formatDate(workflow.lastTriggeredAt, \"relative\")\n : \"Never\"}\n </span>\n </div>\n </div>\n\n {/* Tags */}\n <div className=\"flex flex-wrap gap-1.5 mt-3\">\n {workflow.tags.map((tag) => (\n <span\n key={tag}\n className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-[10px] text-text-secondary\"\n >\n {tag}\n </span>\n ))}\n </div>\n </div>\n\n <WorkflowRowControls\n workflow={workflow}\n raw={rawById.get(workflow.id)}\n onChanged={() => void refetch()}\n />\n </div>\n </div>\n ))}\n\n <Pagination\n page={pagination.page}\n pageSize={pagination.pageSize}\n total={pagination.total}\n onPageChange={pagination.setPage}\n onPageSizeChange={pagination.setPageSize}\n disabled={loading}\n hideWhenSinglePage\n />\n </div>\n )}\n </QueryStateBoundary>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2BA,IAAa,UAA0B;CACrC,IAAM,EAAE,aAAU,gBAAa,GAAsB,EAC/C,EAAE,SAAM,YAAS,UAAO,eAAY,GAA+B,EACnE,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAc,KAAmB,EAAS,MAAM,EACjD,CAAC,GAAgB,KAAqB,EAAS,MAAM,EAErD,IAAe,QACb,GAAM,2BAA2B,SAAS,EAAE,EAClD,CAAC,GAAM,2BAA2B,MAAM,CACzC,EACK,IAAU,QAAc;EAC5B,IAAM,oBAAM,IAAI,KAA0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O,WAAU,eAAgB,CAAA,EACjC,kBAAC,QAAD,EAAA,UACG,EAAS,kBACN,EAAW,EAAS,iBAAiB,WAAW,GAChD,SACC,CAAA,CACH;;WACF;;SAGN,kBAAC,OAAD;UAAK,WAAU;oBACZ,EAAS,KAAK,KAAK,MAClB,kBAAC,QAAD;WAEE,WAAU;qBAET;WACI,EAJA,EAIA,CACP;UACE,CAAA;SACF;WAEN,kBAAC,GAAD;QACY;QACV,KAAK,EAAQ,IAAI,EAAS,GAAG;QAC7B,iBAAiB,KAAK,GAAS;QAC/B,CAAA,CACE;;MACF,EAzEC,EAAS,GAyEV,CACN,EAEF,kBAAC,GAAD;MACE,MAAM,EAAW;MACjB,UAAU,EAAW;MACrB,OAAO,EAAW;MAClB,cAAc,EAAW;MACzB,kBAAkB,EAAW;MAC7B,UAAU;MACV,oBAAA;MACA,CAAA,CACE;;IAEW,CAAA;GACV"}
|
|
1
|
+
{"version":3,"file":"WorkflowsPage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/automation/WorkflowsPage.tsx"],"sourcesContent":["/**\n * Workflows Page (mock 19) โ every automation workflow on the product step\n * engine, with live status toggles and metrics computed from real runs.\n * @module headshotmarketing/pages/automation\n */\n\nimport { useEffect, useMemo, useState, type FC } from \"react\";\nimport {\n Plus,\n Zap,\n CheckCircle2,\n Play,\n Mail,\n UserPlus,\n Users,\n TrendingUp,\n Hand,\n CalendarClock,\n Megaphone,\n type LucideIcon,\n} from \"lucide-react\";\nimport {\n PageLayout,\n StatCard,\n StatusBadge,\n FilterBar,\n EmptyState,\n Pagination,\n QueryStateBoundary,\n} from \"../../components\";\nimport { PagePurpose, EmphasisPanel, NextSteps } from \"@burdenoff/fe-libs/ui\";\nimport {\n formatNumber,\n formatPercentage,\n formatDate,\n} from \"../../utils/helpers\";\nimport {\n describeTrigger,\n visibleStepCount,\n workflowBadgeStatus,\n} from \"../../utils/automationMapper\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport { usePagination } from \"../../hooks\";\nimport {\n WorkflowRowControls,\n WorkflowStatusToggle,\n builderPathFor,\n} from \"./WorkflowActions\";\nimport {\n useAutomationData,\n type AutomationWorkflow,\n} from \"./useAutomationData\";\n\nexport const TRIGGER_ICONS: Record<string, LucideIcon> = {\n LEAD_CREATED: UserPlus,\n CONTACT_CREATED: Users,\n SCORE_THRESHOLD: TrendingUp,\n MANUAL: Hand,\n DATE_BASED: CalendarClock,\n CAMPAIGN_EVENT: Megaphone,\n};\n\nexport const WorkflowsPage: FC = () => {\n const { navigate, basePath } = useHeadshotMarketing();\n const {\n workflows,\n stats,\n runsCapped,\n loading,\n error,\n refetch,\n upsertWorkflow,\n removeWorkflow,\n } = useAutomationData();\n const [search, setSearch] = useState(\"\");\n const [statusFilter, setStatusFilter] = useState(\"all\");\n const [rowError, setRowError] = useState<string | null>(null);\n\n const filtered = useMemo(\n () =>\n workflows.filter((w: AutomationWorkflow) => {\n const q = search.trim().toLowerCase();\n const matchesSearch =\n !q ||\n w.name.toLowerCase().includes(q) ||\n (w.description ?? \"\").toLowerCase().includes(q);\n const matchesStatus =\n statusFilter === \"all\" || w.status === statusFilter;\n return matchesSearch && matchesStatus;\n }),\n [workflows, search, statusFilter],\n );\n\n const activeCount = workflows.filter((w) => w.status === \"ACTIVE\").length;\n const plus = runsCapped ? \"+\" : \"\";\n\n const pagination = usePagination({ initialPageSize: 10 });\n const { page, pageSize, setPage, setTotal } = pagination;\n useEffect(() => {\n setTotal(filtered.length);\n }, [filtered.length, setTotal]);\n useEffect(() => {\n setPage(1);\n }, [search, statusFilter, setPage]);\n const paged = useMemo(\n () =>\n filtered.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),\n [filtered, page, pageSize],\n );\n\n const newWorkflow = (): void => navigate(builderPathFor(basePath));\n\n return (\n <PageLayout\n title=\"Automation Workflows\"\n description=\"Trigger-to-action automations that run on your CRM events\"\n actions={\n <button\n onClick={newWorkflow}\n className=\"inline-flex min-h-10 items-center gap-2 rounded-md bg-action-primary-bg px-3.5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bgHover\"\n >\n <Plus className=\"h-4 w-4\" />\n New Workflow\n </button>\n }\n >\n <PagePurpose>\n Every automation you've built, in one list. Each workflow starts when\n its trigger fires โ a new lead, a new contact, a lead score reaching a\n threshold โ and runs its steps for that person. Switch a workflow on or\n off, open its runs to see every step it executed, and retry or cancel a\n run.\n </PagePurpose>\n\n <NextSteps\n storageKey=\"headshotmarketing-workflows\"\n steps={[\n {\n id: \"build\",\n label: \"Build a workflow\",\n description:\n \"Open the visual builder and wire a trigger to actions.\",\n icon: <Plus className=\"h-4 w-4\" />,\n onClick: newWorkflow,\n },\n {\n id: \"triggers\",\n label: \"Review triggers\",\n description: \"See the events that can start an automation.\",\n icon: <Zap className=\"h-4 w-4\" />,\n onClick: () => navigate(basePath + \"/automation/triggers\"),\n },\n {\n id: \"overview\",\n label: \"Automation overview\",\n description: \"Check overall automation health and performance.\",\n icon: <CheckCircle2 className=\"h-4 w-4\" />,\n onClick: () => navigate(basePath + \"/automation\"),\n },\n ]}\n />\n\n <EmphasisPanel>\n <div className=\"grid grid-cols-2 gap-4 md:grid-cols-4\">\n <StatCard\n title=\"Active Workflows\"\n value={formatNumber(activeCount)}\n icon={<Zap className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Runs This Month\"\n value={`${formatNumber(stats.total.runsThisMonth)}${plus}`}\n icon={<Play className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Emails Sent\"\n value={`${formatNumber(stats.total.emailsSentThisMonth)}${plus}`}\n icon={<Mail className=\"h-4 w-4\" />}\n />\n <StatCard\n title=\"Success Rate\"\n value={\n stats.total.successRate === null\n ? \"โ\"\n : formatPercentage(stats.total.successRate)\n }\n icon={<CheckCircle2 className=\"h-4 w-4\" />}\n />\n </div>\n </EmphasisPanel>\n\n <FilterBar\n searchValue={search}\n onSearchChange={setSearch}\n searchPlaceholder=\"Search workflows...\"\n filters={\n <select\n value={statusFilter}\n onChange={(e) => setStatusFilter(e.target.value)}\n aria-label=\"Filter by status\"\n className=\"rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary\"\n >\n <option value=\"all\">All Statuses</option>\n <option value=\"ACTIVE\">Active</option>\n <option value=\"PAUSED\">Paused</option>\n <option value=\"DRAFT\">Draft</option>\n </select>\n }\n />\n\n {rowError && (\n <div\n role=\"alert\"\n className=\"rounded-lg border border-status-error-border bg-status-error-bg px-4 py-3 text-sm text-status-error-text\"\n >\n {rowError}\n </div>\n )}\n\n <QueryStateBoundary\n loading={loading}\n error={error ?? undefined}\n onRetry={() => void refetch()}\n hasData={workflows.length > 0}\n >\n {filtered.length === 0 ? (\n <EmptyState\n illustration={\n workflows.length === 0 ? \"empty-generic\" : \"empty-search\"\n }\n title={\n workflows.length === 0\n ? \"No workflows yet\"\n : \"No workflows match your filters\"\n }\n description={\n workflows.length === 0\n ? \"Create your first workflow to automate repetitive marketing tasks.\"\n : \"Try a different search term or status.\"\n }\n action={\n workflows.length === 0 ? (\n <button\n onClick={newWorkflow}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bgHover\"\n >\n <Plus className=\"h-4 w-4\" />\n New Workflow\n </button>\n ) : undefined\n }\n />\n ) : (\n <div className=\"space-y-3\">\n <div className=\"hidden grid-cols-[minmax(0,2fr)_minmax(0,1.3fr)_64px_96px_88px_112px_40px] gap-3 px-5 text-xs font-medium text-text-secondary lg:grid\">\n <span>Workflow name</span>\n <span>Trigger</span>\n <span>Toggle</span>\n <span>Status</span>\n <span>Executions</span>\n <span>Last run</span>\n <span className=\"sr-only\">Actions</span>\n </div>\n {paged.map((workflow) => {\n const TriggerIcon = TRIGGER_ICONS[workflow.triggerType] ?? Zap;\n const runStats = stats.byWorkflow.get(workflow.id);\n const lastRun = runStats?.lastRunAt\n ? formatDate(runStats.lastRunAt, \"relative\")\n : workflow.totalRuns > 0\n ? \"Earlier\"\n : \"Never\";\n const stepCount = visibleStepCount(workflow.steps);\n return (\n <div\n key={workflow.id}\n data-testid=\"workflow-row\"\n className=\"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 rounded-lg border border-border-seam bg-gloss-card px-5 py-4 shadow-pop lg:grid-cols-[minmax(0,2fr)_minmax(0,1.3fr)_64px_96px_88px_112px_40px]\"\n >\n <button\n type=\"button\"\n onClick={() =>\n navigate(builderPathFor(basePath, workflow.id))\n }\n className=\"min-w-0 text-left\"\n >\n <span className=\"block truncate text-sm font-semibold text-text-primary hover:underline\">\n {workflow.name}\n </span>\n <span className=\"block truncate text-xs text-text-secondary\">\n {stepCount} step{stepCount === 1 ? \"\" : \"s\"}\n {workflow.description ? ` ยท ${workflow.description}` : \"\"}\n </span>\n </button>\n <div className=\"col-span-2 row-start-2 flex flex-wrap items-center gap-3 lg:col-span-1 lg:row-start-auto lg:contents\">\n <span className=\"inline-flex w-fit items-center gap-1.5 rounded-md bg-bg-sunken px-2.5 py-1 text-xs font-medium text-text-primary\">\n <TriggerIcon className=\"h-3.5 w-3.5\" />\n {describeTrigger(workflow)}\n </span>\n <WorkflowStatusToggle\n workflow={workflow}\n onWorkflowChanged={upsertWorkflow}\n onError={setRowError}\n />\n <StatusBadge\n status={workflowBadgeStatus(workflow.status)}\n className=\"w-fit\"\n />\n <span className=\"text-sm tabular-nums text-text-primary\">\n <span className=\"text-xs text-text-secondary lg:hidden\">\n Runs{\" \"}\n </span>\n {formatNumber(workflow.totalRuns)}\n </span>\n <span className=\"text-xs text-text-secondary\">\n {lastRun}\n </span>\n </div>\n <div className=\"col-start-2 row-start-1 justify-self-end lg:col-start-auto lg:row-start-auto\">\n <WorkflowRowControls\n workflow={workflow}\n onWorkflowChanged={upsertWorkflow}\n onWorkflowRemoved={removeWorkflow}\n onRunsChanged={() => void refetch()}\n />\n </div>\n </div>\n );\n })}\n\n <Pagination\n page={pagination.page}\n pageSize={pagination.pageSize}\n total={pagination.total}\n onPageChange={pagination.setPage}\n onPageSizeChange={pagination.setPageSize}\n disabled={loading}\n hideWhenSinglePage\n />\n </div>\n )}\n </QueryStateBoundary>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqDA,IAAa,IAA4C;CACvD,cAAc;CACd,iBAAiB;CACjB,iBAAiB;CACjB,QAAQ;CACR,YAAY;CACZ,gBAAgB;CACjB,EAEY,UAA0B;CACrC,IAAM,EAAE,aAAU,gBAAa,GAAsB,EAC/C,EACJ,cACA,UACA,eACA,YACA,UACA,YACA,mBACA,sBACE,GAAmB,EACjB,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAc,KAAmB,EAAS,MAAM,EACjD,CAAC,GAAU,KAAe,EAAwB,KAAK,EAEvD,IAAW,QAEb,EAAU,QAAQ,MAA0B;EAC1C,IAAM,IAAI,EAAO,MAAM,CAAC,aAAa,EAC/B,IACJ,CAAC,KACD,EAAE,KAAK,aAAa,CAAC,SAAS,EAAE,KAC/B,EAAE,eAAe,IAAI,aAAa,CAAC,SAAS,EAAE,EAC3C,IACJ,MAAiB,SAAS,EAAE,WAAW;AACzC,SAAO,KAAiB;GACxB,EACJ;EAAC;EAAW;EAAQ;EAAa,CAClC,EAEK,IAAc,EAAU,QAAQ,MAAM,EAAE,WAAW,SAAS,CAAC,QAC7D,IAAO,IAAa,MAAM,IAE1B,IAAa,EAAc,EAAE,iBAAiB,IAAI,CAAC,EACnD,EAAE,SAAM,aAAU,YAAS,gBAAa;AAI9C,CAHA,QAAgB;AACd,IAAS,EAAS,OAAO;IACxB,CAAC,EAAS,QAAQ,EAAS,CAAC,EAC/B,QAAgB;AACd,IAAQ,EAAE;IACT;EAAC;EAAQ;EAAc;EAAQ,CAAC;CACnC,IAAM,KAAQ,QAEV,EAAS,OAAO,IAAO,KAAK,IAAW,IAAO,KAAK,IAAW,EAAS,EACzE;EAAC;EAAU;EAAM;EAAS,CAC3B,EAEK,UAA0B,EAAS,EAAe,EAAS,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,UAAU,EAAW;OACrB,OAAO,EAAW;OAClB,cAAc,EAAW;OACzB,kBAAkB,EAAW;OAC7B,UAAU;OACV,oBAAA;OACA,CAAA;MACE;;IAEW,CAAA;GACV"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HeadshotmarketingAutomationRunFieldsFragment, HeadshotmarketingAutomationWorkflowFieldsFragment } from '../../../generated/wspace-operations';
|
|
2
|
+
import { RunStats } from '../../utils/automationMapper';
|
|
3
|
+
|
|
4
|
+
export type AutomationWorkflow = HeadshotmarketingAutomationWorkflowFieldsFragment;
|
|
5
|
+
export type AutomationRun = HeadshotmarketingAutomationRunFieldsFragment;
|
|
6
|
+
export declare const RUN_PAGE_CAP = 10;
|
|
7
|
+
export interface AutomationData {
|
|
8
|
+
workflows: AutomationWorkflow[];
|
|
9
|
+
runs: AutomationRun[];
|
|
10
|
+
stats: {
|
|
11
|
+
total: RunStats;
|
|
12
|
+
byWorkflow: Map<string, RunStats>;
|
|
13
|
+
};
|
|
14
|
+
/** True when more runs exist this month than were loaded. */
|
|
15
|
+
runsCapped: boolean;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
error: Error | null;
|
|
18
|
+
refetch: () => Promise<void>;
|
|
19
|
+
/** Replace one workflow in place after a mutation returns it. */
|
|
20
|
+
upsertWorkflow: (workflow: AutomationWorkflow) => void;
|
|
21
|
+
removeWorkflow: (id: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function useAutomationData(): AutomationData;
|
|
24
|
+
//# sourceMappingURL=useAutomationData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutomationData.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/automation/useAutomationData.ts"],"names":[],"mappings":"AAaA,OAAO,EAGL,KAAK,4CAA4C,EACjD,KAAK,iDAAiD,EAKvD,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,kBAAkB,GAC5B,iDAAiD,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,4CAA4C,CAAC;AAIzE,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,KAAK,EAAE;QAAE,KAAK,EAAE,QAAQ,CAAC;QAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;KAAE,CAAC;IAC9D,6DAA6D;IAC7D,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,iEAAiE;IACjE,cAAc,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACvD,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAoGlD"}
|