@nivaro/react 0.3.66 → 0.3.68
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 +15 -1
- package/dist/index.js +836 -835
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +584 -585
- package/dist/shared/components/ConformanceView.js +34 -34
- package/dist/shared/components/ItemEditForm.js +1758 -1758
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/ReportView.js +196 -196
- package/dist/shared/components/SlaRulesView.js +36 -36
- package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
- package/dist/shared/components/chat/ChatPanel.js +484 -487
- package/dist/shared/components/chat/ChatViews.js +66 -66
- package/dist/shared/components/chat/RoomParts.js +159 -157
- package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
- package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
- package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/FieldRow.js +188 -188
- package/dist/shared/components/item-edit/FilePickerField.js +281 -297
- package/dist/shared/components/item-edit/GroupSection.js +209 -209
- package/dist/shared/components/item-edit/RecordInsights.js +101 -101
- package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
- package/dist/shared/components/panels/AddendumPanel.js +409 -411
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +204 -197
- package/dist/shared/components/panels/PipelinePanel.js +264 -264
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +229 -229
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +591 -589
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +18 -17
- package/dist/shared/lib/utils.js +87 -80
- package/package.json +1 -1
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var We = (t, e, r) =>
|
|
1
|
+
var fn = Object.defineProperty;
|
|
2
|
+
var hn = (t, e, r) => e in t ? fn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var We = (t, e, r) => hn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import { jsx as n, jsxs as i, Fragment as be } from "react/jsx-runtime";
|
|
5
5
|
import { useQueryClient as Re, useQuery as le, useMutation as qe } from "@tanstack/react-query";
|
|
6
|
-
import { ArrowRight as rt, Loader2 as pe, Check as je, GitBranch as ze, AlertTriangle as
|
|
7
|
-
import { useState as j, useRef as ae, useEffect as he, useMemo as
|
|
6
|
+
import { ArrowRight as rt, Loader2 as pe, Check as je, GitBranch as ze, AlertTriangle as bn, ChevronDown as _e, Send as qt, Users as Rt, Minus as gn, UserPlus as xn, X as Mt, Zap as Pt, Search as yn } from "lucide-react";
|
|
7
|
+
import { useState as j, useRef as ae, useEffect as he, useMemo as Be, Suspense as Dt, useCallback as Ft, lazy as wn } from "react";
|
|
8
8
|
import { toast as X } from "sonner";
|
|
9
|
-
import { useNivaroClient as xe, useItemEditAuth as
|
|
10
|
-
import { get as ce, post as Se, del as
|
|
11
|
-
import { errorToastOptions as
|
|
12
|
-
import { useRecordSignalWhile as
|
|
13
|
-
import { RUN_TRANSITION_EVENT as
|
|
9
|
+
import { useNivaroClient as xe, useItemEditAuth as vn } from "../../context.js";
|
|
10
|
+
import { get as ce, post as Se, del as kn } from "../../lib/commands.js";
|
|
11
|
+
import { errorToastOptions as At, toastError as Nn } from "../../lib/error-toast.js";
|
|
12
|
+
import { useRecordSignalWhile as Ot, useRecordSignalPeers as _n, signalSentence as Sn } from "../../lib/presence-signals.js";
|
|
13
|
+
import { RUN_TRANSITION_EVENT as Le } from "../../lib/run-transition.js";
|
|
14
14
|
import { userErrorMessage as Me } from "../../lib/safe-error.js";
|
|
15
|
-
import { serverNow as
|
|
16
|
-
import { userCardQuery as
|
|
17
|
-
import { cn as ge, titleCase as
|
|
18
|
-
import { PushReadinessChip as
|
|
19
|
-
import { useHeaderFold as
|
|
15
|
+
import { serverNow as Cn } from "../../lib/server-clock.js";
|
|
16
|
+
import { userCardQuery as $n } from "../../lib/user-cards.js";
|
|
17
|
+
import { cn as ge, titleCase as Tn, toLocalDateString as qn, formatRelative as at, formatDateTime as yt, humanHours as Rn } from "../../lib/utils.js";
|
|
18
|
+
import { PushReadinessChip as Mn } from "../integrations/RecordIntegrationPreview.js";
|
|
19
|
+
import { useHeaderFold as Pn } from "../item-edit/HeaderTools.js";
|
|
20
20
|
import { invalidateRecordInsights as Ee, invalidateRecordData as Pe } from "../item-edit/RecordInsights.js";
|
|
21
|
-
import { UserChip as
|
|
22
|
-
import { OwnerAvatars as
|
|
23
|
-
import { UserAvatar as
|
|
21
|
+
import { UserChip as Ut } from "../item-edit/UserChip.js";
|
|
22
|
+
import { OwnerAvatars as Dn } from "../queue/OwnerAvatars.js";
|
|
23
|
+
import { UserAvatar as Fn } from "../UserAvatar.js";
|
|
24
24
|
import { Button as re } from "../ui/button.js";
|
|
25
|
-
import { DropdownMenu as Ve, DropdownMenuTrigger as Xe, DropdownMenuContent as Ye, DropdownMenuGroup as
|
|
25
|
+
import { DropdownMenu as Ve, DropdownMenuTrigger as Xe, DropdownMenuContent as Ye, DropdownMenuGroup as wt, DropdownMenuSeparator as vt, DropdownMenuItem as Oe, DropdownMenuLabel as An } from "../ui/dropdown-menu.js";
|
|
26
26
|
import { Popover as st, PopoverTrigger as it, PopoverContent as lt } from "../ui/popover.js";
|
|
27
27
|
import { Skeleton as we } from "../ui/skeleton.js";
|
|
28
|
-
import { TooltipProvider as
|
|
29
|
-
import { isAccessRefusal as Lt, deniedToastAction as
|
|
30
|
-
import { BranchLanes as
|
|
31
|
-
import { landingState as
|
|
32
|
-
import { SlaClockLine as
|
|
33
|
-
const
|
|
28
|
+
import { TooltipProvider as Bt, Tooltip as Je, TooltipTrigger as Ze, TooltipContent as et } from "../ui/tooltip.js";
|
|
29
|
+
import { isAccessRefusal as Lt, deniedToastAction as Et, WhyOwnersButton as On } from "./AccessInsights.js";
|
|
30
|
+
import { BranchLanes as Un } from "./BranchLanes.js";
|
|
31
|
+
import { landingState as Bn, landingSkipGroups as Ln, joinLabels as kt } from "./landing-state.js";
|
|
32
|
+
import { SlaClockLine as En } from "./SlaClock.js";
|
|
33
|
+
const jt = wn(
|
|
34
34
|
() => import("./TransitionRequirementsDialog.js").then((t) => ({
|
|
35
35
|
default: t.TransitionRequirementsDialog
|
|
36
36
|
}))
|
|
@@ -39,7 +39,7 @@ function ot(t, e) {
|
|
|
39
39
|
const r = t || "System";
|
|
40
40
|
return e.on_behalf_of_name ? `${r}, for ${e.on_behalf_of_name}` : r;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function jn(t) {
|
|
43
43
|
if (t.transition) return null;
|
|
44
44
|
const e = (t.comment ?? "").trim();
|
|
45
45
|
if (!e.startsWith("{")) return null;
|
|
@@ -66,7 +66,7 @@ function nt(t) {
|
|
|
66
66
|
const e = (t.comment ?? "").trim(), r = /^auto: (.+)$/i.exec(e);
|
|
67
67
|
return r ? `Rule: ${r[1]}` : /-state-sync$/i.test(e) ? "The state was copied in from the system that owned this record" : /^instance-migration/i.test(e) ? "Moved when the pipeline was reshaped" : /^state-merge/i.test(e) ? "Moved when two states were merged" : null;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const Nt = {
|
|
70
70
|
validation: "the partner refused what we sent",
|
|
71
71
|
not_found: "the partner could not find what we referred to",
|
|
72
72
|
auth: "the partner refused our credentials",
|
|
@@ -74,18 +74,18 @@ const kt = {
|
|
|
74
74
|
rate_limited: "the partner asked us to slow down",
|
|
75
75
|
unknown: "the partner refused it"
|
|
76
76
|
};
|
|
77
|
-
function
|
|
78
|
-
const e = Math.ceil((new Date(t).getTime() -
|
|
77
|
+
function In(t) {
|
|
78
|
+
const e = Math.ceil((new Date(t).getTime() - Cn()) / 6e4);
|
|
79
79
|
return !Number.isFinite(e) || e <= 0 ? "on the next check" : e < 60 ? `in ${e} min` : `in ${Math.round(e / 60)}h`;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Kn({ held: t }) {
|
|
82
82
|
return t.length === 0 ? null : /* @__PURE__ */ n(
|
|
83
83
|
"div",
|
|
84
84
|
{
|
|
85
85
|
className: "space-y-2 border-b border-amber-100 bg-amber-50 px-5 py-3 dark:border-amber-500/20 dark:bg-amber-500/10",
|
|
86
86
|
"data-pipeline-auto-held": !0,
|
|
87
87
|
children: t.map((e) => {
|
|
88
|
-
const r = e.transition_label ?? "An automatic move", a =
|
|
88
|
+
const r = e.transition_label ?? "An automatic move", a = Nt[e.error_class ?? "unknown"] ?? Nt.unknown;
|
|
89
89
|
return /* @__PURE__ */ i("div", { className: "text-[12px] text-amber-800 dark:text-amber-300", children: [
|
|
90
90
|
/* @__PURE__ */ i("p", { className: "font-medium", children: [
|
|
91
91
|
"Needs a person: ",
|
|
@@ -103,7 +103,7 @@ function jn({ held: t }) {
|
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
105
|
/* @__PURE__ */ i("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: [
|
|
106
|
-
e.retry_at ? `It tries the same push again ${
|
|
106
|
+
e.retry_at ? `It tries the same push again ${In(e.retry_at)}. ` : "It will not send the same push again on its own. ",
|
|
107
107
|
"Fix the record so what it sends changes, retry the push, or move the record by hand.",
|
|
108
108
|
e.attempts > 1 ? ` ${e.attempts} attempts so far.` : ""
|
|
109
109
|
] })
|
|
@@ -112,58 +112,58 @@ function jn({ held: t }) {
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function It(t) {
|
|
116
116
|
var r;
|
|
117
117
|
const e = t == null ? void 0 : t.response;
|
|
118
118
|
return ((e == null ? void 0 : e.code) ?? ((r = e == null ? void 0 : e.data) == null ? void 0 : r.code)) === "TRANSITION_DUPLICATE";
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Kt(t) {
|
|
121
121
|
var r;
|
|
122
122
|
const e = t;
|
|
123
123
|
return (e == null ? void 0 : e.status) === 422 && ((r = e.response) == null ? void 0 : r.error) === "TRANSITION_REQUIREMENTS" ? e.response.requirements ?? [] : null;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Qt(t) {
|
|
126
126
|
var a;
|
|
127
127
|
const e = t == null ? void 0 : t.response, r = (e == null ? void 0 : e.code) ?? ((a = e == null ? void 0 : e.data) == null ? void 0 : a.code);
|
|
128
128
|
return typeof r == "string" ? r : null;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
130
|
+
function Wt(t) {
|
|
131
|
+
if (Qt(t) !== "RECORD_LOCKED") return null;
|
|
132
132
|
const e = t == null ? void 0 : t.response, r = e != null && e.data && typeof e.data == "object" ? e.data : e;
|
|
133
133
|
if ((r == null ? void 0 : r.move_anyway) !== !0) return null;
|
|
134
134
|
const a = typeof r.locked_by_name == "string" ? r.locked_by_name : null;
|
|
135
135
|
return { message: typeof r.error == "string" && r.error.trim() ? r.error : `${a ?? "Someone else"} is editing this record right now.`, holder: a };
|
|
136
136
|
}
|
|
137
|
-
const
|
|
137
|
+
const Qn = {
|
|
138
138
|
PRIORITY_REQUIRED: "priority",
|
|
139
139
|
// A held record does not move forward (efp-ops hold-gate, army 11): taking
|
|
140
140
|
// the hold off is one deliberate, noted step, then the move is tried again.
|
|
141
141
|
ON_HOLD: "remove-hold"
|
|
142
142
|
};
|
|
143
|
-
function
|
|
144
|
-
const r =
|
|
143
|
+
function zt(t, e) {
|
|
144
|
+
const r = Qt(t), a = r ? Qn[r] : void 0;
|
|
145
145
|
return !r || !a ? null : { code: r, actionKey: a, transitionId: e.transition_id, comment: e.comment };
|
|
146
146
|
}
|
|
147
|
-
const
|
|
148
|
-
function
|
|
147
|
+
const Wn = 600;
|
|
148
|
+
function Ht(t) {
|
|
149
149
|
const e = Re(), [r, a] = j(!1), l = ae(!0);
|
|
150
150
|
he(() => (l.current = !0, () => {
|
|
151
151
|
l.current = !1;
|
|
152
152
|
}), []);
|
|
153
153
|
const c = ae(t);
|
|
154
154
|
c.current = t;
|
|
155
|
-
const m =
|
|
155
|
+
const m = Ft(async () => {
|
|
156
156
|
a(!0);
|
|
157
157
|
try {
|
|
158
158
|
await e.refetchQueries({ queryKey: [...c.current], type: "active" });
|
|
159
159
|
} catch {
|
|
160
160
|
}
|
|
161
|
-
await new Promise((b) => setTimeout(b,
|
|
161
|
+
await new Promise((b) => setTimeout(b, Wn)), l.current && a(!1);
|
|
162
162
|
}, [e]);
|
|
163
163
|
return { settling: r, settle: m };
|
|
164
164
|
}
|
|
165
|
-
const $e = 1500,
|
|
166
|
-
class
|
|
165
|
+
const $e = 1500, _t = 4e3;
|
|
166
|
+
class zn {
|
|
167
167
|
constructor() {
|
|
168
168
|
We(this, "seen", null);
|
|
169
169
|
We(this, "fresh", /* @__PURE__ */ new Map());
|
|
@@ -190,12 +190,12 @@ class Qn {
|
|
|
190
190
|
/** Still inert (no state change)? */
|
|
191
191
|
inert(e, r) {
|
|
192
192
|
const a = this.fresh.get(String(e).toUpperCase());
|
|
193
|
-
return !a || r - a.at >=
|
|
193
|
+
return !a || r - a.at >= _t ? !1 : r - a.at < $e || a.hovered && !a.left;
|
|
194
194
|
}
|
|
195
195
|
/** A press: true = let it through. A press inside the window counts as the pointer being there. */
|
|
196
196
|
press(e, r) {
|
|
197
197
|
const a = String(e).toUpperCase(), l = this.fresh.get(a);
|
|
198
|
-
return l ? r - l.at < $e ? (l.hovered = !0, l.left = !1, !1) : l.hovered && !l.left && r - l.at <
|
|
198
|
+
return l ? r - l.at < $e ? (l.hovered = !0, l.left = !1, !1) : l.hovered && !l.left && r - l.at < _t ? !1 : (this.fresh.delete(a), !0) : !0;
|
|
199
199
|
}
|
|
200
200
|
/** Inside its time window (drawn dimmed)? */
|
|
201
201
|
timed(e, r) {
|
|
@@ -211,13 +211,13 @@ class Qn {
|
|
|
211
211
|
this.seen = null, this.fresh.clear();
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Gt(t, e) {
|
|
215
215
|
const r = ae(null);
|
|
216
|
-
r.current || (r.current = new
|
|
216
|
+
r.current || (r.current = new zn());
|
|
217
217
|
const a = r.current, l = ae(e);
|
|
218
218
|
l.current !== e && (l.current = e, a.reset());
|
|
219
219
|
const [, c] = j(0), m = t ? t.join(",") : null;
|
|
220
|
-
return
|
|
220
|
+
return Be(() => {
|
|
221
221
|
t && a.observe(t, Date.now());
|
|
222
222
|
}, [a, m]), he(() => {
|
|
223
223
|
if (!a.hasTimed(Date.now())) return;
|
|
@@ -233,25 +233,25 @@ function Ht(t, e) {
|
|
|
233
233
|
})
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function Vt(t, e) {
|
|
237
237
|
return ["approval-brief", t, String(e)];
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Xt(t, e, r) {
|
|
240
240
|
return t.request(
|
|
241
241
|
ce(`/pipelines/instance/${e}/${r}/approval-brief`)
|
|
242
242
|
).then((a) => a.data);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Hn(t) {
|
|
245
245
|
return (t ?? []).filter((e) => e.tone === "warn" || e.tone === "danger");
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function St(t) {
|
|
248
248
|
return `${(t.label ?? "").trim().toLowerCase()}|${(t.text ?? "").trim().toLowerCase()}`;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Gn(t) {
|
|
251
251
|
const e = Math.max(0, Math.floor(Number(t) || 0));
|
|
252
252
|
return e === 0 ? "today" : e === 1 ? "1 day ago" : `${e} days ago`;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Vn(t, e, r = 40) {
|
|
255
255
|
const a = (_) => _ == null || _ === "" ? "" : String(_), l = a(t), c = a(e), m = (_) => _ === "" ? "(empty)" : _;
|
|
256
256
|
if (t === void 0) return { old: null, new: He(m(c), 0, r) };
|
|
257
257
|
if (l.length <= r && c.length <= r) return { old: m(l), new: m(c) };
|
|
@@ -264,27 +264,27 @@ function He(t, e, r) {
|
|
|
264
264
|
const a = Math.min(e, Math.max(0, t.length - r)), l = t.slice(a, a + r);
|
|
265
265
|
return `${a > 0 ? "…" : ""}${l}${a + r < t.length ? "…" : ""}`;
|
|
266
266
|
}
|
|
267
|
-
const
|
|
268
|
-
function
|
|
267
|
+
const Xn = 4e3;
|
|
268
|
+
function Yt(t, e) {
|
|
269
269
|
const r = xe(), a = Re();
|
|
270
|
-
return
|
|
270
|
+
return Ft(async () => {
|
|
271
271
|
try {
|
|
272
272
|
const l = await Promise.race([
|
|
273
273
|
a.fetchQuery({
|
|
274
|
-
queryKey:
|
|
275
|
-
queryFn: () =>
|
|
274
|
+
queryKey: Vt(t, e),
|
|
275
|
+
queryFn: () => Xt(r, t, e),
|
|
276
276
|
staleTime: 0,
|
|
277
277
|
retry: !1
|
|
278
278
|
}),
|
|
279
|
-
new Promise((c) => setTimeout(() => c(null),
|
|
279
|
+
new Promise((c) => setTimeout(() => c(null), Xn))
|
|
280
280
|
]);
|
|
281
|
-
return
|
|
281
|
+
return Hn(l == null ? void 0 : l.lines);
|
|
282
282
|
} catch {
|
|
283
283
|
return [];
|
|
284
284
|
}
|
|
285
285
|
}, [r, a, t, e]);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Jt({ lines: t }) {
|
|
288
288
|
return t.length === 0 ? null : /* @__PURE__ */ i(
|
|
289
289
|
"div",
|
|
290
290
|
{
|
|
@@ -307,7 +307,7 @@ function De(t, e, r) {
|
|
|
307
307
|
), l = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
|
|
308
308
|
return !!a && !!l && l.sort < a.sort;
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function Zt(t, e, r) {
|
|
311
311
|
var l;
|
|
312
312
|
if (!t) return !1;
|
|
313
313
|
if ((((l = t.order_partners) == null ? void 0 : l.length) ?? 0) > 0) return !0;
|
|
@@ -315,7 +315,7 @@ function Jt(t, e, r) {
|
|
|
315
315
|
const a = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
|
|
316
316
|
return !!(a != null && a.is_terminal) && !/(^|_)cancel/i.test(String(a.key ?? ""));
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const Ct = {
|
|
319
319
|
red: "border-red-200 bg-red-50 text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",
|
|
320
320
|
amber: "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300",
|
|
321
321
|
yellow: "border-yellow-200 bg-yellow-50 text-yellow-800 dark:border-yellow-500/30 dark:bg-yellow-500/10 dark:text-yellow-300",
|
|
@@ -323,14 +323,14 @@ const St = {
|
|
|
323
323
|
blue: "border-sky-200 bg-sky-50 text-sky-800 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-300",
|
|
324
324
|
purple: "border-violet-200 bg-violet-50 text-violet-800 dark:border-violet-500/30 dark:bg-violet-500/10 dark:text-violet-300"
|
|
325
325
|
};
|
|
326
|
-
function
|
|
326
|
+
function en({ flags: t }) {
|
|
327
327
|
return !t || t.length === 0 ? null : /* @__PURE__ */ n(be, { children: t.map((e) => /* @__PURE__ */ i(
|
|
328
328
|
"span",
|
|
329
329
|
{
|
|
330
330
|
"data-record-flag": e.name,
|
|
331
331
|
className: ge(
|
|
332
332
|
"inline-flex shrink-0 items-center gap-1 self-center rounded-full border px-2 py-0.5 text-[11px] font-semibold",
|
|
333
|
-
|
|
333
|
+
Ct[e.color] ?? Ct.amber
|
|
334
334
|
),
|
|
335
335
|
children: [
|
|
336
336
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-current", "aria-hidden": !0 }),
|
|
@@ -340,10 +340,10 @@ function Zt({ flags: t }) {
|
|
|
340
340
|
e.name
|
|
341
341
|
)) });
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function $t(t) {
|
|
344
344
|
return t.replace(/\s+IIP$/i, "");
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function tn({
|
|
347
347
|
collection: t,
|
|
348
348
|
item: e,
|
|
349
349
|
tx: r
|
|
@@ -359,20 +359,20 @@ function en({
|
|
|
359
359
|
staleTime: 2e4
|
|
360
360
|
});
|
|
361
361
|
if (l.length === 0) return null;
|
|
362
|
-
const m = c != null && c.pushes ? c.pushes.filter((h) => h.status === "would_push" && l.includes(h.api_name)).map((h) =>
|
|
362
|
+
const m = c != null && c.pushes ? c.pushes.filter((h) => h.status === "would_push" && l.includes(h.api_name)).map((h) => $t(h.api_name)) : null, b = [...new Set(m ?? l.map($t))];
|
|
363
363
|
return /* @__PURE__ */ i(
|
|
364
364
|
"p",
|
|
365
365
|
{
|
|
366
366
|
"data-order-send-note": !0,
|
|
367
367
|
className: "flex items-start gap-1.5 rounded-md border border-sky-200 bg-sky-50 px-2.5 py-1.5 text-[12px] text-sky-900 dark:border-sky-500/30 dark:bg-sky-500/10 dark:text-sky-200",
|
|
368
368
|
children: [
|
|
369
|
-
/* @__PURE__ */ n(
|
|
369
|
+
/* @__PURE__ */ n(qt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
370
370
|
m && m.length === 0 ? "Nothing is sent to a partner for this record — it only moves the record on." : `This places an order with ${b.join(" or ")}. It cannot be called back from here.`
|
|
371
371
|
]
|
|
372
372
|
}
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function nn(t) {
|
|
376
376
|
return t != null && t.instance ? (t.available_transitions ?? []).some(
|
|
377
377
|
(e) => {
|
|
378
378
|
var r;
|
|
@@ -380,27 +380,27 @@ function tn(t) {
|
|
|
380
380
|
}
|
|
381
381
|
) : !1;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function rn(t, e, r, a) {
|
|
384
384
|
if (!a || a.size === 0) return t;
|
|
385
385
|
const l = new Set([...a.keys()].map((c) => String(c).toUpperCase()));
|
|
386
386
|
return t.filter(
|
|
387
387
|
(c) => !(!c.to_previous && l.has(String(c.to_state).toUpperCase()) && De(c, e, r))
|
|
388
388
|
);
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function an(t, e, r) {
|
|
391
391
|
var h, _, k, w, q, F;
|
|
392
392
|
const a = [...(t == null ? void 0 : t.available_transitions) ?? [], ...(t == null ? void 0 : t.all_transitions) ?? []].find(
|
|
393
|
-
(
|
|
394
|
-
), l = r == null ? void 0 : r.data, c = ((h = l == null ? void 0 : l.new_state) == null ? void 0 : h.id) ?? ((_ = l == null ? void 0 : l.instance) == null ? void 0 : _.current_state) ?? null, m = ((k = l == null ? void 0 : l.new_state) == null ? void 0 : k.label) ?? (a ? (q = (w = t == null ? void 0 : t.states) == null ? void 0 : w.find((
|
|
393
|
+
(B) => B.id === e
|
|
394
|
+
), l = r == null ? void 0 : r.data, c = ((h = l == null ? void 0 : l.new_state) == null ? void 0 : h.id) ?? ((_ = l == null ? void 0 : l.instance) == null ? void 0 : _.current_state) ?? null, m = ((k = l == null ? void 0 : l.new_state) == null ? void 0 : k.label) ?? (a ? (q = (w = t == null ? void 0 : t.states) == null ? void 0 : w.find((B) => B.id === a.to_state)) == null ? void 0 : q.label : void 0) ?? null, b = ((F = t == null ? void 0 : t.instance) == null ? void 0 : F.current_state) ?? null;
|
|
395
395
|
return b && c && String(b) === String(c) ? "Nothing moved" : a != null && a.label && m ? `${a.label} — now ${m}` : m ? `Moved to ${m}` : a != null && a.label ? `${a.label} done` : "Transition executed";
|
|
396
396
|
}
|
|
397
|
-
const
|
|
398
|
-
function
|
|
397
|
+
const Yn = 1200;
|
|
398
|
+
function sn(t) {
|
|
399
399
|
const e = `nvr-move-${Math.random().toString(36).slice(2)}`;
|
|
400
400
|
let r = !1;
|
|
401
401
|
const a = setTimeout(() => {
|
|
402
402
|
r = !0, X.loading(`${(t == null ? void 0 : t.trim()) || "Moving"}…`, { id: e });
|
|
403
|
-
},
|
|
403
|
+
}, Yn);
|
|
404
404
|
return {
|
|
405
405
|
/** Options for the result toast: replaces the loading one when shown. */
|
|
406
406
|
done: () => (clearTimeout(a), r ? { id: e, duration: 7e3 } : {}),
|
|
@@ -410,7 +410,7 @@ function an(t) {
|
|
|
410
410
|
}
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function ln(t, e, r) {
|
|
414
414
|
for (const a of [
|
|
415
415
|
"pipeline-owners-resolved",
|
|
416
416
|
"pipeline-instance-owners",
|
|
@@ -418,7 +418,7 @@ function sn(t, e, r) {
|
|
|
418
418
|
])
|
|
419
419
|
t.invalidateQueries({ queryKey: [a, e, r] });
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function Jn(t, e, r) {
|
|
422
422
|
var b;
|
|
423
423
|
if (!e) return null;
|
|
424
424
|
const a = new Map(r.map((h) => [String(h.id).toUpperCase(), h.sort])), l = [...t].sort(
|
|
@@ -428,7 +428,7 @@ function Xn(t, e, r) {
|
|
|
428
428
|
const c = a.get(String(l.from_state).toUpperCase()), m = a.get(String(l.to_state).toUpperCase());
|
|
429
429
|
return c == null || m == null || m >= c ? null : l;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function Zn({ entry: t }) {
|
|
432
432
|
const e = [t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email || "Someone";
|
|
433
433
|
return /* @__PURE__ */ i(
|
|
434
434
|
"div",
|
|
@@ -447,7 +447,7 @@ function Yn({ entry: t }) {
|
|
|
447
447
|
}
|
|
448
448
|
);
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function on({
|
|
451
451
|
collection: t,
|
|
452
452
|
item: e,
|
|
453
453
|
offer: r,
|
|
@@ -458,7 +458,7 @@ function ln({
|
|
|
458
458
|
}) {
|
|
459
459
|
const b = xe(), h = Re(), [_, k] = j(""), { data: w, isLoading: q } = le({
|
|
460
460
|
queryKey: ["bulk-actions-available-one", t, r.actionKey],
|
|
461
|
-
queryFn: async () => ((await b.request(ce("/bulk-actions/available", { collection: t }))).data ?? []).find((
|
|
461
|
+
queryFn: async () => ((await b.request(ce("/bulk-actions/available", { collection: t }))).data ?? []).find((L) => L.key === r.actionKey) ?? null,
|
|
462
462
|
staleTime: 6e4
|
|
463
463
|
}), F = qe({
|
|
464
464
|
mutationFn: async () => {
|
|
@@ -472,10 +472,10 @@ function ln({
|
|
|
472
472
|
onSuccess: () => {
|
|
473
473
|
Pe(h, t, e), X.success(`${(w == null ? void 0 : w.label) ?? "Done"} — trying again`), a();
|
|
474
474
|
},
|
|
475
|
-
onError: (A) =>
|
|
475
|
+
onError: (A) => Nn(A, `${(w == null ? void 0 : w.label) ?? "The fix"} failed`)
|
|
476
476
|
});
|
|
477
477
|
if (q || !w) return null;
|
|
478
|
-
const
|
|
478
|
+
const B = !F.isPending && (!w.require_reason || _.trim().length > 0);
|
|
479
479
|
return /* @__PURE__ */ i(
|
|
480
480
|
"div",
|
|
481
481
|
{
|
|
@@ -520,7 +520,7 @@ function ln({
|
|
|
520
520
|
type: "button",
|
|
521
521
|
size: "sm",
|
|
522
522
|
className: "h-7 gap-1.5 text-[12px]",
|
|
523
|
-
disabled: !
|
|
523
|
+
disabled: !B,
|
|
524
524
|
onClick: () => F.mutate(),
|
|
525
525
|
children: [
|
|
526
526
|
F.isPending && /* @__PURE__ */ n(pe, { className: "h-3 w-3 animate-spin" }),
|
|
@@ -555,9 +555,9 @@ function ve({
|
|
|
555
555
|
}
|
|
556
556
|
function Ge(t) {
|
|
557
557
|
const e = Math.floor(t / 6e4);
|
|
558
|
-
return e < 60 ? `${Math.max(1, e)}m` :
|
|
558
|
+
return e < 60 ? `${Math.max(1, e)}m` : Rn(t / 36e5);
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function er({
|
|
561
561
|
history: t,
|
|
562
562
|
completedAt: e
|
|
563
563
|
}) {
|
|
@@ -617,7 +617,7 @@ function Jn({
|
|
|
617
617
|
}) })
|
|
618
618
|
] });
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function tr({
|
|
621
621
|
states: t,
|
|
622
622
|
allTransitions: e,
|
|
623
623
|
availableTransitions: r,
|
|
@@ -680,7 +680,7 @@ function Zn({
|
|
|
680
680
|
}).sort((y, S) => y.sort - S.sort);
|
|
681
681
|
})();
|
|
682
682
|
if (w.length < 2) return null;
|
|
683
|
-
const q = w.findIndex((u) => u.id === a), F = new Map(w.map((u, g) => [u.id, g])),
|
|
683
|
+
const q = w.findIndex((u) => u.id === a), F = new Map(w.map((u, g) => [u.id, g])), B = new Map(t.map((u) => [u.id, u.label]));
|
|
684
684
|
function A(u, g) {
|
|
685
685
|
const N = F.get(u);
|
|
686
686
|
return N == null ? [] : [...l].filter((T) => {
|
|
@@ -689,9 +689,9 @@ function Zn({
|
|
|
689
689
|
return d == null || K == null ? !1 : d === N && K > N || K < d && d - 1 === N;
|
|
690
690
|
}).sort((T, d) => new Date(T.timestamp).getTime() - new Date(d.timestamp).getTime());
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function L(u) {
|
|
693
693
|
var g, N, T, d;
|
|
694
|
-
return Ue(u) ? /* @__PURE__ */ n(
|
|
694
|
+
return Ue(u) ? /* @__PURE__ */ n(Pt, { className: "inline h-2.5 w-2.5", "aria-label": tt(u) }) : ((((g = u.first_name) == null ? void 0 : g[0]) ?? "") + (((N = u.last_name) == null ? void 0 : N[0]) ?? "")).toUpperCase() || ((d = (T = u.user_email) == null ? void 0 : T[0]) == null ? void 0 : d.toUpperCase()) || "?";
|
|
695
695
|
}
|
|
696
696
|
function I(u) {
|
|
697
697
|
return ot([u.first_name, u.last_name].filter(Boolean).join(" ") || u.user_email, u);
|
|
@@ -709,10 +709,10 @@ function Zn({
|
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
711
|
function D(u) {
|
|
712
|
-
const g =
|
|
713
|
-
return `Passed over on ${
|
|
712
|
+
const g = B.get(u.from_state ?? "") ?? "the previous step", N = B.get(u.to_state) ?? "the next step", T = Ue(u) ? "it moved automatically" : `${I(u)} moved it`;
|
|
713
|
+
return `Passed over on ${yt(u.timestamp)} — ${T} straight from ${g} to ${N}`;
|
|
714
714
|
}
|
|
715
|
-
return /* @__PURE__ */ n(
|
|
715
|
+
return /* @__PURE__ */ n(Bt, { delayDuration: 200, children: /* @__PURE__ */ n("div", { ref: b, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-start", children: w.map((u, g) => {
|
|
716
716
|
const N = u.id === a, T = h.has(u.id), d = T && !N && (q < 0 || g < q), K = T && !N && !d, te = !T && !N ? R.get(u.id) : void 0, y = !T && !N ? m == null ? void 0 : m.get(u.id) : void 0, S = te || y ? [...te ? [D(te)] : [], ...y ?? []] : void 0, E = S !== void 0, Y = u.color ?? "#94a3b8", G = g === w.length - 1, z = G ? null : w[g + 1], oe = z ? A(u.id, z.id) : [];
|
|
717
717
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 items-start", children: [
|
|
718
718
|
/* @__PURE__ */ i("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
|
|
@@ -728,7 +728,7 @@ function Zn({
|
|
|
728
728
|
border: N || d ? "none" : E ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
|
|
729
729
|
boxShadow: N ? `0 0 0 3px white, 0 0 0 5px ${Y}` : void 0
|
|
730
730
|
},
|
|
731
|
-
children: d ? /* @__PURE__ */ n(je, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : N ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : E ? /* @__PURE__ */ n(
|
|
731
|
+
children: d ? /* @__PURE__ */ n(je, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : N ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : E ? /* @__PURE__ */ n(gn, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
|
|
732
732
|
},
|
|
733
733
|
N ? "cur" : d ? "done" : E ? "skip" : "todo"
|
|
734
734
|
),
|
|
@@ -797,7 +797,7 @@ function Zn({
|
|
|
797
797
|
oe.map(($) => {
|
|
798
798
|
const o = $.from_state !== u.id, ue = Math.abs(
|
|
799
799
|
(F.get($.to_state) ?? 0) - (F.get($.from_state ?? "") ?? 0)
|
|
800
|
-
) > 1 ?
|
|
800
|
+
) > 1 ? B.get($.to_state) ?? "" : null;
|
|
801
801
|
return /* @__PURE__ */ i(Je, { children: [
|
|
802
802
|
/* @__PURE__ */ n(Ze, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
|
|
803
803
|
/* @__PURE__ */ i(
|
|
@@ -807,7 +807,7 @@ function Zn({
|
|
|
807
807
|
style: { color: o ? "#d97706" : "#475569" },
|
|
808
808
|
children: [
|
|
809
809
|
o && "↩ ",
|
|
810
|
-
|
|
810
|
+
L($)
|
|
811
811
|
]
|
|
812
812
|
}
|
|
813
813
|
),
|
|
@@ -829,7 +829,7 @@ function Zn({
|
|
|
829
829
|
"→ straight to ",
|
|
830
830
|
ue
|
|
831
831
|
] }),
|
|
832
|
-
/* @__PURE__ */ n("p", { className: "text-muted-foreground", children:
|
|
832
|
+
/* @__PURE__ */ n("p", { className: "text-muted-foreground", children: yt($.timestamp) })
|
|
833
833
|
] })
|
|
834
834
|
] }, $.id);
|
|
835
835
|
})
|
|
@@ -837,9 +837,9 @@ function Zn({
|
|
|
837
837
|
] }, u.id);
|
|
838
838
|
}) }) }) });
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function nr({ history: t }) {
|
|
841
841
|
return t.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ n("div", { className: "space-y-3", children: t.map((e) => {
|
|
842
|
-
const r = Ue(e), a = r ? tt(e) : ot([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), l =
|
|
842
|
+
const r = Ue(e), a = r ? tt(e) : ot([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), l = jn(e), c = e.comment && !r && !l ? e.comment : null, m = l ?? (r ? nt(e) : null);
|
|
843
843
|
return /* @__PURE__ */ i("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
|
|
844
844
|
/* @__PURE__ */ n("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
|
|
845
845
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -859,7 +859,7 @@ function er({ history: t }) {
|
|
|
859
859
|
className: "mt-0.5 text-slate-400",
|
|
860
860
|
"data-history-on-behalf": e.on_behalf_of_name ? e.on_behalf_of ?? "" : void 0,
|
|
861
861
|
children: [
|
|
862
|
-
r && /* @__PURE__ */ n(
|
|
862
|
+
r && /* @__PURE__ */ n(Pt, { className: "mr-1 inline h-3 w-3", "aria-hidden": !0 }),
|
|
863
863
|
a,
|
|
864
864
|
m ? ` · ${m}` : "",
|
|
865
865
|
" · ",
|
|
@@ -871,7 +871,7 @@ function er({ history: t }) {
|
|
|
871
871
|
] }, e.id);
|
|
872
872
|
}) });
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function rr({ value: t, onChange: e }) {
|
|
875
875
|
const r = xe(), [a, l] = j(!1), [c, m] = j(""), [b, h] = j(""), _ = ae(null), k = ae(null);
|
|
876
876
|
he(() => {
|
|
877
877
|
a ? setTimeout(() => {
|
|
@@ -893,10 +893,10 @@ function tr({ value: t, onChange: e }) {
|
|
|
893
893
|
enabled: a,
|
|
894
894
|
staleTime: 3e4
|
|
895
895
|
}), { data: F } = le({
|
|
896
|
-
|
|
896
|
+
...$n(r, t),
|
|
897
897
|
enabled: !!t,
|
|
898
898
|
staleTime: 5 * 6e4
|
|
899
|
-
}),
|
|
899
|
+
}), B = w ?? [], A = F ?? B.find((R) => R.id === t) ?? null, L = A ? [A.first_name, A.last_name].filter(Boolean).join(" ").trim() || A.email : t ? "Selected person" : null, I = (R) => [R.first_name, R.last_name].filter(Boolean).join(" ").trim();
|
|
900
900
|
return /* @__PURE__ */ i(st, { open: a, onOpenChange: l, children: [
|
|
901
901
|
/* @__PURE__ */ i("div", { className: "relative flex h-8 w-full", children: [
|
|
902
902
|
/* @__PURE__ */ n(it, { asChild: !0, children: /* @__PURE__ */ i(
|
|
@@ -905,7 +905,7 @@ function tr({ value: t, onChange: e }) {
|
|
|
905
905
|
type: "button",
|
|
906
906
|
className: "flex h-full w-full items-center justify-between gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-left text-[13px] text-slate-700 hover:border-slate-300",
|
|
907
907
|
children: [
|
|
908
|
-
/* @__PURE__ */ n("span", { className: `flex-1 truncate ${
|
|
908
|
+
/* @__PURE__ */ n("span", { className: `flex-1 truncate ${L ? "" : "text-slate-400"}`, children: L ?? "Select a user…" }),
|
|
909
909
|
/* @__PURE__ */ n(_e, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
|
|
910
910
|
]
|
|
911
911
|
}
|
|
@@ -918,13 +918,13 @@ function tr({ value: t, onChange: e }) {
|
|
|
918
918
|
R.stopPropagation(), e("");
|
|
919
919
|
},
|
|
920
920
|
className: "absolute right-6 top-1/2 -translate-y-1/2 flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
|
|
921
|
-
children: /* @__PURE__ */ n(
|
|
921
|
+
children: /* @__PURE__ */ n(Mt, { className: "h-3 w-3" })
|
|
922
922
|
}
|
|
923
923
|
)
|
|
924
924
|
] }),
|
|
925
925
|
/* @__PURE__ */ i(lt, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
|
|
926
926
|
/* @__PURE__ */ n("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
927
|
-
/* @__PURE__ */ n(
|
|
927
|
+
/* @__PURE__ */ n(yn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
928
928
|
/* @__PURE__ */ n(
|
|
929
929
|
"input",
|
|
930
930
|
{
|
|
@@ -939,7 +939,7 @@ function tr({ value: t, onChange: e }) {
|
|
|
939
939
|
/* @__PURE__ */ n("div", { className: "max-h-56 overflow-y-auto py-1", children: q ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
|
|
940
940
|
/* @__PURE__ */ n(pe, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
941
941
|
"Loading…"
|
|
942
|
-
] }) :
|
|
942
|
+
] }) : B.length === 0 ? /* @__PURE__ */ n("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : B.map((R) => {
|
|
943
943
|
const D = I(R), Q = D ? `${D} (${R.email})` : R.email, u = R.id === t;
|
|
944
944
|
return /* @__PURE__ */ i(
|
|
945
945
|
"button",
|
|
@@ -965,13 +965,13 @@ function tr({ value: t, onChange: e }) {
|
|
|
965
965
|
] })
|
|
966
966
|
] });
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function Tt({
|
|
969
969
|
userId: t,
|
|
970
970
|
name: e,
|
|
971
971
|
email: r,
|
|
972
972
|
initials: a
|
|
973
973
|
}) {
|
|
974
|
-
return /* @__PURE__ */ n(
|
|
974
|
+
return /* @__PURE__ */ n(Ut, { userId: t, children: /* @__PURE__ */ i(
|
|
975
975
|
"button",
|
|
976
976
|
{
|
|
977
977
|
type: "button",
|
|
@@ -979,7 +979,7 @@ function $t({
|
|
|
979
979
|
className: "group/owner flex min-w-0 flex-1 items-center gap-2.5 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
|
|
980
980
|
children: [
|
|
981
981
|
/* @__PURE__ */ n(
|
|
982
|
-
|
|
982
|
+
Fn,
|
|
983
983
|
{
|
|
984
984
|
userId: t,
|
|
985
985
|
alt: e,
|
|
@@ -995,7 +995,7 @@ function $t({
|
|
|
995
995
|
}
|
|
996
996
|
) });
|
|
997
997
|
}
|
|
998
|
-
function
|
|
998
|
+
function ar({
|
|
999
999
|
collection: t,
|
|
1000
1000
|
item: e,
|
|
1001
1001
|
states: r,
|
|
@@ -1003,13 +1003,13 @@ function nr({
|
|
|
1003
1003
|
returned: l = !1
|
|
1004
1004
|
}) {
|
|
1005
1005
|
var me, ne, ke, Ne;
|
|
1006
|
-
const c = xe(), m = Re(), { isAdmin: b } =
|
|
1006
|
+
const c = xe(), m = Re(), { isAdmin: b } = vn(), [h, _] = j(!1), [k, w] = j(""), [q, F] = j(""), [B, A] = j(!1), L = ["pipeline-instance-owners", t, e], I = ["pipeline-owners-can-add", t, e], R = () => c.request(
|
|
1007
1007
|
ce(`/pipelines/instance/${t}/${e}/owners`)
|
|
1008
1008
|
).then((s) => {
|
|
1009
1009
|
var p;
|
|
1010
1010
|
return m.setQueryData(I, ((p = s.meta) == null ? void 0 : p.can_add) ?? null), s;
|
|
1011
1011
|
}), { data: D, isLoading: Q } = le({
|
|
1012
|
-
queryKey:
|
|
1012
|
+
queryKey: L,
|
|
1013
1013
|
queryFn: () => R().then((s) => s.data)
|
|
1014
1014
|
}), { data: u } = le({
|
|
1015
1015
|
queryKey: I,
|
|
@@ -1039,7 +1039,7 @@ function nr({
|
|
|
1039
1039
|
enabled: S && E && y === 0,
|
|
1040
1040
|
staleTime: 6e4
|
|
1041
1041
|
}), G = S && y === 0 && (Y != null && Y.name) ? Y : null, z = () => {
|
|
1042
|
-
m.invalidateQueries({ queryKey:
|
|
1042
|
+
m.invalidateQueries({ queryKey: L }), m.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
|
|
1043
1043
|
}, oe = qe({
|
|
1044
1044
|
mutationFn: () => c.request(
|
|
1045
1045
|
Se(`/pipelines/instance/${t}/${e}/owners`, {
|
|
@@ -1053,7 +1053,7 @@ function nr({
|
|
|
1053
1053
|
// The server's reason (a 403 says why), not a bare status phrase.
|
|
1054
1054
|
onError: (s) => X.error(Me(s, "Failed to add owner"))
|
|
1055
1055
|
}), $ = qe({
|
|
1056
|
-
mutationFn: (s) => c.request(
|
|
1056
|
+
mutationFn: (s) => c.request(kn(`/pipelines/instance-owners/${s.id}`)),
|
|
1057
1057
|
onSuccess: (s, p) => {
|
|
1058
1058
|
z();
|
|
1059
1059
|
const x = [p.first_name, p.last_name].filter(Boolean).join(" ") || p.email;
|
|
@@ -1081,7 +1081,7 @@ function nr({
|
|
|
1081
1081
|
return /* @__PURE__ */ i("div", { children: [
|
|
1082
1082
|
/* @__PURE__ */ i("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
1083
1083
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [
|
|
1084
|
-
/* @__PURE__ */ n(
|
|
1084
|
+
/* @__PURE__ */ n(Rt, { className: "h-3.5 w-3.5" }),
|
|
1085
1085
|
"Owners",
|
|
1086
1086
|
Q || T ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : G ? null : /* @__PURE__ */ i("span", { className: "text-slate-300", children: [
|
|
1087
1087
|
"(",
|
|
@@ -1090,7 +1090,7 @@ function nr({
|
|
|
1090
1090
|
] })
|
|
1091
1091
|
] }),
|
|
1092
1092
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
|
|
1093
|
-
a && /* @__PURE__ */ n(
|
|
1093
|
+
a && /* @__PURE__ */ n(On, { collection: t, itemId: String(e) }),
|
|
1094
1094
|
!h && g && /* @__PURE__ */ i(
|
|
1095
1095
|
"button",
|
|
1096
1096
|
{
|
|
@@ -1098,7 +1098,7 @@ function nr({
|
|
|
1098
1098
|
onClick: () => _(!0),
|
|
1099
1099
|
className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
1100
1100
|
children: [
|
|
1101
|
-
/* @__PURE__ */ n(
|
|
1101
|
+
/* @__PURE__ */ n(xn, { className: "h-3 w-3" }),
|
|
1102
1102
|
"Add"
|
|
1103
1103
|
]
|
|
1104
1104
|
}
|
|
@@ -1111,7 +1111,7 @@ function nr({
|
|
|
1111
1111
|
] }) : G ? /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
1112
1112
|
l ? "Back with" : "With",
|
|
1113
1113
|
" ",
|
|
1114
|
-
/* @__PURE__ */ n(
|
|
1114
|
+
/* @__PURE__ */ n(Ut, { userId: G.id, children: /* @__PURE__ */ n(
|
|
1115
1115
|
"button",
|
|
1116
1116
|
{
|
|
1117
1117
|
type: "button",
|
|
@@ -1129,7 +1129,7 @@ function nr({
|
|
|
1129
1129
|
{
|
|
1130
1130
|
className: "-mx-2 flex items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
|
|
1131
1131
|
children: [
|
|
1132
|
-
/* @__PURE__ */ n(
|
|
1132
|
+
/* @__PURE__ */ n(Tt, { userId: s.id, name: p, email: s.email, initials: x }),
|
|
1133
1133
|
(() => {
|
|
1134
1134
|
const v = te.get(String(s.id).toUpperCase());
|
|
1135
1135
|
return v ? /* @__PURE__ */ n(
|
|
@@ -1164,7 +1164,7 @@ function nr({
|
|
|
1164
1164
|
className: "group -mx-2 flex items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
|
|
1165
1165
|
children: [
|
|
1166
1166
|
/* @__PURE__ */ n(
|
|
1167
|
-
|
|
1167
|
+
Tt,
|
|
1168
1168
|
{
|
|
1169
1169
|
userId: s.user,
|
|
1170
1170
|
name: [s.first_name, s.last_name].filter(Boolean).join(" ") || s.email,
|
|
@@ -1182,7 +1182,7 @@ function nr({
|
|
|
1182
1182
|
disabled: $.isPending,
|
|
1183
1183
|
onClick: () => $.mutate(s),
|
|
1184
1184
|
className: "shrink-0 rounded p-0.5 text-slate-300 opacity-0 transition-all hover:text-red-500 focus-visible:opacity-100 group-hover:opacity-100",
|
|
1185
|
-
children: /* @__PURE__ */ n(
|
|
1185
|
+
children: /* @__PURE__ */ n(Mt, { className: "h-3 w-3" })
|
|
1186
1186
|
}
|
|
1187
1187
|
)
|
|
1188
1188
|
]
|
|
@@ -1192,8 +1192,8 @@ function nr({
|
|
|
1192
1192
|
] }),
|
|
1193
1193
|
h && /* @__PURE__ */ i("div", { className: "mt-3 space-y-2 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3", children: [
|
|
1194
1194
|
/* @__PURE__ */ n("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
|
|
1195
|
-
/* @__PURE__ */ n(
|
|
1196
|
-
b ? /* @__PURE__ */ i(st, { open:
|
|
1195
|
+
/* @__PURE__ */ n(rr, { value: k, onChange: w }),
|
|
1196
|
+
b ? /* @__PURE__ */ i(st, { open: B, onOpenChange: A, children: [
|
|
1197
1197
|
/* @__PURE__ */ n(it, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1198
1198
|
"button",
|
|
1199
1199
|
{
|
|
@@ -1254,16 +1254,16 @@ function nr({
|
|
|
1254
1254
|
] })
|
|
1255
1255
|
] });
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function dn(t, e, r, a) {
|
|
1258
1258
|
if (!t || !(r != null && r.length)) return null;
|
|
1259
1259
|
const c = new Map(r.map((h) => [String(h.id).toUpperCase(), h])).get(String(t.to_state).toUpperCase()), m = Number(e == null ? void 0 : e.sort);
|
|
1260
1260
|
if (!c || !Number.isFinite(m) || !(Number(c.sort) > m)) return null;
|
|
1261
|
-
const b =
|
|
1261
|
+
const b = Bn(String(t.to_state), r, a);
|
|
1262
1262
|
return b && b.skipped.length > 0 ? b : null;
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function cn({ landing: t }) {
|
|
1265
1265
|
if (!t || t.skipped.length === 0) return null;
|
|
1266
|
-
const e =
|
|
1266
|
+
const e = Ln(t);
|
|
1267
1267
|
if (e.length === 1) {
|
|
1268
1268
|
const r = e[0];
|
|
1269
1269
|
return /* @__PURE__ */ i(
|
|
@@ -1276,7 +1276,7 @@ function dn({ landing: t }) {
|
|
|
1276
1276
|
/* @__PURE__ */ n("span", { className: "font-medium", children: t.state.label }),
|
|
1277
1277
|
" —",
|
|
1278
1278
|
" ",
|
|
1279
|
-
|
|
1279
|
+
kt(r.labels),
|
|
1280
1280
|
" ",
|
|
1281
1281
|
r.labels.length === 1 ? "is" : "are",
|
|
1282
1282
|
" skipped",
|
|
@@ -1298,7 +1298,7 @@ function dn({ landing: t }) {
|
|
|
1298
1298
|
". Skipped on the way:"
|
|
1299
1299
|
] }),
|
|
1300
1300
|
/* @__PURE__ */ n("ul", { className: "mt-0.5 list-disc space-y-0.5 pl-4", children: e.map((r) => /* @__PURE__ */ i("li", { children: [
|
|
1301
|
-
/* @__PURE__ */ n("span", { className: "font-medium", children:
|
|
1301
|
+
/* @__PURE__ */ n("span", { className: "font-medium", children: kt(r.labels) }),
|
|
1302
1302
|
r.reason ? ` — ${r.reason}` : ""
|
|
1303
1303
|
] }, r.labels.join("|"))) })
|
|
1304
1304
|
]
|
|
@@ -1310,7 +1310,7 @@ const Te = {
|
|
|
1310
1310
|
suspended: "suspended",
|
|
1311
1311
|
redacted: "redacted"
|
|
1312
1312
|
};
|
|
1313
|
-
function
|
|
1313
|
+
function sr({
|
|
1314
1314
|
collection: t,
|
|
1315
1315
|
item: e,
|
|
1316
1316
|
states: r,
|
|
@@ -1335,7 +1335,7 @@ function rr({
|
|
|
1335
1335
|
title: "View approval chain",
|
|
1336
1336
|
className: "flex h-6 w-6 items-center justify-center rounded text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-muted dark:hover:text-slate-300",
|
|
1337
1337
|
onClick: (k) => k.stopPropagation(),
|
|
1338
|
-
children: /* @__PURE__ */ n(
|
|
1338
|
+
children: /* @__PURE__ */ n(Rt, { className: "h-3.5 w-3.5" })
|
|
1339
1339
|
}
|
|
1340
1340
|
) }),
|
|
1341
1341
|
/* @__PURE__ */ i(lt, { align: "end", sideOffset: 6, className: "w-[576px] p-0 overflow-hidden", children: [
|
|
@@ -1348,7 +1348,7 @@ function rr({
|
|
|
1348
1348
|
const w = (((I = b[k.id]) == null ? void 0 : I.owners) ?? []).map((g) => ({
|
|
1349
1349
|
id: g.id,
|
|
1350
1350
|
name: [g.first_name, g.last_name].filter(Boolean).join(" ") || g.email
|
|
1351
|
-
})), q = k.id === a, F = ((R = b[k.id]) == null ? void 0 : R.skipped) === !0 && !q,
|
|
1351
|
+
})), q = k.id === a, F = ((R = b[k.id]) == null ? void 0 : R.skipped) === !0 && !q, B = (((D = b[k.id]) == null ? void 0 : D.skip_reasons) ?? []).filter(Boolean), A = ((Q = b[k.id]) == null ? void 0 : Q.unavailable) ?? [], L = ((u = b[k.id]) == null ? void 0 : u.blocked) === !0 && !F;
|
|
1352
1352
|
return /* @__PURE__ */ i(
|
|
1353
1353
|
"div",
|
|
1354
1354
|
{
|
|
@@ -1360,19 +1360,19 @@ function rr({
|
|
|
1360
1360
|
// tint doesn't clash with the state badge's own color.
|
|
1361
1361
|
q && "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/[0.11]",
|
|
1362
1362
|
F && "opacity-60",
|
|
1363
|
-
|
|
1363
|
+
L && "bg-red-50 dark:bg-red-500/10"
|
|
1364
1364
|
),
|
|
1365
|
-
"data-chain-blocked":
|
|
1365
|
+
"data-chain-blocked": L ? "" : void 0,
|
|
1366
1366
|
children: [
|
|
1367
1367
|
/* @__PURE__ */ n(ve, { label: k.label, color: k.color, small: !0 }),
|
|
1368
1368
|
/* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5", children: F ? (
|
|
1369
1369
|
// Radix tooltip with zero delay — native `title` waits on
|
|
1370
1370
|
// the OS hover timer, and a truncated reason needs its
|
|
1371
1371
|
// full text the moment the cursor lands on it.
|
|
1372
|
-
/* @__PURE__ */ n(
|
|
1372
|
+
/* @__PURE__ */ n(Bt, { delayDuration: 0, children: /* @__PURE__ */ i(Je, { children: [
|
|
1373
1373
|
/* @__PURE__ */ n(Ze, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
|
|
1374
1374
|
/* @__PURE__ */ n("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-dashed border-slate-300 px-2 py-0.5 text-[10.5px] font-medium text-slate-400 dark:border-slate-600 dark:text-slate-500", children: "Skipped" }),
|
|
1375
|
-
|
|
1375
|
+
B.length > 0 && /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: B.join(" · ") })
|
|
1376
1376
|
] }) }),
|
|
1377
1377
|
/* @__PURE__ */ i(
|
|
1378
1378
|
et,
|
|
@@ -1382,17 +1382,17 @@ function rr({
|
|
|
1382
1382
|
className: "max-w-[420px] space-y-0.5 text-[11.5px] leading-snug",
|
|
1383
1383
|
children: [
|
|
1384
1384
|
/* @__PURE__ */ n("p", { className: "text-slate-500 dark:text-slate-400", children: "The pipeline will pass through this state without stopping:" }),
|
|
1385
|
-
|
|
1385
|
+
B.length > 0 ? B.map((g) => /* @__PURE__ */ n("p", { children: g }, g)) : /* @__PURE__ */ n("p", { children: "Skip criteria currently match" })
|
|
1386
1386
|
]
|
|
1387
1387
|
}
|
|
1388
1388
|
)
|
|
1389
1389
|
] }) })
|
|
1390
1390
|
) : /* @__PURE__ */ i(be, { children: [
|
|
1391
|
-
/* @__PURE__ */ n(
|
|
1391
|
+
/* @__PURE__ */ n(Dn, { owners: w, max: 10, emptyLabel: "—" }),
|
|
1392
1392
|
A.map((g) => /* @__PURE__ */ i(
|
|
1393
1393
|
"span",
|
|
1394
1394
|
{
|
|
1395
|
-
"data-tip": `${g.name} is ${Te[g.reason] ?? g.reason}${g.delegate ? ` — ${g.delegate.name} covers${g.delegate.expires_at ? ` until ${
|
|
1395
|
+
"data-tip": `${g.name} is ${Te[g.reason] ?? g.reason}${g.delegate ? ` — ${g.delegate.name} covers${g.delegate.expires_at ? ` until ${qn(g.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
|
|
1396
1396
|
className: ge(
|
|
1397
1397
|
"inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10.5px] font-medium",
|
|
1398
1398
|
g.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
|
|
@@ -1422,7 +1422,7 @@ function rr({
|
|
|
1422
1422
|
},
|
|
1423
1423
|
g.id
|
|
1424
1424
|
)),
|
|
1425
|
-
|
|
1425
|
+
L && /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 rounded-full bg-red-600 px-2 py-0.5 text-[10.5px] font-semibold text-white", children: "No one can act here" })
|
|
1426
1426
|
] }) })
|
|
1427
1427
|
]
|
|
1428
1428
|
},
|
|
@@ -1432,7 +1432,7 @@ function rr({
|
|
|
1432
1432
|
] })
|
|
1433
1433
|
] });
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function Br({
|
|
1436
1436
|
collection: t,
|
|
1437
1437
|
item: e,
|
|
1438
1438
|
defaultExpanded: r,
|
|
@@ -1446,7 +1446,7 @@ function Or({
|
|
|
1446
1446
|
asRole: k
|
|
1447
1447
|
}) {
|
|
1448
1448
|
return e === "new" ? null : /* @__PURE__ */ n(
|
|
1449
|
-
|
|
1449
|
+
ir,
|
|
1450
1450
|
{
|
|
1451
1451
|
collection: t,
|
|
1452
1452
|
item: e,
|
|
@@ -1463,25 +1463,25 @@ function Or({
|
|
|
1463
1463
|
`${t}:${e}`
|
|
1464
1464
|
);
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1466
|
+
function un({
|
|
1467
1467
|
collection: t,
|
|
1468
1468
|
item: e,
|
|
1469
1469
|
omitLines: r
|
|
1470
1470
|
}) {
|
|
1471
1471
|
const a = xe(), { data: l } = le({
|
|
1472
|
-
queryKey:
|
|
1473
|
-
queryFn: () =>
|
|
1472
|
+
queryKey: Vt(t, e),
|
|
1473
|
+
queryFn: () => Xt(a, t, e),
|
|
1474
1474
|
staleTime: 3e4,
|
|
1475
1475
|
retry: !1
|
|
1476
1476
|
});
|
|
1477
1477
|
if (!l) return null;
|
|
1478
|
-
const c = l.changed_by_people ?? l.changed_total, m = new Set((r ?? []).map(
|
|
1478
|
+
const c = l.changed_by_people ?? l.changed_total, m = new Set((r ?? []).map(St)), b = (l.lines ?? []).filter((h) => !m.has(St(h)));
|
|
1479
1479
|
return /* @__PURE__ */ i("div", { className: "rounded-md border border-slate-200 bg-white px-3 py-2 text-[11.5px] dark:border-border dark:bg-card", children: [
|
|
1480
1480
|
/* @__PURE__ */ i("p", { className: "text-slate-500 dark:text-muted-foreground", children: [
|
|
1481
1481
|
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: "Since entering this state" }),
|
|
1482
1482
|
" ",
|
|
1483
1483
|
"(",
|
|
1484
|
-
|
|
1484
|
+
Gn(l.days_in_state),
|
|
1485
1485
|
"):",
|
|
1486
1486
|
" ",
|
|
1487
1487
|
l.changed_total === 0 && l.comments === 0 && l.addendums.count === 0 ? /* @__PURE__ */ n("span", { children: "no changes to this record." }) : /* @__PURE__ */ i(be, { children: [
|
|
@@ -1510,14 +1510,14 @@ function cn({
|
|
|
1510
1510
|
] }),
|
|
1511
1511
|
l.field_changes.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 space-y-0.5", children: [
|
|
1512
1512
|
l.field_changes.slice(0, 5).map((h) => {
|
|
1513
|
-
const _ =
|
|
1513
|
+
const _ = Vn(h.old, h.new);
|
|
1514
1514
|
return /* @__PURE__ */ i(
|
|
1515
1515
|
"p",
|
|
1516
1516
|
{
|
|
1517
1517
|
"data-brief-change": h.field,
|
|
1518
1518
|
className: "text-[11px] text-slate-500 dark:text-muted-foreground",
|
|
1519
1519
|
children: [
|
|
1520
|
-
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: h.label ||
|
|
1520
|
+
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: h.label || Tn(h.field) }),
|
|
1521
1521
|
h.auto ? /* @__PURE__ */ n("span", { children: " (updated automatically)" }) : null,
|
|
1522
1522
|
":",
|
|
1523
1523
|
" ",
|
|
@@ -1559,7 +1559,7 @@ function cn({
|
|
|
1559
1559
|
))
|
|
1560
1560
|
] });
|
|
1561
1561
|
}
|
|
1562
|
-
function
|
|
1562
|
+
function ir({
|
|
1563
1563
|
collection: t,
|
|
1564
1564
|
item: e,
|
|
1565
1565
|
defaultExpanded: r,
|
|
@@ -1573,9 +1573,9 @@ function ar({
|
|
|
1573
1573
|
asRole: k
|
|
1574
1574
|
}) {
|
|
1575
1575
|
var pt, ft, ht;
|
|
1576
|
-
const w = xe(), q = Re(), [F,
|
|
1577
|
-
|
|
1578
|
-
const y =
|
|
1576
|
+
const w = xe(), q = Re(), [F, B] = j(""), [A, L] = j(null), [I, R] = j(!1), [D, Q] = j(!1), [u, g] = j(null), [N, T] = j(null), [d, K] = j([]), te = Yt(t, String(e));
|
|
1577
|
+
Ot(t, e, "transition", !!A || !!u);
|
|
1578
|
+
const y = _n(t, e, "transition"), S = ae(!1);
|
|
1579
1579
|
he(() => {
|
|
1580
1580
|
!S.current && r !== void 0 && (S.current = !0, Q(r));
|
|
1581
1581
|
}, [r]);
|
|
@@ -1595,7 +1595,7 @@ function ar({
|
|
|
1595
1595
|
var J, ie;
|
|
1596
1596
|
if (E.current) return;
|
|
1597
1597
|
if (A === f) {
|
|
1598
|
-
|
|
1598
|
+
L(null);
|
|
1599
1599
|
return;
|
|
1600
1600
|
}
|
|
1601
1601
|
if (b) {
|
|
@@ -1608,7 +1608,7 @@ function ar({
|
|
|
1608
1608
|
}
|
|
1609
1609
|
if (!ee) return;
|
|
1610
1610
|
}
|
|
1611
|
-
const C = (W ?? []).find((ee) => ee.id === f), U = String((C == null ? void 0 : C.comment_mode) ?? "none"), V =
|
|
1611
|
+
const C = (W ?? []).find((ee) => ee.id === f), U = String((C == null ? void 0 : C.comment_mode) ?? "none"), V = Zt(C, (o == null ? void 0 : o.states) ?? [], (J = o == null ? void 0 : o.instance) == null ? void 0 : J.current_state);
|
|
1612
1612
|
if (U !== "optional" && U !== "required") {
|
|
1613
1613
|
if (C && !De(C, (o == null ? void 0 : o.states) ?? [], (ie = o == null ? void 0 : o.instance) == null ? void 0 : ie.current_state)) {
|
|
1614
1614
|
E.current = !0;
|
|
@@ -1619,19 +1619,19 @@ function ar({
|
|
|
1619
1619
|
E.current = !1;
|
|
1620
1620
|
}
|
|
1621
1621
|
if (ee.length > 0 || V) {
|
|
1622
|
-
K(ee),
|
|
1622
|
+
K(ee), L(f);
|
|
1623
1623
|
return;
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
1626
|
if (V) {
|
|
1627
|
-
K([]),
|
|
1627
|
+
K([]), L(f);
|
|
1628
1628
|
return;
|
|
1629
1629
|
}
|
|
1630
1630
|
Y({ transition_id: f });
|
|
1631
1631
|
return;
|
|
1632
1632
|
}
|
|
1633
|
-
K([]),
|
|
1634
|
-
}, z = k ? ["pipeline-instance", t, e, k] : ["pipeline-instance", t, e], { settling: oe, settle: $ } =
|
|
1633
|
+
K([]), L(f);
|
|
1634
|
+
}, z = k ? ["pipeline-instance", t, e, k] : ["pipeline-instance", t, e], { settling: oe, settle: $ } = Ht(z), { data: o, isLoading: ue } = le({
|
|
1635
1635
|
queryKey: z,
|
|
1636
1636
|
queryFn: () => w.request(
|
|
1637
1637
|
ce(
|
|
@@ -1648,7 +1648,7 @@ function ar({
|
|
|
1648
1648
|
}
|
|
1649
1649
|
),
|
|
1650
1650
|
staleTime: 1e4
|
|
1651
|
-
}), me =
|
|
1651
|
+
}), me = Gt(
|
|
1652
1652
|
o ? (o.available_transitions ?? []).map((f) => String(f.id)) : null,
|
|
1653
1653
|
`${t}:${e}`
|
|
1654
1654
|
);
|
|
@@ -1667,13 +1667,13 @@ function ar({
|
|
|
1667
1667
|
).then((f) => f.data ?? null),
|
|
1668
1668
|
// Also when a send back is on offer: its target may be a chain step this record skipped.
|
|
1669
1669
|
// And while a move is being confirmed: the panel names where it really lands.
|
|
1670
|
-
enabled: (D ||
|
|
1670
|
+
enabled: (D || nn(o) || !!A) && !!(o != null && o.instance),
|
|
1671
1671
|
staleTime: 3e4
|
|
1672
|
-
}), Ne =
|
|
1672
|
+
}), Ne = Be(() => {
|
|
1673
1673
|
if (!ne) return null;
|
|
1674
1674
|
const f = Object.entries(ne);
|
|
1675
1675
|
return f.length === 0 || f.every(([, C]) => C.on_path === void 0) ? null : new Set(f.filter(([, C]) => C.on_path !== !1).map(([C]) => C));
|
|
1676
|
-
}, [ne]), s =
|
|
1676
|
+
}, [ne]), s = Be(() => {
|
|
1677
1677
|
if (!ne) return null;
|
|
1678
1678
|
const f = /* @__PURE__ */ new Map();
|
|
1679
1679
|
for (const [C, U] of Object.entries(ne))
|
|
@@ -1702,7 +1702,7 @@ function ar({
|
|
|
1702
1702
|
onMutate: (f) => {
|
|
1703
1703
|
var C;
|
|
1704
1704
|
return {
|
|
1705
|
-
slow:
|
|
1705
|
+
slow: sn(
|
|
1706
1706
|
(C = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
|
|
1707
1707
|
(U) => U.id === f.transition_id
|
|
1708
1708
|
)) == null ? void 0 : C.label
|
|
@@ -1710,17 +1710,17 @@ function ar({
|
|
|
1710
1710
|
};
|
|
1711
1711
|
},
|
|
1712
1712
|
onSuccess: (f, C, U) => {
|
|
1713
|
-
q.invalidateQueries({ queryKey: z }), t === "nivaro_addendums" && q.invalidateQueries({ queryKey: ["addendums"] }), Ee(q, t, String(e)), Pe(q, t, String(e)),
|
|
1713
|
+
q.invalidateQueries({ queryKey: z }), t === "nivaro_addendums" && q.invalidateQueries({ queryKey: ["addendums"] }), Ee(q, t, String(e)), Pe(q, t, String(e)), ln(q, t, String(e)), T(null), B(""), L(null), g(null), X.success(an(o, C.transition_id, f), U == null ? void 0 : U.slow.done());
|
|
1714
1714
|
},
|
|
1715
1715
|
onError: (f, C, U) => {
|
|
1716
1716
|
var ee;
|
|
1717
|
-
if (U == null || U.slow.fail(),
|
|
1717
|
+
if (U == null || U.slow.fail(), It(f)) {
|
|
1718
1718
|
q.invalidateQueries({ queryKey: z });
|
|
1719
1719
|
return;
|
|
1720
1720
|
}
|
|
1721
|
-
const V =
|
|
1721
|
+
const V = Wt(f);
|
|
1722
1722
|
if (V) {
|
|
1723
|
-
|
|
1723
|
+
L(null);
|
|
1724
1724
|
const ye = ((ee = [...(o == null ? void 0 : o.available_transitions) ?? [], ...(o == null ? void 0 : o.all_transitions) ?? []].find(
|
|
1725
1725
|
(Ae) => Ae.id === C.transition_id
|
|
1726
1726
|
)) == null ? void 0 : ee.label) ?? "Move";
|
|
@@ -1736,7 +1736,7 @@ function ar({
|
|
|
1736
1736
|
});
|
|
1737
1737
|
return;
|
|
1738
1738
|
}
|
|
1739
|
-
const J =
|
|
1739
|
+
const J = Kt(f);
|
|
1740
1740
|
if (J) {
|
|
1741
1741
|
g((ye) => ({
|
|
1742
1742
|
payload: J,
|
|
@@ -1747,21 +1747,21 @@ function ar({
|
|
|
1747
1747
|
return;
|
|
1748
1748
|
}
|
|
1749
1749
|
const ie = f == null ? void 0 : f.response;
|
|
1750
|
-
T(
|
|
1750
|
+
T(zt(f, C)), X.error(Me(f, "Failed to execute transition"), {
|
|
1751
1751
|
duration: 12e3,
|
|
1752
1752
|
// What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
|
|
1753
|
-
...
|
|
1753
|
+
...At(f, { action: "Transition" }),
|
|
1754
1754
|
// #1867: a refusal carries "Why?" — the role, owner or access rule
|
|
1755
1755
|
// that stopped it, and who can change it.
|
|
1756
1756
|
...Lt(f) ? {
|
|
1757
|
-
action:
|
|
1757
|
+
action: Et(w, {
|
|
1758
1758
|
collection: t,
|
|
1759
1759
|
itemId: String(e),
|
|
1760
1760
|
action: "transition",
|
|
1761
1761
|
transitionId: C.transition_id
|
|
1762
1762
|
})
|
|
1763
1763
|
} : {}
|
|
1764
|
-
}), g(null),
|
|
1764
|
+
}), g(null), L(null), Ee(q, t, String(e)), Pe(q, t, String(e)), (ie == null ? void 0 : ie.status) === 409 && q.invalidateQueries({ queryKey: z });
|
|
1765
1765
|
}
|
|
1766
1766
|
}), M = ae(G);
|
|
1767
1767
|
M.current = G;
|
|
@@ -1778,7 +1778,7 @@ function ar({
|
|
|
1778
1778
|
}
|
|
1779
1779
|
M.current(J.id);
|
|
1780
1780
|
};
|
|
1781
|
-
return window.addEventListener(
|
|
1781
|
+
return window.addEventListener(Le, f), () => window.removeEventListener(Le, f);
|
|
1782
1782
|
}, [t, e]), ue)
|
|
1783
1783
|
return /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ i("div", { className: "flex w-full items-center gap-2.5 px-5 py-3.5", children: [
|
|
1784
1784
|
/* @__PURE__ */ n(we, { className: "h-3.5 w-3.5 shrink-0 rounded" }),
|
|
@@ -1787,9 +1787,9 @@ function ar({
|
|
|
1787
1787
|
/* @__PURE__ */ n(we, { className: "ml-auto h-3.5 w-3.5 rounded" })
|
|
1788
1788
|
] }) });
|
|
1789
1789
|
if (!(o != null && o.binding)) return null;
|
|
1790
|
-
const { instance: v, available_transitions: W, history: Z, states: O } = o, de = new Map((O ?? []).map((f) => [f.id, f])), fe = (v == null ? void 0 : v.current_state_obj) ?? null, se = A ? (W ?? []).find((f) => f.id === A) : null,
|
|
1790
|
+
const { instance: v, available_transitions: W, history: Z, states: O } = o, de = new Map((O ?? []).map((f) => [f.id, f])), fe = (v == null ? void 0 : v.current_state_obj) ?? null, se = A ? (W ?? []).find((f) => f.id === A) : null, mn = se ? de.get(se.to_state) : null, Fe = dn(se, fe, O, ne), Ie = (Fe == null ? void 0 : Fe.state) ?? mn, pn = v != null && v.completed_at && W ? W.filter(
|
|
1791
1791
|
(f) => f.from_state && String(f.from_state).toUpperCase() === String(v.current_state).toUpperCase()
|
|
1792
|
-
) : null, Ke = v != null && v.completed_at ?
|
|
1792
|
+
) : null, Ke = v != null && v.completed_at ? pn ?? [] : rn(
|
|
1793
1793
|
W ?? [],
|
|
1794
1794
|
O ?? [],
|
|
1795
1795
|
v == null ? void 0 : v.current_state,
|
|
@@ -1863,7 +1863,7 @@ function ar({
|
|
|
1863
1863
|
] }, V);
|
|
1864
1864
|
});
|
|
1865
1865
|
}, Qe = N ? /* @__PURE__ */ n(
|
|
1866
|
-
|
|
1866
|
+
on,
|
|
1867
1867
|
{
|
|
1868
1868
|
collection: t,
|
|
1869
1869
|
item: String(e),
|
|
@@ -1871,7 +1871,7 @@ function ar({
|
|
|
1871
1871
|
onDismiss: () => T(null),
|
|
1872
1872
|
onFixed: () => Y({ transition_id: N.transitionId, comment: N.comment })
|
|
1873
1873
|
}
|
|
1874
|
-
) : null, ut =
|
|
1874
|
+
) : null, ut = Jn(Z ?? [], v == null ? void 0 : v.current_state, O ?? []), mt = /* @__PURE__ */ i("div", { className: "space-y-3 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3.5", children: [
|
|
1875
1875
|
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1876
1876
|
/* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
|
|
1877
1877
|
se && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: se.label }),
|
|
@@ -1881,16 +1881,16 @@ function ar({
|
|
|
1881
1881
|
/* @__PURE__ */ n(ve, { label: Ie.label, color: Ie.color, small: !0 })
|
|
1882
1882
|
] })
|
|
1883
1883
|
] }),
|
|
1884
|
-
/* @__PURE__ */ n(
|
|
1885
|
-
/* @__PURE__ */ n(
|
|
1886
|
-
/* @__PURE__ */ n(
|
|
1887
|
-
/* @__PURE__ */ n(
|
|
1884
|
+
/* @__PURE__ */ n(cn, { landing: Fe }),
|
|
1885
|
+
/* @__PURE__ */ n(tn, { collection: t, item: String(e), tx: se }),
|
|
1886
|
+
/* @__PURE__ */ n(un, { collection: t, item: e, omitLines: d }),
|
|
1887
|
+
/* @__PURE__ */ n(Jt, { lines: d }),
|
|
1888
1888
|
/* @__PURE__ */ n(
|
|
1889
1889
|
"input",
|
|
1890
1890
|
{
|
|
1891
1891
|
type: "text",
|
|
1892
1892
|
value: F,
|
|
1893
|
-
onChange: (f) =>
|
|
1893
|
+
onChange: (f) => B(f.target.value),
|
|
1894
1894
|
placeholder: String((se == null ? void 0 : se.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
|
|
1895
1895
|
className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30"
|
|
1896
1896
|
}
|
|
@@ -1903,7 +1903,7 @@ function ar({
|
|
|
1903
1903
|
size: "sm",
|
|
1904
1904
|
variant: "ghost",
|
|
1905
1905
|
className: "h-7 text-[12px]",
|
|
1906
|
-
onClick: () =>
|
|
1906
|
+
onClick: () => L(null),
|
|
1907
1907
|
children: "Cancel"
|
|
1908
1908
|
}
|
|
1909
1909
|
),
|
|
@@ -1946,7 +1946,7 @@ function ar({
|
|
|
1946
1946
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
|
|
1947
1947
|
_ && /* @__PURE__ */ n("span", { className: "flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400", children: "Addendum workflow" }),
|
|
1948
1948
|
fe && /* @__PURE__ */ n(ve, { label: fe.label, color: fe.color }),
|
|
1949
|
-
/* @__PURE__ */ n(
|
|
1949
|
+
/* @__PURE__ */ n(en, { flags: o == null ? void 0 : o.flags }),
|
|
1950
1950
|
(((pt = o == null ? void 0 : o.auto_held) == null ? void 0 : pt.length) ?? 0) > 0 && /* @__PURE__ */ i(
|
|
1951
1951
|
"span",
|
|
1952
1952
|
{
|
|
@@ -1955,7 +1955,7 @@ function ar({
|
|
|
1955
1955
|
`),
|
|
1956
1956
|
"data-pipeline-auto-held-pill": !0,
|
|
1957
1957
|
children: [
|
|
1958
|
-
/* @__PURE__ */ n(
|
|
1958
|
+
/* @__PURE__ */ n(bn, { className: "h-3 w-3 shrink-0" }),
|
|
1959
1959
|
"Needs a person"
|
|
1960
1960
|
]
|
|
1961
1961
|
}
|
|
@@ -1971,7 +1971,7 @@ function ar({
|
|
|
1971
1971
|
"data-pipeline-approving": !0,
|
|
1972
1972
|
children: [
|
|
1973
1973
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
|
|
1974
|
-
|
|
1974
|
+
Sn(y, "approving")
|
|
1975
1975
|
]
|
|
1976
1976
|
}
|
|
1977
1977
|
)
|
|
@@ -1995,7 +1995,7 @@ function ar({
|
|
|
1995
1995
|
}
|
|
1996
1996
|
),
|
|
1997
1997
|
l && ((o == null ? void 0 : o.binding) || (o == null ? void 0 : o.instance)) && /* @__PURE__ */ n(
|
|
1998
|
-
|
|
1998
|
+
sr,
|
|
1999
1999
|
{
|
|
2000
2000
|
collection: t,
|
|
2001
2001
|
item: e,
|
|
@@ -2018,9 +2018,9 @@ function ar({
|
|
|
2018
2018
|
),
|
|
2019
2019
|
!D && A && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: mt }),
|
|
2020
2020
|
!D && Qe && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Qe }),
|
|
2021
|
-
ut && !(v != null && v.completed_at) && /* @__PURE__ */ n(
|
|
2021
|
+
ut && !(v != null && v.completed_at) && /* @__PURE__ */ n(Zn, { entry: ut }),
|
|
2022
2022
|
D && /* @__PURE__ */ i("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
|
|
2023
|
-
/* @__PURE__ */ n(
|
|
2023
|
+
/* @__PURE__ */ n(Kn, { held: (o == null ? void 0 : o.auto_held) ?? [] }),
|
|
2024
2024
|
h && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 border-b border-amber-100 bg-amber-50 px-5 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/10", children: [
|
|
2025
2025
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
|
|
2026
2026
|
/* @__PURE__ */ n("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
|
|
@@ -2040,7 +2040,7 @@ function ar({
|
|
|
2040
2040
|
/* @__PURE__ */ n(we, { className: "ml-2 h-3 w-24" })
|
|
2041
2041
|
] })
|
|
2042
2042
|
) : /* @__PURE__ */ n(
|
|
2043
|
-
|
|
2043
|
+
tr,
|
|
2044
2044
|
{
|
|
2045
2045
|
states: O,
|
|
2046
2046
|
allTransitions: (o == null ? void 0 : o.all_transitions) ?? [],
|
|
@@ -2051,9 +2051,9 @@ function ar({
|
|
|
2051
2051
|
skippedStates: s
|
|
2052
2052
|
}
|
|
2053
2053
|
),
|
|
2054
|
-
(o == null ? void 0 : o.branches) && /* @__PURE__ */ n(
|
|
2054
|
+
(o == null ? void 0 : o.branches) && /* @__PURE__ */ n(Un, { data: o.branches }),
|
|
2055
2055
|
/* @__PURE__ */ n(
|
|
2056
|
-
|
|
2056
|
+
er,
|
|
2057
2057
|
{
|
|
2058
2058
|
history: Z ?? [],
|
|
2059
2059
|
completedAt: v.completed_at
|
|
@@ -2061,9 +2061,9 @@ function ar({
|
|
|
2061
2061
|
)
|
|
2062
2062
|
] }),
|
|
2063
2063
|
/* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
|
|
2064
|
-
!v.completed_at && /* @__PURE__ */ n(
|
|
2064
|
+
!v.completed_at && /* @__PURE__ */ n(En, { collection: t, itemId: String(e) }),
|
|
2065
2065
|
/* @__PURE__ */ n(
|
|
2066
|
-
|
|
2066
|
+
ar,
|
|
2067
2067
|
{
|
|
2068
2068
|
collection: t,
|
|
2069
2069
|
item: e,
|
|
@@ -2110,7 +2110,7 @@ function ar({
|
|
|
2110
2110
|
]
|
|
2111
2111
|
}
|
|
2112
2112
|
),
|
|
2113
|
-
I && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(
|
|
2113
|
+
I && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(nr, { history: Z ?? [] }) })
|
|
2114
2114
|
] })
|
|
2115
2115
|
] }) : /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-4 px-5 py-4", children: [
|
|
2116
2116
|
/* @__PURE__ */ n("p", { className: "text-[13px] text-slate-500", children: "Pipeline not started for this record." }),
|
|
@@ -2133,8 +2133,8 @@ function ar({
|
|
|
2133
2133
|
]
|
|
2134
2134
|
}
|
|
2135
2135
|
),
|
|
2136
|
-
u && /* @__PURE__ */ n(
|
|
2137
|
-
|
|
2136
|
+
u && /* @__PURE__ */ n(Dt, { fallback: null, children: /* @__PURE__ */ n(
|
|
2137
|
+
jt,
|
|
2138
2138
|
{
|
|
2139
2139
|
payload: u.payload,
|
|
2140
2140
|
transitionId: u.transitionId,
|
|
@@ -2156,14 +2156,14 @@ function ar({
|
|
|
2156
2156
|
) })
|
|
2157
2157
|
] });
|
|
2158
2158
|
}
|
|
2159
|
-
function
|
|
2159
|
+
function Lr({
|
|
2160
2160
|
collection: t,
|
|
2161
2161
|
item: e,
|
|
2162
2162
|
onBeforeTransition: r,
|
|
2163
2163
|
wrap: a = !0
|
|
2164
2164
|
}) {
|
|
2165
2165
|
return e === "new" ? null : /* @__PURE__ */ n(
|
|
2166
|
-
|
|
2166
|
+
lr,
|
|
2167
2167
|
{
|
|
2168
2168
|
collection: t,
|
|
2169
2169
|
item: e,
|
|
@@ -2172,15 +2172,15 @@ function Ur({
|
|
|
2172
2172
|
}
|
|
2173
2173
|
);
|
|
2174
2174
|
}
|
|
2175
|
-
function
|
|
2175
|
+
function lr({
|
|
2176
2176
|
collection: t,
|
|
2177
2177
|
item: e,
|
|
2178
2178
|
onBeforeTransition: r,
|
|
2179
2179
|
wrap: a = !0
|
|
2180
2180
|
}) {
|
|
2181
|
-
const l = xe(), c = Re(), [m, b] = j(""), [h, _] = j(null), [k, w] = j(null), [q, F] = j(null), [
|
|
2182
|
-
|
|
2183
|
-
const I = ae(null), R =
|
|
2181
|
+
const l = xe(), c = Re(), [m, b] = j(""), [h, _] = j(null), [k, w] = j(null), [q, F] = j(null), [B, A] = j([]), L = Yt(t, String(e));
|
|
2182
|
+
Ot(t, e, "transition", !!h || !!k);
|
|
2183
|
+
const I = ae(null), R = Pn(I, !a), D = ae(!1), Q = (s) => {
|
|
2184
2184
|
D.current || (D.current = !0, F(null), S.mutate(s, {
|
|
2185
2185
|
onSettled: (p, x) => {
|
|
2186
2186
|
if (x) {
|
|
@@ -2209,13 +2209,13 @@ function sr({
|
|
|
2209
2209
|
}
|
|
2210
2210
|
if (!W) return;
|
|
2211
2211
|
}
|
|
2212
|
-
const p = (G ?? []).find((W) => W.id === s), x = String((p == null ? void 0 : p.comment_mode) ?? "none"), M =
|
|
2212
|
+
const p = (G ?? []).find((W) => W.id === s), x = String((p == null ? void 0 : p.comment_mode) ?? "none"), M = Zt(p, (d == null ? void 0 : d.states) ?? [], (P = d == null ? void 0 : d.instance) == null ? void 0 : P.current_state);
|
|
2213
2213
|
if (x !== "optional" && x !== "required") {
|
|
2214
2214
|
if (p && !De(p, (d == null ? void 0 : d.states) ?? [], (v = d == null ? void 0 : d.instance) == null ? void 0 : v.current_state)) {
|
|
2215
2215
|
D.current = !0;
|
|
2216
2216
|
let W = [];
|
|
2217
2217
|
try {
|
|
2218
|
-
W = await
|
|
2218
|
+
W = await L();
|
|
2219
2219
|
} finally {
|
|
2220
2220
|
D.current = !1;
|
|
2221
2221
|
}
|
|
@@ -2232,7 +2232,7 @@ function sr({
|
|
|
2232
2232
|
return;
|
|
2233
2233
|
}
|
|
2234
2234
|
A([]), _(s);
|
|
2235
|
-
}, g = ["pipeline-instance", t, e], { settling: N, settle: T } =
|
|
2235
|
+
}, g = ["pipeline-instance", t, e], { settling: N, settle: T } = Ht(g), { data: d } = le({
|
|
2236
2236
|
queryKey: g,
|
|
2237
2237
|
queryFn: () => l.request(
|
|
2238
2238
|
ce(`/pipelines/instance/${t}/${e}`)
|
|
@@ -2247,7 +2247,7 @@ function sr({
|
|
|
2247
2247
|
}
|
|
2248
2248
|
),
|
|
2249
2249
|
staleTime: 1e4
|
|
2250
|
-
}), K =
|
|
2250
|
+
}), K = Gt(
|
|
2251
2251
|
d ? (d.available_transitions ?? []).map((s) => String(s.id)) : null,
|
|
2252
2252
|
`${t}:${e}`
|
|
2253
2253
|
), { data: te } = le({
|
|
@@ -2256,9 +2256,9 @@ function sr({
|
|
|
2256
2256
|
ce(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
2257
2257
|
).then((s) => s.data ?? null),
|
|
2258
2258
|
// Also while a move is being confirmed: the panel names where it really lands.
|
|
2259
|
-
enabled:
|
|
2259
|
+
enabled: nn(d) || !!h,
|
|
2260
2260
|
staleTime: 3e4
|
|
2261
|
-
}), y =
|
|
2261
|
+
}), y = Be(() => {
|
|
2262
2262
|
if (!te) return null;
|
|
2263
2263
|
const s = /* @__PURE__ */ new Map();
|
|
2264
2264
|
for (const [p, x] of Object.entries(te))
|
|
@@ -2281,7 +2281,7 @@ function sr({
|
|
|
2281
2281
|
onMutate: (s) => {
|
|
2282
2282
|
var p;
|
|
2283
2283
|
return {
|
|
2284
|
-
slow:
|
|
2284
|
+
slow: sn(
|
|
2285
2285
|
(p = [...(d == null ? void 0 : d.available_transitions) ?? [], ...(d == null ? void 0 : d.all_transitions) ?? []].find(
|
|
2286
2286
|
(x) => x.id === s.transition_id
|
|
2287
2287
|
)) == null ? void 0 : p.label
|
|
@@ -2289,15 +2289,15 @@ function sr({
|
|
|
2289
2289
|
};
|
|
2290
2290
|
},
|
|
2291
2291
|
onSuccess: (s, p, x) => {
|
|
2292
|
-
c.invalidateQueries({ queryKey: g }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), Ee(c, t, String(e)), Pe(c, t, String(e)),
|
|
2292
|
+
c.invalidateQueries({ queryKey: g }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), Ee(c, t, String(e)), Pe(c, t, String(e)), ln(c, t, String(e)), F(null), b(""), _(null), w(null), X.success(an(d, p.transition_id, s), x == null ? void 0 : x.slow.done());
|
|
2293
2293
|
},
|
|
2294
2294
|
onError: (s, p, x) => {
|
|
2295
2295
|
var W;
|
|
2296
|
-
if (x == null || x.slow.fail(),
|
|
2296
|
+
if (x == null || x.slow.fail(), It(s)) {
|
|
2297
2297
|
c.invalidateQueries({ queryKey: g });
|
|
2298
2298
|
return;
|
|
2299
2299
|
}
|
|
2300
|
-
const M =
|
|
2300
|
+
const M = Wt(s);
|
|
2301
2301
|
if (M) {
|
|
2302
2302
|
_(null);
|
|
2303
2303
|
const Z = ((W = [...(d == null ? void 0 : d.available_transitions) ?? [], ...(d == null ? void 0 : d.all_transitions) ?? []].find(
|
|
@@ -2315,7 +2315,7 @@ function sr({
|
|
|
2315
2315
|
});
|
|
2316
2316
|
return;
|
|
2317
2317
|
}
|
|
2318
|
-
const P =
|
|
2318
|
+
const P = Kt(s);
|
|
2319
2319
|
if (P) {
|
|
2320
2320
|
w((Z) => ({
|
|
2321
2321
|
payload: P,
|
|
@@ -2326,14 +2326,14 @@ function sr({
|
|
|
2326
2326
|
return;
|
|
2327
2327
|
}
|
|
2328
2328
|
const v = s == null ? void 0 : s.response;
|
|
2329
|
-
F(
|
|
2329
|
+
F(zt(s, p)), X.error(Me(s, "Failed to execute transition"), {
|
|
2330
2330
|
duration: 12e3,
|
|
2331
2331
|
// What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
|
|
2332
|
-
...
|
|
2332
|
+
...At(s, { action: "Transition" }),
|
|
2333
2333
|
// #1867: a refusal carries "Why?" — the role, owner or access rule
|
|
2334
2334
|
// that stopped it, and who can change it.
|
|
2335
2335
|
...Lt(s) ? {
|
|
2336
|
-
action:
|
|
2336
|
+
action: Et(l, {
|
|
2337
2337
|
collection: t,
|
|
2338
2338
|
itemId: String(e),
|
|
2339
2339
|
action: "transition",
|
|
@@ -2357,9 +2357,9 @@ function sr({
|
|
|
2357
2357
|
}
|
|
2358
2358
|
E.current(P.id);
|
|
2359
2359
|
};
|
|
2360
|
-
return window.addEventListener(
|
|
2360
|
+
return window.addEventListener(Le, s), () => window.removeEventListener(Le, s);
|
|
2361
2361
|
}, [t, e]), !(d != null && d.binding) || !(d != null && d.instance)) return null;
|
|
2362
|
-
const G =
|
|
2362
|
+
const G = rn(
|
|
2363
2363
|
(d.available_transitions ?? []).filter(
|
|
2364
2364
|
(s) => !d.instance.completed_at || s.from_state && String(s.from_state).toUpperCase() === String(d.instance.current_state).toUpperCase()
|
|
2365
2365
|
),
|
|
@@ -2368,7 +2368,7 @@ function sr({
|
|
|
2368
2368
|
d.instance.completed_at ? null : y
|
|
2369
2369
|
);
|
|
2370
2370
|
if (G.length === 0) return null;
|
|
2371
|
-
const z = new Map((d.states ?? []).map((s) => [s.id, s])), oe = d.instance.current_state_obj ?? null, $ = h ? G.find((s) => s.id === h) : null, o = $ ? z.get($.to_state) : null, ue =
|
|
2371
|
+
const z = new Map((d.states ?? []).map((s) => [s.id, s])), oe = d.instance.current_state_obj ?? null, $ = h ? G.find((s) => s.id === h) : null, o = $ ? z.get($.to_state) : null, ue = dn($, oe, d.states ?? [], te), me = (ue == null ? void 0 : ue.state) ?? o, ne = /* @__PURE__ */ new Map();
|
|
2372
2372
|
for (const s of G) {
|
|
2373
2373
|
const p = ne.get(s.label) ?? [];
|
|
2374
2374
|
p.push(s), ne.set(s.label, p);
|
|
@@ -2403,8 +2403,8 @@ function sr({
|
|
|
2403
2403
|
}
|
|
2404
2404
|
) }),
|
|
2405
2405
|
/* @__PURE__ */ n(Ye, { align: "end", className: "min-w-[200px]", children: Array.from(ne.entries()).map(
|
|
2406
|
-
([s, p], x, M) => p.length === 1 ? /* @__PURE__ */ i(
|
|
2407
|
-
x > 0 && M[x - 1][1].length > 1 && /* @__PURE__ */ n(
|
|
2406
|
+
([s, p], x, M) => p.length === 1 ? /* @__PURE__ */ i(wt, { children: [
|
|
2407
|
+
x > 0 && M[x - 1][1].length > 1 && /* @__PURE__ */ n(vt, {}),
|
|
2408
2408
|
/* @__PURE__ */ i(Oe, { onSelect: () => u(p[0].id), children: [
|
|
2409
2409
|
p[0].color && /* @__PURE__ */ n(
|
|
2410
2410
|
"span",
|
|
@@ -2415,9 +2415,9 @@ function sr({
|
|
|
2415
2415
|
),
|
|
2416
2416
|
s
|
|
2417
2417
|
] })
|
|
2418
|
-
] }, s) : /* @__PURE__ */ i(
|
|
2419
|
-
x > 0 && /* @__PURE__ */ n(
|
|
2420
|
-
/* @__PURE__ */ n(
|
|
2418
|
+
] }, s) : /* @__PURE__ */ i(wt, { children: [
|
|
2419
|
+
x > 0 && /* @__PURE__ */ n(vt, {}),
|
|
2420
|
+
/* @__PURE__ */ n(An, { className: "text-[11px] text-muted-foreground", children: s }),
|
|
2421
2421
|
ke(p).map((P) => {
|
|
2422
2422
|
var v;
|
|
2423
2423
|
return /* @__PURE__ */ i(Oe, { onSelect: () => u(P.id), children: [
|
|
@@ -2438,7 +2438,7 @@ function sr({
|
|
|
2438
2438
|
{
|
|
2439
2439
|
className: a ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
|
|
2440
2440
|
children: [
|
|
2441
|
-
/* @__PURE__ */ n(
|
|
2441
|
+
/* @__PURE__ */ n(en, { flags: d == null ? void 0 : d.flags }),
|
|
2442
2442
|
Array.from(ne.entries()).map(([s, p]) => {
|
|
2443
2443
|
var W, Z;
|
|
2444
2444
|
const x = p.some((O) => {
|
|
@@ -2461,7 +2461,7 @@ function sr({
|
|
|
2461
2461
|
K.press(O.id) && u(O.id);
|
|
2462
2462
|
},
|
|
2463
2463
|
children: [
|
|
2464
|
-
de ? /* @__PURE__ */ n(pe, { className: "h-3 w-3 animate-spin" }) : x && /* @__PURE__ */ n(
|
|
2464
|
+
de ? /* @__PURE__ */ n(pe, { className: "h-3 w-3 animate-spin" }) : x && /* @__PURE__ */ n(qt, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
2465
2465
|
s
|
|
2466
2466
|
]
|
|
2467
2467
|
},
|
|
@@ -2470,7 +2470,7 @@ function sr({
|
|
|
2470
2470
|
return O.pushes && O.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
|
|
2471
2471
|
fe,
|
|
2472
2472
|
/* @__PURE__ */ n(
|
|
2473
|
-
|
|
2473
|
+
Mn,
|
|
2474
2474
|
{
|
|
2475
2475
|
collection: t,
|
|
2476
2476
|
itemId: e,
|
|
@@ -2529,10 +2529,10 @@ function sr({
|
|
|
2529
2529
|
/* @__PURE__ */ n(ve, { label: me.label, color: me.color, small: !0 })
|
|
2530
2530
|
] })
|
|
2531
2531
|
] }),
|
|
2532
|
-
/* @__PURE__ */ n(
|
|
2533
|
-
/* @__PURE__ */ n(
|
|
2534
|
-
/* @__PURE__ */ n(
|
|
2535
|
-
/* @__PURE__ */ n(
|
|
2532
|
+
/* @__PURE__ */ n(cn, { landing: ue }),
|
|
2533
|
+
/* @__PURE__ */ n(tn, { collection: t, item: String(e), tx: $ }),
|
|
2534
|
+
/* @__PURE__ */ n(un, { collection: t, item: e, omitLines: B }),
|
|
2535
|
+
/* @__PURE__ */ n(Jt, { lines: B }),
|
|
2536
2536
|
/* @__PURE__ */ n(
|
|
2537
2537
|
"input",
|
|
2538
2538
|
{
|
|
@@ -2567,7 +2567,7 @@ function sr({
|
|
|
2567
2567
|
comment: m.trim() || void 0
|
|
2568
2568
|
}),
|
|
2569
2569
|
children: S.isPending ? /* @__PURE__ */ n(pe, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(be, { children: [
|
|
2570
|
-
/* @__PURE__ */ n("span", { children:
|
|
2570
|
+
/* @__PURE__ */ n("span", { children: B.length > 0 && $ ? `${$.label} anyway` : "Confirm" }),
|
|
2571
2571
|
/* @__PURE__ */ n(je, { className: "h-3 w-3" })
|
|
2572
2572
|
] })
|
|
2573
2573
|
}
|
|
@@ -2577,7 +2577,7 @@ function sr({
|
|
|
2577
2577
|
}
|
|
2578
2578
|
),
|
|
2579
2579
|
q && !h && /* @__PURE__ */ n(
|
|
2580
|
-
|
|
2580
|
+
on,
|
|
2581
2581
|
{
|
|
2582
2582
|
collection: t,
|
|
2583
2583
|
item: String(e),
|
|
@@ -2588,8 +2588,8 @@ function sr({
|
|
|
2588
2588
|
onFixed: () => Q({ transition_id: q.transitionId, comment: q.comment })
|
|
2589
2589
|
}
|
|
2590
2590
|
),
|
|
2591
|
-
k && /* @__PURE__ */ n(
|
|
2592
|
-
|
|
2591
|
+
k && /* @__PURE__ */ n(Dt, { fallback: null, children: /* @__PURE__ */ n(
|
|
2592
|
+
jt,
|
|
2593
2593
|
{
|
|
2594
2594
|
payload: k.payload,
|
|
2595
2595
|
transitionId: k.transitionId,
|
|
@@ -2613,25 +2613,25 @@ function sr({
|
|
|
2613
2613
|
}
|
|
2614
2614
|
export {
|
|
2615
2615
|
$e as FRESH_BUTTON_MS,
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2616
|
+
_t as FRESH_HOVER_MAX_MS,
|
|
2617
|
+
zn as FreshButtonGuard,
|
|
2618
|
+
Br as PipelinePanel,
|
|
2619
|
+
Lr as PipelineTransitionButtons,
|
|
2620
|
+
Qn as REFUSAL_FIX_ACTIONS,
|
|
2621
|
+
en as RecordFlagChips,
|
|
2622
|
+
Yn as SLOW_MOVE_MS,
|
|
2623
|
+
Zt as asksFirst,
|
|
2624
|
+
Gn as briefAgeText,
|
|
2625
|
+
Vn as briefDiffPair,
|
|
2626
|
+
St as briefLineKey,
|
|
2627
|
+
Hn as briefWarnings,
|
|
2628
|
+
It as isDuplicateTransition,
|
|
2629
|
+
Jn as latestSendBack,
|
|
2630
|
+
Wt as lockedMoveOffer,
|
|
2631
|
+
Qt as refusalCode,
|
|
2632
|
+
zt as refusalFixFor,
|
|
2633
|
+
sn as slowMoveToast,
|
|
2634
|
+
Kt as transitionRequirementsFromError,
|
|
2635
|
+
an as transitionToastText,
|
|
2636
|
+
rn as withoutSkippedSendBacks
|
|
2637
2637
|
};
|