@nivaro/react 0.3.50 → 0.3.52
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/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/shared/components/ItemEditForm.js +4801 -4666
- package/dist/shared/components/QueryTable.js +337 -324
- package/dist/shared/components/ReportView.js +105 -99
- package/dist/shared/components/alerts/AlertManagerView.js +327 -301
- package/dist/shared/components/item-edit/CatalogPickerField.js +1149 -1111
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +58 -53
- package/dist/shared/components/item-edit/FieldRenderer.js +227 -223
- package/dist/shared/components/item-edit/FieldRow.js +287 -265
- package/dist/shared/components/item-edit/FilePickerField.js +315 -307
- package/dist/shared/components/item-edit/InlineTableField.js +491 -466
- package/dist/shared/components/item-edit/RecordHeaderActions.js +76 -75
- package/dist/shared/components/item-edit/RecordLiveSync.js +93 -91
- package/dist/shared/components/item-edit/RelationCombobox.js +62 -60
- package/dist/shared/components/item-edit/SummaryPanel.js +287 -277
- package/dist/shared/components/item-edit/UserChip.js +233 -200
- package/dist/shared/components/item-edit/header-midair.js +51 -0
- package/dist/shared/components/item-edit/line-midair.js +76 -70
- package/dist/shared/components/panels/CommentPanel.js +290 -284
- package/dist/shared/components/panels/ItemLockBanner.js +30 -30
- package/dist/shared/components/panels/PipelinePanel.js +956 -901
- package/dist/shared/components/panels/TaskPanel.js +71 -61
- package/dist/shared/components/panels/TransitionRequirementsDialog.js +569 -439
- package/dist/shared/components/panels/requirement-side-effects.js +40 -0
- package/dist/shared/components/queue/QueueWorklist.js +141 -130
- package/dist/shared/lib/draft-store.js +48 -34
- package/dist/shared/lib/query-stats.js +60 -60
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { useQueryClient as so, useQuery as W, useMutation as Se, useQueries as B
|
|
|
6
6
|
import { AlertTriangle as io, FileDiff as co, RefreshCw as uo, Rows3 as xa, Flame as mo, Sparkles as po, BarChart3 as bo, SlidersHorizontal as ho, ListChecks as fo, Rows4 as go, Rows2 as xo, Play as yo, Plus as zt, ChevronDown as ya, Star as ko, Pin as vo, Loader2 as wo, Check as _o, Save as No, Bell as So, Inbox as Co, GripVertical as $o } from "lucide-react";
|
|
7
7
|
import { useState as w, useRef as U, useEffect as M, useMemo as V } from "react";
|
|
8
8
|
import { createPortal as ka } from "react-dom";
|
|
9
|
-
import { toast as
|
|
9
|
+
import { toast as D } from "sonner";
|
|
10
10
|
import { useNivaroClient as $a, useItemEditAuth as va, useItemNavigation as qo, useNavigation as Fo, useOverlayState as To } from "../../context.js";
|
|
11
11
|
import { useDebounced as Ro } from "../../hooks/useDebounced.js";
|
|
12
12
|
import { useElapsedLoading as Eo } from "../../hooks/useElapsedLoading.js";
|
|
@@ -268,7 +268,7 @@ function wi({
|
|
|
268
268
|
transform: oo.Transform.toString(S),
|
|
269
269
|
transition: H,
|
|
270
270
|
opacity: xe ? 0.4 : 1
|
|
271
|
-
},
|
|
271
|
+
}, Y = `col-toggle-${l}`;
|
|
272
272
|
return /* @__PURE__ */ d("div", { ref: h, style: g, className: "flex items-center gap-2 text-[12px]", children: [
|
|
273
273
|
/* @__PURE__ */ a(
|
|
274
274
|
"span",
|
|
@@ -279,8 +279,8 @@ function wi({
|
|
|
279
279
|
children: /* @__PURE__ */ a($o, { className: "h-3.5 w-3.5" })
|
|
280
280
|
}
|
|
281
281
|
),
|
|
282
|
-
/* @__PURE__ */ a(jn, { id:
|
|
283
|
-
/* @__PURE__ */ a(ni, { htmlFor:
|
|
282
|
+
/* @__PURE__ */ a(jn, { id: Y, checked: L, onCheckedChange: P }),
|
|
283
|
+
/* @__PURE__ */ a(ni, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children: y })
|
|
284
284
|
] });
|
|
285
285
|
}
|
|
286
286
|
function Wc({
|
|
@@ -291,7 +291,7 @@ function Wc({
|
|
|
291
291
|
onAsk: G
|
|
292
292
|
}) {
|
|
293
293
|
var ta, na, ra, aa, la, oa, sa, ia, ca, da, ua, ma, pa, ba, ha, fa;
|
|
294
|
-
const f = so(), h = $a(), { userId: S } = va(), H = qo(), { navigate: xe } = Fo(), [g,
|
|
294
|
+
const f = so(), h = $a(), { userId: S } = va(), H = qo(), { navigate: xe } = Fo(), [g, Y] = w("all"), [de, O] = w(1), Un = U(jo()), [Tt, qa] = w(() => {
|
|
295
295
|
try {
|
|
296
296
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
297
297
|
} catch {
|
|
@@ -360,14 +360,14 @@ function Wc({
|
|
|
360
360
|
}).catch(() => []),
|
|
361
361
|
enabled: !!Ie,
|
|
362
362
|
staleTime: 3e5
|
|
363
|
-
}),
|
|
363
|
+
}), re = V(() => {
|
|
364
364
|
const e = /* @__PURE__ */ new Set(), t = [];
|
|
365
365
|
for (const n of (i == null ? void 0 : i.sources) ?? [])
|
|
366
366
|
n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
|
|
367
367
|
return t;
|
|
368
368
|
}, [i == null ? void 0 : i.sources]), Ot = xs(
|
|
369
|
-
|
|
370
|
-
), sn = P === !0 || Array.isArray(P) &&
|
|
369
|
+
re.length === 1 ? re[0] : null
|
|
370
|
+
), sn = P === !0 || Array.isArray(P) && re.length > 0 && re.every((e) => P.includes(e)), me = (i == null ? void 0 : i.claims_enabled) !== !1, u = i == null ? void 0 : i.display_config, Te = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Aa = (u == null ? void 0 : u.work_next) !== !1, Dt = (u == null ? void 0 : u.bulk_actions) !== !1, cn = Ss(
|
|
371
371
|
[
|
|
372
372
|
...new Set(
|
|
373
373
|
((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -381,7 +381,7 @@ function Wc({
|
|
|
381
381
|
M(() => {
|
|
382
382
|
!i || tr.current || (tr.current = !0, Ue("-priority"));
|
|
383
383
|
}, [i]);
|
|
384
|
-
const [
|
|
384
|
+
const [J, La] = w(!1);
|
|
385
385
|
M(() => {
|
|
386
386
|
i != null && i.display_config && !Te.includes(q) && je(Te[0]);
|
|
387
387
|
}, [i, q, Te]), M(() => {
|
|
@@ -409,16 +409,16 @@ function Wc({
|
|
|
409
409
|
qe.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
|
|
410
410
|
}, 900));
|
|
411
411
|
}, N = (b) => {
|
|
412
|
-
let C = !1, v = 0,
|
|
413
|
-
const
|
|
412
|
+
let C = !1, v = 0, z = !1;
|
|
413
|
+
const X = b.flatMap(
|
|
414
414
|
(T) => T ? Zo(T) : [T]
|
|
415
415
|
);
|
|
416
|
-
for (const T of
|
|
417
|
-
const
|
|
418
|
-
if (T && !T.action && (
|
|
419
|
-
if (
|
|
416
|
+
for (const T of X) {
|
|
417
|
+
const ne = T == null ? void 0 : T.changed_fields, Jt = (T == null ? void 0 : T.collection) != null ? `${T.collection}:${String(T.item)}` : null, ga = Jt != null && Vn.current.has(Jt);
|
|
418
|
+
if (T && !T.action && (ne != null && ne.length) && ne.every((Ne) => Ne.startsWith("$"))) {
|
|
419
|
+
if (ne.includes(Ct.tasks) && n.add("queue-task-counts"), ne.includes(Ct.integrations) && n.add("queue-integrations-summary"), ne.includes(Ct.addendums) && n.add("queue-collection-addendums"), ne.includes(Ct.lock) && Ta((Ne) => Ne + 1), ne.includes(Ct.state)) {
|
|
420
420
|
const Ne = li(ga, ln.current === "kanban");
|
|
421
|
-
|
|
421
|
+
z = !0, Ne.refresh && (C = !0), v += Ne.pill;
|
|
422
422
|
}
|
|
423
423
|
r || (r = setTimeout(() => {
|
|
424
424
|
r = null;
|
|
@@ -427,11 +427,11 @@ function Wc({
|
|
|
427
427
|
}, 300));
|
|
428
428
|
continue;
|
|
429
429
|
}
|
|
430
|
-
|
|
430
|
+
z = !0;
|
|
431
431
|
const Jl = (T == null ? void 0 : T.collection) != null && ls(T.collection, T.item);
|
|
432
432
|
Jt && (ga || (T == null ? void 0 : T.action) === "create" || ln.current === "kanban") ? (C = !0, Jl || At.current.push({ key: Jt, by: null })) : v += 1;
|
|
433
433
|
}
|
|
434
|
-
v > 0 && Et((T) => T + v), C && p(),
|
|
434
|
+
v > 0 && Et((T) => T + v), C && p(), z && m();
|
|
435
435
|
}, k = e(t, (b) => Mo(an, [b ?? {}], N));
|
|
436
436
|
return () => {
|
|
437
437
|
k(), Qo(an), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
|
|
@@ -465,17 +465,17 @@ function Wc({
|
|
|
465
465
|
return e;
|
|
466
466
|
})();
|
|
467
467
|
function Ve(e, t) {
|
|
468
|
-
Q((n) => ({ ...n, [e]: n[e] === t ? "" : t })),
|
|
468
|
+
Q((n) => ({ ...n, [e]: n[e] === t ? "" : t })), O(1);
|
|
469
469
|
}
|
|
470
470
|
function Da(e) {
|
|
471
471
|
Q((t) => {
|
|
472
472
|
const n = t.state, r = Array.isArray(n) ? n : n ? [n] : [], o = r.includes(e) ? r.filter((s) => s !== e) : [...r, e];
|
|
473
473
|
return { ...t, state: o };
|
|
474
|
-
}),
|
|
474
|
+
}), O(1);
|
|
475
475
|
}
|
|
476
476
|
const Ka = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Pa = (e) => !e || Array.isArray(e) && e.length === 0;
|
|
477
477
|
function Ma() {
|
|
478
|
-
Q({ ...ue.current }),
|
|
478
|
+
Q({ ...ue.current }), Y("all"), O(1);
|
|
479
479
|
}
|
|
480
480
|
const [dt, Qa] = w(() => {
|
|
481
481
|
try {
|
|
@@ -503,10 +503,10 @@ function Wc({
|
|
|
503
503
|
digest_frequency: "instant"
|
|
504
504
|
})
|
|
505
505
|
)).then(() => {
|
|
506
|
-
|
|
506
|
+
D.success(
|
|
507
507
|
t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
|
|
508
508
|
), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
|
|
509
|
-
}).catch((r) =>
|
|
509
|
+
}).catch((r) => D.error($t(r, "Failed")));
|
|
510
510
|
}, [rr, un] = w(null), mn = [
|
|
511
511
|
...new Set(
|
|
512
512
|
((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -530,10 +530,10 @@ function Wc({
|
|
|
530
530
|
staleTime: 6e4
|
|
531
531
|
}), Ia = (e) => Ua[e] ?? [], Va = (e, t) => {
|
|
532
532
|
h.request(se(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
|
|
533
|
-
|
|
533
|
+
D.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
534
534
|
}).catch((n) => {
|
|
535
535
|
const r = n.response;
|
|
536
|
-
|
|
536
|
+
D.error((r == null ? void 0 : r.error) ?? $t(n, `${e.label} failed`));
|
|
537
537
|
});
|
|
538
538
|
}, { data: pn = [] } = W({
|
|
539
539
|
queryKey: ["queue-triage-labels", l],
|
|
@@ -548,7 +548,7 @@ function Wc({
|
|
|
548
548
|
})
|
|
549
549
|
).then(() => {
|
|
550
550
|
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
|
|
551
|
-
}).catch((n) =>
|
|
551
|
+
}).catch((n) => D.error($t(n, "Label failed")));
|
|
552
552
|
}, {
|
|
553
553
|
data: c,
|
|
554
554
|
isLoading: lr,
|
|
@@ -593,7 +593,7 @@ function Wc({
|
|
|
593
593
|
// first fetch went out WITHOUT the seeded scope and refired ~350ms later
|
|
594
594
|
// with it (3.3s + 8.7s of work for one page). The first fetch now also
|
|
595
595
|
// waits for the debounced copy to settle; later typing still debounces.
|
|
596
|
-
enabled: !!l &&
|
|
596
|
+
enabled: !!l && J && Xn && (dn.current || Oa),
|
|
597
597
|
// Keep the previous page rendered while a sort/filter/page change refetches —
|
|
598
598
|
// swapping to skeletons collapsed the table height and jittered the page.
|
|
599
599
|
placeholderData: (e) => e
|
|
@@ -624,7 +624,7 @@ function Wc({
|
|
|
624
624
|
const t = { ...e };
|
|
625
625
|
for (const n of Ge) delete t[n];
|
|
626
626
|
return t;
|
|
627
|
-
}),
|
|
627
|
+
}), O(1);
|
|
628
628
|
};
|
|
629
629
|
M(() => {
|
|
630
630
|
if (typeof window > "u" || !ce) return;
|
|
@@ -640,7 +640,7 @@ function Wc({
|
|
|
640
640
|
}, r = t.find((o) => o.queue === l);
|
|
641
641
|
t.push(n), t.length > 50 && t.shift(), r && r !== n && ce - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
|
|
642
642
|
}, [ce]);
|
|
643
|
-
const We = lr && !c || !
|
|
643
|
+
const We = lr && !c || !J || !Xn && !c, ur = (ut && !lr || Ga && ut) && !qe.current, Ja = V(
|
|
644
644
|
() => (Ee ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
645
645
|
[Ee, c == null ? void 0 : c.data]
|
|
646
646
|
), za = ss(Ja), Pt = mi(), mr = Eo(ut && !qe.current), Xa = Ao({
|
|
@@ -677,7 +677,7 @@ function Wc({
|
|
|
677
677
|
f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
678
678
|
},
|
|
679
679
|
onError: (e) => {
|
|
680
|
-
|
|
680
|
+
D.error($t(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
681
681
|
}
|
|
682
682
|
}), Ae = Se({
|
|
683
683
|
mutationFn: (e) => h.request(
|
|
@@ -687,7 +687,7 @@ function Wc({
|
|
|
687
687
|
})
|
|
688
688
|
),
|
|
689
689
|
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
690
|
-
onError: () =>
|
|
690
|
+
onError: () => D.error("Failed to claim item")
|
|
691
691
|
}), He = Se({
|
|
692
692
|
mutationFn: (e) => h.request(
|
|
693
693
|
se(`/queues/${l}/release`, {
|
|
@@ -696,7 +696,7 @@ function Wc({
|
|
|
696
696
|
})
|
|
697
697
|
),
|
|
698
698
|
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
699
|
-
onError: () =>
|
|
699
|
+
onError: () => D.error("Failed to release item")
|
|
700
700
|
}), { data: Ye } = W({
|
|
701
701
|
queryKey: ["queue-column-prefs", l],
|
|
702
702
|
queryFn: () => h.request(A(`/queues/${l}/column-prefs`)),
|
|
@@ -769,7 +769,7 @@ function Wc({
|
|
|
769
769
|
staleTime: Number.POSITIVE_INFINITY,
|
|
770
770
|
placeholderData: (e) => e,
|
|
771
771
|
retry: !1
|
|
772
|
-
}), gn = !!jt && ll > ce, x = gn ? jt.stats : c == null ? void 0 : c.stats,
|
|
772
|
+
}), gn = !!jt && ll > ce, x = gn ? jt.stats : c == null ? void 0 : c.stats, Z = gn ? jt.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, hr = gn ? jt.state_counts : c == null ? void 0 : c.state_counts;
|
|
773
773
|
Vn.current = new Set(F.map((e) => `${e.collection}:${e.item_id}`));
|
|
774
774
|
const bt = ts(
|
|
775
775
|
F.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
@@ -1041,7 +1041,7 @@ function Wc({
|
|
|
1041
1041
|
function qr(e) {
|
|
1042
1042
|
const t = e ? oe.findIndex((r) => K(r) === K(e)) + 1 : 0, n = oe.slice(t).find(hl);
|
|
1043
1043
|
if (!n) {
|
|
1044
|
-
Nn(!1), Oe(null),
|
|
1044
|
+
Nn(!1), Oe(null), D.info("Nothing left to work on — queue clear!");
|
|
1045
1045
|
return;
|
|
1046
1046
|
}
|
|
1047
1047
|
if (It(K(n)), me && !n.claimed_by && Ae.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
|
|
@@ -1083,7 +1083,7 @@ function Wc({
|
|
|
1083
1083
|
}), [Xe, Ze] = w(null), [fl, Cn] = w(!1), [$n, Fr] = w(""), [Tr, Rr] = w(!1), [kt, Er] = w(!1);
|
|
1084
1084
|
function vt(e) {
|
|
1085
1085
|
const t = e.state ?? {};
|
|
1086
|
-
|
|
1086
|
+
Y(t.scope ?? "all"), Q({ ...ue.current, ...t.filters ?? {} }), Ue(t.sort ?? ""), ot(t.group_by ?? null), Qt(t.columns ?? null), tn(t.pins ?? null), t.view && je(Te.includes(t.view) ? t.view : Te[0]), O(1), Ze(e.id);
|
|
1087
1087
|
}
|
|
1088
1088
|
function gl() {
|
|
1089
1089
|
var t, n;
|
|
@@ -1092,23 +1092,34 @@ function Wc({
|
|
|
1092
1092
|
vt(e);
|
|
1093
1093
|
return;
|
|
1094
1094
|
}
|
|
1095
|
-
|
|
1095
|
+
Y(((t = i == null ? void 0 : i.display_config) == null ? void 0 : t.default_scope) ?? "all"), Q({ ...ue.current }), Ue(""), ot(null), Qt(null), tn(null), (n = i == null ? void 0 : i.display_config) != null && n.default_view && je(i.display_config.default_view), O(1), Ze(null);
|
|
1096
1096
|
}
|
|
1097
1097
|
M(() => {
|
|
1098
|
-
if (
|
|
1098
|
+
if (J || !(i != null && i.display_config) || Ye === void 0 || j === void 0) return;
|
|
1099
1099
|
const e = Ye.data.default_view_id, t = e != null ? j.data.find((r) => r.id === e) : void 0, n = j.data.find((r) => r.is_default);
|
|
1100
|
-
t ? vt(t) : n ? vt(n) : (je(i.display_config.default_view),
|
|
1101
|
-
}, [i, Ye, j,
|
|
1100
|
+
t ? vt(t) : n ? vt(n) : (je(i.display_config.default_view), Y(i.display_config.default_scope)), La(!0);
|
|
1101
|
+
}, [i, Ye, j, J]);
|
|
1102
1102
|
const Gt = U(null), Wt = U(null);
|
|
1103
1103
|
M(() => {
|
|
1104
|
-
if (!
|
|
1104
|
+
if (!J) return;
|
|
1105
1105
|
const e = Ms();
|
|
1106
1106
|
if (!(e != null && e.restore) || e.queue_id !== l) return;
|
|
1107
1107
|
Na({ ...e, restore: !1 });
|
|
1108
1108
|
const t = e.state ?? {};
|
|
1109
|
-
t.scope &&
|
|
1110
|
-
}, [
|
|
1111
|
-
if (!
|
|
1109
|
+
t.scope && Y(t.scope), t.filters && Q({ ...ue.current, ...t.filters }), t.sort != null && Ue(t.sort), ot(t.group_by ?? null), t.view && je(t.view), t.page && O(t.page), Wt.current = e.scroll ?? 0;
|
|
1110
|
+
}, [J, l]), M(() => {
|
|
1111
|
+
if (!J || typeof window > "u") return;
|
|
1112
|
+
const e = new URLSearchParams(window.location.search), t = e.get("scope");
|
|
1113
|
+
if (t !== "all" && t !== "mine") return;
|
|
1114
|
+
e.delete("scope");
|
|
1115
|
+
const n = e.toString();
|
|
1116
|
+
window.history.replaceState(
|
|
1117
|
+
window.history.state,
|
|
1118
|
+
"",
|
|
1119
|
+
`${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
|
|
1120
|
+
), Y(t), O(1);
|
|
1121
|
+
}, [J]), M(() => {
|
|
1122
|
+
if (!J || typeof window > "u") return;
|
|
1112
1123
|
const e = new URLSearchParams(window.location.search), t = e.get("owner");
|
|
1113
1124
|
if (!t) return;
|
|
1114
1125
|
e.delete("owner");
|
|
@@ -1117,16 +1128,16 @@ function Wc({
|
|
|
1117
1128
|
window.history.state,
|
|
1118
1129
|
"",
|
|
1119
1130
|
`${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
|
|
1120
|
-
),
|
|
1121
|
-
}, [
|
|
1122
|
-
if (!
|
|
1131
|
+
), Y("all"), Q((r) => ({ ...r, owners: [t] })), Ze(null), O(1);
|
|
1132
|
+
}, [J]), M(() => {
|
|
1133
|
+
if (!J) return;
|
|
1123
1134
|
const e = Jo(zo(`queue:${l}`));
|
|
1124
1135
|
e && (Xo(), vt({
|
|
1125
1136
|
id: -1,
|
|
1126
1137
|
// Saved views type filters loosely as strings; multi-selects ride as arrays there too.
|
|
1127
1138
|
state: e
|
|
1128
|
-
}), Ze(null), e.page &&
|
|
1129
|
-
}, [
|
|
1139
|
+
}), Ze(null), e.page && O(e.page));
|
|
1140
|
+
}, [J]);
|
|
1130
1141
|
const xl = () => ({
|
|
1131
1142
|
scope: g,
|
|
1132
1143
|
filters: _,
|
|
@@ -1152,9 +1163,9 @@ function Wc({
|
|
|
1152
1163
|
) : e.at_risk ? bs(e.at_risk_color ?? "red") : void 0, Lr = De || (i == null ? void 0 : i.owner) != null && i.owner === S, wl = Se({
|
|
1153
1164
|
mutationFn: ({ viewId: e, on: t }) => h.request(wa(`/queues/views/${e}`, { is_default: t })),
|
|
1154
1165
|
onSuccess: () => {
|
|
1155
|
-
f.invalidateQueries({ queryKey: ["queue-views", l] }),
|
|
1166
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), D.success("Queue default view updated");
|
|
1156
1167
|
},
|
|
1157
|
-
onError: () =>
|
|
1168
|
+
onError: () => D.error("Could not update the queue default view")
|
|
1158
1169
|
}), Or = Se({
|
|
1159
1170
|
mutationFn: () => h.request(
|
|
1160
1171
|
se(`/queues/${l}/views`, {
|
|
@@ -1173,9 +1184,9 @@ function Wc({
|
|
|
1173
1184
|
})
|
|
1174
1185
|
),
|
|
1175
1186
|
onSuccess: (e) => {
|
|
1176
|
-
Cn(!1), Fr(""), Rr(!1), Er(!1), Ze(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }),
|
|
1187
|
+
Cn(!1), Fr(""), Rr(!1), Er(!1), Ze(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), D.success("View saved");
|
|
1177
1188
|
},
|
|
1178
|
-
onError: () =>
|
|
1189
|
+
onError: () => D.error("Failed to save view")
|
|
1179
1190
|
}), [Dr, Kr] = w(null), Ke = Se({
|
|
1180
1191
|
mutationFn: (e) => h.request(
|
|
1181
1192
|
wa(`/queues/views/${e.id}`, {
|
|
@@ -1191,9 +1202,9 @@ function Wc({
|
|
|
1191
1202
|
})
|
|
1192
1203
|
),
|
|
1193
1204
|
onSuccess: (e, t) => {
|
|
1194
|
-
f.invalidateQueries({ queryKey: ["queue-views", l] }), Kr(t.id), setTimeout(() => Kr((n) => n === t.id ? null : n), 2e3),
|
|
1205
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), Kr(t.id), setTimeout(() => Kr((n) => n === t.id ? null : n), 2e3), D.success(`Saved "${t.name}" with the current filters, scope and sort`);
|
|
1195
1206
|
},
|
|
1196
|
-
onError: () =>
|
|
1207
|
+
onError: () => D.error("Failed to update view")
|
|
1197
1208
|
}), [qn, Ht] = w(null);
|
|
1198
1209
|
M(() => {
|
|
1199
1210
|
if (qn == null) return;
|
|
@@ -1205,24 +1216,24 @@ function Wc({
|
|
|
1205
1216
|
onSuccess: (e, t) => {
|
|
1206
1217
|
Ht(null), f.invalidateQueries({ queryKey: ["queue-views", l] }), Ze(null), Je === t && bn(null);
|
|
1207
1218
|
},
|
|
1208
|
-
onError: () =>
|
|
1219
|
+
onError: () => D.error("Failed to delete view")
|
|
1209
1220
|
}), _l = Se({
|
|
1210
1221
|
mutationFn: (e) => h.request(Oo(`/queues/${l}/default-view`, { view_id: e })),
|
|
1211
1222
|
onMutate: (e) => bn(e),
|
|
1212
1223
|
onSuccess: (e, t) => {
|
|
1213
|
-
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }),
|
|
1224
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), D.success(
|
|
1214
1225
|
t === null ? "Reverted to the general default" : "Set as your default view"
|
|
1215
1226
|
);
|
|
1216
1227
|
},
|
|
1217
1228
|
onError: () => {
|
|
1218
|
-
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }),
|
|
1229
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), D.error("Failed to update default view");
|
|
1219
1230
|
}
|
|
1220
|
-
}), [Pe, et] = w([]), [
|
|
1221
|
-
|
|
1231
|
+
}), [Pe, et] = w([]), [ee, Mr] = w(!1), Nl = () => {
|
|
1232
|
+
ee && et([]), Mr(!ee);
|
|
1222
1233
|
};
|
|
1223
1234
|
M(() => {
|
|
1224
|
-
q !== "table" &&
|
|
1225
|
-
}, [q,
|
|
1235
|
+
q !== "table" && ee && (Mr(!1), et([]));
|
|
1236
|
+
}, [q, ee]), Lo(), Yn.current = Pe.length;
|
|
1226
1237
|
const [Qr, Br] = w(!1);
|
|
1227
1238
|
async function Fn(e, t) {
|
|
1228
1239
|
const n = F.filter((m) => Pe.includes(K(m)));
|
|
@@ -1230,7 +1241,7 @@ function Wc({
|
|
|
1230
1241
|
const r = await Promise.allSettled(n.map(t));
|
|
1231
1242
|
Pt.endBatch();
|
|
1232
1243
|
const o = r.filter((m) => m.status === "fulfilled").length, s = r.length - o;
|
|
1233
|
-
Br(!1), et([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ?
|
|
1244
|
+
Br(!1), et([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? D.warning(`${e}: ${o} succeeded, ${s} failed`) : D.success(`${e}: ${o} succeeded`);
|
|
1234
1245
|
}
|
|
1235
1246
|
const Me = (e) => {
|
|
1236
1247
|
var t;
|
|
@@ -1574,7 +1585,7 @@ function Wc({
|
|
|
1574
1585
|
var r, o, s;
|
|
1575
1586
|
return n === "m2o" ? ((o = (r = e.extra_ids) == null ? void 0 : r[t]) == null ? void 0 : o[0]) ?? null : ((s = e.extra) == null ? void 0 : s[t]) ?? null;
|
|
1576
1587
|
}, Ol = (e, t, n, r, o) => {
|
|
1577
|
-
const s = (b) => `${K(e)}|${b}`, m = [...
|
|
1588
|
+
const s = (b) => `${K(e)}|${b}`, m = [...te].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!Wr(e, b)), p = o === 0 ? null : Yo(m, t, o), N = (b) => b.collection === e.collection && b.item_id === e.item_id, k = (b) => N(b) ? n === "m2o" ? {
|
|
1578
1589
|
...b,
|
|
1579
1590
|
extra_ids: { ...b.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
|
|
1580
1591
|
} : { ...b, extra: { ...b.extra ?? {}, [t]: r } } : b;
|
|
@@ -1686,10 +1697,10 @@ function Wc({
|
|
|
1686
1697
|
"sla_status",
|
|
1687
1698
|
"at_risk",
|
|
1688
1699
|
...wt.slice(0, 2).map((e) => `extra.${e}`)
|
|
1689
|
-
], Ql = (u == null ? void 0 : u.default_columns) ?? null, An = Mt ?? Ql,
|
|
1690
|
-
ze && !Rt.has("addendums") &&
|
|
1700
|
+
], Ql = (u == null ? void 0 : u.default_columns) ?? null, An = Mt ?? Ql, te = new Set(An ?? Ml);
|
|
1701
|
+
ze && !Rt.has("addendums") && te.add("addendums"), mt && !Rt.has("fulfilment") && te.add("fulfilment"), ve && !Rt.has("integrations") && te.add("integrations"), pt && !Rt.has("send_backs") && te.add("send_backs");
|
|
1691
1702
|
const Bl = new Set(De ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
|
|
1692
|
-
for (const e of Bl)
|
|
1703
|
+
for (const e of Bl) te.delete(e);
|
|
1693
1704
|
const Nt = [
|
|
1694
1705
|
...(An ?? []).filter((e) => Yr.includes(e)),
|
|
1695
1706
|
...Yr.filter((e) => !(An ?? []).includes(e))
|
|
@@ -1699,7 +1710,7 @@ function Wc({
|
|
|
1699
1710
|
if (!n || t.id === n.id) return;
|
|
1700
1711
|
const r = Nt.indexOf(String(t.id)), o = Nt.indexOf(String(n.id));
|
|
1701
1712
|
r === -1 || o === -1 || Qt(
|
|
1702
|
-
ao(Nt, r, o).filter((s) =>
|
|
1713
|
+
ao(Nt, r, o).filter((s) => te.has(s))
|
|
1703
1714
|
);
|
|
1704
1715
|
}
|
|
1705
1716
|
const Jr = Ur.find((e) => e.key === "label"), Il = {
|
|
@@ -1732,7 +1743,7 @@ function Wc({
|
|
|
1732
1743
|
const t = (n = Ln.find((r) => r.key === e)) == null ? void 0 : n.header;
|
|
1733
1744
|
return typeof t == "string" ? t : e;
|
|
1734
1745
|
},
|
|
1735
|
-
|
|
1746
|
+
te
|
|
1736
1747
|
), Gl = {
|
|
1737
1748
|
key: "__actions__",
|
|
1738
1749
|
header: "",
|
|
@@ -1747,17 +1758,17 @@ function Wc({
|
|
|
1747
1758
|
urlFor: H.urlFor,
|
|
1748
1759
|
onDeleted: () => {
|
|
1749
1760
|
h.request(Mn(`/items/${e.collection}/${e.item_id}`)).then(() => {
|
|
1750
|
-
|
|
1751
|
-
}).catch((t) =>
|
|
1761
|
+
D.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
1762
|
+
}).catch((t) => D.error($t(t, "Delete failed")));
|
|
1752
1763
|
},
|
|
1753
1764
|
onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
1754
1765
|
bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
|
|
1755
|
-
disabled:
|
|
1766
|
+
disabled: ee
|
|
1756
1767
|
}
|
|
1757
1768
|
) })
|
|
1758
1769
|
}, Yt = [
|
|
1759
1770
|
Il,
|
|
1760
|
-
...Nt.filter((e) =>
|
|
1771
|
+
...Nt.filter((e) => te.has(e)).map((e) => Ln.find((t) => t.key === e)).filter((e) => e !== void 0),
|
|
1761
1772
|
...me ? [$l] : [],
|
|
1762
1773
|
Gl
|
|
1763
1774
|
], Xr = V(() => {
|
|
@@ -1771,7 +1782,7 @@ function Wc({
|
|
|
1771
1782
|
{ value: "at_risk", label: "At risk" },
|
|
1772
1783
|
{ value: "owners", label: "Owner" },
|
|
1773
1784
|
{ value: "aging", label: "Aging" },
|
|
1774
|
-
...wt.filter((e) =>
|
|
1785
|
+
...wt.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: E(`extra.${e}`, lt(e)) }))
|
|
1775
1786
|
], ea = (e) => async (t, n) => {
|
|
1776
1787
|
if (!e.target_collection || !e.display_field) return [];
|
|
1777
1788
|
const r = {
|
|
@@ -1792,10 +1803,10 @@ function Wc({
|
|
|
1792
1803
|
A(`/items/${e.target_collection}`, r)
|
|
1793
1804
|
)).data ?? [], N = Me(e.path), k = Fe[e.path] ? new Set(Fe[e.path]) : null, b = /* @__PURE__ */ new Set(), C = [];
|
|
1794
1805
|
for (const v of p) {
|
|
1795
|
-
const
|
|
1796
|
-
if (
|
|
1797
|
-
const
|
|
1798
|
-
b.has(
|
|
1806
|
+
const z = v[e.display_field];
|
|
1807
|
+
if (z == null || z === "") continue;
|
|
1808
|
+
const X = String(z);
|
|
1809
|
+
b.has(X) || k && !k.has(X) || (b.add(X), C.push({ label: N ? tt(X, N) : X, value: X }));
|
|
1799
1810
|
}
|
|
1800
1811
|
return C;
|
|
1801
1812
|
}, On = new Map(((i == null ? void 0 : i.extra_field_meta) ?? []).map((e) => [e.path, e])), Qe = [
|
|
@@ -1960,7 +1971,7 @@ function Wc({
|
|
|
1960
1971
|
} : { ...r, placeholder: `Search ${n}…`, type: "text" };
|
|
1961
1972
|
})
|
|
1962
1973
|
], Dn = Qe.filter(
|
|
1963
|
-
(e) =>
|
|
1974
|
+
(e) => te.has(e.key) || e.key === "label" || e.key === "owners"
|
|
1964
1975
|
), Kn = (e) => {
|
|
1965
1976
|
var t;
|
|
1966
1977
|
return (((t = Qe.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
|
|
@@ -1975,7 +1986,7 @@ function Wc({
|
|
|
1975
1986
|
value: s,
|
|
1976
1987
|
optionLabel: (b) => {
|
|
1977
1988
|
var C, v;
|
|
1978
|
-
return (v = (C = m == null ? void 0 : m.options) == null ? void 0 : C.find((
|
|
1989
|
+
return (v = (C = m == null ? void 0 : m.options) == null ? void 0 : C.find((z) => z.value === b)) == null ? void 0 : v.label;
|
|
1979
1990
|
},
|
|
1980
1991
|
currency: (N == null ? void 0 : N.type) === "number" && N.prefix === "$",
|
|
1981
1992
|
rangeUnit: m == null ? void 0 : m.range_unit
|
|
@@ -2000,22 +2011,22 @@ function Wc({
|
|
|
2000
2011
|
(() => {
|
|
2001
2012
|
var o;
|
|
2002
2013
|
const e = (s) => {
|
|
2003
|
-
var
|
|
2014
|
+
var z, X, T;
|
|
2004
2015
|
if (!s.key.startsWith("extra.")) return null;
|
|
2005
2016
|
if (s.type === "combobox") return s;
|
|
2006
2017
|
const m = s.key.slice(6), p = On.get(m), N = St.has(s.key);
|
|
2007
2018
|
if ((p == null ? void 0 : p.kind) !== "relation" && !N) return null;
|
|
2008
|
-
const k = Me(m), b = (
|
|
2019
|
+
const k = Me(m), b = (z = c == null ? void 0 : c.available_values.extra) == null ? void 0 : z[m], C = s.placeholder.replace(/^Search (.*)…$/, "$1"), v = (p == null ? void 0 : p.kind) === "relation" && p.target_collection && p.display_field ? { collection: p.target_collection, field: p.display_field } : void 0;
|
|
2009
2020
|
return b != null && b.length ? {
|
|
2010
2021
|
key: s.key,
|
|
2011
2022
|
placeholder: C,
|
|
2012
2023
|
type: "combobox",
|
|
2013
2024
|
multi: !0,
|
|
2014
2025
|
cascade: v,
|
|
2015
|
-
restricted: !!((
|
|
2016
|
-
options: b.map((
|
|
2017
|
-
label: k && k.type !== "number" ? tt(
|
|
2018
|
-
value:
|
|
2026
|
+
restricted: !!((X = Fe[m]) != null && X.length),
|
|
2027
|
+
options: b.map((ne) => ({
|
|
2028
|
+
label: k && k.type !== "number" ? tt(ne, k) : ne,
|
|
2029
|
+
value: ne
|
|
2019
2030
|
}))
|
|
2020
2031
|
} : (p == null ? void 0 : p.kind) === "relation" ? {
|
|
2021
2032
|
key: s.key,
|
|
@@ -2036,10 +2047,10 @@ function Wc({
|
|
|
2036
2047
|
k = Qe.find((b) => b.key === "state");
|
|
2037
2048
|
else {
|
|
2038
2049
|
const b = Qe.filter((v) => {
|
|
2039
|
-
var
|
|
2050
|
+
var X;
|
|
2040
2051
|
if (!v.key.startsWith("extra.") || m.has(v.key)) return !1;
|
|
2041
|
-
const
|
|
2042
|
-
return ((
|
|
2052
|
+
const z = v.key.slice(6);
|
|
2053
|
+
return ((X = On.get(z)) == null ? void 0 : X.target_collection) === p.collection;
|
|
2043
2054
|
}), C = b.find((v) => v.key.slice(6).startsWith(`${N}.`)) ?? b[0];
|
|
2044
2055
|
k = C ? e(C) : null;
|
|
2045
2056
|
}
|
|
@@ -2057,7 +2068,7 @@ function Wc({
|
|
|
2057
2068
|
})()
|
|
2058
2069
|
), Hl = (() => {
|
|
2059
2070
|
if (!x) return null;
|
|
2060
|
-
const e =
|
|
2071
|
+
const e = Z ?? x, t = [
|
|
2061
2072
|
{
|
|
2062
2073
|
key: "breached",
|
|
2063
2074
|
n: e.sla_breached,
|
|
@@ -2089,7 +2100,7 @@ function Wc({
|
|
|
2089
2100
|
tone: "text-slate-600 dark:text-slate-300",
|
|
2090
2101
|
on: g === "unowned",
|
|
2091
2102
|
toggle: () => {
|
|
2092
|
-
|
|
2103
|
+
Y(g === "unowned" ? "all" : "unowned"), O(1);
|
|
2093
2104
|
}
|
|
2094
2105
|
}
|
|
2095
2106
|
].filter((n) => n.n > 0 || n.on);
|
|
@@ -2128,7 +2139,7 @@ function Wc({
|
|
|
2128
2139
|
);
|
|
2129
2140
|
})();
|
|
2130
2141
|
function Yl(e) {
|
|
2131
|
-
const t = new Set(
|
|
2142
|
+
const t = new Set(te);
|
|
2132
2143
|
t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && In((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && In((n) => {
|
|
2133
2144
|
const r = new Set(n);
|
|
2134
2145
|
return r.delete(e), r;
|
|
@@ -2146,13 +2157,13 @@ function Wc({
|
|
|
2146
2157
|
className: "flex flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-4 py-2.5 dark:border-slate-700 dark:bg-slate-900",
|
|
2147
2158
|
"data-queue-toolbar": !0,
|
|
2148
2159
|
children: [
|
|
2149
|
-
|
|
2160
|
+
J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: fi.filter((e) => me || e.value !== "claimed").map(
|
|
2150
2161
|
(e, t) => /* @__PURE__ */ a(
|
|
2151
2162
|
"button",
|
|
2152
2163
|
{
|
|
2153
2164
|
type: "button",
|
|
2154
2165
|
onClick: () => {
|
|
2155
|
-
|
|
2166
|
+
Y(e.value), O(1);
|
|
2156
2167
|
},
|
|
2157
2168
|
className: R(
|
|
2158
2169
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
@@ -2164,7 +2175,7 @@ function Wc({
|
|
|
2164
2175
|
e.value
|
|
2165
2176
|
)
|
|
2166
2177
|
) }) : /* @__PURE__ */ a("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
2167
|
-
|
|
2178
|
+
J ? Te.length <= 1 ? null : (
|
|
2168
2179
|
// One allowed view means nothing to switch to — no button.
|
|
2169
2180
|
/* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
|
|
2170
2181
|
{ value: "table", label: "Table" },
|
|
@@ -2286,7 +2297,7 @@ function Wc({
|
|
|
2286
2297
|
{
|
|
2287
2298
|
type: "button",
|
|
2288
2299
|
onClick: () => {
|
|
2289
|
-
Ue(I === "-priority" ? "" : "-priority"),
|
|
2300
|
+
Ue(I === "-priority" ? "" : "-priority"), O(1);
|
|
2290
2301
|
},
|
|
2291
2302
|
className: R(
|
|
2292
2303
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
@@ -2388,7 +2399,7 @@ function Wc({
|
|
|
2388
2399
|
{
|
|
2389
2400
|
id: e,
|
|
2390
2401
|
label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
|
|
2391
|
-
checked:
|
|
2402
|
+
checked: te.has(e),
|
|
2392
2403
|
onCheckedChange: () => Yl(e)
|
|
2393
2404
|
},
|
|
2394
2405
|
e
|
|
@@ -2402,13 +2413,13 @@ function Wc({
|
|
|
2402
2413
|
{
|
|
2403
2414
|
type: "button",
|
|
2404
2415
|
onClick: Nl,
|
|
2405
|
-
"aria-pressed":
|
|
2406
|
-
"data-queue-bulk-mode":
|
|
2407
|
-
"data-tip":
|
|
2408
|
-
className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${
|
|
2416
|
+
"aria-pressed": ee,
|
|
2417
|
+
"data-queue-bulk-mode": ee ? "on" : "off",
|
|
2418
|
+
"data-tip": ee ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
|
|
2419
|
+
className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${ee ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted"}`,
|
|
2409
2420
|
children: [
|
|
2410
2421
|
/* @__PURE__ */ a(fo, { className: "h-3.5 w-3.5" }),
|
|
2411
|
-
|
|
2422
|
+
ee ? "Done" : "Bulk select"
|
|
2412
2423
|
]
|
|
2413
2424
|
}
|
|
2414
2425
|
),
|
|
@@ -2442,7 +2453,7 @@ function Wc({
|
|
|
2442
2453
|
]
|
|
2443
2454
|
}
|
|
2444
2455
|
),
|
|
2445
|
-
!sn &&
|
|
2456
|
+
!sn && re.length === 1 && (Ot ? /* @__PURE__ */ d(nt, { children: [
|
|
2446
2457
|
/* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2447
2458
|
"button",
|
|
2448
2459
|
{
|
|
@@ -2451,7 +2462,7 @@ function Wc({
|
|
|
2451
2462
|
children: [
|
|
2452
2463
|
/* @__PURE__ */ a(zt, { className: "h-3.5 w-3.5" }),
|
|
2453
2464
|
"New ",
|
|
2454
|
-
Qn(
|
|
2465
|
+
Qn(re[0]),
|
|
2455
2466
|
/* @__PURE__ */ a(ya, { className: "h-3 w-3 opacity-60" })
|
|
2456
2467
|
]
|
|
2457
2468
|
}
|
|
@@ -2462,7 +2473,7 @@ function Wc({
|
|
|
2462
2473
|
{
|
|
2463
2474
|
type: "button",
|
|
2464
2475
|
onClick: () => H.open({
|
|
2465
|
-
collection:
|
|
2476
|
+
collection: re[0],
|
|
2466
2477
|
itemId: "new",
|
|
2467
2478
|
// Same layout the queue opens existing records with.
|
|
2468
2479
|
layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
|
|
@@ -2479,7 +2490,7 @@ function Wc({
|
|
|
2479
2490
|
{
|
|
2480
2491
|
type: "button",
|
|
2481
2492
|
onClick: () => H.open({
|
|
2482
|
-
collection:
|
|
2493
|
+
collection: re[0],
|
|
2483
2494
|
itemId: "new",
|
|
2484
2495
|
layoutSlug: e.slug
|
|
2485
2496
|
}),
|
|
@@ -2494,7 +2505,7 @@ function Wc({
|
|
|
2494
2505
|
{
|
|
2495
2506
|
type: "button",
|
|
2496
2507
|
onClick: () => H.open({
|
|
2497
|
-
collection:
|
|
2508
|
+
collection: re[0],
|
|
2498
2509
|
itemId: "new",
|
|
2499
2510
|
// Open a new record on the same layout the queue opens
|
|
2500
2511
|
// existing ones with, so creating and reviewing match.
|
|
@@ -2504,11 +2515,11 @@ function Wc({
|
|
|
2504
2515
|
children: [
|
|
2505
2516
|
/* @__PURE__ */ a(zt, { className: "h-3.5 w-3.5" }),
|
|
2506
2517
|
"New ",
|
|
2507
|
-
Qn(
|
|
2518
|
+
Qn(re[0])
|
|
2508
2519
|
]
|
|
2509
2520
|
}
|
|
2510
2521
|
)),
|
|
2511
|
-
!sn &&
|
|
2522
|
+
!sn && re.length > 1 && /* @__PURE__ */ d(nt, { children: [
|
|
2512
2523
|
/* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2513
2524
|
"button",
|
|
2514
2525
|
{
|
|
@@ -2521,7 +2532,7 @@ function Wc({
|
|
|
2521
2532
|
]
|
|
2522
2533
|
}
|
|
2523
2534
|
) }),
|
|
2524
|
-
/* @__PURE__ */ a(at, { align: "end", className: "w-56 p-1", children:
|
|
2535
|
+
/* @__PURE__ */ a(at, { align: "end", className: "w-56 p-1", children: re.map((e) => /* @__PURE__ */ d(
|
|
2525
2536
|
"button",
|
|
2526
2537
|
{
|
|
2527
2538
|
type: "button",
|
|
@@ -2564,7 +2575,7 @@ function Wc({
|
|
|
2564
2575
|
{
|
|
2565
2576
|
label: "Total",
|
|
2566
2577
|
count: (x == null ? void 0 : x.total) ?? 0,
|
|
2567
|
-
filteredCount:
|
|
2578
|
+
filteredCount: Z ? Z.total : null,
|
|
2568
2579
|
active: Object.values(_).every(Pa) && g === "all",
|
|
2569
2580
|
isLoading: We,
|
|
2570
2581
|
...ht("total"),
|
|
@@ -2576,7 +2587,7 @@ function Wc({
|
|
|
2576
2587
|
{
|
|
2577
2588
|
label: "Warning",
|
|
2578
2589
|
count: (x == null ? void 0 : x.sla_warning) ?? 0,
|
|
2579
|
-
filteredCount:
|
|
2590
|
+
filteredCount: Z ? Z.sla_warning : null,
|
|
2580
2591
|
tone: "amber",
|
|
2581
2592
|
active: _.sla_status === "warning",
|
|
2582
2593
|
isLoading: We,
|
|
@@ -2590,7 +2601,7 @@ function Wc({
|
|
|
2590
2601
|
{
|
|
2591
2602
|
label: "Breached",
|
|
2592
2603
|
count: (x == null ? void 0 : x.sla_breached) ?? 0,
|
|
2593
|
-
filteredCount:
|
|
2604
|
+
filteredCount: Z ? Z.sla_breached : null,
|
|
2594
2605
|
tone: "red",
|
|
2595
2606
|
active: _.sla_status === "breached",
|
|
2596
2607
|
isLoading: We,
|
|
@@ -2604,7 +2615,7 @@ function Wc({
|
|
|
2604
2615
|
{
|
|
2605
2616
|
label: "At Risk",
|
|
2606
2617
|
count: (x == null ? void 0 : x.at_risk) ?? 0,
|
|
2607
|
-
filteredCount:
|
|
2618
|
+
filteredCount: Z ? Z.at_risk : null,
|
|
2608
2619
|
tone: "red",
|
|
2609
2620
|
active: _.at_risk === "yes",
|
|
2610
2621
|
isLoading: We,
|
|
@@ -2618,13 +2629,13 @@ function Wc({
|
|
|
2618
2629
|
{
|
|
2619
2630
|
label: "Unowned",
|
|
2620
2631
|
count: (x == null ? void 0 : x.unowned) ?? 0,
|
|
2621
|
-
filteredCount:
|
|
2632
|
+
filteredCount: Z ? Z.unowned : null,
|
|
2622
2633
|
active: g === "unowned",
|
|
2623
2634
|
isLoading: We,
|
|
2624
2635
|
deltaBadIsUp: !0,
|
|
2625
2636
|
...ht("unowned"),
|
|
2626
2637
|
onClick: () => {
|
|
2627
|
-
|
|
2638
|
+
Y(g === "unowned" ? "all" : "unowned"), O(1);
|
|
2628
2639
|
}
|
|
2629
2640
|
}
|
|
2630
2641
|
)
|
|
@@ -2642,7 +2653,7 @@ function Wc({
|
|
|
2642
2653
|
Q((r) => ({
|
|
2643
2654
|
...r,
|
|
2644
2655
|
aging_hours: r.aging_hours === t ? "" : t
|
|
2645
|
-
})),
|
|
2656
|
+
})), O(1);
|
|
2646
2657
|
},
|
|
2647
2658
|
className: R(
|
|
2648
2659
|
"rounded-md border px-2 py-1 tabular-nums transition-colors",
|
|
@@ -2685,7 +2696,7 @@ function Wc({
|
|
|
2685
2696
|
{
|
|
2686
2697
|
label: Le(e),
|
|
2687
2698
|
count: t,
|
|
2688
|
-
filteredCount:
|
|
2699
|
+
filteredCount: Z ? Z.by_state[e] ?? 0 : null,
|
|
2689
2700
|
color: ((n = we[e]) == null ? void 0 : n.color) ?? null,
|
|
2690
2701
|
active: Ka.includes(e),
|
|
2691
2702
|
onClick: () => Da(e)
|
|
@@ -2703,10 +2714,10 @@ function Wc({
|
|
|
2703
2714
|
values: _,
|
|
2704
2715
|
seededKeys: St,
|
|
2705
2716
|
onApply: (e) => {
|
|
2706
|
-
Q((t) => ({ ...t, ...e })),
|
|
2717
|
+
Q((t) => ({ ...t, ...e })), O(1);
|
|
2707
2718
|
},
|
|
2708
2719
|
onClear: () => {
|
|
2709
|
-
Q({ ...ue.current }),
|
|
2720
|
+
Q({ ...ue.current }), O(1);
|
|
2710
2721
|
},
|
|
2711
2722
|
right: Hl
|
|
2712
2723
|
}
|
|
@@ -2769,7 +2780,7 @@ function Wc({
|
|
|
2769
2780
|
Q((e) => {
|
|
2770
2781
|
const { owners: t, ...n } = e;
|
|
2771
2782
|
return n;
|
|
2772
|
-
}),
|
|
2783
|
+
}), O(1);
|
|
2773
2784
|
},
|
|
2774
2785
|
className: "flex h-4 w-4 items-center justify-center rounded-full text-[10px] hover:bg-black/10 dark:hover:bg-white/10",
|
|
2775
2786
|
children: "✕"
|
|
@@ -3034,7 +3045,7 @@ function Wc({
|
|
|
3034
3045
|
page: de,
|
|
3035
3046
|
limit: on,
|
|
3036
3047
|
isLoading: We,
|
|
3037
|
-
onPageChange:
|
|
3048
|
+
onPageChange: O,
|
|
3038
3049
|
onRowClick: (e) => Vt(e),
|
|
3039
3050
|
rowDragProps: (e) => ({
|
|
3040
3051
|
...al({ collection: e.collection, id: e.item_id }),
|
|
@@ -3080,7 +3091,7 @@ function Wc({
|
|
|
3080
3091
|
const e = {};
|
|
3081
3092
|
for (const [n, r] of Object.entries(ue.current))
|
|
3082
3093
|
(t = Fe[n.slice(6)]) != null && t.length && (e[n] = r);
|
|
3083
|
-
Q(e),
|
|
3094
|
+
Q(e), O(1);
|
|
3084
3095
|
},
|
|
3085
3096
|
className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
3086
3097
|
"data-queue-empty-clear": !0,
|
|
@@ -3092,7 +3103,7 @@ function Wc({
|
|
|
3092
3103
|
{
|
|
3093
3104
|
type: "button",
|
|
3094
3105
|
onClick: () => {
|
|
3095
|
-
|
|
3106
|
+
Y("all"), O(1);
|
|
3096
3107
|
},
|
|
3097
3108
|
className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
3098
3109
|
"data-queue-empty-all": !0,
|
|
@@ -3104,18 +3115,18 @@ function Wc({
|
|
|
3104
3115
|
),
|
|
3105
3116
|
sort: I,
|
|
3106
3117
|
onSortChange: (e) => {
|
|
3107
|
-
Ue(e),
|
|
3118
|
+
Ue(e), O(1);
|
|
3108
3119
|
},
|
|
3109
3120
|
filterDefs: Dn,
|
|
3110
3121
|
filterValues: _,
|
|
3111
3122
|
onFilterChange: (e, t) => {
|
|
3112
|
-
Q((n) => ({ ...n, [e]: t })),
|
|
3123
|
+
Q((n) => ({ ...n, [e]: t })), O(1);
|
|
3113
3124
|
},
|
|
3114
3125
|
rowGroups: Cl ?? void 0,
|
|
3115
3126
|
collapsedGroups: ye,
|
|
3116
3127
|
onToggleGroup: pl,
|
|
3117
|
-
selectedIds: Dt &&
|
|
3118
|
-
onSelectionChange: Dt &&
|
|
3128
|
+
selectedIds: Dt && ee ? Pe : void 0,
|
|
3129
|
+
onSelectionChange: Dt && ee ? et : void 0,
|
|
3119
3130
|
hideFilterRow: !0,
|
|
3120
3131
|
nowrapCells: !0,
|
|
3121
3132
|
columnPins: Xr,
|
|
@@ -3137,7 +3148,7 @@ function Wc({
|
|
|
3137
3148
|
Q((n) => ({
|
|
3138
3149
|
...n,
|
|
3139
3150
|
at_risk_rule: n.at_risk_rule === t ? "" : t
|
|
3140
|
-
})),
|
|
3151
|
+
})), O(1);
|
|
3141
3152
|
},
|
|
3142
3153
|
className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
|
|
3143
3154
|
}
|
|
@@ -3164,7 +3175,7 @@ function Wc({
|
|
|
3164
3175
|
}
|
|
3165
3176
|
) : /* @__PURE__ */ a(ui, { queueId: l })
|
|
3166
3177
|
] }),
|
|
3167
|
-
Dt &&
|
|
3178
|
+
Dt && ee && /* @__PURE__ */ d(
|
|
3168
3179
|
si,
|
|
3169
3180
|
{
|
|
3170
3181
|
count: Pe.length,
|
|
@@ -3206,7 +3217,7 @@ function Wc({
|
|
|
3206
3217
|
const e = as(
|
|
3207
3218
|
F.filter((t) => Pe.includes(K(t)) && t.collection !== "tasks").map((t) => H.urlFor(Sn(t)))
|
|
3208
3219
|
);
|
|
3209
|
-
e.blocked > 0 || e.capped > 0 ?
|
|
3220
|
+
e.blocked > 0 || e.capped > 0 ? D.warning(_a(e)) : D.success(_a(e));
|
|
3210
3221
|
},
|
|
3211
3222
|
"data-bulk-open-tabs": !0,
|
|
3212
3223
|
title: `Open the selected records in new tabs (up to ${rs})`,
|