@acmekit/dashboard 2.13.34 → 2.13.36

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-4AG76FJV.mjs → api-key-management-create-U37VC624.mjs} +3 -3
  2. package/dist/{api-key-management-detail-T2TB4KST.mjs → api-key-management-detail-ZYKL4ATI.mjs} +10 -10
  3. package/dist/{api-key-management-edit-R44OHS7B.mjs → api-key-management-edit-TSZGMIBL.mjs} +3 -3
  4. package/dist/{api-key-management-list-QK4Q7Y5I.mjs → api-key-management-list-HCJFJWWB.mjs} +3 -3
  5. package/dist/app.css +31 -0
  6. package/dist/app.js +3726 -1386
  7. package/dist/app.mjs +240 -38
  8. package/dist/{chunk-GBFVWROS.mjs → chunk-5IEHCYJO.mjs} +1 -1
  9. package/dist/{chunk-DQCEH3X2.mjs → chunk-7F3CWXUH.mjs} +1 -1
  10. package/dist/chunk-A7ULKHDE.mjs +126 -0
  11. package/dist/{chunk-DN3MIYQH.mjs → chunk-FKTMBR44.mjs} +1 -1
  12. package/dist/chunk-GBPAZAJK.mjs +34 -0
  13. package/dist/{chunk-YRWSG3YM.mjs → chunk-HHPPTD3B.mjs} +1 -1
  14. package/dist/chunk-LP6CPB7N.mjs +213 -0
  15. package/dist/{chunk-EFRMWHRX.mjs → chunk-PFZQYK7R.mjs} +1 -1
  16. package/dist/{chunk-XIM7X4FB.mjs → chunk-SYACY6AL.mjs} +1 -1
  17. package/dist/{chunk-2U3RK3JG.mjs → chunk-VEI6HW6L.mjs} +3 -5
  18. package/dist/{chunk-ST2YB7JN.mjs → chunk-WLRJXEKL.mjs} +1 -1
  19. package/dist/{chunk-ULSPL3DR.mjs → chunk-XIP35KXF.mjs} +1 -1
  20. package/dist/{chunk-DTY37DDZ.mjs → chunk-YKIWIMJX.mjs} +1 -0
  21. package/dist/en.json +132 -3
  22. package/dist/{invite-XGPZZBUP.mjs → invite-3JSNOA2B.mjs} +3 -3
  23. package/dist/{login-GNP3QIPI.mjs → login-BEJ5EFGE.mjs} +9 -9
  24. package/dist/{profile-detail-YX27F7N6.mjs → profile-detail-QVTJC4JC.mjs} +3 -3
  25. package/dist/{profile-edit-2VRDU75O.mjs → profile-edit-MIO62TWH.mjs} +3 -3
  26. package/dist/{reset-password-TWRNZO6Z.mjs → reset-password-BN4KAJQL.mjs} +2 -2
  27. package/dist/{settings-3XWLL5LG.mjs → settings-GH5IWXHE.mjs} +3 -3
  28. package/dist/{translation-list-CCEQJNED.mjs → translation-list-JA22BUKN.mjs} +10 -10
  29. package/dist/{translations-edit-E57GVUFV.mjs → translations-edit-STTMANVT.mjs} +11 -11
  30. package/dist/{user-detail-KUSRRVNX.mjs → user-detail-WCXBFRGS.mjs} +3 -3
  31. package/dist/{user-edit-HTN3ZGCL.mjs → user-edit-XDVMJOS4.mjs} +3 -3
  32. package/dist/{user-invite-E3FAAU3V.mjs → user-invite-73ZDSDFC.mjs} +3 -3
  33. package/dist/{user-list-KNJ5S3IM.mjs → user-list-MPJXE3CA.mjs} +5 -5
  34. package/dist/{user-metadata-5GQK75DT.mjs → user-metadata-ADNTL3LT.mjs} +10 -10
  35. package/dist/workflow-analytics-4WCI4ODQ.mjs +152 -0
  36. package/dist/workflow-definition-detail-GI6CFBMG.mjs +94 -0
  37. package/dist/workflow-definition-list-GF3XAEPS.mjs +142 -0
  38. package/dist/workflow-execution-complete-step-WSRLO572.mjs +245 -0
  39. package/dist/workflow-execution-detail-3RH6EQSS.mjs +1411 -0
  40. package/dist/workflow-execution-list-AQEGAME4.mjs +596 -0
  41. package/dist/workflow-execution-rerun-WCYLYL3Q.mjs +138 -0
  42. package/dist/workflow-execution-run-MWN5KWNY.mjs +135 -0
  43. package/dist/workflow-scheduled-list-ZPXR7CZM.mjs +174 -0
  44. package/package.json +9 -9
  45. package/dist/chunk-LKWTBYYC.mjs +0 -35
  46. package/dist/chunk-RPAL6FHW.mjs +0 -73
  47. package/dist/workflow-execution-detail-5O5VCXL3.mjs +0 -870
  48. package/dist/workflow-execution-list-DETG4MRT.mjs +0 -347
  49. /package/dist/{chunk-22YYMH6M.mjs → chunk-RISX76YT.mjs} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SingleColumnPage
3
- } from "./chunk-22YYMH6M.mjs";
3
+ } from "./chunk-RISX76YT.mjs";
4
4
  import {
5
5
  useExtension
6
6
  } from "./chunk-C5P5PL3E.mjs";
@@ -16,14 +16,14 @@ import {
16
16
  useDeleteUser,
17
17
  useUser,
18
18
  usersQueryKeys
19
- } from "./chunk-YRWSG3YM.mjs";
19
+ } from "./chunk-HHPPTD3B.mjs";
20
20
  import {
21
21
  queryClient
22
22
  } from "./chunk-FXYH54JP.mjs";
23
23
  import "./chunk-774WSTCC.mjs";
24
24
  import {
25
25
  sdk
26
- } from "./chunk-DTY37DDZ.mjs";
26
+ } from "./chunk-YKIWIMJX.mjs";
27
27
  import "./chunk-QZ7TP4HQ.mjs";
28
28
 
29
29
  // src/routes/users/user-detail/breadcrumb.tsx
@@ -3,17 +3,17 @@ import {
3
3
  KeyboundForm,
4
4
  RouteDrawer,
5
5
  useRouteModal
6
- } from "./chunk-2U3RK3JG.mjs";
6
+ } from "./chunk-VEI6HW6L.mjs";
7
7
  import {
8
8
  Form
9
9
  } from "./chunk-ND3ODI36.mjs";
10
10
  import {
11
11
  useUpdateUser,
12
12
  useUser
13
- } from "./chunk-YRWSG3YM.mjs";
13
+ } from "./chunk-HHPPTD3B.mjs";
14
14
  import "./chunk-FXYH54JP.mjs";
15
15
  import "./chunk-774WSTCC.mjs";
16
- import "./chunk-DTY37DDZ.mjs";
16
+ import "./chunk-YKIWIMJX.mjs";
17
17
  import "./chunk-QZ7TP4HQ.mjs";
18
18
 
19
19
  // src/routes/users/user-edit/user-edit.tsx
@@ -18,20 +18,20 @@ import {
18
18
  useDeleteInvite,
19
19
  useInvites,
20
20
  useResendInvite
21
- } from "./chunk-XIM7X4FB.mjs";
21
+ } from "./chunk-SYACY6AL.mjs";
22
22
  import "./chunk-ITNQKZQQ.mjs";
23
23
  import "./chunk-OAHCJFG3.mjs";
24
24
  import "./chunk-S4DMV3ZT.mjs";
25
25
  import {
26
26
  KeyboundForm,
27
27
  RouteFocusModal
28
- } from "./chunk-2U3RK3JG.mjs";
28
+ } from "./chunk-VEI6HW6L.mjs";
29
29
  import {
30
30
  Form
31
31
  } from "./chunk-ND3ODI36.mjs";
32
32
  import "./chunk-FXYH54JP.mjs";
33
33
  import "./chunk-774WSTCC.mjs";
34
- import "./chunk-DTY37DDZ.mjs";
34
+ import "./chunk-YKIWIMJX.mjs";
35
35
  import "./chunk-QZ7TP4HQ.mjs";
36
36
 
37
37
  // src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useFeatureFlag
3
- } from "./chunk-DQCEH3X2.mjs";
3
+ } from "./chunk-7F3CWXUH.mjs";
4
4
  import {
5
5
  useQueryParams
6
6
  } from "./chunk-C76H5USB.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  import "./chunk-535OVBXR.mjs";
11
11
  import {
12
12
  SingleColumnPage
13
- } from "./chunk-22YYMH6M.mjs";
13
+ } from "./chunk-RISX76YT.mjs";
14
14
  import {
15
15
  useExtension
16
16
  } from "./chunk-C5P5PL3E.mjs";
@@ -24,15 +24,15 @@ import {
24
24
  useSetActiveViewConfiguration,
25
25
  useUpdateViewConfiguration,
26
26
  useViewConfigurations
27
- } from "./chunk-DN3MIYQH.mjs";
27
+ } from "./chunk-FKTMBR44.mjs";
28
28
  import "./chunk-OAHCJFG3.mjs";
29
29
  import "./chunk-S4DMV3ZT.mjs";
30
30
  import {
31
31
  useUsers
32
- } from "./chunk-YRWSG3YM.mjs";
32
+ } from "./chunk-HHPPTD3B.mjs";
33
33
  import "./chunk-FXYH54JP.mjs";
34
34
  import "./chunk-774WSTCC.mjs";
35
- import "./chunk-DTY37DDZ.mjs";
35
+ import "./chunk-YKIWIMJX.mjs";
36
36
  import "./chunk-QZ7TP4HQ.mjs";
37
37
 
38
38
  // src/routes/users/user-list/components/user-list-table/user-list-table.tsx
@@ -1,10 +1,10 @@
1
- import "./chunk-ST2YB7JN.mjs";
2
- import "./chunk-GBFVWROS.mjs";
3
- import "./chunk-EFRMWHRX.mjs";
4
- import "./chunk-LKWTBYYC.mjs";
5
- import "./chunk-ULSPL3DR.mjs";
6
- import "./chunk-DN3MIYQH.mjs";
7
- import "./chunk-XIM7X4FB.mjs";
1
+ import "./chunk-WLRJXEKL.mjs";
2
+ import "./chunk-5IEHCYJO.mjs";
3
+ import "./chunk-XIP35KXF.mjs";
4
+ import "./chunk-PFZQYK7R.mjs";
5
+ import "./chunk-A7ULKHDE.mjs";
6
+ import "./chunk-FKTMBR44.mjs";
7
+ import "./chunk-SYACY6AL.mjs";
8
8
  import {
9
9
  Skeleton
10
10
  } from "./chunk-ITNQKZQQ.mjs";
@@ -19,17 +19,17 @@ import {
19
19
  KeyboundForm,
20
20
  RouteDrawer,
21
21
  useRouteModal
22
- } from "./chunk-2U3RK3JG.mjs";
22
+ } from "./chunk-VEI6HW6L.mjs";
23
23
  import {
24
24
  Form
25
25
  } from "./chunk-ND3ODI36.mjs";
26
26
  import {
27
27
  useUpdateUser,
28
28
  useUser
29
- } from "./chunk-YRWSG3YM.mjs";
29
+ } from "./chunk-HHPPTD3B.mjs";
30
30
  import "./chunk-FXYH54JP.mjs";
31
31
  import "./chunk-774WSTCC.mjs";
32
- import "./chunk-DTY37DDZ.mjs";
32
+ import "./chunk-YKIWIMJX.mjs";
33
33
  import "./chunk-QZ7TP4HQ.mjs";
34
34
 
35
35
  // src/routes/users/user-metadata/user-metadata.tsx
@@ -0,0 +1,152 @@
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
+ };
@@ -0,0 +1,94 @@
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
+ };
@@ -0,0 +1,142 @@
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
+ };