@nivaro/react 0.3.100 → 0.3.101
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 +46 -3
- package/dist/index.js +623 -620
- package/dist/shared/components/ActivityEntry.js +5 -5
- package/dist/shared/components/ItemEditForm.js +2708 -2704
- package/dist/shared/components/JobsTray.js +74 -63
- package/dist/shared/components/NotificationBell.js +80 -73
- package/dist/shared/components/TipLayer.js +56 -41
- package/dist/shared/components/integrations/console/SignalCard.js +40 -40
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
- package/dist/shared/components/integrations/console/drill/status.js +23 -18
- package/dist/shared/components/item-edit/RecordInsights.js +86 -86
- package/dist/shared/components/item-edit/header-path-preview.js +46 -34
- package/dist/shared/components/notifications/DeliveryChips.js +1 -2
- package/dist/shared/components/panels/BackgroundMove.js +152 -85
- package/dist/shared/components/panels/PipelinePanel.js +602 -594
- package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
- package/dist/shared/components/profile/DayTimeline.js +145 -140
- package/dist/shared/components/profile/PersonAccess.js +679 -383
- package/dist/shared/components/profile/PersonActivity.js +404 -427
- package/dist/shared/components/profile/PersonDidPanel.js +248 -134
- package/dist/shared/components/profile/PersonProfile.js +33 -32
- package/dist/shared/components/profile/journey-view.js +166 -0
- package/dist/shared/lib/activity-sentence.js +319 -236
- package/dist/shared/lib/jobs-tray.js +60 -41
- package/dist/shared/lib/move-failure.js +16 -6
- package/dist/shared/lib/obligation-banner.js +16 -16
- package/dist/shared/lib/partner-failure.js +44 -32
- package/package.json +1 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Kn = Object.defineProperty;
|
|
2
|
+
var Wn = (t, e, r) => e in t ? Kn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var lt = (t, e, r) => Wn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
4
|
import { jsx as n, jsxs as i, Fragment as Se } from "react/jsx-runtime";
|
|
5
|
-
import { useQueryClient as
|
|
6
|
-
import { ArrowRight as
|
|
7
|
-
import { useState as Q, useRef as
|
|
5
|
+
import { useQueryClient as Ve, useQuery as be, useMutation as Qe } from "@tanstack/react-query";
|
|
6
|
+
import { ArrowRight as Nt, Loader2 as ye, Check as rt, GitBranch as dt, AlertTriangle as Vt, ChevronDown as Fe, Send as Xt, Users as Yt, Undo2 as zn, Minus as Hn, UserPlus as Gn, X as Jt, Zap as Zt, Search as Vn } from "lucide-react";
|
|
7
|
+
import { useState as Q, useRef as ce, useEffect as _e, useMemo as et, Suspense as en, useCallback as tn, lazy as Xn, Fragment as Yn } from "react";
|
|
8
8
|
import { toast as V } from "sonner";
|
|
9
9
|
import { useNivaroClient as Pe, useItemEditAuth as nn } from "../../context.js";
|
|
10
|
-
import { get as
|
|
11
|
-
import { errorToastOptions as rn, toastError as
|
|
10
|
+
import { get as we, post as Ge, del as Jn } from "../../lib/commands.js";
|
|
11
|
+
import { errorToastOptions as rn, toastError as Zn } from "../../lib/error-toast.js";
|
|
12
|
+
import { partnerMoveFailure as an, partnerMoveReading as sn } from "../../lib/move-failure.js";
|
|
12
13
|
import { OPEN_MOVE_STATE_EVENT as Lt } from "../../lib/move-state.js";
|
|
13
|
-
import { useRecordSignalWhile as
|
|
14
|
-
import { RUN_TRANSITION_EVENT as
|
|
15
|
-
import { partnerMoveFailure as sn } from "../../lib/move-failure.js";
|
|
14
|
+
import { useRecordSignalWhile as on, useRecordSignalPeers as er, signalSentence as tr } from "../../lib/presence-signals.js";
|
|
15
|
+
import { RUN_TRANSITION_EVENT as tt } from "../../lib/run-transition.js";
|
|
16
16
|
import { userErrorMessage as Ae } from "../../lib/safe-error.js";
|
|
17
|
-
import { serverNow as
|
|
18
|
-
import { userCardQuery as
|
|
19
|
-
import { cn as ge, titleCase as
|
|
20
|
-
import { PushReadinessChip as
|
|
21
|
-
import { useHeaderFold as
|
|
22
|
-
import { invalidateRecordInsights as
|
|
23
|
-
import { UserChip as
|
|
24
|
-
import { OwnerAvatars as
|
|
25
|
-
import { UserAvatar as
|
|
26
|
-
import { Button as
|
|
27
|
-
import { DropdownMenu as
|
|
28
|
-
import { Popover as
|
|
17
|
+
import { serverNow as nr } from "../../lib/server-clock.js";
|
|
18
|
+
import { userCardQuery as rr } from "../../lib/user-cards.js";
|
|
19
|
+
import { cn as ge, titleCase as ar, toLocalDateString as sr, formatRelative as _t, formatDateTime as Et, humanHours as ir } from "../../lib/utils.js";
|
|
20
|
+
import { PushReadinessChip as or } from "../integrations/RecordIntegrationPreview.js";
|
|
21
|
+
import { useHeaderFold as lr } from "../item-edit/HeaderTools.js";
|
|
22
|
+
import { invalidateRecordInsights as Ie, invalidateRecordData as je } from "../item-edit/RecordInsights.js";
|
|
23
|
+
import { UserChip as ln } from "../item-edit/UserChip.js";
|
|
24
|
+
import { OwnerAvatars as dr } from "../queue/OwnerAvatars.js";
|
|
25
|
+
import { UserAvatar as cr } from "../UserAvatar.js";
|
|
26
|
+
import { Button as pe } from "../ui/button.js";
|
|
27
|
+
import { DropdownMenu as mt, DropdownMenuTrigger as pt, DropdownMenuContent as ft, DropdownMenuGroup as It, DropdownMenuSeparator as ht, DropdownMenuItem as Je, DropdownMenuLabel as ur } from "../ui/dropdown-menu.js";
|
|
28
|
+
import { Popover as St, PopoverTrigger as Ct, PopoverContent as $t } from "../ui/popover.js";
|
|
29
29
|
import { Skeleton as Me } from "../ui/skeleton.js";
|
|
30
|
-
import { TooltipProvider as
|
|
31
|
-
import { isAccessRefusal as
|
|
32
|
-
import { runningMovePoll as
|
|
33
|
-
import { BranchLanes as
|
|
34
|
-
import { landingState as
|
|
35
|
-
import { distinctAdvisories as
|
|
36
|
-
import { MoveToStatePanel as
|
|
37
|
-
import { SlaClockLine as
|
|
38
|
-
const
|
|
30
|
+
import { TooltipProvider as dn, Tooltip as bt, TooltipTrigger as gt, TooltipContent as xt } from "../ui/tooltip.js";
|
|
31
|
+
import { isAccessRefusal as cn, deniedToastAction as un, WhyOwnersButton as mr } from "./AccessInsights.js";
|
|
32
|
+
import { runningMovePoll as mn, useRunEnded as pn, startedInBackground as fn, pendingOptIn as hn, sameMoveId as vt, runningMoveTip as pr, unansweredHoldTip as bn, RunningMoveNotice as fr, MoveProblemNotice as hr } from "./BackgroundMove.js";
|
|
33
|
+
import { BranchLanes as br } from "./BranchLanes.js";
|
|
34
|
+
import { landingState as gr, landingSkipGroups as xr, joinLabels as jt } from "./landing-state.js";
|
|
35
|
+
import { distinctAdvisories as gn, MoveAdvisoryNotice as xn, REFUSAL_FIX_ACTIONS as vr, useRecordFixAction as yr } from "./MoveAdvisory.js";
|
|
36
|
+
import { MoveToStatePanel as wr } from "./MoveToStatePanel.js";
|
|
37
|
+
import { SlaClockLine as kr } from "./SlaClock.js";
|
|
38
|
+
const vn = Xn(
|
|
39
39
|
() => import("./TransitionRequirementsDialog.js").then((t) => ({
|
|
40
40
|
default: t.TransitionRequirementsDialog
|
|
41
41
|
}))
|
|
42
42
|
);
|
|
43
|
-
function
|
|
43
|
+
function Tt(t, e) {
|
|
44
44
|
const r = t || "System";
|
|
45
45
|
return e.on_behalf_of_name ? `${r}, for ${e.on_behalf_of_name}` : r;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Nr(t) {
|
|
48
48
|
if (t.transition) return null;
|
|
49
49
|
const e = (t.comment ?? "").trim();
|
|
50
50
|
if (!e.startsWith("{")) return null;
|
|
@@ -58,14 +58,14 @@ function wr(t) {
|
|
|
58
58
|
}
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Ze(t) {
|
|
62
62
|
return !(t.first_name || t.last_name || t.user_email);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function yt(t) {
|
|
65
65
|
const e = (t.comment ?? "").trim().toLowerCase();
|
|
66
66
|
return t.origin === "import" || e.startsWith("import:") ? "Imported" : t.origin === "integration" ? "By an integration" : /-state-sync$/.test(e) || e.startsWith("legacy-") ? "Synced from another system" : e === "state-merge" || e === "instance-migration" ? "Moved by an admin script" : "Moved automatically";
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function wt(t) {
|
|
69
69
|
if (t.transition_text) return t.transition_text;
|
|
70
70
|
if (t.transition_label) return `Rule: ${t.transition_label}`;
|
|
71
71
|
const e = (t.comment ?? "").trim(), r = /^auto: (.+)$/i.exec(e);
|
|
@@ -79,11 +79,11 @@ const Qt = {
|
|
|
79
79
|
rate_limited: "the partner asked us to slow down",
|
|
80
80
|
unknown: "the partner refused it"
|
|
81
81
|
};
|
|
82
|
-
function
|
|
83
|
-
const e = Math.ceil((new Date(t).getTime() -
|
|
82
|
+
function _r(t) {
|
|
83
|
+
const e = Math.ceil((new Date(t).getTime() - nr()) / 6e4);
|
|
84
84
|
return !Number.isFinite(e) || e <= 0 ? "on the next check" : e < 60 ? `in ${e} min` : `in ${Math.round(e / 60)}h`;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Sr({ held: t }) {
|
|
87
87
|
return t.length === 0 ? null : /* @__PURE__ */ n(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
@@ -108,7 +108,7 @@ function Nr({ held: t }) {
|
|
|
108
108
|
}
|
|
109
109
|
),
|
|
110
110
|
/* @__PURE__ */ i("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: [
|
|
111
|
-
e.retry_at ? `It tries the same push again ${
|
|
111
|
+
e.retry_at ? `It tries the same push again ${_r(e.retry_at)}. ` : "It will not send the same push again on its own. ",
|
|
112
112
|
"Fix the record so what it sends changes, retry the push, or move the record by hand.",
|
|
113
113
|
e.attempts > 1 ? ` ${e.attempts} attempts so far.` : ""
|
|
114
114
|
] })
|
|
@@ -117,40 +117,40 @@ function Nr({ held: t }) {
|
|
|
117
117
|
}
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function yn(t) {
|
|
121
121
|
var r;
|
|
122
122
|
const e = t == null ? void 0 : t.response;
|
|
123
123
|
return ((e == null ? void 0 : e.code) ?? ((r = e == null ? void 0 : e.data) == null ? void 0 : r.code)) === "TRANSITION_DUPLICATE";
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function wn(t) {
|
|
126
126
|
var r;
|
|
127
127
|
const e = t;
|
|
128
128
|
return (e == null ? void 0 : e.status) === 422 && ((r = e.response) == null ? void 0 : r.error) === "TRANSITION_REQUIREMENTS" ? e.response.requirements ?? [] : null;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function at(t) {
|
|
131
131
|
var s;
|
|
132
132
|
const e = t == null ? void 0 : t.response, r = (e == null ? void 0 : e.code) ?? ((s = e == null ? void 0 : e.data) == null ? void 0 : s.code);
|
|
133
133
|
return typeof r == "string" ? r : null;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
if (
|
|
135
|
+
function kn(t) {
|
|
136
|
+
if (at(t) !== "RECORD_LOCKED") return null;
|
|
137
137
|
const e = t == null ? void 0 : t.response, r = e != null && e.data && typeof e.data == "object" ? e.data : e;
|
|
138
138
|
if ((r == null ? void 0 : r.move_anyway) !== !0) return null;
|
|
139
139
|
const s = typeof r.locked_by_name == "string" ? r.locked_by_name : null;
|
|
140
140
|
return { message: typeof r.error == "string" && r.error.trim() ? r.error : `${s ?? "Someone else"} is editing this record right now.`, holder: s };
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function Nn(t, e) {
|
|
143
143
|
var m, h, p;
|
|
144
|
-
const r =
|
|
144
|
+
const r = at(t), s = t == null ? void 0 : t.response, o = ((m = s == null ? void 0 : s.fix) == null ? void 0 : m.action) ?? ((p = (h = s == null ? void 0 : s.data) == null ? void 0 : h.fix) == null ? void 0 : p.action), c = typeof o == "string" && o.trim() || (r ? vr[r] : void 0);
|
|
145
145
|
return !r || !c ? null : { code: r, actionKey: c, transitionId: e.transition_id, comment: e.comment };
|
|
146
146
|
}
|
|
147
|
-
const
|
|
148
|
-
function
|
|
149
|
-
const e =
|
|
147
|
+
const Cr = 600;
|
|
148
|
+
function _n(t) {
|
|
149
|
+
const e = Ve(), [r, s] = Q(!1), o = ce(!0);
|
|
150
150
|
_e(() => (o.current = !0, () => {
|
|
151
151
|
o.current = !1;
|
|
152
152
|
}), []);
|
|
153
|
-
const c =
|
|
153
|
+
const c = ce(t);
|
|
154
154
|
c.current = t;
|
|
155
155
|
const m = tn(async () => {
|
|
156
156
|
s(!0);
|
|
@@ -158,15 +158,15 @@ function kn(t) {
|
|
|
158
158
|
await e.refetchQueries({ queryKey: [...c.current], type: "active" });
|
|
159
159
|
} catch {
|
|
160
160
|
}
|
|
161
|
-
await new Promise((h) => setTimeout(h,
|
|
161
|
+
await new Promise((h) => setTimeout(h, Cr)), o.current && s(!1);
|
|
162
162
|
}, [e]);
|
|
163
163
|
return { settling: r, settle: m };
|
|
164
164
|
}
|
|
165
|
-
const
|
|
166
|
-
class
|
|
165
|
+
const Be = 1500, Kt = 4e3;
|
|
166
|
+
class $r {
|
|
167
167
|
constructor() {
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
lt(this, "seen", null);
|
|
169
|
+
lt(this, "fresh", /* @__PURE__ */ new Map());
|
|
170
170
|
}
|
|
171
171
|
/** Feed the ids on offer now. */
|
|
172
172
|
observe(e, r) {
|
|
@@ -180,7 +180,7 @@ class Sr {
|
|
|
180
180
|
/** The pointer is on the button. */
|
|
181
181
|
enter(e, r) {
|
|
182
182
|
const s = this.fresh.get(String(e).toUpperCase());
|
|
183
|
-
s && !s.left && r - s.at <
|
|
183
|
+
s && !s.left && r - s.at < Be && (s.hovered = !0);
|
|
184
184
|
}
|
|
185
185
|
/** The pointer left the button. */
|
|
186
186
|
leave(e) {
|
|
@@ -190,38 +190,38 @@ class Sr {
|
|
|
190
190
|
/** Still inert (no state change)? */
|
|
191
191
|
inert(e, r) {
|
|
192
192
|
const s = this.fresh.get(String(e).toUpperCase());
|
|
193
|
-
return !s || r - s.at >= Kt ? !1 : r - s.at <
|
|
193
|
+
return !s || r - s.at >= Kt ? !1 : r - s.at < Be || s.hovered && !s.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 s = String(e).toUpperCase(), o = this.fresh.get(s);
|
|
198
|
-
return o ? r - o.at <
|
|
198
|
+
return o ? r - o.at < Be ? (o.hovered = !0, o.left = !1, !1) : o.hovered && !o.left && r - o.at < Kt ? !1 : (this.fresh.delete(s), !0) : !0;
|
|
199
199
|
}
|
|
200
200
|
/** Inside its time window (drawn dimmed)? */
|
|
201
201
|
timed(e, r) {
|
|
202
202
|
const s = this.fresh.get(String(e).toUpperCase());
|
|
203
|
-
return !!s && r - s.at <
|
|
203
|
+
return !!s && r - s.at < Be;
|
|
204
204
|
}
|
|
205
205
|
/** Any button still inside its time window? */
|
|
206
206
|
hasTimed(e) {
|
|
207
|
-
for (const r of this.fresh.values()) if (e - r.at <
|
|
207
|
+
for (const r of this.fresh.values()) if (e - r.at < Be) return !0;
|
|
208
208
|
return !1;
|
|
209
209
|
}
|
|
210
210
|
reset() {
|
|
211
211
|
this.seen = null, this.fresh.clear();
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
const r =
|
|
216
|
-
r.current || (r.current = new
|
|
217
|
-
const s = r.current, o =
|
|
214
|
+
function Sn(t, e) {
|
|
215
|
+
const r = ce(null);
|
|
216
|
+
r.current || (r.current = new $r());
|
|
217
|
+
const s = r.current, o = ce(e);
|
|
218
218
|
o.current !== e && (o.current = e, s.reset());
|
|
219
219
|
const [, c] = Q(0), m = t ? t.join(",") : null;
|
|
220
|
-
return
|
|
220
|
+
return et(() => {
|
|
221
221
|
t && s.observe(t, Date.now());
|
|
222
222
|
}, [s, m]), _e(() => {
|
|
223
223
|
if (!s.hasTimed(Date.now())) return;
|
|
224
|
-
const h = setTimeout(() => c((p) => p + 1),
|
|
224
|
+
const h = setTimeout(() => c((p) => p + 1), Be + 20);
|
|
225
225
|
return () => clearTimeout(h);
|
|
226
226
|
}, [s, m]), {
|
|
227
227
|
dimmed: (h) => s.timed(h, Date.now()),
|
|
@@ -233,58 +233,58 @@ function Nn(t, e) {
|
|
|
233
233
|
})
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function Cn(t, e) {
|
|
237
237
|
return ["approval-brief", t, String(e)];
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function $n(t, e, r) {
|
|
240
240
|
return t.request(
|
|
241
|
-
|
|
241
|
+
we(`/pipelines/instance/${e}/${r}/approval-brief`)
|
|
242
242
|
).then((s) => s.data);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Tr(t) {
|
|
245
245
|
return (t ?? []).filter((e) => e.tone === "warn" || e.tone === "danger");
|
|
246
246
|
}
|
|
247
247
|
function Wt(t) {
|
|
248
248
|
return `${(t.label ?? "").trim().toLowerCase()}|${(t.text ?? "").trim().toLowerCase()}`;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function qr(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 Mr(t, e, r = 40) {
|
|
255
255
|
const s = (x) => x == null || x === "" ? "" : String(x), o = s(t), c = s(e), m = (x) => x === "" ? "(empty)" : x;
|
|
256
|
-
if (t === void 0) return { old: null, new:
|
|
256
|
+
if (t === void 0) return { old: null, new: ct(m(c), 0, r) };
|
|
257
257
|
if (o.length <= r && c.length <= r) return { old: m(o), new: m(c) };
|
|
258
258
|
let h = 0;
|
|
259
259
|
for (; h < o.length && h < c.length && o[h] === c[h]; ) h++;
|
|
260
260
|
const p = h > r / 2 ? h - Math.floor(r / 3) : 0;
|
|
261
|
-
return { old:
|
|
261
|
+
return { old: ct(m(o), p, r), new: ct(m(c), p, r) };
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function ct(t, e, r) {
|
|
264
264
|
const s = Math.min(e, Math.max(0, t.length - r)), o = t.slice(s, s + r);
|
|
265
265
|
return `${s > 0 ? "…" : ""}${o}${s + r < t.length ? "…" : ""}`;
|
|
266
266
|
}
|
|
267
|
-
const
|
|
268
|
-
function
|
|
269
|
-
const r = Pe(), s =
|
|
267
|
+
const Rr = 4e3;
|
|
268
|
+
function Tn(t, e) {
|
|
269
|
+
const r = Pe(), s = Ve();
|
|
270
270
|
return tn(async () => {
|
|
271
271
|
try {
|
|
272
272
|
const o = await Promise.race([
|
|
273
273
|
s.fetchQuery({
|
|
274
|
-
queryKey:
|
|
275
|
-
queryFn: () =>
|
|
274
|
+
queryKey: Cn(t, e),
|
|
275
|
+
queryFn: () => $n(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), Rr))
|
|
280
280
|
]);
|
|
281
|
-
return
|
|
281
|
+
return Tr(o == null ? void 0 : o.lines);
|
|
282
282
|
} catch {
|
|
283
283
|
return [];
|
|
284
284
|
}
|
|
285
285
|
}, [r, s, t, e]);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function qn({ lines: t }) {
|
|
288
288
|
return t.length === 0 ? null : /* @__PURE__ */ i(
|
|
289
289
|
"div",
|
|
290
290
|
{
|
|
@@ -300,18 +300,18 @@ function $n({ lines: t }) {
|
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Xe(t, e, r) {
|
|
304
304
|
if (!r) return !1;
|
|
305
305
|
const s = e.find(
|
|
306
306
|
(c) => String(c.id).toUpperCase() === String(r).toUpperCase()
|
|
307
307
|
), o = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
|
|
308
308
|
return !!s && !!o && o.sort < s.sort;
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function qt(t, e, r) {
|
|
311
311
|
var o;
|
|
312
312
|
if (!t) return !1;
|
|
313
313
|
if ((((o = t.order_partners) == null ? void 0 : o.length) ?? 0) > 0) return !0;
|
|
314
|
-
if (
|
|
314
|
+
if (Xe(t, e, r)) return !1;
|
|
315
315
|
const s = e.find((c) => String(c.id).toUpperCase() === String(t.to_state).toUpperCase());
|
|
316
316
|
return !!(s != null && s.is_terminal) && !/(^|_)cancel/i.test(String(s.key ?? ""));
|
|
317
317
|
}
|
|
@@ -323,7 +323,7 @@ const zt = {
|
|
|
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 Pr({ flags: t }) {
|
|
327
327
|
return !t || t.length === 0 ? null : /* @__PURE__ */ n(Se, { children: t.map((e) => /* @__PURE__ */ i(
|
|
328
328
|
"span",
|
|
329
329
|
{
|
|
@@ -343,7 +343,7 @@ function Mr({ flags: t }) {
|
|
|
343
343
|
function Ht(t) {
|
|
344
344
|
return t.replace(/\s+IIP$/i, "");
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Mn({
|
|
347
347
|
collection: t,
|
|
348
348
|
item: e,
|
|
349
349
|
tx: r
|
|
@@ -351,7 +351,7 @@ function Tn({
|
|
|
351
351
|
const s = Pe(), o = (r == null ? void 0 : r.order_partners) ?? [], { data: c } = be({
|
|
352
352
|
queryKey: ["push-preflight", t, e, "t", (r == null ? void 0 : r.id) ?? ""],
|
|
353
353
|
queryFn: () => s.request(
|
|
354
|
-
|
|
354
|
+
we(`/integration-preview/${t}/${encodeURIComponent(e)}/preflight`, {
|
|
355
355
|
transition_id: (r == null ? void 0 : r.id) ?? ""
|
|
356
356
|
})
|
|
357
357
|
).then((p) => p.data),
|
|
@@ -372,35 +372,35 @@ function Tn({
|
|
|
372
372
|
}
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function Rn(t) {
|
|
376
376
|
return t != null && t.instance ? (t.available_transitions ?? []).some(
|
|
377
377
|
(e) => {
|
|
378
378
|
var r;
|
|
379
|
-
return
|
|
379
|
+
return Xe(e, t.states ?? [], (r = t.instance) == null ? void 0 : r.current_state);
|
|
380
380
|
}
|
|
381
381
|
) : !1;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Pn(t, e, r, s) {
|
|
384
384
|
if (!s || s.size === 0) return t;
|
|
385
385
|
const o = new Set([...s.keys()].map((c) => String(c).toUpperCase()));
|
|
386
386
|
return t.filter(
|
|
387
|
-
(c) => !(!c.to_previous && o.has(String(c.to_state).toUpperCase()) &&
|
|
387
|
+
(c) => !(!c.to_previous && o.has(String(c.to_state).toUpperCase()) && Xe(c, e, r))
|
|
388
388
|
);
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function Fn(t, e, r) {
|
|
391
391
|
var p, x, k, R, _, U;
|
|
392
392
|
const s = [...(t == null ? void 0 : t.available_transitions) ?? [], ...(t == null ? void 0 : t.all_transitions) ?? []].find(
|
|
393
393
|
(j) => j.id === e
|
|
394
394
|
), o = r == null ? void 0 : r.data, c = ((p = o == null ? void 0 : o.new_state) == null ? void 0 : p.id) ?? ((x = o == null ? void 0 : o.instance) == null ? void 0 : x.current_state) ?? null, m = ((k = o == null ? void 0 : o.new_state) == null ? void 0 : k.label) ?? (s ? (_ = (R = t == null ? void 0 : t.states) == null ? void 0 : R.find((j) => j.id === s.to_state)) == null ? void 0 : _.label : void 0) ?? null, h = ((U = t == null ? void 0 : t.instance) == null ? void 0 : U.current_state) ?? null;
|
|
395
395
|
return h && c && String(h) === String(c) ? "Nothing moved" : s != null && s.label && m ? `${s.label} — now ${m}` : m ? `Moved to ${m}` : s != null && s.label ? `${s.label} done` : "Transition executed";
|
|
396
396
|
}
|
|
397
|
-
const
|
|
398
|
-
function
|
|
397
|
+
const Fr = 1200;
|
|
398
|
+
function An(t) {
|
|
399
399
|
const e = `nvr-move-${Math.random().toString(36).slice(2)}`;
|
|
400
400
|
let r = !1;
|
|
401
401
|
const s = setTimeout(() => {
|
|
402
402
|
r = !0, V.loading(`${(t == null ? void 0 : t.trim()) || "Moving"}…`, { id: e });
|
|
403
|
-
},
|
|
403
|
+
}, Fr);
|
|
404
404
|
return {
|
|
405
405
|
/** Options for the result toast: replaces the loading one when shown. */
|
|
406
406
|
done: () => (clearTimeout(s), r ? { id: e, duration: 7e3 } : {}),
|
|
@@ -410,7 +410,7 @@ function Pn(t) {
|
|
|
410
410
|
}
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function nt(t, e, r) {
|
|
414
414
|
for (const s of [
|
|
415
415
|
"pipeline-owners-resolved",
|
|
416
416
|
"pipeline-instance-owners",
|
|
@@ -418,7 +418,7 @@ function et(t, e, r) {
|
|
|
418
418
|
])
|
|
419
419
|
t.invalidateQueries({ queryKey: [s, e, r] });
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function Ar(t, e, r) {
|
|
422
422
|
var h;
|
|
423
423
|
if (!e) return null;
|
|
424
424
|
const s = new Map(r.map((p) => [String(p.id).toUpperCase(), p.sort])), o = [...t].sort(
|
|
@@ -438,21 +438,21 @@ function Ne({ className: t }) {
|
|
|
438
438
|
}
|
|
439
439
|
);
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function Le(t, e = "button") {
|
|
442
442
|
return t.advisory ? {
|
|
443
443
|
"data-move-blocked": t.advisory.code,
|
|
444
444
|
"aria-description": t.advisory.message,
|
|
445
445
|
...e === "button" ? { "data-tip": t.advisory.message } : {}
|
|
446
446
|
} : {};
|
|
447
447
|
}
|
|
448
|
-
const
|
|
449
|
-
function
|
|
448
|
+
const On = "border-amber-300 text-slate-700 dark:border-amber-500/40 dark:text-slate-200";
|
|
449
|
+
function kt({
|
|
450
450
|
moves: t,
|
|
451
451
|
nameOf: e
|
|
452
452
|
}) {
|
|
453
|
-
const r =
|
|
454
|
-
return r.map(({ advisory: s, moves: o }) => /* @__PURE__ */ i(
|
|
455
|
-
/* @__PURE__ */ n(
|
|
453
|
+
const r = gn(t);
|
|
454
|
+
return r.map(({ advisory: s, moves: o }) => /* @__PURE__ */ i(Yn, { children: [
|
|
455
|
+
/* @__PURE__ */ n(ht, {}),
|
|
456
456
|
/* @__PURE__ */ i(
|
|
457
457
|
"div",
|
|
458
458
|
{
|
|
@@ -472,11 +472,11 @@ function yt({
|
|
|
472
472
|
)
|
|
473
473
|
] }, `${s.code}:${s.message}`));
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Dn(t, e, r) {
|
|
476
476
|
const s = String(t.comment_mode ?? "none");
|
|
477
|
-
return s === "optional" || s === "required" ||
|
|
477
|
+
return s === "optional" || s === "required" || qt(t, e, r);
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Or({ entry: t }) {
|
|
480
480
|
const e = [t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email || "Someone";
|
|
481
481
|
return /* @__PURE__ */ i(
|
|
482
482
|
"div",
|
|
@@ -485,7 +485,7 @@ function Fr({ entry: t }) {
|
|
|
485
485
|
"data-send-back-notice": !0,
|
|
486
486
|
children: [
|
|
487
487
|
/* @__PURE__ */ n(
|
|
488
|
-
|
|
488
|
+
zn,
|
|
489
489
|
{
|
|
490
490
|
"aria-hidden": !0,
|
|
491
491
|
className: "mt-[3px] h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400"
|
|
@@ -495,16 +495,16 @@ function Fr({ entry: t }) {
|
|
|
495
495
|
/* @__PURE__ */ n("p", { className: "whitespace-pre-line break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: t.comment }),
|
|
496
496
|
/* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-amber-800/80 dark:text-amber-300/80", children: [
|
|
497
497
|
"Sent back by ",
|
|
498
|
-
|
|
498
|
+
Tt(e, t),
|
|
499
499
|
" · ",
|
|
500
|
-
|
|
500
|
+
_t(t.timestamp)
|
|
501
501
|
] })
|
|
502
502
|
] })
|
|
503
503
|
]
|
|
504
504
|
}
|
|
505
505
|
);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Un({
|
|
508
508
|
collection: t,
|
|
509
509
|
item: e,
|
|
510
510
|
offer: r,
|
|
@@ -513,12 +513,12 @@ function On({
|
|
|
513
513
|
className: c,
|
|
514
514
|
style: m
|
|
515
515
|
}) {
|
|
516
|
-
const [h, p] = Q(""), { action: x, isLoading: k, run: R } =
|
|
516
|
+
const [h, p] = Q(""), { action: x, isLoading: k, run: R } = yr(t, e, r.actionKey), _ = Qe({
|
|
517
517
|
mutationFn: () => R(h),
|
|
518
518
|
onSuccess: () => {
|
|
519
519
|
V.success(`${(x == null ? void 0 : x.label) ?? "Done"} — trying again`), s();
|
|
520
520
|
},
|
|
521
|
-
onError: (j) =>
|
|
521
|
+
onError: (j) => Zn(j, `${(x == null ? void 0 : x.label) ?? "The fix"} failed`)
|
|
522
522
|
});
|
|
523
523
|
if (k || !x) return null;
|
|
524
524
|
const U = !_.isPending && (!x.require_reason || h.trim().length > 0);
|
|
@@ -550,7 +550,7 @@ function On({
|
|
|
550
550
|
),
|
|
551
551
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
|
|
552
552
|
/* @__PURE__ */ n(
|
|
553
|
-
|
|
553
|
+
pe,
|
|
554
554
|
{
|
|
555
555
|
type: "button",
|
|
556
556
|
size: "sm",
|
|
@@ -561,7 +561,7 @@ function On({
|
|
|
561
561
|
}
|
|
562
562
|
),
|
|
563
563
|
/* @__PURE__ */ i(
|
|
564
|
-
|
|
564
|
+
pe,
|
|
565
565
|
{
|
|
566
566
|
type: "button",
|
|
567
567
|
size: "sm",
|
|
@@ -569,7 +569,7 @@ function On({
|
|
|
569
569
|
disabled: !U,
|
|
570
570
|
onClick: () => _.mutate(),
|
|
571
571
|
children: [
|
|
572
|
-
_.isPending && /* @__PURE__ */ n(
|
|
572
|
+
_.isPending && /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }),
|
|
573
573
|
x.label,
|
|
574
574
|
", then try again"
|
|
575
575
|
]
|
|
@@ -599,11 +599,11 @@ function Re({
|
|
|
599
599
|
t
|
|
600
600
|
);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function ut(t) {
|
|
603
603
|
const e = Math.floor(t / 6e4);
|
|
604
|
-
return e < 60 ? `${Math.max(1, e)}m` :
|
|
604
|
+
return e < 60 ? `${Math.max(1, e)}m` : ir(t / 36e5);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function Dr({
|
|
607
607
|
history: t,
|
|
608
608
|
completedAt: e
|
|
609
609
|
}) {
|
|
@@ -627,7 +627,7 @@ function Ar({
|
|
|
627
627
|
/* @__PURE__ */ i("div", { className: "mb-1 flex items-center justify-between", children: [
|
|
628
628
|
/* @__PURE__ */ n("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: "Time in step" }),
|
|
629
629
|
/* @__PURE__ */ i("p", { className: "text-[10px] tabular-nums text-slate-400 dark:text-slate-500", children: [
|
|
630
|
-
|
|
630
|
+
ut(c),
|
|
631
631
|
" total",
|
|
632
632
|
e ? "" : " · so far"
|
|
633
633
|
] })
|
|
@@ -637,7 +637,7 @@ function Ar({
|
|
|
637
637
|
return /* @__PURE__ */ i(
|
|
638
638
|
"div",
|
|
639
639
|
{
|
|
640
|
-
"data-tip": `${m.label} — ${
|
|
640
|
+
"data-tip": `${m.label} — ${ut(m.ms)}${m.current ? " (current)" : ""}`,
|
|
641
641
|
className: "relative flex min-w-[8px] items-center overflow-hidden border-r border-white/60 last:border-r-0 dark:border-black/30",
|
|
642
642
|
style: {
|
|
643
643
|
width: `${h}%`,
|
|
@@ -647,7 +647,7 @@ function Ar({
|
|
|
647
647
|
h >= 14 && /* @__PURE__ */ i("span", { className: "truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
|
|
648
648
|
m.label,
|
|
649
649
|
" · ",
|
|
650
|
-
|
|
650
|
+
ut(m.ms)
|
|
651
651
|
] }),
|
|
652
652
|
m.current && /* @__PURE__ */ n(
|
|
653
653
|
"span",
|
|
@@ -663,7 +663,7 @@ function Ar({
|
|
|
663
663
|
}) })
|
|
664
664
|
] });
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Ur({
|
|
667
667
|
states: t,
|
|
668
668
|
allTransitions: e,
|
|
669
669
|
availableTransitions: r,
|
|
@@ -673,7 +673,7 @@ function Or({
|
|
|
673
673
|
skippedStates: m
|
|
674
674
|
}) {
|
|
675
675
|
var K;
|
|
676
|
-
const h =
|
|
676
|
+
const h = ce(null);
|
|
677
677
|
_e(() => {
|
|
678
678
|
const f = h.current;
|
|
679
679
|
if (!f || f.scrollWidth <= f.clientWidth) return;
|
|
@@ -689,26 +689,26 @@ function Or({
|
|
|
689
689
|
const R = (() => {
|
|
690
690
|
if (c)
|
|
691
691
|
return t.filter((b) => c.has(b.id) || p.has(b.id) || b.id === s).filter((b) => {
|
|
692
|
-
const
|
|
693
|
-
return
|
|
694
|
-
}).sort((b,
|
|
692
|
+
const M = b.stage_visibility ?? "always";
|
|
693
|
+
return M === "hide" ? !1 : M === "hide_unless_active" ? p.has(b.id) || b.id === s : !0;
|
|
694
|
+
}).sort((b, M) => b.sort - M.sort);
|
|
695
695
|
if (e.length === 0) {
|
|
696
696
|
const b = /* @__PURE__ */ new Set([...p]);
|
|
697
|
-
return s && b.add(s), t.filter((
|
|
697
|
+
return s && b.add(s), t.filter((M) => b.has(M.id)).sort((M, ee) => M.sort - ee.sort);
|
|
698
698
|
}
|
|
699
699
|
const f = new Set(
|
|
700
700
|
o.filter((b) => b.from_state).map((b) => `${b.from_state}:${b.to_state}`)
|
|
701
701
|
), v = new Set(o.map((b) => b.from_state).filter(Boolean)), g = e.filter((b) => b.from_state !== null), $ = /* @__PURE__ */ new Map();
|
|
702
702
|
for (const b of g) {
|
|
703
|
-
const
|
|
704
|
-
if (v.has(
|
|
705
|
-
const ee = $.get(
|
|
706
|
-
ee.push(b.to_state), $.set(
|
|
703
|
+
const M = b.from_state;
|
|
704
|
+
if (v.has(M) && !f.has(`${M}:${b.to_state}`)) continue;
|
|
705
|
+
const ee = $.get(M) ?? [];
|
|
706
|
+
ee.push(b.to_state), $.set(M, ee);
|
|
707
707
|
}
|
|
708
708
|
if (s) {
|
|
709
|
-
const b = g.filter((
|
|
709
|
+
const b = g.filter((M) => M.from_state === s).map((M) => M.to_state);
|
|
710
710
|
$.set(s, [
|
|
711
|
-
.../* @__PURE__ */ new Set([...r.map((
|
|
711
|
+
.../* @__PURE__ */ new Set([...r.map((M) => M.to_state), ...b])
|
|
712
712
|
]);
|
|
713
713
|
}
|
|
714
714
|
const T = /* @__PURE__ */ new Set(), X = t.filter((b) => b.is_initial).map((b) => b.id);
|
|
@@ -716,14 +716,14 @@ function Or({
|
|
|
716
716
|
const b = X.shift();
|
|
717
717
|
if (!T.has(b)) {
|
|
718
718
|
T.add(b);
|
|
719
|
-
for (const
|
|
719
|
+
for (const M of $.get(b) ?? []) T.has(M) || X.push(M);
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
const u = /* @__PURE__ */ new Set([...T, ...p]);
|
|
723
723
|
return s && u.add(s), t.filter((b) => u.has(b.id)).filter((b) => {
|
|
724
|
-
const
|
|
725
|
-
return
|
|
726
|
-
}).sort((b,
|
|
724
|
+
const M = b.stage_visibility ?? "always";
|
|
725
|
+
return M === "hide" ? !1 : M === "hide_unless_active" ? p.has(b.id) || b.id === s : !0;
|
|
726
|
+
}).sort((b, M) => b.sort - M.sort);
|
|
727
727
|
})();
|
|
728
728
|
if (R.length < 2) return null;
|
|
729
729
|
const _ = R.findIndex((f) => f.id === s), U = new Map(R.map((f, v) => [f.id, v])), j = new Map(t.map((f) => [f.id, f.label]));
|
|
@@ -737,10 +737,10 @@ function Or({
|
|
|
737
737
|
}
|
|
738
738
|
function re(f) {
|
|
739
739
|
var v, g, $, T;
|
|
740
|
-
return
|
|
740
|
+
return Ze(f) ? /* @__PURE__ */ n(Zt, { className: "inline h-2.5 w-2.5", "aria-label": yt(f) }) : ((((v = f.first_name) == null ? void 0 : v[0]) ?? "") + (((g = f.last_name) == null ? void 0 : g[0]) ?? "")).toUpperCase() || ((T = ($ = f.user_email) == null ? void 0 : $[0]) == null ? void 0 : T.toUpperCase()) || "?";
|
|
741
741
|
}
|
|
742
742
|
function ae(f) {
|
|
743
|
-
return
|
|
743
|
+
return Tt([f.first_name, f.last_name].filter(Boolean).join(" ") || f.user_email, f);
|
|
744
744
|
}
|
|
745
745
|
const F = /* @__PURE__ */ new Map();
|
|
746
746
|
for (const f of [...o].sort(
|
|
@@ -755,11 +755,11 @@ function Or({
|
|
|
755
755
|
}
|
|
756
756
|
}
|
|
757
757
|
function E(f) {
|
|
758
|
-
const v = j.get(f.from_state ?? "") ?? "the previous step", g = j.get(f.to_state) ?? "the next step", $ =
|
|
758
|
+
const v = j.get(f.from_state ?? "") ?? "the previous step", g = j.get(f.to_state) ?? "the next step", $ = Ze(f) ? "it moved automatically" : `${ae(f)} moved it`;
|
|
759
759
|
return `Passed over on ${Et(f.timestamp)} — ${$} straight from ${v} to ${g}`;
|
|
760
760
|
}
|
|
761
|
-
return /* @__PURE__ */ n(
|
|
762
|
-
const g = f.id === s, $ = p.has(f.id), T = $ && !g && (_ < 0 || v < _), X = $ && !g && !T, u = !$ && !g ? F.get(f.id) : void 0, b = !$ && !g ? m == null ? void 0 : m.get(f.id) : void 0,
|
|
761
|
+
return /* @__PURE__ */ n(dn, { delayDuration: 200, children: /* @__PURE__ */ n("div", { ref: h, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ n("div", { className: "flex w-full items-start", children: R.map((f, v) => {
|
|
762
|
+
const g = f.id === s, $ = p.has(f.id), T = $ && !g && (_ < 0 || v < _), X = $ && !g && !T, u = !$ && !g ? F.get(f.id) : void 0, b = !$ && !g ? m == null ? void 0 : m.get(f.id) : void 0, M = u || b ? [...u ? [E(u)] : [], ...b ?? []] : void 0, ee = M !== void 0, W = f.color ?? "#94a3b8", ue = v === R.length - 1, xe = ue ? null : R[v + 1], de = xe ? ne(f.id, xe.id) : [];
|
|
763
763
|
return /* @__PURE__ */ i("div", { className: "flex flex-1 items-start", children: [
|
|
764
764
|
/* @__PURE__ */ i("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
|
|
765
765
|
/* @__PURE__ */ n(
|
|
@@ -774,12 +774,12 @@ function Or({
|
|
|
774
774
|
border: g || T ? "none" : ee ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
|
|
775
775
|
boxShadow: g ? `0 0 0 3px white, 0 0 0 5px ${W}` : void 0
|
|
776
776
|
},
|
|
777
|
-
children: T ? /* @__PURE__ */ n(
|
|
777
|
+
children: T ? /* @__PURE__ */ n(rt, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : g ? /* @__PURE__ */ n("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : ee ? /* @__PURE__ */ n(Hn, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ n("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
|
|
778
778
|
},
|
|
779
779
|
g ? "cur" : T ? "done" : ee ? "skip" : "todo"
|
|
780
780
|
),
|
|
781
|
-
ee ? /* @__PURE__ */ i(
|
|
782
|
-
/* @__PURE__ */ n(
|
|
781
|
+
ee ? /* @__PURE__ */ i(bt, { children: [
|
|
782
|
+
/* @__PURE__ */ n(gt, { asChild: !0, children: /* @__PURE__ */ n(
|
|
783
783
|
"span",
|
|
784
784
|
{
|
|
785
785
|
className: "w-full cursor-help break-words text-center leading-snug",
|
|
@@ -794,9 +794,9 @@ function Or({
|
|
|
794
794
|
children: f.label
|
|
795
795
|
}
|
|
796
796
|
) }),
|
|
797
|
-
/* @__PURE__ */ i(
|
|
797
|
+
/* @__PURE__ */ i(xt, { className: "max-w-[260px]", children: [
|
|
798
798
|
/* @__PURE__ */ n("p", { className: "text-[11px] font-medium", children: "Skipped for this record" }),
|
|
799
|
-
|
|
799
|
+
M.length > 0 ? /* @__PURE__ */ n("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: M.map((D) => /* @__PURE__ */ n("li", { children: D }, D)) }) : /* @__PURE__ */ n("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
|
|
800
800
|
] })
|
|
801
801
|
] }) : /* @__PURE__ */ n(
|
|
802
802
|
"span",
|
|
@@ -815,15 +815,15 @@ function Or({
|
|
|
815
815
|
}
|
|
816
816
|
)
|
|
817
817
|
] }),
|
|
818
|
-
!
|
|
818
|
+
!ue && /* @__PURE__ */ i("div", { className: "mt-[13px] flex w-10 shrink-0 flex-col items-center gap-1.5", children: [
|
|
819
819
|
(() => {
|
|
820
|
-
const
|
|
820
|
+
const D = T ? `${W}55` : "#e8ecf0";
|
|
821
821
|
return /* @__PURE__ */ i("div", { className: "flex w-full shrink-0 items-center", children: [
|
|
822
822
|
/* @__PURE__ */ n(
|
|
823
823
|
"div",
|
|
824
824
|
{
|
|
825
825
|
className: "h-0.5 flex-1 rounded-l-sm",
|
|
826
|
-
style: { backgroundColor:
|
|
826
|
+
style: { backgroundColor: D }
|
|
827
827
|
}
|
|
828
828
|
),
|
|
829
829
|
/* @__PURE__ */ n(
|
|
@@ -834,18 +834,18 @@ function Or({
|
|
|
834
834
|
height: 0,
|
|
835
835
|
borderTop: "3px solid transparent",
|
|
836
836
|
borderBottom: "3px solid transparent",
|
|
837
|
-
borderLeft: `5px solid ${
|
|
837
|
+
borderLeft: `5px solid ${D}`
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
840
|
)
|
|
841
841
|
] });
|
|
842
842
|
})(),
|
|
843
|
-
|
|
844
|
-
const Y =
|
|
845
|
-
(U.get(
|
|
846
|
-
) > 1 ? j.get(
|
|
847
|
-
return /* @__PURE__ */ i(
|
|
848
|
-
/* @__PURE__ */ n(
|
|
843
|
+
de.map((D) => {
|
|
844
|
+
const Y = D.from_state !== f.id, z = Math.abs(
|
|
845
|
+
(U.get(D.to_state) ?? 0) - (U.get(D.from_state ?? "") ?? 0)
|
|
846
|
+
) > 1 ? j.get(D.to_state) ?? "" : null;
|
|
847
|
+
return /* @__PURE__ */ i(bt, { children: [
|
|
848
|
+
/* @__PURE__ */ n(gt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
|
|
849
849
|
/* @__PURE__ */ i(
|
|
850
850
|
"span",
|
|
851
851
|
{
|
|
@@ -853,45 +853,45 @@ function Or({
|
|
|
853
853
|
style: { color: Y ? "#d97706" : "#475569" },
|
|
854
854
|
children: [
|
|
855
855
|
Y && "↩ ",
|
|
856
|
-
re(
|
|
856
|
+
re(D)
|
|
857
857
|
]
|
|
858
858
|
}
|
|
859
859
|
),
|
|
860
|
-
/* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children:
|
|
860
|
+
/* @__PURE__ */ n("span", { className: "text-[8.5px] leading-none text-slate-400", children: _t(D.timestamp) })
|
|
861
861
|
] }) }),
|
|
862
|
-
/* @__PURE__ */ i(
|
|
863
|
-
|
|
862
|
+
/* @__PURE__ */ i(xt, { side: "top", className: "space-y-0.5 text-[12px]", children: [
|
|
863
|
+
Ze(D) ? /* @__PURE__ */ i(Se, { children: [
|
|
864
864
|
/* @__PURE__ */ i("p", { className: "font-medium", children: [
|
|
865
865
|
Y ? "↩ Sent back · " : "",
|
|
866
|
-
|
|
866
|
+
yt(D)
|
|
867
867
|
] }),
|
|
868
|
-
|
|
868
|
+
wt(D) && /* @__PURE__ */ n("p", { className: "max-w-[280px] text-muted-foreground", children: wt(D) })
|
|
869
869
|
] }) : /* @__PURE__ */ i("p", { className: "font-medium", children: [
|
|
870
870
|
Y ? "↩ Sent back by" : "Approved by",
|
|
871
871
|
" ",
|
|
872
|
-
ae(
|
|
872
|
+
ae(D)
|
|
873
873
|
] }),
|
|
874
874
|
z && /* @__PURE__ */ i("p", { className: "text-muted-foreground", children: [
|
|
875
875
|
"→ straight to ",
|
|
876
876
|
z
|
|
877
877
|
] }),
|
|
878
|
-
/* @__PURE__ */ n("p", { className: "text-muted-foreground", children: Et(
|
|
878
|
+
/* @__PURE__ */ n("p", { className: "text-muted-foreground", children: Et(D.timestamp) })
|
|
879
879
|
] })
|
|
880
|
-
] },
|
|
880
|
+
] }, D.id);
|
|
881
881
|
})
|
|
882
882
|
] })
|
|
883
883
|
] }, f.id);
|
|
884
884
|
}) }) }) });
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function Br({ history: t }) {
|
|
887
887
|
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) => {
|
|
888
|
-
const r =
|
|
888
|
+
const r = Ze(e), s = r ? yt(e) : Tt([e.first_name, e.last_name].filter(Boolean).join(" ") || e.user_email, e), o = Nr(e), c = e.comment && !r && !o ? e.comment : null, m = o ?? (r ? wt(e) : null);
|
|
889
889
|
return /* @__PURE__ */ i("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
|
|
890
890
|
/* @__PURE__ */ n("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
|
|
891
891
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
892
892
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
|
|
893
893
|
e.from_state_label ? /* @__PURE__ */ n(Re, { label: e.from_state_label, color: e.from_state_color, small: !0 }) : /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 italic", children: "started" }),
|
|
894
|
-
/* @__PURE__ */ n(
|
|
894
|
+
/* @__PURE__ */ n(Nt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
|
|
895
895
|
/* @__PURE__ */ n(Re, { label: e.to_state_label, color: e.to_state_color, small: !0 })
|
|
896
896
|
] }),
|
|
897
897
|
c && /* @__PURE__ */ i("p", { className: "mt-1 text-slate-500 italic", children: [
|
|
@@ -909,7 +909,7 @@ function Dr({ history: t }) {
|
|
|
909
909
|
s,
|
|
910
910
|
m ? ` · ${m}` : "",
|
|
911
911
|
" · ",
|
|
912
|
-
|
|
912
|
+
_t(e.timestamp)
|
|
913
913
|
]
|
|
914
914
|
}
|
|
915
915
|
)
|
|
@@ -917,8 +917,8 @@ function Dr({ history: t }) {
|
|
|
917
917
|
] }, e.id);
|
|
918
918
|
}) });
|
|
919
919
|
}
|
|
920
|
-
function
|
|
921
|
-
const r = Pe(), [s, o] = Q(!1), [c, m] = Q(""), [h, p] = Q(""), x =
|
|
920
|
+
function Lr({ value: t, onChange: e }) {
|
|
921
|
+
const r = Pe(), [s, o] = Q(!1), [c, m] = Q(""), [h, p] = Q(""), x = ce(null), k = ce(null);
|
|
922
922
|
_e(() => {
|
|
923
923
|
s ? setTimeout(() => {
|
|
924
924
|
var F;
|
|
@@ -930,7 +930,7 @@ function Ur({ value: t, onChange: e }) {
|
|
|
930
930
|
const { data: R, isLoading: _ } = be({
|
|
931
931
|
queryKey: ["users", "async-search", h],
|
|
932
932
|
queryFn: () => r.request(
|
|
933
|
-
|
|
933
|
+
we("/users", {
|
|
934
934
|
limit: 50,
|
|
935
935
|
sort: "first_name",
|
|
936
936
|
...h ? { search: h } : {}
|
|
@@ -939,13 +939,13 @@ function Ur({ value: t, onChange: e }) {
|
|
|
939
939
|
enabled: s,
|
|
940
940
|
staleTime: 3e4
|
|
941
941
|
}), { data: U } = be({
|
|
942
|
-
...
|
|
942
|
+
...rr(r, t),
|
|
943
943
|
enabled: !!t,
|
|
944
944
|
staleTime: 5 * 6e4
|
|
945
945
|
}), j = R ?? [], ne = U ?? j.find((F) => F.id === t) ?? null, re = ne ? [ne.first_name, ne.last_name].filter(Boolean).join(" ").trim() || ne.email : t ? "Selected person" : null, ae = (F) => [F.first_name, F.last_name].filter(Boolean).join(" ").trim();
|
|
946
|
-
return /* @__PURE__ */ i(
|
|
946
|
+
return /* @__PURE__ */ i(St, { open: s, onOpenChange: o, children: [
|
|
947
947
|
/* @__PURE__ */ i("div", { className: "relative flex h-8 w-full", children: [
|
|
948
|
-
/* @__PURE__ */ n(
|
|
948
|
+
/* @__PURE__ */ n(Ct, { asChild: !0, children: /* @__PURE__ */ i(
|
|
949
949
|
"button",
|
|
950
950
|
{
|
|
951
951
|
type: "button",
|
|
@@ -968,9 +968,9 @@ function Ur({ value: t, onChange: e }) {
|
|
|
968
968
|
}
|
|
969
969
|
)
|
|
970
970
|
] }),
|
|
971
|
-
/* @__PURE__ */ i(
|
|
971
|
+
/* @__PURE__ */ i($t, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
|
|
972
972
|
/* @__PURE__ */ n("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
973
|
-
/* @__PURE__ */ n(
|
|
973
|
+
/* @__PURE__ */ n(Vn, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
974
974
|
/* @__PURE__ */ n(
|
|
975
975
|
"input",
|
|
976
976
|
{
|
|
@@ -983,7 +983,7 @@ function Ur({ value: t, onChange: e }) {
|
|
|
983
983
|
)
|
|
984
984
|
] }) }),
|
|
985
985
|
/* @__PURE__ */ n("div", { className: "max-h-56 overflow-y-auto py-1", children: _ ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
|
|
986
|
-
/* @__PURE__ */ n(
|
|
986
|
+
/* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
987
987
|
"Loading…"
|
|
988
988
|
] }) : j.length === 0 ? /* @__PURE__ */ n("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : j.map((F) => {
|
|
989
989
|
const E = ae(F), K = E ? `${E} (${F.email})` : F.email, f = F.id === t;
|
|
@@ -997,7 +997,7 @@ function Ur({ value: t, onChange: e }) {
|
|
|
997
997
|
className: `flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] hover:bg-slate-50 ${f ? "font-medium text-slate-800" : "text-slate-600"}`,
|
|
998
998
|
children: [
|
|
999
999
|
/* @__PURE__ */ n(
|
|
1000
|
-
|
|
1000
|
+
rt,
|
|
1001
1001
|
{
|
|
1002
1002
|
className: `h-3.5 w-3.5 shrink-0 ${f ? "text-nvr-cyan" : "opacity-0"}`
|
|
1003
1003
|
}
|
|
@@ -1017,7 +1017,7 @@ function Gt({
|
|
|
1017
1017
|
email: r,
|
|
1018
1018
|
initials: s
|
|
1019
1019
|
}) {
|
|
1020
|
-
return /* @__PURE__ */ n(
|
|
1020
|
+
return /* @__PURE__ */ n(ln, { userId: t, children: /* @__PURE__ */ i(
|
|
1021
1021
|
"button",
|
|
1022
1022
|
{
|
|
1023
1023
|
type: "button",
|
|
@@ -1025,7 +1025,7 @@ function Gt({
|
|
|
1025
1025
|
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",
|
|
1026
1026
|
children: [
|
|
1027
1027
|
/* @__PURE__ */ n(
|
|
1028
|
-
|
|
1028
|
+
cr,
|
|
1029
1029
|
{
|
|
1030
1030
|
userId: t,
|
|
1031
1031
|
alt: e,
|
|
@@ -1041,16 +1041,16 @@ function Gt({
|
|
|
1041
1041
|
}
|
|
1042
1042
|
) });
|
|
1043
1043
|
}
|
|
1044
|
-
function
|
|
1044
|
+
function Er({
|
|
1045
1045
|
collection: t,
|
|
1046
1046
|
item: e,
|
|
1047
1047
|
states: r,
|
|
1048
1048
|
currentStateId: s,
|
|
1049
1049
|
returned: o = !1
|
|
1050
1050
|
}) {
|
|
1051
|
-
var
|
|
1052
|
-
const c = Pe(), m =
|
|
1053
|
-
|
|
1051
|
+
var ie, H, qe, Oe;
|
|
1052
|
+
const c = Pe(), m = Ve(), { isAdmin: h } = nn(), [p, x] = Q(!1), [k, R] = Q(""), [_, U] = Q(""), [j, ne] = Q(!1), re = ["pipeline-instance-owners", t, e], ae = ["pipeline-owners-can-add", t, e], F = () => c.request(
|
|
1053
|
+
we(`/pipelines/instance/${t}/${e}/owners`)
|
|
1054
1054
|
).then((a) => {
|
|
1055
1055
|
var I;
|
|
1056
1056
|
return m.setQueryData(ae, ((I = a.meta) == null ? void 0 : I.can_add) ?? null), a;
|
|
@@ -1068,27 +1068,27 @@ function Br({
|
|
|
1068
1068
|
}), v = typeof f == "boolean" ? f : h, { data: g, isLoading: $ } = be({
|
|
1069
1069
|
queryKey: ["pipeline-all-owners", t, e],
|
|
1070
1070
|
queryFn: () => c.request(
|
|
1071
|
-
|
|
1071
|
+
we(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
1072
1072
|
).then((a) => a.data ?? null),
|
|
1073
1073
|
enabled: !!s,
|
|
1074
1074
|
staleTime: 3e4
|
|
1075
|
-
}), T = new Set((E ?? []).map((a) => a.user)), X = s ? (((
|
|
1076
|
-
(s ? ((
|
|
1075
|
+
}), T = new Set((E ?? []).map((a) => a.user)), X = s ? (((ie = g == null ? void 0 : g[s]) == null ? void 0 : ie.owners) ?? []).filter((a) => !T.has(a.id)) : [], u = new Map(
|
|
1076
|
+
(s ? ((H = g == null ? void 0 : g[s]) == null ? void 0 : H.unavailable) ?? [] : []).map((a) => [
|
|
1077
1077
|
String(a.id).toUpperCase(),
|
|
1078
1078
|
a
|
|
1079
1079
|
])
|
|
1080
|
-
), b = X.length + ((E == null ? void 0 : E.length) ?? 0),
|
|
1080
|
+
), b = X.length + ((E == null ? void 0 : E.length) ?? 0), M = !!((qe = r.find((a) => a.id === s)) != null && qe.is_initial), ee = !K && !$, { data: W } = be({
|
|
1081
1081
|
queryKey: ["pipeline-record-creator", t, e],
|
|
1082
1082
|
queryFn: () => c.request(
|
|
1083
|
-
|
|
1083
|
+
we(`/pipelines/instance/${t}/${e}/creator`)
|
|
1084
1084
|
).then((a) => a.data ?? null),
|
|
1085
|
-
enabled:
|
|
1085
|
+
enabled: M && ee && b === 0,
|
|
1086
1086
|
staleTime: 6e4
|
|
1087
|
-
}),
|
|
1087
|
+
}), ue = M && b === 0 && (W != null && W.name) ? W : null, xe = () => {
|
|
1088
1088
|
m.invalidateQueries({ queryKey: re }), m.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
|
|
1089
|
-
},
|
|
1089
|
+
}, de = Qe({
|
|
1090
1090
|
mutationFn: () => c.request(
|
|
1091
|
-
|
|
1091
|
+
Ge(`/pipelines/instance/${t}/${e}/owners`, {
|
|
1092
1092
|
user: k,
|
|
1093
1093
|
state: _ || void 0
|
|
1094
1094
|
})
|
|
@@ -1098,8 +1098,8 @@ function Br({
|
|
|
1098
1098
|
},
|
|
1099
1099
|
// The server's reason (a 403 says why), not a bare status phrase.
|
|
1100
1100
|
onError: (a) => V.error(Ae(a, "Failed to add owner"))
|
|
1101
|
-
}),
|
|
1102
|
-
mutationFn: (a) => c.request(
|
|
1101
|
+
}), D = Qe({
|
|
1102
|
+
mutationFn: (a) => c.request(Jn(`/pipelines/instance-owners/${a.id}`)),
|
|
1103
1103
|
onSuccess: (a, I) => {
|
|
1104
1104
|
xe();
|
|
1105
1105
|
const Z = [I.first_name, I.last_name].filter(Boolean).join(" ") || I.email;
|
|
@@ -1107,7 +1107,7 @@ function Br({
|
|
|
1107
1107
|
action: {
|
|
1108
1108
|
label: "Undo",
|
|
1109
1109
|
onClick: () => void c.request(
|
|
1110
|
-
|
|
1110
|
+
Ge(`/pipelines/instance/${t}/${e}/owners`, {
|
|
1111
1111
|
user: I.user,
|
|
1112
1112
|
state: I.state || void 0
|
|
1113
1113
|
})
|
|
@@ -1117,8 +1117,8 @@ function Br({
|
|
|
1117
1117
|
},
|
|
1118
1118
|
onError: (a) => V.error(Ae(a, "Failed to remove owner"))
|
|
1119
1119
|
}), Y = (a) => {
|
|
1120
|
-
var J,
|
|
1121
|
-
const I = ((J = a.first_name) == null ? void 0 : J[0]) ?? "", Z = ((
|
|
1120
|
+
var J, he;
|
|
1121
|
+
const I = ((J = a.first_name) == null ? void 0 : J[0]) ?? "", Z = ((he = a.last_name) == null ? void 0 : he[0]) ?? "";
|
|
1122
1122
|
return (`${I}${Z}`.trim() || a.email[0] || "?").toUpperCase();
|
|
1123
1123
|
}, z = (a) => {
|
|
1124
1124
|
var I;
|
|
@@ -1129,14 +1129,14 @@ function Br({
|
|
|
1129
1129
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [
|
|
1130
1130
|
/* @__PURE__ */ n(Yt, { className: "h-3.5 w-3.5" }),
|
|
1131
1131
|
"Owners",
|
|
1132
|
-
K || $ ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) :
|
|
1132
|
+
K || $ ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : ue ? null : /* @__PURE__ */ i("span", { className: "text-slate-300", children: [
|
|
1133
1133
|
"(",
|
|
1134
1134
|
b,
|
|
1135
1135
|
")"
|
|
1136
1136
|
] })
|
|
1137
1137
|
] }),
|
|
1138
1138
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-3", children: [
|
|
1139
|
-
s && /* @__PURE__ */ n(
|
|
1139
|
+
s && /* @__PURE__ */ n(mr, { collection: t, itemId: String(e) }),
|
|
1140
1140
|
!p && v && /* @__PURE__ */ i(
|
|
1141
1141
|
"button",
|
|
1142
1142
|
{
|
|
@@ -1144,7 +1144,7 @@ function Br({
|
|
|
1144
1144
|
onClick: () => x(!0),
|
|
1145
1145
|
className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
1146
1146
|
children: [
|
|
1147
|
-
/* @__PURE__ */ n(
|
|
1147
|
+
/* @__PURE__ */ n(Gn, { className: "h-3 w-3" }),
|
|
1148
1148
|
"Add"
|
|
1149
1149
|
]
|
|
1150
1150
|
}
|
|
@@ -1152,24 +1152,24 @@ function Br({
|
|
|
1152
1152
|
] })
|
|
1153
1153
|
] }),
|
|
1154
1154
|
K || $ ? /* @__PURE__ */ i("div", { className: "flex items-center gap-2 py-1.5 text-[12px] text-slate-400", children: [
|
|
1155
|
-
/* @__PURE__ */ n(
|
|
1155
|
+
/* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1156
1156
|
"Resolving owners…"
|
|
1157
|
-
] }) :
|
|
1157
|
+
] }) : ue ? /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
1158
1158
|
o ? "Back with" : "With",
|
|
1159
1159
|
" ",
|
|
1160
|
-
/* @__PURE__ */ n(
|
|
1160
|
+
/* @__PURE__ */ n(ln, { userId: ue.id, children: /* @__PURE__ */ n(
|
|
1161
1161
|
"button",
|
|
1162
1162
|
{
|
|
1163
1163
|
type: "button",
|
|
1164
|
-
"aria-label": `${
|
|
1164
|
+
"aria-label": `${ue.name} — profile`,
|
|
1165
1165
|
className: "rounded font-medium text-slate-700 underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:text-foreground",
|
|
1166
|
-
children:
|
|
1166
|
+
children: ue.name
|
|
1167
1167
|
}
|
|
1168
1168
|
) })
|
|
1169
1169
|
] }) : b === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400", children: "No owners assigned." }) : /* @__PURE__ */ i("div", { className: "space-y-px", children: [
|
|
1170
1170
|
X.map((a) => {
|
|
1171
|
-
var J,
|
|
1172
|
-
const I = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, Z = (`${((J = a.first_name) == null ? void 0 : J[0]) ?? ""}${((
|
|
1171
|
+
var J, he;
|
|
1172
|
+
const I = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, Z = (`${((J = a.first_name) == null ? void 0 : J[0]) ?? ""}${((he = a.last_name) == null ? void 0 : he[0]) ?? ""}`.trim() || a.email[0] || "?").toUpperCase();
|
|
1173
1173
|
return /* @__PURE__ */ i(
|
|
1174
1174
|
"div",
|
|
1175
1175
|
{
|
|
@@ -1186,8 +1186,8 @@ function Br({
|
|
|
1186
1186
|
"shrink-0 rounded-full border px-1.5 py-0.5 text-[10px] font-medium",
|
|
1187
1187
|
l.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"
|
|
1188
1188
|
),
|
|
1189
|
-
"data-tip": l.delegate ? `${I} is ${
|
|
1190
|
-
children: l.delegate ? `${
|
|
1189
|
+
"data-tip": l.delegate ? `${I} is ${Ee[l.reason] ?? l.reason} — ${l.delegate.name} covers` : `${I} is ${Ee[l.reason] ?? l.reason} and can't approve this step`,
|
|
1190
|
+
children: l.delegate ? `${Ee[l.reason] ?? l.reason} · ${l.delegate.name} covers` : Ee[l.reason] ?? l.reason
|
|
1191
1191
|
}
|
|
1192
1192
|
) : null;
|
|
1193
1193
|
})(),
|
|
@@ -1225,8 +1225,8 @@ function Br({
|
|
|
1225
1225
|
{
|
|
1226
1226
|
type: "button",
|
|
1227
1227
|
"aria-label": `Remove ${[a.first_name, a.last_name].filter(Boolean).join(" ") || a.email} as an owner`,
|
|
1228
|
-
disabled:
|
|
1229
|
-
onClick: () =>
|
|
1228
|
+
disabled: D.isPending,
|
|
1229
|
+
onClick: () => D.mutate(a),
|
|
1230
1230
|
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",
|
|
1231
1231
|
children: /* @__PURE__ */ n(Jt, { className: "h-3 w-3" })
|
|
1232
1232
|
}
|
|
@@ -1238,9 +1238,9 @@ function Br({
|
|
|
1238
1238
|
] }),
|
|
1239
1239
|
p && /* @__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: [
|
|
1240
1240
|
/* @__PURE__ */ n("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
|
|
1241
|
-
/* @__PURE__ */ n(
|
|
1242
|
-
h ? /* @__PURE__ */ i(
|
|
1243
|
-
/* @__PURE__ */ n(
|
|
1241
|
+
/* @__PURE__ */ n(Lr, { value: k, onChange: R }),
|
|
1242
|
+
h ? /* @__PURE__ */ i(St, { open: j, onOpenChange: ne, children: [
|
|
1243
|
+
/* @__PURE__ */ n(Ct, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1244
1244
|
"button",
|
|
1245
1245
|
{
|
|
1246
1246
|
type: "button",
|
|
@@ -1251,9 +1251,9 @@ function Br({
|
|
|
1251
1251
|
]
|
|
1252
1252
|
}
|
|
1253
1253
|
) }),
|
|
1254
|
-
/* @__PURE__ */ n(
|
|
1254
|
+
/* @__PURE__ */ n($t, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...r.map((a) => a.id)].map((a) => {
|
|
1255
1255
|
var J;
|
|
1256
|
-
const I = a === "" ? "All states" : ((J = r.find((
|
|
1256
|
+
const I = a === "" ? "All states" : ((J = r.find((he) => he.id === a)) == null ? void 0 : J.label) ?? a;
|
|
1257
1257
|
return /* @__PURE__ */ n(
|
|
1258
1258
|
"button",
|
|
1259
1259
|
{
|
|
@@ -1273,7 +1273,7 @@ function Br({
|
|
|
1273
1273
|
] }) : /* @__PURE__ */ n("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "Hands off the current step." }),
|
|
1274
1274
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2 pt-0.5", children: [
|
|
1275
1275
|
/* @__PURE__ */ n(
|
|
1276
|
-
|
|
1276
|
+
pe,
|
|
1277
1277
|
{
|
|
1278
1278
|
type: "button",
|
|
1279
1279
|
size: "sm",
|
|
@@ -1286,30 +1286,30 @@ function Br({
|
|
|
1286
1286
|
}
|
|
1287
1287
|
),
|
|
1288
1288
|
/* @__PURE__ */ n(
|
|
1289
|
-
|
|
1289
|
+
pe,
|
|
1290
1290
|
{
|
|
1291
1291
|
type: "button",
|
|
1292
1292
|
size: "sm",
|
|
1293
1293
|
className: "h-7 text-[12px]",
|
|
1294
|
-
disabled: !k ||
|
|
1295
|
-
onClick: () =>
|
|
1296
|
-
children:
|
|
1294
|
+
disabled: !k || de.isPending,
|
|
1295
|
+
onClick: () => de.mutate(),
|
|
1296
|
+
children: de.isPending ? /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }) : "Add"
|
|
1297
1297
|
}
|
|
1298
1298
|
)
|
|
1299
1299
|
] })
|
|
1300
1300
|
] })
|
|
1301
1301
|
] });
|
|
1302
1302
|
}
|
|
1303
|
-
function
|
|
1303
|
+
function Bn(t, e, r, s) {
|
|
1304
1304
|
if (!t || !(r != null && r.length)) return null;
|
|
1305
1305
|
const c = new Map(r.map((p) => [String(p.id).toUpperCase(), p])).get(String(t.to_state).toUpperCase()), m = Number(e == null ? void 0 : e.sort);
|
|
1306
1306
|
if (!c || !Number.isFinite(m) || !(Number(c.sort) > m)) return null;
|
|
1307
|
-
const h =
|
|
1307
|
+
const h = gr(String(t.to_state), r, s);
|
|
1308
1308
|
return h && h.skipped.length > 0 ? h : null;
|
|
1309
1309
|
}
|
|
1310
|
-
function
|
|
1310
|
+
function Ln({ landing: t }) {
|
|
1311
1311
|
if (!t || t.skipped.length === 0) return null;
|
|
1312
|
-
const e =
|
|
1312
|
+
const e = xr(t);
|
|
1313
1313
|
if (e.length === 1) {
|
|
1314
1314
|
const r = e[0];
|
|
1315
1315
|
return /* @__PURE__ */ i(
|
|
@@ -1351,12 +1351,12 @@ function Un({ landing: t }) {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
);
|
|
1353
1353
|
}
|
|
1354
|
-
const
|
|
1354
|
+
const Ee = {
|
|
1355
1355
|
out: "out of office",
|
|
1356
1356
|
suspended: "suspended",
|
|
1357
1357
|
redacted: "redacted"
|
|
1358
1358
|
};
|
|
1359
|
-
function
|
|
1359
|
+
function Ir({
|
|
1360
1360
|
collection: t,
|
|
1361
1361
|
item: e,
|
|
1362
1362
|
states: r,
|
|
@@ -1365,7 +1365,7 @@ function Lr({
|
|
|
1365
1365
|
const o = Pe(), [c, m] = Q(!1), { data: h, isLoading: p } = be({
|
|
1366
1366
|
queryKey: ["pipeline-all-owners", t, e],
|
|
1367
1367
|
queryFn: () => o.request(
|
|
1368
|
-
|
|
1368
|
+
we(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
1369
1369
|
).then((k) => k.data ?? null),
|
|
1370
1370
|
enabled: c,
|
|
1371
1371
|
staleTime: 3e4
|
|
@@ -1373,8 +1373,8 @@ function Lr({
|
|
|
1373
1373
|
var R;
|
|
1374
1374
|
return !h || ((R = h[k.id]) == null ? void 0 : R.on_path) !== !1;
|
|
1375
1375
|
}).sort((k, R) => k.sort - R.sort);
|
|
1376
|
-
return /* @__PURE__ */ i(
|
|
1377
|
-
/* @__PURE__ */ n(
|
|
1376
|
+
return /* @__PURE__ */ i(St, { open: c, onOpenChange: m, children: [
|
|
1377
|
+
/* @__PURE__ */ n(Ct, { asChild: !0, children: /* @__PURE__ */ n(
|
|
1378
1378
|
"button",
|
|
1379
1379
|
{
|
|
1380
1380
|
type: "button",
|
|
@@ -1384,7 +1384,7 @@ function Lr({
|
|
|
1384
1384
|
children: /* @__PURE__ */ n(Yt, { className: "h-3.5 w-3.5" })
|
|
1385
1385
|
}
|
|
1386
1386
|
) }),
|
|
1387
|
-
/* @__PURE__ */ i(
|
|
1387
|
+
/* @__PURE__ */ i($t, { align: "end", sideOffset: 6, className: "w-[576px] p-0 overflow-hidden", children: [
|
|
1388
1388
|
/* @__PURE__ */ i("div", { className: "border-b border-slate-100 px-4 py-3", children: [
|
|
1389
1389
|
/* @__PURE__ */ n("p", { className: "text-[12px] font-semibold text-slate-700", children: "Approval Chain" }),
|
|
1390
1390
|
/* @__PURE__ */ n("p", { className: "text-[11px] text-slate-400 mt-0.5", children: "Owners per pipeline state" })
|
|
@@ -1415,13 +1415,13 @@ function Lr({
|
|
|
1415
1415
|
// Radix tooltip with zero delay — native `title` waits on
|
|
1416
1416
|
// the OS hover timer, and a truncated reason needs its
|
|
1417
1417
|
// full text the moment the cursor lands on it.
|
|
1418
|
-
/* @__PURE__ */ n(
|
|
1419
|
-
/* @__PURE__ */ n(
|
|
1418
|
+
/* @__PURE__ */ n(dn, { delayDuration: 0, children: /* @__PURE__ */ i(bt, { children: [
|
|
1419
|
+
/* @__PURE__ */ n(gt, { asChild: !0, children: /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
|
|
1420
1420
|
/* @__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" }),
|
|
1421
1421
|
j.length > 0 && /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: j.join(" · ") })
|
|
1422
1422
|
] }) }),
|
|
1423
1423
|
/* @__PURE__ */ i(
|
|
1424
|
-
|
|
1424
|
+
xt,
|
|
1425
1425
|
{
|
|
1426
1426
|
side: "bottom",
|
|
1427
1427
|
align: "start",
|
|
@@ -1434,11 +1434,11 @@ function Lr({
|
|
|
1434
1434
|
)
|
|
1435
1435
|
] }) })
|
|
1436
1436
|
) : /* @__PURE__ */ i(Se, { children: [
|
|
1437
|
-
/* @__PURE__ */ n(
|
|
1437
|
+
/* @__PURE__ */ n(dr, { owners: R, max: 10, emptyLabel: "—" }),
|
|
1438
1438
|
ne.map((v) => /* @__PURE__ */ i(
|
|
1439
1439
|
"span",
|
|
1440
1440
|
{
|
|
1441
|
-
"data-tip": `${v.name} is ${
|
|
1441
|
+
"data-tip": `${v.name} is ${Ee[v.reason] ?? v.reason}${v.delegate ? ` — ${v.delegate.name} covers${v.delegate.expires_at ? ` until ${sr(v.delegate.expires_at)}` : ""}` : " and nobody is covering"}`,
|
|
1442
1442
|
className: ge(
|
|
1443
1443
|
"inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10.5px] font-medium",
|
|
1444
1444
|
v.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"
|
|
@@ -1462,7 +1462,7 @@ function Lr({
|
|
|
1462
1462
|
] }) : /* @__PURE__ */ i("span", { className: "opacity-80", children: [
|
|
1463
1463
|
" ",
|
|
1464
1464
|
"· ",
|
|
1465
|
-
|
|
1465
|
+
Ee[v.reason] ?? v.reason
|
|
1466
1466
|
] })
|
|
1467
1467
|
]
|
|
1468
1468
|
},
|
|
@@ -1478,7 +1478,7 @@ function Lr({
|
|
|
1478
1478
|
] })
|
|
1479
1479
|
] });
|
|
1480
1480
|
}
|
|
1481
|
-
function
|
|
1481
|
+
function Sa({
|
|
1482
1482
|
collection: t,
|
|
1483
1483
|
item: e,
|
|
1484
1484
|
defaultExpanded: r,
|
|
@@ -1492,7 +1492,7 @@ function Na({
|
|
|
1492
1492
|
asRole: k
|
|
1493
1493
|
}) {
|
|
1494
1494
|
return e === "new" ? null : /* @__PURE__ */ n(
|
|
1495
|
-
|
|
1495
|
+
jr,
|
|
1496
1496
|
{
|
|
1497
1497
|
collection: t,
|
|
1498
1498
|
item: e,
|
|
@@ -1509,14 +1509,14 @@ function Na({
|
|
|
1509
1509
|
`${t}:${e}`
|
|
1510
1510
|
);
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function En({
|
|
1513
1513
|
collection: t,
|
|
1514
1514
|
item: e,
|
|
1515
1515
|
omitLines: r
|
|
1516
1516
|
}) {
|
|
1517
1517
|
const s = Pe(), { data: o } = be({
|
|
1518
|
-
queryKey:
|
|
1519
|
-
queryFn: () =>
|
|
1518
|
+
queryKey: Cn(t, e),
|
|
1519
|
+
queryFn: () => $n(s, t, e),
|
|
1520
1520
|
staleTime: 3e4,
|
|
1521
1521
|
retry: !1
|
|
1522
1522
|
});
|
|
@@ -1527,7 +1527,7 @@ function Bn({
|
|
|
1527
1527
|
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: "Since entering this state" }),
|
|
1528
1528
|
" ",
|
|
1529
1529
|
"(",
|
|
1530
|
-
|
|
1530
|
+
qr(o.days_in_state),
|
|
1531
1531
|
"):",
|
|
1532
1532
|
" ",
|
|
1533
1533
|
o.changed_total === 0 && o.comments === 0 && o.addendums.count === 0 ? /* @__PURE__ */ n("span", { children: "no changes to this record." }) : /* @__PURE__ */ i(Se, { children: [
|
|
@@ -1556,14 +1556,14 @@ function Bn({
|
|
|
1556
1556
|
] }),
|
|
1557
1557
|
o.field_changes.length > 0 && /* @__PURE__ */ i("div", { className: "mt-1 space-y-0.5", children: [
|
|
1558
1558
|
o.field_changes.slice(0, 5).map((p) => {
|
|
1559
|
-
const x =
|
|
1559
|
+
const x = Mr(p.old, p.new);
|
|
1560
1560
|
return /* @__PURE__ */ i(
|
|
1561
1561
|
"p",
|
|
1562
1562
|
{
|
|
1563
1563
|
"data-brief-change": p.field,
|
|
1564
1564
|
className: "text-[11px] text-slate-500 dark:text-muted-foreground",
|
|
1565
1565
|
children: [
|
|
1566
|
-
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: p.label ||
|
|
1566
|
+
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-foreground", children: p.label || ar(p.field) }),
|
|
1567
1567
|
p.auto ? /* @__PURE__ */ n("span", { children: " (updated automatically)" }) : null,
|
|
1568
1568
|
":",
|
|
1569
1569
|
" ",
|
|
@@ -1605,7 +1605,7 @@ function Bn({
|
|
|
1605
1605
|
))
|
|
1606
1606
|
] });
|
|
1607
1607
|
}
|
|
1608
|
-
function
|
|
1608
|
+
function jr({
|
|
1609
1609
|
collection: t,
|
|
1610
1610
|
item: e,
|
|
1611
1611
|
defaultExpanded: r,
|
|
@@ -1618,29 +1618,29 @@ function Er({
|
|
|
1618
1618
|
addendumView: x,
|
|
1619
1619
|
asRole: k
|
|
1620
1620
|
}) {
|
|
1621
|
-
var
|
|
1622
|
-
const R = Pe(), _ =
|
|
1621
|
+
var Dt, Ut, Bt;
|
|
1622
|
+
const R = Pe(), _ = Ve(), { isAdmin: U } = nn(), [j, ne] = Q(0), re = ce(null);
|
|
1623
1623
|
_e(() => {
|
|
1624
1624
|
if (!U) return;
|
|
1625
1625
|
const d = (N) => {
|
|
1626
1626
|
const C = N.detail;
|
|
1627
|
-
!C || C.claimed || C.collection !== t || String(C.item) !== String(e) || (C.claimed = !0, $(!0), ne((
|
|
1627
|
+
!C || C.claimed || C.collection !== t || String(C.item) !== String(e) || (C.claimed = !0, $(!0), ne((O) => O + 1), setTimeout(
|
|
1628
1628
|
() => {
|
|
1629
|
-
var
|
|
1630
|
-
return (
|
|
1629
|
+
var O;
|
|
1630
|
+
return (O = re.current) == null ? void 0 : O.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
1631
1631
|
},
|
|
1632
1632
|
80
|
|
1633
1633
|
));
|
|
1634
1634
|
};
|
|
1635
1635
|
return window.addEventListener(Lt, d), () => window.removeEventListener(Lt, d);
|
|
1636
1636
|
}, [U, t, e]);
|
|
1637
|
-
const [ae, F] = Q(""), [E, K] = Q(null), [f, v] = Q(!1), [g, $] = Q(!1), [T, X] = Q(null), [u, b] = Q(null), [
|
|
1638
|
-
|
|
1639
|
-
const
|
|
1637
|
+
const [ae, F] = Q(""), [E, K] = Q(null), [f, v] = Q(!1), [g, $] = Q(!1), [T, X] = Q(null), [u, b] = Q(null), [M, ee] = Q(null), [W, ue] = Q([]), xe = Tn(t, String(e));
|
|
1638
|
+
on(t, e, "transition", !!E || !!T);
|
|
1639
|
+
const de = er(t, e, "transition"), D = ce(!1);
|
|
1640
1640
|
_e(() => {
|
|
1641
|
-
!
|
|
1641
|
+
!D.current && r !== void 0 && (D.current = !0, $(r));
|
|
1642
1642
|
}, [r]);
|
|
1643
|
-
const Y =
|
|
1643
|
+
const Y = ce(!1), z = (d) => {
|
|
1644
1644
|
Y.current || (Y.current = !0, b(null), P.mutate(d, {
|
|
1645
1645
|
onSettled: (N, C) => {
|
|
1646
1646
|
if (C) {
|
|
@@ -1652,54 +1652,54 @@ function Er({
|
|
|
1652
1652
|
});
|
|
1653
1653
|
}
|
|
1654
1654
|
}));
|
|
1655
|
-
},
|
|
1656
|
-
var
|
|
1655
|
+
}, ie = async (d, N) => {
|
|
1656
|
+
var fe, me;
|
|
1657
1657
|
if (Y.current || a != null && a.running_move) return;
|
|
1658
1658
|
if (E === d) {
|
|
1659
1659
|
K(null);
|
|
1660
1660
|
return;
|
|
1661
1661
|
}
|
|
1662
|
-
if (!(N != null && N.cleared) && ((a == null ? void 0 : a.available_transitions) ?? []).some((
|
|
1662
|
+
if (!(N != null && N.cleared) && ((a == null ? void 0 : a.available_transitions) ?? []).some((le) => le.id === d && le.advisory)) {
|
|
1663
1663
|
K(null), b(null), ee(d), _.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
|
|
1664
1664
|
return;
|
|
1665
1665
|
}
|
|
1666
1666
|
if (ee(null), h) {
|
|
1667
1667
|
Y.current = !0;
|
|
1668
|
-
let
|
|
1668
|
+
let le = !1;
|
|
1669
1669
|
try {
|
|
1670
|
-
|
|
1670
|
+
le = await h();
|
|
1671
1671
|
} finally {
|
|
1672
1672
|
Y.current = !1;
|
|
1673
1673
|
}
|
|
1674
|
-
if (!
|
|
1674
|
+
if (!le) return;
|
|
1675
1675
|
}
|
|
1676
|
-
const C = (
|
|
1677
|
-
if (
|
|
1678
|
-
if (C && !
|
|
1676
|
+
const C = (G ?? []).find((le) => le.id === d), O = String((C == null ? void 0 : C.comment_mode) ?? "none"), te = qt(C, (a == null ? void 0 : a.states) ?? [], (fe = a == null ? void 0 : a.instance) == null ? void 0 : fe.current_state);
|
|
1677
|
+
if (O !== "optional" && O !== "required") {
|
|
1678
|
+
if (C && !Xe(C, (a == null ? void 0 : a.states) ?? [], (me = a == null ? void 0 : a.instance) == null ? void 0 : me.current_state)) {
|
|
1679
1679
|
Y.current = !0;
|
|
1680
|
-
let
|
|
1680
|
+
let le = [];
|
|
1681
1681
|
try {
|
|
1682
|
-
|
|
1682
|
+
le = await xe();
|
|
1683
1683
|
} finally {
|
|
1684
1684
|
Y.current = !1;
|
|
1685
1685
|
}
|
|
1686
|
-
if (
|
|
1687
|
-
|
|
1686
|
+
if (le.length > 0 || te) {
|
|
1687
|
+
ue(le), K(d);
|
|
1688
1688
|
return;
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
1691
|
if (te) {
|
|
1692
|
-
|
|
1692
|
+
ue([]), K(d);
|
|
1693
1693
|
return;
|
|
1694
1694
|
}
|
|
1695
1695
|
z({ transition_id: d });
|
|
1696
1696
|
return;
|
|
1697
1697
|
}
|
|
1698
|
-
|
|
1699
|
-
},
|
|
1700
|
-
queryKey:
|
|
1698
|
+
ue([]), K(d);
|
|
1699
|
+
}, H = k ? ["pipeline-instance", t, e, k] : ["pipeline-instance", t, e], { settling: qe, settle: Oe } = _n(H), { data: a, isLoading: I } = be({
|
|
1700
|
+
queryKey: H,
|
|
1701
1701
|
queryFn: () => R.request(
|
|
1702
|
-
|
|
1702
|
+
we(
|
|
1703
1703
|
`/pipelines/instance/${t}/${e}${k ? `?as_role=${encodeURIComponent(k)}` : ""}`
|
|
1704
1704
|
)
|
|
1705
1705
|
).then(
|
|
@@ -1713,12 +1713,12 @@ function Er({
|
|
|
1713
1713
|
}
|
|
1714
1714
|
),
|
|
1715
1715
|
staleTime: 1e4,
|
|
1716
|
-
refetchInterval: (d) =>
|
|
1716
|
+
refetchInterval: (d) => mn(d.state.data)
|
|
1717
1717
|
});
|
|
1718
|
-
|
|
1719
|
-
|
|
1718
|
+
pn(!!(a != null && a.running_move), () => {
|
|
1719
|
+
Ie(_, t, String(e)), je(_, t, String(e)), nt(_, t, String(e));
|
|
1720
1720
|
});
|
|
1721
|
-
const Z =
|
|
1721
|
+
const Z = Sn(
|
|
1722
1722
|
a ? (a.available_transitions ?? []).map((d) => String(d.id)) : null,
|
|
1723
1723
|
`${t}:${e}`
|
|
1724
1724
|
);
|
|
@@ -1730,50 +1730,50 @@ function Er({
|
|
|
1730
1730
|
}),
|
|
1731
1731
|
[_, t, e]
|
|
1732
1732
|
);
|
|
1733
|
-
const { data: J, isLoading:
|
|
1733
|
+
const { data: J, isLoading: he } = be({
|
|
1734
1734
|
queryKey: ["pipeline-all-owners", t, e],
|
|
1735
1735
|
queryFn: () => R.request(
|
|
1736
|
-
|
|
1736
|
+
we(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
1737
1737
|
).then((d) => d.data ?? null),
|
|
1738
1738
|
// Also when a send back is on offer: its target may be a chain step this record skipped.
|
|
1739
1739
|
// And while a move is being confirmed: the panel names where it really lands.
|
|
1740
|
-
enabled: (g ||
|
|
1740
|
+
enabled: (g || Rn(a) || !!E) && !!(a != null && a.instance),
|
|
1741
1741
|
staleTime: 3e4
|
|
1742
|
-
}), l =
|
|
1742
|
+
}), l = et(() => {
|
|
1743
1743
|
if (!J) return null;
|
|
1744
1744
|
const d = Object.entries(J);
|
|
1745
1745
|
return d.length === 0 || d.every(([, N]) => N.on_path === void 0) ? null : new Set(d.filter(([, N]) => N.on_path !== !1).map(([N]) => N));
|
|
1746
|
-
}, [J]), y =
|
|
1746
|
+
}, [J]), y = et(() => {
|
|
1747
1747
|
if (!J) return null;
|
|
1748
1748
|
const d = /* @__PURE__ */ new Map();
|
|
1749
1749
|
for (const [N, C] of Object.entries(J))
|
|
1750
1750
|
C.skipped && d.set(N, C.skip_reasons ?? []);
|
|
1751
1751
|
return d;
|
|
1752
|
-
}, [J]), w =
|
|
1753
|
-
mutationFn: () => R.request(
|
|
1752
|
+
}, [J]), w = Qe({
|
|
1753
|
+
mutationFn: () => R.request(Ge(`/pipelines/instance/${t}/${e}/start`, {})),
|
|
1754
1754
|
onSuccess: () => {
|
|
1755
|
-
_.invalidateQueries({ queryKey:
|
|
1755
|
+
_.invalidateQueries({ queryKey: H }), V.success("Pipeline started");
|
|
1756
1756
|
},
|
|
1757
1757
|
onError: () => V.error("Failed to start pipeline")
|
|
1758
|
-
}), P =
|
|
1758
|
+
}), P = Qe({
|
|
1759
1759
|
mutationFn: ({
|
|
1760
1760
|
transition_id: d,
|
|
1761
1761
|
comment: N,
|
|
1762
1762
|
reviewed: C,
|
|
1763
|
-
lock_ack:
|
|
1763
|
+
lock_ack: O
|
|
1764
1764
|
}) => R.request(
|
|
1765
|
-
|
|
1765
|
+
Ge(`/pipelines/instance/${t}/${e}/transition`, {
|
|
1766
1766
|
transition_id: d,
|
|
1767
1767
|
comment: N,
|
|
1768
1768
|
...C ? { reviewed: !0 } : {},
|
|
1769
|
-
...
|
|
1770
|
-
...
|
|
1769
|
+
...O ? { lock_ack: !0 } : {},
|
|
1770
|
+
...hn(a == null ? void 0 : a.available_transitions, d)
|
|
1771
1771
|
})
|
|
1772
1772
|
),
|
|
1773
1773
|
onMutate: (d) => {
|
|
1774
1774
|
var N;
|
|
1775
1775
|
return {
|
|
1776
|
-
slow:
|
|
1776
|
+
slow: An(
|
|
1777
1777
|
(N = [...(a == null ? void 0 : a.available_transitions) ?? [], ...(a == null ? void 0 : a.all_transitions) ?? []].find(
|
|
1778
1778
|
(C) => C.id === d.transition_id
|
|
1779
1779
|
)) == null ? void 0 : N.label
|
|
@@ -1781,30 +1781,30 @@ function Er({
|
|
|
1781
1781
|
};
|
|
1782
1782
|
},
|
|
1783
1783
|
onSuccess: (d, N, C) => {
|
|
1784
|
-
_.invalidateQueries({ queryKey:
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1787
|
-
`${
|
|
1784
|
+
_.invalidateQueries({ queryKey: H }), t === "nivaro_addendums" && _.invalidateQueries({ queryKey: ["addendums"] }), Ie(_, t, String(e)), je(_, t, String(e)), nt(_, t, String(e)), b(null), F(""), K(null), X(null);
|
|
1785
|
+
const O = fn(d);
|
|
1786
|
+
O ? V.info(
|
|
1787
|
+
`${O.transition_label ?? "The move"} started. You will be told if it does not go through.`,
|
|
1788
1788
|
C == null ? void 0 : C.slow.done()
|
|
1789
|
-
) : V.success(
|
|
1789
|
+
) : V.success(Fn(a, N.transition_id, d), C == null ? void 0 : C.slow.done());
|
|
1790
1790
|
},
|
|
1791
1791
|
onError: (d, N, C) => {
|
|
1792
|
-
var
|
|
1793
|
-
if (C == null || C.slow.fail(),
|
|
1794
|
-
_.invalidateQueries({ queryKey:
|
|
1792
|
+
var le, ze;
|
|
1793
|
+
if (C == null || C.slow.fail(), yn(d)) {
|
|
1794
|
+
_.invalidateQueries({ queryKey: H });
|
|
1795
1795
|
return;
|
|
1796
1796
|
}
|
|
1797
|
-
if (
|
|
1798
|
-
_.invalidateQueries({ queryKey:
|
|
1797
|
+
if (at(d) === "TRANSITION_RUNNING") {
|
|
1798
|
+
_.invalidateQueries({ queryKey: H }), K(null), X(null), V.info(Ae(d, "This move is already running on this record."));
|
|
1799
1799
|
return;
|
|
1800
1800
|
}
|
|
1801
|
-
const
|
|
1802
|
-
if (
|
|
1801
|
+
const O = kn(d);
|
|
1802
|
+
if (O) {
|
|
1803
1803
|
K(null);
|
|
1804
|
-
const ke = ((
|
|
1804
|
+
const ke = ((le = [...(a == null ? void 0 : a.available_transitions) ?? [], ...(a == null ? void 0 : a.all_transitions) ?? []].find(
|
|
1805
1805
|
(A) => A.id === N.transition_id
|
|
1806
|
-
)) == null ? void 0 :
|
|
1807
|
-
V.warning(
|
|
1806
|
+
)) == null ? void 0 : le.label) ?? "Move";
|
|
1807
|
+
V.warning(O.message, {
|
|
1808
1808
|
id: `nvr-locked-move:${t}:${String(e)}`,
|
|
1809
1809
|
duration: 2e4,
|
|
1810
1810
|
action: {
|
|
@@ -1816,7 +1816,7 @@ function Er({
|
|
|
1816
1816
|
});
|
|
1817
1817
|
return;
|
|
1818
1818
|
}
|
|
1819
|
-
const te =
|
|
1819
|
+
const te = wn(d);
|
|
1820
1820
|
if (te) {
|
|
1821
1821
|
X((ke) => ({
|
|
1822
1822
|
payload: te,
|
|
@@ -1826,47 +1826,51 @@ function Er({
|
|
|
1826
1826
|
}));
|
|
1827
1827
|
return;
|
|
1828
1828
|
}
|
|
1829
|
-
const
|
|
1830
|
-
b(
|
|
1831
|
-
const
|
|
1829
|
+
const fe = d == null ? void 0 : d.response;
|
|
1830
|
+
b(Nn(d, N));
|
|
1831
|
+
const me = an(
|
|
1832
1832
|
d,
|
|
1833
|
-
(
|
|
1833
|
+
(ze = [...(a == null ? void 0 : a.available_transitions) ?? [], ...(a == null ? void 0 : a.all_transitions) ?? []].find(
|
|
1834
1834
|
(ke) => ke.id === N.transition_id
|
|
1835
|
-
)) == null ? void 0 :
|
|
1835
|
+
)) == null ? void 0 : ze.label
|
|
1836
1836
|
);
|
|
1837
|
-
V.error((
|
|
1837
|
+
V.error((me == null ? void 0 : me.title) ?? Ae(d, "Failed to execute transition"), {
|
|
1838
1838
|
duration: 12e3,
|
|
1839
1839
|
// What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
|
|
1840
|
-
|
|
1841
|
-
|
|
1840
|
+
// A partner's refusal copies what the toast said and the other system's answer as
|
|
1841
|
+
// stored, never the generic reading of a 422.
|
|
1842
|
+
...rn(me ? sn(d, me) : d, {
|
|
1843
|
+
action: "Transition"
|
|
1844
|
+
}),
|
|
1845
|
+
...me ? { description: me.description } : {},
|
|
1842
1846
|
// #1867: a refusal carries "Why?" — the role, owner or access rule
|
|
1843
1847
|
// that stopped it, and who can change it.
|
|
1844
|
-
...
|
|
1845
|
-
action:
|
|
1848
|
+
...cn(d) ? {
|
|
1849
|
+
action: un(R, {
|
|
1846
1850
|
collection: t,
|
|
1847
1851
|
itemId: String(e),
|
|
1848
1852
|
action: "transition",
|
|
1849
1853
|
transitionId: N.transition_id
|
|
1850
1854
|
})
|
|
1851
1855
|
} : {}
|
|
1852
|
-
}), X(null), K(null),
|
|
1856
|
+
}), X(null), K(null), Ie(_, t, String(e)), je(_, t, String(e)), (fe == null ? void 0 : fe.status) === 409 && _.invalidateQueries({ queryKey: H });
|
|
1853
1857
|
}
|
|
1854
|
-
}), B =
|
|
1855
|
-
B.current =
|
|
1856
|
-
const
|
|
1857
|
-
if (
|
|
1858
|
+
}), B = ce(ie);
|
|
1859
|
+
B.current = ie;
|
|
1860
|
+
const oe = ce((a == null ? void 0 : a.available_transitions) ?? []);
|
|
1861
|
+
if (oe.current = (a == null ? void 0 : a.available_transitions) ?? [], _e(() => {
|
|
1858
1862
|
const d = (N) => {
|
|
1859
1863
|
const C = N.detail;
|
|
1860
1864
|
if (!C || C.claimed || C.collection !== t || String(C.item) !== String(e)) return;
|
|
1861
1865
|
C.claimed = !0;
|
|
1862
|
-
const
|
|
1866
|
+
const O = String(C.transition_id).toUpperCase(), te = oe.current.find((fe) => String(fe.id).toUpperCase() === O);
|
|
1863
1867
|
if (!te) {
|
|
1864
1868
|
V.error("That step is not available from where the record is now");
|
|
1865
1869
|
return;
|
|
1866
1870
|
}
|
|
1867
1871
|
B.current(te.id);
|
|
1868
1872
|
};
|
|
1869
|
-
return window.addEventListener(
|
|
1873
|
+
return window.addEventListener(tt, d), () => window.removeEventListener(tt, d);
|
|
1870
1874
|
}, [t, e]), I)
|
|
1871
1875
|
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: [
|
|
1872
1876
|
/* @__PURE__ */ n(Me, { className: "h-3.5 w-3.5 shrink-0 rounded" }),
|
|
@@ -1875,80 +1879,80 @@ function Er({
|
|
|
1875
1879
|
/* @__PURE__ */ n(Me, { className: "ml-auto h-3.5 w-3.5 rounded" })
|
|
1876
1880
|
] }) });
|
|
1877
1881
|
if (!(a != null && a.binding)) return null;
|
|
1878
|
-
const { instance:
|
|
1879
|
-
(d) => d.from_state && String(d.from_state).toUpperCase() === String(
|
|
1880
|
-
) : null, De =
|
|
1881
|
-
|
|
1882
|
+
const { instance: q, available_transitions: G, history: S, states: L } = a, ve = new Map((L ?? []).map((d) => [d.id, d])), Ce = (q == null ? void 0 : q.current_state_obj) ?? null, se = E ? (G ?? []).find((d) => d.id === E) : null, In = se ? ve.get(se.to_state) : null, Ye = Bn(se, Ce, L, J), st = (Ye == null ? void 0 : Ye.state) ?? In, jn = q != null && q.completed_at && G ? G.filter(
|
|
1883
|
+
(d) => d.from_state && String(d.from_state).toUpperCase() === String(q.current_state).toUpperCase()
|
|
1884
|
+
) : null, De = q != null && q.completed_at ? jn ?? [] : Pn(
|
|
1885
|
+
G ?? [],
|
|
1882
1886
|
L ?? [],
|
|
1883
|
-
|
|
1887
|
+
q == null ? void 0 : q.current_state,
|
|
1884
1888
|
y
|
|
1885
|
-
),
|
|
1889
|
+
), it = De.length > 0, Mt = gn(De), Ke = M ? De.find((d) => d.id === M) : null, $e = (a == null ? void 0 : a.running_move) ?? null, We = $e ? null : (a == null ? void 0 : a.last_move_problem) ?? null, Rt = We ? De.find((d) => vt(d.id, We.transition_id)) : null, Pt = (d, N = !1) => {
|
|
1886
1890
|
const C = /* @__PURE__ */ new Map();
|
|
1887
|
-
for (const
|
|
1888
|
-
const te = C.get(
|
|
1889
|
-
te.push(
|
|
1891
|
+
for (const O of d) {
|
|
1892
|
+
const te = C.get(O.label) ?? [];
|
|
1893
|
+
te.push(O), C.set(O.label, te);
|
|
1890
1894
|
}
|
|
1891
|
-
return Array.from(C.entries()).map(([
|
|
1892
|
-
var
|
|
1893
|
-
const
|
|
1895
|
+
return Array.from(C.entries()).map(([O, te]) => {
|
|
1896
|
+
var ze, ke;
|
|
1897
|
+
const fe = ((ze = te[0]) == null ? void 0 : ze.color) ?? null, me = te.some((A) => A.id === E), le = (A) => fe ? A ? { backgroundColor: fe, borderColor: fe } : { borderColor: fe, color: fe } : void 0;
|
|
1894
1898
|
if (te.length === 1) {
|
|
1895
|
-
const A = te[0], Te = P.isPending && ((ke = P.variables) == null ? void 0 : ke.transition_id) === A.id ||
|
|
1896
|
-
|
|
1897
|
-
ue,
|
|
1899
|
+
const A = te[0], Te = P.isPending && ((ke = P.variables) == null ? void 0 : ke.transition_id) === A.id || vt($e == null ? void 0 : $e.transition_id, A.id), Ue = bn(We, A.id), He = /* @__PURE__ */ i(
|
|
1900
|
+
pe,
|
|
1898
1901
|
{
|
|
1899
1902
|
size: "sm",
|
|
1900
|
-
variant:
|
|
1903
|
+
variant: me && !A.advisory ? "default" : "outline",
|
|
1901
1904
|
className: ge(
|
|
1902
1905
|
N ? "h-7 text-[11px]" : "text-[12px]",
|
|
1903
1906
|
"gap-1.5 data-[fresh=true]:opacity-60",
|
|
1904
|
-
A.advisory &&
|
|
1907
|
+
A.advisory && On
|
|
1905
1908
|
),
|
|
1906
|
-
style: A.advisory ? void 0 :
|
|
1907
|
-
disabled: P.isPending || qe || !!$e,
|
|
1909
|
+
style: A.advisory ? void 0 : le(me),
|
|
1910
|
+
disabled: P.isPending || qe || !!$e || !!Ue,
|
|
1908
1911
|
"aria-disabled": Z.dimmed(A.id) || void 0,
|
|
1909
1912
|
"data-fresh": Z.dimmed(A.id) || void 0,
|
|
1910
1913
|
...Z.bind(A.id),
|
|
1911
|
-
...
|
|
1914
|
+
...Le(A),
|
|
1912
1915
|
onClick: () => {
|
|
1913
|
-
Z.press(A.id) &&
|
|
1916
|
+
Z.press(A.id) && ie(A.id);
|
|
1914
1917
|
},
|
|
1915
1918
|
children: [
|
|
1916
|
-
Te ? /* @__PURE__ */ n(
|
|
1917
|
-
|
|
1919
|
+
Te ? /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }) : A.advisory && /* @__PURE__ */ n(Ne, {}),
|
|
1920
|
+
O
|
|
1918
1921
|
]
|
|
1919
1922
|
},
|
|
1920
|
-
|
|
1923
|
+
O
|
|
1921
1924
|
);
|
|
1925
|
+
return Ue ? /* @__PURE__ */ n("span", { className: "inline-flex", "data-tip": Ue, "data-move-held": !0, children: He }, O) : He;
|
|
1922
1926
|
}
|
|
1923
|
-
return /* @__PURE__ */ i(
|
|
1924
|
-
/* @__PURE__ */ n(
|
|
1925
|
-
|
|
1927
|
+
return /* @__PURE__ */ i(mt, { children: [
|
|
1928
|
+
/* @__PURE__ */ n(pt, { asChild: !0, children: /* @__PURE__ */ i(
|
|
1929
|
+
pe,
|
|
1926
1930
|
{
|
|
1927
1931
|
size: "sm",
|
|
1928
|
-
variant:
|
|
1932
|
+
variant: me ? "default" : "outline",
|
|
1929
1933
|
className: `${N ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
|
|
1930
|
-
style:
|
|
1934
|
+
style: le(me),
|
|
1931
1935
|
disabled: P.isPending || qe || !!$e,
|
|
1932
1936
|
children: [
|
|
1933
1937
|
te.every((A) => A.advisory) && /* @__PURE__ */ n(Ne, {}),
|
|
1934
|
-
|
|
1938
|
+
O,
|
|
1935
1939
|
/* @__PURE__ */ n(Fe, { className: "h-3 w-3" })
|
|
1936
1940
|
]
|
|
1937
1941
|
}
|
|
1938
1942
|
) }),
|
|
1939
|
-
/* @__PURE__ */ i(
|
|
1943
|
+
/* @__PURE__ */ i(ft, { align: "start", children: [
|
|
1940
1944
|
[...te].sort(
|
|
1941
1945
|
(A, Te) => {
|
|
1942
|
-
var
|
|
1943
|
-
return (((
|
|
1946
|
+
var Ue, He;
|
|
1947
|
+
return (((Ue = ve.get(A.to_state)) == null ? void 0 : Ue.sort) ?? 999) - (((He = ve.get(Te.to_state)) == null ? void 0 : He.sort) ?? 999);
|
|
1944
1948
|
}
|
|
1945
1949
|
).map((A) => {
|
|
1946
1950
|
var Te;
|
|
1947
1951
|
return /* @__PURE__ */ i(
|
|
1948
|
-
|
|
1952
|
+
Je,
|
|
1949
1953
|
{
|
|
1950
|
-
onSelect: () =>
|
|
1951
|
-
...
|
|
1954
|
+
onSelect: () => ie(A.id),
|
|
1955
|
+
...Le(A, "menu"),
|
|
1952
1956
|
children: [
|
|
1953
1957
|
A.color && /* @__PURE__ */ n(
|
|
1954
1958
|
"span",
|
|
@@ -1957,7 +1961,7 @@ function Er({
|
|
|
1957
1961
|
style: { backgroundColor: A.color }
|
|
1958
1962
|
}
|
|
1959
1963
|
),
|
|
1960
|
-
((Te =
|
|
1964
|
+
((Te = ve.get(A.to_state)) == null ? void 0 : Te.label) ?? A.to_state,
|
|
1961
1965
|
A.advisory && /* @__PURE__ */ n(Ne, { className: "ml-auto" })
|
|
1962
1966
|
]
|
|
1963
1967
|
},
|
|
@@ -1965,20 +1969,20 @@ function Er({
|
|
|
1965
1969
|
);
|
|
1966
1970
|
}),
|
|
1967
1971
|
/* @__PURE__ */ n(
|
|
1968
|
-
|
|
1972
|
+
kt,
|
|
1969
1973
|
{
|
|
1970
1974
|
moves: te,
|
|
1971
1975
|
nameOf: (A) => {
|
|
1972
1976
|
var Te;
|
|
1973
|
-
return ((Te =
|
|
1977
|
+
return ((Te = ve.get(A.to_state)) == null ? void 0 : Te.label) ?? A.to_state;
|
|
1974
1978
|
}
|
|
1975
1979
|
}
|
|
1976
1980
|
)
|
|
1977
1981
|
] })
|
|
1978
|
-
] },
|
|
1982
|
+
] }, O);
|
|
1979
1983
|
});
|
|
1980
|
-
},
|
|
1981
|
-
|
|
1984
|
+
}, ot = u ? /* @__PURE__ */ n(
|
|
1985
|
+
Un,
|
|
1982
1986
|
{
|
|
1983
1987
|
collection: t,
|
|
1984
1988
|
item: String(e),
|
|
@@ -1986,70 +1990,70 @@ function Er({
|
|
|
1986
1990
|
onDismiss: () => b(null),
|
|
1987
1991
|
onFixed: () => z({ transition_id: u.transitionId, comment: u.comment })
|
|
1988
1992
|
}
|
|
1989
|
-
) : null,
|
|
1990
|
-
|
|
1991
|
-
|
|
1993
|
+
) : null, Qn = g && !m && !!q && it, Ft = (d) => /* @__PURE__ */ i(Se, { children: [
|
|
1994
|
+
Mt.map(({ advisory: N, moves: C }) => /* @__PURE__ */ n(
|
|
1995
|
+
xn,
|
|
1992
1996
|
{
|
|
1993
1997
|
collection: t,
|
|
1994
1998
|
item: String(e),
|
|
1995
1999
|
advisory: N,
|
|
1996
|
-
armedMove:
|
|
1997
|
-
id:
|
|
1998
|
-
label:
|
|
1999
|
-
confirms:
|
|
2000
|
+
armedMove: Ke && C.some((O) => O.id === Ke.id) ? {
|
|
2001
|
+
id: Ke.id,
|
|
2002
|
+
label: Ke.label,
|
|
2003
|
+
confirms: Dn(Ke, L ?? [], q == null ? void 0 : q.current_state)
|
|
2000
2004
|
} : null,
|
|
2001
|
-
stops:
|
|
2005
|
+
stops: Mt.length > 1 ? [...new Set(C.map((O) => O.label))] : void 0,
|
|
2002
2006
|
className: d ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0,
|
|
2003
2007
|
onDismiss: () => ee(null),
|
|
2004
|
-
onFixed: (
|
|
2005
|
-
ee(null), _.invalidateQueries({ queryKey:
|
|
2008
|
+
onFixed: (O) => {
|
|
2009
|
+
ee(null), _.invalidateQueries({ queryKey: H }), O && ie(O.id, { cleared: !0 });
|
|
2006
2010
|
}
|
|
2007
2011
|
},
|
|
2008
2012
|
`${N.code}:${N.message}`
|
|
2009
2013
|
)),
|
|
2010
2014
|
$e && /* @__PURE__ */ n(
|
|
2011
|
-
|
|
2015
|
+
fr,
|
|
2012
2016
|
{
|
|
2013
2017
|
run: $e,
|
|
2014
2018
|
className: d ? "rounded-lg border border-sky-200/80 px-3 dark:border-sky-500/20" : void 0
|
|
2015
2019
|
}
|
|
2016
2020
|
),
|
|
2017
|
-
|
|
2018
|
-
|
|
2021
|
+
We && /* @__PURE__ */ n(
|
|
2022
|
+
hr,
|
|
2019
2023
|
{
|
|
2020
|
-
problem:
|
|
2024
|
+
problem: We,
|
|
2021
2025
|
retryDisabled: P.isPending || qe,
|
|
2022
|
-
onRetry:
|
|
2026
|
+
onRetry: Rt ? () => void ie(Rt.id) : void 0,
|
|
2023
2027
|
className: d ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0
|
|
2024
2028
|
}
|
|
2025
2029
|
)
|
|
2026
|
-
] }),
|
|
2030
|
+
] }), At = Ar(S ?? [], q == null ? void 0 : q.current_state, L ?? []), Ot = /* @__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: [
|
|
2027
2031
|
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2028
2032
|
/* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
/* @__PURE__ */ n(Re, { label:
|
|
2032
|
-
/* @__PURE__ */ n(
|
|
2033
|
-
/* @__PURE__ */ n(Re, { label:
|
|
2033
|
+
se && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: se.label }),
|
|
2034
|
+
Ce && st && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
2035
|
+
/* @__PURE__ */ n(Re, { label: Ce.label, color: Ce.color, small: !0 }),
|
|
2036
|
+
/* @__PURE__ */ n(Nt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
|
|
2037
|
+
/* @__PURE__ */ n(Re, { label: st.label, color: st.color, small: !0 })
|
|
2034
2038
|
] })
|
|
2035
2039
|
] }),
|
|
2036
|
-
/* @__PURE__ */ n(
|
|
2037
|
-
/* @__PURE__ */ n(
|
|
2038
|
-
/* @__PURE__ */ n(
|
|
2039
|
-
/* @__PURE__ */ n(
|
|
2040
|
+
/* @__PURE__ */ n(Ln, { landing: Ye }),
|
|
2041
|
+
/* @__PURE__ */ n(Mn, { collection: t, item: String(e), tx: se }),
|
|
2042
|
+
/* @__PURE__ */ n(En, { collection: t, item: e, omitLines: W }),
|
|
2043
|
+
/* @__PURE__ */ n(qn, { lines: W }),
|
|
2040
2044
|
/* @__PURE__ */ n(
|
|
2041
2045
|
"input",
|
|
2042
2046
|
{
|
|
2043
2047
|
type: "text",
|
|
2044
2048
|
value: ae,
|
|
2045
2049
|
onChange: (d) => F(d.target.value),
|
|
2046
|
-
placeholder: String((
|
|
2050
|
+
placeholder: String((se == null ? void 0 : se.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
|
|
2047
2051
|
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"
|
|
2048
2052
|
}
|
|
2049
2053
|
),
|
|
2050
2054
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
|
|
2051
2055
|
/* @__PURE__ */ n(
|
|
2052
|
-
|
|
2056
|
+
pe,
|
|
2053
2057
|
{
|
|
2054
2058
|
type: "button",
|
|
2055
2059
|
size: "sm",
|
|
@@ -2060,19 +2064,19 @@ function Er({
|
|
|
2060
2064
|
}
|
|
2061
2065
|
),
|
|
2062
2066
|
/* @__PURE__ */ n(
|
|
2063
|
-
|
|
2067
|
+
pe,
|
|
2064
2068
|
{
|
|
2065
2069
|
type: "button",
|
|
2066
2070
|
size: "sm",
|
|
2067
2071
|
className: "h-7 gap-1.5 text-[12px]",
|
|
2068
|
-
disabled: P.isPending || !!$e || String((
|
|
2072
|
+
disabled: P.isPending || !!$e || String((se == null ? void 0 : se.comment_mode) ?? "") === "required" && ae.trim() === "",
|
|
2069
2073
|
onClick: () => z({
|
|
2070
2074
|
transition_id: E,
|
|
2071
2075
|
comment: ae.trim() || void 0
|
|
2072
2076
|
}),
|
|
2073
|
-
children: P.isPending ? /* @__PURE__ */ n(
|
|
2074
|
-
/* @__PURE__ */ n("span", { children: W.length > 0 &&
|
|
2075
|
-
/* @__PURE__ */ n(
|
|
2077
|
+
children: P.isPending ? /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(Se, { children: [
|
|
2078
|
+
/* @__PURE__ */ n("span", { children: W.length > 0 && se ? `${se.label} anyway` : "Confirm" }),
|
|
2079
|
+
/* @__PURE__ */ n(rt, { className: "h-3 w-3" })
|
|
2076
2080
|
] })
|
|
2077
2081
|
}
|
|
2078
2082
|
)
|
|
@@ -2093,13 +2097,13 @@ function Er({
|
|
|
2093
2097
|
onKeyDown: (d) => (d.key === "Enter" || d.key === " ") && $((N) => !N),
|
|
2094
2098
|
className: "flex w-full cursor-pointer items-center gap-2.5 px-5 py-3.5 transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
|
|
2095
2099
|
children: [
|
|
2096
|
-
/* @__PURE__ */ n(
|
|
2100
|
+
/* @__PURE__ */ n(dt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
2097
2101
|
/* @__PURE__ */ n("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: s || "Pipeline" }),
|
|
2098
2102
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
|
|
2099
2103
|
x && /* @__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" }),
|
|
2100
|
-
|
|
2101
|
-
/* @__PURE__ */ n(
|
|
2102
|
-
(((
|
|
2104
|
+
Ce && /* @__PURE__ */ n(Re, { label: Ce.label, color: Ce.color }),
|
|
2105
|
+
/* @__PURE__ */ n(Pr, { flags: a == null ? void 0 : a.flags }),
|
|
2106
|
+
(((Dt = a == null ? void 0 : a.auto_held) == null ? void 0 : Dt.length) ?? 0) > 0 && /* @__PURE__ */ i(
|
|
2103
2107
|
"span",
|
|
2104
2108
|
{
|
|
2105
2109
|
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",
|
|
@@ -2116,22 +2120,22 @@ function Er({
|
|
|
2116
2120
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 animate-pulse shrink-0" }),
|
|
2117
2121
|
"Addendum in review"
|
|
2118
2122
|
] }),
|
|
2119
|
-
|
|
2123
|
+
de.length > 0 && /* @__PURE__ */ i(
|
|
2120
2124
|
"span",
|
|
2121
2125
|
{
|
|
2122
2126
|
className: "flex items-center gap-1 rounded-full border border-sky-200 bg-sky-50 px-2 py-0.5 text-[11px] font-medium text-sky-700 dark:border-sky-500/20 dark:bg-sky-500/10 dark:text-sky-300",
|
|
2123
2127
|
"data-pipeline-approving": !0,
|
|
2124
2128
|
children: [
|
|
2125
2129
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
|
|
2126
|
-
|
|
2130
|
+
tr(de, "approving")
|
|
2127
2131
|
]
|
|
2128
2132
|
}
|
|
2129
2133
|
)
|
|
2130
2134
|
] }),
|
|
2131
2135
|
/* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-2", onClick: (d) => d.stopPropagation(), children: [
|
|
2132
|
-
!g &&
|
|
2133
|
-
!g && !
|
|
2134
|
-
|
|
2136
|
+
!g && it && !c && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: Pt(De, !0) }),
|
|
2137
|
+
!g && !q && (a == null ? void 0 : a.binding) && /* @__PURE__ */ i(
|
|
2138
|
+
pe,
|
|
2135
2139
|
{
|
|
2136
2140
|
size: "sm",
|
|
2137
2141
|
variant: "outline",
|
|
@@ -2141,18 +2145,18 @@ function Er({
|
|
|
2141
2145
|
},
|
|
2142
2146
|
disabled: w.isPending,
|
|
2143
2147
|
children: [
|
|
2144
|
-
w.isPending ? /* @__PURE__ */ n(
|
|
2148
|
+
w.isPending ? /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(dt, { className: "h-3 w-3" }),
|
|
2145
2149
|
"Start"
|
|
2146
2150
|
]
|
|
2147
2151
|
}
|
|
2148
2152
|
),
|
|
2149
2153
|
o && ((a == null ? void 0 : a.binding) || (a == null ? void 0 : a.instance)) && /* @__PURE__ */ n(
|
|
2150
|
-
|
|
2154
|
+
Ir,
|
|
2151
2155
|
{
|
|
2152
2156
|
collection: t,
|
|
2153
2157
|
item: e,
|
|
2154
2158
|
states: L ?? [],
|
|
2155
|
-
currentStateId: ((
|
|
2159
|
+
currentStateId: ((Ut = a == null ? void 0 : a.instance) == null ? void 0 : Ut.current_state) ?? null
|
|
2156
2160
|
}
|
|
2157
2161
|
)
|
|
2158
2162
|
] }),
|
|
@@ -2168,19 +2172,19 @@ function Er({
|
|
|
2168
2172
|
]
|
|
2169
2173
|
}
|
|
2170
2174
|
),
|
|
2171
|
-
!
|
|
2172
|
-
!g && E && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children:
|
|
2173
|
-
!g &&
|
|
2174
|
-
|
|
2175
|
+
!Qn && Ft(!1),
|
|
2176
|
+
!g && E && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Ot }),
|
|
2177
|
+
!g && ot && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: ot }),
|
|
2178
|
+
At && !(q != null && q.completed_at) && /* @__PURE__ */ n(Or, { entry: At }),
|
|
2175
2179
|
g && /* @__PURE__ */ i("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
|
|
2176
|
-
/* @__PURE__ */ n(
|
|
2180
|
+
/* @__PURE__ */ n(Sr, { held: (a == null ? void 0 : a.auto_held) ?? [] }),
|
|
2177
2181
|
p && /* @__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: [
|
|
2178
2182
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
|
|
2179
2183
|
/* @__PURE__ */ n("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
|
|
2180
2184
|
] }),
|
|
2181
|
-
|
|
2185
|
+
q ? /* @__PURE__ */ i("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: [
|
|
2182
2186
|
(L ?? []).length > 1 && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
|
|
2183
|
-
|
|
2187
|
+
he ? (
|
|
2184
2188
|
// Path pruning arrives with the owners query — rendering
|
|
2185
2189
|
// the UNPRUNED track first meant every state briefly
|
|
2186
2190
|
// showed, then snapped into formation. Hold a same-height
|
|
@@ -2193,35 +2197,35 @@ function Er({
|
|
|
2193
2197
|
/* @__PURE__ */ n(Me, { className: "ml-2 h-3 w-24" })
|
|
2194
2198
|
] })
|
|
2195
2199
|
) : /* @__PURE__ */ n(
|
|
2196
|
-
|
|
2200
|
+
Ur,
|
|
2197
2201
|
{
|
|
2198
2202
|
states: L,
|
|
2199
2203
|
allTransitions: (a == null ? void 0 : a.all_transitions) ?? [],
|
|
2200
|
-
availableTransitions:
|
|
2201
|
-
currentStateId:
|
|
2204
|
+
availableTransitions: G ?? [],
|
|
2205
|
+
currentStateId: q.current_state,
|
|
2202
2206
|
history: S ?? [],
|
|
2203
2207
|
onPathIds: l,
|
|
2204
2208
|
skippedStates: y
|
|
2205
2209
|
}
|
|
2206
2210
|
),
|
|
2207
|
-
(a == null ? void 0 : a.branches) && /* @__PURE__ */ n(
|
|
2211
|
+
(a == null ? void 0 : a.branches) && /* @__PURE__ */ n(br, { data: a.branches }),
|
|
2208
2212
|
/* @__PURE__ */ n(
|
|
2209
|
-
|
|
2213
|
+
Dr,
|
|
2210
2214
|
{
|
|
2211
2215
|
history: S ?? [],
|
|
2212
|
-
completedAt:
|
|
2216
|
+
completedAt: q.completed_at
|
|
2213
2217
|
}
|
|
2214
2218
|
)
|
|
2215
2219
|
] }),
|
|
2216
2220
|
/* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
|
|
2217
|
-
!
|
|
2221
|
+
!q.completed_at && /* @__PURE__ */ n(kr, { collection: t, itemId: String(e) }),
|
|
2218
2222
|
/* @__PURE__ */ n(
|
|
2219
|
-
|
|
2223
|
+
Er,
|
|
2220
2224
|
{
|
|
2221
2225
|
collection: t,
|
|
2222
2226
|
item: e,
|
|
2223
2227
|
states: L ?? [],
|
|
2224
|
-
currentStateId: ((
|
|
2228
|
+
currentStateId: ((Bt = a == null ? void 0 : a.instance) == null ? void 0 : Bt.current_state) ?? null,
|
|
2225
2229
|
returned: ((a == null ? void 0 : a.history) ?? []).some(
|
|
2226
2230
|
(d) => {
|
|
2227
2231
|
var N;
|
|
@@ -2231,11 +2235,11 @@ function Er({
|
|
|
2231
2235
|
}
|
|
2232
2236
|
)
|
|
2233
2237
|
] }),
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
/* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-2", children:
|
|
2237
|
-
E &&
|
|
2238
|
-
|
|
2238
|
+
it && !m && /* @__PURE__ */ i("div", { className: "space-y-3 px-5 py-4", children: [
|
|
2239
|
+
Ft(!0),
|
|
2240
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap justify-end gap-2", children: Pt(De) }),
|
|
2241
|
+
E && Ot,
|
|
2242
|
+
ot
|
|
2239
2243
|
] }),
|
|
2240
2244
|
/* @__PURE__ */ i("div", { className: "px-5 py-3", children: [
|
|
2241
2245
|
/* @__PURE__ */ i(
|
|
@@ -2264,18 +2268,18 @@ function Er({
|
|
|
2264
2268
|
]
|
|
2265
2269
|
}
|
|
2266
2270
|
),
|
|
2267
|
-
f && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(
|
|
2271
|
+
f && /* @__PURE__ */ n("div", { className: "mt-3", children: /* @__PURE__ */ n(Br, { history: S ?? [] }) })
|
|
2268
2272
|
] }),
|
|
2269
2273
|
U && (L ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "px-5 py-3", ref: re, children: /* @__PURE__ */ n(
|
|
2270
|
-
|
|
2274
|
+
wr,
|
|
2271
2275
|
{
|
|
2272
2276
|
collection: t,
|
|
2273
2277
|
item: e,
|
|
2274
2278
|
states: L ?? [],
|
|
2275
|
-
currentStateId:
|
|
2279
|
+
currentStateId: q.current_state ?? null,
|
|
2276
2280
|
openSignal: j,
|
|
2277
2281
|
onMoved: () => {
|
|
2278
|
-
_.invalidateQueries({ queryKey:
|
|
2282
|
+
_.invalidateQueries({ queryKey: H }), _.invalidateQueries({
|
|
2279
2283
|
queryKey: ["pipeline-instance", t, e]
|
|
2280
2284
|
});
|
|
2281
2285
|
}
|
|
@@ -2284,7 +2288,7 @@ function Er({
|
|
|
2284
2288
|
] }) : /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-4 px-5 py-4", children: [
|
|
2285
2289
|
/* @__PURE__ */ n("p", { className: "text-[13px] text-slate-500", children: "Pipeline not started for this record." }),
|
|
2286
2290
|
/* @__PURE__ */ i(
|
|
2287
|
-
|
|
2291
|
+
pe,
|
|
2288
2292
|
{
|
|
2289
2293
|
size: "sm",
|
|
2290
2294
|
variant: "outline",
|
|
@@ -2292,7 +2296,7 @@ function Er({
|
|
|
2292
2296
|
onClick: () => w.mutate(),
|
|
2293
2297
|
disabled: w.isPending,
|
|
2294
2298
|
children: [
|
|
2295
|
-
w.isPending ? /* @__PURE__ */ n(
|
|
2299
|
+
w.isPending ? /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(dt, { className: "h-3.5 w-3.5" }),
|
|
2296
2300
|
"Start Pipeline"
|
|
2297
2301
|
]
|
|
2298
2302
|
}
|
|
@@ -2303,7 +2307,7 @@ function Er({
|
|
|
2303
2307
|
}
|
|
2304
2308
|
),
|
|
2305
2309
|
T && /* @__PURE__ */ n(en, { fallback: null, children: /* @__PURE__ */ n(
|
|
2306
|
-
|
|
2310
|
+
vn,
|
|
2307
2311
|
{
|
|
2308
2312
|
payload: T.payload,
|
|
2309
2313
|
transitionId: T.transitionId,
|
|
@@ -2325,14 +2329,14 @@ function Er({
|
|
|
2325
2329
|
) })
|
|
2326
2330
|
] });
|
|
2327
2331
|
}
|
|
2328
|
-
function
|
|
2332
|
+
function Ca({
|
|
2329
2333
|
collection: t,
|
|
2330
2334
|
item: e,
|
|
2331
2335
|
onBeforeTransition: r,
|
|
2332
2336
|
wrap: s = !0
|
|
2333
2337
|
}) {
|
|
2334
2338
|
return e === "new" ? null : /* @__PURE__ */ n(
|
|
2335
|
-
|
|
2339
|
+
Qr,
|
|
2336
2340
|
{
|
|
2337
2341
|
collection: t,
|
|
2338
2342
|
item: e,
|
|
@@ -2341,15 +2345,15 @@ function _a({
|
|
|
2341
2345
|
}
|
|
2342
2346
|
);
|
|
2343
2347
|
}
|
|
2344
|
-
function
|
|
2348
|
+
function Qr({
|
|
2345
2349
|
collection: t,
|
|
2346
2350
|
item: e,
|
|
2347
2351
|
onBeforeTransition: r,
|
|
2348
2352
|
wrap: s = !0
|
|
2349
2353
|
}) {
|
|
2350
|
-
const o = Pe(), c =
|
|
2351
|
-
|
|
2352
|
-
const E =
|
|
2354
|
+
const o = Pe(), c = Ve(), [m, h] = Q(""), [p, x] = Q(null), [k, R] = Q(null), [_, U] = Q(null), [j, ne] = Q(null), [re, ae] = Q([]), F = Tn(t, String(e));
|
|
2355
|
+
on(t, e, "transition", !!p || !!k);
|
|
2356
|
+
const E = ce(null), K = lr(E, !s), f = ce(!1), v = (l) => {
|
|
2353
2357
|
f.current || (f.current = !0, U(null), W.mutate(l, {
|
|
2354
2358
|
onSettled: (y, w) => {
|
|
2355
2359
|
if (w) {
|
|
@@ -2362,38 +2366,38 @@ function Ir({
|
|
|
2362
2366
|
}
|
|
2363
2367
|
}));
|
|
2364
2368
|
}, g = async (l, y) => {
|
|
2365
|
-
var
|
|
2369
|
+
var oe, q;
|
|
2366
2370
|
if (f.current || u != null && u.running_move) return;
|
|
2367
2371
|
if (p === l) {
|
|
2368
2372
|
x(null);
|
|
2369
2373
|
return;
|
|
2370
2374
|
}
|
|
2371
|
-
if (!(y != null && y.cleared) && ((u == null ? void 0 : u.available_transitions) ?? []).some((
|
|
2375
|
+
if (!(y != null && y.cleared) && ((u == null ? void 0 : u.available_transitions) ?? []).some((G) => G.id === l && G.advisory)) {
|
|
2372
2376
|
x(null), U(null), ne(l), c.invalidateQueries({ queryKey: ["pipeline-instance", t, e] });
|
|
2373
2377
|
return;
|
|
2374
2378
|
}
|
|
2375
2379
|
if (ne(null), r) {
|
|
2376
2380
|
f.current = !0;
|
|
2377
|
-
let
|
|
2381
|
+
let G = !1;
|
|
2378
2382
|
try {
|
|
2379
|
-
|
|
2383
|
+
G = await r();
|
|
2380
2384
|
} finally {
|
|
2381
2385
|
f.current = !1;
|
|
2382
2386
|
}
|
|
2383
|
-
if (!
|
|
2387
|
+
if (!G) return;
|
|
2384
2388
|
}
|
|
2385
|
-
const w = (
|
|
2389
|
+
const w = (de ?? []).find((G) => G.id === l), P = String((w == null ? void 0 : w.comment_mode) ?? "none"), B = qt(w, (u == null ? void 0 : u.states) ?? [], (oe = u == null ? void 0 : u.instance) == null ? void 0 : oe.current_state);
|
|
2386
2390
|
if (P !== "optional" && P !== "required") {
|
|
2387
|
-
if (w && !
|
|
2391
|
+
if (w && !Xe(w, (u == null ? void 0 : u.states) ?? [], (q = u == null ? void 0 : u.instance) == null ? void 0 : q.current_state)) {
|
|
2388
2392
|
f.current = !0;
|
|
2389
|
-
let
|
|
2393
|
+
let G = [];
|
|
2390
2394
|
try {
|
|
2391
|
-
|
|
2395
|
+
G = await F();
|
|
2392
2396
|
} finally {
|
|
2393
2397
|
f.current = !1;
|
|
2394
2398
|
}
|
|
2395
|
-
if (
|
|
2396
|
-
ae(
|
|
2399
|
+
if (G.length > 0 || B) {
|
|
2400
|
+
ae(G), x(l);
|
|
2397
2401
|
return;
|
|
2398
2402
|
}
|
|
2399
2403
|
}
|
|
@@ -2405,10 +2409,10 @@ function Ir({
|
|
|
2405
2409
|
return;
|
|
2406
2410
|
}
|
|
2407
2411
|
ae([]), x(l);
|
|
2408
|
-
}, $ = ["pipeline-instance", t, e], { settling: T, settle: X } =
|
|
2412
|
+
}, $ = ["pipeline-instance", t, e], { settling: T, settle: X } = _n($), { data: u } = be({
|
|
2409
2413
|
queryKey: $,
|
|
2410
2414
|
queryFn: () => o.request(
|
|
2411
|
-
|
|
2415
|
+
we(`/pipelines/instance/${t}/${e}`)
|
|
2412
2416
|
).then(
|
|
2413
2417
|
(l) => l.data ?? {
|
|
2414
2418
|
instance: null,
|
|
@@ -2420,47 +2424,47 @@ function Ir({
|
|
|
2420
2424
|
}
|
|
2421
2425
|
),
|
|
2422
2426
|
staleTime: 1e4,
|
|
2423
|
-
refetchInterval: (l) =>
|
|
2427
|
+
refetchInterval: (l) => mn(l.state.data)
|
|
2424
2428
|
});
|
|
2425
|
-
|
|
2426
|
-
|
|
2429
|
+
pn(!!(u != null && u.running_move), () => {
|
|
2430
|
+
Ie(c, t, String(e)), je(c, t, String(e)), nt(c, t, String(e));
|
|
2427
2431
|
});
|
|
2428
|
-
const b =
|
|
2432
|
+
const b = Sn(
|
|
2429
2433
|
u ? (u.available_transitions ?? []).map((l) => String(l.id)) : null,
|
|
2430
2434
|
`${t}:${e}`
|
|
2431
|
-
), { data:
|
|
2435
|
+
), { data: M } = be({
|
|
2432
2436
|
queryKey: ["pipeline-all-owners", t, e],
|
|
2433
2437
|
queryFn: () => o.request(
|
|
2434
|
-
|
|
2438
|
+
we(`/pipelines/instance/${t}/${e}/owners/all`)
|
|
2435
2439
|
).then((l) => l.data ?? null),
|
|
2436
2440
|
// Also while a move is being confirmed: the panel names where it really lands.
|
|
2437
|
-
enabled:
|
|
2441
|
+
enabled: Rn(u) || !!p,
|
|
2438
2442
|
staleTime: 3e4
|
|
2439
|
-
}), ee =
|
|
2440
|
-
if (!
|
|
2443
|
+
}), ee = et(() => {
|
|
2444
|
+
if (!M) return null;
|
|
2441
2445
|
const l = /* @__PURE__ */ new Map();
|
|
2442
|
-
for (const [y, w] of Object.entries(
|
|
2446
|
+
for (const [y, w] of Object.entries(M))
|
|
2443
2447
|
w.skipped && l.set(y, w.skip_reasons ?? []);
|
|
2444
2448
|
return l;
|
|
2445
|
-
}, [
|
|
2449
|
+
}, [M]), W = Qe({
|
|
2446
2450
|
mutationFn: ({
|
|
2447
2451
|
transition_id: l,
|
|
2448
2452
|
comment: y,
|
|
2449
2453
|
reviewed: w,
|
|
2450
2454
|
lock_ack: P
|
|
2451
2455
|
}) => o.request(
|
|
2452
|
-
|
|
2456
|
+
Ge(`/pipelines/instance/${t}/${e}/transition`, {
|
|
2453
2457
|
transition_id: l,
|
|
2454
2458
|
comment: y,
|
|
2455
2459
|
...w ? { reviewed: !0 } : {},
|
|
2456
2460
|
...P ? { lock_ack: !0 } : {},
|
|
2457
|
-
...
|
|
2461
|
+
...hn(u == null ? void 0 : u.available_transitions, l)
|
|
2458
2462
|
})
|
|
2459
2463
|
),
|
|
2460
2464
|
onMutate: (l) => {
|
|
2461
2465
|
var y;
|
|
2462
2466
|
return {
|
|
2463
|
-
slow:
|
|
2467
|
+
slow: An(
|
|
2464
2468
|
(y = [...(u == null ? void 0 : u.available_transitions) ?? [], ...(u == null ? void 0 : u.all_transitions) ?? []].find(
|
|
2465
2469
|
(w) => w.id === l.transition_id
|
|
2466
2470
|
)) == null ? void 0 : y.label
|
|
@@ -2468,29 +2472,29 @@ function Ir({
|
|
|
2468
2472
|
};
|
|
2469
2473
|
},
|
|
2470
2474
|
onSuccess: (l, y, w) => {
|
|
2471
|
-
c.invalidateQueries({ queryKey: $ }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }),
|
|
2472
|
-
const P =
|
|
2475
|
+
c.invalidateQueries({ queryKey: $ }), t === "nivaro_addendums" && c.invalidateQueries({ queryKey: ["addendums"] }), Ie(c, t, String(e)), je(c, t, String(e)), nt(c, t, String(e)), U(null), h(""), x(null), R(null);
|
|
2476
|
+
const P = fn(l);
|
|
2473
2477
|
P ? V.info(
|
|
2474
2478
|
`${P.transition_label ?? "The move"} started. You will be told if it does not go through.`,
|
|
2475
2479
|
w == null ? void 0 : w.slow.done()
|
|
2476
|
-
) : V.success(
|
|
2480
|
+
) : V.success(Fn(u, y.transition_id, l), w == null ? void 0 : w.slow.done());
|
|
2477
2481
|
},
|
|
2478
2482
|
onError: (l, y, w) => {
|
|
2479
|
-
var
|
|
2480
|
-
if (w == null || w.slow.fail(),
|
|
2483
|
+
var G, S;
|
|
2484
|
+
if (w == null || w.slow.fail(), yn(l)) {
|
|
2481
2485
|
c.invalidateQueries({ queryKey: $ });
|
|
2482
2486
|
return;
|
|
2483
2487
|
}
|
|
2484
|
-
if (
|
|
2488
|
+
if (at(l) === "TRANSITION_RUNNING") {
|
|
2485
2489
|
c.invalidateQueries({ queryKey: $ }), x(null), R(null), V.info(Ae(l, "This move is already running on this record."));
|
|
2486
2490
|
return;
|
|
2487
2491
|
}
|
|
2488
|
-
const P =
|
|
2492
|
+
const P = kn(l);
|
|
2489
2493
|
if (P) {
|
|
2490
2494
|
x(null);
|
|
2491
|
-
const L = ((
|
|
2492
|
-
(
|
|
2493
|
-
)) == null ? void 0 :
|
|
2495
|
+
const L = ((G = [...(u == null ? void 0 : u.available_transitions) ?? [], ...(u == null ? void 0 : u.all_transitions) ?? []].find(
|
|
2496
|
+
(ve) => ve.id === y.transition_id
|
|
2497
|
+
)) == null ? void 0 : G.label) ?? "Move";
|
|
2494
2498
|
V.warning(P.message, {
|
|
2495
2499
|
id: `nvr-locked-move:${t}:${String(e)}`,
|
|
2496
2500
|
duration: 2e4,
|
|
@@ -2503,7 +2507,7 @@ function Ir({
|
|
|
2503
2507
|
});
|
|
2504
2508
|
return;
|
|
2505
2509
|
}
|
|
2506
|
-
const B =
|
|
2510
|
+
const B = wn(l);
|
|
2507
2511
|
if (B) {
|
|
2508
2512
|
R((L) => ({
|
|
2509
2513
|
payload: B,
|
|
@@ -2513,49 +2517,53 @@ function Ir({
|
|
|
2513
2517
|
}));
|
|
2514
2518
|
return;
|
|
2515
2519
|
}
|
|
2516
|
-
const
|
|
2517
|
-
U(
|
|
2518
|
-
const
|
|
2520
|
+
const oe = l == null ? void 0 : l.response;
|
|
2521
|
+
U(Nn(l, y));
|
|
2522
|
+
const q = an(
|
|
2519
2523
|
l,
|
|
2520
2524
|
(S = [...(u == null ? void 0 : u.available_transitions) ?? [], ...(u == null ? void 0 : u.all_transitions) ?? []].find(
|
|
2521
2525
|
(L) => L.id === y.transition_id
|
|
2522
2526
|
)) == null ? void 0 : S.label
|
|
2523
2527
|
);
|
|
2524
|
-
V.error((
|
|
2528
|
+
V.error((q == null ? void 0 : q.title) ?? Ae(l, "Failed to execute transition"), {
|
|
2525
2529
|
duration: 12e3,
|
|
2526
2530
|
// What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
|
|
2527
|
-
|
|
2528
|
-
|
|
2531
|
+
// A partner's refusal copies what the toast said and the other system's answer as
|
|
2532
|
+
// stored, never the generic reading of a 422.
|
|
2533
|
+
...rn(q ? sn(l, q) : l, {
|
|
2534
|
+
action: "Transition"
|
|
2535
|
+
}),
|
|
2536
|
+
...q ? { description: q.description } : {},
|
|
2529
2537
|
// #1867: a refusal carries "Why?" — the role, owner or access rule
|
|
2530
2538
|
// that stopped it, and who can change it.
|
|
2531
|
-
...
|
|
2532
|
-
action:
|
|
2539
|
+
...cn(l) ? {
|
|
2540
|
+
action: un(o, {
|
|
2533
2541
|
collection: t,
|
|
2534
2542
|
itemId: String(e),
|
|
2535
2543
|
action: "transition",
|
|
2536
2544
|
transitionId: y.transition_id
|
|
2537
2545
|
})
|
|
2538
2546
|
} : {}
|
|
2539
|
-
}), R(null), x(null),
|
|
2547
|
+
}), R(null), x(null), Ie(c, t, String(e)), je(c, t, String(e)), (oe == null ? void 0 : oe.status) === 409 && c.invalidateQueries({ queryKey: $ });
|
|
2540
2548
|
}
|
|
2541
|
-
}),
|
|
2542
|
-
|
|
2543
|
-
const xe =
|
|
2549
|
+
}), ue = ce(g);
|
|
2550
|
+
ue.current = g;
|
|
2551
|
+
const xe = ce((u == null ? void 0 : u.available_transitions) ?? []);
|
|
2544
2552
|
if (xe.current = (u == null ? void 0 : u.available_transitions) ?? [], _e(() => {
|
|
2545
2553
|
const l = (y) => {
|
|
2546
2554
|
const w = y.detail;
|
|
2547
2555
|
if (!w || w.claimed || w.collection !== t || String(w.item) !== String(e)) return;
|
|
2548
2556
|
w.claimed = !0;
|
|
2549
|
-
const P = String(w.transition_id).toUpperCase(), B = xe.current.find((
|
|
2557
|
+
const P = String(w.transition_id).toUpperCase(), B = xe.current.find((oe) => String(oe.id).toUpperCase() === P);
|
|
2550
2558
|
if (!B) {
|
|
2551
2559
|
V.error("That step is not available from where the record is now");
|
|
2552
2560
|
return;
|
|
2553
2561
|
}
|
|
2554
|
-
|
|
2562
|
+
ue.current(B.id);
|
|
2555
2563
|
};
|
|
2556
|
-
return window.addEventListener(
|
|
2564
|
+
return window.addEventListener(tt, l), () => window.removeEventListener(tt, l);
|
|
2557
2565
|
}, [t, e]), !(u != null && u.binding) || !(u != null && u.instance)) return null;
|
|
2558
|
-
const
|
|
2566
|
+
const de = Pn(
|
|
2559
2567
|
(u.available_transitions ?? []).filter(
|
|
2560
2568
|
(l) => !u.instance.completed_at || l.from_state && String(l.from_state).toUpperCase() === String(u.instance.current_state).toUpperCase()
|
|
2561
2569
|
),
|
|
@@ -2563,18 +2571,18 @@ function Ir({
|
|
|
2563
2571
|
u.instance.current_state,
|
|
2564
2572
|
u.instance.completed_at ? null : ee
|
|
2565
2573
|
);
|
|
2566
|
-
if (
|
|
2567
|
-
const
|
|
2568
|
-
for (const l of
|
|
2574
|
+
if (de.length === 0) return null;
|
|
2575
|
+
const D = new Map((u.states ?? []).map((l) => [l.id, l])), Y = u.instance.current_state_obj ?? null, z = p ? de.find((l) => l.id === p) : null, ie = j ? de.find((l) => l.id === j) : null, H = u.running_move ?? null, qe = H ? pr(H) : void 0, Oe = z ? D.get(z.to_state) : null, a = Bn(z, Y, u.states ?? [], M), I = (a == null ? void 0 : a.state) ?? Oe, Z = /* @__PURE__ */ new Map();
|
|
2576
|
+
for (const l of de) {
|
|
2569
2577
|
const y = Z.get(l.label) ?? [];
|
|
2570
2578
|
y.push(l), Z.set(l.label, y);
|
|
2571
2579
|
}
|
|
2572
2580
|
const J = (l) => [...l].sort(
|
|
2573
2581
|
(y, w) => {
|
|
2574
2582
|
var P, B;
|
|
2575
|
-
return (((P =
|
|
2583
|
+
return (((P = D.get(y.to_state)) == null ? void 0 : P.sort) ?? 999) - (((B = D.get(w.to_state)) == null ? void 0 : B.sort) ?? 999);
|
|
2576
2584
|
}
|
|
2577
|
-
),
|
|
2585
|
+
), he = (() => {
|
|
2578
2586
|
var w, P, B;
|
|
2579
2587
|
const l = (w = E.current) == null ? void 0 : w.getBoundingClientRect();
|
|
2580
2588
|
if (!l) return 600;
|
|
@@ -2582,31 +2590,31 @@ function Ir({
|
|
|
2582
2590
|
return Math.max(260, Math.min(600, l.right - ((y == null ? void 0 : y.left) ?? 0) - 12));
|
|
2583
2591
|
})();
|
|
2584
2592
|
return /* @__PURE__ */ i("div", { ref: E, className: "relative", "data-tip": qe, children: [
|
|
2585
|
-
K ? /* @__PURE__ */ i(
|
|
2586
|
-
/* @__PURE__ */ n(
|
|
2587
|
-
|
|
2593
|
+
K ? /* @__PURE__ */ i(mt, { children: [
|
|
2594
|
+
/* @__PURE__ */ n(pt, { asChild: !0, children: /* @__PURE__ */ i(
|
|
2595
|
+
pe,
|
|
2588
2596
|
{
|
|
2589
2597
|
size: "sm",
|
|
2590
2598
|
variant: "outline",
|
|
2591
2599
|
className: "shrink-0 gap-1.5 text-[12px]",
|
|
2592
|
-
disabled: W.isPending || T || !!
|
|
2600
|
+
disabled: W.isPending || T || !!H,
|
|
2593
2601
|
"data-transitions-folded": !0,
|
|
2594
2602
|
children: [
|
|
2595
|
-
W.isPending ||
|
|
2603
|
+
W.isPending || H ? /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }) : de.every((l) => l.advisory) && /* @__PURE__ */ n(Ne, {}),
|
|
2596
2604
|
"Actions",
|
|
2597
2605
|
/* @__PURE__ */ n(Fe, { className: "h-3 w-3" })
|
|
2598
2606
|
]
|
|
2599
2607
|
}
|
|
2600
2608
|
) }),
|
|
2601
|
-
/* @__PURE__ */ i(
|
|
2609
|
+
/* @__PURE__ */ i(ft, { align: "end", className: "min-w-[200px]", children: [
|
|
2602
2610
|
Array.from(Z.entries()).map(
|
|
2603
2611
|
([l, y], w, P) => y.length === 1 ? /* @__PURE__ */ i(It, { children: [
|
|
2604
|
-
w > 0 && P[w - 1][1].length > 1 && /* @__PURE__ */ n(
|
|
2612
|
+
w > 0 && P[w - 1][1].length > 1 && /* @__PURE__ */ n(ht, {}),
|
|
2605
2613
|
/* @__PURE__ */ i(
|
|
2606
|
-
|
|
2614
|
+
Je,
|
|
2607
2615
|
{
|
|
2608
2616
|
onSelect: () => g(y[0].id),
|
|
2609
|
-
...
|
|
2617
|
+
...Le(y[0], "menu"),
|
|
2610
2618
|
children: [
|
|
2611
2619
|
y[0].color && /* @__PURE__ */ n(
|
|
2612
2620
|
"span",
|
|
@@ -2621,15 +2629,15 @@ function Ir({
|
|
|
2621
2629
|
}
|
|
2622
2630
|
)
|
|
2623
2631
|
] }, l) : /* @__PURE__ */ i(It, { children: [
|
|
2624
|
-
w > 0 && /* @__PURE__ */ n(
|
|
2625
|
-
/* @__PURE__ */ n(
|
|
2632
|
+
w > 0 && /* @__PURE__ */ n(ht, {}),
|
|
2633
|
+
/* @__PURE__ */ n(ur, { className: "text-[11px] text-muted-foreground", children: l }),
|
|
2626
2634
|
J(y).map((B) => {
|
|
2627
|
-
var
|
|
2635
|
+
var oe;
|
|
2628
2636
|
return /* @__PURE__ */ i(
|
|
2629
|
-
|
|
2637
|
+
Je,
|
|
2630
2638
|
{
|
|
2631
2639
|
onSelect: () => g(B.id),
|
|
2632
|
-
...
|
|
2640
|
+
...Le(B, "menu"),
|
|
2633
2641
|
children: [
|
|
2634
2642
|
B.color && /* @__PURE__ */ n(
|
|
2635
2643
|
"span",
|
|
@@ -2638,7 +2646,7 @@ function Ir({
|
|
|
2638
2646
|
style: { backgroundColor: B.color }
|
|
2639
2647
|
}
|
|
2640
2648
|
),
|
|
2641
|
-
((
|
|
2649
|
+
((oe = D.get(B.to_state)) == null ? void 0 : oe.label) ?? B.to_state,
|
|
2642
2650
|
B.advisory && /* @__PURE__ */ n(Ne, { className: "ml-auto" })
|
|
2643
2651
|
]
|
|
2644
2652
|
},
|
|
@@ -2648,12 +2656,12 @@ function Ir({
|
|
|
2648
2656
|
] }, l)
|
|
2649
2657
|
),
|
|
2650
2658
|
/* @__PURE__ */ n(
|
|
2651
|
-
|
|
2659
|
+
kt,
|
|
2652
2660
|
{
|
|
2653
|
-
moves:
|
|
2661
|
+
moves: de,
|
|
2654
2662
|
nameOf: (l) => {
|
|
2655
2663
|
var y, w;
|
|
2656
|
-
return (((y = Z.get(l.label)) == null ? void 0 : y.length) ?? 0) > 1 ? ((w =
|
|
2664
|
+
return (((y = Z.get(l.label)) == null ? void 0 : y.length) ?? 0) > 1 ? ((w = D.get(l.to_state)) == null ? void 0 : w.label) ?? l.to_state : l.label;
|
|
2657
2665
|
}
|
|
2658
2666
|
}
|
|
2659
2667
|
)
|
|
@@ -2663,42 +2671,42 @@ function Ir({
|
|
|
2663
2671
|
{
|
|
2664
2672
|
className: s ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
|
|
2665
2673
|
children: Array.from(Z.entries()).map(([l, y]) => {
|
|
2666
|
-
var
|
|
2674
|
+
var q, G;
|
|
2667
2675
|
const w = y.some((S) => {
|
|
2668
2676
|
var L;
|
|
2669
2677
|
return (((L = S.order_partners) == null ? void 0 : L.length) ?? 0) > 0;
|
|
2670
|
-
}), P = w ? null : ((
|
|
2678
|
+
}), P = w ? null : ((q = y[0]) == null ? void 0 : q.color) ?? null, B = y.some((S) => S.id === p), oe = (S) => P ? S ? { backgroundColor: P, borderColor: P } : { borderColor: P, color: P } : void 0;
|
|
2671
2679
|
if (y.length === 1) {
|
|
2672
|
-
const S = y[0], L =
|
|
2673
|
-
|
|
2680
|
+
const S = y[0], L = vt(H == null ? void 0 : H.transition_id, S.id), ve = bn(H ? null : u.last_move_problem, S.id), Ce = W.isPending && ((G = W.variables) == null ? void 0 : G.transition_id) === S.id || L, se = /* @__PURE__ */ i(
|
|
2681
|
+
pe,
|
|
2674
2682
|
{
|
|
2675
2683
|
size: "sm",
|
|
2676
2684
|
variant: B && !S.advisory ? "default" : "outline",
|
|
2677
2685
|
className: ge(
|
|
2678
2686
|
"gap-1.5 text-[12px] data-[fresh=true]:opacity-60",
|
|
2679
|
-
S.advisory &&
|
|
2687
|
+
S.advisory && On
|
|
2680
2688
|
),
|
|
2681
|
-
style: S.advisory ? void 0 :
|
|
2682
|
-
disabled: W.isPending || T || !!
|
|
2689
|
+
style: S.advisory ? void 0 : oe(B),
|
|
2690
|
+
disabled: W.isPending || T || !!H || !!ve,
|
|
2683
2691
|
"data-move-running": L || void 0,
|
|
2684
2692
|
"aria-disabled": b.dimmed(S.id) || void 0,
|
|
2685
2693
|
"data-fresh": b.dimmed(S.id) || void 0,
|
|
2686
2694
|
...b.bind(S.id),
|
|
2687
|
-
...
|
|
2695
|
+
...Le(S),
|
|
2688
2696
|
onClick: () => {
|
|
2689
2697
|
b.press(S.id) && g(S.id);
|
|
2690
2698
|
},
|
|
2691
2699
|
children: [
|
|
2692
|
-
Ce ? /* @__PURE__ */ n(
|
|
2700
|
+
Ce ? /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin" }) : S.advisory ? /* @__PURE__ */ n(Ne, {}) : w && /* @__PURE__ */ n(Xt, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
2693
2701
|
l
|
|
2694
2702
|
]
|
|
2695
2703
|
},
|
|
2696
2704
|
l
|
|
2697
2705
|
);
|
|
2698
|
-
return S.pushes && S.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
|
|
2699
|
-
|
|
2706
|
+
return ve ? /* @__PURE__ */ n("span", { className: "inline-flex", "data-tip": ve, "data-move-held": !0, children: se }, l) : S.pushes && S.pushes > 0 ? /* @__PURE__ */ i("span", { className: "relative inline-flex", children: [
|
|
2707
|
+
se,
|
|
2700
2708
|
/* @__PURE__ */ n(
|
|
2701
|
-
|
|
2709
|
+
or,
|
|
2702
2710
|
{
|
|
2703
2711
|
collection: t,
|
|
2704
2712
|
itemId: e,
|
|
@@ -2707,17 +2715,17 @@ function Ir({
|
|
|
2707
2715
|
compact: !0
|
|
2708
2716
|
}
|
|
2709
2717
|
)
|
|
2710
|
-
] }, l) :
|
|
2718
|
+
] }, l) : se;
|
|
2711
2719
|
}
|
|
2712
|
-
return /* @__PURE__ */ i(
|
|
2713
|
-
/* @__PURE__ */ n(
|
|
2714
|
-
|
|
2720
|
+
return /* @__PURE__ */ i(mt, { children: [
|
|
2721
|
+
/* @__PURE__ */ n(pt, { asChild: !0, children: /* @__PURE__ */ i(
|
|
2722
|
+
pe,
|
|
2715
2723
|
{
|
|
2716
2724
|
size: "sm",
|
|
2717
2725
|
variant: B ? "default" : "outline",
|
|
2718
2726
|
className: "gap-1.5 text-[12px]",
|
|
2719
|
-
style:
|
|
2720
|
-
disabled: W.isPending || T || !!
|
|
2727
|
+
style: oe(B),
|
|
2728
|
+
disabled: W.isPending || T || !!H,
|
|
2721
2729
|
children: [
|
|
2722
2730
|
y.every((S) => S.advisory) && /* @__PURE__ */ n(Ne, {}),
|
|
2723
2731
|
l,
|
|
@@ -2725,14 +2733,14 @@ function Ir({
|
|
|
2725
2733
|
]
|
|
2726
2734
|
}
|
|
2727
2735
|
) }),
|
|
2728
|
-
/* @__PURE__ */ i(
|
|
2736
|
+
/* @__PURE__ */ i(ft, { align: "start", children: [
|
|
2729
2737
|
J(y).map((S) => {
|
|
2730
2738
|
var L;
|
|
2731
2739
|
return /* @__PURE__ */ i(
|
|
2732
|
-
|
|
2740
|
+
Je,
|
|
2733
2741
|
{
|
|
2734
2742
|
onSelect: () => g(S.id),
|
|
2735
|
-
...
|
|
2743
|
+
...Le(S, "menu"),
|
|
2736
2744
|
children: [
|
|
2737
2745
|
S.color && /* @__PURE__ */ n(
|
|
2738
2746
|
"span",
|
|
@@ -2741,7 +2749,7 @@ function Ir({
|
|
|
2741
2749
|
style: { backgroundColor: S.color }
|
|
2742
2750
|
}
|
|
2743
2751
|
),
|
|
2744
|
-
((L =
|
|
2752
|
+
((L = D.get(S.to_state)) == null ? void 0 : L.label) ?? S.to_state,
|
|
2745
2753
|
S.advisory && /* @__PURE__ */ n(Ne, { className: "ml-auto" })
|
|
2746
2754
|
]
|
|
2747
2755
|
},
|
|
@@ -2749,12 +2757,12 @@ function Ir({
|
|
|
2749
2757
|
);
|
|
2750
2758
|
}),
|
|
2751
2759
|
/* @__PURE__ */ n(
|
|
2752
|
-
|
|
2760
|
+
kt,
|
|
2753
2761
|
{
|
|
2754
2762
|
moves: y,
|
|
2755
2763
|
nameOf: (S) => {
|
|
2756
2764
|
var L;
|
|
2757
|
-
return ((L =
|
|
2765
|
+
return ((L = D.get(S.to_state)) == null ? void 0 : L.label) ?? S.to_state;
|
|
2758
2766
|
}
|
|
2759
2767
|
}
|
|
2760
2768
|
)
|
|
@@ -2767,21 +2775,21 @@ function Ir({
|
|
|
2767
2775
|
"div",
|
|
2768
2776
|
{
|
|
2769
2777
|
className: "absolute right-0 top-full z-50 mt-1 space-y-3 rounded-lg border border-slate-200 bg-white shadow-lg dark:bg-card dark:border-border p-3.5",
|
|
2770
|
-
style: { width:
|
|
2778
|
+
style: { width: he },
|
|
2771
2779
|
children: [
|
|
2772
2780
|
/* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2773
2781
|
/* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
|
|
2774
2782
|
z && /* @__PURE__ */ n("span", { className: "text-[12px] font-medium text-slate-700", children: z.label }),
|
|
2775
2783
|
Y && I && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
2776
2784
|
/* @__PURE__ */ n(Re, { label: Y.label, color: Y.color, small: !0 }),
|
|
2777
|
-
/* @__PURE__ */ n(
|
|
2785
|
+
/* @__PURE__ */ n(Nt, { className: "h-3 w-3 shrink-0 text-slate-300" }),
|
|
2778
2786
|
/* @__PURE__ */ n(Re, { label: I.label, color: I.color, small: !0 })
|
|
2779
2787
|
] })
|
|
2780
2788
|
] }),
|
|
2781
|
-
/* @__PURE__ */ n(
|
|
2782
|
-
/* @__PURE__ */ n(
|
|
2783
|
-
/* @__PURE__ */ n(
|
|
2784
|
-
/* @__PURE__ */ n(
|
|
2789
|
+
/* @__PURE__ */ n(Ln, { landing: a }),
|
|
2790
|
+
/* @__PURE__ */ n(Mn, { collection: t, item: String(e), tx: z }),
|
|
2791
|
+
/* @__PURE__ */ n(En, { collection: t, item: e, omitLines: re }),
|
|
2792
|
+
/* @__PURE__ */ n(qn, { lines: re }),
|
|
2785
2793
|
/* @__PURE__ */ n(
|
|
2786
2794
|
"input",
|
|
2787
2795
|
{
|
|
@@ -2794,7 +2802,7 @@ function Ir({
|
|
|
2794
2802
|
),
|
|
2795
2803
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-end gap-2", children: [
|
|
2796
2804
|
/* @__PURE__ */ n(
|
|
2797
|
-
|
|
2805
|
+
pe,
|
|
2798
2806
|
{
|
|
2799
2807
|
type: "button",
|
|
2800
2808
|
size: "sm",
|
|
@@ -2805,19 +2813,19 @@ function Ir({
|
|
|
2805
2813
|
}
|
|
2806
2814
|
),
|
|
2807
2815
|
/* @__PURE__ */ n(
|
|
2808
|
-
|
|
2816
|
+
pe,
|
|
2809
2817
|
{
|
|
2810
2818
|
type: "button",
|
|
2811
2819
|
size: "sm",
|
|
2812
2820
|
className: "h-7 gap-1.5 text-[12px]",
|
|
2813
|
-
disabled: W.isPending || !!
|
|
2821
|
+
disabled: W.isPending || !!H || String((z == null ? void 0 : z.comment_mode) ?? "") === "required" && m.trim() === "",
|
|
2814
2822
|
onClick: () => v({
|
|
2815
2823
|
transition_id: p,
|
|
2816
2824
|
comment: m.trim() || void 0
|
|
2817
2825
|
}),
|
|
2818
|
-
children: W.isPending ? /* @__PURE__ */ n(
|
|
2826
|
+
children: W.isPending ? /* @__PURE__ */ n(ye, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ i(Se, { children: [
|
|
2819
2827
|
/* @__PURE__ */ n("span", { children: re.length > 0 && z ? `${z.label} anyway` : "Confirm" }),
|
|
2820
|
-
/* @__PURE__ */ n(
|
|
2828
|
+
/* @__PURE__ */ n(rt, { className: "h-3 w-3" })
|
|
2821
2829
|
] })
|
|
2822
2830
|
}
|
|
2823
2831
|
)
|
|
@@ -2825,20 +2833,20 @@ function Ir({
|
|
|
2825
2833
|
]
|
|
2826
2834
|
}
|
|
2827
2835
|
),
|
|
2828
|
-
(
|
|
2829
|
-
|
|
2836
|
+
(ie == null ? void 0 : ie.advisory) && !p && /* @__PURE__ */ n(
|
|
2837
|
+
xn,
|
|
2830
2838
|
{
|
|
2831
2839
|
floating: !0,
|
|
2832
2840
|
collection: t,
|
|
2833
2841
|
item: String(e),
|
|
2834
|
-
advisory:
|
|
2842
|
+
advisory: ie.advisory,
|
|
2835
2843
|
armedMove: {
|
|
2836
|
-
id:
|
|
2837
|
-
label:
|
|
2838
|
-
confirms:
|
|
2844
|
+
id: ie.id,
|
|
2845
|
+
label: ie.label,
|
|
2846
|
+
confirms: Dn(ie, u.states ?? [], u.instance.current_state)
|
|
2839
2847
|
},
|
|
2840
2848
|
className: "absolute right-0 top-full z-50 mt-1",
|
|
2841
|
-
style: { width:
|
|
2849
|
+
style: { width: he },
|
|
2842
2850
|
onDismiss: () => ne(null),
|
|
2843
2851
|
onFixed: (l) => {
|
|
2844
2852
|
ne(null), c.invalidateQueries({ queryKey: $ }), l && g(l.id, { cleared: !0 });
|
|
@@ -2846,19 +2854,19 @@ function Ir({
|
|
|
2846
2854
|
}
|
|
2847
2855
|
),
|
|
2848
2856
|
_ && !p && /* @__PURE__ */ n(
|
|
2849
|
-
|
|
2857
|
+
Un,
|
|
2850
2858
|
{
|
|
2851
2859
|
collection: t,
|
|
2852
2860
|
item: String(e),
|
|
2853
2861
|
offer: _,
|
|
2854
2862
|
className: "absolute right-0 top-full z-50 mt-1 shadow-lg",
|
|
2855
|
-
style: { width:
|
|
2863
|
+
style: { width: he },
|
|
2856
2864
|
onDismiss: () => U(null),
|
|
2857
2865
|
onFixed: () => v({ transition_id: _.transitionId, comment: _.comment })
|
|
2858
2866
|
}
|
|
2859
2867
|
),
|
|
2860
2868
|
k && /* @__PURE__ */ n(en, { fallback: null, children: /* @__PURE__ */ n(
|
|
2861
|
-
|
|
2869
|
+
vn,
|
|
2862
2870
|
{
|
|
2863
2871
|
payload: k.payload,
|
|
2864
2872
|
transitionId: k.transitionId,
|
|
@@ -2881,26 +2889,26 @@ function Ir({
|
|
|
2881
2889
|
] });
|
|
2882
2890
|
}
|
|
2883
2891
|
export {
|
|
2884
|
-
|
|
2892
|
+
Be as FRESH_BUTTON_MS,
|
|
2885
2893
|
Kt as FRESH_HOVER_MAX_MS,
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2894
|
+
$r as FreshButtonGuard,
|
|
2895
|
+
Sa as PipelinePanel,
|
|
2896
|
+
Ca as PipelineTransitionButtons,
|
|
2897
|
+
vr as REFUSAL_FIX_ACTIONS,
|
|
2898
|
+
Pr as RecordFlagChips,
|
|
2899
|
+
Fr as SLOW_MOVE_MS,
|
|
2900
|
+
qt as asksFirst,
|
|
2901
|
+
qr as briefAgeText,
|
|
2902
|
+
Mr as briefDiffPair,
|
|
2895
2903
|
Wt as briefLineKey,
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2904
|
+
Tr as briefWarnings,
|
|
2905
|
+
yn as isDuplicateTransition,
|
|
2906
|
+
Ar as latestSendBack,
|
|
2907
|
+
kn as lockedMoveOffer,
|
|
2908
|
+
at as refusalCode,
|
|
2909
|
+
Nn as refusalFixFor,
|
|
2910
|
+
An as slowMoveToast,
|
|
2911
|
+
wn as transitionRequirementsFromError,
|
|
2912
|
+
Fn as transitionToastText,
|
|
2913
|
+
Pn as withoutSkippedSendBacks
|
|
2906
2914
|
};
|