@open-mercato/core 0.6.2-develop.3400.1.d948268f50 → 0.6.2-develop.3406.1.2b403f40da
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/.turbo/turbo-build.log +1 -1
- package/dist/generated/entities/workflow_definition/index.js +2 -0
- package/dist/generated/entities/workflow_definition/index.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +1 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/sales/workflows.js +180 -0
- package/dist/modules/sales/workflows.js.map +7 -0
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js +172 -0
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js +205 -0
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js.map +7 -0
- package/dist/modules/workflows/api/definitions/[id]/route.js +91 -2
- package/dist/modules/workflows/api/definitions/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/route.js +32 -9
- package/dist/modules/workflows/api/definitions/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/serialize.js +36 -1
- package/dist/modules/workflows/api/definitions/serialize.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/[id]/page.js +161 -52
- package/dist/modules/workflows/backend/definitions/[id]/page.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/page.js +37 -34
- package/dist/modules/workflows/backend/definitions/page.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js +134 -41
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
- package/dist/modules/workflows/cli.js +19 -121
- package/dist/modules/workflows/cli.js.map +2 -2
- package/dist/modules/workflows/components/formConfig.js +1 -1
- package/dist/modules/workflows/components/formConfig.js.map +2 -2
- package/dist/modules/workflows/data/entities.js +3 -0
- package/dist/modules/workflows/data/entities.js.map +2 -2
- package/dist/modules/workflows/data/validators.js +2 -2
- package/dist/modules/workflows/data/validators.js.map +2 -2
- package/dist/modules/workflows/events.js +2 -0
- package/dist/modules/workflows/events.js.map +2 -2
- package/dist/modules/workflows/examples/guard-rules-example.json +6 -6
- package/dist/modules/workflows/examples/order-approval-guard-rules.json +2 -2
- package/dist/modules/workflows/frontend/checkout-demo/page.js +4 -4
- package/dist/modules/workflows/frontend/checkout-demo/page.js.map +2 -2
- package/dist/modules/workflows/lib/code-registry.js +40 -0
- package/dist/modules/workflows/lib/code-registry.js.map +7 -0
- package/dist/modules/workflows/lib/find-definition.js +58 -0
- package/dist/modules/workflows/lib/find-definition.js.map +7 -0
- package/dist/modules/workflows/lib/seeds.js +0 -3
- package/dist/modules/workflows/lib/seeds.js.map +2 -2
- package/dist/modules/workflows/lib/start-validator.js +1 -20
- package/dist/modules/workflows/lib/start-validator.js.map +2 -2
- package/dist/modules/workflows/lib/workflow-executor.js +1 -19
- package/dist/modules/workflows/lib/workflow-executor.js.map +2 -2
- package/dist/modules/workflows/migrations/Migration20260414120000.js +13 -0
- package/dist/modules/workflows/migrations/Migration20260414120000.js.map +7 -0
- package/dist/modules/workflows/migrations/Migration20260428102318.js +32 -0
- package/dist/modules/workflows/migrations/Migration20260428102318.js.map +7 -0
- package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js +1 -1
- package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js.map +1 -1
- package/dist/modules/workflows/workflows.js +260 -0
- package/dist/modules/workflows/workflows.js.map +7 -0
- package/generated/entities/workflow_definition/index.ts +1 -0
- package/generated/entity-fields-registry.ts +1 -0
- package/package.json +7 -7
- package/src/modules/sales/workflows.ts +184 -0
- package/src/modules/workflows/api/definitions/[id]/customize/route.ts +197 -0
- package/src/modules/workflows/api/definitions/[id]/reset-to-code/route.ts +252 -0
- package/src/modules/workflows/api/definitions/[id]/route.ts +108 -4
- package/src/modules/workflows/api/definitions/route.ts +54 -10
- package/src/modules/workflows/api/definitions/serialize.ts +42 -0
- package/src/modules/workflows/backend/definitions/[id]/page.tsx +135 -11
- package/src/modules/workflows/backend/definitions/page.tsx +45 -33
- package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +222 -97
- package/src/modules/workflows/cli.ts +32 -155
- package/src/modules/workflows/components/formConfig.tsx +2 -2
- package/src/modules/workflows/data/entities.ts +4 -1
- package/src/modules/workflows/data/validators.ts +4 -3
- package/src/modules/workflows/events.ts +2 -0
- package/src/modules/workflows/examples/guard-rules-example.json +6 -6
- package/src/modules/workflows/examples/order-approval-guard-rules.json +2 -2
- package/src/modules/workflows/frontend/checkout-demo/page.tsx +4 -4
- package/src/modules/workflows/i18n/de.json +16 -0
- package/src/modules/workflows/i18n/en.json +16 -0
- package/src/modules/workflows/i18n/es.json +16 -0
- package/src/modules/workflows/i18n/pl.json +16 -0
- package/src/modules/workflows/lib/code-registry.ts +65 -0
- package/src/modules/workflows/lib/find-definition.ts +100 -0
- package/src/modules/workflows/lib/seeds.ts +4 -3
- package/src/modules/workflows/lib/start-validator.ts +2 -35
- package/src/modules/workflows/lib/workflow-executor.ts +2 -39
- package/src/modules/workflows/migrations/.snapshot-open-mercato.json +10 -0
- package/src/modules/workflows/migrations/Migration20260414120000.ts +13 -0
- package/src/modules/workflows/migrations/Migration20260428102318.ts +57 -0
- package/src/modules/workflows/widgets/injection/order-approval/widget.client.tsx +1 -1
- package/src/modules/workflows/workflows.ts +278 -0
- package/dist/modules/workflows/examples/checkout-demo-definition.json +0 -486
- package/dist/modules/workflows/examples/order-approval-definition.json +0 -257
- package/dist/modules/workflows/examples/simple-approval-definition.json +0 -134
- package/src/modules/workflows/examples/checkout-demo-definition.json +0 -486
- package/src/modules/workflows/examples/order-approval-definition.json +0 -257
- package/src/modules/workflows/examples/simple-approval-definition.json +0 -134
|
@@ -81,6 +81,9 @@ function VisualEditorPage() {
|
|
|
81
81
|
const [effectiveFrom, setEffectiveFrom] = useState("");
|
|
82
82
|
const [effectiveTo, setEffectiveTo] = useState("");
|
|
83
83
|
const [triggers, setTriggers] = useState([]);
|
|
84
|
+
const [source, setSource] = useState(null);
|
|
85
|
+
const isCodeOnly = source === "code";
|
|
86
|
+
const isCodeOverride = source === "code_override";
|
|
84
87
|
useEffect(() => {
|
|
85
88
|
const loadDefinition = async () => {
|
|
86
89
|
if (!definitionId) {
|
|
@@ -109,7 +112,7 @@ function VisualEditorPage() {
|
|
|
109
112
|
setNodes(graph.nodes);
|
|
110
113
|
setEdges(graph.edges);
|
|
111
114
|
setTriggers(definition.definition?.triggers || []);
|
|
112
|
-
|
|
115
|
+
setSource(definition.source ?? null);
|
|
113
116
|
} catch (error) {
|
|
114
117
|
console.error("Error loading workflow definition:", error);
|
|
115
118
|
flash("Failed to load workflow definition", "error");
|
|
@@ -120,12 +123,15 @@ function VisualEditorPage() {
|
|
|
120
123
|
loadDefinition();
|
|
121
124
|
}, [definitionId]);
|
|
122
125
|
const handleNodesChange = useCallback((changes) => {
|
|
126
|
+
if (isCodeOnly) return;
|
|
123
127
|
setNodes((nds) => applyNodeChanges(changes, nds));
|
|
124
|
-
}, []);
|
|
128
|
+
}, [isCodeOnly]);
|
|
125
129
|
const handleEdgesChange = useCallback((changes) => {
|
|
130
|
+
if (isCodeOnly) return;
|
|
126
131
|
setEdges((eds) => applyEdgeChanges(changes, eds));
|
|
127
|
-
}, []);
|
|
132
|
+
}, [isCodeOnly]);
|
|
128
133
|
const handleAddNode = useCallback((nodeType) => {
|
|
134
|
+
if (isCodeOnly) return;
|
|
129
135
|
const newNode = {
|
|
130
136
|
id: generateStepId(nodeType),
|
|
131
137
|
type: nodeType,
|
|
@@ -141,17 +147,19 @@ function VisualEditorPage() {
|
|
|
141
147
|
}
|
|
142
148
|
};
|
|
143
149
|
setNodes((nds) => [...nds, newNode]);
|
|
144
|
-
}, [nodes.length]);
|
|
150
|
+
}, [nodes.length, isCodeOnly]);
|
|
145
151
|
const handleNodeClick = useCallback((_event, node) => {
|
|
152
|
+
if (isCodeOnly) return;
|
|
146
153
|
setSelectedNode(node);
|
|
147
154
|
setSelectedEdge(null);
|
|
148
155
|
setShowNodeDialog(true);
|
|
149
|
-
}, []);
|
|
156
|
+
}, [isCodeOnly]);
|
|
150
157
|
const handleEdgeClick = useCallback((_event, edge) => {
|
|
158
|
+
if (isCodeOnly) return;
|
|
151
159
|
setSelectedEdge(edge);
|
|
152
160
|
setSelectedNode(null);
|
|
153
161
|
setShowEdgeDialog(true);
|
|
154
|
-
}, []);
|
|
162
|
+
}, [isCodeOnly]);
|
|
155
163
|
const handleSaveNode = useCallback((nodeId, updates) => {
|
|
156
164
|
setNodes(
|
|
157
165
|
(nds) => nds.map(
|
|
@@ -270,8 +278,14 @@ function VisualEditorPage() {
|
|
|
270
278
|
method: "PUT",
|
|
271
279
|
headers: { "Content-Type": "application/json" },
|
|
272
280
|
body: JSON.stringify({
|
|
281
|
+
workflowName,
|
|
282
|
+
description: description || null,
|
|
283
|
+
version,
|
|
273
284
|
definition: definitionData,
|
|
274
|
-
|
|
285
|
+
metadata: Object.keys(metadata2).length > 0 ? metadata2 : null,
|
|
286
|
+
enabled,
|
|
287
|
+
effectiveFrom: effectiveFrom || null,
|
|
288
|
+
effectiveTo: effectiveTo || null
|
|
275
289
|
})
|
|
276
290
|
});
|
|
277
291
|
} else {
|
|
@@ -307,6 +321,53 @@ function VisualEditorPage() {
|
|
|
307
321
|
setIsSaving(false);
|
|
308
322
|
}
|
|
309
323
|
}, [nodes, edges, workflowId, workflowName, description, version, enabled, category, tags, icon, effectiveFrom, effectiveTo, triggers, definitionId, router]);
|
|
324
|
+
const handleCustomize = useCallback(async () => {
|
|
325
|
+
if (!definitionId) return;
|
|
326
|
+
setIsSaving(true);
|
|
327
|
+
try {
|
|
328
|
+
const result = await apiCall(
|
|
329
|
+
`/api/workflows/definitions/${definitionId}/customize`,
|
|
330
|
+
{ method: "POST" }
|
|
331
|
+
);
|
|
332
|
+
if (!result.ok) {
|
|
333
|
+
flash(result.result?.error || "Failed to customize workflow", "error");
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
const newId = result.result?.data?.id;
|
|
337
|
+
if (!newId) return;
|
|
338
|
+
router.push(`/backend/definitions/visual-editor?id=${encodeURIComponent(newId)}`);
|
|
339
|
+
router.refresh();
|
|
340
|
+
} finally {
|
|
341
|
+
setIsSaving(false);
|
|
342
|
+
}
|
|
343
|
+
}, [definitionId, router]);
|
|
344
|
+
const handleResetToCode = useCallback(async () => {
|
|
345
|
+
if (!definitionId) return;
|
|
346
|
+
const confirmed = await confirm({
|
|
347
|
+
title: t("workflows.actions.resetToCode"),
|
|
348
|
+
description: t("workflows.actions.resetConfirm"),
|
|
349
|
+
confirmText: t("workflows.actions.resetToCode"),
|
|
350
|
+
variant: "destructive"
|
|
351
|
+
});
|
|
352
|
+
if (!confirmed) return;
|
|
353
|
+
setIsSaving(true);
|
|
354
|
+
try {
|
|
355
|
+
const result = await apiCall(
|
|
356
|
+
`/api/workflows/definitions/${definitionId}/reset-to-code`,
|
|
357
|
+
{ method: "POST" }
|
|
358
|
+
);
|
|
359
|
+
if (!result.ok) {
|
|
360
|
+
flash(result.result?.error || "Failed to reset workflow", "error");
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
const codeId = result.result?.data?.id || (workflowId ? `code:${workflowId}` : null);
|
|
364
|
+
if (!codeId) return;
|
|
365
|
+
router.push(`/backend/definitions/visual-editor?id=${encodeURIComponent(codeId)}`);
|
|
366
|
+
router.refresh();
|
|
367
|
+
} finally {
|
|
368
|
+
setIsSaving(false);
|
|
369
|
+
}
|
|
370
|
+
}, [definitionId, workflowId, router, confirm, t]);
|
|
310
371
|
const handleTest = useCallback(() => {
|
|
311
372
|
const errors = validateWorkflowGraph(nodes, edges);
|
|
312
373
|
const criticalErrors = errors.filter((e) => e.type === "error");
|
|
@@ -509,7 +570,7 @@ function VisualEditorPage() {
|
|
|
509
570
|
]
|
|
510
571
|
}
|
|
511
572
|
),
|
|
512
|
-
/* @__PURE__ */ jsx(
|
|
573
|
+
!isCodeOnly && /* @__PURE__ */ jsx(
|
|
513
574
|
Button,
|
|
514
575
|
{
|
|
515
576
|
variant: "outline",
|
|
@@ -520,7 +581,7 @@ function VisualEditorPage() {
|
|
|
520
581
|
children: t("workflows.visualEditor.loadExample")
|
|
521
582
|
}
|
|
522
583
|
),
|
|
523
|
-
/* @__PURE__ */ jsxs(
|
|
584
|
+
!isCodeOnly && /* @__PURE__ */ jsxs(
|
|
524
585
|
Button,
|
|
525
586
|
{
|
|
526
587
|
variant: "destructive",
|
|
@@ -550,7 +611,7 @@ function VisualEditorPage() {
|
|
|
550
611
|
]
|
|
551
612
|
}
|
|
552
613
|
),
|
|
553
|
-
/* @__PURE__ */ jsxs(
|
|
614
|
+
!isCodeOnly && /* @__PURE__ */ jsxs(
|
|
554
615
|
Button,
|
|
555
616
|
{
|
|
556
617
|
variant: "outline",
|
|
@@ -564,7 +625,27 @@ function VisualEditorPage() {
|
|
|
564
625
|
]
|
|
565
626
|
}
|
|
566
627
|
),
|
|
567
|
-
/* @__PURE__ */
|
|
628
|
+
isCodeOverride && /* @__PURE__ */ jsx(
|
|
629
|
+
Button,
|
|
630
|
+
{
|
|
631
|
+
variant: "outline",
|
|
632
|
+
size: "sm",
|
|
633
|
+
onClick: handleResetToCode,
|
|
634
|
+
disabled: isSaving,
|
|
635
|
+
className: "h-8 text-xs",
|
|
636
|
+
children: t("workflows.actions.resetToCode")
|
|
637
|
+
}
|
|
638
|
+
),
|
|
639
|
+
isCodeOnly ? /* @__PURE__ */ jsx(
|
|
640
|
+
Button,
|
|
641
|
+
{
|
|
642
|
+
size: "sm",
|
|
643
|
+
onClick: handleCustomize,
|
|
644
|
+
disabled: isSaving,
|
|
645
|
+
className: "h-8 px-2 text-xs md:px-3",
|
|
646
|
+
children: t("workflows.actions.customize")
|
|
647
|
+
}
|
|
648
|
+
) : /* @__PURE__ */ jsxs(
|
|
568
649
|
Button,
|
|
569
650
|
{
|
|
570
651
|
size: "sm",
|
|
@@ -581,12 +662,19 @@ function VisualEditorPage() {
|
|
|
581
662
|
] })
|
|
582
663
|
}
|
|
583
664
|
) }),
|
|
665
|
+
(isCodeOnly || isCodeOverride) && /* @__PURE__ */ jsxs("div", { className: "shrink-0 border-b border-border bg-background px-3 py-2 md:px-6 md:py-3", children: [
|
|
666
|
+
isCodeOnly && /* @__PURE__ */ jsx(Alert, { variant: "info", children: /* @__PURE__ */ jsx(AlertTitle, { children: t("workflows.source.code.readonlyBanner") }) }),
|
|
667
|
+
isCodeOverride && /* @__PURE__ */ jsx(Alert, { variant: "warning", children: /* @__PURE__ */ jsx(AlertTitle, { children: t("workflows.source.code_override.banner") }) })
|
|
668
|
+
] }),
|
|
584
669
|
showMetadata && /* @__PURE__ */ jsxs("div", { className: isCompactViewport ? "shrink-0 border-b border-border bg-background px-3 py-2 max-h-[60svh] overflow-y-auto overscroll-contain md:px-6 md:py-3" : "shrink-0 border-b border-border bg-background px-3 py-2 md:px-6 md:py-3", children: [
|
|
585
|
-
/* @__PURE__ */ jsxs("
|
|
670
|
+
/* @__PURE__ */ jsxs("fieldset", { disabled: isCodeOnly, className: "rounded-lg border bg-card p-3 disabled:opacity-70 md:p-4", children: [
|
|
586
671
|
/* @__PURE__ */ jsx("h2", { className: "mb-3 text-xs font-semibold uppercase text-muted-foreground", children: t("workflows.visualEditor.workflowMetadata") }),
|
|
587
672
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 md:gap-4", children: [
|
|
588
673
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
589
|
-
/* @__PURE__ */
|
|
674
|
+
/* @__PURE__ */ jsxs(Label, { htmlFor: "workflowId", className: "text-xs", children: [
|
|
675
|
+
t("workflows.form.workflowId"),
|
|
676
|
+
" *"
|
|
677
|
+
] }),
|
|
590
678
|
/* @__PURE__ */ jsx(
|
|
591
679
|
Input,
|
|
592
680
|
{
|
|
@@ -598,10 +686,13 @@ function VisualEditorPage() {
|
|
|
598
686
|
className: "h-8 text-sm"
|
|
599
687
|
}
|
|
600
688
|
),
|
|
601
|
-
definitionId && /* @__PURE__ */ jsx("p", { className: "text-overline text-muted-foreground", children: "
|
|
689
|
+
definitionId && /* @__PURE__ */ jsx("p", { className: "text-overline text-muted-foreground", children: t("workflows.visualEditor.readOnly") })
|
|
602
690
|
] }),
|
|
603
691
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
604
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ jsxs(Label, { htmlFor: "workflowName", className: "text-xs", children: [
|
|
693
|
+
t("workflows.form.workflowName"),
|
|
694
|
+
" *"
|
|
695
|
+
] }),
|
|
605
696
|
/* @__PURE__ */ jsx(
|
|
606
697
|
Input,
|
|
607
698
|
{
|
|
@@ -614,7 +705,7 @@ function VisualEditorPage() {
|
|
|
614
705
|
)
|
|
615
706
|
] }),
|
|
616
707
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
617
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "category", className: "text-xs", children: "
|
|
708
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "category", className: "text-xs", children: t("workflows.form.category") }),
|
|
618
709
|
/* @__PURE__ */ jsx(
|
|
619
710
|
Input,
|
|
620
711
|
{
|
|
@@ -627,21 +718,24 @@ function VisualEditorPage() {
|
|
|
627
718
|
)
|
|
628
719
|
] }),
|
|
629
720
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1 sm:col-span-2 lg:col-span-3", children: [
|
|
630
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "description", className: "text-xs", children: "
|
|
721
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "description", className: "text-xs", children: t("workflows.form.description") }),
|
|
631
722
|
/* @__PURE__ */ jsx(
|
|
632
723
|
Textarea,
|
|
633
724
|
{
|
|
634
725
|
id: "description",
|
|
635
726
|
value: description,
|
|
636
727
|
onChange: (e) => setDescription(e.target.value),
|
|
637
|
-
placeholder: "
|
|
728
|
+
placeholder: t("workflows.form.placeholders.description"),
|
|
638
729
|
rows: 2,
|
|
639
730
|
className: "min-h-[60px] text-sm"
|
|
640
731
|
}
|
|
641
732
|
)
|
|
642
733
|
] }),
|
|
643
734
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
644
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ jsxs(Label, { htmlFor: "version", className: "text-xs", children: [
|
|
736
|
+
t("workflows.form.version"),
|
|
737
|
+
" *"
|
|
738
|
+
] }),
|
|
645
739
|
/* @__PURE__ */ jsx(
|
|
646
740
|
Input,
|
|
647
741
|
{
|
|
@@ -670,7 +764,7 @@ function VisualEditorPage() {
|
|
|
670
764
|
] })
|
|
671
765
|
] }),
|
|
672
766
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
673
|
-
/* @__PURE__ */ jsx(Label, { className: "text-xs", children: "
|
|
767
|
+
/* @__PURE__ */ jsx(Label, { className: "text-xs", children: t("workflows.form.tags") }),
|
|
674
768
|
/* @__PURE__ */ jsx(
|
|
675
769
|
TagsInput,
|
|
676
770
|
{
|
|
@@ -681,7 +775,7 @@ function VisualEditorPage() {
|
|
|
681
775
|
)
|
|
682
776
|
] }),
|
|
683
777
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
684
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "icon", className: "text-xs", children: "
|
|
778
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "icon", className: "text-xs", children: t("workflows.form.icon") }),
|
|
685
779
|
/* @__PURE__ */ jsx(
|
|
686
780
|
Input,
|
|
687
781
|
{
|
|
@@ -694,7 +788,7 @@ function VisualEditorPage() {
|
|
|
694
788
|
)
|
|
695
789
|
] }),
|
|
696
790
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
697
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "effectiveFrom", className: "text-xs", children: "
|
|
791
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "effectiveFrom", className: "text-xs", children: t("workflows.form.effectiveFrom") }),
|
|
698
792
|
/* @__PURE__ */ jsx(
|
|
699
793
|
Input,
|
|
700
794
|
{
|
|
@@ -707,7 +801,7 @@ function VisualEditorPage() {
|
|
|
707
801
|
)
|
|
708
802
|
] }),
|
|
709
803
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
710
|
-
/* @__PURE__ */ jsx(Label, { htmlFor: "effectiveTo", className: "text-xs", children: "
|
|
804
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: "effectiveTo", className: "text-xs", children: t("workflows.form.effectiveTo") }),
|
|
711
805
|
/* @__PURE__ */ jsx(
|
|
712
806
|
Input,
|
|
713
807
|
{
|
|
@@ -721,14 +815,13 @@ function VisualEditorPage() {
|
|
|
721
815
|
] })
|
|
722
816
|
] })
|
|
723
817
|
] }),
|
|
724
|
-
/* @__PURE__ */ jsx(
|
|
818
|
+
/* @__PURE__ */ jsx("fieldset", { disabled: isCodeOnly, className: "mt-3 disabled:opacity-70", children: /* @__PURE__ */ jsx(
|
|
725
819
|
DefinitionTriggersEditor,
|
|
726
820
|
{
|
|
727
821
|
value: triggers,
|
|
728
|
-
onChange: setTriggers
|
|
729
|
-
className: "mt-3"
|
|
822
|
+
onChange: setTriggers
|
|
730
823
|
}
|
|
731
|
-
)
|
|
824
|
+
) })
|
|
732
825
|
] }),
|
|
733
826
|
isCompactViewport ? /* @__PURE__ */ jsxs("div", { className: "px-3 py-3 md:px-6 md:py-4", children: [
|
|
734
827
|
/* @__PURE__ */ jsxs("div", { className: "relative min-w-0", children: [
|
|
@@ -742,26 +835,26 @@ function VisualEditorPage() {
|
|
|
742
835
|
onNodeClick: handleNodeClick,
|
|
743
836
|
onEdgeClick: handleEdgeClick,
|
|
744
837
|
onConnect: handleConnect,
|
|
745
|
-
editable:
|
|
838
|
+
editable: !isCodeOnly,
|
|
746
839
|
height: "100%"
|
|
747
840
|
}
|
|
748
841
|
) }),
|
|
749
842
|
nodes.length === 0 && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center px-4", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
750
|
-
/* @__PURE__ */ jsx("h2", { className: "mb-2 text-lg font-semibold text-foreground", children: "
|
|
751
|
-
/* @__PURE__ */ jsx("p", { className: "mb-4 text-sm text-muted-foreground", children: "
|
|
843
|
+
/* @__PURE__ */ jsx("h2", { className: "mb-2 text-lg font-semibold text-foreground", children: t("workflows.visualEditor.startBuilding") }),
|
|
844
|
+
/* @__PURE__ */ jsx("p", { className: "mb-4 text-sm text-muted-foreground", children: t("workflows.visualEditor.tapToAddBelow") }),
|
|
752
845
|
/* @__PURE__ */ jsx(
|
|
753
846
|
"button",
|
|
754
847
|
{
|
|
755
848
|
onClick: handleLoadExample,
|
|
756
849
|
className: "pointer-events-auto text-sm text-primary hover:underline",
|
|
757
|
-
children: "
|
|
850
|
+
children: t("workflows.visualEditor.loadExampleWorkflow")
|
|
758
851
|
}
|
|
759
852
|
)
|
|
760
853
|
] }) })
|
|
761
854
|
] }),
|
|
762
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-3 rounded-lg border bg-card p-3", children: [
|
|
763
|
-
/* @__PURE__ */ jsx("h2", { className: "mb-2 text-xs font-semibold uppercase text-muted-foreground", children: "
|
|
764
|
-
/* @__PURE__ */ jsx("p", { className: "mb-3 text-xs text-muted-foreground", children: "
|
|
855
|
+
!isCodeOnly && /* @__PURE__ */ jsxs("div", { className: "mt-3 rounded-lg border bg-card p-3", children: [
|
|
856
|
+
/* @__PURE__ */ jsx("h2", { className: "mb-2 text-xs font-semibold uppercase text-muted-foreground", children: t("workflows.visualEditor.stepPalette") }),
|
|
857
|
+
/* @__PURE__ */ jsx("p", { className: "mb-3 text-xs text-muted-foreground", children: t("workflows.visualEditor.tapToAdd") }),
|
|
765
858
|
/* @__PURE__ */ jsx("div", { className: "flex gap-2 overflow-x-auto pb-1", children: ["start", "userTask", "automated", "waitForSignal", "subWorkflow", "end"].map((nodeType) => {
|
|
766
859
|
const Icon = NODE_TYPE_ICONS[nodeType];
|
|
767
860
|
return /* @__PURE__ */ jsxs(
|
|
@@ -779,9 +872,9 @@ function VisualEditorPage() {
|
|
|
779
872
|
}) })
|
|
780
873
|
] })
|
|
781
874
|
] }) : /* @__PURE__ */ jsxs("div", { className: "flex min-h-[72svh] min-w-0 flex-1 border-t border-border", children: [
|
|
782
|
-
/* @__PURE__ */ jsx("div", { className: "w-[24rem] shrink-0 overflow-y-auto border-r border-border bg-background p-6", children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
783
|
-
/* @__PURE__ */ jsx("h2", { className: "mb-2 text-sm font-semibold uppercase text-muted-foreground", children: "
|
|
784
|
-
/* @__PURE__ */ jsx("p", { className: "mb-4 text-xs text-muted-foreground", children: "
|
|
875
|
+
!isCodeOnly && /* @__PURE__ */ jsx("div", { className: "w-[24rem] shrink-0 overflow-y-auto border-r border-border bg-background p-6", children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
876
|
+
/* @__PURE__ */ jsx("h2", { className: "mb-2 text-sm font-semibold uppercase text-muted-foreground", children: t("workflows.visualEditor.stepPalette") }),
|
|
877
|
+
/* @__PURE__ */ jsx("p", { className: "mb-4 text-xs text-muted-foreground", children: t("workflows.visualEditor.clickToAdd") }),
|
|
785
878
|
/* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
786
879
|
/* @__PURE__ */ jsxs(
|
|
787
880
|
"button",
|
|
@@ -897,19 +990,19 @@ function VisualEditorPage() {
|
|
|
897
990
|
onNodeClick: handleNodeClick,
|
|
898
991
|
onEdgeClick: handleEdgeClick,
|
|
899
992
|
onConnect: handleConnect,
|
|
900
|
-
editable:
|
|
993
|
+
editable: !isCodeOnly,
|
|
901
994
|
height: "100%"
|
|
902
995
|
}
|
|
903
996
|
) }),
|
|
904
997
|
nodes.length === 0 && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center px-4", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
905
|
-
/* @__PURE__ */ jsx("h2", { className: "mb-2 text-xl font-semibold text-foreground", children: "
|
|
906
|
-
/* @__PURE__ */ jsx("p", { className: "mb-4 text-muted-foreground", children: "
|
|
998
|
+
/* @__PURE__ */ jsx("h2", { className: "mb-2 text-xl font-semibold text-foreground", children: t("workflows.visualEditor.startBuilding") }),
|
|
999
|
+
/* @__PURE__ */ jsx("p", { className: "mb-4 text-muted-foreground", children: t("workflows.visualEditor.clickToAddFromPalette") }),
|
|
907
1000
|
/* @__PURE__ */ jsx(
|
|
908
1001
|
"button",
|
|
909
1002
|
{
|
|
910
1003
|
onClick: handleLoadExample,
|
|
911
1004
|
className: "pointer-events-auto text-sm text-primary hover:underline",
|
|
912
|
-
children: "
|
|
1005
|
+
children: t("workflows.visualEditor.loadExampleWorkflow")
|
|
913
1006
|
}
|
|
914
1007
|
)
|
|
915
1008
|
] }) })
|