@nivaro/react 0.3.40 → 0.3.42
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/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +645 -16
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/PickerExcludedRows.js +3 -3
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n, Fragment as de } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { ArrowRight as Fe, Loader2 as se, Check as Ce, GitBranch as Te, AlertTriangle as
|
|
4
|
-
import { useState as K, useRef as ne, useEffect as ue, useMemo as et, Suspense as dt, lazy as
|
|
2
|
+
import { useQueryClient as Le, useQuery as te, useMutation as xe } from "@tanstack/react-query";
|
|
3
|
+
import { ArrowRight as Fe, Loader2 as se, Check as Ce, GitBranch as Te, AlertTriangle as kt, ChevronDown as me, Users as it, Minus as _t, UserPlus as Ct, X as lt, Zap as ot, Search as St } from "lucide-react";
|
|
4
|
+
import { useState as K, useRef as ne, useEffect as ue, useMemo as et, Suspense as dt, lazy as $t } from "react";
|
|
5
5
|
import { toast as ee } from "sonner";
|
|
6
|
-
import { useNivaroClient as fe, useItemEditAuth as
|
|
7
|
-
import { get as ie, post as be, del as
|
|
8
|
-
import {
|
|
6
|
+
import { useNivaroClient as fe, useItemEditAuth as Tt } from "../../context.js";
|
|
7
|
+
import { get as ie, post as be, del as qt } from "../../lib/commands.js";
|
|
8
|
+
import { errorToastOptions as ct } from "../../lib/error-toast.js";
|
|
9
|
+
import { useRecordSignalWhile as mt, useRecordSignalPeers as Pt, signalSentence as At } from "../../lib/presence-signals.js";
|
|
9
10
|
import { RUN_TRANSITION_EVENT as Ne } from "../../lib/run-transition.js";
|
|
10
11
|
import { userErrorMessage as he } from "../../lib/safe-error.js";
|
|
11
|
-
import { serverNow as
|
|
12
|
-
import { userCardQuery as
|
|
13
|
-
import { cn as ge, formatRelative as
|
|
14
|
-
import { PushReadinessChip as
|
|
15
|
-
import { useHeaderFold as
|
|
12
|
+
import { serverNow as Rt } from "../../lib/server-clock.js";
|
|
13
|
+
import { userCardQuery as Dt } from "../../lib/user-cards.js";
|
|
14
|
+
import { cn as ge, formatRelative as ut, humanHours as jt } from "../../lib/utils.js";
|
|
15
|
+
import { PushReadinessChip as Bt } from "../integrations/RecordIntegrationPreview.js";
|
|
16
|
+
import { useHeaderFold as Mt } from "../item-edit/HeaderTools.js";
|
|
16
17
|
import { invalidateRecordInsights as ke, invalidateRecordData as _e } from "../item-edit/RecordInsights.js";
|
|
17
|
-
import { UserChip as
|
|
18
|
-
import { OwnerAvatars as
|
|
18
|
+
import { UserChip as pt } from "../item-edit/UserChip.js";
|
|
19
|
+
import { OwnerAvatars as Ot } from "../queue/OwnerAvatars.js";
|
|
19
20
|
import { UserAvatar as Lt } from "../UserAvatar.js";
|
|
20
21
|
import { Button as Y } from "../ui/button.js";
|
|
21
|
-
import { DropdownMenu as Pe, DropdownMenuTrigger as Ae, DropdownMenuContent as Re, DropdownMenuGroup as tt, DropdownMenuSeparator as nt, DropdownMenuItem as we, DropdownMenuLabel as
|
|
22
|
+
import { DropdownMenu as Pe, DropdownMenuTrigger as Ae, DropdownMenuContent as Re, DropdownMenuGroup as tt, DropdownMenuSeparator as nt, DropdownMenuItem as we, DropdownMenuLabel as Ft } from "../ui/dropdown-menu.js";
|
|
22
23
|
import { Popover as Ie, PopoverTrigger as Ee, PopoverContent as Ue } from "../ui/popover.js";
|
|
23
24
|
import { Skeleton as le } from "../ui/skeleton.js";
|
|
24
|
-
import { TooltipProvider as
|
|
25
|
-
import { isAccessRefusal as
|
|
26
|
-
import { BranchLanes as
|
|
27
|
-
import { SlaClockLine as
|
|
28
|
-
const
|
|
25
|
+
import { TooltipProvider as ft, Tooltip as De, TooltipTrigger as je, TooltipContent as Be } from "../ui/tooltip.js";
|
|
26
|
+
import { isAccessRefusal as ht, deniedToastAction as xt, WhyOwnersButton as It } from "./AccessInsights.js";
|
|
27
|
+
import { BranchLanes as Et } from "./BranchLanes.js";
|
|
28
|
+
import { SlaClockLine as Ut } from "./SlaClock.js";
|
|
29
|
+
const bt = $t(
|
|
29
30
|
() => import("./TransitionRequirementsDialog.js").then((r) => ({
|
|
30
31
|
default: r.TransitionRequirementsDialog
|
|
31
32
|
}))
|
|
32
33
|
);
|
|
33
|
-
function
|
|
34
|
+
function gt(r, t) {
|
|
34
35
|
const u = r || "System";
|
|
35
36
|
return t.on_behalf_of_name ? `${u}, for ${t.on_behalf_of_name}` : u;
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function Qt(r) {
|
|
38
39
|
if (r.transition) return null;
|
|
39
40
|
const t = (r.comment ?? "").trim();
|
|
40
41
|
if (!t.startsWith("{")) return null;
|
|
@@ -55,7 +56,7 @@ function Me(r) {
|
|
|
55
56
|
const t = (r.comment ?? "").trim().toLowerCase();
|
|
56
57
|
return r.origin === "import" || t.startsWith("import:") ? "Imported" : r.origin === "integration" ? "By an integration" : /-state-sync$/.test(t) || t.startsWith("legacy-") ? "Synced from another system" : t === "state-merge" || t === "instance-migration" ? "Moved by an admin script" : "Moved automatically";
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
+
function Oe(r) {
|
|
59
60
|
if (r.transition_text) return r.transition_text;
|
|
60
61
|
if (r.transition_label) return `Rule: ${r.transition_label}`;
|
|
61
62
|
const t = (r.comment ?? "").trim(), u = /^auto: (.+)$/i.exec(t);
|
|
@@ -69,11 +70,11 @@ const rt = {
|
|
|
69
70
|
rate_limited: "the partner asked us to slow down",
|
|
70
71
|
unknown: "the partner refused it"
|
|
71
72
|
};
|
|
72
|
-
function
|
|
73
|
-
const t = Math.ceil((new Date(r).getTime() -
|
|
73
|
+
function zt(r) {
|
|
74
|
+
const t = Math.ceil((new Date(r).getTime() - Rt()) / 6e4);
|
|
74
75
|
return !Number.isFinite(t) || t <= 0 ? "on the next check" : t < 60 ? `in ${t} min` : `in ${Math.round(t / 60)}h`;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function Kt({ held: r }) {
|
|
77
78
|
return r.length === 0 ? null : /* @__PURE__ */ e(
|
|
78
79
|
"div",
|
|
79
80
|
{
|
|
@@ -98,7 +99,7 @@ function zt({ held: r }) {
|
|
|
98
99
|
}
|
|
99
100
|
),
|
|
100
101
|
/* @__PURE__ */ n("p", { className: "mt-1 text-[11px] text-amber-700 dark:text-amber-400", children: [
|
|
101
|
-
t.retry_at ? `It tries the same push again ${
|
|
102
|
+
t.retry_at ? `It tries the same push again ${zt(t.retry_at)}. ` : "It will not send the same push again on its own. ",
|
|
102
103
|
"Fix the record so what it sends changes, retry the push, or move the record by hand.",
|
|
103
104
|
t.attempts > 1 ? ` ${t.attempts} attempts so far.` : ""
|
|
104
105
|
] })
|
|
@@ -107,12 +108,12 @@ function zt({ held: r }) {
|
|
|
107
108
|
}
|
|
108
109
|
);
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function yt(r) {
|
|
111
112
|
var u;
|
|
112
113
|
const t = r == null ? void 0 : r.response;
|
|
113
114
|
return ((t == null ? void 0 : t.code) ?? ((u = t == null ? void 0 : t.data) == null ? void 0 : u.code)) === "TRANSITION_DUPLICATE";
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function wt(r) {
|
|
116
117
|
var u;
|
|
117
118
|
const t = r;
|
|
118
119
|
return (t == null ? void 0 : t.status) === 422 && ((u = t.response) == null ? void 0 : u.error) === "TRANSITION_REQUIREMENTS" ? t.response.requirements ?? [] : null;
|
|
@@ -138,9 +139,9 @@ function oe({
|
|
|
138
139
|
}
|
|
139
140
|
function qe(r) {
|
|
140
141
|
const t = Math.floor(r / 6e4);
|
|
141
|
-
return t < 60 ? `${Math.max(1, t)}m` :
|
|
142
|
+
return t < 60 ? `${Math.max(1, t)}m` : jt(r / 36e5);
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function Wt({
|
|
144
145
|
history: r,
|
|
145
146
|
completedAt: t
|
|
146
147
|
}) {
|
|
@@ -200,7 +201,7 @@ function Kt({
|
|
|
200
201
|
}) })
|
|
201
202
|
] });
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
+
function Ht({
|
|
204
205
|
states: r,
|
|
205
206
|
allTransitions: t,
|
|
206
207
|
availableTransitions: u,
|
|
@@ -225,46 +226,46 @@ function Wt({
|
|
|
225
226
|
x && x !== i && P.add(x);
|
|
226
227
|
const R = (() => {
|
|
227
228
|
if (p)
|
|
228
|
-
return r.filter((
|
|
229
|
-
const y =
|
|
230
|
-
return y === "hide" ? !1 : y === "hide_unless_active" ? P.has(
|
|
231
|
-
}).sort((
|
|
229
|
+
return r.filter((m) => p.has(m.id) || P.has(m.id) || m.id === i).filter((m) => {
|
|
230
|
+
const y = m.stage_visibility ?? "always";
|
|
231
|
+
return y === "hide" ? !1 : y === "hide_unless_active" ? P.has(m.id) || m.id === i : !0;
|
|
232
|
+
}).sort((m, y) => m.sort - y.sort);
|
|
232
233
|
if (t.length === 0) {
|
|
233
|
-
const
|
|
234
|
-
return i &&
|
|
234
|
+
const m = /* @__PURE__ */ new Set([...P]);
|
|
235
|
+
return i && m.add(i), r.filter((y) => m.has(y.id)).sort((y, d) => y.sort - d.sort);
|
|
235
236
|
}
|
|
236
237
|
const l = new Set(
|
|
237
|
-
q.filter((
|
|
238
|
-
), w = new Set(q.map((
|
|
239
|
-
for (const
|
|
240
|
-
const y =
|
|
241
|
-
if (w.has(y) && !l.has(`${y}:${
|
|
238
|
+
q.filter((m) => m.from_state).map((m) => `${m.from_state}:${m.to_state}`)
|
|
239
|
+
), w = new Set(q.map((m) => m.from_state).filter(Boolean)), s = t.filter((m) => m.from_state !== null), v = /* @__PURE__ */ new Map();
|
|
240
|
+
for (const m of s) {
|
|
241
|
+
const y = m.from_state;
|
|
242
|
+
if (w.has(y) && !l.has(`${y}:${m.to_state}`)) continue;
|
|
242
243
|
const d = v.get(y) ?? [];
|
|
243
|
-
d.push(
|
|
244
|
+
d.push(m.to_state), v.set(y, d);
|
|
244
245
|
}
|
|
245
246
|
if (i) {
|
|
246
|
-
const
|
|
247
|
+
const m = s.filter((y) => y.from_state === i).map((y) => y.to_state);
|
|
247
248
|
v.set(i, [
|
|
248
|
-
.../* @__PURE__ */ new Set([...u.map((y) => y.to_state), ...
|
|
249
|
+
.../* @__PURE__ */ new Set([...u.map((y) => y.to_state), ...m])
|
|
249
250
|
]);
|
|
250
251
|
}
|
|
251
|
-
const k = /* @__PURE__ */ new Set(), A = r.filter((
|
|
252
|
+
const k = /* @__PURE__ */ new Set(), A = r.filter((m) => m.is_initial).map((m) => m.id);
|
|
252
253
|
for (; A.length; ) {
|
|
253
|
-
const
|
|
254
|
-
if (!k.has(
|
|
255
|
-
k.add(
|
|
256
|
-
for (const y of v.get(
|
|
254
|
+
const m = A.shift();
|
|
255
|
+
if (!k.has(m)) {
|
|
256
|
+
k.add(m);
|
|
257
|
+
for (const y of v.get(m) ?? []) k.has(y) || A.push(y);
|
|
257
258
|
}
|
|
258
259
|
}
|
|
259
260
|
const W = /* @__PURE__ */ new Set([...k, ...P]);
|
|
260
|
-
return i && W.add(i), r.filter((
|
|
261
|
-
const y =
|
|
262
|
-
return y === "hide" ? !1 : y === "hide_unless_active" ? P.has(
|
|
263
|
-
}).sort((
|
|
261
|
+
return i && W.add(i), r.filter((m) => W.has(m.id)).filter((m) => {
|
|
262
|
+
const y = m.stage_visibility ?? "always";
|
|
263
|
+
return y === "hide" ? !1 : y === "hide_unless_active" ? P.has(m.id) || m.id === i : !0;
|
|
264
|
+
}).sort((m, y) => m.sort - y.sort);
|
|
264
265
|
})();
|
|
265
266
|
if (R.length < 2) return null;
|
|
266
267
|
const C = new Map(R.map((l, w) => [l.id, w])), E = new Map(r.map((l) => [l.id, l.label]));
|
|
267
|
-
function
|
|
268
|
+
function O(l, w) {
|
|
268
269
|
const s = C.get(l);
|
|
269
270
|
return s == null ? [] : [...q].filter((v) => {
|
|
270
271
|
if (!v.from_state) return !1;
|
|
@@ -277,7 +278,7 @@ function Wt({
|
|
|
277
278
|
return ve(l) ? /* @__PURE__ */ e(ot, { className: "inline h-2.5 w-2.5", "aria-label": Me(l) }) : ((((w = l.first_name) == null ? void 0 : w[0]) ?? "") + (((s = l.last_name) == null ? void 0 : s[0]) ?? "")).toUpperCase() || ((k = (v = l.user_email) == null ? void 0 : v[0]) == null ? void 0 : k.toUpperCase()) || "?";
|
|
278
279
|
}
|
|
279
280
|
function B(l) {
|
|
280
|
-
return
|
|
281
|
+
return gt([l.first_name, l.last_name].filter(Boolean).join(" ") || l.user_email, l);
|
|
281
282
|
}
|
|
282
283
|
const U = /* @__PURE__ */ new Map();
|
|
283
284
|
for (const l of [...q].sort(
|
|
@@ -295,8 +296,8 @@ function Wt({
|
|
|
295
296
|
const w = E.get(l.from_state ?? "") ?? "the previous step", s = E.get(l.to_state) ?? "the next step", v = ve(l) ? "it moved automatically" : `${B(l)} moved it`;
|
|
296
297
|
return `Passed over on ${new Date(l.timestamp).toLocaleString()} — ${v} straight from ${w} to ${s}`;
|
|
297
298
|
}
|
|
298
|
-
return /* @__PURE__ */ e(
|
|
299
|
-
const s = l.id === i, v = P.has(l.id), k = v && !s, A = !v && !s ? U.get(l.id) : void 0, W = !v && !s ? f == null ? void 0 : f.get(l.id) : void 0,
|
|
299
|
+
return /* @__PURE__ */ e(ft, { delayDuration: 200, children: /* @__PURE__ */ e("div", { ref: N, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ e("div", { className: "flex w-full items-start", children: R.map((l, w) => {
|
|
300
|
+
const s = l.id === i, v = P.has(l.id), k = v && !s, A = !v && !s ? U.get(l.id) : void 0, W = !v && !s ? f == null ? void 0 : f.get(l.id) : void 0, m = A || W ? [...A ? [b(A)] : [], ...W ?? []] : void 0, y = m !== void 0, d = l.color ?? "#94a3b8", c = w === R.length - 1, g = c ? null : R[w + 1], _ = g ? O(l.id, g.id) : [];
|
|
300
301
|
return /* @__PURE__ */ n("div", { className: "flex flex-1 items-start", children: [
|
|
301
302
|
/* @__PURE__ */ n("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
|
|
302
303
|
/* @__PURE__ */ e(
|
|
@@ -310,7 +311,7 @@ function Wt({
|
|
|
310
311
|
border: s || k ? "none" : y ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
|
|
311
312
|
boxShadow: s ? `0 0 0 3px white, 0 0 0 5px ${d}` : void 0
|
|
312
313
|
},
|
|
313
|
-
children: k ? /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : s ? /* @__PURE__ */ e("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : y ? /* @__PURE__ */ e(
|
|
314
|
+
children: k ? /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : s ? /* @__PURE__ */ e("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : y ? /* @__PURE__ */ e(_t, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ e("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
|
|
314
315
|
},
|
|
315
316
|
s ? "cur" : k ? "done" : y ? "skip" : "todo"
|
|
316
317
|
),
|
|
@@ -332,7 +333,7 @@ function Wt({
|
|
|
332
333
|
) }),
|
|
333
334
|
/* @__PURE__ */ n(Be, { className: "max-w-[260px]", children: [
|
|
334
335
|
/* @__PURE__ */ e("p", { className: "text-[11px] font-medium", children: "Skipped for this record" }),
|
|
335
|
-
|
|
336
|
+
m.length > 0 ? /* @__PURE__ */ e("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: m.map((h) => /* @__PURE__ */ e("li", { children: h }, h)) }) : /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
|
|
336
337
|
] })
|
|
337
338
|
] }) : /* @__PURE__ */ e(
|
|
338
339
|
"span",
|
|
@@ -348,7 +349,7 @@ function Wt({
|
|
|
348
349
|
}
|
|
349
350
|
)
|
|
350
351
|
] }),
|
|
351
|
-
!
|
|
352
|
+
!c && /* @__PURE__ */ n("div", { className: "mt-[13px] flex w-10 shrink-0 flex-col items-center gap-1.5", children: [
|
|
352
353
|
(() => {
|
|
353
354
|
const h = k ? `${d}55` : "#e8ecf0";
|
|
354
355
|
return /* @__PURE__ */ n("div", { className: "flex w-full shrink-0 items-center", children: [
|
|
@@ -390,7 +391,7 @@ function Wt({
|
|
|
390
391
|
]
|
|
391
392
|
}
|
|
392
393
|
),
|
|
393
|
-
/* @__PURE__ */ e("span", { className: "text-[8.5px] leading-none text-slate-400", children:
|
|
394
|
+
/* @__PURE__ */ e("span", { className: "text-[8.5px] leading-none text-slate-400", children: ut(h.timestamp) })
|
|
394
395
|
] }) }),
|
|
395
396
|
/* @__PURE__ */ n(Be, { side: "top", className: "space-y-0.5 text-[12px]", children: [
|
|
396
397
|
ve(h) ? /* @__PURE__ */ n(de, { children: [
|
|
@@ -398,7 +399,7 @@ function Wt({
|
|
|
398
399
|
$ ? "↩ Sent back · " : "",
|
|
399
400
|
Me(h)
|
|
400
401
|
] }),
|
|
401
|
-
|
|
402
|
+
Oe(h) && /* @__PURE__ */ e("p", { className: "max-w-[280px] text-muted-foreground", children: Oe(h) })
|
|
402
403
|
] }) : /* @__PURE__ */ n("p", { className: "font-medium", children: [
|
|
403
404
|
$ ? "↩ Sent back by" : "Approved by",
|
|
404
405
|
" ",
|
|
@@ -416,9 +417,9 @@ function Wt({
|
|
|
416
417
|
] }, l.id);
|
|
417
418
|
}) }) }) });
|
|
418
419
|
}
|
|
419
|
-
function
|
|
420
|
+
function Vt({ history: r }) {
|
|
420
421
|
return r.length === 0 ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: r.map((t) => {
|
|
421
|
-
const u = ve(t), i = u ? Me(t) :
|
|
422
|
+
const u = ve(t), i = u ? Me(t) : gt([t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email, t), q = Qt(t), p = t.comment && !u && !q ? t.comment : null, f = q ?? (u ? Oe(t) : null);
|
|
422
423
|
return /* @__PURE__ */ n("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
|
|
423
424
|
/* @__PURE__ */ e("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
|
|
424
425
|
/* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -442,7 +443,7 @@ function Ht({ history: r }) {
|
|
|
442
443
|
i,
|
|
443
444
|
f ? ` · ${f}` : "",
|
|
444
445
|
" · ",
|
|
445
|
-
|
|
446
|
+
ut(t.timestamp)
|
|
446
447
|
]
|
|
447
448
|
}
|
|
448
449
|
)
|
|
@@ -450,7 +451,7 @@ function Ht({ history: r }) {
|
|
|
450
451
|
] }, t.id);
|
|
451
452
|
}) });
|
|
452
453
|
}
|
|
453
|
-
function
|
|
454
|
+
function Gt({ value: r, onChange: t }) {
|
|
454
455
|
const u = fe(), [i, q] = K(!1), [p, f] = K(""), [N, P] = K(""), j = ne(null), x = ne(null);
|
|
455
456
|
ue(() => {
|
|
456
457
|
i ? setTimeout(() => {
|
|
@@ -472,10 +473,10 @@ function Vt({ value: r, onChange: t }) {
|
|
|
472
473
|
enabled: i,
|
|
473
474
|
staleTime: 3e4
|
|
474
475
|
}), { data: E } = te({
|
|
475
|
-
...
|
|
476
|
+
...Dt(u, r),
|
|
476
477
|
enabled: !!r,
|
|
477
478
|
staleTime: 5 * 6e4
|
|
478
|
-
}),
|
|
479
|
+
}), O = R ?? [], M = E ?? O.find((b) => b.id === r) ?? null, B = M ? [M.first_name, M.last_name].filter(Boolean).join(" ").trim() || M.email : r ? "Selected person" : null, U = (b) => [b.first_name, b.last_name].filter(Boolean).join(" ").trim();
|
|
479
480
|
return /* @__PURE__ */ n(Ie, { open: i, onOpenChange: q, children: [
|
|
480
481
|
/* @__PURE__ */ n("div", { className: "relative flex h-8 w-full", children: [
|
|
481
482
|
/* @__PURE__ */ e(Ee, { asChild: !0, children: /* @__PURE__ */ n(
|
|
@@ -503,7 +504,7 @@ function Vt({ value: r, onChange: t }) {
|
|
|
503
504
|
] }),
|
|
504
505
|
/* @__PURE__ */ n(Ue, { align: "start", className: "w-72 p-0", sideOffset: 4, children: [
|
|
505
506
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-100 px-2 py-1.5", children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
506
|
-
/* @__PURE__ */ e(
|
|
507
|
+
/* @__PURE__ */ e(St, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
507
508
|
/* @__PURE__ */ e(
|
|
508
509
|
"input",
|
|
509
510
|
{
|
|
@@ -518,7 +519,7 @@ function Vt({ value: r, onChange: t }) {
|
|
|
518
519
|
/* @__PURE__ */ e("div", { className: "max-h-56 overflow-y-auto py-1", children: C ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
|
|
519
520
|
/* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
520
521
|
"Loading…"
|
|
521
|
-
] }) :
|
|
522
|
+
] }) : O.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : O.map((b) => {
|
|
522
523
|
const S = U(b), l = S ? `${S} (${b.email})` : b.email, w = b.id === r;
|
|
523
524
|
return /* @__PURE__ */ n(
|
|
524
525
|
"button",
|
|
@@ -550,7 +551,7 @@ function at({
|
|
|
550
551
|
email: u,
|
|
551
552
|
initials: i
|
|
552
553
|
}) {
|
|
553
|
-
return /* @__PURE__ */ e(
|
|
554
|
+
return /* @__PURE__ */ e(pt, { userId: r, children: /* @__PURE__ */ n(
|
|
554
555
|
"button",
|
|
555
556
|
{
|
|
556
557
|
type: "button",
|
|
@@ -574,15 +575,15 @@ function at({
|
|
|
574
575
|
}
|
|
575
576
|
) });
|
|
576
577
|
}
|
|
577
|
-
function
|
|
578
|
+
function Xt({
|
|
578
579
|
collection: r,
|
|
579
580
|
item: t,
|
|
580
581
|
states: u,
|
|
581
582
|
currentStateId: i,
|
|
582
583
|
returned: q = !1
|
|
583
584
|
}) {
|
|
584
|
-
var
|
|
585
|
-
const p = fe(), f =
|
|
585
|
+
var L, re, F;
|
|
586
|
+
const p = fe(), f = Le(), { isAdmin: N } = Tt(), [P, j] = K(!1), [x, R] = K(""), [C, E] = K(""), [O, M] = K(!1), B = ["pipeline-instance-owners", r, t], U = ["pipeline-owners-can-add", r, t], b = () => p.request(
|
|
586
587
|
ie(`/pipelines/instance/${r}/${t}/owners`)
|
|
587
588
|
).then((a) => {
|
|
588
589
|
var D;
|
|
@@ -605,14 +606,14 @@ function Gt({
|
|
|
605
606
|
).then((a) => a.data ?? null),
|
|
606
607
|
enabled: !!i,
|
|
607
608
|
staleTime: 3e4
|
|
608
|
-
}), A = new Set((S ?? []).map((a) => a.user)), W = i ? (((
|
|
609
|
+
}), A = new Set((S ?? []).map((a) => a.user)), W = i ? (((L = v == null ? void 0 : v[i]) == null ? void 0 : L.owners) ?? []).filter((a) => !A.has(a.id)) : [], m = W.length + ((S == null ? void 0 : S.length) ?? 0), y = !!((re = u.find((a) => a.id === i)) != null && re.is_initial), d = !l && !k, { data: c } = te({
|
|
609
610
|
queryKey: ["pipeline-record-creator", r, t],
|
|
610
611
|
queryFn: () => p.request(
|
|
611
612
|
ie(`/pipelines/instance/${r}/${t}/creator`)
|
|
612
613
|
).then((a) => a.data ?? null),
|
|
613
|
-
enabled: y && d &&
|
|
614
|
+
enabled: y && d && m === 0,
|
|
614
615
|
staleTime: 6e4
|
|
615
|
-
}), g = y &&
|
|
616
|
+
}), g = y && m === 0 && (c != null && c.name) ? c : null, _ = () => {
|
|
616
617
|
f.invalidateQueries({ queryKey: B }), f.invalidateQueries({ queryKey: ["pipeline-instance", r, t] });
|
|
617
618
|
}, h = xe({
|
|
618
619
|
mutationFn: () => p.request(
|
|
@@ -627,7 +628,7 @@ function Gt({
|
|
|
627
628
|
// The server's reason (a 403 says why), not a bare status phrase.
|
|
628
629
|
onError: (a) => ee.error(he(a, "Failed to add owner"))
|
|
629
630
|
}), $ = xe({
|
|
630
|
-
mutationFn: (a) => p.request(
|
|
631
|
+
mutationFn: (a) => p.request(qt(`/pipelines/instance-owners/${a.id}`)),
|
|
631
632
|
onSuccess: (a, D) => {
|
|
632
633
|
_();
|
|
633
634
|
const H = [D.first_name, D.last_name].filter(Boolean).join(" ") || D.email;
|
|
@@ -659,12 +660,12 @@ function Gt({
|
|
|
659
660
|
"Owners",
|
|
660
661
|
l || k ? /* @__PURE__ */ e("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : g ? null : /* @__PURE__ */ n("span", { className: "text-slate-300", children: [
|
|
661
662
|
"(",
|
|
662
|
-
|
|
663
|
+
m,
|
|
663
664
|
")"
|
|
664
665
|
] })
|
|
665
666
|
] }),
|
|
666
667
|
/* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
|
|
667
|
-
i && /* @__PURE__ */ e(
|
|
668
|
+
i && /* @__PURE__ */ e(It, { collection: r, itemId: String(t) }),
|
|
668
669
|
!P && s && /* @__PURE__ */ n(
|
|
669
670
|
"button",
|
|
670
671
|
{
|
|
@@ -672,7 +673,7 @@ function Gt({
|
|
|
672
673
|
onClick: () => j(!0),
|
|
673
674
|
className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
|
|
674
675
|
children: [
|
|
675
|
-
/* @__PURE__ */ e(
|
|
676
|
+
/* @__PURE__ */ e(Ct, { className: "h-3 w-3" }),
|
|
676
677
|
"Add"
|
|
677
678
|
]
|
|
678
679
|
}
|
|
@@ -685,7 +686,7 @@ function Gt({
|
|
|
685
686
|
] }) : g ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
686
687
|
q ? "Back with" : "With",
|
|
687
688
|
" ",
|
|
688
|
-
/* @__PURE__ */ e(
|
|
689
|
+
/* @__PURE__ */ e(pt, { userId: g.id, children: /* @__PURE__ */ e(
|
|
689
690
|
"button",
|
|
690
691
|
{
|
|
691
692
|
type: "button",
|
|
@@ -694,7 +695,7 @@ function Gt({
|
|
|
694
695
|
children: g.name
|
|
695
696
|
}
|
|
696
697
|
) })
|
|
697
|
-
] }) :
|
|
698
|
+
] }) : m === 0 ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No owners assigned." }) : /* @__PURE__ */ n("div", { className: "space-y-px", children: [
|
|
698
699
|
W.map((a) => {
|
|
699
700
|
var V, Z;
|
|
700
701
|
const D = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, H = (`${((V = a.first_name) == null ? void 0 : V[0]) ?? ""}${((Z = a.last_name) == null ? void 0 : Z[0]) ?? ""}`.trim() || a.email[0] || "?").toUpperCase();
|
|
@@ -751,8 +752,8 @@ function Gt({
|
|
|
751
752
|
] }),
|
|
752
753
|
P && /* @__PURE__ */ n("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: [
|
|
753
754
|
/* @__PURE__ */ e("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
|
|
754
|
-
/* @__PURE__ */ e(
|
|
755
|
-
N ? /* @__PURE__ */ n(Ie, { open:
|
|
755
|
+
/* @__PURE__ */ e(Gt, { value: x, onChange: R }),
|
|
756
|
+
N ? /* @__PURE__ */ n(Ie, { open: O, onOpenChange: M, children: [
|
|
756
757
|
/* @__PURE__ */ e(Ee, { asChild: !0, children: /* @__PURE__ */ n(
|
|
757
758
|
"button",
|
|
758
759
|
{
|
|
@@ -818,7 +819,7 @@ const st = {
|
|
|
818
819
|
suspended: "suspended",
|
|
819
820
|
redacted: "redacted"
|
|
820
821
|
};
|
|
821
|
-
function
|
|
822
|
+
function Jt({
|
|
822
823
|
collection: r,
|
|
823
824
|
item: t,
|
|
824
825
|
states: u,
|
|
@@ -856,7 +857,7 @@ function Xt({
|
|
|
856
857
|
const R = (((U = N[x.id]) == null ? void 0 : U.owners) ?? []).map((s) => ({
|
|
857
858
|
id: s.id,
|
|
858
859
|
name: [s.first_name, s.last_name].filter(Boolean).join(" ") || s.email
|
|
859
|
-
})), C = x.id === i, E = ((b = N[x.id]) == null ? void 0 : b.skipped) === !0 && !C,
|
|
860
|
+
})), C = x.id === i, E = ((b = N[x.id]) == null ? void 0 : b.skipped) === !0 && !C, O = (((S = N[x.id]) == null ? void 0 : S.skip_reasons) ?? []).filter(Boolean), M = ((l = N[x.id]) == null ? void 0 : l.unavailable) ?? [], B = ((w = N[x.id]) == null ? void 0 : w.blocked) === !0 && !E;
|
|
860
861
|
return /* @__PURE__ */ n(
|
|
861
862
|
"div",
|
|
862
863
|
{
|
|
@@ -877,10 +878,10 @@ function Xt({
|
|
|
877
878
|
// Radix tooltip with zero delay — native `title` waits on
|
|
878
879
|
// the OS hover timer, and a truncated reason needs its
|
|
879
880
|
// full text the moment the cursor lands on it.
|
|
880
|
-
/* @__PURE__ */ e(
|
|
881
|
+
/* @__PURE__ */ e(ft, { delayDuration: 0, children: /* @__PURE__ */ n(De, { children: [
|
|
881
882
|
/* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
|
|
882
883
|
/* @__PURE__ */ e("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" }),
|
|
883
|
-
|
|
884
|
+
O.length > 0 && /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: O.join(" · ") })
|
|
884
885
|
] }) }),
|
|
885
886
|
/* @__PURE__ */ n(
|
|
886
887
|
Be,
|
|
@@ -890,13 +891,13 @@ function Xt({
|
|
|
890
891
|
className: "max-w-[420px] space-y-0.5 text-[11.5px] leading-snug",
|
|
891
892
|
children: [
|
|
892
893
|
/* @__PURE__ */ e("p", { className: "text-slate-500 dark:text-slate-400", children: "The pipeline will pass through this state without stopping:" }),
|
|
893
|
-
|
|
894
|
+
O.length > 0 ? O.map((s) => /* @__PURE__ */ e("p", { children: s }, s)) : /* @__PURE__ */ e("p", { children: "Skip criteria currently match" })
|
|
894
895
|
]
|
|
895
896
|
}
|
|
896
897
|
)
|
|
897
898
|
] }) })
|
|
898
899
|
) : /* @__PURE__ */ n(de, { children: [
|
|
899
|
-
/* @__PURE__ */ e(
|
|
900
|
+
/* @__PURE__ */ e(Ot, { owners: R, max: 10, emptyLabel: "—" }),
|
|
900
901
|
M.map((s) => /* @__PURE__ */ n(
|
|
901
902
|
"span",
|
|
902
903
|
{
|
|
@@ -940,7 +941,7 @@ function Xt({
|
|
|
940
941
|
] })
|
|
941
942
|
] });
|
|
942
943
|
}
|
|
943
|
-
function
|
|
944
|
+
function qn({
|
|
944
945
|
collection: r,
|
|
945
946
|
item: t,
|
|
946
947
|
defaultExpanded: u,
|
|
@@ -954,7 +955,7 @@ function $n({
|
|
|
954
955
|
asRole: x
|
|
955
956
|
}) {
|
|
956
957
|
return t === "new" ? null : /* @__PURE__ */ e(
|
|
957
|
-
|
|
958
|
+
Zt,
|
|
958
959
|
{
|
|
959
960
|
collection: r,
|
|
960
961
|
item: t,
|
|
@@ -971,7 +972,7 @@ function $n({
|
|
|
971
972
|
`${r}:${t}`
|
|
972
973
|
);
|
|
973
974
|
}
|
|
974
|
-
function
|
|
975
|
+
function vt({ collection: r, item: t }) {
|
|
975
976
|
const u = fe(), { data: i } = te({
|
|
976
977
|
queryKey: ["approval-brief", r, String(t)],
|
|
977
978
|
queryFn: () => u.request(ie(`/pipelines/instance/${r}/${t}/approval-brief`)).then((p) => p.data),
|
|
@@ -1060,7 +1061,7 @@ function wt({ collection: r, item: t }) {
|
|
|
1060
1061
|
))
|
|
1061
1062
|
] });
|
|
1062
1063
|
}
|
|
1063
|
-
function
|
|
1064
|
+
function Zt({
|
|
1064
1065
|
collection: r,
|
|
1065
1066
|
item: t,
|
|
1066
1067
|
defaultExpanded: u,
|
|
@@ -1074,9 +1075,9 @@ function Jt({
|
|
|
1074
1075
|
asRole: x
|
|
1075
1076
|
}) {
|
|
1076
1077
|
var We, He, Ve;
|
|
1077
|
-
const R = fe(), C =
|
|
1078
|
-
|
|
1079
|
-
const v =
|
|
1078
|
+
const R = fe(), C = Le(), [E, O] = K(""), [M, B] = K(null), [U, b] = K(!1), [S, l] = K(!1), [w, s] = K(null);
|
|
1079
|
+
mt(r, t, "transition", !!M || !!w);
|
|
1080
|
+
const v = Pt(r, t, "transition"), k = ne(!1);
|
|
1080
1081
|
ue(() => {
|
|
1081
1082
|
!k.current && u !== void 0 && (k.current = !0, l(u));
|
|
1082
1083
|
}, [u]);
|
|
@@ -1086,7 +1087,7 @@ function Jt({
|
|
|
1086
1087
|
A.current = !1;
|
|
1087
1088
|
}
|
|
1088
1089
|
}));
|
|
1089
|
-
},
|
|
1090
|
+
}, m = async (o) => {
|
|
1090
1091
|
if (A.current) return;
|
|
1091
1092
|
if (M === o) {
|
|
1092
1093
|
B(null);
|
|
@@ -1108,7 +1109,7 @@ function Jt({
|
|
|
1108
1109
|
return;
|
|
1109
1110
|
}
|
|
1110
1111
|
B(o);
|
|
1111
|
-
}, y = x ? ["pipeline-instance", r, t, x] : ["pipeline-instance", r, t], { data: d, isLoading:
|
|
1112
|
+
}, y = x ? ["pipeline-instance", r, t, x] : ["pipeline-instance", r, t], { data: d, isLoading: c } = te({
|
|
1112
1113
|
queryKey: y,
|
|
1113
1114
|
queryFn: () => R.request(
|
|
1114
1115
|
ie(
|
|
@@ -1170,14 +1171,14 @@ function Jt({
|
|
|
1170
1171
|
})
|
|
1171
1172
|
),
|
|
1172
1173
|
onSuccess: () => {
|
|
1173
|
-
C.invalidateQueries({ queryKey: y }), r === "nivaro_addendums" && C.invalidateQueries({ queryKey: ["addendums"] }), ke(C, r, String(t)), _e(C, r, String(t)),
|
|
1174
|
+
C.invalidateQueries({ queryKey: y }), r === "nivaro_addendums" && C.invalidateQueries({ queryKey: ["addendums"] }), ke(C, r, String(t)), _e(C, r, String(t)), O(""), B(null), s(null), ee.success("Transition executed");
|
|
1174
1175
|
},
|
|
1175
1176
|
onError: (o, T) => {
|
|
1176
|
-
if (
|
|
1177
|
+
if (yt(o)) {
|
|
1177
1178
|
C.invalidateQueries({ queryKey: y });
|
|
1178
1179
|
return;
|
|
1179
1180
|
}
|
|
1180
|
-
const I =
|
|
1181
|
+
const I = wt(o);
|
|
1181
1182
|
if (I) {
|
|
1182
1183
|
s((G) => ({
|
|
1183
1184
|
payload: I,
|
|
@@ -1190,10 +1191,12 @@ function Jt({
|
|
|
1190
1191
|
const z = o == null ? void 0 : o.response;
|
|
1191
1192
|
ee.error(he(o, "Failed to execute transition"), {
|
|
1192
1193
|
duration: 12e3,
|
|
1194
|
+
// What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
|
|
1195
|
+
...ct(o, { action: "Transition" }),
|
|
1193
1196
|
// #1867: a refusal carries "Why?" — the role, owner or access rule
|
|
1194
1197
|
// that stopped it, and who can change it.
|
|
1195
|
-
...
|
|
1196
|
-
action:
|
|
1198
|
+
...ht(o) ? {
|
|
1199
|
+
action: xt(R, {
|
|
1197
1200
|
collection: r,
|
|
1198
1201
|
itemId: String(t),
|
|
1199
1202
|
action: "transition",
|
|
@@ -1202,8 +1205,8 @@ function Jt({
|
|
|
1202
1205
|
} : {}
|
|
1203
1206
|
}), s(null), B(null), ke(C, r, String(t)), _e(C, r, String(t)), (z == null ? void 0 : z.status) === 409 && C.invalidateQueries({ queryKey: y });
|
|
1204
1207
|
}
|
|
1205
|
-
}),
|
|
1206
|
-
|
|
1208
|
+
}), L = ne(m);
|
|
1209
|
+
L.current = m;
|
|
1207
1210
|
const re = ne((d == null ? void 0 : d.available_transitions) ?? []);
|
|
1208
1211
|
if (re.current = (d == null ? void 0 : d.available_transitions) ?? [], ue(() => {
|
|
1209
1212
|
const o = (T) => {
|
|
@@ -1215,10 +1218,10 @@ function Jt({
|
|
|
1215
1218
|
ee.error("That step is not available from where the record is now");
|
|
1216
1219
|
return;
|
|
1217
1220
|
}
|
|
1218
|
-
|
|
1221
|
+
L.current(G.id);
|
|
1219
1222
|
};
|
|
1220
1223
|
return window.addEventListener(Ne, o), () => window.removeEventListener(Ne, o);
|
|
1221
|
-
}, [r, t]),
|
|
1224
|
+
}, [r, t]), c)
|
|
1222
1225
|
return /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ n("div", { className: "flex w-full items-center gap-2.5 px-5 py-3.5", children: [
|
|
1223
1226
|
/* @__PURE__ */ e(le, { className: "h-3.5 w-3.5 shrink-0 rounded" }),
|
|
1224
1227
|
/* @__PURE__ */ e(le, { className: "h-4 w-20" }),
|
|
@@ -1226,9 +1229,9 @@ function Jt({
|
|
|
1226
1229
|
/* @__PURE__ */ e(le, { className: "ml-auto h-3.5 w-3.5 rounded" })
|
|
1227
1230
|
] }) });
|
|
1228
1231
|
if (!(d != null && d.binding)) return null;
|
|
1229
|
-
const { instance: F, available_transitions: a, history: D, states: H } = d, V = new Map((H ?? []).map((o) => [o.id, o])), Z = (F == null ? void 0 : F.current_state_obj) ?? null, ae = M ? (a ?? []).find((o) => o.id === M) : null, Se = ae ? V.get(ae.to_state) : null,
|
|
1232
|
+
const { instance: F, available_transitions: a, history: D, states: H } = d, V = new Map((H ?? []).map((o) => [o.id, o])), Z = (F == null ? void 0 : F.current_state_obj) ?? null, ae = M ? (a ?? []).find((o) => o.id === M) : null, Se = ae ? V.get(ae.to_state) : null, Nt = F != null && F.completed_at && a ? a.filter(
|
|
1230
1233
|
(o) => o.from_state && String(o.from_state).toUpperCase() === String(F.current_state).toUpperCase()
|
|
1231
|
-
) : null, $e = F != null && F.completed_at ?
|
|
1234
|
+
) : null, $e = F != null && F.completed_at ? Nt ?? [] : a ?? [], Qe = $e.length > 0, ze = (o, T = !1) => {
|
|
1232
1235
|
const I = /* @__PURE__ */ new Map();
|
|
1233
1236
|
for (const z of o) {
|
|
1234
1237
|
const G = I.get(z.label) ?? [];
|
|
@@ -1247,7 +1250,7 @@ function Jt({
|
|
|
1247
1250
|
className: `${T ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
|
|
1248
1251
|
style: Ge(ye),
|
|
1249
1252
|
disabled: J.isPending,
|
|
1250
|
-
onClick: () =>
|
|
1253
|
+
onClick: () => m(X.id),
|
|
1251
1254
|
children: [
|
|
1252
1255
|
pe && /* @__PURE__ */ e(se, { className: "h-3 w-3 animate-spin" }),
|
|
1253
1256
|
z
|
|
@@ -1278,7 +1281,7 @@ function Jt({
|
|
|
1278
1281
|
}
|
|
1279
1282
|
).map((X) => {
|
|
1280
1283
|
var pe;
|
|
1281
|
-
return /* @__PURE__ */ n(we, { onSelect: () =>
|
|
1284
|
+
return /* @__PURE__ */ n(we, { onSelect: () => m(X.id), children: [
|
|
1282
1285
|
X.color && /* @__PURE__ */ e(
|
|
1283
1286
|
"span",
|
|
1284
1287
|
{
|
|
@@ -1301,13 +1304,13 @@ function Jt({
|
|
|
1301
1304
|
/* @__PURE__ */ e(oe, { label: Se.label, color: Se.color, small: !0 })
|
|
1302
1305
|
] })
|
|
1303
1306
|
] }),
|
|
1304
|
-
/* @__PURE__ */ e(
|
|
1307
|
+
/* @__PURE__ */ e(vt, { collection: r, item: t }),
|
|
1305
1308
|
/* @__PURE__ */ e(
|
|
1306
1309
|
"input",
|
|
1307
1310
|
{
|
|
1308
1311
|
type: "text",
|
|
1309
1312
|
value: E,
|
|
1310
|
-
onChange: (o) =>
|
|
1313
|
+
onChange: (o) => O(o.target.value),
|
|
1311
1314
|
placeholder: String((ae == null ? void 0 : ae.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
|
|
1312
1315
|
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"
|
|
1313
1316
|
}
|
|
@@ -1371,7 +1374,7 @@ function Jt({
|
|
|
1371
1374
|
`),
|
|
1372
1375
|
"data-pipeline-auto-held-pill": !0,
|
|
1373
1376
|
children: [
|
|
1374
|
-
/* @__PURE__ */ e(
|
|
1377
|
+
/* @__PURE__ */ e(kt, { className: "h-3 w-3 shrink-0" }),
|
|
1375
1378
|
"Needs a person"
|
|
1376
1379
|
]
|
|
1377
1380
|
}
|
|
@@ -1387,7 +1390,7 @@ function Jt({
|
|
|
1387
1390
|
"data-pipeline-approving": !0,
|
|
1388
1391
|
children: [
|
|
1389
1392
|
/* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
|
|
1390
|
-
|
|
1393
|
+
At(v, "approving")
|
|
1391
1394
|
]
|
|
1392
1395
|
}
|
|
1393
1396
|
)
|
|
@@ -1411,7 +1414,7 @@ function Jt({
|
|
|
1411
1414
|
}
|
|
1412
1415
|
),
|
|
1413
1416
|
q && ((d == null ? void 0 : d.binding) || (d == null ? void 0 : d.instance)) && /* @__PURE__ */ e(
|
|
1414
|
-
|
|
1417
|
+
Jt,
|
|
1415
1418
|
{
|
|
1416
1419
|
collection: r,
|
|
1417
1420
|
item: t,
|
|
@@ -1434,7 +1437,7 @@ function Jt({
|
|
|
1434
1437
|
),
|
|
1435
1438
|
!S && M && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Ke }),
|
|
1436
1439
|
S && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
|
|
1437
|
-
/* @__PURE__ */ e(
|
|
1440
|
+
/* @__PURE__ */ e(Kt, { held: (d == null ? void 0 : d.auto_held) ?? [] }),
|
|
1438
1441
|
P && /* @__PURE__ */ n("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: [
|
|
1439
1442
|
/* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
|
|
1440
1443
|
/* @__PURE__ */ e("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
|
|
@@ -1454,7 +1457,7 @@ function Jt({
|
|
|
1454
1457
|
/* @__PURE__ */ e(le, { className: "ml-2 h-3 w-24" })
|
|
1455
1458
|
] })
|
|
1456
1459
|
) : /* @__PURE__ */ e(
|
|
1457
|
-
|
|
1460
|
+
Ht,
|
|
1458
1461
|
{
|
|
1459
1462
|
states: H,
|
|
1460
1463
|
allTransitions: (d == null ? void 0 : d.all_transitions) ?? [],
|
|
@@ -1465,9 +1468,9 @@ function Jt({
|
|
|
1465
1468
|
skippedStates: $
|
|
1466
1469
|
}
|
|
1467
1470
|
),
|
|
1468
|
-
(d == null ? void 0 : d.branches) && /* @__PURE__ */ e(
|
|
1471
|
+
(d == null ? void 0 : d.branches) && /* @__PURE__ */ e(Et, { data: d.branches }),
|
|
1469
1472
|
/* @__PURE__ */ e(
|
|
1470
|
-
|
|
1473
|
+
Wt,
|
|
1471
1474
|
{
|
|
1472
1475
|
history: D ?? [],
|
|
1473
1476
|
completedAt: F.completed_at
|
|
@@ -1475,9 +1478,9 @@ function Jt({
|
|
|
1475
1478
|
)
|
|
1476
1479
|
] }),
|
|
1477
1480
|
/* @__PURE__ */ n("div", { className: "space-y-3 px-5 py-4", children: [
|
|
1478
|
-
!F.completed_at && /* @__PURE__ */ e(
|
|
1481
|
+
!F.completed_at && /* @__PURE__ */ e(Ut, { collection: r, itemId: String(t) }),
|
|
1479
1482
|
/* @__PURE__ */ e(
|
|
1480
|
-
|
|
1483
|
+
Xt,
|
|
1481
1484
|
{
|
|
1482
1485
|
collection: r,
|
|
1483
1486
|
item: t,
|
|
@@ -1523,7 +1526,7 @@ function Jt({
|
|
|
1523
1526
|
]
|
|
1524
1527
|
}
|
|
1525
1528
|
),
|
|
1526
|
-
U && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e(
|
|
1529
|
+
U && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e(Vt, { history: D ?? [] }) })
|
|
1527
1530
|
] })
|
|
1528
1531
|
] }) : /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-4 px-5 py-4", children: [
|
|
1529
1532
|
/* @__PURE__ */ e("p", { className: "text-[13px] text-slate-500", children: "Pipeline not started for this record." }),
|
|
@@ -1547,7 +1550,7 @@ function Jt({
|
|
|
1547
1550
|
}
|
|
1548
1551
|
),
|
|
1549
1552
|
w && /* @__PURE__ */ e(dt, { fallback: null, children: /* @__PURE__ */ e(
|
|
1550
|
-
|
|
1553
|
+
bt,
|
|
1551
1554
|
{
|
|
1552
1555
|
payload: w.payload,
|
|
1553
1556
|
isRetry: w.revision > 1,
|
|
@@ -1568,14 +1571,14 @@ function Jt({
|
|
|
1568
1571
|
) })
|
|
1569
1572
|
] });
|
|
1570
1573
|
}
|
|
1571
|
-
function
|
|
1574
|
+
function Pn({
|
|
1572
1575
|
collection: r,
|
|
1573
1576
|
item: t,
|
|
1574
1577
|
onBeforeTransition: u,
|
|
1575
1578
|
wrap: i = !0
|
|
1576
1579
|
}) {
|
|
1577
1580
|
return t === "new" ? null : /* @__PURE__ */ e(
|
|
1578
|
-
|
|
1581
|
+
Yt,
|
|
1579
1582
|
{
|
|
1580
1583
|
collection: r,
|
|
1581
1584
|
item: t,
|
|
@@ -1584,48 +1587,48 @@ function Tn({
|
|
|
1584
1587
|
}
|
|
1585
1588
|
);
|
|
1586
1589
|
}
|
|
1587
|
-
function
|
|
1590
|
+
function Yt({
|
|
1588
1591
|
collection: r,
|
|
1589
1592
|
item: t,
|
|
1590
1593
|
onBeforeTransition: u,
|
|
1591
1594
|
wrap: i = !0
|
|
1592
1595
|
}) {
|
|
1593
|
-
const q = fe(), p =
|
|
1594
|
-
|
|
1595
|
-
const C = ne(null), E =
|
|
1596
|
-
|
|
1596
|
+
const q = fe(), p = Le(), [f, N] = K(""), [P, j] = K(null), [x, R] = K(null);
|
|
1597
|
+
mt(r, t, "transition", !!P || !!x);
|
|
1598
|
+
const C = ne(null), E = Mt(C, !i), O = ne(!1), M = (c) => {
|
|
1599
|
+
O.current || (O.current = !0, S.mutate(c, {
|
|
1597
1600
|
onSettled: () => {
|
|
1598
|
-
|
|
1601
|
+
O.current = !1;
|
|
1599
1602
|
}
|
|
1600
1603
|
}));
|
|
1601
|
-
}, B = async (
|
|
1602
|
-
if (
|
|
1603
|
-
if (P ===
|
|
1604
|
+
}, B = async (c) => {
|
|
1605
|
+
if (O.current) return;
|
|
1606
|
+
if (P === c) {
|
|
1604
1607
|
j(null);
|
|
1605
1608
|
return;
|
|
1606
1609
|
}
|
|
1607
1610
|
if (u) {
|
|
1608
|
-
|
|
1611
|
+
O.current = !0;
|
|
1609
1612
|
let h = !1;
|
|
1610
1613
|
try {
|
|
1611
1614
|
h = await u();
|
|
1612
1615
|
} finally {
|
|
1613
|
-
|
|
1616
|
+
O.current = !1;
|
|
1614
1617
|
}
|
|
1615
1618
|
if (!h) return;
|
|
1616
1619
|
}
|
|
1617
|
-
const g = (s ?? []).find((h) => h.id ===
|
|
1620
|
+
const g = (s ?? []).find((h) => h.id === c), _ = String((g == null ? void 0 : g.comment_mode) ?? "none");
|
|
1618
1621
|
if (_ !== "optional" && _ !== "required") {
|
|
1619
|
-
M({ transition_id:
|
|
1622
|
+
M({ transition_id: c });
|
|
1620
1623
|
return;
|
|
1621
1624
|
}
|
|
1622
|
-
j(
|
|
1625
|
+
j(c);
|
|
1623
1626
|
}, U = ["pipeline-instance", r, t], { data: b } = te({
|
|
1624
1627
|
queryKey: U,
|
|
1625
1628
|
queryFn: () => q.request(
|
|
1626
1629
|
ie(`/pipelines/instance/${r}/${t}`)
|
|
1627
1630
|
).then(
|
|
1628
|
-
(
|
|
1631
|
+
(c) => c.data ?? {
|
|
1629
1632
|
instance: null,
|
|
1630
1633
|
states: [],
|
|
1631
1634
|
available_transitions: [],
|
|
@@ -1637,12 +1640,12 @@ function Zt({
|
|
|
1637
1640
|
staleTime: 1e4
|
|
1638
1641
|
}), S = xe({
|
|
1639
1642
|
mutationFn: ({
|
|
1640
|
-
transition_id:
|
|
1643
|
+
transition_id: c,
|
|
1641
1644
|
comment: g,
|
|
1642
1645
|
reviewed: _
|
|
1643
1646
|
}) => q.request(
|
|
1644
1647
|
be(`/pipelines/instance/${r}/${t}/transition`, {
|
|
1645
|
-
transition_id:
|
|
1648
|
+
transition_id: c,
|
|
1646
1649
|
comment: g,
|
|
1647
1650
|
..._ ? { reviewed: !0 } : {}
|
|
1648
1651
|
})
|
|
@@ -1650,12 +1653,12 @@ function Zt({
|
|
|
1650
1653
|
onSuccess: () => {
|
|
1651
1654
|
p.invalidateQueries({ queryKey: U }), r === "nivaro_addendums" && p.invalidateQueries({ queryKey: ["addendums"] }), ke(p, r, String(t)), _e(p, r, String(t)), N(""), j(null), R(null), ee.success("Transition executed");
|
|
1652
1655
|
},
|
|
1653
|
-
onError: (
|
|
1654
|
-
if (
|
|
1656
|
+
onError: (c, g) => {
|
|
1657
|
+
if (yt(c)) {
|
|
1655
1658
|
p.invalidateQueries({ queryKey: U });
|
|
1656
1659
|
return;
|
|
1657
1660
|
}
|
|
1658
|
-
const _ =
|
|
1661
|
+
const _ = wt(c);
|
|
1659
1662
|
if (_) {
|
|
1660
1663
|
R(($) => ({
|
|
1661
1664
|
payload: _,
|
|
@@ -1665,13 +1668,15 @@ function Zt({
|
|
|
1665
1668
|
}));
|
|
1666
1669
|
return;
|
|
1667
1670
|
}
|
|
1668
|
-
const h =
|
|
1669
|
-
ee.error(he(
|
|
1671
|
+
const h = c == null ? void 0 : c.response;
|
|
1672
|
+
ee.error(he(c, "Failed to execute transition"), {
|
|
1670
1673
|
duration: 12e3,
|
|
1674
|
+
// What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
|
|
1675
|
+
...ct(c, { action: "Transition" }),
|
|
1671
1676
|
// #1867: a refusal carries "Why?" — the role, owner or access rule
|
|
1672
1677
|
// that stopped it, and who can change it.
|
|
1673
|
-
...
|
|
1674
|
-
action:
|
|
1678
|
+
...ht(c) ? {
|
|
1679
|
+
action: xt(q, {
|
|
1675
1680
|
collection: r,
|
|
1676
1681
|
itemId: String(t),
|
|
1677
1682
|
action: "transition",
|
|
@@ -1684,7 +1689,7 @@ function Zt({
|
|
|
1684
1689
|
l.current = B;
|
|
1685
1690
|
const w = ne((b == null ? void 0 : b.available_transitions) ?? []);
|
|
1686
1691
|
if (w.current = (b == null ? void 0 : b.available_transitions) ?? [], ue(() => {
|
|
1687
|
-
const
|
|
1692
|
+
const c = (g) => {
|
|
1688
1693
|
const _ = g.detail;
|
|
1689
1694
|
if (!_ || _.claimed || _.collection !== r || String(_.item) !== String(t)) return;
|
|
1690
1695
|
_.claimed = !0;
|
|
@@ -1695,28 +1700,28 @@ function Zt({
|
|
|
1695
1700
|
}
|
|
1696
1701
|
l.current($.id);
|
|
1697
1702
|
};
|
|
1698
|
-
return window.addEventListener(Ne,
|
|
1703
|
+
return window.addEventListener(Ne, c), () => window.removeEventListener(Ne, c);
|
|
1699
1704
|
}, [r, t]), !(b != null && b.binding) || !(b != null && b.instance)) return null;
|
|
1700
1705
|
const s = (b.available_transitions ?? []).filter(
|
|
1701
|
-
(
|
|
1706
|
+
(c) => !b.instance.completed_at || c.from_state && String(c.from_state).toUpperCase() === String(b.instance.current_state).toUpperCase()
|
|
1702
1707
|
);
|
|
1703
1708
|
if (s.length === 0) return null;
|
|
1704
|
-
const v = new Map((b.states ?? []).map((
|
|
1705
|
-
for (const
|
|
1706
|
-
const g =
|
|
1707
|
-
g.push(
|
|
1709
|
+
const v = new Map((b.states ?? []).map((c) => [c.id, c])), k = b.instance.current_state_obj ?? null, A = P ? s.find((c) => c.id === P) : null, W = A ? v.get(A.to_state) : null, m = /* @__PURE__ */ new Map();
|
|
1710
|
+
for (const c of s) {
|
|
1711
|
+
const g = m.get(c.label) ?? [];
|
|
1712
|
+
g.push(c), m.set(c.label, g);
|
|
1708
1713
|
}
|
|
1709
|
-
const y = (
|
|
1714
|
+
const y = (c) => [...c].sort(
|
|
1710
1715
|
(g, _) => {
|
|
1711
1716
|
var h, $;
|
|
1712
1717
|
return (((h = v.get(g.to_state)) == null ? void 0 : h.sort) ?? 999) - ((($ = v.get(_.to_state)) == null ? void 0 : $.sort) ?? 999);
|
|
1713
1718
|
}
|
|
1714
1719
|
), d = (() => {
|
|
1715
1720
|
var _, h, $;
|
|
1716
|
-
const
|
|
1717
|
-
if (!
|
|
1721
|
+
const c = (_ = C.current) == null ? void 0 : _.getBoundingClientRect();
|
|
1722
|
+
if (!c) return 600;
|
|
1718
1723
|
const g = ($ = (h = C.current) == null ? void 0 : h.closest('[role="dialog"]')) == null ? void 0 : $.getBoundingClientRect();
|
|
1719
|
-
return Math.max(260, Math.min(600,
|
|
1724
|
+
return Math.max(260, Math.min(600, c.right - ((g == null ? void 0 : g.left) ?? 0) - 12));
|
|
1720
1725
|
})();
|
|
1721
1726
|
return /* @__PURE__ */ n("div", { ref: C, className: "relative", children: [
|
|
1722
1727
|
E ? /* @__PURE__ */ n(Pe, { children: [
|
|
@@ -1735,8 +1740,8 @@ function Zt({
|
|
|
1735
1740
|
]
|
|
1736
1741
|
}
|
|
1737
1742
|
) }),
|
|
1738
|
-
/* @__PURE__ */ e(Re, { align: "end", className: "min-w-[200px]", children: Array.from(
|
|
1739
|
-
([
|
|
1743
|
+
/* @__PURE__ */ e(Re, { align: "end", className: "min-w-[200px]", children: Array.from(m.entries()).map(
|
|
1744
|
+
([c, g], _, h) => g.length === 1 ? /* @__PURE__ */ n(tt, { children: [
|
|
1740
1745
|
_ > 0 && h[_ - 1][1].length > 1 && /* @__PURE__ */ e(nt, {}),
|
|
1741
1746
|
/* @__PURE__ */ n(we, { onSelect: () => B(g[0].id), children: [
|
|
1742
1747
|
g[0].color && /* @__PURE__ */ e(
|
|
@@ -1746,11 +1751,11 @@ function Zt({
|
|
|
1746
1751
|
style: { backgroundColor: g[0].color }
|
|
1747
1752
|
}
|
|
1748
1753
|
),
|
|
1749
|
-
|
|
1754
|
+
c
|
|
1750
1755
|
] })
|
|
1751
|
-
] },
|
|
1756
|
+
] }, c) : /* @__PURE__ */ n(tt, { children: [
|
|
1752
1757
|
_ > 0 && /* @__PURE__ */ e(nt, {}),
|
|
1753
|
-
/* @__PURE__ */ e(
|
|
1758
|
+
/* @__PURE__ */ e(Ft, { className: "text-[11px] text-muted-foreground", children: c }),
|
|
1754
1759
|
y(g).map(($) => {
|
|
1755
1760
|
var Q;
|
|
1756
1761
|
return /* @__PURE__ */ n(we, { onSelect: () => B($.id), children: [
|
|
@@ -1764,17 +1769,17 @@ function Zt({
|
|
|
1764
1769
|
((Q = v.get($.to_state)) == null ? void 0 : Q.label) ?? $.to_state
|
|
1765
1770
|
] }, $.id);
|
|
1766
1771
|
})
|
|
1767
|
-
] },
|
|
1772
|
+
] }, c)
|
|
1768
1773
|
) })
|
|
1769
1774
|
] }) : /* @__PURE__ */ e(
|
|
1770
1775
|
"div",
|
|
1771
1776
|
{
|
|
1772
1777
|
className: i ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
|
|
1773
|
-
children: Array.from(
|
|
1778
|
+
children: Array.from(m.entries()).map(([c, g]) => {
|
|
1774
1779
|
var Q, J;
|
|
1775
|
-
const _ = ((Q = g[0]) == null ? void 0 : Q.color) ?? null, h = g.some((
|
|
1780
|
+
const _ = ((Q = g[0]) == null ? void 0 : Q.color) ?? null, h = g.some((L) => L.id === P), $ = (L) => _ ? L ? { backgroundColor: _, borderColor: _ } : { borderColor: _, color: _ } : void 0;
|
|
1776
1781
|
if (g.length === 1) {
|
|
1777
|
-
const
|
|
1782
|
+
const L = g[0], re = S.isPending && ((J = S.variables) == null ? void 0 : J.transition_id) === L.id, F = /* @__PURE__ */ n(
|
|
1778
1783
|
Y,
|
|
1779
1784
|
{
|
|
1780
1785
|
size: "sm",
|
|
@@ -1782,27 +1787,27 @@ function Zt({
|
|
|
1782
1787
|
className: "gap-1.5 text-[12px]",
|
|
1783
1788
|
style: $(h),
|
|
1784
1789
|
disabled: S.isPending,
|
|
1785
|
-
onClick: () => B(
|
|
1790
|
+
onClick: () => B(L.id),
|
|
1786
1791
|
children: [
|
|
1787
1792
|
re && /* @__PURE__ */ e(se, { className: "h-3 w-3 animate-spin" }),
|
|
1788
|
-
|
|
1793
|
+
c
|
|
1789
1794
|
]
|
|
1790
1795
|
},
|
|
1791
|
-
|
|
1796
|
+
c
|
|
1792
1797
|
);
|
|
1793
|
-
return
|
|
1798
|
+
return L.pushes && L.pushes > 0 ? /* @__PURE__ */ n("span", { className: "relative inline-flex", children: [
|
|
1794
1799
|
F,
|
|
1795
1800
|
/* @__PURE__ */ e(
|
|
1796
|
-
|
|
1801
|
+
Bt,
|
|
1797
1802
|
{
|
|
1798
1803
|
collection: r,
|
|
1799
1804
|
itemId: t,
|
|
1800
|
-
transitionId:
|
|
1801
|
-
label:
|
|
1805
|
+
transitionId: L.id,
|
|
1806
|
+
label: c,
|
|
1802
1807
|
compact: !0
|
|
1803
1808
|
}
|
|
1804
1809
|
)
|
|
1805
|
-
] },
|
|
1810
|
+
] }, c) : F;
|
|
1806
1811
|
}
|
|
1807
1812
|
return /* @__PURE__ */ n(Pe, { children: [
|
|
1808
1813
|
/* @__PURE__ */ e(Ae, { asChild: !0, children: /* @__PURE__ */ n(
|
|
@@ -1814,25 +1819,25 @@ function Zt({
|
|
|
1814
1819
|
style: $(h),
|
|
1815
1820
|
disabled: S.isPending,
|
|
1816
1821
|
children: [
|
|
1817
|
-
|
|
1822
|
+
c,
|
|
1818
1823
|
/* @__PURE__ */ e(me, { className: "h-3 w-3" })
|
|
1819
1824
|
]
|
|
1820
1825
|
}
|
|
1821
1826
|
) }),
|
|
1822
|
-
/* @__PURE__ */ e(Re, { align: "start", children: y(g).map((
|
|
1827
|
+
/* @__PURE__ */ e(Re, { align: "start", children: y(g).map((L) => {
|
|
1823
1828
|
var re;
|
|
1824
|
-
return /* @__PURE__ */ n(we, { onSelect: () => B(
|
|
1825
|
-
|
|
1829
|
+
return /* @__PURE__ */ n(we, { onSelect: () => B(L.id), children: [
|
|
1830
|
+
L.color && /* @__PURE__ */ e(
|
|
1826
1831
|
"span",
|
|
1827
1832
|
{
|
|
1828
1833
|
className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
|
|
1829
|
-
style: { backgroundColor:
|
|
1834
|
+
style: { backgroundColor: L.color }
|
|
1830
1835
|
}
|
|
1831
1836
|
),
|
|
1832
|
-
((re = v.get(
|
|
1833
|
-
] },
|
|
1837
|
+
((re = v.get(L.to_state)) == null ? void 0 : re.label) ?? L.to_state
|
|
1838
|
+
] }, L.id);
|
|
1834
1839
|
}) })
|
|
1835
|
-
] },
|
|
1840
|
+
] }, c);
|
|
1836
1841
|
})
|
|
1837
1842
|
}
|
|
1838
1843
|
),
|
|
@@ -1851,13 +1856,13 @@ function Zt({
|
|
|
1851
1856
|
/* @__PURE__ */ e(oe, { label: W.label, color: W.color, small: !0 })
|
|
1852
1857
|
] })
|
|
1853
1858
|
] }),
|
|
1854
|
-
/* @__PURE__ */ e(
|
|
1859
|
+
/* @__PURE__ */ e(vt, { collection: r, item: t }),
|
|
1855
1860
|
/* @__PURE__ */ e(
|
|
1856
1861
|
"input",
|
|
1857
1862
|
{
|
|
1858
1863
|
type: "text",
|
|
1859
1864
|
value: f,
|
|
1860
|
-
onChange: (
|
|
1865
|
+
onChange: (c) => N(c.target.value),
|
|
1861
1866
|
placeholder: String((A == null ? void 0 : A.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
|
|
1862
1867
|
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"
|
|
1863
1868
|
}
|
|
@@ -1896,7 +1901,7 @@ function Zt({
|
|
|
1896
1901
|
}
|
|
1897
1902
|
),
|
|
1898
1903
|
x && /* @__PURE__ */ e(dt, { fallback: null, children: /* @__PURE__ */ e(
|
|
1899
|
-
|
|
1904
|
+
bt,
|
|
1900
1905
|
{
|
|
1901
1906
|
payload: x.payload,
|
|
1902
1907
|
isRetry: x.revision > 1,
|
|
@@ -1918,8 +1923,8 @@ function Zt({
|
|
|
1918
1923
|
] });
|
|
1919
1924
|
}
|
|
1920
1925
|
export {
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1926
|
+
qn as PipelinePanel,
|
|
1927
|
+
Pn as PipelineTransitionButtons,
|
|
1928
|
+
yt as isDuplicateTransition,
|
|
1929
|
+
wt as transitionRequirementsFromError
|
|
1925
1930
|
};
|