@acmekit/dashboard 2.13.36 → 2.13.38

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.
Files changed (49) hide show
  1. package/dist/{api-key-management-create-U37VC624.mjs → api-key-management-create-4AG76FJV.mjs} +3 -3
  2. package/dist/{api-key-management-detail-ZYKL4ATI.mjs → api-key-management-detail-T2TB4KST.mjs} +10 -10
  3. package/dist/{api-key-management-edit-TSZGMIBL.mjs → api-key-management-edit-R44OHS7B.mjs} +3 -3
  4. package/dist/{api-key-management-list-HCJFJWWB.mjs → api-key-management-list-QK4Q7Y5I.mjs} +3 -3
  5. package/dist/app.css +6 -31
  6. package/dist/app.js +1386 -3726
  7. package/dist/app.mjs +38 -240
  8. package/dist/{chunk-VEI6HW6L.mjs → chunk-2U3RK3JG.mjs} +5 -3
  9. package/dist/{chunk-FKTMBR44.mjs → chunk-DN3MIYQH.mjs} +1 -1
  10. package/dist/{chunk-7F3CWXUH.mjs → chunk-DQCEH3X2.mjs} +1 -1
  11. package/dist/{chunk-YKIWIMJX.mjs → chunk-DTY37DDZ.mjs} +0 -1
  12. package/dist/{chunk-PFZQYK7R.mjs → chunk-EFRMWHRX.mjs} +1 -1
  13. package/dist/{chunk-5IEHCYJO.mjs → chunk-GBFVWROS.mjs} +1 -1
  14. package/dist/chunk-LKWTBYYC.mjs +35 -0
  15. package/dist/chunk-RPAL6FHW.mjs +73 -0
  16. package/dist/{chunk-WLRJXEKL.mjs → chunk-ST2YB7JN.mjs} +1 -1
  17. package/dist/{chunk-XIP35KXF.mjs → chunk-ULSPL3DR.mjs} +1 -1
  18. package/dist/{chunk-SYACY6AL.mjs → chunk-XIM7X4FB.mjs} +1 -1
  19. package/dist/{chunk-HHPPTD3B.mjs → chunk-YRWSG3YM.mjs} +1 -1
  20. package/dist/en.json +3 -132
  21. package/dist/{invite-3JSNOA2B.mjs → invite-XGPZZBUP.mjs} +3 -3
  22. package/dist/{login-BEJ5EFGE.mjs → login-GNP3QIPI.mjs} +9 -9
  23. package/dist/{profile-detail-QVTJC4JC.mjs → profile-detail-YX27F7N6.mjs} +3 -3
  24. package/dist/{profile-edit-MIO62TWH.mjs → profile-edit-2VRDU75O.mjs} +3 -3
  25. package/dist/{reset-password-BN4KAJQL.mjs → reset-password-TWRNZO6Z.mjs} +2 -2
  26. package/dist/{settings-GH5IWXHE.mjs → settings-3XWLL5LG.mjs} +3 -3
  27. package/dist/{translation-list-JA22BUKN.mjs → translation-list-CCEQJNED.mjs} +10 -10
  28. package/dist/{translations-edit-STTMANVT.mjs → translations-edit-E57GVUFV.mjs} +11 -11
  29. package/dist/{user-detail-WCXBFRGS.mjs → user-detail-KUSRRVNX.mjs} +3 -3
  30. package/dist/{user-edit-XDVMJOS4.mjs → user-edit-HTN3ZGCL.mjs} +3 -3
  31. package/dist/{user-invite-73ZDSDFC.mjs → user-invite-E3FAAU3V.mjs} +3 -3
  32. package/dist/{user-list-MPJXE3CA.mjs → user-list-KNJ5S3IM.mjs} +5 -5
  33. package/dist/{user-metadata-ADNTL3LT.mjs → user-metadata-5GQK75DT.mjs} +10 -10
  34. package/dist/workflow-execution-detail-5O5VCXL3.mjs +870 -0
  35. package/dist/workflow-execution-list-DETG4MRT.mjs +347 -0
  36. package/package.json +9 -9
  37. package/dist/chunk-A7ULKHDE.mjs +0 -126
  38. package/dist/chunk-GBPAZAJK.mjs +0 -34
  39. package/dist/chunk-LP6CPB7N.mjs +0 -213
  40. package/dist/workflow-analytics-4WCI4ODQ.mjs +0 -152
  41. package/dist/workflow-definition-detail-GI6CFBMG.mjs +0 -94
  42. package/dist/workflow-definition-list-GF3XAEPS.mjs +0 -142
  43. package/dist/workflow-execution-complete-step-WSRLO572.mjs +0 -245
  44. package/dist/workflow-execution-detail-3RH6EQSS.mjs +0 -1411
  45. package/dist/workflow-execution-list-AQEGAME4.mjs +0 -596
  46. package/dist/workflow-execution-rerun-WCYLYL3Q.mjs +0 -138
  47. package/dist/workflow-execution-run-MWN5KWNY.mjs +0 -135
  48. package/dist/workflow-scheduled-list-ZPXR7CZM.mjs +0 -174
  49. /package/dist/{chunk-RISX76YT.mjs → chunk-22YYMH6M.mjs} +0 -0
@@ -1,213 +0,0 @@
1
- // src/routes/workflow-executions/constants.ts
2
- var STEP_IN_PROGRESS_STATES = [
3
- "compensating" /* COMPENSATING */,
4
- "invoking" /* INVOKING */
5
- ];
6
- var STEP_SKIPPED_STATES = [
7
- "skipped" /* SKIPPED */,
8
- "skipped_failure" /* SKIPPED_FAILURE */
9
- ];
10
- var STEP_OK_STATES = [
11
- "done" /* DONE */
12
- ];
13
- var STEP_ERROR_STATES = [
14
- "failed" /* FAILED */,
15
- "reverted" /* REVERTED */,
16
- "timeout" /* TIMEOUT */,
17
- "dormant" /* DORMANT */
18
- ];
19
- var STEP_INACTIVE_STATES = [
20
- "not_started" /* NOT_STARTED */
21
- ];
22
- var TRANSACTION_OK_STATES = [
23
- "done" /* DONE */
24
- ];
25
- var TRANSACTION_ERROR_STATES = [
26
- "failed" /* FAILED */,
27
- "reverted" /* REVERTED */
28
- ];
29
- var TRANSACTION_IN_PROGRESS_STATES = [
30
- "invoking" /* INVOKING */,
31
- "waiting_to_compensate" /* WAITING_TO_COMPENSATE */,
32
- "compensating" /* COMPENSATING */
33
- ];
34
- var TRANSACTION_TERMINAL_STATES = [
35
- "done" /* DONE */,
36
- "failed" /* FAILED */,
37
- "reverted" /* REVERTED */
38
- ];
39
- var TRANSACTION_ACTIVE_STATES = [
40
- "invoking" /* INVOKING */,
41
- "compensating" /* COMPENSATING */,
42
- "waiting_to_compensate" /* WAITING_TO_COMPENSATE */
43
- ];
44
- var STEP_WAITING_STATES = [
45
- "invoking" /* INVOKING */
46
- // waiting_response comes through as invoking state in the step
47
- ];
48
-
49
- // src/routes/workflow-executions/utils.ts
50
- var getTransactionStateColor = (state) => {
51
- switch (state) {
52
- case "done" /* DONE */:
53
- return "green";
54
- case "failed" /* FAILED */:
55
- case "reverted" /* REVERTED */:
56
- return "red";
57
- case "invoking" /* INVOKING */:
58
- return "blue";
59
- case "compensating" /* COMPENSATING */:
60
- case "waiting_to_compensate" /* WAITING_TO_COMPENSATE */:
61
- return "orange";
62
- case "not_started" /* NOT_STARTED */:
63
- return "grey";
64
- default:
65
- return "grey";
66
- }
67
- };
68
- var getTransactionState = (t, state) => {
69
- switch (state) {
70
- case "done" /* DONE */:
71
- return t("workflowExecutions.state.done");
72
- case "failed" /* FAILED */:
73
- return t("workflowExecutions.state.failed");
74
- case "reverted" /* REVERTED */:
75
- return t("workflowExecutions.state.reverted");
76
- case "invoking" /* INVOKING */:
77
- return t("workflowExecutions.state.invoking");
78
- case "waiting_to_compensate" /* WAITING_TO_COMPENSATE */:
79
- return t("workflowExecutions.transaction.state.waitingToCompensate");
80
- case "compensating" /* COMPENSATING */:
81
- return t("workflowExecutions.state.compensating");
82
- case "not_started" /* NOT_STARTED */:
83
- return t("workflowExecutions.state.notStarted");
84
- }
85
- };
86
- var isTerminalState = (state) => {
87
- return [
88
- "done" /* DONE */,
89
- "failed" /* FAILED */,
90
- "reverted" /* REVERTED */
91
- ].includes(state);
92
- };
93
- var getFailedSteps = (execution) => {
94
- const steps = execution?.execution?.steps || {};
95
- const errors = execution?.context?.errors || [];
96
- const failed = [];
97
- for (const [stepId, step] of Object.entries(steps)) {
98
- if (stepId === "_root") continue;
99
- const invokeStatus = step?.invoke?.status;
100
- if (invokeStatus === "permanent_failure" /* PERMANENT_FAILURE */) {
101
- const stepError = errors.find((e) => e.action === stepId);
102
- failed.push({ stepId, error: stepError });
103
- }
104
- }
105
- return failed;
106
- };
107
- var getWaitingSteps = (execution) => {
108
- const steps = execution?.execution?.steps || {};
109
- const waiting = [];
110
- for (const [stepId, step] of Object.entries(steps)) {
111
- if (stepId === "_root") continue;
112
- const invokeStatus = step?.invoke?.status;
113
- if (invokeStatus === "waiting_response" /* WAITING */) {
114
- waiting.push({ stepId });
115
- }
116
- }
117
- return waiting;
118
- };
119
- var formatStepDuration = (startedAt, endedAt) => {
120
- if (!startedAt || !endedAt) return "";
121
- const ms = endedAt - startedAt;
122
- if (ms < 1e3) return `${ms}ms`;
123
- if (ms < 6e4) return `${(ms / 1e3).toFixed(1)}s`;
124
- const minutes = Math.floor(ms / 6e4);
125
- const seconds = Math.round(ms % 6e4 / 1e3);
126
- return `${minutes}m ${seconds}s`;
127
- };
128
- var computeIdempotencyKey = (workflowId, transactionId, stepId, action = "invoke") => {
129
- return `${workflowId}:${transactionId}:${stepId}:${action}`;
130
- };
131
- var mergeStepEvent = (current, event) => {
132
- if (!current) return current;
133
- const updated = JSON.parse(
134
- JSON.stringify(current)
135
- );
136
- const execution = updated.workflow_execution;
137
- if (!execution?.execution?.steps) return updated;
138
- const stepId = event.step?.id;
139
- if (!stepId) return updated;
140
- const step = execution.execution.steps[stepId];
141
- if (!step) return updated;
142
- const eventType = event.event_type;
143
- switch (eventType) {
144
- case "onStepBegin":
145
- if (step.invoke) step.invoke.state = "invoking" /* INVOKING */;
146
- break;
147
- case "onStepSuccess":
148
- if (step.invoke) {
149
- step.invoke.state = "done" /* DONE */;
150
- step.invoke.status = "ok" /* OK */;
151
- }
152
- break;
153
- case "onStepFailure":
154
- if (step.invoke) {
155
- step.invoke.state = "failed" /* FAILED */;
156
- step.invoke.status = "permanent_failure" /* PERMANENT_FAILURE */;
157
- }
158
- break;
159
- case "onStepAwaiting":
160
- if (step.invoke) {
161
- step.invoke.status = "waiting_response" /* WAITING */;
162
- }
163
- break;
164
- case "onCompensateBegin":
165
- if (step.compensate) {
166
- step.compensate.state = "compensating" /* COMPENSATING */;
167
- }
168
- break;
169
- case "onCompensateStepSuccess":
170
- if (step.compensate) {
171
- step.compensate.state = "reverted" /* REVERTED */;
172
- }
173
- break;
174
- case "onCompensateStepFailure":
175
- if (step.compensate) {
176
- step.compensate.state = "failed" /* FAILED */;
177
- }
178
- break;
179
- case "onStepSkipped":
180
- if (step.invoke) {
181
- step.invoke.state = "skipped" /* SKIPPED */;
182
- }
183
- break;
184
- case "onFinish":
185
- execution.state = "done" /* DONE */;
186
- break;
187
- case "onTimeout":
188
- if (step.invoke) {
189
- step.invoke.state = "timeout" /* TIMEOUT */;
190
- }
191
- break;
192
- }
193
- return updated;
194
- };
195
-
196
- export {
197
- STEP_IN_PROGRESS_STATES,
198
- STEP_SKIPPED_STATES,
199
- STEP_OK_STATES,
200
- STEP_ERROR_STATES,
201
- STEP_INACTIVE_STATES,
202
- TRANSACTION_ERROR_STATES,
203
- TRANSACTION_IN_PROGRESS_STATES,
204
- TRANSACTION_ACTIVE_STATES,
205
- getTransactionStateColor,
206
- getTransactionState,
207
- isTerminalState,
208
- getFailedSteps,
209
- getWaitingSteps,
210
- formatStepDuration,
211
- computeIdempotencyKey,
212
- mergeStepEvent
213
- };
@@ -1,152 +0,0 @@
1
- import {
2
- SingleColumnPage
3
- } from "./chunk-RISX76YT.mjs";
4
- import {
5
- queryKeysFactory
6
- } from "./chunk-774WSTCC.mjs";
7
- import {
8
- sdk
9
- } from "./chunk-YKIWIMJX.mjs";
10
- import "./chunk-QZ7TP4HQ.mjs";
11
-
12
- // src/routes/workflow-analytics/workflow-analytics.tsx
13
- import {
14
- Badge,
15
- Container,
16
- Heading,
17
- Text
18
- } from "@acmekit/ui";
19
- import { useTranslation } from "react-i18next";
20
-
21
- // src/hooks/api/workflow-metrics.tsx
22
- import { useQuery } from "@tanstack/react-query";
23
- var WORKFLOW_METRICS_QUERY_KEY = "workflow_metrics";
24
- var workflowMetricsQueryKeys = queryKeysFactory(
25
- WORKFLOW_METRICS_QUERY_KEY
26
- );
27
- var useWorkflowMetrics = (options) => {
28
- const { data, ...rest } = useQuery({
29
- queryFn: async () => {
30
- const result = await sdk.client.fetch(
31
- "/admin/workflows-executions/metrics"
32
- );
33
- return result;
34
- },
35
- queryKey: workflowMetricsQueryKeys.all,
36
- refetchInterval: 3e4,
37
- ...options
38
- });
39
- return { ...data, ...rest };
40
- };
41
-
42
- // src/routes/workflow-analytics/workflow-analytics.tsx
43
- import { jsx, jsxs } from "react/jsx-runtime";
44
- var WorkflowAnalytics = () => {
45
- const { t } = useTranslation();
46
- const {
47
- total_24h,
48
- success_rate_24h,
49
- avg_duration_ms_24h,
50
- running_now,
51
- per_workflow,
52
- isPending: isLoading
53
- } = useWorkflowMetrics();
54
- const formatDuration = (ms) => {
55
- if (ms < 1e3) return `${ms}ms`;
56
- if (ms < 6e4) return `${(ms / 1e3).toFixed(1)}s`;
57
- const min = Math.floor(ms / 6e4);
58
- const sec = Math.round(ms % 6e4 / 1e3);
59
- return `${min}m ${sec}s`;
60
- };
61
- const formatRate = (rate) => `${(rate * 100).toFixed(1)}%`;
62
- return /* @__PURE__ */ jsxs(SingleColumnPage, { widgets: { before: [], after: [] }, children: [
63
- /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
64
- /* @__PURE__ */ jsxs("div", { className: "px-6 py-4", children: [
65
- /* @__PURE__ */ jsx(Heading, { children: t("workflowExecutions.analytics.domain") }),
66
- /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle", size: "small", children: t("workflowExecutions.analytics.subtitle") })
67
- ] }),
68
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-4 gap-px bg-ui-border-base", children: [
69
- /* @__PURE__ */ jsx(
70
- MetricCard,
71
- {
72
- label: t("workflowExecutions.analytics.executions24h"),
73
- value: isLoading ? "-" : String(total_24h ?? 0),
74
- subtitle: "Last 24h"
75
- }
76
- ),
77
- /* @__PURE__ */ jsx(
78
- MetricCard,
79
- {
80
- label: t("workflowExecutions.analytics.successRate"),
81
- value: isLoading ? "-" : formatRate(success_rate_24h ?? 0),
82
- subtitle: "Last 24h",
83
- color: (success_rate_24h ?? 1) >= 0.9 ? "green" : (success_rate_24h ?? 1) >= 0.7 ? "orange" : "red"
84
- }
85
- ),
86
- /* @__PURE__ */ jsx(
87
- MetricCard,
88
- {
89
- label: t("workflowExecutions.analytics.avgDuration"),
90
- value: isLoading ? "-" : formatDuration(avg_duration_ms_24h ?? 0),
91
- subtitle: "Last 24h"
92
- }
93
- ),
94
- /* @__PURE__ */ jsx(
95
- MetricCard,
96
- {
97
- label: t("workflowExecutions.analytics.runningNow"),
98
- value: isLoading ? "-" : String(running_now ?? 0),
99
- color: (running_now ?? 0) > 0 ? "blue" : void 0
100
- }
101
- )
102
- ] })
103
- ] }),
104
- per_workflow && per_workflow.length > 0 && /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
105
- /* @__PURE__ */ jsx("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx(Heading, { level: "h2", children: t("workflowExecutions.analytics.perWorkflowBreakdown") }) }),
106
- /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
107
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-ui-border-base border-b", children: [
108
- /* @__PURE__ */ jsx("th", { className: "text-ui-fg-subtle txt-compact-small-plus px-6 py-2 text-left", children: "Workflow" }),
109
- /* @__PURE__ */ jsx("th", { className: "text-ui-fg-subtle txt-compact-small-plus px-6 py-2 text-right", children: "Runs" }),
110
- /* @__PURE__ */ jsx("th", { className: "text-ui-fg-subtle txt-compact-small-plus px-6 py-2 text-right", children: "Success Rate" }),
111
- /* @__PURE__ */ jsx("th", { className: "text-ui-fg-subtle txt-compact-small-plus px-6 py-2 text-right", children: "Avg Duration" })
112
- ] }) }),
113
- /* @__PURE__ */ jsx("tbody", { children: per_workflow.map((wf) => /* @__PURE__ */ jsxs(
114
- "tr",
115
- {
116
- className: "border-ui-border-base border-b last:border-b-0",
117
- children: [
118
- /* @__PURE__ */ jsx("td", { className: "px-6 py-3", children: /* @__PURE__ */ jsx(Badge, { size: "2xsmall", children: wf.workflow_id }) }),
119
- /* @__PURE__ */ jsx("td", { className: "txt-compact-small text-ui-fg-subtle px-6 py-3 text-right", children: wf.runs }),
120
- /* @__PURE__ */ jsx("td", { className: "txt-compact-small text-ui-fg-subtle px-6 py-3 text-right", children: formatRate(wf.success_rate) }),
121
- /* @__PURE__ */ jsx("td", { className: "txt-compact-small text-ui-fg-subtle px-6 py-3 text-right", children: formatDuration(wf.avg_duration_ms) })
122
- ]
123
- },
124
- wf.workflow_id
125
- )) })
126
- ] }) })
127
- ] })
128
- ] });
129
- };
130
- var MetricCard = ({
131
- label,
132
- value,
133
- subtitle,
134
- color
135
- }) => {
136
- const colorClass = color ? {
137
- green: "text-ui-tag-green-icon",
138
- orange: "text-ui-tag-orange-icon",
139
- red: "text-ui-tag-red-icon",
140
- blue: "text-ui-tag-blue-icon"
141
- }[color] : "text-ui-fg-base";
142
- return /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-base flex flex-col gap-y-1 px-6 py-4", children: [
143
- /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: label }),
144
- /* @__PURE__ */ jsx(Text, { size: "xlarge", weight: "plus", className: colorClass, children: value }),
145
- subtitle && /* @__PURE__ */ jsx(Text, { size: "xsmall", className: "text-ui-fg-muted", children: subtitle })
146
- ] });
147
- };
148
- var Component = WorkflowAnalytics;
149
- export {
150
- Component,
151
- WorkflowAnalytics
152
- };
@@ -1,94 +0,0 @@
1
- import {
2
- useWorkflowDefinition
3
- } from "./chunk-GBPAZAJK.mjs";
4
- import {
5
- SingleColumnPage
6
- } from "./chunk-RISX76YT.mjs";
7
- import {
8
- SingleColumnPageSkeleton
9
- } from "./chunk-ITNQKZQQ.mjs";
10
- import "./chunk-774WSTCC.mjs";
11
- import "./chunk-YKIWIMJX.mjs";
12
- import "./chunk-QZ7TP4HQ.mjs";
13
-
14
- // src/routes/workflow-definitions/workflow-definition-detail/workflow-definition-detail.tsx
15
- import { ArrowPathMini } from "@acmekit/icons";
16
- import {
17
- Badge,
18
- Button,
19
- Container,
20
- Copy,
21
- Heading,
22
- Text
23
- } from "@acmekit/ui";
24
- import { useTranslation } from "react-i18next";
25
- import { Link, useParams } from "react-router-dom";
26
- import { jsx, jsxs } from "react/jsx-runtime";
27
- var WorkflowDefinitionDetail = () => {
28
- const { id } = useParams();
29
- const { t } = useTranslation();
30
- const {
31
- workflow_definition: definition,
32
- isPending: isLoading,
33
- isError,
34
- error
35
- } = useWorkflowDefinition(id);
36
- if (isLoading) {
37
- return /* @__PURE__ */ jsx(SingleColumnPageSkeleton, { sections: 2, showJSON: true });
38
- }
39
- if (isError) {
40
- throw error;
41
- }
42
- if (!definition) {
43
- return /* @__PURE__ */ jsx(SingleColumnPageSkeleton, { sections: 2, showJSON: true });
44
- }
45
- return /* @__PURE__ */ jsxs(
46
- SingleColumnPage,
47
- {
48
- widgets: { before: [], after: [] },
49
- data: definition,
50
- showJSON: true,
51
- hasOutlet: true,
52
- children: [
53
- /* @__PURE__ */ jsx(Container, { className: "divide-y p-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
54
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ jsx(Copy, { content: definition.id, asChild: true, children: /* @__PURE__ */ jsx(Badge, { size: "2xsmall", className: "cursor-pointer", children: definition.id }) }) }),
55
- /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "small", asChild: true, children: /* @__PURE__ */ jsxs(Link, { to: "run", children: [
56
- /* @__PURE__ */ jsx(ArrowPathMini, { className: "mr-1" }),
57
- t("workflowExecutions.actions.runWorkflow")
58
- ] }) })
59
- ] }) }),
60
- /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
61
- /* @__PURE__ */ jsxs("div", { className: "px-6 py-4", children: [
62
- /* @__PURE__ */ jsx(Heading, { level: "h2", children: t("workflowExecutions.definitions.steps") }),
63
- /* @__PURE__ */ jsxs(Text, { size: "small", className: "text-ui-fg-subtle mt-1", children: [
64
- t("workflowExecutions.definitions.stepCount"),
65
- ":",
66
- " ",
67
- definition.steps?.length || 0
68
- ] })
69
- ] }),
70
- /* @__PURE__ */ jsx("div", { className: "divide-y", children: (definition.steps || []).map((step, idx) => /* @__PURE__ */ jsxs(
71
- "div",
72
- {
73
- className: "flex items-center justify-between px-6 py-3",
74
- style: { paddingLeft: `${1.5 + step.depth * 1.5}rem` },
75
- children: [
76
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2", children: [
77
- /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted txt-compact-xsmall", children: step.depth > 0 ? "\u2514" : "\u25CF" }),
78
- /* @__PURE__ */ jsx(Badge, { size: "2xsmall", children: step.action })
79
- ] }),
80
- /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted txt-compact-xsmall", children: step.noCompensation ? "no compensation" : "" })
81
- ]
82
- },
83
- `${step.action}-${idx}`
84
- )) })
85
- ] })
86
- ]
87
- }
88
- );
89
- };
90
- var Component = WorkflowDefinitionDetail;
91
- export {
92
- Component,
93
- WorkflowDefinitionDetail
94
- };
@@ -1,142 +0,0 @@
1
- import {
2
- useWorkflowDefinitions
3
- } from "./chunk-GBPAZAJK.mjs";
4
- import {
5
- _DataTable,
6
- useDataTable
7
- } from "./chunk-YLPAZ2DP.mjs";
8
- import "./chunk-DFFLVEZ5.mjs";
9
- import "./chunk-535OVBXR.mjs";
10
- import {
11
- SingleColumnPage
12
- } from "./chunk-RISX76YT.mjs";
13
- import "./chunk-ITNQKZQQ.mjs";
14
- import "./chunk-S4DMV3ZT.mjs";
15
- import "./chunk-774WSTCC.mjs";
16
- import "./chunk-YKIWIMJX.mjs";
17
- import "./chunk-QZ7TP4HQ.mjs";
18
-
19
- // src/routes/workflow-definitions/workflow-definition-list/components/workflow-definition-list-table/workflow-definition-list-table.tsx
20
- import { Container, Heading, Text } from "@acmekit/ui";
21
- import { keepPreviousData } from "@tanstack/react-query";
22
- import { useTranslation as useTranslation2 } from "react-i18next";
23
-
24
- // src/routes/workflow-definitions/workflow-definition-list/components/workflow-definition-list-table/use-workflow-definition-table-columns.tsx
25
- import { Badge, Copy } from "@acmekit/ui";
26
- import { createColumnHelper } from "@tanstack/react-table";
27
- import { useMemo } from "react";
28
- import { useTranslation } from "react-i18next";
29
- import { jsx, jsxs } from "react/jsx-runtime";
30
- var columnHelper = createColumnHelper();
31
- var useWorkflowDefinitionTableColumns = () => {
32
- const { t } = useTranslation();
33
- return useMemo(
34
- () => [
35
- columnHelper.accessor("id", {
36
- header: t("workflowExecutions.definitions.name"),
37
- cell: ({ getValue }) => {
38
- const id = getValue();
39
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-1", children: [
40
- /* @__PURE__ */ jsx(Badge, { size: "2xsmall", className: "truncate", children: id }),
41
- /* @__PURE__ */ jsx(Copy, { content: id, className: "text-ui-fg-muted" })
42
- ] });
43
- }
44
- }),
45
- columnHelper.accessor("steps", {
46
- header: t("workflowExecutions.definitions.stepCount"),
47
- cell: ({ getValue }) => {
48
- const steps = getValue();
49
- return /* @__PURE__ */ jsxs("span", { className: "text-ui-fg-subtle txt-compact-small", children: [
50
- steps?.length || 0,
51
- " ",
52
- t("workflowExecutions.definitions.steps")
53
- ] });
54
- }
55
- }),
56
- columnHelper.accessor("handler_count", {
57
- header: t("workflowExecutions.definitions.handlers"),
58
- cell: ({ getValue }) => {
59
- return /* @__PURE__ */ jsx("span", { className: "text-ui-fg-subtle txt-compact-small", children: getValue() || 0 });
60
- }
61
- }),
62
- columnHelper.display({
63
- id: "schedule",
64
- header: t("workflowExecutions.scheduled.schedule"),
65
- cell: ({ row }) => {
66
- const schedule = row.original.options?.schedule;
67
- if (!schedule) {
68
- return /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted txt-compact-small", children: "-" });
69
- }
70
- return /* @__PURE__ */ jsx(Badge, { size: "2xsmall", color: "purple", children: String(schedule) });
71
- }
72
- })
73
- ],
74
- [t]
75
- );
76
- };
77
-
78
- // src/routes/workflow-definitions/workflow-definition-list/components/workflow-definition-list-table/workflow-definition-list-table.tsx
79
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
80
- var PAGE_SIZE = 20;
81
- var WorkflowDefinitionListTable = () => {
82
- const { t } = useTranslation2();
83
- const {
84
- workflow_definitions,
85
- count,
86
- isPending: isLoading,
87
- isError,
88
- error
89
- } = useWorkflowDefinitions(void 0, {
90
- placeholderData: keepPreviousData
91
- });
92
- const definitions = workflow_definitions || [];
93
- const columns = useWorkflowDefinitionTableColumns();
94
- const { table } = useDataTable({
95
- data: definitions,
96
- columns,
97
- count,
98
- pageSize: PAGE_SIZE,
99
- enablePagination: true,
100
- getRowId: (row) => row.id
101
- });
102
- if (isError) {
103
- throw error;
104
- }
105
- return /* @__PURE__ */ jsxs2(Container, { className: "divide-y p-0", children: [
106
- /* @__PURE__ */ jsx2("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsxs2("div", { children: [
107
- /* @__PURE__ */ jsx2(Heading, { children: t("workflowExecutions.definitions.domain") }),
108
- /* @__PURE__ */ jsx2(Text, { className: "text-ui-fg-subtle", size: "small", children: t("workflowExecutions.definitions.subtitle") })
109
- ] }) }),
110
- /* @__PURE__ */ jsx2(
111
- _DataTable,
112
- {
113
- table,
114
- columns,
115
- count,
116
- isLoading,
117
- pageSize: PAGE_SIZE,
118
- navigateTo: (row) => row.id,
119
- search: true,
120
- pagination: true
121
- }
122
- )
123
- ] });
124
- };
125
-
126
- // src/routes/workflow-definitions/workflow-definition-list/workflow-definition-list.tsx
127
- import { jsx as jsx3 } from "react/jsx-runtime";
128
- var WorkflowDefinitionList = () => {
129
- return /* @__PURE__ */ jsx3(
130
- SingleColumnPage,
131
- {
132
- widgets: { before: [], after: [] },
133
- hasOutlet: true,
134
- children: /* @__PURE__ */ jsx3(WorkflowDefinitionListTable, {})
135
- }
136
- );
137
- };
138
- var Component = WorkflowDefinitionList;
139
- export {
140
- Component,
141
- WorkflowDefinitionList
142
- };