@nivaro/react 0.3.67 → 0.3.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +836 -835
- package/dist/shared/components/ConformanceView.js +34 -34
- package/dist/shared/components/ReportView.js +196 -196
- package/dist/shared/components/SlaRulesView.js +36 -36
- package/dist/shared/components/chat/ChatPanel.js +484 -487
- package/dist/shared/components/chat/ChatViews.js +66 -66
- package/dist/shared/components/chat/RoomParts.js +159 -157
- package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
- package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
- package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
- package/dist/shared/components/item-edit/FieldRenderer.js +186 -182
- package/dist/shared/components/item-edit/FieldRow.js +87 -87
- package/dist/shared/components/item-edit/FileDownloadCount.js +94 -0
- package/dist/shared/components/item-edit/FilePickerField.js +350 -349
- package/dist/shared/components/item-edit/RecordInsights.js +90 -91
- package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +175 -138
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +53 -52
- package/dist/shared/components/panels/AddendumPanel.js +409 -411
- package/dist/shared/components/panels/CommentPanel.js +169 -162
- package/dist/shared/components/panels/PipelinePanel.js +75 -75
- package/dist/shared/components/panels/RevisionsPanel.js +103 -103
- package/dist/shared/components/queue/QueueWorklist.js +142 -141
- package/dist/shared/lib/activity-sentence.js +154 -144
- package/dist/shared/lib/format-value.js +15 -15
- package/dist/shared/lib/placement-behaviour.js +39 -31
- package/dist/shared/lib/utils.js +58 -53
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as d, Fragment as Se, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useSensors as bo, useSensor as
|
|
2
|
+
import { useSensors as bo, useSensor as fo, PointerSensor as ho, DndContext as go, closestCenter as xo } from "@dnd-kit/core";
|
|
3
3
|
import { SortableContext as yo, verticalListSortingStrategy as ko, arrayMove as vo, useSortable as wo } from "@dnd-kit/sortable";
|
|
4
4
|
import { CSS as _o } from "@dnd-kit/utilities";
|
|
5
5
|
import { useQueryClient as No, useQuery as X, useMutation as Te, useQueries as je } from "@tanstack/react-query";
|
|
@@ -20,7 +20,7 @@ import { deliverLive as rs, releaseLiveOwner as as } from "../../lib/focus-mode.
|
|
|
20
20
|
import { formatMultiValue as Ue } from "../../lib/format-value.js";
|
|
21
21
|
import { createCursorBook as ls, pageRequest as os, noteNextCursor as ss } from "../../lib/keyset-pager.js";
|
|
22
22
|
import { normalizeInlineEdit as is, inlineM2oTarget as cs, inlineChoices as ds, inlineEditFor as us, nextInlineKey as ms } from "../../lib/list-inline-edit.js";
|
|
23
|
-
import { sanitizeQueueLinkState as ps, readListLinkFromLocation as bs, dropListLinkParam as
|
|
23
|
+
import { sanitizeQueueLinkState as ps, readListLinkFromLocation as bs, dropListLinkParam as fs, encodeListLink as hs, replaceListLinkParam as gs } from "../../lib/list-link.js";
|
|
24
24
|
import { arrivedByListReturn as xs, historyKey as ys, ensureHistoryKey as ks } from "../../lib/list-page-memory.js";
|
|
25
25
|
import { expandCoalesced as vs, LIVE_ASPECTS as At } from "../../lib/live.js";
|
|
26
26
|
import { useRowChanges as ws, useRowLocksByCollection as _s, lockLabel as Ns } from "../../lib/live-list.js";
|
|
@@ -55,8 +55,8 @@ import { readQueueReturn as ci, queueReturnApplies as di, writeQueueReturn as Da
|
|
|
55
55
|
import { ListLoadError as ui } from "../ListLoadError.js";
|
|
56
56
|
import { LiveRowMark as mi } from "../LiveRowMark.js";
|
|
57
57
|
import { CopyListLinkButton as pi } from "../list/CopyListLinkButton.js";
|
|
58
|
-
import { useInlineEdit as bi, InlineEditCell as
|
|
59
|
-
import { usePickerExcludedRows as
|
|
58
|
+
import { useInlineEdit as bi, InlineEditCell as fi } from "../list/InlineEdit.js";
|
|
59
|
+
import { usePickerExcludedRows as hi, PICKER_EXCLUDED_ROW_CLASS as gi, PICKER_EXCLUDED_TITLE as xi } from "../PickerExcludedRows.js";
|
|
60
60
|
import { RealtimeStaleMark as yi } from "../RealtimeStatusBanner.js";
|
|
61
61
|
import { RecordDrilldownSheet as ki } from "../RecordDrilldownSheet.js";
|
|
62
62
|
import { RowHighlightLegend as vi } from "../RowHighlightLegend.js";
|
|
@@ -154,8 +154,8 @@ function zi({ status: l }) {
|
|
|
154
154
|
}
|
|
155
155
|
function Xi({ points: l, inline: k = !1 }) {
|
|
156
156
|
if (l.length < 2) return null;
|
|
157
|
-
const K = k ? 40 : 64, M = k ? 14 : 18, Z = Math.max(...l),
|
|
158
|
-
(de, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(M - 2 - (de -
|
|
157
|
+
const K = k ? 40 : 64, M = k ? 14 : 18, Z = Math.max(...l), h = Math.min(...l), f = Z - h || 1, S = K / (l.length - 1), Y = l.map(
|
|
158
|
+
(de, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(M - 2 - (de - h) / f * (M - 4)).toFixed(1)}`
|
|
159
159
|
).join(" ");
|
|
160
160
|
return /* @__PURE__ */ a(
|
|
161
161
|
"svg",
|
|
@@ -174,8 +174,8 @@ function Pt({
|
|
|
174
174
|
filteredCount: K,
|
|
175
175
|
active: M,
|
|
176
176
|
isLoading: Z,
|
|
177
|
-
tone:
|
|
178
|
-
trend:
|
|
177
|
+
tone: h,
|
|
178
|
+
trend: f,
|
|
179
179
|
delta: S,
|
|
180
180
|
deltaBadIsUp: Y,
|
|
181
181
|
breakdown: de,
|
|
@@ -220,7 +220,7 @@ function Pt({
|
|
|
220
220
|
{
|
|
221
221
|
className: L(
|
|
222
222
|
"whitespace-nowrap text-[11px] font-medium leading-none",
|
|
223
|
-
|
|
223
|
+
h === "red" ? "text-red-700 dark:text-red-400" : h === "amber" ? "text-amber-800 dark:text-amber-400" : "text-slate-500 dark:text-muted-foreground"
|
|
224
224
|
),
|
|
225
225
|
children: l
|
|
226
226
|
}
|
|
@@ -246,7 +246,7 @@ function Pt({
|
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
248
|
),
|
|
249
|
-
|
|
249
|
+
f && k > 0 && /* @__PURE__ */ a(Xi, { points: f, inline: !0 })
|
|
250
250
|
] })
|
|
251
251
|
}
|
|
252
252
|
);
|
|
@@ -257,13 +257,13 @@ function Zi({
|
|
|
257
257
|
filteredCount: K,
|
|
258
258
|
color: M,
|
|
259
259
|
active: Z,
|
|
260
|
-
onClick:
|
|
260
|
+
onClick: h
|
|
261
261
|
}) {
|
|
262
262
|
return /* @__PURE__ */ d(
|
|
263
263
|
"button",
|
|
264
264
|
{
|
|
265
265
|
type: "button",
|
|
266
|
-
onClick:
|
|
266
|
+
onClick: h,
|
|
267
267
|
className: L(
|
|
268
268
|
"flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px] font-medium transition-colors",
|
|
269
269
|
Z ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300"
|
|
@@ -295,19 +295,19 @@ function ec({
|
|
|
295
295
|
checked: K,
|
|
296
296
|
onCheckedChange: M
|
|
297
297
|
}) {
|
|
298
|
-
const { attributes: Z, listeners:
|
|
298
|
+
const { attributes: Z, listeners: h, setNodeRef: f, transform: S, transition: Y, isDragging: de } = wo({
|
|
299
299
|
id: l
|
|
300
300
|
}), g = {
|
|
301
301
|
transform: _o.Transform.toString(S),
|
|
302
302
|
transition: Y,
|
|
303
303
|
opacity: de ? 0.4 : 1
|
|
304
304
|
}, te = `col-toggle-${l}`;
|
|
305
|
-
return /* @__PURE__ */ d("div", { ref:
|
|
305
|
+
return /* @__PURE__ */ d("div", { ref: f, style: g, className: "flex items-center gap-2 text-[12px]", children: [
|
|
306
306
|
/* @__PURE__ */ a(
|
|
307
307
|
"span",
|
|
308
308
|
{
|
|
309
309
|
...Z,
|
|
310
|
-
...
|
|
310
|
+
...h,
|
|
311
311
|
className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
|
|
312
312
|
children: /* @__PURE__ */ a(Vo, { className: "h-3.5 w-3.5" })
|
|
313
313
|
}
|
|
@@ -323,20 +323,20 @@ function Od({
|
|
|
323
323
|
hideCreateActions: M = !1,
|
|
324
324
|
onAsk: Z
|
|
325
325
|
}) {
|
|
326
|
-
var pa, ba,
|
|
327
|
-
const
|
|
326
|
+
var pa, ba, fa, ha, ga, xa, ya, ka, va, wa, _a, Na, Sa, Ca, $a, qa, Ra;
|
|
327
|
+
const h = No(), f = ja(), { userId: S } = Ea(), Y = Io(), { navigate: de } = Go(), [g, te] = w("all"), [ue, P] = w(1), tr = Q(ls()), [Dt, Ua] = w(() => {
|
|
328
328
|
try {
|
|
329
329
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
330
330
|
} catch {
|
|
331
331
|
return "compact";
|
|
332
332
|
}
|
|
333
|
-
}), [C, Ie] = w("table"), [B, Ge] = w(""), [_, j] = w({}), [Mt, nr] = w(() => /* @__PURE__ */ new Set()), [R, bt] = w(null), [Ce, cn] = w(/* @__PURE__ */ new Set()), [
|
|
333
|
+
}), [C, Ie] = w("table"), [B, Ge] = w(""), [_, j] = w({}), [Mt, nr] = w(() => /* @__PURE__ */ new Set()), [R, bt] = w(null), [Ce, cn] = w(/* @__PURE__ */ new Set()), [ft, dn] = w(null), [We, un] = w(null), [mn, Bt] = w(0), pn = Q(0), Ee = ws(), bn = As(), fn = Q({}).current, rr = Q(/* @__PURE__ */ new Set()), [Va, Ia] = w(0), [ar, Ga] = w(0), be = Q(!1), Qt = Q([]), lr = Q(null), hn = Q(!1), gn = Q(0), xn = Q("table");
|
|
334
334
|
xn.current = C;
|
|
335
335
|
const yn = 25, { data: c, error: jt } = X({
|
|
336
336
|
queryKey: ["queue-meta", l],
|
|
337
|
-
queryFn: () =>
|
|
337
|
+
queryFn: () => f.request(O(`/queues/${l}`)).then((e) => e.data),
|
|
338
338
|
enabled: !!l
|
|
339
|
-
}), { scopes: Ut, ready: or } = Ps(), sr = Q(!1), [ir, cr] = w(!1), [
|
|
339
|
+
}), { scopes: Ut, ready: or } = Ps(), sr = Q(!1), [ir, cr] = w(!1), [fe, Wa] = w({}), he = Q({});
|
|
340
340
|
D(() => {
|
|
341
341
|
if (sr.current || !or || !c) return;
|
|
342
342
|
sr.current = !0;
|
|
@@ -349,7 +349,7 @@ function Od({
|
|
|
349
349
|
}
|
|
350
350
|
(async () => {
|
|
351
351
|
const t = {}, n = {}, r = async (o, s) => {
|
|
352
|
-
const u = await
|
|
352
|
+
const u = await f.request(
|
|
353
353
|
O(`/items/${o.target_collection}`, {
|
|
354
354
|
filter: JSON.stringify({ id: { _in: s } }),
|
|
355
355
|
fields: `id,${o.display_field}`,
|
|
@@ -375,12 +375,12 @@ function Od({
|
|
|
375
375
|
} catch {
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
Object.keys(n).length > 0 && Wa(n), Object.keys(t).length > 0 && (
|
|
378
|
+
Object.keys(n).length > 0 && Wa(n), Object.keys(t).length > 0 && (he.current = t, j((o) => ({ ...o, ...t }))), cr(!0);
|
|
379
379
|
})();
|
|
380
380
|
}, [or, Ut, c]);
|
|
381
381
|
const He = ((ba = (pa = c == null ? void 0 : c.sources) == null ? void 0 : pa.find((e) => e.type === "collection")) == null ? void 0 : ba.collection) ?? null, { data: dr = [] } = X({
|
|
382
382
|
queryKey: ["queue-browser-quick-filters", He],
|
|
383
|
-
queryFn: () =>
|
|
383
|
+
queryFn: () => f.request(O(`/collections/${He}`)).then((e) => {
|
|
384
384
|
var t, n;
|
|
385
385
|
return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
|
|
386
386
|
}).catch(() => []),
|
|
@@ -428,11 +428,11 @@ function Od({
|
|
|
428
428
|
}, 1500));
|
|
429
429
|
}, m = () => {
|
|
430
430
|
o || (o = setTimeout(() => {
|
|
431
|
-
if (o = null, gn.current > 0 ||
|
|
431
|
+
if (o = null, gn.current > 0 || hn.current) {
|
|
432
432
|
Qt.current = [], Bt((b) => b + 1);
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
|
-
be.current = !0,
|
|
435
|
+
be.current = !0, h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] });
|
|
436
436
|
}, 900));
|
|
437
437
|
}, y = (b) => {
|
|
438
438
|
let E = !1, v = 0, ae = !1;
|
|
@@ -448,7 +448,7 @@ function Od({
|
|
|
448
448
|
}
|
|
449
449
|
r || (r = setTimeout(() => {
|
|
450
450
|
r = null;
|
|
451
|
-
for (const Le of n)
|
|
451
|
+
for (const Le of n) h.invalidateQueries({ queryKey: [Le] });
|
|
452
452
|
n.clear();
|
|
453
453
|
}, 300));
|
|
454
454
|
continue;
|
|
@@ -458,11 +458,11 @@ function Od({
|
|
|
458
458
|
H && (ln || (q == null ? void 0 : q.action) === "create" || xn.current === "kanban") ? (E = !0, po || Qt.current.push({ key: H, by: null })) : v += 1;
|
|
459
459
|
}
|
|
460
460
|
v > 0 && (pn.current += v), E && m(), ae && u();
|
|
461
|
-
}, N = e(t, (b) => rs(
|
|
461
|
+
}, N = e(t, (b) => rs(fn, [b ?? {}], y));
|
|
462
462
|
return () => {
|
|
463
|
-
N(), as(
|
|
463
|
+
N(), as(fn), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
|
|
464
464
|
};
|
|
465
|
-
}, [bn, k, c == null ? void 0 : c.sources,
|
|
465
|
+
}, [bn, k, c == null ? void 0 : c.sources, h, l, S, fn]);
|
|
466
466
|
const Oe = Ho(_, 350), Ya = JSON.stringify(Oe) === JSON.stringify(_), vn = Q(!1), $e = C === "table" && !!R, mr = Fi(c), xe = (() => {
|
|
467
467
|
const e = {};
|
|
468
468
|
for (const [t, n] of Object.entries(Oe))
|
|
@@ -491,9 +491,9 @@ function Od({
|
|
|
491
491
|
}
|
|
492
492
|
const Xa = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Za = (e) => !e || Array.isArray(e) && e.length === 0;
|
|
493
493
|
function el() {
|
|
494
|
-
j({ ...
|
|
494
|
+
j({ ...he.current }), te("all"), P(1);
|
|
495
495
|
}
|
|
496
|
-
const [
|
|
496
|
+
const [ht, tl] = w(() => {
|
|
497
497
|
try {
|
|
498
498
|
return localStorage.getItem("nvr_queue_insights_open") === "1";
|
|
499
499
|
} catch {
|
|
@@ -502,17 +502,17 @@ function Od({
|
|
|
502
502
|
});
|
|
503
503
|
D(() => {
|
|
504
504
|
try {
|
|
505
|
-
localStorage.setItem("nvr_queue_insights_open",
|
|
505
|
+
localStorage.setItem("nvr_queue_insights_open", ht ? "1" : "0");
|
|
506
506
|
} catch {
|
|
507
507
|
}
|
|
508
|
-
}, [
|
|
508
|
+
}, [ht]);
|
|
509
509
|
const { data: nl = [] } = X({
|
|
510
510
|
queryKey: ["queue-view-subs", l],
|
|
511
|
-
queryFn: () =>
|
|
511
|
+
queryFn: () => f.request(O("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
|
|
512
512
|
staleTime: 3e4
|
|
513
513
|
}), Gt = (e) => nl.find((t) => t.queue_view_id === e), rl = (e) => {
|
|
514
514
|
const t = Gt(e);
|
|
515
|
-
(t ?
|
|
515
|
+
(t ? f.request(zn(`/notification-subscriptions/${t.id}`)) : f.request(
|
|
516
516
|
ce("/notification-subscriptions", {
|
|
517
517
|
queue_id: l,
|
|
518
518
|
queue_view_id: e,
|
|
@@ -521,7 +521,7 @@ function Od({
|
|
|
521
521
|
)).then(() => {
|
|
522
522
|
A.success(
|
|
523
523
|
t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
|
|
524
|
-
),
|
|
524
|
+
), h.invalidateQueries({ queryKey: ["queue-view-subs", l] });
|
|
525
525
|
}).catch((r) => A.error(dt(r, "Failed")));
|
|
526
526
|
}, [pr, wn] = w(null), _n = [
|
|
527
527
|
...new Set(
|
|
@@ -533,7 +533,7 @@ function Od({
|
|
|
533
533
|
const e = {};
|
|
534
534
|
for (const t of _n.slice(0, 6))
|
|
535
535
|
try {
|
|
536
|
-
const n = await
|
|
536
|
+
const n = await f.request(
|
|
537
537
|
O("/custom-actions", { collection: t })
|
|
538
538
|
);
|
|
539
539
|
e[t] = n.data ?? [];
|
|
@@ -545,33 +545,33 @@ function Od({
|
|
|
545
545
|
enabled: _n.length > 0,
|
|
546
546
|
staleTime: 6e4
|
|
547
547
|
}), ll = (e) => al[e] ?? [], ol = (e, t) => {
|
|
548
|
-
|
|
549
|
-
A.success(`${e.label} ran`),
|
|
548
|
+
f.request(ce(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
|
|
549
|
+
A.success(`${e.label} ran`), h.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
550
550
|
}).catch((n) => {
|
|
551
551
|
const r = n.response;
|
|
552
552
|
A.error((r == null ? void 0 : r.error) ?? dt(n, `${e.label} failed`));
|
|
553
553
|
});
|
|
554
554
|
}, { data: Nn = [] } = X({
|
|
555
555
|
queryKey: ["queue-triage-labels", l],
|
|
556
|
-
queryFn: () =>
|
|
556
|
+
queryFn: () => f.request(O(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
|
|
557
557
|
staleTime: 3e4
|
|
558
558
|
}), br = (e, t) => {
|
|
559
|
-
|
|
559
|
+
f.request(
|
|
560
560
|
ce(`/queues/${l}/triage-labels/toggle`, {
|
|
561
561
|
collection: e.collection,
|
|
562
562
|
item_id: e.item_id,
|
|
563
563
|
label: t
|
|
564
564
|
})
|
|
565
565
|
).then(() => {
|
|
566
|
-
|
|
566
|
+
h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
|
|
567
567
|
}).catch((n) => A.error(dt(n, "Label failed")));
|
|
568
568
|
}, {
|
|
569
569
|
data: i,
|
|
570
|
-
isLoading:
|
|
570
|
+
isLoading: fr,
|
|
571
571
|
isFetching: gt,
|
|
572
572
|
isPlaceholderData: sl,
|
|
573
573
|
dataUpdatedAt: oe,
|
|
574
|
-
isError:
|
|
574
|
+
isError: hr,
|
|
575
575
|
error: il,
|
|
576
576
|
refetch: cl
|
|
577
577
|
} = X({
|
|
@@ -585,7 +585,7 @@ function Od({
|
|
|
585
585
|
R
|
|
586
586
|
],
|
|
587
587
|
queryFn: async () => {
|
|
588
|
-
const e = !$e && C === "table", t = JSON.stringify([l, g, B, xe, yn]), n = e ? os(tr.current, t, ue, "").after : void 0, r = await
|
|
588
|
+
const e = !$e && C === "table", t = JSON.stringify([l, g, B, xe, yn]), n = e ? os(tr.current, t, ue, "").after : void 0, r = await f.request(
|
|
589
589
|
O(`/queues/${l}/items`, {
|
|
590
590
|
scope: g,
|
|
591
591
|
// Last State Change is Aging read the other way round: the newest
|
|
@@ -615,19 +615,19 @@ function Od({
|
|
|
615
615
|
placeholderData: (e) => e
|
|
616
616
|
});
|
|
617
617
|
i && !vn.current && (vn.current = !0);
|
|
618
|
-
const ze = Object.entries(
|
|
618
|
+
const ze = Object.entries(he.current).filter(
|
|
619
619
|
([e, t]) => {
|
|
620
620
|
var n;
|
|
621
|
-
return !((n =
|
|
621
|
+
return !((n = fe[e.slice(6)]) != null && n.length) && JSON.stringify(xe[e] ?? null) === JSON.stringify(t);
|
|
622
622
|
}
|
|
623
623
|
).map(([e]) => e), gr = ze.length > 0 && Object.keys(xe).every((e) => ze.includes(e)), xr = Object.fromEntries(
|
|
624
624
|
Object.entries(xe).filter(([e]) => !ze.includes(e))
|
|
625
625
|
), { data: dl } = X({
|
|
626
626
|
queryKey: ["queue-default-hidden", l, g, xr],
|
|
627
|
-
enabled: !!l && !!i && !gt && i.total === 0 && ((
|
|
627
|
+
enabled: !!l && !!i && !gt && i.total === 0 && ((fa = i.empty) == null ? void 0 : fa.reason) === "filters" && ze.length > 0 && !gr,
|
|
628
628
|
staleTime: 3e4,
|
|
629
629
|
retry: !1,
|
|
630
|
-
queryFn: () =>
|
|
630
|
+
queryFn: () => f.request(
|
|
631
631
|
O(`/queues/${l}/items`, {
|
|
632
632
|
scope: g,
|
|
633
633
|
filters: JSON.stringify(xr),
|
|
@@ -635,7 +635,7 @@ function Od({
|
|
|
635
635
|
limit: 1
|
|
636
636
|
})
|
|
637
637
|
).then((e) => Number(e.total ?? 0))
|
|
638
|
-
}), ye = gr ? Math.max(0, (((
|
|
638
|
+
}), ye = gr ? Math.max(0, (((ha = i == null ? void 0 : i.stats) == null ? void 0 : ha.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : dl ?? 0, yr = (e) => ze.map(e).join(" and "), kr = () => {
|
|
639
639
|
j((e) => {
|
|
640
640
|
const t = { ...e };
|
|
641
641
|
for (const n of ze) delete t[n];
|
|
@@ -656,7 +656,7 @@ function Od({
|
|
|
656
656
|
}, r = t.find((o) => o.queue === l);
|
|
657
657
|
t.push(n), t.length > 50 && t.shift(), r && r !== n && oe - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
|
|
658
658
|
}, [oe]);
|
|
659
|
-
const Xe =
|
|
659
|
+
const Xe = fr && !i || !z || !ir && !i, vr = (gt && !fr || sl && gt) && !be.current, ul = J(
|
|
660
660
|
() => ($e ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
661
661
|
[$e, i == null ? void 0 : i.data]
|
|
662
662
|
), ml = Rs(ul), Wt = Qi(), wr = Jo(gt && !be.current), pl = Yo({
|
|
@@ -666,7 +666,7 @@ function Od({
|
|
|
666
666
|
}), bl = qs();
|
|
667
667
|
async function _r(e, t) {
|
|
668
668
|
var m;
|
|
669
|
-
const r = (await
|
|
669
|
+
const r = (await f.request(O(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
|
|
670
670
|
if (!r || r.states.length === 0)
|
|
671
671
|
throw new Error("This item has no workflow instance");
|
|
672
672
|
const o = r.states.find((y) => y.key === t);
|
|
@@ -678,51 +678,51 @@ function Od({
|
|
|
678
678
|
let u = null;
|
|
679
679
|
if (ji(s) && (u = await Wt.ask(((m = s.label) == null ? void 0 : m.trim()) || "Move"), !u))
|
|
680
680
|
throw new Error("Not moved — this move needs a note");
|
|
681
|
-
await
|
|
681
|
+
await f.request(
|
|
682
682
|
ce(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
|
|
683
683
|
transition_id: s.id,
|
|
684
684
|
...u ? { comment: u } : {}
|
|
685
685
|
})
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
|
-
const
|
|
688
|
+
const fl = Te({
|
|
689
689
|
mutationFn: async ({ item: e, targetState: t }) => {
|
|
690
690
|
await _r(e, t);
|
|
691
691
|
},
|
|
692
692
|
onSuccess: () => {
|
|
693
|
-
|
|
693
|
+
h.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
694
694
|
},
|
|
695
695
|
onError: (e) => {
|
|
696
|
-
A.error(dt(e, "Failed to move item")),
|
|
696
|
+
A.error(dt(e, "Failed to move item")), h.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
697
697
|
}
|
|
698
698
|
}), Ke = Te({
|
|
699
|
-
mutationFn: (e) =>
|
|
699
|
+
mutationFn: (e) => f.request(
|
|
700
700
|
ce(`/queues/${l}/claim`, {
|
|
701
701
|
source_collection: e.collection,
|
|
702
702
|
item_id: e.item_id
|
|
703
703
|
})
|
|
704
704
|
),
|
|
705
|
-
onSuccess: () =>
|
|
705
|
+
onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
706
706
|
onError: () => A.error("Failed to claim item")
|
|
707
707
|
}), Ze = Te({
|
|
708
|
-
mutationFn: (e) =>
|
|
708
|
+
mutationFn: (e) => f.request(
|
|
709
709
|
ce(`/queues/${l}/release`, {
|
|
710
710
|
source_collection: e.collection,
|
|
711
711
|
item_id: e.item_id
|
|
712
712
|
})
|
|
713
713
|
),
|
|
714
|
-
onSuccess: () =>
|
|
714
|
+
onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
715
715
|
onError: () => A.error("Failed to release item")
|
|
716
716
|
}), { data: et } = X({
|
|
717
717
|
queryKey: ["queue-column-prefs", l],
|
|
718
|
-
queryFn: () =>
|
|
718
|
+
queryFn: () => f.request(O(`/queues/${l}/column-prefs`)),
|
|
719
719
|
enabled: !!l
|
|
720
720
|
}), [xt, Ht] = w(null), [tt, Sn] = w(null);
|
|
721
721
|
D(() => {
|
|
722
722
|
et && Sn(et.data.default_view_id);
|
|
723
723
|
}, [et]);
|
|
724
|
-
const [
|
|
725
|
-
(e) => Array.from({ length:
|
|
724
|
+
const [hl, Nr] = w({}), ke = $e ? (i == null ? void 0 : i.groups) ?? null : null, Jt = (ke ?? []).filter((e) => !Ce.has(e.key)).map((e) => e.key).flatMap(
|
|
725
|
+
(e) => Array.from({ length: hl[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
|
|
726
726
|
), Cn = je({
|
|
727
727
|
queries: Jt.map(({ key: e, page: t }) => ({
|
|
728
728
|
queryKey: [
|
|
@@ -736,7 +736,7 @@ function Od({
|
|
|
736
736
|
e,
|
|
737
737
|
t
|
|
738
738
|
],
|
|
739
|
-
queryFn: () =>
|
|
739
|
+
queryFn: () => f.request(
|
|
740
740
|
O(`/queues/${l}/items`, {
|
|
741
741
|
scope: g,
|
|
742
742
|
sort: B === "state_entered" ? "-aging_hours" : B === "-state_entered" ? "aging_hours" : B,
|
|
@@ -773,7 +773,7 @@ function Od({
|
|
|
773
773
|
);
|
|
774
774
|
const yl = Vs(), yt = $.some((e) => e.fulfilment !== void 0), kt = $.some((e) => e.send_backs !== void 0), { data: nt, dataUpdatedAt: Sr } = X({
|
|
775
775
|
queryKey: ["queue-live-stats", l, g, Oe, ar],
|
|
776
|
-
queryFn: () =>
|
|
776
|
+
queryFn: () => f.request(
|
|
777
777
|
O(`/queues/${l}/items`, {
|
|
778
778
|
scope: g,
|
|
779
779
|
filters: JSON.stringify(xe),
|
|
@@ -788,7 +788,7 @@ function Od({
|
|
|
788
788
|
}), Yt = !!nt && Sr > oe, x = Yt ? nt.stats : i == null ? void 0 : i.stats, I = Yt ? nt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, Cr = Yt ? nt.state_counts : i == null ? void 0 : i.state_counts;
|
|
789
789
|
D(() => {
|
|
790
790
|
if (!Yt) return;
|
|
791
|
-
const e = gn.current > 0 ||
|
|
791
|
+
const e = gn.current > 0 || hn.current, t = Li({
|
|
792
792
|
pending: pn.current,
|
|
793
793
|
liveTotal: nt.total,
|
|
794
794
|
rowsTotal: i == null ? void 0 : i.total,
|
|
@@ -802,7 +802,7 @@ function Od({
|
|
|
802
802
|
// nothing else re-read them — "37 of 38" with the strip at 38 for minutes.
|
|
803
803
|
table: C === "table",
|
|
804
804
|
busy: e
|
|
805
|
-
}) && (be.current = !0,
|
|
805
|
+
}) && (be.current = !0, h.invalidateQueries({
|
|
806
806
|
queryKey: $e ? ["queue-items", l] : ["queue-items", l, g]
|
|
807
807
|
}).finally(() => {
|
|
808
808
|
be.current = !1;
|
|
@@ -835,16 +835,16 @@ function Od({
|
|
|
835
835
|
Bt(0);
|
|
836
836
|
}, [oe]);
|
|
837
837
|
function kl() {
|
|
838
|
-
|
|
838
|
+
h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }), Bt(0);
|
|
839
839
|
}
|
|
840
840
|
const { data: ve } = X({
|
|
841
841
|
queryKey: ["queue-trends", l],
|
|
842
|
-
queryFn: () =>
|
|
842
|
+
queryFn: () => f.request(O(`/queues/${l}/trends`, { days: 14 })),
|
|
843
843
|
enabled: !!l,
|
|
844
844
|
staleTime: 300 * 1e3
|
|
845
845
|
}), { data: we } = X({
|
|
846
846
|
queryKey: ["queue-trends", l, "mine"],
|
|
847
|
-
queryFn: () =>
|
|
847
|
+
queryFn: () => f.request(O(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
|
|
848
848
|
enabled: !!l && g === "mine",
|
|
849
849
|
staleTime: 300 * 1e3
|
|
850
850
|
});
|
|
@@ -871,12 +871,12 @@ function Od({
|
|
|
871
871
|
[c == null ? void 0 : c.sources]
|
|
872
872
|
), { data: vl } = X({
|
|
873
873
|
queryKey: ["collections"],
|
|
874
|
-
queryFn: () =>
|
|
874
|
+
queryFn: () => f.request(O("/collections")).then((e) => e.data),
|
|
875
875
|
staleTime: 300 * 1e3
|
|
876
876
|
}), rt = je({
|
|
877
877
|
queries: Nt.map((e) => ({
|
|
878
878
|
queryKey: ["queue-collection-addendums", e],
|
|
879
|
-
queryFn: () =>
|
|
879
|
+
queryFn: () => f.request(
|
|
880
880
|
O(`/collections/${e}`)
|
|
881
881
|
).then((t) => {
|
|
882
882
|
var n;
|
|
@@ -886,7 +886,7 @@ function Od({
|
|
|
886
886
|
}))
|
|
887
887
|
}).some((e) => e.data === !0), { data: Rn = [] } = X({
|
|
888
888
|
queryKey: ["queue-integrations-collections"],
|
|
889
|
-
queryFn: () =>
|
|
889
|
+
queryFn: () => f.request(O("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
|
|
890
890
|
staleTime: 300 * 1e3
|
|
891
891
|
}), qe = Nt.some((e) => Rn.includes(e)), Fn = J(() => {
|
|
892
892
|
var t;
|
|
@@ -901,7 +901,7 @@ function Od({
|
|
|
901
901
|
}, [$, Rn, qe]), Fr = Object.keys(Fn), Lr = je({
|
|
902
902
|
queries: Fr.map((e) => ({
|
|
903
903
|
queryKey: ["queue-integrations-summary", e, Fn[e].join(",")],
|
|
904
|
-
queryFn: () =>
|
|
904
|
+
queryFn: () => f.request(
|
|
905
905
|
ce("/integration-obligations/summary", {
|
|
906
906
|
collection: e,
|
|
907
907
|
ids: Fn[e]
|
|
@@ -929,7 +929,7 @@ function Od({
|
|
|
929
929
|
}, [$]), Tn = Object.keys(Ln), Tr = je({
|
|
930
930
|
queries: Tn.map((e) => ({
|
|
931
931
|
queryKey: ["queue-task-counts", e, Ln[e].join(",")],
|
|
932
|
-
queryFn: () =>
|
|
932
|
+
queryFn: () => f.request(
|
|
933
933
|
ce("/tasks/counts", { collection: e, ids: Ln[e] })
|
|
934
934
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
935
935
|
staleTime: 3e4
|
|
@@ -943,7 +943,7 @@ function Od({
|
|
|
943
943
|
}, [Nl]), Er = Tn.length > 0, Ar = je({
|
|
944
944
|
queries: Nt.map((e) => ({
|
|
945
945
|
queryKey: ["queue-collection-risk-rules", e],
|
|
946
|
-
queryFn: () =>
|
|
946
|
+
queryFn: () => f.request(
|
|
947
947
|
O("/at-risk/rules/active", { collection: e })
|
|
948
948
|
).then((t) => t.data ?? []).catch(() => []),
|
|
949
949
|
staleTime: 300 * 1e3
|
|
@@ -962,7 +962,7 @@ function Od({
|
|
|
962
962
|
}, [Cl]), Kr = je({
|
|
963
963
|
queries: Nt.map((e) => ({
|
|
964
964
|
queryKey: ["queue-collection-states", e],
|
|
965
|
-
queryFn: () =>
|
|
965
|
+
queryFn: () => f.request(
|
|
966
966
|
O(`/queues/collection-states/${e}`)
|
|
967
967
|
).then((t) => t.data),
|
|
968
968
|
staleTime: 300 * 1e3
|
|
@@ -1133,12 +1133,12 @@ function Od({
|
|
|
1133
1133
|
}, [C, me, St, Pe, S, Ke, Ze, ge]);
|
|
1134
1134
|
const { data: G } = X({
|
|
1135
1135
|
queryKey: ["queue-views", l],
|
|
1136
|
-
queryFn: () =>
|
|
1136
|
+
queryFn: () => f.request(O(`/queues/${l}/views`)),
|
|
1137
1137
|
enabled: !!l
|
|
1138
1138
|
}), [ot, st] = w(null), [Ll, Dn] = w(!1), [Xt, jr] = w(""), [Ur, Vr] = w(!1), [$t, Ir] = w(!1);
|
|
1139
1139
|
function qt(e) {
|
|
1140
1140
|
const t = e.state ?? {};
|
|
1141
|
-
te(t.scope ?? "all"), j({ ...
|
|
1141
|
+
te(t.scope ?? "all"), j({ ...he.current, ...t.filters ?? {} }), Ge(t.sort ?? ""), bt(t.group_by ?? null), Ht(t.columns ?? null), un(t.pins ?? null), t.view && Ie(Ae.includes(t.view) ? t.view : Ae[0]), P(1), st(e.id);
|
|
1142
1142
|
}
|
|
1143
1143
|
function Tl() {
|
|
1144
1144
|
var t, n;
|
|
@@ -1147,7 +1147,7 @@ function Od({
|
|
|
1147
1147
|
qt(e);
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
|
-
te(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), j({ ...
|
|
1150
|
+
te(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), j({ ...he.current }), Ge(""), bt(null), Ht(null), un(null), (n = c == null ? void 0 : c.display_config) != null && n.default_view && Ie(c.display_config.default_view), P(1), st(null);
|
|
1151
1151
|
}
|
|
1152
1152
|
D(() => {
|
|
1153
1153
|
if (z || !(c != null && c.display_config) || et === void 0 || G === void 0) return;
|
|
@@ -1161,7 +1161,7 @@ function Od({
|
|
|
1161
1161
|
if (!e || !di(e, l, ys(), xs())) return;
|
|
1162
1162
|
Da({ ...e, restore: !1 });
|
|
1163
1163
|
const t = e.state ?? {};
|
|
1164
|
-
t.scope && te(t.scope), t.filters && j({ ...
|
|
1164
|
+
t.scope && te(t.scope), t.filters && j({ ...he.current, ...t.filters }), t.sort != null && Ge(t.sort), bt(t.group_by ?? null), t.view && Ie(t.view), t.page && P(t.page), en.current = e.scroll ?? 0, W && W.length > 0 && ct.back(W.length);
|
|
1165
1165
|
}, [z, l]), D(() => {
|
|
1166
1166
|
var s;
|
|
1167
1167
|
if (!z || typeof window > "u") return;
|
|
@@ -1188,7 +1188,7 @@ function Od({
|
|
|
1188
1188
|
}, [z]), D(() => {
|
|
1189
1189
|
if (!z) return;
|
|
1190
1190
|
const e = ps(bs(`queue:${l}`));
|
|
1191
|
-
e && (
|
|
1191
|
+
e && (fs(), qt({
|
|
1192
1192
|
id: -1,
|
|
1193
1193
|
// Saved views type filters loosely as strings; multi-selects ride as arrays there too.
|
|
1194
1194
|
state: e
|
|
@@ -1210,20 +1210,20 @@ function Od({
|
|
|
1210
1210
|
const { isAdmin: Me } = Ea(), El = $.map((e) => `${e.collection}|${e.item_id}`).join(","), Al = J(
|
|
1211
1211
|
() => $.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
1212
1212
|
[El]
|
|
1213
|
-
), Wr =
|
|
1213
|
+
), Wr = hi(Al, Me), Ol = (e) => St === F(e) ? (
|
|
1214
1214
|
// Pinned sticky cells use bg-inherit — the highlight must be
|
|
1215
1215
|
// OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
|
|
1216
1216
|
// scrolled content bleeds through the pinned columns. Same
|
|
1217
1217
|
// pair DataTable uses for selected rows when pins are active.
|
|
1218
1218
|
"bg-[#f2fdff] dark:bg-[#20303a]"
|
|
1219
1219
|
) : e.at_risk ? Ks(e.at_risk_color ?? "red") : void 0, tn = Me || (c == null ? void 0 : c.owner) != null && c.owner === S, Kl = Te({
|
|
1220
|
-
mutationFn: ({ viewId: e, on: t }) =>
|
|
1220
|
+
mutationFn: ({ viewId: e, on: t }) => f.request(Aa(`/queues/views/${e}`, { is_default: t })),
|
|
1221
1221
|
onSuccess: () => {
|
|
1222
|
-
|
|
1222
|
+
h.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("Queue default view updated");
|
|
1223
1223
|
},
|
|
1224
1224
|
onError: () => A.error("Could not update the queue default view")
|
|
1225
1225
|
}), nn = Te({
|
|
1226
|
-
mutationFn: () =>
|
|
1226
|
+
mutationFn: () => f.request(
|
|
1227
1227
|
ce(`/queues/${l}/views`, {
|
|
1228
1228
|
name: Xt.trim(),
|
|
1229
1229
|
is_shared: tn && (Ur || $t),
|
|
@@ -1240,11 +1240,11 @@ function Od({
|
|
|
1240
1240
|
})
|
|
1241
1241
|
),
|
|
1242
1242
|
onSuccess: (e) => {
|
|
1243
|
-
Dn(!1), jr(""), Vr(!1), Ir(!1), st(e.data.id),
|
|
1243
|
+
Dn(!1), jr(""), Vr(!1), Ir(!1), st(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("View saved");
|
|
1244
1244
|
},
|
|
1245
1245
|
onError: () => A.error("Failed to save view")
|
|
1246
1246
|
}), [Hr, Jr] = w(null), Be = Te({
|
|
1247
|
-
mutationFn: (e) =>
|
|
1247
|
+
mutationFn: (e) => f.request(
|
|
1248
1248
|
Aa(`/queues/views/${e.id}`, {
|
|
1249
1249
|
state: {
|
|
1250
1250
|
scope: g,
|
|
@@ -1258,7 +1258,7 @@ function Od({
|
|
|
1258
1258
|
})
|
|
1259
1259
|
),
|
|
1260
1260
|
onSuccess: (e, t) => {
|
|
1261
|
-
|
|
1261
|
+
h.invalidateQueries({ queryKey: ["queue-views", l] }), Jr(t.id), setTimeout(() => Jr((n) => n === t.id ? null : n), 2e3), A.success(`Saved "${t.name}" with the current filters, scope and sort`);
|
|
1262
1262
|
},
|
|
1263
1263
|
onError: () => A.error("Failed to update view")
|
|
1264
1264
|
}), [Mn, rn] = w(null);
|
|
@@ -1268,21 +1268,21 @@ function Od({
|
|
|
1268
1268
|
return () => clearTimeout(e);
|
|
1269
1269
|
}, [Mn]);
|
|
1270
1270
|
const Yr = Te({
|
|
1271
|
-
mutationFn: (e) =>
|
|
1271
|
+
mutationFn: (e) => f.request(zn(`/queues/views/${e}`)),
|
|
1272
1272
|
onSuccess: (e, t) => {
|
|
1273
|
-
rn(null),
|
|
1273
|
+
rn(null), h.invalidateQueries({ queryKey: ["queue-views", l] }), st(null), tt === t && Sn(null);
|
|
1274
1274
|
},
|
|
1275
1275
|
onError: () => A.error("Failed to delete view")
|
|
1276
1276
|
}), Pl = Te({
|
|
1277
|
-
mutationFn: (e) =>
|
|
1277
|
+
mutationFn: (e) => f.request(Xo(`/queues/${l}/default-view`, { view_id: e })),
|
|
1278
1278
|
onMutate: (e) => Sn(e),
|
|
1279
1279
|
onSuccess: (e, t) => {
|
|
1280
|
-
|
|
1280
|
+
h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.success(
|
|
1281
1281
|
t === null ? "Reverted to the general default" : "Set as your default view"
|
|
1282
1282
|
);
|
|
1283
1283
|
},
|
|
1284
1284
|
onError: () => {
|
|
1285
|
-
|
|
1285
|
+
h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.error("Failed to update default view");
|
|
1286
1286
|
}
|
|
1287
1287
|
}), [ie, it] = w([]), [ne, zr] = w(!1), Dl = () => {
|
|
1288
1288
|
ne && it([]), zr(!ne);
|
|
@@ -1297,7 +1297,7 @@ function Od({
|
|
|
1297
1297
|
const r = await Promise.allSettled(n.map(t));
|
|
1298
1298
|
Wt.endBatch();
|
|
1299
1299
|
const o = r.filter((u) => u.status === "fulfilled").length, s = r.length - o;
|
|
1300
|
-
Xr(!1), it([]),
|
|
1300
|
+
Xr(!1), it([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), s ? A.warning(`${e}: ${o} succeeded, ${s} failed`) : A.success(`${e}: ${o} succeeded`);
|
|
1301
1301
|
}
|
|
1302
1302
|
const Ne = (e) => {
|
|
1303
1303
|
var t;
|
|
@@ -1579,7 +1579,7 @@ function Od({
|
|
|
1579
1579
|
D(() => {
|
|
1580
1580
|
var r;
|
|
1581
1581
|
if (!z || !l) return;
|
|
1582
|
-
const e = `queue:${l}`, t = Gr(), n =
|
|
1582
|
+
const e = `queue:${l}`, t = Gr(), n = hs(e, t);
|
|
1583
1583
|
if (((r = jn.current) == null ? void 0 : r.queue) !== l) {
|
|
1584
1584
|
jn.current = { queue: l, enc: n };
|
|
1585
1585
|
return;
|
|
@@ -1623,7 +1623,8 @@ function Od({
|
|
|
1623
1623
|
const t = new Date(e);
|
|
1624
1624
|
if (!Number.isNaN(t.getTime()))
|
|
1625
1625
|
return {
|
|
1626
|
-
|
|
1626
|
+
// The one read-only date style (army 11), the full stamp on hover.
|
|
1627
|
+
text: js(t),
|
|
1627
1628
|
title: Pa(t)
|
|
1628
1629
|
};
|
|
1629
1630
|
}
|
|
@@ -1636,7 +1637,7 @@ function Od({
|
|
|
1636
1637
|
] : [], Wl = je({
|
|
1637
1638
|
queries: na.map((e) => ({
|
|
1638
1639
|
queryKey: ["cbv-collection-meta", e],
|
|
1639
|
-
queryFn: () =>
|
|
1640
|
+
queryFn: () => f.request(O(`/collections/${e}`)).then((t) => t.data),
|
|
1640
1641
|
staleTime: 10 * 6e4,
|
|
1641
1642
|
retry: !1
|
|
1642
1643
|
}))
|
|
@@ -1651,7 +1652,7 @@ function Od({
|
|
|
1651
1652
|
});
|
|
1652
1653
|
const { data: Hl } = X({
|
|
1653
1654
|
queryKey: ["my-permissions"],
|
|
1654
|
-
queryFn: () =>
|
|
1655
|
+
queryFn: () => f.request(O("/security/my/permissions")).then((e) => e.data),
|
|
1655
1656
|
enabled: Un.enabled && !Me,
|
|
1656
1657
|
staleTime: 5 * 6e4
|
|
1657
1658
|
}), ra = bi(), aa = (e, t) => {
|
|
@@ -1685,23 +1686,23 @@ function Od({
|
|
|
1685
1686
|
value: r,
|
|
1686
1687
|
next: m ? s(m) : null,
|
|
1687
1688
|
optimistic: () => {
|
|
1688
|
-
const b =
|
|
1689
|
-
return
|
|
1689
|
+
const b = h.getQueriesData({ queryKey: ["queue-items", l] });
|
|
1690
|
+
return h.setQueriesData({ queryKey: ["queue-items", l] }, (E) => {
|
|
1690
1691
|
const v = E;
|
|
1691
1692
|
return Array.isArray(v == null ? void 0 : v.data) ? { ...v, data: v.data.map(N) } : Array.isArray(v == null ? void 0 : v.rows) ? { ...v, rows: v.rows.map(N) } : E;
|
|
1692
1693
|
}), () => {
|
|
1693
|
-
for (const [E, v] of b)
|
|
1694
|
+
for (const [E, v] of b) h.setQueryData(E, v);
|
|
1694
1695
|
};
|
|
1695
1696
|
},
|
|
1696
1697
|
// Labels, rollups and the row's place in the queue follow the server.
|
|
1697
|
-
onSaved: () => void
|
|
1698
|
+
onSaved: () => void h.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
1698
1699
|
});
|
|
1699
1700
|
}, Yl = (e, t, n) => {
|
|
1700
1701
|
const r = aa(e, t);
|
|
1701
1702
|
if (!r) return n;
|
|
1702
1703
|
const o = Vn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
|
|
1703
1704
|
return /* @__PURE__ */ a(
|
|
1704
|
-
|
|
1705
|
+
fi,
|
|
1705
1706
|
{
|
|
1706
1707
|
controller: ra,
|
|
1707
1708
|
cellKey: `${F(e)}|${t}`,
|
|
@@ -1790,7 +1791,7 @@ function Od({
|
|
|
1790
1791
|
const Lt = [
|
|
1791
1792
|
...(In ?? []).filter((e) => oa.includes(e)),
|
|
1792
1793
|
...oa.filter((e) => !(In ?? []).includes(e))
|
|
1793
|
-
], no = bo(ho
|
|
1794
|
+
], no = bo(fo(ho, { activationConstraint: { distance: 4 } }));
|
|
1794
1795
|
function ro(e) {
|
|
1795
1796
|
const { active: t, over: n } = e;
|
|
1796
1797
|
if (!n || t.id === n.id) return;
|
|
@@ -1844,11 +1845,11 @@ function Od({
|
|
|
1844
1845
|
onPeek: () => De(e),
|
|
1845
1846
|
urlFor: Y.urlFor,
|
|
1846
1847
|
onDeleted: () => {
|
|
1847
|
-
|
|
1848
|
-
A.success("Moved to trash"),
|
|
1848
|
+
f.request(zn(`/items/${e.collection}/${e.item_id}`)).then(() => {
|
|
1849
|
+
A.success("Moved to trash"), h.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
1849
1850
|
}).catch((t) => A.error(dt(t, "Delete failed")));
|
|
1850
1851
|
},
|
|
1851
|
-
onAfterTransition: () => void
|
|
1852
|
+
onAfterTransition: () => void h.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
1852
1853
|
bulkEnabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
|
|
1853
1854
|
disabled: ne
|
|
1854
1855
|
}
|
|
@@ -1865,7 +1866,7 @@ function Od({
|
|
|
1865
1866
|
try {
|
|
1866
1867
|
const t = [];
|
|
1867
1868
|
for (let m = 1; t.length < 1e4; m++) {
|
|
1868
|
-
const y = await
|
|
1869
|
+
const y = await f.request(
|
|
1869
1870
|
O(`/queues/${l}/items`, {
|
|
1870
1871
|
scope: g,
|
|
1871
1872
|
sort: B === "state_entered" ? "-aging_hours" : B === "-state_entered" ? "aging_hours" : B,
|
|
@@ -1925,23 +1926,23 @@ function Od({
|
|
|
1925
1926
|
// Records hidden from pickers (a retired zone) are not offered.
|
|
1926
1927
|
picker: "1"
|
|
1927
1928
|
}, o = (n == null ? void 0 : n.narrowBy) ?? [], s = [];
|
|
1928
|
-
for (const [q, V] of Object.entries(
|
|
1929
|
+
for (const [q, V] of Object.entries(fe)) {
|
|
1929
1930
|
if (q === e.path || V.length === 0) continue;
|
|
1930
1931
|
const H = an.get(q);
|
|
1931
1932
|
!(H != null && H.target_collection) || !H.display_field || o.some((ln) => ln.collection === H.target_collection) || s.push({ collection: H.target_collection, field: H.display_field, values: V });
|
|
1932
1933
|
}
|
|
1933
1934
|
const u = [...o, ...s], m = u.length ? Ts(
|
|
1934
1935
|
e.target_collection,
|
|
1935
|
-
await Es(
|
|
1936
|
+
await Es(f, h, e.target_collection),
|
|
1936
1937
|
u
|
|
1937
1938
|
) : null, y = [
|
|
1938
1939
|
...t.trim() ? [{ [e.display_field]: { _contains: t.trim() } }] : [],
|
|
1939
1940
|
...m ? [m] : []
|
|
1940
1941
|
];
|
|
1941
1942
|
y.length > 0 && (r.filter = JSON.stringify(y.length === 1 ? y[0] : { _and: y }));
|
|
1942
|
-
const b = (await
|
|
1943
|
+
const b = (await f.request(
|
|
1943
1944
|
O(`/items/${e.target_collection}`, r)
|
|
1944
|
-
)).data ?? [], E = Ne(e.path), v =
|
|
1945
|
+
)).data ?? [], E = Ne(e.path), v = fe[e.path] ? new Set(fe[e.path]) : null, ae = /* @__PURE__ */ new Set(), pe = [];
|
|
1945
1946
|
for (const q of b) {
|
|
1946
1947
|
const V = q[e.display_field];
|
|
1947
1948
|
if (V == null || V === "") continue;
|
|
@@ -2068,7 +2069,7 @@ function Od({
|
|
|
2068
2069
|
placeholder: T("label", "Item"),
|
|
2069
2070
|
type: "combobox",
|
|
2070
2071
|
multi: !0,
|
|
2071
|
-
loadOptions: async (e) => ((await
|
|
2072
|
+
loadOptions: async (e) => ((await f.request(
|
|
2072
2073
|
O(`/queues/${l}/label-suggest`, e.trim() ? { q: e.trim() } : {})
|
|
2073
2074
|
)).data ?? []).map((n) => ({ label: n, value: n }))
|
|
2074
2075
|
},
|
|
@@ -2104,7 +2105,7 @@ function Od({
|
|
|
2104
2105
|
multi: !0,
|
|
2105
2106
|
// The "your access" mark follows the person's restriction on every tab,
|
|
2106
2107
|
// not only on an empty one (army 11 Q2-1).
|
|
2107
|
-
restricted: !!((m =
|
|
2108
|
+
restricted: !!((m = fe[e]) != null && m.length),
|
|
2108
2109
|
options: s.map((N) => ({
|
|
2109
2110
|
label: o ? Ue(N, o) : Kt(t, N),
|
|
2110
2111
|
value: N
|
|
@@ -2113,7 +2114,7 @@ function Od({
|
|
|
2113
2114
|
...r,
|
|
2114
2115
|
type: "combobox",
|
|
2115
2116
|
multi: !0,
|
|
2116
|
-
restricted: !!((y =
|
|
2117
|
+
restricted: !!((y = fe[e]) != null && y.length),
|
|
2117
2118
|
loadOptions: ma(t)
|
|
2118
2119
|
} : { ...r, placeholder: `Search ${n}…`, type: "text" };
|
|
2119
2120
|
})
|
|
@@ -2149,7 +2150,7 @@ function Od({
|
|
|
2149
2150
|
shown: typeof t == "number" ? t : null,
|
|
2150
2151
|
of: (x == null ? void 0 : x.total) ?? null
|
|
2151
2152
|
});
|
|
2152
|
-
})(), Et = new Set(Object.keys(
|
|
2153
|
+
})(), Et = new Set(Object.keys(he.current)), io = ((e) => {
|
|
2153
2154
|
var n;
|
|
2154
2155
|
if (e.some((r) => r.key === "state")) return e;
|
|
2155
2156
|
const t = Qe.find((r) => r.key === "state");
|
|
@@ -2170,7 +2171,7 @@ function Od({
|
|
|
2170
2171
|
type: "combobox",
|
|
2171
2172
|
multi: !0,
|
|
2172
2173
|
cascade: v,
|
|
2173
|
-
restricted: !!((pe =
|
|
2174
|
+
restricted: !!((pe = fe[u]) != null && pe.length),
|
|
2174
2175
|
options: b.map((V) => ({
|
|
2175
2176
|
label: N && N.type !== "number" ? Ue(V, N) : Kt(m, V),
|
|
2176
2177
|
value: V
|
|
@@ -2181,7 +2182,7 @@ function Od({
|
|
|
2181
2182
|
type: "combobox",
|
|
2182
2183
|
multi: !0,
|
|
2183
2184
|
cascade: v,
|
|
2184
|
-
restricted: !!((q =
|
|
2185
|
+
restricted: !!((q = fe[u]) != null && q.length),
|
|
2185
2186
|
loadOptions: ma(m)
|
|
2186
2187
|
} : null;
|
|
2187
2188
|
};
|
|
@@ -2474,11 +2475,11 @@ function Od({
|
|
|
2474
2475
|
type: "button",
|
|
2475
2476
|
className: L(
|
|
2476
2477
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2477
|
-
|
|
2478
|
+
ft ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2478
2479
|
),
|
|
2479
2480
|
children: [
|
|
2480
2481
|
/* @__PURE__ */ a(Fa, { className: "h-3.5 w-3.5" }),
|
|
2481
|
-
|
|
2482
|
+
ft ? `Lanes: ${ft === "collection" ? "Collection" : "Owner"}` : "Lanes"
|
|
2482
2483
|
]
|
|
2483
2484
|
}
|
|
2484
2485
|
) }),
|
|
@@ -2524,11 +2525,11 @@ function Od({
|
|
|
2524
2525
|
{
|
|
2525
2526
|
type: "button",
|
|
2526
2527
|
onClick: () => tl((e) => !e),
|
|
2527
|
-
"aria-expanded":
|
|
2528
|
+
"aria-expanded": ht,
|
|
2528
2529
|
title: "Trends, aging, pace and states",
|
|
2529
2530
|
className: L(
|
|
2530
2531
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2531
|
-
|
|
2532
|
+
ht ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2532
2533
|
),
|
|
2533
2534
|
"data-queue-insights-toggle": !0,
|
|
2534
2535
|
children: [
|
|
@@ -2726,7 +2727,7 @@ function Od({
|
|
|
2726
2727
|
]
|
|
2727
2728
|
}
|
|
2728
2729
|
),
|
|
2729
|
-
|
|
2730
|
+
ht && /* @__PURE__ */ d(
|
|
2730
2731
|
"div",
|
|
2731
2732
|
{
|
|
2732
2733
|
className: "flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-slate-100 bg-white px-4 py-2.5 dark:border-slate-800 dark:bg-slate-900",
|
|
@@ -2883,7 +2884,7 @@ function Od({
|
|
|
2883
2884
|
j((t) => ({ ...t, ...e })), P(1);
|
|
2884
2885
|
},
|
|
2885
2886
|
onClear: () => {
|
|
2886
|
-
j({ ...
|
|
2887
|
+
j({ ...he.current }), P(1);
|
|
2887
2888
|
},
|
|
2888
2889
|
right: uo
|
|
2889
2890
|
}
|
|
@@ -3174,7 +3175,7 @@ function Od({
|
|
|
3174
3175
|
)
|
|
3175
3176
|
] }),
|
|
3176
3177
|
/* @__PURE__ */ d("div", { ref: Zt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
|
|
3177
|
-
|
|
3178
|
+
hr && /* @__PURE__ */ a(ui, { error: il, onRetry: () => void cl(), className: "mb-3" }),
|
|
3178
3179
|
Yn && /* @__PURE__ */ a(
|
|
3179
3180
|
"p",
|
|
3180
3181
|
{
|
|
@@ -3235,7 +3236,7 @@ function Od({
|
|
|
3235
3236
|
Ol(e),
|
|
3236
3237
|
Wr(e.collection, e.item_id) && gi
|
|
3237
3238
|
),
|
|
3238
|
-
emptyMessage:
|
|
3239
|
+
emptyMessage: hr ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
|
|
3239
3240
|
ti,
|
|
3240
3241
|
{
|
|
3241
3242
|
icon: Uo,
|
|
@@ -3262,8 +3263,8 @@ function Od({
|
|
|
3262
3263
|
onClick: () => {
|
|
3263
3264
|
var t;
|
|
3264
3265
|
const e = {};
|
|
3265
|
-
for (const [n, r] of Object.entries(
|
|
3266
|
-
(t =
|
|
3266
|
+
for (const [n, r] of Object.entries(he.current))
|
|
3267
|
+
(t = fe[n.slice(6)]) != null && t.length && (e[n] = r);
|
|
3267
3268
|
j(e), P(1);
|
|
3268
3269
|
},
|
|
3269
3270
|
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",
|
|
@@ -3335,15 +3336,15 @@ function Od({
|
|
|
3335
3336
|
{
|
|
3336
3337
|
items: $,
|
|
3337
3338
|
onCardClick: (e) => Pn(e),
|
|
3338
|
-
onDrop: (e, t) =>
|
|
3339
|
+
onDrop: (e, t) => fl.mutate({ item: e, targetState: t }),
|
|
3339
3340
|
onClaim: (e) => Ke.mutate(e),
|
|
3340
3341
|
onRelease: (e) => Ze.mutate(e),
|
|
3341
|
-
swimlaneBy:
|
|
3342
|
+
swimlaneBy: ft,
|
|
3342
3343
|
stateLabels: En,
|
|
3343
|
-
laneLabel:
|
|
3344
|
+
laneLabel: ft === "collection" ? at : void 0,
|
|
3344
3345
|
claimsEnabled: ge,
|
|
3345
3346
|
onDraggingChange: (e) => {
|
|
3346
|
-
|
|
3347
|
+
hn.current = e;
|
|
3347
3348
|
}
|
|
3348
3349
|
}
|
|
3349
3350
|
) : /* @__PURE__ */ a(Bi, { queueId: l })
|
|
@@ -3363,7 +3364,7 @@ function Od({
|
|
|
3363
3364
|
busy: Rt,
|
|
3364
3365
|
onClaim: () => Bn(
|
|
3365
3366
|
"Claim",
|
|
3366
|
-
(e) =>
|
|
3367
|
+
(e) => f.request(
|
|
3367
3368
|
ce(`/queues/${l}/claim`, {
|
|
3368
3369
|
source_collection: e.collection,
|
|
3369
3370
|
item_id: e.item_id
|
|
@@ -3372,7 +3373,7 @@ function Od({
|
|
|
3372
3373
|
),
|
|
3373
3374
|
onRelease: () => Bn(
|
|
3374
3375
|
"Release",
|
|
3375
|
-
(e) =>
|
|
3376
|
+
(e) => f.request(
|
|
3376
3377
|
ce(`/queues/${l}/release`, {
|
|
3377
3378
|
source_collection: e.collection,
|
|
3378
3379
|
item_id: e.item_id
|
|
@@ -3406,7 +3407,7 @@ function Od({
|
|
|
3406
3407
|
tone: "light",
|
|
3407
3408
|
disabled: Rt,
|
|
3408
3409
|
onDone: (e) => {
|
|
3409
|
-
e.failed === 0 && it([]),
|
|
3410
|
+
e.failed === 0 && it([]), h.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
3410
3411
|
}
|
|
3411
3412
|
}
|
|
3412
3413
|
),
|
|
@@ -3415,7 +3416,7 @@ function Od({
|
|
|
3415
3416
|
{
|
|
3416
3417
|
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3417
3418
|
disabled: Rt,
|
|
3418
|
-
onDone: () => void
|
|
3419
|
+
onDone: () => void h.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
3419
3420
|
className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
|
|
3420
3421
|
}
|
|
3421
3422
|
),
|
|
@@ -3612,7 +3613,7 @@ function Od({
|
|
|
3612
3613
|
onRelease: (e) => Ze.mutate(e),
|
|
3613
3614
|
workNextActive: ql,
|
|
3614
3615
|
onNext: () => Pe && Qr(Pe),
|
|
3615
|
-
refetchItems: () =>
|
|
3616
|
+
refetchItems: () => h.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
3616
3617
|
}
|
|
3617
3618
|
),
|
|
3618
3619
|
Wt.dialog
|
|
@@ -3624,7 +3625,7 @@ function tc({
|
|
|
3624
3625
|
onClose: K,
|
|
3625
3626
|
onOpenRecord: M
|
|
3626
3627
|
}) {
|
|
3627
|
-
const Z = ja(), { data:
|
|
3628
|
+
const Z = ja(), { data: h, isLoading: f } = X({
|
|
3628
3629
|
queryKey: ["queue-agg-rows", l, k.row.collection, k.row.item_id, k.path],
|
|
3629
3630
|
queryFn: () => Z.request(
|
|
3630
3631
|
O(`/queues/${l}/aggregate-rows`, {
|
|
@@ -3666,12 +3667,12 @@ function tc({
|
|
|
3666
3667
|
}
|
|
3667
3668
|
)
|
|
3668
3669
|
] }),
|
|
3669
|
-
|
|
3670
|
+
f ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "Loading…" }) : ((h == null ? void 0 : h.rows) ?? []).length === 0 ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "No contributing rows resolved." }) : /* @__PURE__ */ a("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: h == null ? void 0 : h.rows.map((S) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between gap-3 py-1.5", children: [
|
|
3670
3671
|
/* @__PURE__ */ a(
|
|
3671
3672
|
"button",
|
|
3672
3673
|
{
|
|
3673
3674
|
type: "button",
|
|
3674
|
-
onClick: () =>
|
|
3675
|
+
onClick: () => h.target && M(h.target, String(S.id)),
|
|
3675
3676
|
className: "min-w-0 truncate text-left text-[12.5px] underline decoration-dotted underline-offset-2 hover:text-nvr-navy dark:hover:text-nvr-cyan",
|
|
3676
3677
|
children: S.label
|
|
3677
3678
|
}
|