@acmekit/dashboard 2.13.21 → 2.13.23
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/{api-key-management-list-HYZG23AG.mjs → api-key-management-list-QK4Q7Y5I.mjs} +73 -72
- package/dist/app.js +1079 -830
- package/dist/app.mjs +12 -4
- package/dist/chunk-QZOY6YYT.mjs +38 -0
- package/dist/en.json +8 -0
- package/dist/{workflow-execution-detail-LZXCRVNC.mjs → workflow-execution-detail-5O5VCXL3.mjs} +63 -12
- package/dist/workflow-execution-list-DETG4MRT.mjs +347 -0
- package/package.json +9 -9
- package/src/i18n/translations/$schema.json +32 -0
- package/src/i18n/translations/en.json +8 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-general-section/workflow-execution-general-section.tsx +93 -16
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx +134 -12
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-filters.tsx +57 -0
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-query.tsx +9 -2
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx +8 -0
- package/dist/chunk-WILMJYUB.mjs +0 -35
- package/dist/workflow-execution-list-HQ3V6TML.mjs +0 -175
package/dist/app.mjs
CHANGED
|
@@ -11881,6 +11881,13 @@ var en_default = {
|
|
|
11881
11881
|
transactionIdLabel: "Transaction ID",
|
|
11882
11882
|
workflowIdLabel: "Workflow ID",
|
|
11883
11883
|
progressLabel: "Progress",
|
|
11884
|
+
metrics: {
|
|
11885
|
+
stepsSummary: "{{completed}} of {{total}} steps",
|
|
11886
|
+
failedSteps: "{{count}} failed",
|
|
11887
|
+
skippedSteps: "{{count}} skipped",
|
|
11888
|
+
compensatedYes: "Compensated",
|
|
11889
|
+
compensatedNo: "Not compensated"
|
|
11890
|
+
},
|
|
11884
11891
|
stepsCompletedLabel_one: "{{completed}} of {{count}} step",
|
|
11885
11892
|
stepsCompletedLabel_other: "{{completed}} of {{count}} steps",
|
|
11886
11893
|
list: {
|
|
@@ -12096,6 +12103,7 @@ var en_default = {
|
|
|
12096
12103
|
note: "Note",
|
|
12097
12104
|
automaticTaxes: "Automatic Taxes",
|
|
12098
12105
|
taxInclusivePricing: "Tax inclusive pricing",
|
|
12106
|
+
duration: "Duration",
|
|
12099
12107
|
currency: "Currency",
|
|
12100
12108
|
address: "Address",
|
|
12101
12109
|
address2: "Apartment, suite, etc.",
|
|
@@ -95348,7 +95356,7 @@ var defaultSettingsRouteChildren = [
|
|
|
95348
95356
|
children: [
|
|
95349
95357
|
{
|
|
95350
95358
|
path: "",
|
|
95351
|
-
lazy: () => import("./api-key-management-list-
|
|
95359
|
+
lazy: () => import("./api-key-management-list-QK4Q7Y5I.mjs"),
|
|
95352
95360
|
children: [
|
|
95353
95361
|
{
|
|
95354
95362
|
path: "create",
|
|
@@ -95390,7 +95398,7 @@ var defaultSettingsRouteChildren = [
|
|
|
95390
95398
|
children: [
|
|
95391
95399
|
{
|
|
95392
95400
|
path: "",
|
|
95393
|
-
lazy: () => import("./api-key-management-list-
|
|
95401
|
+
lazy: () => import("./api-key-management-list-QK4Q7Y5I.mjs"),
|
|
95394
95402
|
children: [
|
|
95395
95403
|
{
|
|
95396
95404
|
path: "create",
|
|
@@ -95429,12 +95437,12 @@ var defaultSettingsRouteChildren = [
|
|
|
95429
95437
|
children: [
|
|
95430
95438
|
{
|
|
95431
95439
|
path: "",
|
|
95432
|
-
lazy: () => import("./workflow-execution-list-
|
|
95440
|
+
lazy: () => import("./workflow-execution-list-DETG4MRT.mjs")
|
|
95433
95441
|
},
|
|
95434
95442
|
{
|
|
95435
95443
|
path: ":id",
|
|
95436
95444
|
lazy: async () => {
|
|
95437
|
-
const { Component, Breadcrumb, loader } = await import("./workflow-execution-detail-
|
|
95445
|
+
const { Component, Breadcrumb, loader } = await import("./workflow-execution-detail-5O5VCXL3.mjs");
|
|
95438
95446
|
return {
|
|
95439
95447
|
Component,
|
|
95440
95448
|
loader,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDate
|
|
3
|
+
} from "./chunk-DFFLVEZ5.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/table/table-cells/common/date-cell/date-cell.tsx
|
|
6
|
+
import { Tooltip } from "@acmekit/ui";
|
|
7
|
+
import { useTranslation } from "react-i18next";
|
|
8
|
+
|
|
9
|
+
// src/components/table/table-cells/common/placeholder-cell/placeholder-cell.tsx
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var PlaceholderCell = () => {
|
|
12
|
+
return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center", children: /* @__PURE__ */ jsx("span", { className: "text-ui-fg-muted", children: "-" }) });
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// src/components/table/table-cells/common/date-cell/date-cell.tsx
|
|
16
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
17
|
+
var DateCell = ({ date }) => {
|
|
18
|
+
const { getFullDate } = useDate();
|
|
19
|
+
if (!date) {
|
|
20
|
+
return /* @__PURE__ */ jsx2(PlaceholderCell, {});
|
|
21
|
+
}
|
|
22
|
+
return /* @__PURE__ */ jsx2("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx2(
|
|
23
|
+
Tooltip,
|
|
24
|
+
{
|
|
25
|
+
className: "z-10",
|
|
26
|
+
content: /* @__PURE__ */ jsx2("span", { className: "text-pretty", children: `${getFullDate({
|
|
27
|
+
date,
|
|
28
|
+
includeTime: true
|
|
29
|
+
})}` }),
|
|
30
|
+
children: /* @__PURE__ */ jsx2("span", { className: "truncate", children: getFullDate({ date, includeTime: false }) })
|
|
31
|
+
}
|
|
32
|
+
) });
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
PlaceholderCell,
|
|
37
|
+
DateCell
|
|
38
|
+
};
|
package/dist/en.json
CHANGED
|
@@ -2965,6 +2965,13 @@
|
|
|
2965
2965
|
"transactionIdLabel": "Transaction ID",
|
|
2966
2966
|
"workflowIdLabel": "Workflow ID",
|
|
2967
2967
|
"progressLabel": "Progress",
|
|
2968
|
+
"metrics": {
|
|
2969
|
+
"stepsSummary": "{{completed}} of {{total}} steps",
|
|
2970
|
+
"failedSteps": "{{count}} failed",
|
|
2971
|
+
"skippedSteps": "{{count}} skipped",
|
|
2972
|
+
"compensatedYes": "Compensated",
|
|
2973
|
+
"compensatedNo": "Not compensated"
|
|
2974
|
+
},
|
|
2968
2975
|
"stepsCompletedLabel_one": "{{completed}} of {{count}} step",
|
|
2969
2976
|
"stepsCompletedLabel_other": "{{completed}} of {{count}} steps",
|
|
2970
2977
|
"list": {
|
|
@@ -3180,6 +3187,7 @@
|
|
|
3180
3187
|
"note": "Note",
|
|
3181
3188
|
"automaticTaxes": "Automatic Taxes",
|
|
3182
3189
|
"taxInclusivePricing": "Tax inclusive pricing",
|
|
3190
|
+
"duration": "Duration",
|
|
3183
3191
|
"currency": "Currency",
|
|
3184
3192
|
"address": "Address",
|
|
3185
3193
|
"address2": "Apartment, suite, etc.",
|
package/dist/{workflow-execution-detail-LZXCRVNC.mjs → workflow-execution-detail-5O5VCXL3.mjs}
RENAMED
|
@@ -7,6 +7,10 @@ import {
|
|
|
7
7
|
getTransactionState,
|
|
8
8
|
getTransactionStateColor
|
|
9
9
|
} from "./chunk-RPAL6FHW.mjs";
|
|
10
|
+
import {
|
|
11
|
+
useDate
|
|
12
|
+
} from "./chunk-DFFLVEZ5.mjs";
|
|
13
|
+
import "./chunk-535OVBXR.mjs";
|
|
10
14
|
import {
|
|
11
15
|
JsonViewSection,
|
|
12
16
|
SingleColumnPage
|
|
@@ -72,21 +76,14 @@ var workflowExecutionLoader = async ({
|
|
|
72
76
|
import { useParams } from "react-router-dom";
|
|
73
77
|
|
|
74
78
|
// src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-general-section/workflow-execution-general-section.tsx
|
|
75
|
-
import {
|
|
76
|
-
Badge,
|
|
77
|
-
Container,
|
|
78
|
-
Copy,
|
|
79
|
-
Heading,
|
|
80
|
-
StatusBadge,
|
|
81
|
-
Text,
|
|
82
|
-
clx
|
|
83
|
-
} from "@acmekit/ui";
|
|
79
|
+
import { Badge, Container, Copy, Heading, StatusBadge, Text, clx } from "@acmekit/ui";
|
|
84
80
|
import { useTranslation } from "react-i18next";
|
|
85
81
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
86
82
|
var WorkflowExecutionGeneralSection = ({
|
|
87
83
|
execution
|
|
88
84
|
}) => {
|
|
89
85
|
const { t } = useTranslation();
|
|
86
|
+
const { getFullDate } = useDate();
|
|
90
87
|
const cleanId = execution.id.replace("wf_exec_", "");
|
|
91
88
|
const translatedState = getTransactionState(
|
|
92
89
|
t,
|
|
@@ -95,6 +92,24 @@ var WorkflowExecutionGeneralSection = ({
|
|
|
95
92
|
const stateColor = getTransactionStateColor(
|
|
96
93
|
execution.state
|
|
97
94
|
);
|
|
95
|
+
const createdAt = execution.created_at;
|
|
96
|
+
const updatedAt = execution.updated_at;
|
|
97
|
+
const allSteps = Object.values(execution.execution?.steps || {}).filter(
|
|
98
|
+
(step) => step.id !== ROOT_PREFIX
|
|
99
|
+
);
|
|
100
|
+
const totalSteps = allSteps.length;
|
|
101
|
+
const completedSteps = allSteps.filter(
|
|
102
|
+
(step) => step.invoke.state === "done" /* DONE */
|
|
103
|
+
).length;
|
|
104
|
+
const failedSteps = allSteps.filter(
|
|
105
|
+
(step) => STEP_ERROR_STATES.includes(step.invoke.state)
|
|
106
|
+
).length;
|
|
107
|
+
const skippedSteps = allSteps.filter(
|
|
108
|
+
(step) => STEP_SKIPPED_STATES.includes(step.invoke.state)
|
|
109
|
+
).length;
|
|
110
|
+
const compensatedSteps = allSteps.filter(
|
|
111
|
+
(step) => step.compensate.state === "reverted" /* REVERTED */
|
|
112
|
+
).length;
|
|
98
113
|
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
99
114
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
100
115
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-0.5", children: [
|
|
@@ -105,15 +120,51 @@ var WorkflowExecutionGeneralSection = ({
|
|
|
105
120
|
] }),
|
|
106
121
|
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
107
122
|
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("workflowExecutions.workflowIdLabel") }),
|
|
108
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-1", children: [
|
|
124
|
+
/* @__PURE__ */ jsx2(Badge, { size: "2xsmall", className: "w-fit", children: execution.workflow_id }),
|
|
125
|
+
/* @__PURE__ */ jsx2(Copy, { content: execution.workflow_id, className: "text-ui-fg-muted" })
|
|
126
|
+
] })
|
|
109
127
|
] }),
|
|
110
128
|
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
111
129
|
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("workflowExecutions.transactionIdLabel") }),
|
|
112
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-1", children: [
|
|
131
|
+
/* @__PURE__ */ jsx2(Badge, { size: "2xsmall", className: "w-fit", children: execution.transaction_id }),
|
|
132
|
+
/* @__PURE__ */ jsx2(
|
|
133
|
+
Copy,
|
|
134
|
+
{
|
|
135
|
+
content: execution.transaction_id,
|
|
136
|
+
className: "text-ui-fg-muted"
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] })
|
|
113
140
|
] }),
|
|
114
141
|
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
115
142
|
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("workflowExecutions.progressLabel") }),
|
|
116
143
|
/* @__PURE__ */ jsx2(Progress, { steps: execution.execution?.steps })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
146
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.summary") }),
|
|
147
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-1", children: [
|
|
148
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("workflowExecutions.metrics.stepsSummary", {
|
|
149
|
+
completed: completedSteps,
|
|
150
|
+
total: totalSteps
|
|
151
|
+
}) }),
|
|
152
|
+
failedSteps > 0 && /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("workflowExecutions.metrics.failedSteps", {
|
|
153
|
+
count: failedSteps
|
|
154
|
+
}) }),
|
|
155
|
+
skippedSteps > 0 && /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("workflowExecutions.metrics.skippedSteps", {
|
|
156
|
+
count: skippedSteps
|
|
157
|
+
}) }),
|
|
158
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: compensatedSteps > 0 ? t("workflowExecutions.metrics.compensatedYes") : t("workflowExecutions.metrics.compensatedNo") })
|
|
159
|
+
] })
|
|
160
|
+
] }),
|
|
161
|
+
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
162
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.createdAt") }),
|
|
163
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: createdAt ? getFullDate({ date: createdAt, includeTime: true }) : "-" })
|
|
164
|
+
] }),
|
|
165
|
+
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
166
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.updatedAt") }),
|
|
167
|
+
/* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", children: updatedAt ? getFullDate({ date: updatedAt, includeTime: true }) : "-" })
|
|
117
168
|
] })
|
|
118
169
|
] });
|
|
119
170
|
};
|
|
@@ -125,7 +176,7 @@ var Progress = ({
|
|
|
125
176
|
if (!steps) {
|
|
126
177
|
return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("workflowExecutions.stepsCompletedLabel", {
|
|
127
178
|
completed: 0,
|
|
128
|
-
|
|
179
|
+
count: 0
|
|
129
180
|
}) });
|
|
130
181
|
}
|
|
131
182
|
const actionableSteps = Object.values(steps).filter(
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DateCell
|
|
3
|
+
} from "./chunk-QZOY6YYT.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getTransactionState,
|
|
6
|
+
getTransactionStateColor
|
|
7
|
+
} from "./chunk-RPAL6FHW.mjs";
|
|
8
|
+
import {
|
|
9
|
+
_DataTable,
|
|
10
|
+
useDataTable
|
|
11
|
+
} from "./chunk-YLPAZ2DP.mjs";
|
|
12
|
+
import {
|
|
13
|
+
useQueryParams
|
|
14
|
+
} from "./chunk-C76H5USB.mjs";
|
|
15
|
+
import "./chunk-DFFLVEZ5.mjs";
|
|
16
|
+
import "./chunk-535OVBXR.mjs";
|
|
17
|
+
import {
|
|
18
|
+
SingleColumnPage
|
|
19
|
+
} from "./chunk-22YYMH6M.mjs";
|
|
20
|
+
import {
|
|
21
|
+
useExtension
|
|
22
|
+
} from "./chunk-C5P5PL3E.mjs";
|
|
23
|
+
import {
|
|
24
|
+
useWorkflowExecutions
|
|
25
|
+
} from "./chunk-LKWTBYYC.mjs";
|
|
26
|
+
import "./chunk-ITNQKZQQ.mjs";
|
|
27
|
+
import "./chunk-S4DMV3ZT.mjs";
|
|
28
|
+
import "./chunk-774WSTCC.mjs";
|
|
29
|
+
import "./chunk-DTY37DDZ.mjs";
|
|
30
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
31
|
+
|
|
32
|
+
// src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx
|
|
33
|
+
import { Container, Heading, Text as Text2 } from "@acmekit/ui";
|
|
34
|
+
import { keepPreviousData } from "@tanstack/react-query";
|
|
35
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
36
|
+
|
|
37
|
+
// src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx
|
|
38
|
+
import { Badge, Copy, Text, clx as clx2 } from "@acmekit/ui";
|
|
39
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
40
|
+
import { useMemo } from "react";
|
|
41
|
+
import { useTranslation } from "react-i18next";
|
|
42
|
+
|
|
43
|
+
// src/components/data-table/components/data-table-status-cell/data-table-status-cell.tsx
|
|
44
|
+
import { clx } from "@acmekit/ui";
|
|
45
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
46
|
+
var DataTableStatusCell = ({
|
|
47
|
+
color,
|
|
48
|
+
children
|
|
49
|
+
}) => {
|
|
50
|
+
return /* @__PURE__ */ jsxs("div", { className: "txt-compact-small text-ui-fg-subtle flex h-full w-full items-center gap-x-2 overflow-hidden", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
role: "presentation",
|
|
55
|
+
className: "flex h-5 w-2 items-center justify-center",
|
|
56
|
+
children: /* @__PURE__ */ jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: clx(
|
|
60
|
+
"h-2 w-2 rounded-sm shadow-[0px_0px_0px_1px_rgba(0,0,0,0.12)_inset]",
|
|
61
|
+
{
|
|
62
|
+
"bg-ui-tag-neutral-icon": color === "grey",
|
|
63
|
+
"bg-ui-tag-green-icon": color === "green",
|
|
64
|
+
"bg-ui-tag-red-icon": color === "red",
|
|
65
|
+
"bg-ui-tag-blue-icon": color === "blue",
|
|
66
|
+
"bg-ui-tag-orange-icon": color === "orange",
|
|
67
|
+
"bg-ui-tag-purple-icon": color === "purple"
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children })
|
|
75
|
+
] });
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx
|
|
79
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
80
|
+
var columnHelper = createColumnHelper();
|
|
81
|
+
var useWorkflowExecutionTableColumns = () => {
|
|
82
|
+
const { t } = useTranslation();
|
|
83
|
+
return useMemo(
|
|
84
|
+
() => [
|
|
85
|
+
columnHelper.accessor("workflow_id", {
|
|
86
|
+
header: t("workflowExecutions.workflowIdLabel"),
|
|
87
|
+
cell: ({ getValue }) => {
|
|
88
|
+
const workflowId = getValue();
|
|
89
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-1", children: [
|
|
90
|
+
/* @__PURE__ */ jsx2(Badge, { size: "2xsmall", className: "truncate", children: workflowId }),
|
|
91
|
+
/* @__PURE__ */ jsx2(Copy, { content: workflowId, className: "text-ui-fg-muted" })
|
|
92
|
+
] });
|
|
93
|
+
}
|
|
94
|
+
}),
|
|
95
|
+
columnHelper.accessor("state", {
|
|
96
|
+
header: t("fields.state"),
|
|
97
|
+
cell: ({ getValue }) => {
|
|
98
|
+
const state = getValue();
|
|
99
|
+
const color = getTransactionStateColor(state);
|
|
100
|
+
const translatedState = getTransactionState(t, state);
|
|
101
|
+
return /* @__PURE__ */ jsx2(DataTableStatusCell, { color, children: /* @__PURE__ */ jsx2("span", { className: "capitalize", children: translatedState }) });
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
104
|
+
columnHelper.accessor("execution", {
|
|
105
|
+
header: t("workflowExecutions.progressLabel"),
|
|
106
|
+
cell: ({ getValue }) => {
|
|
107
|
+
const steps = getValue()?.steps;
|
|
108
|
+
if (!steps) {
|
|
109
|
+
return /* @__PURE__ */ jsx2("span", { className: "text-ui-fg-subtle whitespace-nowrap", children: t("workflowExecutions.stepsCompletedLabel", {
|
|
110
|
+
completed: 0,
|
|
111
|
+
count: 0
|
|
112
|
+
}) });
|
|
113
|
+
}
|
|
114
|
+
const actionableSteps = Object.values(steps).filter(
|
|
115
|
+
(step) => step.id !== ROOT_PREFIX
|
|
116
|
+
);
|
|
117
|
+
const completedSteps = actionableSteps.filter(
|
|
118
|
+
(step) => step.invoke.state === "done" /* DONE */
|
|
119
|
+
);
|
|
120
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-2", children: [
|
|
121
|
+
/* @__PURE__ */ jsx2("div", { className: "flex items-center gap-x-[3px]", children: actionableSteps.map((step) => /* @__PURE__ */ jsx2(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
className: clx2(
|
|
125
|
+
"bg-ui-bg-switch-off shadow-details-switch-background h-3 w-1.5 rounded-full",
|
|
126
|
+
{
|
|
127
|
+
"bg-ui-fg-muted": step.invoke.state === "done" /* DONE */
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
"data-completed": step.invoke.state === "done" /* DONE */
|
|
131
|
+
},
|
|
132
|
+
step.id
|
|
133
|
+
)) }),
|
|
134
|
+
/* @__PURE__ */ jsx2("span", { className: "text-ui-fg-subtle whitespace-nowrap", children: t("workflowExecutions.stepsCompletedLabel", {
|
|
135
|
+
completed: completedSteps.length,
|
|
136
|
+
count: actionableSteps.length
|
|
137
|
+
}) })
|
|
138
|
+
] });
|
|
139
|
+
}
|
|
140
|
+
}),
|
|
141
|
+
columnHelper.display({
|
|
142
|
+
id: "duration",
|
|
143
|
+
header: t("fields.duration"),
|
|
144
|
+
cell: ({ row }) => {
|
|
145
|
+
const createdAt = row.original.created_at;
|
|
146
|
+
const updatedAt = row.original.updated_at;
|
|
147
|
+
const state = row.original.state;
|
|
148
|
+
if (!createdAt) {
|
|
149
|
+
return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: "-" });
|
|
150
|
+
}
|
|
151
|
+
const start = new Date(createdAt);
|
|
152
|
+
const end = updatedAt && ["done", "failed", "reverted"].includes(state) ? new Date(updatedAt) : /* @__PURE__ */ new Date();
|
|
153
|
+
if (isNaN(start.getTime()) || isNaN(end.getTime())) {
|
|
154
|
+
return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: "-" });
|
|
155
|
+
}
|
|
156
|
+
const ms = end.getTime() - start.getTime();
|
|
157
|
+
if (ms < 0) {
|
|
158
|
+
return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: "-" });
|
|
159
|
+
}
|
|
160
|
+
const seconds = Math.floor(ms / 1e3);
|
|
161
|
+
const minutes = Math.floor(seconds / 60);
|
|
162
|
+
const hours = Math.floor(minutes / 60);
|
|
163
|
+
let label;
|
|
164
|
+
if (hours > 0) {
|
|
165
|
+
label = `${hours}h ${minutes % 60}m`;
|
|
166
|
+
} else if (minutes > 0) {
|
|
167
|
+
label = `${minutes}m ${seconds % 60}s`;
|
|
168
|
+
} else if (seconds > 0) {
|
|
169
|
+
label = `${seconds}s`;
|
|
170
|
+
} else if (ms > 0) {
|
|
171
|
+
label = "<1s";
|
|
172
|
+
} else {
|
|
173
|
+
label = "0s";
|
|
174
|
+
}
|
|
175
|
+
return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: label });
|
|
176
|
+
}
|
|
177
|
+
}),
|
|
178
|
+
columnHelper.accessor("created_at", {
|
|
179
|
+
header: t("fields.createdAt"),
|
|
180
|
+
cell: ({ getValue }) => {
|
|
181
|
+
const date = getValue();
|
|
182
|
+
return /* @__PURE__ */ jsx2(DateCell, { date });
|
|
183
|
+
}
|
|
184
|
+
}),
|
|
185
|
+
columnHelper.accessor("updated_at", {
|
|
186
|
+
header: t("fields.updatedAt"),
|
|
187
|
+
cell: ({ getValue }) => {
|
|
188
|
+
const date = getValue();
|
|
189
|
+
return /* @__PURE__ */ jsx2(DateCell, { date });
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
],
|
|
193
|
+
[t]
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
var ROOT_PREFIX = "_root";
|
|
197
|
+
|
|
198
|
+
// src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-filters.tsx
|
|
199
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
200
|
+
var useWorkflowExecutionTableFilters = () => {
|
|
201
|
+
const { t } = useTranslation2();
|
|
202
|
+
const stateFilter = {
|
|
203
|
+
key: "state",
|
|
204
|
+
label: t("fields.status"),
|
|
205
|
+
type: "select",
|
|
206
|
+
multiple: true,
|
|
207
|
+
options: [
|
|
208
|
+
{
|
|
209
|
+
label: t("workflowExecutions.state.done"),
|
|
210
|
+
value: "done"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
label: t("workflowExecutions.state.failed"),
|
|
214
|
+
value: "failed"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
label: t("workflowExecutions.state.reverted"),
|
|
218
|
+
value: "reverted"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
label: t("workflowExecutions.state.invoking"),
|
|
222
|
+
value: "invoking"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: t("workflowExecutions.transaction.state.waitingToCompensate"),
|
|
226
|
+
value: "waiting_to_compensate"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
label: t("workflowExecutions.state.compensating"),
|
|
230
|
+
value: "compensating"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
label: t("workflowExecutions.state.notStarted"),
|
|
234
|
+
value: "not_started"
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
};
|
|
238
|
+
const dateFilters = [
|
|
239
|
+
{ key: "created_at", label: t("fields.createdAt"), type: "date" },
|
|
240
|
+
{ key: "updated_at", label: t("fields.updatedAt"), type: "date" }
|
|
241
|
+
];
|
|
242
|
+
return [stateFilter, ...dateFilters];
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-query.tsx
|
|
246
|
+
var useWorkflowExecutionTableQuery = ({
|
|
247
|
+
pageSize = 20,
|
|
248
|
+
prefix
|
|
249
|
+
}) => {
|
|
250
|
+
const raw = useQueryParams(
|
|
251
|
+
["q", "offset", "order", "state", "created_at", "updated_at"],
|
|
252
|
+
prefix
|
|
253
|
+
);
|
|
254
|
+
const { offset, order, state, created_at, updated_at, ...rest } = raw;
|
|
255
|
+
const searchParams = {
|
|
256
|
+
limit: pageSize,
|
|
257
|
+
offset: offset ? parseInt(offset) : 0,
|
|
258
|
+
order: order ?? "-created_at",
|
|
259
|
+
state: state ? state.split(",") : void 0,
|
|
260
|
+
created_at: created_at ? JSON.parse(created_at) : void 0,
|
|
261
|
+
updated_at: updated_at ? JSON.parse(updated_at) : void 0,
|
|
262
|
+
...rest
|
|
263
|
+
};
|
|
264
|
+
return {
|
|
265
|
+
searchParams,
|
|
266
|
+
raw
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
// src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx
|
|
271
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
272
|
+
var PAGE_SIZE = 20;
|
|
273
|
+
var WorkflowExecutionListTable = () => {
|
|
274
|
+
const { t } = useTranslation3();
|
|
275
|
+
const { searchParams, raw } = useWorkflowExecutionTableQuery({
|
|
276
|
+
pageSize: PAGE_SIZE
|
|
277
|
+
});
|
|
278
|
+
const { workflow_executions, count, isLoading, isError, error } = useWorkflowExecutions(
|
|
279
|
+
{
|
|
280
|
+
...searchParams
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
placeholderData: keepPreviousData
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
const columns = useWorkflowExecutionTableColumns();
|
|
287
|
+
const filters = useWorkflowExecutionTableFilters();
|
|
288
|
+
const { table } = useDataTable({
|
|
289
|
+
data: workflow_executions || [],
|
|
290
|
+
columns,
|
|
291
|
+
count,
|
|
292
|
+
pageSize: PAGE_SIZE,
|
|
293
|
+
enablePagination: true,
|
|
294
|
+
getRowId: (row) => row.id
|
|
295
|
+
});
|
|
296
|
+
if (isError) {
|
|
297
|
+
throw error;
|
|
298
|
+
}
|
|
299
|
+
return /* @__PURE__ */ jsxs3(Container, { className: "divide-y p-0", children: [
|
|
300
|
+
/* @__PURE__ */ jsx3("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsxs3("div", { children: [
|
|
301
|
+
/* @__PURE__ */ jsx3(Heading, { children: t("workflowExecutions.domain") }),
|
|
302
|
+
/* @__PURE__ */ jsx3(Text2, { className: "text-ui-fg-subtle", size: "small", children: t(`workflowExecutions.subtitle`) })
|
|
303
|
+
] }) }),
|
|
304
|
+
/* @__PURE__ */ jsx3(
|
|
305
|
+
_DataTable,
|
|
306
|
+
{
|
|
307
|
+
table,
|
|
308
|
+
columns,
|
|
309
|
+
filters,
|
|
310
|
+
count,
|
|
311
|
+
isLoading,
|
|
312
|
+
orderBy: [
|
|
313
|
+
{ key: "created_at", label: t("fields.createdAt") },
|
|
314
|
+
{ key: "updated_at", label: t("fields.updatedAt") }
|
|
315
|
+
],
|
|
316
|
+
pageSize: PAGE_SIZE,
|
|
317
|
+
navigateTo: (row) => `${row.id}`,
|
|
318
|
+
search: true,
|
|
319
|
+
pagination: true,
|
|
320
|
+
queryObject: raw,
|
|
321
|
+
noRecords: {
|
|
322
|
+
message: t("workflowExecutions.list.noRecordsMessage")
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
] });
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// src/routes/workflow-executions/workflow-execution-list/workflow-execution-list.tsx
|
|
330
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
331
|
+
var WorkflowExcecutionList = () => {
|
|
332
|
+
const { getWidgets } = useExtension();
|
|
333
|
+
return /* @__PURE__ */ jsx4(
|
|
334
|
+
SingleColumnPage,
|
|
335
|
+
{
|
|
336
|
+
widgets: {
|
|
337
|
+
after: getWidgets("workflow.list.after"),
|
|
338
|
+
before: getWidgets("workflow.list.before")
|
|
339
|
+
},
|
|
340
|
+
hasOutlet: false,
|
|
341
|
+
children: /* @__PURE__ */ jsx4(WorkflowExecutionListTable, {})
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
};
|
|
345
|
+
export {
|
|
346
|
+
WorkflowExcecutionList as Component
|
|
347
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acmekit/dashboard",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.23",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
|
|
6
6
|
"dev": "../../../node_modules/.bin/vite",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@acmekit/admin-shared": "2.13.
|
|
43
|
-
"@acmekit/icons": "2.13.
|
|
44
|
-
"@acmekit/js-sdk": "2.13.
|
|
45
|
-
"@acmekit/ui": "4.1.
|
|
42
|
+
"@acmekit/admin-shared": "2.13.23",
|
|
43
|
+
"@acmekit/icons": "2.13.23",
|
|
44
|
+
"@acmekit/js-sdk": "2.13.23",
|
|
45
|
+
"@acmekit/ui": "4.1.19",
|
|
46
46
|
"@ariakit/react": "^0.4.15",
|
|
47
47
|
"@babel/runtime": "^7.26.10",
|
|
48
48
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"zod": "3.25.76"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@acmekit/admin-shared": "2.13.
|
|
84
|
-
"@acmekit/admin-vite-plugin": "2.13.
|
|
85
|
-
"@acmekit/types": "2.13.
|
|
86
|
-
"@acmekit/ui-preset": "2.13.
|
|
83
|
+
"@acmekit/admin-shared": "2.13.23",
|
|
84
|
+
"@acmekit/admin-vite-plugin": "2.13.23",
|
|
85
|
+
"@acmekit/types": "2.13.23",
|
|
86
|
+
"@acmekit/ui-preset": "2.13.23"
|
|
87
87
|
},
|
|
88
88
|
"packageManager": "yarn@3.2.1"
|
|
89
89
|
}
|
|
@@ -11038,6 +11038,34 @@
|
|
|
11038
11038
|
"stepsCompletedLabel_other": {
|
|
11039
11039
|
"type": "string"
|
|
11040
11040
|
},
|
|
11041
|
+
"metrics": {
|
|
11042
|
+
"type": "object",
|
|
11043
|
+
"properties": {
|
|
11044
|
+
"stepsSummary": {
|
|
11045
|
+
"type": "string"
|
|
11046
|
+
},
|
|
11047
|
+
"failedSteps": {
|
|
11048
|
+
"type": "string"
|
|
11049
|
+
},
|
|
11050
|
+
"skippedSteps": {
|
|
11051
|
+
"type": "string"
|
|
11052
|
+
},
|
|
11053
|
+
"compensatedYes": {
|
|
11054
|
+
"type": "string"
|
|
11055
|
+
},
|
|
11056
|
+
"compensatedNo": {
|
|
11057
|
+
"type": "string"
|
|
11058
|
+
}
|
|
11059
|
+
},
|
|
11060
|
+
"required": [
|
|
11061
|
+
"stepsSummary",
|
|
11062
|
+
"failedSteps",
|
|
11063
|
+
"skippedSteps",
|
|
11064
|
+
"compensatedYes",
|
|
11065
|
+
"compensatedNo"
|
|
11066
|
+
],
|
|
11067
|
+
"additionalProperties": false
|
|
11068
|
+
},
|
|
11041
11069
|
"list": {
|
|
11042
11070
|
"type": "object",
|
|
11043
11071
|
"properties": {
|
|
@@ -11184,6 +11212,7 @@
|
|
|
11184
11212
|
"progressLabel",
|
|
11185
11213
|
"stepsCompletedLabel_one",
|
|
11186
11214
|
"stepsCompletedLabel_other",
|
|
11215
|
+
"metrics",
|
|
11187
11216
|
"list",
|
|
11188
11217
|
"history",
|
|
11189
11218
|
"state",
|
|
@@ -11759,6 +11788,9 @@
|
|
|
11759
11788
|
"taxInclusivePricing": {
|
|
11760
11789
|
"type": "string"
|
|
11761
11790
|
},
|
|
11791
|
+
"duration": {
|
|
11792
|
+
"type": "string"
|
|
11793
|
+
},
|
|
11762
11794
|
"currency": {
|
|
11763
11795
|
"type": "string"
|
|
11764
11796
|
},
|