@nivaro/react 0.3.110 → 0.3.112
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +170 -2
- package/dist/index.js +745 -728
- package/dist/shared/components/CollectionBrowserView.js +3097 -2972
- package/dist/shared/components/CollectionImportBanner.js +135 -0
- package/dist/shared/components/ItemEditForm.js +2235 -2218
- package/dist/shared/components/JobsTray.js +54 -47
- package/dist/shared/components/TipLayer.js +61 -54
- package/dist/shared/components/ViewAsPersonButton.js +109 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
- package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
- package/dist/shared/components/bulk/bulk-field-options.js +20 -19
- package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
- package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
- package/dist/shared/components/cbv/column-totals.js +66 -0
- package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
- package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
- package/dist/shared/components/collections-directory/directory-data.js +70 -58
- package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
- package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
- package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
- package/dist/shared/components/item-edit/FieldRow.js +248 -246
- package/dist/shared/components/item-edit/InlineGridField.js +34 -33
- package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
- package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
- package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
- package/dist/shared/components/item-edit/PlanGrid.js +2 -1
- package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
- package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
- package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
- package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
- package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
- package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
- package/dist/shared/components/item-edit/grid-search.js +345 -0
- package/dist/shared/components/item-edit/render-stability.js +61 -54
- package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
- package/dist/shared/components/ops-report/DigestSections.js +163 -144
- package/dist/shared/components/ops-report/drill.js +97 -97
- package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
- package/dist/shared/components/panels/AddendumPanel.js +92 -91
- package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
- package/dist/shared/components/panels/BlockedMove.js +73 -0
- package/dist/shared/components/panels/CommentPanel.js +265 -252
- package/dist/shared/components/panels/OwnersSlot.js +47 -35
- package/dist/shared/components/panels/PipelineInsight.js +186 -0
- package/dist/shared/components/panels/PipelinePanel.js +1573 -1475
- package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
- package/dist/shared/components/panels/RevisionsPanel.js +261 -260
- package/dist/shared/components/pipeline/FieldPicker.js +41 -40
- package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
- package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
- package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
- package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
- package/dist/shared/components/profile/PersonHeader.js +29 -29
- package/dist/shared/components/profile/PersonProfile.js +30 -28
- package/dist/shared/components/profile/SlowScreensCard.js +286 -0
- package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
- package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
- package/dist/shared/components/support/TicketDetailSheet.js +25 -16
- package/dist/shared/components/support/TicketSlowScreens.js +32 -0
- package/dist/shared/lib/activity-sentence.js +224 -178
- package/dist/shared/lib/collection-import-banner.js +27 -0
- package/dist/shared/lib/crash-report.js +112 -0
- package/dist/shared/lib/export-runs.js +99 -0
- package/dist/shared/lib/jobs-tray.js +89 -67
- package/dist/shared/lib/list-link.js +76 -69
- package/dist/shared/lib/nav-trail.js +180 -76
- package/dist/shared/lib/query-keys.js +26 -0
- package/dist/shared/lib/view-as.js +16 -11
- package/package.json +1 -1
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { sortableKeyboardCoordinates as
|
|
4
|
-
import { CSS as
|
|
5
|
-
import { useMutation as j, useQueryClient as ke, useQuery as
|
|
6
|
-
import { X as ve, ArrowLeft as
|
|
7
|
-
import { useState as $, useEffect as
|
|
8
|
-
import { createPortal as
|
|
2
|
+
import { useSensors as Wt, useSensor as Xe, PointerSensor as Vt, KeyboardSensor as Ht, DndContext as He, closestCenter as Ye } from "@dnd-kit/core";
|
|
3
|
+
import { sortableKeyboardCoordinates as Yt, SortableContext as Ge, verticalListSortingStrategy as Ie, arrayMove as Je, useSortable as pt } from "@dnd-kit/sortable";
|
|
4
|
+
import { CSS as ut } from "@dnd-kit/utilities";
|
|
5
|
+
import { useMutation as j, useQueryClient as ke, useQuery as V } from "@tanstack/react-query";
|
|
6
|
+
import { X as ve, ArrowLeft as fa, Check as Ne, Pencil as Pe, Download as ga, Plus as ye, Trash2 as Se, ArrowRight as Gt, Zap as ba, PlugZap as ya, Filter as ht, Link2 as Pt, LayoutGrid as va, Link2Off as Na, ListChecks as It, Loader2 as we, GripVertical as xt, Settings as wa, GitFork as ka, ChevronDown as Oe, Search as ft, History as _a, ChevronRight as gt, ExternalLink as Ca } from "lucide-react";
|
|
7
|
+
import { useState as $, useEffect as pe, useRef as je, useContext as Sa, useMemo as qa, createContext as $a } from "react";
|
|
8
|
+
import { createPortal as Fa } from "react-dom";
|
|
9
9
|
import { toast as P } from "sonner";
|
|
10
|
-
import { useNivaroClient as Z, useNavigation as
|
|
11
|
-
import { post as I, get as
|
|
12
|
-
import { describeTransition as
|
|
13
|
-
import { toastError as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
10
|
+
import { useNivaroClient as Z, useNavigation as Ea } from "../../context.js";
|
|
11
|
+
import { post as I, get as H, patch as be, del as $e } from "../../lib/commands.js";
|
|
12
|
+
import { describeTransition as Oa, sentenceLabelsFromFields as Ra } from "../../lib/config-sentences.js";
|
|
13
|
+
import { toastError as Dt } from "../../lib/error-toast.js";
|
|
14
|
+
import { queryKeys as Me } from "../../lib/query-keys.js";
|
|
15
|
+
import { cn as J, formatRelative as Ta, titleCase as Pa } from "../../lib/utils.js";
|
|
16
|
+
import { ExplainCard as Da } from "../ai/ExplainButton.js";
|
|
17
|
+
import { ConfigHistoryButton as Aa } from "../ConfigHistory.js";
|
|
18
|
+
import { ConfigReadBack as La } from "../ConfigReadBack.js";
|
|
19
|
+
import { PipelineCumulativeFlowCard as ja } from "../charts/CumulativeFlowChart.js";
|
|
20
|
+
import { useCollectionBody as Ma } from "../layout-editor/collection-meta.js";
|
|
20
21
|
import { ConfirmButton as De } from "../profile/primitives.js";
|
|
21
|
-
import { QueryErrorState as
|
|
22
|
-
import { Term as
|
|
22
|
+
import { QueryErrorState as Ka } from "../QueryErrorState.js";
|
|
23
|
+
import { Term as At } from "../Term.js";
|
|
23
24
|
import { Badge as Ce } from "../ui/badge.js";
|
|
24
25
|
import { Button as T } from "../ui/button.js";
|
|
25
26
|
import { Input as W } from "../ui/input.js";
|
|
26
27
|
import { Label as Y } from "../ui/label.js";
|
|
27
|
-
import { Popover as
|
|
28
|
-
import { Select as
|
|
28
|
+
import { Popover as Ke, PopoverTrigger as ze, PopoverContent as Be } from "../ui/popover.js";
|
|
29
|
+
import { Select as za, SelectTrigger as Ba, SelectValue as Qa, SelectContent as Ua, SelectItem as Wa } from "../ui/select.js";
|
|
29
30
|
import { Skeleton as Ae } from "../ui/skeleton.js";
|
|
30
31
|
import { Switch as Ee } from "../ui/switch.js";
|
|
31
|
-
import { Textarea as
|
|
32
|
-
import { FieldPicker as
|
|
33
|
-
import { OwnerMatrix as
|
|
34
|
-
import { OwnerMatrixVersionsCard as
|
|
35
|
-
import { TemplateLintCard as
|
|
36
|
-
import { PipelineSkipCriteria as
|
|
37
|
-
import { PipelineStateOwners as
|
|
38
|
-
import { findM2ORelation as
|
|
39
|
-
import { TeamsView as
|
|
40
|
-
import { useScopeDimensions as
|
|
41
|
-
const
|
|
42
|
-
function
|
|
32
|
+
import { Textarea as Jt } from "../ui/textarea.js";
|
|
33
|
+
import { FieldPicker as mt } from "./FieldPicker.js";
|
|
34
|
+
import { OwnerMatrix as Va } from "./OwnerMatrix.js";
|
|
35
|
+
import { OwnerMatrixVersionsCard as Ha } from "./OwnerMatrixVersionsCard.js";
|
|
36
|
+
import { TemplateLintCard as Ya, SkipReportCard as Ga } from "./PipelineHealthCards.js";
|
|
37
|
+
import { PipelineSkipCriteria as Ia } from "./PipelineSkipCriteria.js";
|
|
38
|
+
import { PipelineStateOwners as Ja } from "./PipelineStateOwners.js";
|
|
39
|
+
import { findM2ORelation as Xa, extractTemplateFields as Za, renderDisplayTemplate as ot } from "./relations.js";
|
|
40
|
+
import { TeamsView as es } from "./TeamsView.js";
|
|
41
|
+
import { useScopeDimensions as ts, rankTeamForFilters as as, tierOrder as Lt } from "./teamScopes.js";
|
|
42
|
+
const Xt = "rgb(var(--nvr-cyan-rgb, 0 206 255))", Le = "rounded bg-red-50 px-1.5 text-[11px] font-semibold text-red-700 hover:text-red-700 dark:bg-red-500/10 dark:text-red-400";
|
|
43
|
+
function ue({
|
|
43
44
|
value: a,
|
|
44
45
|
onChange: n,
|
|
45
46
|
options: c,
|
|
@@ -48,17 +49,17 @@ function pe({
|
|
|
48
49
|
className: x
|
|
49
50
|
}) {
|
|
50
51
|
var m;
|
|
51
|
-
const [o, r] = $(!1), [h, v] = $(""), u =
|
|
52
|
-
|
|
52
|
+
const [o, r] = $(!1), [h, v] = $(""), u = je(null);
|
|
53
|
+
pe(() => {
|
|
53
54
|
o ? setTimeout(() => {
|
|
54
55
|
var f;
|
|
55
56
|
return (f = u.current) == null ? void 0 : f.focus();
|
|
56
57
|
}, 50) : v("");
|
|
57
58
|
}, [o]);
|
|
58
59
|
const d = h.trim() ? c.filter((f) => f.label.toLowerCase().includes(h.toLowerCase())) : c, N = a ? ((m = c.find((f) => f.value === a)) == null ? void 0 : m.label) ?? a : null;
|
|
59
|
-
return /* @__PURE__ */ t(
|
|
60
|
+
return /* @__PURE__ */ t(Ke, { open: o, onOpenChange: r, children: [
|
|
60
61
|
/* @__PURE__ */ t("div", { className: J("relative flex h-8 w-full", x), children: [
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
+
/* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ t(
|
|
62
63
|
"button",
|
|
63
64
|
{
|
|
64
65
|
type: "button",
|
|
@@ -81,9 +82,9 @@ function pe({
|
|
|
81
82
|
}
|
|
82
83
|
)
|
|
83
84
|
] }),
|
|
84
|
-
/* @__PURE__ */ t(
|
|
85
|
+
/* @__PURE__ */ t(Be, { align: "start", className: "w-56 p-0", sideOffset: 4, children: [
|
|
85
86
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "relative", children: [
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
+
/* @__PURE__ */ e(ft, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
87
88
|
/* @__PURE__ */ e(
|
|
88
89
|
"input",
|
|
89
90
|
{
|
|
@@ -135,15 +136,15 @@ function pe({
|
|
|
135
136
|
] })
|
|
136
137
|
] });
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
+
function ss({
|
|
139
140
|
values: a,
|
|
140
141
|
onChange: n,
|
|
141
142
|
options: c,
|
|
142
143
|
placeholder: g = "Select states…"
|
|
143
144
|
}) {
|
|
144
145
|
var N;
|
|
145
|
-
const [l, x] = $(!1), [o, r] = $(""), h =
|
|
146
|
-
|
|
146
|
+
const [l, x] = $(!1), [o, r] = $(""), h = je(null);
|
|
147
|
+
pe(() => {
|
|
147
148
|
l ? setTimeout(() => {
|
|
148
149
|
var m;
|
|
149
150
|
return (m = h.current) == null ? void 0 : m.focus();
|
|
@@ -154,9 +155,9 @@ function es({
|
|
|
154
155
|
n(a.includes(m) ? a.filter((f) => f !== m) : [...a, m]);
|
|
155
156
|
}
|
|
156
157
|
const d = a.length === 0 ? null : a.length === 1 ? ((N = c.find((m) => m.value === a[0])) == null ? void 0 : N.label) ?? a[0] : `${a.length} states`;
|
|
157
|
-
return /* @__PURE__ */ t(
|
|
158
|
+
return /* @__PURE__ */ t(Ke, { open: l, onOpenChange: x, children: [
|
|
158
159
|
/* @__PURE__ */ t("div", { className: "relative flex h-8 w-full", children: [
|
|
159
|
-
/* @__PURE__ */ e(
|
|
160
|
+
/* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ t(
|
|
160
161
|
"button",
|
|
161
162
|
{
|
|
162
163
|
type: "button",
|
|
@@ -179,9 +180,9 @@ function es({
|
|
|
179
180
|
}
|
|
180
181
|
)
|
|
181
182
|
] }),
|
|
182
|
-
/* @__PURE__ */ t(
|
|
183
|
+
/* @__PURE__ */ t(Be, { align: "start", className: "w-56 p-0", sideOffset: 4, children: [
|
|
183
184
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "relative", children: [
|
|
184
|
-
/* @__PURE__ */ e(
|
|
185
|
+
/* @__PURE__ */ e(ft, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
185
186
|
/* @__PURE__ */ e(
|
|
186
187
|
"input",
|
|
187
188
|
{
|
|
@@ -220,7 +221,7 @@ function es({
|
|
|
220
221
|
] })
|
|
221
222
|
] });
|
|
222
223
|
}
|
|
223
|
-
const
|
|
224
|
+
const ns = [
|
|
224
225
|
"#6b7280",
|
|
225
226
|
"#ef4444",
|
|
226
227
|
"#f97316",
|
|
@@ -231,7 +232,7 @@ const ts = [
|
|
|
231
232
|
"#8b5cf6",
|
|
232
233
|
"#ec4899"
|
|
233
234
|
];
|
|
234
|
-
function
|
|
235
|
+
function Ze({
|
|
235
236
|
value: a,
|
|
236
237
|
onChange: n
|
|
237
238
|
}) {
|
|
@@ -248,7 +249,7 @@ function Je({
|
|
|
248
249
|
title: "No color"
|
|
249
250
|
}
|
|
250
251
|
),
|
|
251
|
-
|
|
252
|
+
ns.map((c) => /* @__PURE__ */ e(
|
|
252
253
|
"button",
|
|
253
254
|
{
|
|
254
255
|
type: "button",
|
|
@@ -264,7 +265,7 @@ function Je({
|
|
|
264
265
|
))
|
|
265
266
|
] });
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
+
function jt({ state: a, small: n }) {
|
|
268
269
|
return /* @__PURE__ */ t(
|
|
269
270
|
"span",
|
|
270
271
|
{
|
|
@@ -282,7 +283,7 @@ function Dt({ state: a, small: n }) {
|
|
|
282
283
|
}
|
|
283
284
|
);
|
|
284
285
|
}
|
|
285
|
-
function
|
|
286
|
+
function Mt({
|
|
286
287
|
initial: a,
|
|
287
288
|
onSave: n,
|
|
288
289
|
onCancel: c,
|
|
@@ -350,7 +351,7 @@ function At({
|
|
|
350
351
|
] }),
|
|
351
352
|
/* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
|
|
352
353
|
/* @__PURE__ */ e(Y, { className: "text-[12px]", children: "Color" }),
|
|
353
|
-
/* @__PURE__ */ e(
|
|
354
|
+
/* @__PURE__ */ e(Ze, { value: l.color, onChange: (r) => o("color", r) })
|
|
354
355
|
] }),
|
|
355
356
|
/* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
|
|
356
357
|
/* @__PURE__ */ e(Y, { className: "text-[12px]", children: "Help text" }),
|
|
@@ -470,19 +471,19 @@ function At({
|
|
|
470
471
|
] })
|
|
471
472
|
] });
|
|
472
473
|
}
|
|
473
|
-
function
|
|
474
|
+
function Kt(a) {
|
|
474
475
|
return !a || a.length === 0 ? "" : [...a].sort(
|
|
475
476
|
(n, c) => `${n.field}${n.op}${String(n.value)}`.localeCompare(`${c.field}${c.op}${String(c.value)}`)
|
|
476
477
|
).map((n) => `${n.field}:${n.op}:${String(n.value ?? "")}`).join("|");
|
|
477
478
|
}
|
|
478
|
-
function
|
|
479
|
+
function zt(a) {
|
|
479
480
|
const n = /* @__PURE__ */ new Map();
|
|
480
481
|
for (const g of a) {
|
|
481
482
|
n.has(g.label) || n.set(g.label, { label: g.label, color: g.color, routes: [], minSort: g.sort });
|
|
482
483
|
const l = n.get(g.label);
|
|
483
484
|
l.minSort = Math.min(l.minSort, g.sort);
|
|
484
|
-
const x =
|
|
485
|
-
(r) => r.from_state === g.from_state &&
|
|
485
|
+
const x = Kt(g.condition_rules), o = l.routes.find(
|
|
486
|
+
(r) => r.from_state === g.from_state && Kt(r.condition_rules) === x
|
|
486
487
|
);
|
|
487
488
|
o ? (o.ids.push(g.id), o.to_states.push(g.to_state), o.minSort = Math.min(o.minSort, g.sort)) : l.routes.push({
|
|
488
489
|
ids: [g.id],
|
|
@@ -507,17 +508,17 @@ function jt(a) {
|
|
|
507
508
|
for (const g of c) g.routes.sort((l, x) => l.minSort - x.minSort);
|
|
508
509
|
return c;
|
|
509
510
|
}
|
|
510
|
-
const
|
|
511
|
-
function
|
|
512
|
-
const { attributes: c, listeners: g, setNodeRef: l, transform: x, transition: o, isDragging: r } =
|
|
511
|
+
const Zt = $a(null);
|
|
512
|
+
function Bt({ id: a, children: n }) {
|
|
513
|
+
const { attributes: c, listeners: g, setNodeRef: l, transform: x, transition: o, isDragging: r } = pt({
|
|
513
514
|
id: a
|
|
514
515
|
});
|
|
515
|
-
return /* @__PURE__ */ e(
|
|
516
|
+
return /* @__PURE__ */ e(Zt.Provider, { value: { listeners: g, attributes: c }, children: /* @__PURE__ */ e(
|
|
516
517
|
"div",
|
|
517
518
|
{
|
|
518
519
|
ref: l,
|
|
519
520
|
style: {
|
|
520
|
-
transform:
|
|
521
|
+
transform: ut.Transform.toString(x),
|
|
521
522
|
transition: o,
|
|
522
523
|
opacity: r ? 0.4 : 1
|
|
523
524
|
},
|
|
@@ -525,8 +526,8 @@ function Mt({ id: a, children: n }) {
|
|
|
525
526
|
}
|
|
526
527
|
) });
|
|
527
528
|
}
|
|
528
|
-
function
|
|
529
|
-
const a =
|
|
529
|
+
function Qt() {
|
|
530
|
+
const a = Sa(Zt);
|
|
530
531
|
return /* @__PURE__ */ e(
|
|
531
532
|
"button",
|
|
532
533
|
{
|
|
@@ -535,36 +536,36 @@ function Kt() {
|
|
|
535
536
|
...a == null ? void 0 : a.attributes,
|
|
536
537
|
className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 shrink-0",
|
|
537
538
|
tabIndex: -1,
|
|
538
|
-
children: /* @__PURE__ */ e(
|
|
539
|
+
children: /* @__PURE__ */ e(xt, { className: "h-3.5 w-3.5" })
|
|
539
540
|
}
|
|
540
541
|
);
|
|
541
542
|
}
|
|
542
|
-
function
|
|
543
|
+
function ls(a) {
|
|
543
544
|
return a ? Array.isArray(a) ? a.map(String).filter(Boolean) : typeof a == "string" && a.trim() ? [a] : [] : [];
|
|
544
545
|
}
|
|
545
|
-
function
|
|
546
|
+
function rs({
|
|
546
547
|
relatedCollection: a,
|
|
547
548
|
value: n,
|
|
548
549
|
onChange: c
|
|
549
550
|
}) {
|
|
550
|
-
const g = Z(), [l, x] = $(!1), [o, r] = $(""), h =
|
|
551
|
-
|
|
551
|
+
const g = Z(), [l, x] = $(!1), [o, r] = $(""), h = je(null);
|
|
552
|
+
pe(() => {
|
|
552
553
|
l ? setTimeout(() => {
|
|
553
554
|
var O;
|
|
554
555
|
return (O = h.current) == null ? void 0 : O.focus();
|
|
555
556
|
}, 50) : r("");
|
|
556
557
|
}, [l]);
|
|
557
|
-
const { data: v } =
|
|
558
|
-
queryKey:
|
|
559
|
-
queryFn: () => g.request(
|
|
558
|
+
const { data: v } = V({
|
|
559
|
+
queryKey: Me.collectionMeta(a),
|
|
560
|
+
queryFn: () => g.request(H(`/collections/${a}`)).then((O) => O.data),
|
|
560
561
|
staleTime: 6e4,
|
|
561
562
|
enabled: !!a
|
|
562
563
|
}), u = ((v == null ? void 0 : v.fields) ?? []).map((O) => O.field), d = (v == null ? void 0 : v.display_template) ?? null, N = ["name", "title", "label", "display_name", "subject", "email", "slug"], m = [
|
|
563
|
-
.../* @__PURE__ */ new Set(["id", ...
|
|
564
|
-
], f = u.length ? m.filter((O) => O === "id" || u.includes(O)).join(",") : "id", { data: b, isLoading: p, isError: w } =
|
|
564
|
+
.../* @__PURE__ */ new Set(["id", ...Za(d), ...N])
|
|
565
|
+
], f = u.length ? m.filter((O) => O === "id" || u.includes(O)).join(",") : "id", { data: b, isLoading: p, isError: w } = V({
|
|
565
566
|
queryKey: ["relation-picker-items", a, f],
|
|
566
567
|
queryFn: () => g.request(
|
|
567
|
-
|
|
568
|
+
H(`/items/${a}`, { limit: 200, fields: f })
|
|
568
569
|
).then((O) => O.data),
|
|
569
570
|
staleTime: 3e4,
|
|
570
571
|
// Fetch when dropdown opens OR when there are existing values to resolve labels
|
|
@@ -588,16 +589,16 @@ function ss({
|
|
|
588
589
|
const k = b ?? [];
|
|
589
590
|
function S(O) {
|
|
590
591
|
const y = k.find((i) => String(i.id) === O);
|
|
591
|
-
return y ?
|
|
592
|
+
return y ? ot(d, y) : O;
|
|
592
593
|
}
|
|
593
594
|
function D(O) {
|
|
594
595
|
c(n.includes(O) ? n.filter((y) => y !== O) : [...n, O]);
|
|
595
596
|
}
|
|
596
597
|
const A = o ? k.filter(
|
|
597
|
-
(O) =>
|
|
598
|
+
(O) => ot(d, O).toLowerCase().includes(o.toLowerCase())
|
|
598
599
|
) : k;
|
|
599
|
-
return /* @__PURE__ */ t(
|
|
600
|
-
/* @__PURE__ */ e("div", { className: "relative w-full", children: /* @__PURE__ */ e(
|
|
600
|
+
return /* @__PURE__ */ t(Ke, { open: l, onOpenChange: x, children: [
|
|
601
|
+
/* @__PURE__ */ e("div", { className: "relative w-full", children: /* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ t(
|
|
601
602
|
"button",
|
|
602
603
|
{
|
|
603
604
|
type: "button",
|
|
@@ -635,9 +636,9 @@ function ss({
|
|
|
635
636
|
]
|
|
636
637
|
}
|
|
637
638
|
) }) }),
|
|
638
|
-
/* @__PURE__ */ t(
|
|
639
|
+
/* @__PURE__ */ t(Be, { align: "start", className: "w-64 p-0", sideOffset: 4, children: [
|
|
639
640
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ t("div", { className: "relative", children: [
|
|
640
|
-
/* @__PURE__ */ e(
|
|
641
|
+
/* @__PURE__ */ e(ft, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
641
642
|
/* @__PURE__ */ e(
|
|
642
643
|
"input",
|
|
643
644
|
{
|
|
@@ -653,7 +654,7 @@ function ss({
|
|
|
653
654
|
/* @__PURE__ */ e(we, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
654
655
|
"Loading…"
|
|
655
656
|
] }) : A.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : A.map((O) => {
|
|
656
|
-
const y =
|
|
657
|
+
const y = ot(d, O), i = String(O.id), _ = n.includes(i);
|
|
657
658
|
return /* @__PURE__ */ t(
|
|
658
659
|
"button",
|
|
659
660
|
{
|
|
@@ -676,7 +677,7 @@ function ss({
|
|
|
676
677
|
] })
|
|
677
678
|
] });
|
|
678
679
|
}
|
|
679
|
-
const
|
|
680
|
+
const is = [
|
|
680
681
|
{ value: "eq", label: "equals" },
|
|
681
682
|
{ value: "neq", label: "not equals" },
|
|
682
683
|
{ value: "gt", label: "greater than" },
|
|
@@ -686,16 +687,16 @@ const ns = [
|
|
|
686
687
|
{ value: "contains", label: "contains" },
|
|
687
688
|
{ value: "null", label: "is empty" },
|
|
688
689
|
{ value: "nnull", label: "is not empty" }
|
|
689
|
-
],
|
|
690
|
-
function
|
|
690
|
+
], os = /* @__PURE__ */ new Set(["integer", "bigInteger", "float", "decimal", "number"]), cs = /* @__PURE__ */ new Set(["date", "dateTime", "datetime", "timestamp"]), ds = /* @__PURE__ */ new Set(["boolean"]);
|
|
691
|
+
function ms({
|
|
691
692
|
rules: a,
|
|
692
693
|
onChange: n,
|
|
693
694
|
collection: c
|
|
694
695
|
}) {
|
|
695
696
|
var b;
|
|
696
|
-
const g = Z(), [l, x] = $(a.length > 0), [o, r] = $({}), { data: h } =
|
|
697
|
-
queryKey:
|
|
698
|
-
queryFn: () => g.request(
|
|
697
|
+
const g = Z(), [l, x] = $(a.length > 0), [o, r] = $({}), { data: h } = V({
|
|
698
|
+
queryKey: Me.collectionMeta(c),
|
|
699
|
+
queryFn: () => g.request(H(`/collections/${c}`)).then((p) => p.data),
|
|
699
700
|
enabled: !!c
|
|
700
701
|
}), v = [...((b = h == null ? void 0 : h.fields) == null ? void 0 : b.filter((p) => !p.hidden)) ?? []].sort(
|
|
701
702
|
(p, w) => p.field.localeCompare(w.field)
|
|
@@ -705,7 +706,7 @@ function os({
|
|
|
705
706
|
if (!p.includes(".")) {
|
|
706
707
|
const w = v.find((k) => k.field === p);
|
|
707
708
|
if (w) {
|
|
708
|
-
const k =
|
|
709
|
+
const k = Xa(u, c ?? "", p);
|
|
709
710
|
return { type: w.type, relatedCollection: (k == null ? void 0 : k.one_collection) ?? void 0 };
|
|
710
711
|
}
|
|
711
712
|
}
|
|
@@ -713,7 +714,7 @@ function os({
|
|
|
713
714
|
}
|
|
714
715
|
const N = (p, w) => n(a.map((k, S) => S === p ? { ...k, ...w } : k)), m = (p) => n(a.filter((w, k) => k !== p));
|
|
715
716
|
function f(p) {
|
|
716
|
-
return p ? p.split(".").map(
|
|
717
|
+
return p ? p.split(".").map(Pa).join(" → ") : "";
|
|
717
718
|
}
|
|
718
719
|
return /* @__PURE__ */ t("div", { className: "space-y-2 border-t border-slate-200 pt-3", children: [
|
|
719
720
|
/* @__PURE__ */ t(
|
|
@@ -723,8 +724,8 @@ function os({
|
|
|
723
724
|
onClick: () => x((p) => !p),
|
|
724
725
|
className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
|
|
725
726
|
children: [
|
|
726
|
-
l ? /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(
|
|
727
|
-
/* @__PURE__ */ e(
|
|
727
|
+
l ? /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(gt, { className: "h-3.5 w-3.5" }),
|
|
728
|
+
/* @__PURE__ */ e(ht, { className: "h-3 w-3" }),
|
|
728
729
|
"Conditions ",
|
|
729
730
|
/* @__PURE__ */ e("span", { className: "font-normal text-slate-400", children: "(optional)" }),
|
|
730
731
|
a.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy", children: a.length })
|
|
@@ -734,14 +735,14 @@ function os({
|
|
|
734
735
|
l && /* @__PURE__ */ t("div", { className: "space-y-2", children: [
|
|
735
736
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400 leading-snug", children: "Transition is only offered when all conditions match the record — use two transitions with opposite conditions to branch." }),
|
|
736
737
|
a.map((p, w) => {
|
|
737
|
-
const k = p.op === "null" || p.op === "nnull", S = d(p.field), D =
|
|
738
|
+
const k = p.op === "null" || p.op === "nnull", S = d(p.field), D = os.has(S.type), A = cs.has(S.type), O = ds.has(S.type), y = !!S.relatedCollection;
|
|
738
739
|
return /* @__PURE__ */ t(
|
|
739
740
|
"div",
|
|
740
741
|
{
|
|
741
742
|
className: "flex flex-wrap items-center gap-2 rounded-lg border border-slate-200 bg-white p-2",
|
|
742
743
|
children: [
|
|
743
744
|
/* @__PURE__ */ e("div", { className: "flex-1 min-w-[160px]", children: /* @__PURE__ */ e(
|
|
744
|
-
|
|
745
|
+
mt,
|
|
745
746
|
{
|
|
746
747
|
collection: c ?? "",
|
|
747
748
|
fields: v,
|
|
@@ -763,23 +764,23 @@ function os({
|
|
|
763
764
|
}
|
|
764
765
|
) }),
|
|
765
766
|
/* @__PURE__ */ e("div", { className: "w-36 shrink-0", children: /* @__PURE__ */ e(
|
|
766
|
-
|
|
767
|
+
ue,
|
|
767
768
|
{
|
|
768
769
|
value: p.op,
|
|
769
770
|
onChange: (i) => N(w, { op: i || "eq" }),
|
|
770
|
-
options:
|
|
771
|
+
options: is.map((i) => ({ value: i.value, label: i.label })),
|
|
771
772
|
placeholder: "Operator…"
|
|
772
773
|
}
|
|
773
774
|
) }),
|
|
774
775
|
!k && /* @__PURE__ */ e("div", { className: "flex-1 min-w-[120px]", children: y ? /* @__PURE__ */ e(
|
|
775
|
-
|
|
776
|
+
rs,
|
|
776
777
|
{
|
|
777
778
|
relatedCollection: S.relatedCollection,
|
|
778
|
-
value:
|
|
779
|
+
value: ls(p.value),
|
|
779
780
|
onChange: (i) => N(w, { value: i.length === 1 ? i[0] : i })
|
|
780
781
|
}
|
|
781
782
|
) : O ? /* @__PURE__ */ e(
|
|
782
|
-
|
|
783
|
+
ue,
|
|
783
784
|
{
|
|
784
785
|
value: String(p.value ?? ""),
|
|
785
786
|
onChange: (i) => N(w, { value: i }),
|
|
@@ -838,16 +839,16 @@ function os({
|
|
|
838
839
|
] })
|
|
839
840
|
] });
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
+
function ps({
|
|
842
843
|
requirement: a,
|
|
843
844
|
childRelations: n,
|
|
844
845
|
onChange: c,
|
|
845
846
|
onRemove: g
|
|
846
847
|
}) {
|
|
847
848
|
var N;
|
|
848
|
-
const l = Z(), { data: x } =
|
|
849
|
-
queryKey:
|
|
850
|
-
queryFn: () => l.request(
|
|
849
|
+
const l = Z(), { data: x } = V({
|
|
850
|
+
queryKey: Me.collectionMeta(a.collection),
|
|
851
|
+
queryFn: () => l.request(H(`/collections/${a.collection}`)).then((m) => m.data),
|
|
851
852
|
enabled: !!a.collection
|
|
852
853
|
}), o = [
|
|
853
854
|
...((N = x == null ? void 0 : x.fields) == null ? void 0 : N.filter((m) => !m.hidden)) ?? []
|
|
@@ -869,7 +870,7 @@ function cs({
|
|
|
869
870
|
/* @__PURE__ */ t("div", { className: "flex-1 space-y-1.5", children: [
|
|
870
871
|
/* @__PURE__ */ e(Y, { className: "text-[11px]", children: "Child Relation" }),
|
|
871
872
|
/* @__PURE__ */ e(
|
|
872
|
-
|
|
873
|
+
ue,
|
|
873
874
|
{
|
|
874
875
|
value: h,
|
|
875
876
|
onChange: (m) => {
|
|
@@ -961,14 +962,14 @@ function cs({
|
|
|
961
962
|
] })
|
|
962
963
|
] });
|
|
963
964
|
}
|
|
964
|
-
function
|
|
965
|
+
function us({
|
|
965
966
|
requirements: a,
|
|
966
967
|
onChange: n,
|
|
967
968
|
collection: c
|
|
968
969
|
}) {
|
|
969
|
-
const g = Z(), [l, x] = $(a.length > 0), { data: o } =
|
|
970
|
-
queryKey:
|
|
971
|
-
queryFn: () => g.request(
|
|
970
|
+
const g = Z(), [l, x] = $(a.length > 0), { data: o } = V({
|
|
971
|
+
queryKey: Me.collectionMeta(c),
|
|
972
|
+
queryFn: () => g.request(H(`/collections/${c}`)).then((d) => d.data),
|
|
972
973
|
enabled: !!c
|
|
973
974
|
}), h = ((o == null ? void 0 : o.relations) ?? []).filter(
|
|
974
975
|
(d) => d.one_collection === c && d.junction_field === null
|
|
@@ -981,8 +982,8 @@ function ds({
|
|
|
981
982
|
onClick: () => x((d) => !d),
|
|
982
983
|
className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
|
|
983
984
|
children: [
|
|
984
|
-
l ? /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(
|
|
985
|
-
/* @__PURE__ */ e(
|
|
985
|
+
l ? /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(gt, { className: "h-3.5 w-3.5" }),
|
|
986
|
+
/* @__PURE__ */ e(It, { className: "h-3 w-3" }),
|
|
986
987
|
"Requirements ",
|
|
987
988
|
/* @__PURE__ */ e("span", { className: "font-normal text-slate-400", children: "(optional)" }),
|
|
988
989
|
a.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy", children: a.length })
|
|
@@ -992,7 +993,7 @@ function ds({
|
|
|
992
993
|
l && /* @__PURE__ */ t("div", { className: "space-y-2", children: [
|
|
993
994
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400 leading-snug", children: "Block this transition until every row of a child relation has the listed fields filled in. Prompts the user with a fill-in dialog when rows are incomplete." }),
|
|
994
995
|
a.map((d, N) => /* @__PURE__ */ e(
|
|
995
|
-
|
|
996
|
+
ps,
|
|
996
997
|
{
|
|
997
998
|
requirement: d,
|
|
998
999
|
childRelations: h,
|
|
@@ -1034,7 +1035,7 @@ function Fe({
|
|
|
1034
1035
|
return /* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
1035
1036
|
/* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: a }),
|
|
1036
1037
|
/* @__PURE__ */ e(
|
|
1037
|
-
|
|
1038
|
+
Jt,
|
|
1038
1039
|
{
|
|
1039
1040
|
value: x,
|
|
1040
1041
|
onChange: (v) => {
|
|
@@ -1061,40 +1062,40 @@ function Fe({
|
|
|
1061
1062
|
r && /* @__PURE__ */ e("p", { className: "text-[10.5px] text-red-500", children: "Invalid JSON — not saved yet." })
|
|
1062
1063
|
] });
|
|
1063
1064
|
}
|
|
1064
|
-
const
|
|
1065
|
-
function
|
|
1065
|
+
const ct = "__custom__";
|
|
1066
|
+
function hs(a) {
|
|
1066
1067
|
return a.status === "live" ? `Live v${a.published_version ?? "?"}` : a.status === "draft" ? "Draft changes" : "Not published";
|
|
1067
1068
|
}
|
|
1068
|
-
function
|
|
1069
|
+
function xs({
|
|
1069
1070
|
externalApi: a,
|
|
1070
1071
|
value: n,
|
|
1071
1072
|
onChange: c
|
|
1072
1073
|
}) {
|
|
1073
|
-
const g = Z(), l =
|
|
1074
|
+
const g = Z(), l = Ea(), x = a.trim(), { data: o } = V({
|
|
1074
1075
|
queryKey: ["payload-templates", "list", x],
|
|
1075
1076
|
queryFn: () => g.request(
|
|
1076
|
-
|
|
1077
|
+
H(`/payload-templates?external_api=${encodeURIComponent(x)}`)
|
|
1077
1078
|
).then((m) => m.data ?? []),
|
|
1078
1079
|
enabled: !!x
|
|
1079
|
-
}), { data: r } =
|
|
1080
|
+
}), { data: r } = V({
|
|
1080
1081
|
queryKey: ["external-apis", "list"],
|
|
1081
|
-
queryFn: () => g.request(
|
|
1082
|
+
queryFn: () => g.request(H("/external-apis")).then((m) => m.data ?? []),
|
|
1082
1083
|
enabled: !!n
|
|
1083
1084
|
}), h = [
|
|
1084
|
-
{ value:
|
|
1085
|
+
{ value: ct, label: "Custom (inline Liquid)" },
|
|
1085
1086
|
...(o ?? []).map((m) => ({
|
|
1086
1087
|
value: m.key,
|
|
1087
|
-
label: `${m.label} · ${
|
|
1088
|
+
label: `${m.label} · ${hs(m)}`
|
|
1088
1089
|
}))
|
|
1089
1090
|
], v = (r ?? []).find((m) => m.name === x || String(m.id) === x), u = v ? String(v.id) : x, d = n ? `/external-apis/${encodeURIComponent(u)}/payloads/${encodeURIComponent(n)}` : null, N = d ? l.consoleUrl ? l.consoleUrl(d) : d : null;
|
|
1090
1091
|
return /* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
1091
1092
|
/* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400 dark:text-slate-500", children: "Payload template" }),
|
|
1092
1093
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
1093
1094
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
1094
|
-
|
|
1095
|
+
ue,
|
|
1095
1096
|
{
|
|
1096
|
-
value: n ??
|
|
1097
|
-
onChange: (m) => c(m ===
|
|
1097
|
+
value: n ?? ct,
|
|
1098
|
+
onChange: (m) => c(m === ct ? void 0 : m),
|
|
1098
1099
|
options: h,
|
|
1099
1100
|
placeholder: x ? "Custom (inline Liquid)" : "Enter an external API first"
|
|
1100
1101
|
}
|
|
@@ -1106,7 +1107,7 @@ function ps({
|
|
|
1106
1107
|
onClick: () => l.navigate(N),
|
|
1107
1108
|
className: "flex shrink-0 items-center gap-1 text-[11px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200",
|
|
1108
1109
|
children: [
|
|
1109
|
-
/* @__PURE__ */ e(
|
|
1110
|
+
/* @__PURE__ */ e(Ca, { className: "h-3 w-3" }),
|
|
1110
1111
|
"Open template"
|
|
1111
1112
|
]
|
|
1112
1113
|
}
|
|
@@ -1114,7 +1115,7 @@ function ps({
|
|
|
1114
1115
|
] })
|
|
1115
1116
|
] });
|
|
1116
1117
|
}
|
|
1117
|
-
function
|
|
1118
|
+
function fs({
|
|
1118
1119
|
actions: a,
|
|
1119
1120
|
onChange: n
|
|
1120
1121
|
}) {
|
|
@@ -1127,7 +1128,7 @@ function us({
|
|
|
1127
1128
|
onClick: () => g((o) => !o),
|
|
1128
1129
|
className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-800",
|
|
1129
1130
|
children: [
|
|
1130
|
-
c ? /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(
|
|
1131
|
+
c ? /* @__PURE__ */ e(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(gt, { className: "h-3.5 w-3.5" }),
|
|
1131
1132
|
"Actions",
|
|
1132
1133
|
a.length > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-teal-100 px-1.5 py-0.5 text-[10px] font-medium text-teal-700", children: a.length })
|
|
1133
1134
|
]
|
|
@@ -1154,7 +1155,7 @@ function us({
|
|
|
1154
1155
|
children: [
|
|
1155
1156
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
1156
1157
|
/* @__PURE__ */ e(
|
|
1157
|
-
|
|
1158
|
+
ue,
|
|
1158
1159
|
{
|
|
1159
1160
|
value: o.type,
|
|
1160
1161
|
onChange: (h) => l(r, { type: h }),
|
|
@@ -1252,7 +1253,7 @@ function us({
|
|
|
1252
1253
|
] })
|
|
1253
1254
|
] }),
|
|
1254
1255
|
o.type === "erp_submit" && /* @__PURE__ */ e(
|
|
1255
|
-
|
|
1256
|
+
xs,
|
|
1256
1257
|
{
|
|
1257
1258
|
externalApi: String(o.external_api ?? ""),
|
|
1258
1259
|
value: o.payload_template_key,
|
|
@@ -1262,7 +1263,7 @@ function us({
|
|
|
1262
1263
|
!(o.type === "erp_submit" && o.payload_template_key) && /* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
1263
1264
|
/* @__PURE__ */ e("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: "Payload template (Liquid — must render to valid JSON)" }),
|
|
1264
1265
|
/* @__PURE__ */ e(
|
|
1265
|
-
|
|
1266
|
+
Jt,
|
|
1266
1267
|
{
|
|
1267
1268
|
value: o.payload_template ?? "",
|
|
1268
1269
|
onChange: (h) => l(r, { payload_template: h.target.value }),
|
|
@@ -1352,7 +1353,7 @@ function us({
|
|
|
1352
1353
|
] })
|
|
1353
1354
|
] });
|
|
1354
1355
|
}
|
|
1355
|
-
function
|
|
1356
|
+
function dt({
|
|
1356
1357
|
initial: a,
|
|
1357
1358
|
states: n,
|
|
1358
1359
|
collection: c,
|
|
@@ -1377,15 +1378,15 @@ function ct({
|
|
|
1377
1378
|
notify_text: a.notify_text ?? null,
|
|
1378
1379
|
comment_mode: a.comment_mode ?? "none",
|
|
1379
1380
|
actions: a.actions ?? null
|
|
1380
|
-
}), v = (b, p) => h((w) => ({ ...w, [b]: p })), u = (b) => b.collection.trim() !== "" && b.fk_field.trim() !== "" && b.fields.length > 0, d = (r.requirements ?? []).every(u), N = r.to_states.length > 0 && r.label.trim() && d, { data: m } =
|
|
1381
|
+
}), v = (b, p) => h((w) => ({ ...w, [b]: p })), u = (b) => b.collection.trim() !== "" && b.fk_field.trim() !== "" && b.fields.length > 0, d = (r.requirements ?? []).every(u), N = r.to_states.length > 0 && r.label.trim() && d, { data: m } = Ma(c, {
|
|
1381
1382
|
select: (b) => Array.isArray(b == null ? void 0 : b.fields) ? b.fields : []
|
|
1382
|
-
}), f =
|
|
1383
|
+
}), f = Oa(
|
|
1383
1384
|
{
|
|
1384
1385
|
...r,
|
|
1385
1386
|
condition_rules: (r.condition_rules ?? []).filter((b) => b.field.trim()),
|
|
1386
1387
|
requirements: (r.requirements ?? []).filter(u)
|
|
1387
1388
|
},
|
|
1388
|
-
|
|
1389
|
+
Ra(m ?? [], [], c, {
|
|
1389
1390
|
states: Object.fromEntries(n.map((b) => [b.id, b.label]))
|
|
1390
1391
|
})
|
|
1391
1392
|
);
|
|
@@ -1409,7 +1410,7 @@ function ct({
|
|
|
1409
1410
|
/* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
|
|
1410
1411
|
/* @__PURE__ */ e(Y, { className: "text-[12px]", children: "From State" }),
|
|
1411
1412
|
/* @__PURE__ */ e(
|
|
1412
|
-
|
|
1413
|
+
ue,
|
|
1413
1414
|
{
|
|
1414
1415
|
value: r.from_state ?? "",
|
|
1415
1416
|
onChange: (b) => v("from_state", b || null),
|
|
@@ -1423,7 +1424,7 @@ function ct({
|
|
|
1423
1424
|
/* @__PURE__ */ e(Y, { className: "text-[12px]", children: r.to_previous ? "Fallback state" : `To State${r.to_states.length !== 1 ? "s" : ""}` }),
|
|
1424
1425
|
r.to_previous && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400", children: "The real target is the record's previous state — this only applies when history can't answer (the record started in this state, or the prior state was removed)." }),
|
|
1425
1426
|
/* @__PURE__ */ e(
|
|
1426
|
-
|
|
1427
|
+
ss,
|
|
1427
1428
|
{
|
|
1428
1429
|
values: r.to_states,
|
|
1429
1430
|
onChange: (b) => v("to_states", b),
|
|
@@ -1461,10 +1462,10 @@ function ct({
|
|
|
1461
1462
|
] }),
|
|
1462
1463
|
!g && /* @__PURE__ */ t("div", { className: "space-y-1.5", children: [
|
|
1463
1464
|
/* @__PURE__ */ e(Y, { className: "text-[12px]", children: "Color" }),
|
|
1464
|
-
/* @__PURE__ */ e(
|
|
1465
|
+
/* @__PURE__ */ e(Ze, { value: r.color, onChange: (b) => v("color", b) })
|
|
1465
1466
|
] }),
|
|
1466
1467
|
/* @__PURE__ */ e(
|
|
1467
|
-
|
|
1468
|
+
ms,
|
|
1468
1469
|
{
|
|
1469
1470
|
rules: r.condition_rules ?? [],
|
|
1470
1471
|
onChange: (b) => v("condition_rules", b),
|
|
@@ -1472,7 +1473,7 @@ function ct({
|
|
|
1472
1473
|
}
|
|
1473
1474
|
),
|
|
1474
1475
|
/* @__PURE__ */ e(
|
|
1475
|
-
|
|
1476
|
+
us,
|
|
1476
1477
|
{
|
|
1477
1478
|
requirements: r.requirements ?? [],
|
|
1478
1479
|
onChange: (b) => v("requirements", b.length > 0 ? b : null),
|
|
@@ -1480,7 +1481,7 @@ function ct({
|
|
|
1480
1481
|
}
|
|
1481
1482
|
),
|
|
1482
1483
|
/* @__PURE__ */ e(
|
|
1483
|
-
|
|
1484
|
+
fs,
|
|
1484
1485
|
{
|
|
1485
1486
|
actions: r.actions ?? [],
|
|
1486
1487
|
onChange: (b) => v("actions", b.length > 0 ? b : null)
|
|
@@ -1587,7 +1588,7 @@ function ct({
|
|
|
1587
1588
|
] }),
|
|
1588
1589
|
/* @__PURE__ */ e(Ee, { checked: r.to_previous, onCheckedChange: (b) => v("to_previous", b) })
|
|
1589
1590
|
] }),
|
|
1590
|
-
/* @__PURE__ */ e(
|
|
1591
|
+
/* @__PURE__ */ e(La, { kind: "transition", sentences: f }),
|
|
1591
1592
|
/* @__PURE__ */ t("div", { className: "flex gap-2 justify-end", children: [
|
|
1592
1593
|
/* @__PURE__ */ e(T, { type: "button", variant: "outline", size: "sm", onClick: x, children: "Cancel" }),
|
|
1593
1594
|
/* @__PURE__ */ e(
|
|
@@ -1610,19 +1611,19 @@ function ct({
|
|
|
1610
1611
|
] })
|
|
1611
1612
|
] });
|
|
1612
1613
|
}
|
|
1613
|
-
function
|
|
1614
|
+
function gs(a) {
|
|
1614
1615
|
var g, l;
|
|
1615
1616
|
const n = ((g = a.first_name) == null ? void 0 : g[0]) ?? "", c = ((l = a.last_name) == null ? void 0 : l[0]) ?? "";
|
|
1616
1617
|
return (n + c).toUpperCase() || a.email[0].toUpperCase();
|
|
1617
1618
|
}
|
|
1618
|
-
function
|
|
1619
|
+
function bs(a) {
|
|
1619
1620
|
const n = a.filter((l) => !l.filters || l.filters.length === 0), c = /* @__PURE__ */ new Set(), g = [];
|
|
1620
1621
|
for (const l of n)
|
|
1621
1622
|
for (const x of l.users)
|
|
1622
1623
|
c.has(x.user) || (c.add(x.user), g.push(x));
|
|
1623
1624
|
return g;
|
|
1624
1625
|
}
|
|
1625
|
-
function
|
|
1626
|
+
function ys({
|
|
1626
1627
|
users: a,
|
|
1627
1628
|
filteredCount: n
|
|
1628
1629
|
}) {
|
|
@@ -1635,7 +1636,7 @@ function fs({
|
|
|
1635
1636
|
{
|
|
1636
1637
|
title: `${l.first_name ?? ""} ${l.last_name ?? ""}`.trim() || l.email,
|
|
1637
1638
|
className: "h-5 w-5 rounded-full bg-nvr-cyan/20 border border-white flex items-center justify-center text-[9px] font-semibold text-nvr-cyan",
|
|
1638
|
-
children:
|
|
1639
|
+
children: gs(l)
|
|
1639
1640
|
},
|
|
1640
1641
|
l.user
|
|
1641
1642
|
)),
|
|
@@ -1658,7 +1659,7 @@ function fs({
|
|
|
1658
1659
|
)
|
|
1659
1660
|
] });
|
|
1660
1661
|
}
|
|
1661
|
-
function
|
|
1662
|
+
function vs({
|
|
1662
1663
|
s: a,
|
|
1663
1664
|
groups: n,
|
|
1664
1665
|
expandedStateId: c,
|
|
@@ -1666,7 +1667,7 @@ function gs({
|
|
|
1666
1667
|
onEdit: l,
|
|
1667
1668
|
onDelete: x
|
|
1668
1669
|
}) {
|
|
1669
|
-
const { attributes: o, listeners: r, setNodeRef: h, transform: v, transition: u, isDragging: d } =
|
|
1670
|
+
const { attributes: o, listeners: r, setNodeRef: h, transform: v, transition: u, isDragging: d } = pt({
|
|
1670
1671
|
id: a.id
|
|
1671
1672
|
});
|
|
1672
1673
|
return /* @__PURE__ */ e(
|
|
@@ -1674,7 +1675,7 @@ function gs({
|
|
|
1674
1675
|
{
|
|
1675
1676
|
ref: h,
|
|
1676
1677
|
style: {
|
|
1677
|
-
transform:
|
|
1678
|
+
transform: ut.Transform.toString(v),
|
|
1678
1679
|
transition: u,
|
|
1679
1680
|
opacity: d ? 0.4 : 1
|
|
1680
1681
|
},
|
|
@@ -1687,7 +1688,7 @@ function gs({
|
|
|
1687
1688
|
...r,
|
|
1688
1689
|
className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 transition-colors shrink-0",
|
|
1689
1690
|
tabIndex: -1,
|
|
1690
|
-
children: /* @__PURE__ */ e(
|
|
1691
|
+
children: /* @__PURE__ */ e(xt, { className: "h-3.5 w-3.5" })
|
|
1691
1692
|
}
|
|
1692
1693
|
),
|
|
1693
1694
|
/* @__PURE__ */ e(
|
|
@@ -1705,9 +1706,9 @@ function gs({
|
|
|
1705
1706
|
a.lock_record && /* @__PURE__ */ e(Ce, { variant: "outline", className: "text-[10px] h-4 px-1", children: "locked" })
|
|
1706
1707
|
] }) }),
|
|
1707
1708
|
/* @__PURE__ */ e(
|
|
1708
|
-
|
|
1709
|
+
ys,
|
|
1709
1710
|
{
|
|
1710
|
-
users:
|
|
1711
|
+
users: bs(n),
|
|
1711
1712
|
filteredCount: n.filter((N) => N.filters && N.filters.length > 0).length
|
|
1712
1713
|
}
|
|
1713
1714
|
),
|
|
@@ -1719,7 +1720,7 @@ function gs({
|
|
|
1719
1720
|
onClick: g,
|
|
1720
1721
|
className: "rounded p-1 text-slate-400 hover:text-slate-700",
|
|
1721
1722
|
title: "Configure owners & skip",
|
|
1722
|
-
children: /* @__PURE__ */ e(
|
|
1723
|
+
children: /* @__PURE__ */ e(wa, { className: "h-3.5 w-3.5" })
|
|
1723
1724
|
}
|
|
1724
1725
|
),
|
|
1725
1726
|
/* @__PURE__ */ e(
|
|
@@ -1748,19 +1749,19 @@ function gs({
|
|
|
1748
1749
|
}
|
|
1749
1750
|
);
|
|
1750
1751
|
}
|
|
1751
|
-
function
|
|
1752
|
+
function Ns({
|
|
1752
1753
|
d: a,
|
|
1753
1754
|
siblings: n,
|
|
1754
1755
|
onSave: c,
|
|
1755
1756
|
saving: g
|
|
1756
1757
|
}) {
|
|
1757
1758
|
const [l, x] = $(!1), [o, r] = $(a.cascade ?? []);
|
|
1758
|
-
|
|
1759
|
+
pe(() => {
|
|
1759
1760
|
l && r(a.cascade ?? []);
|
|
1760
1761
|
}, [l, a.cascade]);
|
|
1761
1762
|
const h = n.filter((v) => v.id !== a.id && !v.is_row_axis);
|
|
1762
|
-
return /* @__PURE__ */ t(
|
|
1763
|
-
/* @__PURE__ */ e(
|
|
1763
|
+
return /* @__PURE__ */ t(Ke, { open: l, onOpenChange: x, children: [
|
|
1764
|
+
/* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(
|
|
1764
1765
|
"button",
|
|
1765
1766
|
{
|
|
1766
1767
|
type: "button",
|
|
@@ -1769,10 +1770,10 @@ function bs({
|
|
|
1769
1770
|
"rounded p-1 transition-colors",
|
|
1770
1771
|
(a.cascade ?? []).length > 0 ? "text-nvr-cyan hover:text-nvr-cyan-dark" : "text-slate-400 hover:text-slate-700"
|
|
1771
1772
|
),
|
|
1772
|
-
children: /* @__PURE__ */ e(
|
|
1773
|
+
children: /* @__PURE__ */ e(ht, { className: "h-3.5 w-3.5" })
|
|
1773
1774
|
}
|
|
1774
1775
|
) }),
|
|
1775
|
-
/* @__PURE__ */ t(
|
|
1776
|
+
/* @__PURE__ */ t(Be, { align: "end", className: "w-[380px] p-3", sideOffset: 4, children: [
|
|
1776
1777
|
/* @__PURE__ */ t("p", { className: "text-[12px] font-semibold text-slate-800 dark:text-foreground", children: [
|
|
1777
1778
|
"Cascade ",
|
|
1778
1779
|
a.label
|
|
@@ -1789,7 +1790,7 @@ function bs({
|
|
|
1789
1790
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
|
|
1790
1791
|
/* @__PURE__ */ e("span", { className: "w-14 shrink-0 text-[10.5px] font-medium uppercase tracking-wide text-slate-400", children: "Parent" }),
|
|
1791
1792
|
/* @__PURE__ */ e(
|
|
1792
|
-
|
|
1793
|
+
ue,
|
|
1793
1794
|
{
|
|
1794
1795
|
value: v.parent_field,
|
|
1795
1796
|
options: h.map((d) => ({ value: d.field, label: d.label })),
|
|
@@ -1877,7 +1878,7 @@ function bs({
|
|
|
1877
1878
|
] })
|
|
1878
1879
|
] });
|
|
1879
1880
|
}
|
|
1880
|
-
function
|
|
1881
|
+
function ws({
|
|
1881
1882
|
d: a,
|
|
1882
1883
|
siblings: n,
|
|
1883
1884
|
onEdit: c,
|
|
@@ -1885,7 +1886,7 @@ function ys({
|
|
|
1885
1886
|
onSaveCascade: l,
|
|
1886
1887
|
cascadeSaving: x
|
|
1887
1888
|
}) {
|
|
1888
|
-
const { attributes: o, listeners: r, setNodeRef: h, transform: v, transition: u, isDragging: d } =
|
|
1889
|
+
const { attributes: o, listeners: r, setNodeRef: h, transform: v, transition: u, isDragging: d } = pt({
|
|
1889
1890
|
id: a.id
|
|
1890
1891
|
});
|
|
1891
1892
|
return /* @__PURE__ */ t(
|
|
@@ -1893,7 +1894,7 @@ function ys({
|
|
|
1893
1894
|
{
|
|
1894
1895
|
ref: h,
|
|
1895
1896
|
style: {
|
|
1896
|
-
transform:
|
|
1897
|
+
transform: ut.Transform.toString(v),
|
|
1897
1898
|
transition: u,
|
|
1898
1899
|
opacity: d ? 0.4 : 1
|
|
1899
1900
|
},
|
|
@@ -1907,7 +1908,7 @@ function ys({
|
|
|
1907
1908
|
...r,
|
|
1908
1909
|
className: "cursor-grab touch-none text-slate-300 hover:text-slate-400 transition-colors",
|
|
1909
1910
|
tabIndex: -1,
|
|
1910
|
-
children: /* @__PURE__ */ e(
|
|
1911
|
+
children: /* @__PURE__ */ e(xt, { className: "h-3.5 w-3.5" })
|
|
1911
1912
|
}
|
|
1912
1913
|
),
|
|
1913
1914
|
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0 flex items-center gap-3 flex-wrap", children: [
|
|
@@ -1930,7 +1931,7 @@ function ys({
|
|
|
1930
1931
|
] }),
|
|
1931
1932
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
1932
1933
|
/* @__PURE__ */ e(
|
|
1933
|
-
|
|
1934
|
+
Ns,
|
|
1934
1935
|
{
|
|
1935
1936
|
d: a,
|
|
1936
1937
|
siblings: n,
|
|
@@ -1964,18 +1965,18 @@ function ys({
|
|
|
1964
1965
|
}
|
|
1965
1966
|
);
|
|
1966
1967
|
}
|
|
1967
|
-
function
|
|
1968
|
+
function ks({
|
|
1968
1969
|
binding: a,
|
|
1969
1970
|
templateId: n
|
|
1970
1971
|
}) {
|
|
1971
1972
|
var y;
|
|
1972
1973
|
const c = Z(), g = ke(), l = a.dimensions ?? [], [x, o] = $(() => l.map((i) => i.id));
|
|
1973
|
-
|
|
1974
|
+
pe(() => {
|
|
1974
1975
|
o(l.map((i) => i.id));
|
|
1975
1976
|
}, [l]);
|
|
1976
|
-
const r = x.map((i) => l.find((_) => _.id === i)).filter(Boolean), h =
|
|
1977
|
-
|
|
1978
|
-
|
|
1977
|
+
const r = x.map((i) => l.find((_) => _.id === i)).filter(Boolean), h = Wt(
|
|
1978
|
+
Xe(Vt),
|
|
1979
|
+
Xe(Ht, { coordinateGetter: Yt })
|
|
1979
1980
|
), [v, u] = $(null), [d, N] = $({
|
|
1980
1981
|
field: "",
|
|
1981
1982
|
label: "",
|
|
@@ -1988,9 +1989,9 @@ function vs({
|
|
|
1988
1989
|
sort: 0,
|
|
1989
1990
|
is_row_axis: !1,
|
|
1990
1991
|
required: !1
|
|
1991
|
-
}), { data: b } =
|
|
1992
|
-
queryKey:
|
|
1993
|
-
queryFn: () => c.request(
|
|
1992
|
+
}), { data: b } = V({
|
|
1993
|
+
queryKey: Me.collectionMeta(a.collection),
|
|
1994
|
+
queryFn: () => c.request(H(`/collections/${a.collection}`)).then((i) => i.data),
|
|
1994
1995
|
enabled: !!a.collection
|
|
1995
1996
|
}), p = ((y = b == null ? void 0 : b.fields) == null ? void 0 : y.filter((i) => !i.hidden)) ?? [], w = () => g.invalidateQueries({ queryKey: ["pipeline-template", n] }), k = j({
|
|
1996
1997
|
mutationFn: (i) => c.request(I(`/pipelines/bindings/${a.id}/dimensions`, i)),
|
|
@@ -2021,7 +2022,7 @@ function vs({
|
|
|
2021
2022
|
}, O = (i) => {
|
|
2022
2023
|
const { active: _, over: E } = i;
|
|
2023
2024
|
if (!E || _.id === E.id) return;
|
|
2024
|
-
const F = x.indexOf(_.id), B = x.indexOf(E.id), L =
|
|
2025
|
+
const F = x.indexOf(_.id), B = x.indexOf(E.id), L = Je(x, F, B);
|
|
2025
2026
|
o(L), L.forEach((M, U) => {
|
|
2026
2027
|
var te;
|
|
2027
2028
|
((te = l.find((ae) => ae.id === M)) == null ? void 0 : te.sort) !== U && S.mutate({ dimId: M, body: { sort: U } });
|
|
@@ -2029,7 +2030,7 @@ function vs({
|
|
|
2029
2030
|
};
|
|
2030
2031
|
return /* @__PURE__ */ t("div", { className: "border-t border-slate-100 bg-slate-50/50 px-4 pt-3 pb-4 space-y-3 rounded-b-lg", children: [
|
|
2031
2032
|
l.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400 py-0.5", children: "No dimensions — add one below." }),
|
|
2032
|
-
l.length > 0 && /* @__PURE__ */ e(
|
|
2033
|
+
l.length > 0 && /* @__PURE__ */ e(He, { sensors: h, collisionDetection: Ye, onDragEnd: O, children: /* @__PURE__ */ e(Ge, { items: x, strategy: Ie, children: /* @__PURE__ */ e("div", { className: "space-y-1.5", children: r.map(
|
|
2033
2034
|
(i) => v === i.id ? /* @__PURE__ */ t(
|
|
2034
2035
|
"div",
|
|
2035
2036
|
{
|
|
@@ -2039,7 +2040,7 @@ function vs({
|
|
|
2039
2040
|
/* @__PURE__ */ t("div", { className: "space-y-1.5 flex-1 min-w-[160px]", children: [
|
|
2040
2041
|
/* @__PURE__ */ e(Y, { className: "text-[11px] text-slate-500", children: "Field" }),
|
|
2041
2042
|
/* @__PURE__ */ e(
|
|
2042
|
-
|
|
2043
|
+
mt,
|
|
2043
2044
|
{
|
|
2044
2045
|
collection: a.collection,
|
|
2045
2046
|
fields: p,
|
|
@@ -2122,7 +2123,7 @@ function vs({
|
|
|
2122
2123
|
},
|
|
2123
2124
|
i.id
|
|
2124
2125
|
) : /* @__PURE__ */ e(
|
|
2125
|
-
|
|
2126
|
+
ws,
|
|
2126
2127
|
{
|
|
2127
2128
|
d: i,
|
|
2128
2129
|
siblings: r,
|
|
@@ -2141,7 +2142,7 @@ function vs({
|
|
|
2141
2142
|
/* @__PURE__ */ t("div", { className: "space-y-1.5 flex-1 min-w-[160px]", children: [
|
|
2142
2143
|
/* @__PURE__ */ e(Y, { className: "text-[11px] text-slate-500", children: "Field" }),
|
|
2143
2144
|
/* @__PURE__ */ e(
|
|
2144
|
-
|
|
2145
|
+
mt,
|
|
2145
2146
|
{
|
|
2146
2147
|
collection: a.collection,
|
|
2147
2148
|
fields: p,
|
|
@@ -2213,73 +2214,73 @@ function vs({
|
|
|
2213
2214
|
] })
|
|
2214
2215
|
] });
|
|
2215
2216
|
}
|
|
2216
|
-
function
|
|
2217
|
+
function En({
|
|
2217
2218
|
templateId: a,
|
|
2218
2219
|
onBack: n,
|
|
2219
2220
|
onExport: c,
|
|
2220
2221
|
hidden: g
|
|
2221
2222
|
}) {
|
|
2222
|
-
var
|
|
2223
|
+
var Rt;
|
|
2223
2224
|
const l = Z(), x = ke(), o = new Set(g ?? []), [r, h] = $(!1), [v, u] = $(""), [d, N] = $(!1), [m, f] = $(null), [b, p] = $(!1), [w, k] = $(null), [S, D] = $(null), [A, O] = $(
|
|
2224
2225
|
null
|
|
2225
|
-
), [y, i] = $(""), [_, E] = $(""), [F, B] = $(null), [L, M] = $(!1), [U, te] = $([]), ae =
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
), { data: oe } =
|
|
2226
|
+
), [y, i] = $(""), [_, E] = $(""), [F, B] = $(null), [L, M] = $(!1), [U, te] = $([]), ae = Wt(
|
|
2227
|
+
Xe(Vt),
|
|
2228
|
+
Xe(Ht, { coordinateGetter: Yt })
|
|
2229
|
+
), { data: oe } = V({
|
|
2229
2230
|
queryKey: ["collection-fields", y],
|
|
2230
|
-
queryFn: () => l.request(
|
|
2231
|
+
queryFn: () => l.request(H(`/collections/${y}`)).then((s) => {
|
|
2231
2232
|
var C;
|
|
2232
2233
|
return (((C = s.data) == null ? void 0 : C.fields) ?? []).filter((R) => !R.hidden);
|
|
2233
2234
|
}),
|
|
2234
2235
|
enabled: !!y
|
|
2235
|
-
}), [ce,
|
|
2236
|
+
}), [ce, tt] = $(null), {
|
|
2236
2237
|
data: z,
|
|
2237
|
-
isLoading:
|
|
2238
|
+
isLoading: Qe,
|
|
2238
2239
|
isError: Q,
|
|
2239
2240
|
error: X,
|
|
2240
2241
|
refetch: de
|
|
2241
|
-
} =
|
|
2242
|
+
} = V({
|
|
2242
2243
|
queryKey: ["pipeline-template", a],
|
|
2243
|
-
queryFn: () => l.request(
|
|
2244
|
+
queryFn: () => l.request(H(`/pipelines/${a}`)).then((s) => s.data),
|
|
2244
2245
|
enabled: !!a
|
|
2245
|
-
}), [me,
|
|
2246
|
-
|
|
2246
|
+
}), [me, bt] = $([]), [Ue, yt] = $({});
|
|
2247
|
+
pe(() => {
|
|
2247
2248
|
const s = (z == null ? void 0 : z.states) ?? [];
|
|
2248
2249
|
te(s.map((C) => C.id));
|
|
2249
|
-
}, [z == null ? void 0 : z.states]),
|
|
2250
|
-
const s =
|
|
2251
|
-
|
|
2250
|
+
}, [z == null ? void 0 : z.states]), pe(() => {
|
|
2251
|
+
const s = zt((z == null ? void 0 : z.transitions) ?? []);
|
|
2252
|
+
bt(s.map((C) => C.label)), yt(
|
|
2252
2253
|
Object.fromEntries(s.map((C) => [C.label, C.routes.map((R) => R.ids[0])]))
|
|
2253
2254
|
);
|
|
2254
2255
|
}, [z == null ? void 0 : z.transitions]);
|
|
2255
|
-
const { data:
|
|
2256
|
+
const { data: na } = V({
|
|
2256
2257
|
queryKey: ["collections", "tables_only"],
|
|
2257
|
-
queryFn: () => l.request(
|
|
2258
|
-
}), { data:
|
|
2258
|
+
queryFn: () => l.request(H("/collections?tables_only=true")).then((s) => s.data)
|
|
2259
|
+
}), { data: at } = V({
|
|
2259
2260
|
queryKey: ["pipeline-all-owner-groups", a],
|
|
2260
|
-
queryFn: () => l.request(
|
|
2261
|
+
queryFn: () => l.request(H(`/pipelines/${a}/owner-groups`)).then((s) => s.data),
|
|
2261
2262
|
enabled: !!a
|
|
2262
2263
|
}), le = () => {
|
|
2263
2264
|
x.invalidateQueries({ queryKey: ["pipeline-template", a] }), x.invalidateQueries({ queryKey: ["pipeline-templates"] }), x.invalidateQueries({ queryKey: ["pipeline-all-owner-groups", a] });
|
|
2264
|
-
},
|
|
2265
|
+
}, st = j({
|
|
2265
2266
|
mutationFn: (s) => l.request(be(`/pipelines/${a}`, s)),
|
|
2266
2267
|
onSuccess: () => {
|
|
2267
2268
|
le(), h(!1);
|
|
2268
2269
|
},
|
|
2269
2270
|
onError: () => P.error("Failed to update pipeline")
|
|
2270
|
-
}),
|
|
2271
|
+
}), vt = j({
|
|
2271
2272
|
mutationFn: (s) => l.request(I(`/pipelines/${a}/states`, s)),
|
|
2272
2273
|
onSuccess: () => {
|
|
2273
2274
|
le(), N(!1);
|
|
2274
2275
|
},
|
|
2275
2276
|
onError: () => P.error("Failed to add state")
|
|
2276
|
-
}),
|
|
2277
|
+
}), nt = j({
|
|
2277
2278
|
mutationFn: ({ stateId: s, body: C }) => l.request(be(`/pipelines/states/${s}`, C)),
|
|
2278
2279
|
onSuccess: () => {
|
|
2279
2280
|
le(), f(null);
|
|
2280
2281
|
},
|
|
2281
2282
|
onError: () => P.error("Failed to update state")
|
|
2282
|
-
}),
|
|
2283
|
+
}), la = j({
|
|
2283
2284
|
mutationFn: (s) => l.request($e(`/pipelines/states/${s}`)),
|
|
2284
2285
|
onSuccess: () => {
|
|
2285
2286
|
le(), P.success("State deleted");
|
|
@@ -2289,7 +2290,7 @@ function Sn({
|
|
|
2289
2290
|
const C = ((R = s == null ? void 0 : s.response) == null ? void 0 : R.error) ?? (s == null ? void 0 : s.message);
|
|
2290
2291
|
P.error(C || "Failed to delete state", { duration: 9e3 });
|
|
2291
2292
|
}
|
|
2292
|
-
}),
|
|
2293
|
+
}), Nt = j({
|
|
2293
2294
|
mutationFn: async (s) => {
|
|
2294
2295
|
const C = {
|
|
2295
2296
|
from_state: s.from_state,
|
|
@@ -2316,7 +2317,7 @@ function Sn({
|
|
|
2316
2317
|
le(), p(!1);
|
|
2317
2318
|
},
|
|
2318
2319
|
onError: () => P.error("Failed to add transition")
|
|
2319
|
-
}),
|
|
2320
|
+
}), wt = j({
|
|
2320
2321
|
mutationFn: async ({
|
|
2321
2322
|
labelGroup: s,
|
|
2322
2323
|
data: C
|
|
@@ -2347,7 +2348,7 @@ function Sn({
|
|
|
2347
2348
|
le(), k(null);
|
|
2348
2349
|
},
|
|
2349
2350
|
onError: () => P.error("Failed to add route")
|
|
2350
|
-
}),
|
|
2351
|
+
}), kt = j({
|
|
2351
2352
|
mutationFn: async ({ route: s, data: C }) => {
|
|
2352
2353
|
const R = /* @__PURE__ */ new Map();
|
|
2353
2354
|
s.to_states.forEach((q, K) => {
|
|
@@ -2387,9 +2388,9 @@ function Sn({
|
|
|
2387
2388
|
le(), O(null);
|
|
2388
2389
|
},
|
|
2389
2390
|
onError: (s) => {
|
|
2390
|
-
|
|
2391
|
+
Dt(s, "Failed to update route");
|
|
2391
2392
|
}
|
|
2392
|
-
}),
|
|
2393
|
+
}), _t = j({
|
|
2393
2394
|
mutationFn: async (s) => {
|
|
2394
2395
|
for (const C of s) await l.request($e(`/pipelines/transitions/${C}`));
|
|
2395
2396
|
},
|
|
@@ -2397,21 +2398,21 @@ function Sn({
|
|
|
2397
2398
|
le(), P.success("Deleted");
|
|
2398
2399
|
},
|
|
2399
2400
|
onError: () => P.error("Failed to delete")
|
|
2400
|
-
}),
|
|
2401
|
+
}), ra = j({
|
|
2401
2402
|
mutationFn: async (s) => {
|
|
2402
2403
|
for (const { id: C, sort: R } of s)
|
|
2403
2404
|
await l.request(be(`/pipelines/transitions/${C}`, { sort: R }));
|
|
2404
2405
|
},
|
|
2405
2406
|
onSuccess: () => le(),
|
|
2406
2407
|
onError: () => P.error("Failed to reorder")
|
|
2407
|
-
}),
|
|
2408
|
+
}), ia = j({
|
|
2408
2409
|
mutationFn: async ({ ids: s, color: C }) => {
|
|
2409
2410
|
for (const R of s)
|
|
2410
2411
|
await l.request(be(`/pipelines/transitions/${R}`, { color: C }));
|
|
2411
2412
|
},
|
|
2412
2413
|
onSuccess: () => le(),
|
|
2413
2414
|
onError: () => P.error("Failed to update color")
|
|
2414
|
-
}), [qe,
|
|
2415
|
+
}), [qe, We] = $(null), Re = j({
|
|
2415
2416
|
mutationFn: async ({
|
|
2416
2417
|
from: s,
|
|
2417
2418
|
label: C,
|
|
@@ -2428,92 +2429,100 @@ function Sn({
|
|
|
2428
2429
|
},
|
|
2429
2430
|
onSuccess: (s, { label: C }) => {
|
|
2430
2431
|
if ("pending" in s && s.pending) {
|
|
2431
|
-
|
|
2432
|
+
We(s.pending);
|
|
2432
2433
|
return;
|
|
2433
2434
|
}
|
|
2434
2435
|
const R = "done" in s ? s.done.filter((G) => G.rewritten).length : 0;
|
|
2435
|
-
le(), D(null),
|
|
2436
|
+
le(), D(null), We(null), P.success(
|
|
2436
2437
|
R ? `Renamed to "${C}" · ${R} reference${R === 1 ? "" : "s"} updated` : `Renamed to "${C}"`
|
|
2437
2438
|
);
|
|
2438
2439
|
},
|
|
2439
2440
|
onError: (s) => {
|
|
2440
|
-
|
|
2441
|
+
Dt(s, "Failed to rename");
|
|
2441
2442
|
}
|
|
2442
|
-
}),
|
|
2443
|
+
}), Ct = j({
|
|
2443
2444
|
mutationFn: (s) => l.request(I(`/pipelines/${a}/bind`, s)),
|
|
2444
2445
|
onSuccess: () => {
|
|
2445
2446
|
le(), i(""), E(""), P.success("Collection bound");
|
|
2446
2447
|
},
|
|
2447
2448
|
onError: () => P.error("Failed to bind collection")
|
|
2448
|
-
}),
|
|
2449
|
+
}), oa = j({
|
|
2449
2450
|
mutationFn: (s) => l.request($e(`/pipelines/bindings/${s}`)),
|
|
2450
2451
|
onSuccess: () => {
|
|
2451
2452
|
le(), P.success("Collection unbound");
|
|
2452
2453
|
},
|
|
2453
2454
|
onError: () => P.error("Failed to unbind")
|
|
2454
|
-
}),
|
|
2455
|
+
}), lt = j({
|
|
2455
2456
|
mutationFn: ({
|
|
2456
2457
|
bindingId: s,
|
|
2457
2458
|
body: C
|
|
2458
2459
|
}) => l.request(be(`/pipelines/bindings/${s}`, C)),
|
|
2459
2460
|
onSuccess: () => le(),
|
|
2460
2461
|
onError: () => P.error("Failed to update binding")
|
|
2461
|
-
});
|
|
2462
|
-
if (
|
|
2462
|
+
}), St = je(!1), qt = !!z;
|
|
2463
|
+
if (pe(() => {
|
|
2464
|
+
if (!qt || St.current || typeof window > "u" || window.location.hash !== "#owner-matrix") return;
|
|
2465
|
+
St.current = !0;
|
|
2466
|
+
const s = window.setTimeout(() => {
|
|
2467
|
+
var C;
|
|
2468
|
+
(C = document.getElementById("owner-matrix")) == null || C.scrollIntoView({ block: "start" });
|
|
2469
|
+
}, 50);
|
|
2470
|
+
return () => window.clearTimeout(s);
|
|
2471
|
+
}, [qt]), Q && !z)
|
|
2463
2472
|
return /* @__PURE__ */ e(
|
|
2464
|
-
|
|
2473
|
+
Ka,
|
|
2465
2474
|
{
|
|
2466
2475
|
error: X,
|
|
2467
2476
|
what: "this pipeline",
|
|
2468
2477
|
onRetry: () => void de()
|
|
2469
2478
|
}
|
|
2470
2479
|
);
|
|
2471
|
-
if (
|
|
2480
|
+
if (Qe || !z)
|
|
2472
2481
|
return /* @__PURE__ */ t("div", { className: "p-8 space-y-4", children: [
|
|
2473
2482
|
/* @__PURE__ */ e(Ae, { className: "h-8 w-64" }),
|
|
2474
2483
|
/* @__PURE__ */ e(Ae, { className: "h-48 rounded-xl" }),
|
|
2475
2484
|
/* @__PURE__ */ e(Ae, { className: "h-48 rounded-xl" })
|
|
2476
2485
|
] });
|
|
2477
|
-
const re = z.states ?? [],
|
|
2478
|
-
function
|
|
2486
|
+
const re = z.states ?? [], $t = z.transitions ?? [], he = z.bindings ?? [], ca = na ?? [], rt = U.length > 0 ? U.map((s) => re.find((C) => C.id === s)).filter(Boolean) : re, Ft = new Map(re.map((s) => [s.id, s])), it = new Map(zt($t).map((s) => [s.label, s])), Et = me.map((s) => it.get(s)).filter((s) => !!s);
|
|
2487
|
+
function Ot(s, C, R) {
|
|
2479
2488
|
const G = [];
|
|
2480
2489
|
let ee = 0;
|
|
2481
2490
|
for (const q of s) {
|
|
2482
2491
|
const K = R.get(q);
|
|
2483
2492
|
if (K)
|
|
2484
2493
|
for (const se of C[q] ?? []) {
|
|
2485
|
-
const fe = K.routes.find((
|
|
2494
|
+
const fe = K.routes.find((xe) => xe.ids[0] === se);
|
|
2486
2495
|
if (fe) {
|
|
2487
|
-
for (const
|
|
2496
|
+
for (const xe of fe.ids) G.push({ id: xe, sort: ee });
|
|
2488
2497
|
ee++;
|
|
2489
2498
|
}
|
|
2490
2499
|
}
|
|
2491
2500
|
}
|
|
2492
|
-
|
|
2501
|
+
ra.mutate(G);
|
|
2493
2502
|
}
|
|
2494
|
-
function
|
|
2503
|
+
function da(s) {
|
|
2495
2504
|
const { active: C, over: R } = s;
|
|
2496
2505
|
if (!R || C.id === R.id) return;
|
|
2497
|
-
const G =
|
|
2506
|
+
const G = Je(
|
|
2498
2507
|
me,
|
|
2499
2508
|
me.indexOf(C.id),
|
|
2500
2509
|
me.indexOf(R.id)
|
|
2501
2510
|
);
|
|
2502
|
-
|
|
2511
|
+
bt(G), Ot(G, Ue, it);
|
|
2503
2512
|
}
|
|
2504
|
-
function
|
|
2513
|
+
function ma(s, C) {
|
|
2505
2514
|
const { active: R, over: G } = C;
|
|
2506
2515
|
if (!G || R.id === G.id) return;
|
|
2507
|
-
const ee =
|
|
2508
|
-
|
|
2516
|
+
const ee = Ue[s] ?? [], q = Je(ee, ee.indexOf(R.id), ee.indexOf(G.id)), K = { ...Ue, [s]: q };
|
|
2517
|
+
yt(K), Ot(me, K, it);
|
|
2509
2518
|
}
|
|
2510
|
-
const
|
|
2519
|
+
const pa = he.some((s) => (s.dimensions ?? []).length > 0), ua = new Set(he.map((s) => s.collection)), ha = ca.filter((s) => !ua.has(s.collection)), xa = (s) => {
|
|
2511
2520
|
const { active: C, over: R } = s;
|
|
2512
2521
|
if (!R || C.id === R.id) return;
|
|
2513
|
-
const G = U.indexOf(C.id), ee = U.indexOf(R.id), q =
|
|
2522
|
+
const G = U.indexOf(C.id), ee = U.indexOf(R.id), q = Je(U, G, ee);
|
|
2514
2523
|
te(q), q.forEach((K, se) => {
|
|
2515
2524
|
var fe;
|
|
2516
|
-
((fe = re.find((
|
|
2525
|
+
((fe = re.find((xe) => xe.id === K)) == null ? void 0 : fe.sort) !== se && nt.mutate({ stateId: K, body: { sort: se } });
|
|
2517
2526
|
});
|
|
2518
2527
|
};
|
|
2519
2528
|
return /* @__PURE__ */ t(_e, { children: [
|
|
@@ -2527,7 +2536,7 @@ function Sn({
|
|
|
2527
2536
|
onClick: n,
|
|
2528
2537
|
className: "flex items-center gap-1 text-slate-400 transition-colors hover:text-slate-700",
|
|
2529
2538
|
children: [
|
|
2530
|
-
/* @__PURE__ */ e(
|
|
2539
|
+
/* @__PURE__ */ e(fa, { className: "h-3.5 w-3.5" }),
|
|
2531
2540
|
"Pipelines"
|
|
2532
2541
|
]
|
|
2533
2542
|
}
|
|
@@ -2539,7 +2548,7 @@ function Sn({
|
|
|
2539
2548
|
{
|
|
2540
2549
|
className: "flex items-center gap-1.5",
|
|
2541
2550
|
onSubmit: (s) => {
|
|
2542
|
-
s.preventDefault(), v.trim() &&
|
|
2551
|
+
s.preventDefault(), v.trim() && st.mutate({ name: v.trim() });
|
|
2543
2552
|
},
|
|
2544
2553
|
children: [
|
|
2545
2554
|
/* @__PURE__ */ e(
|
|
@@ -2582,7 +2591,7 @@ function Sn({
|
|
|
2582
2591
|
] }),
|
|
2583
2592
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
2584
2593
|
!o.has("history") && /* @__PURE__ */ e(
|
|
2585
|
-
|
|
2594
|
+
Aa,
|
|
2586
2595
|
{
|
|
2587
2596
|
collection: "nivaro_workflow_templates",
|
|
2588
2597
|
item: a,
|
|
@@ -2602,7 +2611,7 @@ function Sn({
|
|
|
2602
2611
|
}
|
|
2603
2612
|
},
|
|
2604
2613
|
children: [
|
|
2605
|
-
/* @__PURE__ */ e(
|
|
2614
|
+
/* @__PURE__ */ e(ga, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
2606
2615
|
" Export"
|
|
2607
2616
|
]
|
|
2608
2617
|
}
|
|
@@ -2621,7 +2630,7 @@ function Sn({
|
|
|
2621
2630
|
className: "text-[13px]",
|
|
2622
2631
|
onBlur: (s) => {
|
|
2623
2632
|
const C = s.target.value.trim() || null;
|
|
2624
|
-
C !== z.description &&
|
|
2633
|
+
C !== z.description && st.mutate({ description: C });
|
|
2625
2634
|
}
|
|
2626
2635
|
}
|
|
2627
2636
|
)
|
|
@@ -2629,16 +2638,16 @@ function Sn({
|
|
|
2629
2638
|
/* @__PURE__ */ t("div", { className: "shrink-0 space-y-1.5", children: [
|
|
2630
2639
|
/* @__PURE__ */ e(Y, { className: "text-[12px]", children: "Accent color" }),
|
|
2631
2640
|
/* @__PURE__ */ e(
|
|
2632
|
-
|
|
2641
|
+
Ze,
|
|
2633
2642
|
{
|
|
2634
2643
|
value: z.color,
|
|
2635
|
-
onChange: (s) =>
|
|
2644
|
+
onChange: (s) => st.mutate({ color: s })
|
|
2636
2645
|
}
|
|
2637
2646
|
)
|
|
2638
2647
|
] })
|
|
2639
2648
|
] }),
|
|
2640
2649
|
/* @__PURE__ */ e(
|
|
2641
|
-
|
|
2650
|
+
Da,
|
|
2642
2651
|
{
|
|
2643
2652
|
kind: "config",
|
|
2644
2653
|
params: { type: "pipeline", id: a },
|
|
@@ -2669,63 +2678,63 @@ function Sn({
|
|
|
2669
2678
|
] }),
|
|
2670
2679
|
re.length === 0 && !d && /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-400", children: "No states yet. States define the stages a record can be in." }),
|
|
2671
2680
|
/* @__PURE__ */ e(
|
|
2672
|
-
|
|
2681
|
+
He,
|
|
2673
2682
|
{
|
|
2674
2683
|
sensors: ae,
|
|
2675
|
-
collisionDetection:
|
|
2676
|
-
onDragEnd:
|
|
2677
|
-
children: /* @__PURE__ */ e(
|
|
2678
|
-
|
|
2684
|
+
collisionDetection: Ye,
|
|
2685
|
+
onDragEnd: xa,
|
|
2686
|
+
children: /* @__PURE__ */ e(Ge, { items: U, strategy: Ie, children: /* @__PURE__ */ t("div", { className: "space-y-2", children: [
|
|
2687
|
+
rt.map((s) => {
|
|
2679
2688
|
var C, R;
|
|
2680
2689
|
return /* @__PURE__ */ t("div", { children: [
|
|
2681
2690
|
(m == null ? void 0 : m.id) === s.id ? /* @__PURE__ */ e(
|
|
2682
|
-
|
|
2691
|
+
Mt,
|
|
2683
2692
|
{
|
|
2684
2693
|
initial: s,
|
|
2685
|
-
saving:
|
|
2686
|
-
onSave: (G) =>
|
|
2694
|
+
saving: nt.isPending,
|
|
2695
|
+
onSave: (G) => nt.mutate({ stateId: s.id, body: G }),
|
|
2687
2696
|
onCancel: () => f(null)
|
|
2688
2697
|
}
|
|
2689
2698
|
) : /* @__PURE__ */ e(
|
|
2690
|
-
|
|
2699
|
+
vs,
|
|
2691
2700
|
{
|
|
2692
2701
|
s,
|
|
2693
|
-
groups: (
|
|
2702
|
+
groups: (at == null ? void 0 : at[s.id]) ?? [],
|
|
2694
2703
|
expandedStateId: F,
|
|
2695
2704
|
onToggleExpand: () => B(F === s.id ? null : s.id),
|
|
2696
2705
|
onEdit: () => f(s),
|
|
2697
|
-
onDelete: () =>
|
|
2706
|
+
onDelete: () => la.mutate(s.id)
|
|
2698
2707
|
}
|
|
2699
2708
|
),
|
|
2700
2709
|
F === s.id && (m == null ? void 0 : m.id) !== s.id && /* @__PURE__ */ t("div", { className: "ml-4 mb-2 mt-2 rounded-xl border border-slate-200 bg-slate-50 p-4 space-y-4", children: [
|
|
2701
2710
|
/* @__PURE__ */ e(
|
|
2702
|
-
|
|
2711
|
+
Ja,
|
|
2703
2712
|
{
|
|
2704
2713
|
stateId: s.id,
|
|
2705
2714
|
stateName: s.label,
|
|
2706
2715
|
templateId: a,
|
|
2707
|
-
collection: (C =
|
|
2716
|
+
collection: (C = he[0]) == null ? void 0 : C.collection
|
|
2708
2717
|
}
|
|
2709
2718
|
),
|
|
2710
2719
|
/* @__PURE__ */ e("div", { className: "border-t border-slate-200 pt-4", children: /* @__PURE__ */ e(
|
|
2711
|
-
|
|
2720
|
+
Ia,
|
|
2712
2721
|
{
|
|
2713
2722
|
stateId: s.id,
|
|
2714
2723
|
stateName: s.label,
|
|
2715
2724
|
templateId: a,
|
|
2716
2725
|
initialCriteria: s.skip_criteria ?? null,
|
|
2717
|
-
collection: (R =
|
|
2726
|
+
collection: (R = he[0]) == null ? void 0 : R.collection
|
|
2718
2727
|
}
|
|
2719
2728
|
) })
|
|
2720
2729
|
] })
|
|
2721
2730
|
] }, s.id);
|
|
2722
2731
|
}),
|
|
2723
2732
|
d && /* @__PURE__ */ e(
|
|
2724
|
-
|
|
2733
|
+
Mt,
|
|
2725
2734
|
{
|
|
2726
2735
|
initial: {},
|
|
2727
|
-
saving:
|
|
2728
|
-
onSave: (s) =>
|
|
2736
|
+
saving: vt.isPending,
|
|
2737
|
+
onSave: (s) => vt.mutate({ ...s, sort: re.length }),
|
|
2729
2738
|
onCancel: () => N(!1)
|
|
2730
2739
|
}
|
|
2731
2740
|
)
|
|
@@ -2737,7 +2746,7 @@ function Sn({
|
|
|
2737
2746
|
/* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
|
|
2738
2747
|
/* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
|
|
2739
2748
|
"Transitions",
|
|
2740
|
-
/* @__PURE__ */ e("span", { className: "ml-2 font-mono text-[11px] font-normal text-slate-400", children:
|
|
2749
|
+
/* @__PURE__ */ e("span", { className: "ml-2 font-mono text-[11px] font-normal text-slate-400", children: $t.length }),
|
|
2741
2750
|
/* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "The allowed moves between states — who may take them, the conditions that gate them, and the actions they fire." })
|
|
2742
2751
|
] }),
|
|
2743
2752
|
!b && /* @__PURE__ */ t(
|
|
@@ -2758,19 +2767,19 @@ function Sn({
|
|
|
2758
2767
|
re.length < 2 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Add at least 2 states before defining transitions." }),
|
|
2759
2768
|
/* @__PURE__ */ t("div", { className: "space-y-3", children: [
|
|
2760
2769
|
/* @__PURE__ */ e(
|
|
2761
|
-
|
|
2770
|
+
He,
|
|
2762
2771
|
{
|
|
2763
2772
|
sensors: ae,
|
|
2764
|
-
collisionDetection:
|
|
2765
|
-
onDragEnd:
|
|
2766
|
-
children: /* @__PURE__ */ e(
|
|
2773
|
+
collisionDetection: Ye,
|
|
2774
|
+
onDragEnd: da,
|
|
2775
|
+
children: /* @__PURE__ */ e(Ge, { items: me, strategy: Ie, children: Et.map((s) => {
|
|
2767
2776
|
var ee;
|
|
2768
|
-
const C = new Map(s.routes.map((q) => [q.ids[0], q])), R =
|
|
2769
|
-
return /* @__PURE__ */ e(
|
|
2777
|
+
const C = new Map(s.routes.map((q) => [q.ids[0], q])), R = Ue[s.label] ?? s.routes.map((q) => q.ids[0]), G = R.map((q) => C.get(q)).filter((q) => !!q);
|
|
2778
|
+
return /* @__PURE__ */ e(Bt, { id: s.label, children: /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white", children: [
|
|
2770
2779
|
/* @__PURE__ */ t("div", { className: "group/hdr flex items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-3 py-2", children: [
|
|
2771
|
-
/* @__PURE__ */ e(
|
|
2772
|
-
/* @__PURE__ */ t(
|
|
2773
|
-
/* @__PURE__ */ e(
|
|
2780
|
+
/* @__PURE__ */ e(Qt, {}),
|
|
2781
|
+
/* @__PURE__ */ t(Ke, { children: [
|
|
2782
|
+
/* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(
|
|
2774
2783
|
"button",
|
|
2775
2784
|
{
|
|
2776
2785
|
type: "button",
|
|
@@ -2780,7 +2789,7 @@ function Sn({
|
|
|
2780
2789
|
}
|
|
2781
2790
|
) }),
|
|
2782
2791
|
/* @__PURE__ */ t(
|
|
2783
|
-
|
|
2792
|
+
Be,
|
|
2784
2793
|
{
|
|
2785
2794
|
align: "start",
|
|
2786
2795
|
className: "w-auto p-3",
|
|
@@ -2788,12 +2797,12 @@ function Sn({
|
|
|
2788
2797
|
children: [
|
|
2789
2798
|
/* @__PURE__ */ e("p", { className: "mb-2 text-[11px] font-medium text-slate-500", children: "Group color" }),
|
|
2790
2799
|
/* @__PURE__ */ e(
|
|
2791
|
-
|
|
2800
|
+
Ze,
|
|
2792
2801
|
{
|
|
2793
2802
|
value: s.color,
|
|
2794
2803
|
onChange: (q) => {
|
|
2795
2804
|
const K = s.routes.flatMap((se) => se.ids);
|
|
2796
|
-
|
|
2805
|
+
ia.mutate({ ids: K, color: q });
|
|
2797
2806
|
}
|
|
2798
2807
|
}
|
|
2799
2808
|
)
|
|
@@ -2802,8 +2811,8 @@ function Sn({
|
|
|
2802
2811
|
)
|
|
2803
2812
|
] }),
|
|
2804
2813
|
(S == null ? void 0 : S.from) === s.label ? (() => {
|
|
2805
|
-
const q = S.value, K = q.trim(), se = K !== s.label &&
|
|
2806
|
-
!fe || Re.isPending || (qe && qe.to !== K &&
|
|
2814
|
+
const q = S.value, K = q.trim(), se = K !== s.label && Et.some((ie) => ie.label === K), fe = K.length > 0 && K !== s.label && !se, xe = () => {
|
|
2815
|
+
!fe || Re.isPending || (qe && qe.to !== K && We(null), Re.mutate({ from: s.label, label: K }));
|
|
2807
2816
|
}, ne = (qe == null ? void 0 : qe.from) === s.label && qe.to === K ? qe.references : null;
|
|
2808
2817
|
return /* @__PURE__ */ t(
|
|
2809
2818
|
"div",
|
|
@@ -2821,7 +2830,7 @@ function Sn({
|
|
|
2821
2830
|
value: ie.target.value
|
|
2822
2831
|
}),
|
|
2823
2832
|
onKeyDown: (ie) => {
|
|
2824
|
-
ie.key === "Enter" && (ie.preventDefault(),
|
|
2833
|
+
ie.key === "Enter" && (ie.preventDefault(), xe()), ie.key === "Escape" && D(null);
|
|
2825
2834
|
},
|
|
2826
2835
|
"aria-label": "Button label",
|
|
2827
2836
|
className: "h-7 max-w-[260px] text-[13px] font-semibold"
|
|
@@ -2832,7 +2841,7 @@ function Sn({
|
|
|
2832
2841
|
"button",
|
|
2833
2842
|
{
|
|
2834
2843
|
type: "button",
|
|
2835
|
-
onClick:
|
|
2844
|
+
onClick: xe,
|
|
2836
2845
|
disabled: !fe || Re.isPending,
|
|
2837
2846
|
title: "Save (Enter)",
|
|
2838
2847
|
className: "rounded p-1 text-emerald-600 hover:bg-emerald-50 disabled:opacity-40",
|
|
@@ -2844,7 +2853,7 @@ function Sn({
|
|
|
2844
2853
|
{
|
|
2845
2854
|
type: "button",
|
|
2846
2855
|
onClick: () => {
|
|
2847
|
-
D(null),
|
|
2856
|
+
D(null), We(null);
|
|
2848
2857
|
},
|
|
2849
2858
|
title: "Cancel (Esc)",
|
|
2850
2859
|
className: "rounded p-1 text-slate-400 hover:bg-slate-100",
|
|
@@ -2929,7 +2938,7 @@ function Sn({
|
|
|
2929
2938
|
/* @__PURE__ */ e(
|
|
2930
2939
|
De,
|
|
2931
2940
|
{
|
|
2932
|
-
onConfirm: () =>
|
|
2941
|
+
onConfirm: () => _t.mutate(s.routes.flatMap((q) => q.ids)),
|
|
2933
2942
|
title: "Delete all routes",
|
|
2934
2943
|
confirmLabel: "Delete all?",
|
|
2935
2944
|
confirmTitle: `Delete all routes for "${s.label}"?`,
|
|
@@ -2940,25 +2949,25 @@ function Sn({
|
|
|
2940
2949
|
)
|
|
2941
2950
|
] }),
|
|
2942
2951
|
/* @__PURE__ */ e(
|
|
2943
|
-
|
|
2952
|
+
He,
|
|
2944
2953
|
{
|
|
2945
2954
|
sensors: ae,
|
|
2946
|
-
collisionDetection:
|
|
2947
|
-
onDragEnd: (q) =>
|
|
2955
|
+
collisionDetection: Ye,
|
|
2956
|
+
onDragEnd: (q) => ma(s.label, q),
|
|
2948
2957
|
children: /* @__PURE__ */ e(
|
|
2949
|
-
|
|
2958
|
+
Ge,
|
|
2950
2959
|
{
|
|
2951
2960
|
items: R,
|
|
2952
|
-
strategy:
|
|
2961
|
+
strategy: Ie,
|
|
2953
2962
|
children: G.map((q) => {
|
|
2954
|
-
var
|
|
2955
|
-
const K = `${s.label}|${q.from_state ?? "_any_"}|${q.ids[0]}`, se = q.from_state ?
|
|
2963
|
+
var xe;
|
|
2964
|
+
const K = `${s.label}|${q.from_state ?? "_any_"}|${q.ids[0]}`, se = q.from_state ? Ft.get(q.from_state) : null;
|
|
2956
2965
|
return (A == null ? void 0 : A.label) === s.label && A.route.ids[0] === q.ids[0] ? /* @__PURE__ */ e(
|
|
2957
2966
|
"div",
|
|
2958
2967
|
{
|
|
2959
2968
|
className: "border-b border-slate-100 last:border-0 p-3",
|
|
2960
2969
|
children: /* @__PURE__ */ e(
|
|
2961
|
-
|
|
2970
|
+
dt,
|
|
2962
2971
|
{
|
|
2963
2972
|
initial: {
|
|
2964
2973
|
from_state: q.from_state,
|
|
@@ -2982,24 +2991,24 @@ function Sn({
|
|
|
2982
2991
|
},
|
|
2983
2992
|
fixedLabel: s.label,
|
|
2984
2993
|
states: re,
|
|
2985
|
-
collection: (
|
|
2986
|
-
saving:
|
|
2987
|
-
onSave: (ne) =>
|
|
2994
|
+
collection: (xe = he[0]) == null ? void 0 : xe.collection,
|
|
2995
|
+
saving: kt.isPending,
|
|
2996
|
+
onSave: (ne) => kt.mutate({ route: q, data: ne }),
|
|
2988
2997
|
onCancel: () => O(null)
|
|
2989
2998
|
}
|
|
2990
2999
|
)
|
|
2991
3000
|
},
|
|
2992
3001
|
K
|
|
2993
|
-
) : /* @__PURE__ */ e(
|
|
2994
|
-
/* @__PURE__ */ e(
|
|
3002
|
+
) : /* @__PURE__ */ e(Bt, { id: q.ids[0], children: /* @__PURE__ */ t("div", { className: "group/row flex items-center gap-2 border-b border-slate-100 px-3 py-2 last:border-0 hover:bg-slate-50", children: [
|
|
3003
|
+
/* @__PURE__ */ e(Qt, {}),
|
|
2995
3004
|
/* @__PURE__ */ t("div", { className: "flex flex-1 min-w-0 flex-wrap items-center gap-1.5 text-[12px]", children: [
|
|
2996
|
-
se ? /* @__PURE__ */ e(
|
|
2997
|
-
/* @__PURE__ */ e(
|
|
3005
|
+
se ? /* @__PURE__ */ e(jt, { state: se }) : /* @__PURE__ */ e("span", { className: "italic text-slate-400 text-[11px]", children: "any state" }),
|
|
3006
|
+
/* @__PURE__ */ e(Gt, { className: "h-3 w-3 text-slate-300 shrink-0" }),
|
|
2998
3007
|
q.to_states.map((ne, ie) => {
|
|
2999
|
-
const
|
|
3000
|
-
return
|
|
3008
|
+
const Tt = Ft.get(ne);
|
|
3009
|
+
return Tt ? /* @__PURE__ */ t("span", { className: "flex items-center gap-1", children: [
|
|
3001
3010
|
ie > 0 && /* @__PURE__ */ e("span", { className: "text-slate-300", children: "·" }),
|
|
3002
|
-
/* @__PURE__ */ e(
|
|
3011
|
+
/* @__PURE__ */ e(jt, { state: Tt, small: !0 })
|
|
3003
3012
|
] }, ne) : null;
|
|
3004
3013
|
}),
|
|
3005
3014
|
q.auto_trigger && /* @__PURE__ */ t(
|
|
@@ -3008,7 +3017,7 @@ function Sn({
|
|
|
3008
3017
|
className: "ml-1 inline-flex items-center gap-1 rounded-full bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",
|
|
3009
3018
|
title: "Automatic — fired by the engine when conditions match; hidden from users",
|
|
3010
3019
|
children: [
|
|
3011
|
-
/* @__PURE__ */ e(
|
|
3020
|
+
/* @__PURE__ */ e(ba, { className: "h-2.5 w-2.5" }),
|
|
3012
3021
|
"Auto"
|
|
3013
3022
|
]
|
|
3014
3023
|
}
|
|
@@ -3045,7 +3054,7 @@ function Sn({
|
|
|
3045
3054
|
className: "ml-1 inline-flex items-center gap-1 rounded-full bg-teal-100 px-1.5 py-0.5 text-[10px] font-semibold text-teal-700 dark:bg-teal-900/30 dark:text-teal-400",
|
|
3046
3055
|
title: "Transition actions run after this transition lands",
|
|
3047
3056
|
children: [
|
|
3048
|
-
/* @__PURE__ */ e(
|
|
3057
|
+
/* @__PURE__ */ e(ya, { className: "h-2.5 w-2.5" }),
|
|
3049
3058
|
(q.actions ?? []).length
|
|
3050
3059
|
]
|
|
3051
3060
|
}
|
|
@@ -3058,7 +3067,7 @@ function Sn({
|
|
|
3058
3067
|
(ne) => `${ne.field} ${ne.op} ${String(ne.value ?? "")}`
|
|
3059
3068
|
).join(" AND "),
|
|
3060
3069
|
children: [
|
|
3061
|
-
/* @__PURE__ */ e(
|
|
3070
|
+
/* @__PURE__ */ e(ht, { className: "h-2.5 w-2.5" }),
|
|
3062
3071
|
(q.condition_rules ?? []).length
|
|
3063
3072
|
]
|
|
3064
3073
|
}
|
|
@@ -3077,7 +3086,7 @@ function Sn({
|
|
|
3077
3086
|
/* @__PURE__ */ e(
|
|
3078
3087
|
De,
|
|
3079
3088
|
{
|
|
3080
|
-
onConfirm: () =>
|
|
3089
|
+
onConfirm: () => _t.mutate(q.ids),
|
|
3081
3090
|
title: "Delete route",
|
|
3082
3091
|
confirmLabel: "Delete?",
|
|
3083
3092
|
confirmTitle: "Delete this route?",
|
|
@@ -3094,14 +3103,14 @@ function Sn({
|
|
|
3094
3103
|
}
|
|
3095
3104
|
),
|
|
3096
3105
|
w === s.label && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 p-3", children: /* @__PURE__ */ e(
|
|
3097
|
-
|
|
3106
|
+
dt,
|
|
3098
3107
|
{
|
|
3099
3108
|
initial: { color: s.color },
|
|
3100
3109
|
fixedLabel: s.label,
|
|
3101
3110
|
states: re,
|
|
3102
|
-
collection: (ee =
|
|
3103
|
-
saving:
|
|
3104
|
-
onSave: (q) =>
|
|
3111
|
+
collection: (ee = he[0]) == null ? void 0 : ee.collection,
|
|
3112
|
+
saving: wt.isPending,
|
|
3113
|
+
onSave: (q) => wt.mutate({ labelGroup: s, data: q }),
|
|
3105
3114
|
onCancel: () => k(null)
|
|
3106
3115
|
}
|
|
3107
3116
|
) })
|
|
@@ -3110,30 +3119,30 @@ function Sn({
|
|
|
3110
3119
|
}
|
|
3111
3120
|
),
|
|
3112
3121
|
b && /* @__PURE__ */ e(
|
|
3113
|
-
|
|
3122
|
+
dt,
|
|
3114
3123
|
{
|
|
3115
3124
|
initial: {},
|
|
3116
3125
|
states: re,
|
|
3117
|
-
collection: (
|
|
3118
|
-
saving:
|
|
3119
|
-
onSave: (s) =>
|
|
3126
|
+
collection: (Rt = he[0]) == null ? void 0 : Rt.collection,
|
|
3127
|
+
saving: Nt.isPending,
|
|
3128
|
+
onSave: (s) => Nt.mutate(s),
|
|
3120
3129
|
onCancel: () => p(!1)
|
|
3121
3130
|
}
|
|
3122
3131
|
)
|
|
3123
3132
|
] })
|
|
3124
3133
|
] })
|
|
3125
3134
|
] }),
|
|
3126
|
-
!o.has("branches") && /* @__PURE__ */ e(
|
|
3135
|
+
!o.has("branches") && /* @__PURE__ */ e(Os, { templateId: a, states: rt }),
|
|
3127
3136
|
!o.has("bindings") && /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-4", children: [
|
|
3128
3137
|
/* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
|
|
3129
3138
|
"Applied to Collections",
|
|
3130
3139
|
/* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "Which collections run this pipeline, and the ownership dimensions (Region, Zone…) the Owner Matrix below resolves against." })
|
|
3131
3140
|
] }),
|
|
3132
|
-
|
|
3141
|
+
he.length > 0 && /* @__PURE__ */ e("div", { className: "space-y-2", children: he.map((s) => {
|
|
3133
3142
|
var C;
|
|
3134
3143
|
return /* @__PURE__ */ t("div", { className: "rounded-lg border border-slate-200 bg-white", children: [
|
|
3135
3144
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-3 px-4 py-3", children: [
|
|
3136
|
-
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-slate-100", children: /* @__PURE__ */ e(
|
|
3145
|
+
/* @__PURE__ */ e("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-slate-100", children: /* @__PURE__ */ e(Pt, { className: "h-3.5 w-3.5 text-slate-500" }) }),
|
|
3137
3146
|
/* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: [
|
|
3138
3147
|
/* @__PURE__ */ e("span", { className: "font-mono text-[13px] font-medium text-slate-800", children: s.collection }),
|
|
3139
3148
|
s.state_field && /* @__PURE__ */ t("div", { className: "mt-0.5 text-[11px] text-slate-400", children: [
|
|
@@ -3148,7 +3157,7 @@ function Sn({
|
|
|
3148
3157
|
{
|
|
3149
3158
|
type: "checkbox",
|
|
3150
3159
|
checked: !!s.auto_start,
|
|
3151
|
-
onChange: (R) =>
|
|
3160
|
+
onChange: (R) => lt.mutate({
|
|
3152
3161
|
bindingId: s.id,
|
|
3153
3162
|
body: {
|
|
3154
3163
|
auto_start: R.target.checked,
|
|
@@ -3163,10 +3172,10 @@ function Sn({
|
|
|
3163
3172
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
|
|
3164
3173
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Owner fallback:" }),
|
|
3165
3174
|
/* @__PURE__ */ e(
|
|
3166
|
-
|
|
3175
|
+
$s,
|
|
3167
3176
|
{
|
|
3168
3177
|
value: s.owner_fallback_field ?? "",
|
|
3169
|
-
onCommit: (R) =>
|
|
3178
|
+
onCommit: (R) => lt.mutate({
|
|
3170
3179
|
bindingId: s.id,
|
|
3171
3180
|
body: { owner_fallback_field: R || null }
|
|
3172
3181
|
})
|
|
@@ -3176,10 +3185,10 @@ function Sn({
|
|
|
3176
3185
|
s.auto_start && /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: [
|
|
3177
3186
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Start in:" }),
|
|
3178
3187
|
/* @__PURE__ */ e(
|
|
3179
|
-
|
|
3188
|
+
ue,
|
|
3180
3189
|
{
|
|
3181
3190
|
value: s.auto_start_state ?? "",
|
|
3182
|
-
onChange: (R) =>
|
|
3191
|
+
onChange: (R) => lt.mutate({
|
|
3183
3192
|
bindingId: s.id,
|
|
3184
3193
|
body: { auto_start: !0, auto_start_state: R || null }
|
|
3185
3194
|
}),
|
|
@@ -3200,15 +3209,15 @@ function Sn({
|
|
|
3200
3209
|
"button",
|
|
3201
3210
|
{
|
|
3202
3211
|
type: "button",
|
|
3203
|
-
onClick: () =>
|
|
3212
|
+
onClick: () => tt(ce === s.id ? null : s.id),
|
|
3204
3213
|
className: J(
|
|
3205
3214
|
"flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-[12px] font-medium transition-colors",
|
|
3206
3215
|
ce === s.id ? "bg-nvr-cyan/10 text-nvr-cyan" : "text-slate-500 hover:bg-slate-100 hover:text-slate-700"
|
|
3207
3216
|
),
|
|
3208
3217
|
"aria-label": "Configure matrix dimensions",
|
|
3209
3218
|
children: [
|
|
3210
|
-
/* @__PURE__ */ e(
|
|
3211
|
-
/* @__PURE__ */ e(
|
|
3219
|
+
/* @__PURE__ */ e(va, { className: "h-3.5 w-3.5" }),
|
|
3220
|
+
/* @__PURE__ */ e(At, { id: "dimension", children: "Dimensions" }),
|
|
3212
3221
|
(s.dimensions ?? []).length > 0 && /* @__PURE__ */ t("span", { className: "font-mono text-[10px] opacity-70", children: [
|
|
3213
3222
|
"(",
|
|
3214
3223
|
(C = s.dimensions) == null ? void 0 : C.length,
|
|
@@ -3220,28 +3229,28 @@ function Sn({
|
|
|
3220
3229
|
/* @__PURE__ */ e(
|
|
3221
3230
|
De,
|
|
3222
3231
|
{
|
|
3223
|
-
onConfirm: () =>
|
|
3232
|
+
onConfirm: () => oa.mutate(s.id),
|
|
3224
3233
|
title: "Unbind collection",
|
|
3225
3234
|
confirmLabel: "Unbind?",
|
|
3226
3235
|
confirmTitle: `Unbind "${s.collection}"?`,
|
|
3227
3236
|
className: "rounded p-1.5 text-slate-400 hover:text-red-500 transition-colors",
|
|
3228
3237
|
armedClassName: Le,
|
|
3229
|
-
children: /* @__PURE__ */ e(
|
|
3238
|
+
children: /* @__PURE__ */ e(Na, { className: "h-3.5 w-3.5" })
|
|
3230
3239
|
}
|
|
3231
3240
|
)
|
|
3232
3241
|
] })
|
|
3233
3242
|
] }),
|
|
3234
|
-
ce === s.id && /* @__PURE__ */ e(
|
|
3243
|
+
ce === s.id && /* @__PURE__ */ e(ks, { binding: s, templateId: a })
|
|
3235
3244
|
] }, s.id);
|
|
3236
3245
|
}) }),
|
|
3237
3246
|
/* @__PURE__ */ t("div", { className: "space-y-2 pt-2", children: [
|
|
3238
3247
|
/* @__PURE__ */ t("div", { className: "flex gap-2", children: [
|
|
3239
3248
|
/* @__PURE__ */ e(
|
|
3240
|
-
|
|
3249
|
+
ue,
|
|
3241
3250
|
{
|
|
3242
3251
|
value: y,
|
|
3243
3252
|
onChange: i,
|
|
3244
|
-
options:
|
|
3253
|
+
options: ha.map((s) => ({
|
|
3245
3254
|
value: s.collection,
|
|
3246
3255
|
label: s.display_name ?? s.collection
|
|
3247
3256
|
})),
|
|
@@ -3250,7 +3259,7 @@ function Sn({
|
|
|
3250
3259
|
}
|
|
3251
3260
|
),
|
|
3252
3261
|
/* @__PURE__ */ e(
|
|
3253
|
-
|
|
3262
|
+
ue,
|
|
3254
3263
|
{
|
|
3255
3264
|
value: _,
|
|
3256
3265
|
onChange: E,
|
|
@@ -3270,13 +3279,13 @@ function Sn({
|
|
|
3270
3279
|
size: "sm",
|
|
3271
3280
|
variant: "outline",
|
|
3272
3281
|
className: "shrink-0 gap-1.5",
|
|
3273
|
-
disabled: !y ||
|
|
3274
|
-
onClick: () =>
|
|
3282
|
+
disabled: !y || Ct.isPending,
|
|
3283
|
+
onClick: () => Ct.mutate({
|
|
3275
3284
|
collection: y,
|
|
3276
3285
|
state_field: _.trim() || void 0
|
|
3277
3286
|
}),
|
|
3278
3287
|
children: [
|
|
3279
|
-
/* @__PURE__ */ e(
|
|
3288
|
+
/* @__PURE__ */ e(Pt, { className: "h-3.5 w-3.5" }),
|
|
3280
3289
|
"Bind"
|
|
3281
3290
|
]
|
|
3282
3291
|
}
|
|
@@ -3288,45 +3297,52 @@ function Sn({
|
|
|
3288
3297
|
] })
|
|
3289
3298
|
] })
|
|
3290
3299
|
] }),
|
|
3291
|
-
!o.has("matrix") &&
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
!o.has("
|
|
3322
|
-
!o.has("
|
|
3323
|
-
!o.has("
|
|
3324
|
-
!o.has("
|
|
3325
|
-
!o.has("
|
|
3300
|
+
!o.has("matrix") && pa && /* @__PURE__ */ t(
|
|
3301
|
+
"div",
|
|
3302
|
+
{
|
|
3303
|
+
id: "owner-matrix",
|
|
3304
|
+
className: "scroll-mt-4 rounded-xl border border-slate-200 bg-white p-6 space-y-4",
|
|
3305
|
+
children: [
|
|
3306
|
+
/* @__PURE__ */ t("div", { className: "flex items-start justify-between gap-4", children: [
|
|
3307
|
+
/* @__PURE__ */ t("h2", { className: "text-[13px] font-semibold text-slate-800", children: [
|
|
3308
|
+
/* @__PURE__ */ e(At, { id: "owner-matrix", children: "Owner Matrix" }),
|
|
3309
|
+
/* @__PURE__ */ e("span", { className: "mt-0.5 block max-w-[72ch] text-[12px] font-normal text-slate-500", children: "Who is responsible in each state, per dimension value. Records resolve their owners from this grid automatically — notifications, queues, and SLAs follow it." })
|
|
3310
|
+
] }),
|
|
3311
|
+
/* @__PURE__ */ t(
|
|
3312
|
+
T,
|
|
3313
|
+
{
|
|
3314
|
+
size: "sm",
|
|
3315
|
+
variant: "outline",
|
|
3316
|
+
className: "h-7 shrink-0 gap-1.5 text-[12px]",
|
|
3317
|
+
onClick: () => M(!0),
|
|
3318
|
+
children: [
|
|
3319
|
+
/* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
|
|
3320
|
+
" Manage teams"
|
|
3321
|
+
]
|
|
3322
|
+
}
|
|
3323
|
+
)
|
|
3324
|
+
] }),
|
|
3325
|
+
/* @__PURE__ */ e(Va, { templateId: a, states: rt, bindings: he })
|
|
3326
|
+
]
|
|
3327
|
+
}
|
|
3328
|
+
),
|
|
3329
|
+
L && /* @__PURE__ */ e(zs, { onClose: () => M(!1) }),
|
|
3330
|
+
!o.has("simulator") && /* @__PURE__ */ e(Rs, { bindings: he }),
|
|
3331
|
+
!o.has("canvas") && /* @__PURE__ */ e(js, { templateId: a }),
|
|
3332
|
+
!o.has("flow-map") && /* @__PURE__ */ e(Ms, { templateId: a }),
|
|
3333
|
+
!o.has("cumulative-flow") && /* @__PURE__ */ e(ja, { templateId: a }),
|
|
3334
|
+
!o.has("replay") && /* @__PURE__ */ e(Ks, { templateId: a }),
|
|
3335
|
+
!o.has("migration") && /* @__PURE__ */ e(Ls, { templateId: a }),
|
|
3336
|
+
!o.has("lint") && /* @__PURE__ */ e(Ya, { templateId: a }),
|
|
3337
|
+
!o.has("coverage") && /* @__PURE__ */ e(Ds, { templateId: a, states: re }),
|
|
3338
|
+
!o.has("skip-report") && /* @__PURE__ */ e(Ga, { templateId: a }),
|
|
3339
|
+
!o.has("ai-review") && /* @__PURE__ */ e(_s, { templateId: a }),
|
|
3340
|
+
!o.has("versions") && /* @__PURE__ */ e(Cs, { templateId: a }),
|
|
3341
|
+
!o.has("matrix-versions") && /* @__PURE__ */ e(Ha, { templateId: a })
|
|
3326
3342
|
] })
|
|
3327
3343
|
] });
|
|
3328
3344
|
}
|
|
3329
|
-
function
|
|
3345
|
+
function _s({ templateId: a }) {
|
|
3330
3346
|
const n = Z(), [c, g] = $(
|
|
3331
3347
|
null
|
|
3332
3348
|
), l = j({
|
|
@@ -3369,14 +3385,14 @@ function Ns({ templateId: a }) {
|
|
|
3369
3385
|
] })
|
|
3370
3386
|
] });
|
|
3371
3387
|
}
|
|
3372
|
-
function
|
|
3373
|
-
const n = Z(), c = ke(), [g, l] = $(null), [x, o] = $(null), { data: r, isFetching: h } =
|
|
3388
|
+
function Cs({ templateId: a }) {
|
|
3389
|
+
const n = Z(), c = ke(), [g, l] = $(null), [x, o] = $(null), { data: r, isFetching: h } = V({
|
|
3374
3390
|
queryKey: ["pipeline-version-diff", a, x],
|
|
3375
|
-
queryFn: () => n.request(
|
|
3391
|
+
queryFn: () => n.request(H(`/pipelines/${a}/versions/${x}/diff`)).then((N) => N.data),
|
|
3376
3392
|
enabled: x != null
|
|
3377
|
-
}), { data: v, isLoading: u } =
|
|
3393
|
+
}), { data: v, isLoading: u } = V({
|
|
3378
3394
|
queryKey: ["pipeline-versions", a],
|
|
3379
|
-
queryFn: () => n.request(
|
|
3395
|
+
queryFn: () => n.request(H(`/pipelines/${a}/versions`)).then((N) => N.data)
|
|
3380
3396
|
}), d = j({
|
|
3381
3397
|
mutationFn: (N) => n.request(I(`/pipelines/${a}/versions/${N}/restore`)),
|
|
3382
3398
|
onSuccess: (N) => {
|
|
@@ -3391,7 +3407,7 @@ function ws({ templateId: a }) {
|
|
|
3391
3407
|
});
|
|
3392
3408
|
return /* @__PURE__ */ t("div", { className: "rounded-xl border border-slate-200 bg-white p-6 space-y-3", children: [
|
|
3393
3409
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
3394
|
-
/* @__PURE__ */ e(
|
|
3410
|
+
/* @__PURE__ */ e(_a, { className: "h-4 w-4 text-slate-400" }),
|
|
3395
3411
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-semibold text-slate-800", children: "Config versions" }),
|
|
3396
3412
|
v && v.length > 0 && /* @__PURE__ */ e("span", { className: "ml-auto rounded-full bg-slate-100 px-2 py-0.5 text-[10px] font-semibold text-slate-500 dark:bg-muted dark:text-muted-foreground", children: v.length })
|
|
3397
3413
|
] }),
|
|
@@ -3409,7 +3425,7 @@ function ws({ templateId: a }) {
|
|
|
3409
3425
|
N.note ?? "—",
|
|
3410
3426
|
(m = N.created_by_name) != null && m.trim() ? ` · ${N.created_by_name}` : ""
|
|
3411
3427
|
] }),
|
|
3412
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10.5px] text-slate-400", children:
|
|
3428
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: Ta(N.created_at) }),
|
|
3413
3429
|
g === N.id ? /* @__PURE__ */ t("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
3414
3430
|
/* @__PURE__ */ e(
|
|
3415
3431
|
T,
|
|
@@ -3454,16 +3470,16 @@ function ws({ templateId: a }) {
|
|
|
3454
3470
|
] })
|
|
3455
3471
|
] }, N.id);
|
|
3456
3472
|
}) }),
|
|
3457
|
-
x != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: h ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : r ? /* @__PURE__ */ e(
|
|
3473
|
+
x != null && /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 p-3 dark:border-border dark:bg-muted/30", children: h ? /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Comparing…" }) : r ? /* @__PURE__ */ e(Ss, { fromVersion: r.from_version, to: r.to, diff: r.diff }) : /* @__PURE__ */ e("p", { className: "text-[11.5px] text-slate-400", children: "Could not load the diff." }) }),
|
|
3458
3474
|
/* @__PURE__ */ e("p", { className: "text-[10.5px] text-slate-400", children: "Restore snapshots the current config first, then upserts states/transitions/bindings by id — states are never deleted, and transitions with execution history are kept." })
|
|
3459
3475
|
] });
|
|
3460
3476
|
}
|
|
3461
|
-
function
|
|
3477
|
+
function Ve(a) {
|
|
3462
3478
|
if (a == null || a === "") return "(empty)";
|
|
3463
3479
|
const n = typeof a == "string" ? a : JSON.stringify(a);
|
|
3464
3480
|
return n.length > 80 ? `${n.slice(0, 80)}…` : n;
|
|
3465
3481
|
}
|
|
3466
|
-
function
|
|
3482
|
+
function Ss({
|
|
3467
3483
|
fromVersion: a,
|
|
3468
3484
|
to: n,
|
|
3469
3485
|
diff: c
|
|
@@ -3491,10 +3507,10 @@ function ks({
|
|
|
3491
3507
|
/* @__PURE__ */ e("span", { className: "font-mono", children: x.field }),
|
|
3492
3508
|
":",
|
|
3493
3509
|
" ",
|
|
3494
|
-
/* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children:
|
|
3510
|
+
/* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Ve(x.from) }),
|
|
3495
3511
|
" ",
|
|
3496
3512
|
"→ ",
|
|
3497
|
-
/* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children:
|
|
3513
|
+
/* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Ve(x.to) })
|
|
3498
3514
|
]
|
|
3499
3515
|
},
|
|
3500
3516
|
x.field
|
|
@@ -3534,11 +3550,11 @@ function ks({
|
|
|
3534
3550
|
/* @__PURE__ */ e("span", { className: "font-mono", children: h.field }),
|
|
3535
3551
|
":",
|
|
3536
3552
|
" ",
|
|
3537
|
-
/* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children:
|
|
3553
|
+
/* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: Ve(h.from) }),
|
|
3538
3554
|
" ",
|
|
3539
3555
|
"→",
|
|
3540
3556
|
" ",
|
|
3541
|
-
/* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children:
|
|
3557
|
+
/* @__PURE__ */ e("span", { className: "text-emerald-700 dark:text-emerald-400", children: Ve(h.to) })
|
|
3542
3558
|
]
|
|
3543
3559
|
},
|
|
3544
3560
|
h.field
|
|
@@ -3548,13 +3564,13 @@ function ks({
|
|
|
3548
3564
|
)
|
|
3549
3565
|
] });
|
|
3550
3566
|
}
|
|
3551
|
-
function
|
|
3567
|
+
function ea(a, n) {
|
|
3552
3568
|
return a.filter((c) => !c.is_terminal && !n.includes(c.key)).map((c) => ({ value: c.key, label: c.label }));
|
|
3553
3569
|
}
|
|
3554
|
-
function
|
|
3570
|
+
function qs(a) {
|
|
3555
3571
|
return a ? `Runs only while the record is in ${a}, by that step's owners or an administrator.` : "No starting step: only an administrator can run this split.";
|
|
3556
3572
|
}
|
|
3557
|
-
function
|
|
3573
|
+
function et({
|
|
3558
3574
|
state: a,
|
|
3559
3575
|
selected: n,
|
|
3560
3576
|
onClick: c
|
|
@@ -3570,9 +3586,9 @@ function Xe({
|
|
|
3570
3586
|
a.label
|
|
3571
3587
|
] }) : /* @__PURE__ */ e("span", { className: g, style: l, children: a.label });
|
|
3572
3588
|
}
|
|
3573
|
-
function
|
|
3589
|
+
function $s({ value: a, onCommit: n }) {
|
|
3574
3590
|
const [c, g] = $(a);
|
|
3575
|
-
return
|
|
3591
|
+
return pe(() => g(a), [a]), /* @__PURE__ */ e(
|
|
3576
3592
|
"input",
|
|
3577
3593
|
{
|
|
3578
3594
|
value: c,
|
|
@@ -3589,7 +3605,7 @@ function Cs({ value: a, onCommit: n }) {
|
|
|
3589
3605
|
}
|
|
3590
3606
|
);
|
|
3591
3607
|
}
|
|
3592
|
-
function
|
|
3608
|
+
function Fs({
|
|
3593
3609
|
states: a,
|
|
3594
3610
|
saving: n,
|
|
3595
3611
|
onSave: c,
|
|
@@ -3618,11 +3634,11 @@ function Ss({
|
|
|
3618
3634
|
/* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(the step the record must be in to split)" })
|
|
3619
3635
|
] }),
|
|
3620
3636
|
/* @__PURE__ */ e(
|
|
3621
|
-
|
|
3637
|
+
ue,
|
|
3622
3638
|
{
|
|
3623
3639
|
value: u,
|
|
3624
3640
|
onChange: d,
|
|
3625
|
-
options:
|
|
3641
|
+
options: ea(a, o),
|
|
3626
3642
|
noneLabel: "No starting step",
|
|
3627
3643
|
placeholder: "No starting step",
|
|
3628
3644
|
className: "max-w-xs"
|
|
@@ -3635,7 +3651,7 @@ function Ss({
|
|
|
3635
3651
|
"text-[11px]",
|
|
3636
3652
|
u ? "text-slate-500" : "text-amber-700 dark:text-amber-400"
|
|
3637
3653
|
),
|
|
3638
|
-
children:
|
|
3654
|
+
children: qs(m)
|
|
3639
3655
|
}
|
|
3640
3656
|
)
|
|
3641
3657
|
] }),
|
|
@@ -3645,7 +3661,7 @@ function Ss({
|
|
|
3645
3661
|
/* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(pick 2 or more — the record enters ALL of them at once)" })
|
|
3646
3662
|
] }),
|
|
3647
3663
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: a.map((p) => /* @__PURE__ */ e(
|
|
3648
|
-
|
|
3664
|
+
et,
|
|
3649
3665
|
{
|
|
3650
3666
|
state: p,
|
|
3651
3667
|
selected: o.includes(p.key),
|
|
@@ -3660,7 +3676,7 @@ function Ss({
|
|
|
3660
3676
|
/* @__PURE__ */ e("span", { className: "ml-1.5 font-normal text-slate-400", children: "(auto-entered when every branch reaches a terminal state)" })
|
|
3661
3677
|
] }),
|
|
3662
3678
|
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: a.filter((p) => !o.includes(p.key)).map((p) => /* @__PURE__ */ e(
|
|
3663
|
-
|
|
3679
|
+
et,
|
|
3664
3680
|
{
|
|
3665
3681
|
state: p,
|
|
3666
3682
|
selected: h === p.key,
|
|
@@ -3690,7 +3706,7 @@ function Ss({
|
|
|
3690
3706
|
] })
|
|
3691
3707
|
] });
|
|
3692
3708
|
}
|
|
3693
|
-
function
|
|
3709
|
+
function Es({
|
|
3694
3710
|
split: a,
|
|
3695
3711
|
states: n,
|
|
3696
3712
|
saving: c,
|
|
@@ -3700,13 +3716,13 @@ function qs({
|
|
|
3700
3716
|
return /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3701
3717
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-500", children: "Starts from" }),
|
|
3702
3718
|
/* @__PURE__ */ e(
|
|
3703
|
-
|
|
3719
|
+
ue,
|
|
3704
3720
|
{
|
|
3705
3721
|
value: l,
|
|
3706
3722
|
onChange: (o) => {
|
|
3707
3723
|
o !== l && g(o || null);
|
|
3708
3724
|
},
|
|
3709
|
-
options:
|
|
3725
|
+
options: ea(n, a.branch_states),
|
|
3710
3726
|
noneLabel: "No starting step",
|
|
3711
3727
|
placeholder: "No starting step",
|
|
3712
3728
|
className: "h-7 w-56"
|
|
@@ -3729,13 +3745,13 @@ function qs({
|
|
|
3729
3745
|
)
|
|
3730
3746
|
] });
|
|
3731
3747
|
}
|
|
3732
|
-
function
|
|
3748
|
+
function Os({
|
|
3733
3749
|
templateId: a,
|
|
3734
3750
|
states: n
|
|
3735
3751
|
}) {
|
|
3736
|
-
const c = Z(), g = ke(), [l, x] = $(!1), [o, r] = $(null), h = ["workflow-splits", a], { data: v } =
|
|
3752
|
+
const c = Z(), g = ke(), [l, x] = $(!1), [o, r] = $(null), h = ["workflow-splits", a], { data: v } = V({
|
|
3737
3753
|
queryKey: h,
|
|
3738
|
-
queryFn: () => c.request(
|
|
3754
|
+
queryFn: () => c.request(H(`/workflows/templates/${a}/splits`)).then((f) => f.data)
|
|
3739
3755
|
}), u = () => g.invalidateQueries({ queryKey: h }), d = j({
|
|
3740
3756
|
mutationFn: (f) => c.request(I(`/workflows/templates/${a}/splits`, f)),
|
|
3741
3757
|
onSuccess: () => {
|
|
@@ -3769,7 +3785,7 @@ function $s({
|
|
|
3769
3785
|
/* @__PURE__ */ t("div", { className: "flex items-start justify-between gap-4", children: [
|
|
3770
3786
|
/* @__PURE__ */ t("h2", { className: "flex-1 text-[13px] font-semibold text-slate-800", children: [
|
|
3771
3787
|
/* @__PURE__ */ t("span", { className: "flex items-center gap-2", children: [
|
|
3772
|
-
/* @__PURE__ */ e(
|
|
3788
|
+
/* @__PURE__ */ e(ka, { className: "h-4 w-4 text-slate-400" }),
|
|
3773
3789
|
"Parallel Branches",
|
|
3774
3790
|
/* @__PURE__ */ e("span", { className: "font-mono text-[11px] font-normal text-slate-400", children: (v == null ? void 0 : v.length) ?? 0 })
|
|
3775
3791
|
] }),
|
|
@@ -3802,7 +3818,7 @@ function $s({
|
|
|
3802
3818
|
/* @__PURE__ */ t("div", { className: "min-w-0 flex-1 space-y-1.5", children: [
|
|
3803
3819
|
/* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-700", children: f.label }),
|
|
3804
3820
|
/* @__PURE__ */ e(
|
|
3805
|
-
|
|
3821
|
+
Es,
|
|
3806
3822
|
{
|
|
3807
3823
|
split: f,
|
|
3808
3824
|
states: n,
|
|
@@ -3811,9 +3827,9 @@ function $s({
|
|
|
3811
3827
|
}
|
|
3812
3828
|
),
|
|
3813
3829
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
3814
|
-
f.branch_state_objs.map((p) => /* @__PURE__ */ e(
|
|
3815
|
-
/* @__PURE__ */ e(
|
|
3816
|
-
f.join_state_obj ? /* @__PURE__ */ e(
|
|
3830
|
+
f.branch_state_objs.map((p) => /* @__PURE__ */ e(et, { state: p }, p.id)),
|
|
3831
|
+
/* @__PURE__ */ e(Gt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
|
|
3832
|
+
f.join_state_obj ? /* @__PURE__ */ e(et, { state: f.join_state_obj }) : /* @__PURE__ */ e("span", { className: "text-[12px] italic text-slate-400", children: "missing join state" })
|
|
3817
3833
|
] })
|
|
3818
3834
|
] }),
|
|
3819
3835
|
o === f.id ? /* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
@@ -3854,7 +3870,7 @@ function $s({
|
|
|
3854
3870
|
);
|
|
3855
3871
|
}),
|
|
3856
3872
|
l && /* @__PURE__ */ e(
|
|
3857
|
-
|
|
3873
|
+
Fs,
|
|
3858
3874
|
{
|
|
3859
3875
|
states: n,
|
|
3860
3876
|
saving: d.isPending,
|
|
@@ -3864,7 +3880,7 @@ function $s({
|
|
|
3864
3880
|
)
|
|
3865
3881
|
] });
|
|
3866
3882
|
}
|
|
3867
|
-
function
|
|
3883
|
+
function Rs({ bindings: a }) {
|
|
3868
3884
|
var v;
|
|
3869
3885
|
const n = Z(), [c, g] = $(""), [l, x] = $(""), o = l || ((v = a[0]) == null ? void 0 : v.collection) || "", r = j({
|
|
3870
3886
|
mutationFn: () => n.request(I("/pipelines/simulate", { collection: o, item_id: c.trim() })).then((u) => u.data),
|
|
@@ -3980,14 +3996,14 @@ function Fs({ bindings: a }) {
|
|
|
3980
3996
|
] });
|
|
3981
3997
|
}
|
|
3982
3998
|
const Te = 900, ge = 230;
|
|
3983
|
-
function
|
|
3999
|
+
function ta({
|
|
3984
4000
|
selected: a,
|
|
3985
4001
|
onChange: n
|
|
3986
4002
|
}) {
|
|
3987
|
-
const c = Z(), [g, l] = $(""), { data: x, isFetching: o } =
|
|
4003
|
+
const c = Z(), [g, l] = $(""), { data: x, isFetching: o } = V({
|
|
3988
4004
|
queryKey: ["coverage-people", g],
|
|
3989
4005
|
queryFn: () => c.request(
|
|
3990
|
-
|
|
4006
|
+
H("/users", { limit: 50, sort: "first_name", search: g || void 0 })
|
|
3991
4007
|
).then((d) => d.data),
|
|
3992
4008
|
staleTime: 6e4
|
|
3993
4009
|
}), r = new Set(a.map((d) => d.id)), h = (d) => [d.first_name, d.last_name].filter(Boolean).join(" ") || d.email, v = (d) => [d.title, d.department].filter(Boolean).join(" · ") || d.email, u = [...x ?? []].sort(
|
|
@@ -4059,21 +4075,21 @@ function Xt({
|
|
|
4059
4075
|
] })
|
|
4060
4076
|
] });
|
|
4061
4077
|
}
|
|
4062
|
-
function
|
|
4078
|
+
function Ts({
|
|
4063
4079
|
templateId: a,
|
|
4064
4080
|
cluster: n,
|
|
4065
4081
|
onDone: c
|
|
4066
4082
|
}) {
|
|
4067
4083
|
var w, k;
|
|
4068
|
-
const g = Z(), l = ke(), x = !!((w = n.suggestion) != null && w.group_id) && n.suggestion.mismatched_filters.length === 0, o = Object.values(n.dims).filter(Boolean).join(" · ") || "New group", [r, h] = $(o), [v, u] = $([]), [d, N] = $([]), m =
|
|
4084
|
+
const g = Z(), l = ke(), x = !!((w = n.suggestion) != null && w.group_id) && n.suggestion.mismatched_filters.length === 0, o = Object.values(n.dims).filter(Boolean).join(" · ") || "New group", [r, h] = $(o), [v, u] = $([]), [d, N] = $([]), m = ts(), { data: f } = V({
|
|
4069
4085
|
queryKey: ["user-groups-teams"],
|
|
4070
|
-
queryFn: () => g.request(
|
|
4086
|
+
queryFn: () => g.request(H("/user-groups")).then((S) => S.data),
|
|
4071
4087
|
staleTime: 6e4
|
|
4072
4088
|
}), b = (f ?? []).map((S) => ({
|
|
4073
4089
|
...S,
|
|
4074
|
-
rank:
|
|
4090
|
+
rank: as(S.scopes, n.filters, m, n.collection)
|
|
4075
4091
|
})).sort(
|
|
4076
|
-
(S, D) =>
|
|
4092
|
+
(S, D) => Lt(S.rank.tier) - Lt(D.rank.tier) || S.name.localeCompare(D.name, void 0, { sensitivity: "base" })
|
|
4077
4093
|
), p = j({
|
|
4078
4094
|
mutationFn: async () => {
|
|
4079
4095
|
var D;
|
|
@@ -4151,7 +4167,7 @@ function Es({
|
|
|
4151
4167
|
);
|
|
4152
4168
|
})
|
|
4153
4169
|
] }),
|
|
4154
|
-
/* @__PURE__ */ e(
|
|
4170
|
+
/* @__PURE__ */ e(ta, { selected: v, onChange: u }),
|
|
4155
4171
|
/* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-1.5", children: [
|
|
4156
4172
|
/* @__PURE__ */ e(T, { size: "sm", variant: "ghost", className: "h-6 px-2 text-[11px]", onClick: c, children: "Cancel" }),
|
|
4157
4173
|
/* @__PURE__ */ e(
|
|
@@ -4167,7 +4183,7 @@ function Es({
|
|
|
4167
4183
|
] })
|
|
4168
4184
|
] });
|
|
4169
4185
|
}
|
|
4170
|
-
function
|
|
4186
|
+
function Ps({ templateId: a, finding: n }) {
|
|
4171
4187
|
const c = Z(), g = ke(), [l, x] = $(
|
|
4172
4188
|
"idle"
|
|
4173
4189
|
), [o, r] = $([]), h = (p) => {
|
|
@@ -4335,7 +4351,7 @@ function Os({ templateId: a, finding: n }) {
|
|
|
4335
4351
|
)
|
|
4336
4352
|
] }),
|
|
4337
4353
|
l === "add-member" && /* @__PURE__ */ t("div", { className: "mt-2 ml-2 space-y-2 rounded-md border border-slate-200 bg-slate-50/60 p-2.5 dark:border-border dark:bg-muted/20", children: [
|
|
4338
|
-
/* @__PURE__ */ e(
|
|
4354
|
+
/* @__PURE__ */ e(ta, { selected: o, onChange: r }),
|
|
4339
4355
|
/* @__PURE__ */ t("div", { className: "flex items-center justify-end gap-1.5", children: [
|
|
4340
4356
|
/* @__PURE__ */ e(
|
|
4341
4357
|
T,
|
|
@@ -4363,19 +4379,19 @@ function Os({ templateId: a, finding: n }) {
|
|
|
4363
4379
|
] })
|
|
4364
4380
|
] });
|
|
4365
4381
|
}
|
|
4366
|
-
function
|
|
4382
|
+
function Ds({
|
|
4367
4383
|
templateId: a,
|
|
4368
4384
|
states: n
|
|
4369
4385
|
}) {
|
|
4370
|
-
const c = Z(), g = ke(), [l, x] = $(!1), [o, r] = $(!1), [h, v] = $(null), { data: u, isFetching: d, refetch: N } =
|
|
4386
|
+
const c = Z(), g = ke(), [l, x] = $(!1), [o, r] = $(!1), [h, v] = $(null), { data: u, isFetching: d, refetch: N } = V({
|
|
4371
4387
|
queryKey: ["owner-gaps", a],
|
|
4372
|
-
queryFn: () => c.request(
|
|
4388
|
+
queryFn: () => c.request(H(`/pipelines/${a}/owner-gaps`)).then((y) => y.data),
|
|
4373
4389
|
enabled: l,
|
|
4374
4390
|
staleTime: 5 * 6e4
|
|
4375
|
-
}), { data: m } =
|
|
4391
|
+
}), { data: m } = V({
|
|
4376
4392
|
queryKey: ["owner-lint", a],
|
|
4377
4393
|
queryFn: () => c.request(
|
|
4378
|
-
|
|
4394
|
+
H(`/pipelines/${a}/owner-lint`)
|
|
4379
4395
|
).then((y) => y.data),
|
|
4380
4396
|
enabled: l,
|
|
4381
4397
|
staleTime: 5 * 6e4
|
|
@@ -4402,7 +4418,7 @@ function Rs({
|
|
|
4402
4418
|
{
|
|
4403
4419
|
className: "inline-flex items-baseline gap-1 rounded border border-slate-200 bg-slate-50 px-1.5 py-px text-[10.5px] dark:border-border dark:bg-muted/40",
|
|
4404
4420
|
children: [
|
|
4405
|
-
/* @__PURE__ */ e("span", { className: "text-slate-400", children:
|
|
4421
|
+
/* @__PURE__ */ e("span", { className: "text-slate-400", children: sa(y) }),
|
|
4406
4422
|
/* @__PURE__ */ e("span", { className: "font-medium text-slate-700 dark:text-foreground", children: i })
|
|
4407
4423
|
]
|
|
4408
4424
|
},
|
|
@@ -4565,7 +4581,7 @@ function Rs({
|
|
|
4565
4581
|
style: { backgroundColor: (_ == null ? void 0 : _.color) ?? "#94a3b8" }
|
|
4566
4582
|
}
|
|
4567
4583
|
),
|
|
4568
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-foreground", children: (_ == null ? void 0 : _.label) ??
|
|
4584
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-foreground", children: (_ == null ? void 0 : _.label) ?? aa(y) }),
|
|
4569
4585
|
/* @__PURE__ */ t("span", { className: "ml-auto text-[11px] tabular-nums text-slate-400", children: [
|
|
4570
4586
|
E,
|
|
4571
4587
|
" record",
|
|
@@ -4620,7 +4636,7 @@ function Rs({
|
|
|
4620
4636
|
" ",
|
|
4621
4637
|
"already matches",
|
|
4622
4638
|
" ",
|
|
4623
|
-
|
|
4639
|
+
Ut(
|
|
4624
4640
|
F.suggestion.matched_labels,
|
|
4625
4641
|
F.suggestion.matched_filters
|
|
4626
4642
|
) || "nothing"
|
|
@@ -4629,7 +4645,7 @@ function Rs({
|
|
|
4629
4645
|
" ",
|
|
4630
4646
|
"— it misses",
|
|
4631
4647
|
" ",
|
|
4632
|
-
|
|
4648
|
+
Ut(
|
|
4633
4649
|
F.suggestion.missing_labels,
|
|
4634
4650
|
F.suggestion.mismatched_filters
|
|
4635
4651
|
),
|
|
@@ -4640,7 +4656,7 @@ function Rs({
|
|
|
4640
4656
|
"No group comes close — assigning creates one for this combination."
|
|
4641
4657
|
] }) }),
|
|
4642
4658
|
h === L && /* @__PURE__ */ e(
|
|
4643
|
-
|
|
4659
|
+
Ts,
|
|
4644
4660
|
{
|
|
4645
4661
|
templateId: a,
|
|
4646
4662
|
cluster: F,
|
|
@@ -4670,37 +4686,37 @@ function Rs({
|
|
|
4670
4686
|
] }),
|
|
4671
4687
|
/* @__PURE__ */ e("div", { className: "max-h-96 divide-y divide-slate-100 overflow-y-auto px-3 dark:divide-border/60", children: w.map((y, i) => (
|
|
4672
4688
|
// biome-ignore lint/suspicious/noArrayIndexKey: findings are positional
|
|
4673
|
-
/* @__PURE__ */ e(
|
|
4689
|
+
/* @__PURE__ */ e(Ps, { templateId: a, finding: y }, i)
|
|
4674
4690
|
)) })
|
|
4675
4691
|
] })
|
|
4676
4692
|
] })
|
|
4677
4693
|
] });
|
|
4678
4694
|
}
|
|
4679
|
-
function
|
|
4695
|
+
function aa(a) {
|
|
4680
4696
|
return a.replace(/[_-]+/g, " ").replace(/\b\w/g, (n) => n.toUpperCase());
|
|
4681
4697
|
}
|
|
4682
|
-
function
|
|
4698
|
+
function sa(a) {
|
|
4683
4699
|
const n = a.split(".");
|
|
4684
4700
|
for (; n.length > 1 && /^((short_)?name|label|key|id|.*_id)$/i.test(n[n.length - 1]); )
|
|
4685
4701
|
n.pop();
|
|
4686
4702
|
const c = n[n.length - 1].replace(/s$/i, "");
|
|
4687
|
-
return
|
|
4703
|
+
return aa(c);
|
|
4688
4704
|
}
|
|
4689
|
-
function
|
|
4690
|
-
return a.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (n) =>
|
|
4705
|
+
function As(a) {
|
|
4706
|
+
return a.replace(/[a-z_]+(?:\.[a-z_]+)+/g, (n) => sa(n));
|
|
4691
4707
|
}
|
|
4692
|
-
function
|
|
4693
|
-
return Array.isArray(a) && a.length > 0 ? a.join(", ") :
|
|
4708
|
+
function Ut(a, n) {
|
|
4709
|
+
return Array.isArray(a) && a.length > 0 ? a.join(", ") : As(n.map((c) => c.replace(/ \(wants \d+\)$/, "")).join(", "));
|
|
4694
4710
|
}
|
|
4695
|
-
function
|
|
4696
|
-
const n = Z(), c = ke(), [g, l] = $(""), [x, o] = $(""), [r, h] = $(!1), { data: v } =
|
|
4711
|
+
function Ls({ templateId: a }) {
|
|
4712
|
+
const n = Z(), c = ke(), [g, l] = $(""), [x, o] = $(""), [r, h] = $(!1), { data: v } = V({
|
|
4697
4713
|
queryKey: ["instance-distribution", a],
|
|
4698
|
-
queryFn: () => n.request(
|
|
4714
|
+
queryFn: () => n.request(H(`/pipelines/${a}/instance-distribution`)),
|
|
4699
4715
|
staleTime: 3e4
|
|
4700
|
-
}), u = (v == null ? void 0 : v.data) ?? [], d = (v == null ? void 0 : v.states) ?? [], N = u.filter((k) => k.orphaned), m = u.filter((k) => String(k.state_id) === g).reduce((k, S) => k + S.count, 0), { data: f } =
|
|
4716
|
+
}), u = (v == null ? void 0 : v.data) ?? [], d = (v == null ? void 0 : v.states) ?? [], N = u.filter((k) => k.orphaned), m = u.filter((k) => String(k.state_id) === g).reduce((k, S) => k + S.count, 0), { data: f } = V({
|
|
4701
4717
|
queryKey: ["pipeline-bindings-start", a],
|
|
4702
4718
|
queryFn: () => n.request(
|
|
4703
|
-
|
|
4719
|
+
H(`/pipelines/${a}/bindings`)
|
|
4704
4720
|
)
|
|
4705
4721
|
}), b = ((f == null ? void 0 : f.data) ?? []).map((k) => k.collection), p = j({
|
|
4706
4722
|
mutationFn: (k) => n.request(
|
|
@@ -4776,9 +4792,9 @@ function Ps({ templateId: a }) {
|
|
|
4776
4792
|
m,
|
|
4777
4793
|
" instance(s) to"
|
|
4778
4794
|
] }),
|
|
4779
|
-
/* @__PURE__ */ t(
|
|
4780
|
-
/* @__PURE__ */ e(
|
|
4781
|
-
/* @__PURE__ */ e(
|
|
4795
|
+
/* @__PURE__ */ t(za, { value: x || void 0, onValueChange: o, children: [
|
|
4796
|
+
/* @__PURE__ */ e(Ba, { className: "h-8 w-[220px] text-[12.5px]", children: /* @__PURE__ */ e(Qa, { placeholder: "Pick a state…" }) }),
|
|
4797
|
+
/* @__PURE__ */ e(Ua, { children: d.filter((k) => String(k.id) !== g).map((k) => /* @__PURE__ */ e(Wa, { value: k.id, children: k.label }, k.id)) })
|
|
4782
4798
|
] }),
|
|
4783
4799
|
x && !r && /* @__PURE__ */ e(T, { size: "sm", className: "h-8 text-[12.5px]", onClick: () => h(!0), children: "Migrate…" }),
|
|
4784
4800
|
x && r && /* @__PURE__ */ t("span", { className: "flex items-center gap-2 rounded-md border border-amber-300 bg-amber-50 px-2.5 py-1 dark:border-amber-500/40 dark:bg-amber-400/10", children: [
|
|
@@ -4809,7 +4825,7 @@ function Ps({ templateId: a }) {
|
|
|
4809
4825
|
] })
|
|
4810
4826
|
] });
|
|
4811
4827
|
}
|
|
4812
|
-
function
|
|
4828
|
+
function js({ templateId: a }) {
|
|
4813
4829
|
const n = Z(), [c, g] = $(
|
|
4814
4830
|
null
|
|
4815
4831
|
), [l, x] = $(() => {
|
|
@@ -4818,12 +4834,12 @@ function Ds({ templateId: a }) {
|
|
|
4818
4834
|
} catch {
|
|
4819
4835
|
return {};
|
|
4820
4836
|
}
|
|
4821
|
-
}), o =
|
|
4837
|
+
}), o = je(null), { data: r } = V({
|
|
4822
4838
|
queryKey: ["pipeline-canvas", a],
|
|
4823
|
-
queryFn: () => n.request(
|
|
4839
|
+
queryFn: () => n.request(H(`/pipelines/${a}`)).then((i) => i.data),
|
|
4824
4840
|
staleTime: 3e4
|
|
4825
|
-
}), h = (r == null ? void 0 : r.states) ?? [], v = (r == null ? void 0 : r.transitions) ?? [], u =
|
|
4826
|
-
var
|
|
4841
|
+
}), h = (r == null ? void 0 : r.states) ?? [], v = (r == null ? void 0 : r.transitions) ?? [], u = qa(() => {
|
|
4842
|
+
var Qe;
|
|
4827
4843
|
const i = new Map(h.map((Q) => [String(Q.id).toUpperCase(), Q])), _ = /* @__PURE__ */ new Map(), E = h.filter((Q) => Q.is_initial).map((Q) => ({ id: String(Q.id).toUpperCase(), r: 0 })), F = /* @__PURE__ */ new Map();
|
|
4828
4844
|
for (const Q of v) {
|
|
4829
4845
|
if (!Q.from_state) continue;
|
|
@@ -4836,7 +4852,7 @@ function Ds({ templateId: a }) {
|
|
|
4836
4852
|
_.has(Q) || _.set(Q, X);
|
|
4837
4853
|
for (const de of F.get(Q) ?? []) {
|
|
4838
4854
|
const me = i.get(de);
|
|
4839
|
-
!_.has(de) && (((
|
|
4855
|
+
!_.has(de) && (((Qe = i.get(Q)) == null ? void 0 : Qe.sort) ?? 0) <= ((me == null ? void 0 : me.sort) ?? 0) && E.push({ id: de, r: X + 1 });
|
|
4840
4856
|
}
|
|
4841
4857
|
}
|
|
4842
4858
|
}
|
|
@@ -4856,8 +4872,8 @@ function Ds({ templateId: a }) {
|
|
|
4856
4872
|
ce = Math.max(ce, X.length), X.forEach((de, me) => {
|
|
4857
4873
|
oe.set(de, { x: 20 + Q * (M + te), y: 20 + me * (U + ae) });
|
|
4858
4874
|
});
|
|
4859
|
-
const
|
|
4860
|
-
return { pos: oe, width:
|
|
4875
|
+
const tt = 60 + (Math.max(0, ...L.keys()) + 1) * (M + te), z = 60 + ce * (U + ae);
|
|
4876
|
+
return { pos: oe, width: tt, height: z, NODE_W: M, NODE_H: U };
|
|
4861
4877
|
}, [h, v]), d = (i) => l[i] ?? u.pos.get(i) ?? { x: 20, y: 20 }, [N, m] = $(null), [f, b] = $(null), p = ke(), w = j({
|
|
4862
4878
|
mutationFn: (i) => n.request(
|
|
4863
4879
|
I(`/pipelines/${a}/transitions`, {
|
|
@@ -4988,7 +5004,7 @@ function Ds({ templateId: a }) {
|
|
|
4988
5004
|
y1: d(N).y + u.NODE_H / 2,
|
|
4989
5005
|
x2: f.x,
|
|
4990
5006
|
y2: f.y,
|
|
4991
|
-
stroke:
|
|
5007
|
+
stroke: Xt,
|
|
4992
5008
|
strokeWidth: 2,
|
|
4993
5009
|
strokeDasharray: "5 4"
|
|
4994
5010
|
}
|
|
@@ -5106,12 +5122,12 @@ function Ds({ templateId: a }) {
|
|
|
5106
5122
|
] })
|
|
5107
5123
|
] });
|
|
5108
5124
|
}
|
|
5109
|
-
function
|
|
5125
|
+
function Ms({ templateId: a }) {
|
|
5110
5126
|
var A, O;
|
|
5111
|
-
const n = Z(), [c, g] = $(90), [l, x] = $(null), { data: o } =
|
|
5127
|
+
const n = Z(), [c, g] = $(90), [l, x] = $(null), { data: o } = V({
|
|
5112
5128
|
queryKey: ["flow-map", a, c],
|
|
5113
5129
|
queryFn: () => n.request(
|
|
5114
|
-
|
|
5130
|
+
H(`/pipelines/${a}/flow-map`, { days: c })
|
|
5115
5131
|
).then((y) => y.data),
|
|
5116
5132
|
staleTime: 6e4
|
|
5117
5133
|
}), r = (o == null ? void 0 : o.states) ?? [], h = ((o == null ? void 0 : o.flows) ?? []).slice(0, 40), v = h.reduce((y, i) => y + i.count, 0), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
@@ -5169,7 +5185,7 @@ function As({ templateId: a }) {
|
|
|
5169
5185
|
"path",
|
|
5170
5186
|
{
|
|
5171
5187
|
d: y.path,
|
|
5172
|
-
fill: y.f.back ? "#ef4444" :
|
|
5188
|
+
fill: y.f.back ? "#ef4444" : Xt,
|
|
5173
5189
|
opacity: l === null ? y.f.back ? 0.45 : 0.3 : l === y.f ? 0.75 : 0.08,
|
|
5174
5190
|
onMouseEnter: () => x(y.f),
|
|
5175
5191
|
onMouseLeave: () => x(null)
|
|
@@ -5267,15 +5283,15 @@ function As({ templateId: a }) {
|
|
|
5267
5283
|
] })
|
|
5268
5284
|
] });
|
|
5269
5285
|
}
|
|
5270
|
-
function
|
|
5271
|
-
const n = Z(), [c, g] = $(90), [l, x] = $(0), [o, r] = $(!1), [h, v] = $(!0), { data: u } =
|
|
5286
|
+
function Ks({ templateId: a }) {
|
|
5287
|
+
const n = Z(), [c, g] = $(90), [l, x] = $(0), [o, r] = $(!1), [h, v] = $(!0), { data: u } = V({
|
|
5272
5288
|
queryKey: ["pipeline-replay", a, c],
|
|
5273
|
-
queryFn: () => n.request(
|
|
5289
|
+
queryFn: () => n.request(H(`/pipelines/${a}/replay`, { days: c })).then((w) => w.data),
|
|
5274
5290
|
staleTime: 5 * 6e4
|
|
5275
5291
|
}), d = (u == null ? void 0 : u.days) ?? [], N = ((u == null ? void 0 : u.states) ?? []).filter((w) => !h || !w.is_terminal);
|
|
5276
|
-
|
|
5292
|
+
pe(() => {
|
|
5277
5293
|
x(0), r(!1);
|
|
5278
|
-
}, []),
|
|
5294
|
+
}, []), pe(() => {
|
|
5279
5295
|
if (!o || d.length === 0) return;
|
|
5280
5296
|
const w = setInterval(() => {
|
|
5281
5297
|
x((k) => k + 1 >= d.length ? (r(!1), k) : k + 1);
|
|
@@ -5397,13 +5413,13 @@ function Ls({ templateId: a }) {
|
|
|
5397
5413
|
] })
|
|
5398
5414
|
] });
|
|
5399
5415
|
}
|
|
5400
|
-
function
|
|
5401
|
-
return
|
|
5416
|
+
function zs({ onClose: a }) {
|
|
5417
|
+
return pe(() => {
|
|
5402
5418
|
const n = (c) => {
|
|
5403
5419
|
c.key === "Escape" && a();
|
|
5404
5420
|
};
|
|
5405
5421
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
5406
|
-
}, [a]),
|
|
5422
|
+
}, [a]), Fa(
|
|
5407
5423
|
/* @__PURE__ */ t("div", { className: "fixed inset-0 z-[120]", children: [
|
|
5408
5424
|
/* @__PURE__ */ e(
|
|
5409
5425
|
"button",
|
|
@@ -5429,18 +5445,18 @@ function js({ onClose: a }) {
|
|
|
5429
5445
|
}
|
|
5430
5446
|
)
|
|
5431
5447
|
] }),
|
|
5432
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(
|
|
5448
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ e(es, { compact: !0 }) })
|
|
5433
5449
|
] })
|
|
5434
5450
|
] }),
|
|
5435
5451
|
document.body
|
|
5436
5452
|
);
|
|
5437
5453
|
}
|
|
5438
5454
|
export {
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5455
|
+
_s as AiReviewCard,
|
|
5456
|
+
Ds as OwnerGapsCard,
|
|
5457
|
+
En as PipelineEditorView,
|
|
5458
|
+
Rs as PipelineSimulatorCard,
|
|
5459
|
+
qs as splitStartNote,
|
|
5460
|
+
ea as splitStartOptions,
|
|
5461
|
+
Ut as suggestionList
|
|
5446
5462
|
};
|