@nivaro/react 0.3.54 → 0.3.56
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.
|
@@ -4,15 +4,15 @@ import { SortableContext as so, verticalListSortingStrategy as io, arrayMove as
|
|
|
4
4
|
import { CSS as mo } from "@dnd-kit/utilities";
|
|
5
5
|
import { useQueryClient as po, useQuery as W, useMutation as Se, useQueries as Be } from "@tanstack/react-query";
|
|
6
6
|
import { AlertTriangle as bo, FileDiff as ho, RefreshCw as fo, Rows3 as wa, Flame as go, Sparkles as xo, BarChart3 as yo, SlidersHorizontal as ko, ListChecks as vo, Rows4 as wo, Rows2 as _o, Play as No, Plus as Zt, ChevronDown as _a, Star as So, Pin as Co, Loader2 as $o, Check as qo, Save as Fo, Bell as To, Inbox as Ro, GripVertical as Eo } from "lucide-react";
|
|
7
|
-
import { useState as
|
|
7
|
+
import { useState as v, useRef as U, useEffect as M, useMemo as V } from "react";
|
|
8
8
|
import { createPortal as Na } from "react-dom";
|
|
9
9
|
import { toast as D } from "sonner";
|
|
10
|
-
import { useNivaroClient as Ea, useItemEditAuth as Sa, useItemNavigation as
|
|
10
|
+
import { useNivaroClient as Ea, useItemEditAuth as Sa, useItemNavigation as Lo, useNavigation as Ao, useOverlayState as Oo } from "../../context.js";
|
|
11
11
|
import { useDebounced as Do } from "../../hooks/useDebounced.js";
|
|
12
12
|
import { useElapsedLoading as Ko } from "../../hooks/useElapsedLoading.js";
|
|
13
13
|
import { useSlowReason as Po } from "../../hooks/useSlowReason.js";
|
|
14
14
|
import { useBulkProgressFeed as Mo } from "../../lib/bulk-progress.js";
|
|
15
|
-
import { get as
|
|
15
|
+
import { get as L, post as se, patch as Ca, del as jn, put as Qo } from "../../lib/commands.js";
|
|
16
16
|
import { evaluateExpression as Bo } from "../../lib/expression.js";
|
|
17
17
|
import { clauseFromControlValue as jo, filterSentence as Uo } from "../../lib/filter-sentence.js";
|
|
18
18
|
import { deliverLive as Io, releaseLiveOwner as Vo } from "../../lib/focus-mode.js";
|
|
@@ -20,7 +20,7 @@ import { formatMultiValue as tt, formatValue as Go } from "../../lib/format-valu
|
|
|
20
20
|
import { createCursorBook as Wo, pageRequest as Ho, noteNextCursor as Yo } from "../../lib/keyset-pager.js";
|
|
21
21
|
import { normalizeInlineEdit as Jo, inlineM2oTarget as zo, inlineChoices as Xo, inlineEditFor as Zo, nextInlineKey as es } from "../../lib/list-inline-edit.js";
|
|
22
22
|
import { sanitizeQueueLinkState as ts, readListLinkFromLocation as ns, dropListLinkParam as rs } from "../../lib/list-link.js";
|
|
23
|
-
import { expandCoalesced as as, LIVE_ASPECTS as
|
|
23
|
+
import { expandCoalesced as as, LIVE_ASPECTS as Ct } from "../../lib/live.js";
|
|
24
24
|
import { useRowChanges as ls, useRowLocksByCollection as os, lockLabel as ss } from "../../lib/live-list.js";
|
|
25
25
|
import { OPEN_IN_TABS_CAP as is, openInTabs as cs, openInTabsMessage as $a } from "../../lib/open-in-tabs.js";
|
|
26
26
|
import { isOwnWrite as ds } from "../../lib/own-writes.js";
|
|
@@ -31,61 +31,61 @@ import { cascadeFilter as hs, fetchCascadeRelations as fs } from "../../lib/quic
|
|
|
31
31
|
import { useOptionalRealtime as gs } from "../../lib/realtime.js";
|
|
32
32
|
import { copyIdText as qa } from "../../lib/record-ref.js";
|
|
33
33
|
import { rowHighlightTextClass as xs, rowHighlightClass as ys } from "../../lib/row-highlight.js";
|
|
34
|
-
import { userErrorMessage as
|
|
35
|
-
import { useMyScopes as ks, matchScopeDimension as vs
|
|
36
|
-
import { useNewItemLayouts as
|
|
37
|
-
import { formatNumber as ie, cn as R, titleCase as Un, humanHours as
|
|
38
|
-
import { usePublishAskContext as
|
|
39
|
-
import { useBuiltinGate as
|
|
40
|
-
import { BulkRowMark as
|
|
41
|
-
import { RowActionsMenu as
|
|
42
|
-
import { DataTable as
|
|
43
|
-
import { EmptyState as
|
|
44
|
-
import { FocusModeToggle as
|
|
45
|
-
import { FulfilmentPill as
|
|
46
|
-
import { ImportFromFileButton as
|
|
47
|
-
import { IntegrationDots as
|
|
48
|
-
import { IntegrationsFilterPill as
|
|
49
|
-
import { readQueueReturn as
|
|
50
|
-
import { ListLoadError as
|
|
51
|
-
import { LiveRowMark as
|
|
52
|
-
import { CopyListLinkButton as
|
|
53
|
-
import { useInlineEdit as
|
|
54
|
-
import { usePickerExcludedRows as
|
|
55
|
-
import { RealtimeStaleMark as
|
|
56
|
-
import { RecordDrilldownSheet as
|
|
57
|
-
import { RowHighlightLegend as
|
|
58
|
-
import { RowPresence as
|
|
34
|
+
import { userErrorMessage as $t } from "../../lib/safe-error.js";
|
|
35
|
+
import { useMyScopes as ks, matchScopeDimension as vs } from "../../lib/use-my-scopes.js";
|
|
36
|
+
import { useNewItemLayouts as ws } from "../../lib/use-new-item-layouts.js";
|
|
37
|
+
import { formatNumber as ie, cn as R, titleCase as Un, humanHours as _s, formatRelative as Ns, formatDateTime as Ss, formatDate as Cs } from "../../lib/utils.js";
|
|
38
|
+
import { usePublishAskContext as $s, useAskRecordDrag as qs } from "../ai/ask-context.js";
|
|
39
|
+
import { useBuiltinGate as Fs, BulkActionButtons as Ts } from "../bulk/BulkActionButtons.js";
|
|
40
|
+
import { BulkRowMark as Rs } from "../bulk/BulkRowMark.js";
|
|
41
|
+
import { RowActionsMenu as Es, roleMayUpdate as Ls } from "../CollectionBrowserView.js";
|
|
42
|
+
import { DataTable as As } from "../DataTable.js";
|
|
43
|
+
import { EmptyState as Os } from "../EmptyState.js";
|
|
44
|
+
import { FocusModeToggle as Ds } from "../FocusModeToggle.js";
|
|
45
|
+
import { FulfilmentPill as Ks, FULFILMENT_FILTER_OPTIONS as Ps } from "../FulfilmentPill.js";
|
|
46
|
+
import { ImportFromFileButton as Ms } from "../import/ImportFromFileButton.js";
|
|
47
|
+
import { IntegrationDots as Qs, INTEGRATIONS_FILTER_OPTIONS as Bs } from "../integrations/IntegrationDots.js";
|
|
48
|
+
import { IntegrationsFilterPill as js } from "../integrations/IntegrationsFilterPill.js";
|
|
49
|
+
import { readQueueReturn as Us, writeQueueReturn as Fa } from "../item-edit/QueueReturnChip.js";
|
|
50
|
+
import { ListLoadError as Is } from "../ListLoadError.js";
|
|
51
|
+
import { LiveRowMark as Vs } from "../LiveRowMark.js";
|
|
52
|
+
import { CopyListLinkButton as Gs } from "../list/CopyListLinkButton.js";
|
|
53
|
+
import { useInlineEdit as Ws, InlineEditCell as Hs } from "../list/InlineEdit.js";
|
|
54
|
+
import { usePickerExcludedRows as Ys, PICKER_EXCLUDED_ROW_CLASS as Js, PICKER_EXCLUDED_TITLE as zs } from "../PickerExcludedRows.js";
|
|
55
|
+
import { RealtimeStaleMark as Xs } from "../RealtimeStatusBanner.js";
|
|
56
|
+
import { RecordDrilldownSheet as Zs } from "../RecordDrilldownSheet.js";
|
|
57
|
+
import { RowHighlightLegend as ei } from "../RowHighlightLegend.js";
|
|
58
|
+
import { RowPresence as ti } from "../RowPresence.js";
|
|
59
59
|
import { TickerNumber as In } from "../TickerNumber.js";
|
|
60
|
-
import { UnseenDot as
|
|
61
|
-
import { Badge as
|
|
60
|
+
import { UnseenDot as ni } from "../UnseenDot.js";
|
|
61
|
+
import { Badge as ri } from "../ui/badge.js";
|
|
62
62
|
import { Checkbox as Vn } from "../ui/checkbox.js";
|
|
63
|
-
import { Command as Ta, CommandInput as
|
|
64
|
-
import { Label as
|
|
63
|
+
import { Command as Ta, CommandInput as ai, CommandList as Ra, CommandEmpty as li, CommandItem as qt } from "../ui/command.js";
|
|
64
|
+
import { Label as oi } from "../ui/label.js";
|
|
65
65
|
import { Popover as nt, PopoverTrigger as rt, PopoverContent as at } from "../ui/popover.js";
|
|
66
|
-
import { Skeleton as
|
|
67
|
-
import { dedupeChooserKeys as
|
|
68
|
-
import { stateAspectEffect as
|
|
69
|
-
import { OwnerAvatars as
|
|
70
|
-
import { QueueBulkBar as
|
|
71
|
-
import { QueueItemSheet as
|
|
72
|
-
import { QueueKanbanBoard as
|
|
73
|
-
import { QueueQuickFilters as
|
|
74
|
-
import { QueueWorkloadView as
|
|
75
|
-
import { useTransitionNote as
|
|
76
|
-
function
|
|
66
|
+
import { Skeleton as si } from "../ui/skeleton.js";
|
|
67
|
+
import { dedupeChooserKeys as ii } from "./column-chooser.js";
|
|
68
|
+
import { stateAspectEffect as ci } from "./live-state-aspect.js";
|
|
69
|
+
import { OwnerAvatars as di } from "./OwnerAvatars.js";
|
|
70
|
+
import { QueueBulkBar as ui } from "./QueueBulkBar.js";
|
|
71
|
+
import { QueueItemSheet as mi } from "./QueueItemSheet.js";
|
|
72
|
+
import { QueueKanbanBoard as pi } from "./QueueKanbanBoard.js";
|
|
73
|
+
import { QueueQuickFilters as bi } from "./QueueQuickFilters.js";
|
|
74
|
+
import { QueueWorkloadView as hi } from "./QueueWorkloadView.js";
|
|
75
|
+
import { useTransitionNote as fi, needsTransitionNote as gi } from "./transition-note.js";
|
|
76
|
+
function xi({ summary: l }) {
|
|
77
77
|
if (!l || l.count === 0)
|
|
78
78
|
return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
|
|
79
|
-
const y = [l.last_from, l.last_to].filter(Boolean).join(" → "),
|
|
79
|
+
const y = [l.last_from, l.last_to].filter(Boolean).join(" → "), A = [
|
|
80
80
|
y ? `Last: ${y}` : null,
|
|
81
|
-
l.last_at ?
|
|
81
|
+
l.last_at ? Ns(l.last_at) : null,
|
|
82
82
|
l.last_reason ? `“${l.last_reason}”` : "no reason given"
|
|
83
83
|
].filter(Boolean).join(" · ");
|
|
84
84
|
return /* @__PURE__ */ d(
|
|
85
85
|
"span",
|
|
86
86
|
{
|
|
87
87
|
className: "inline-flex max-w-[260px] items-center gap-1.5 truncate rounded-full border border-rose-200 bg-rose-50 px-2 py-0.5 text-[11px] font-medium text-rose-700 dark:border-rose-900/40 dark:bg-rose-900/10 dark:text-rose-300",
|
|
88
|
-
"data-tip":
|
|
88
|
+
"data-tip": A,
|
|
89
89
|
"data-send-backs": l.count,
|
|
90
90
|
children: [
|
|
91
91
|
/* @__PURE__ */ d("span", { className: "tabular-nums", children: [
|
|
@@ -100,15 +100,15 @@ function yi({ summary: l }) {
|
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
|
-
const
|
|
103
|
+
const yi = 50, en = "nivaro_addendums", ki = [
|
|
104
104
|
{ value: "mine", label: "My Items" },
|
|
105
105
|
{ value: "unowned", label: "No Owners" },
|
|
106
106
|
{ value: "claimed", label: "Claimed by me" },
|
|
107
107
|
{ value: "all", label: "All Items" }
|
|
108
108
|
];
|
|
109
|
-
function
|
|
109
|
+
function vi({ summary: l }) {
|
|
110
110
|
if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
111
|
-
const y = l.active > 0,
|
|
111
|
+
const y = l.active > 0, A = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", P = l.cost_impact, G = P != null && P !== 0 ? `${P > 0 ? "+" : "−"}$${Math.abs(P).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
|
|
112
112
|
return /* @__PURE__ */ d(
|
|
113
113
|
"span",
|
|
114
114
|
{
|
|
@@ -128,7 +128,7 @@ function wi({ summary: l }) {
|
|
|
128
128
|
)
|
|
129
129
|
}
|
|
130
130
|
),
|
|
131
|
-
y ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${
|
|
131
|
+
y ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${A}` : `${l.total} ${A}`,
|
|
132
132
|
G && /* @__PURE__ */ d("span", { className: "tabular-nums opacity-80", children: [
|
|
133
133
|
"· ",
|
|
134
134
|
G
|
|
@@ -137,21 +137,21 @@ function wi({ summary: l }) {
|
|
|
137
137
|
}
|
|
138
138
|
);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return
|
|
140
|
+
function wi(l) {
|
|
141
|
+
return _s(l);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function _i({ status: l }) {
|
|
144
144
|
return l ? /* @__PURE__ */ a("span", { className: R("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ni({ points: l, inline: y = !1 }) {
|
|
147
147
|
if (l.length < 2) return null;
|
|
148
|
-
const
|
|
149
|
-
(xe, g) => `${g === 0 ? "M" : "L"}${(g *
|
|
148
|
+
const A = y ? 40 : 64, P = y ? 14 : 18, G = Math.max(...l), f = Math.min(...l), h = G - f || 1, N = A / (l.length - 1), H = l.map(
|
|
149
|
+
(xe, g) => `${g === 0 ? "M" : "L"}${(g * N).toFixed(1)},${(P - 2 - (xe - f) / h * (P - 4)).toFixed(1)}`
|
|
150
150
|
).join(" ");
|
|
151
151
|
return /* @__PURE__ */ a(
|
|
152
152
|
"svg",
|
|
153
153
|
{
|
|
154
|
-
width:
|
|
154
|
+
width: A,
|
|
155
155
|
height: P,
|
|
156
156
|
className: y ? "opacity-40" : "mt-1.5 opacity-40",
|
|
157
157
|
"aria-hidden": "true",
|
|
@@ -159,15 +159,15 @@ function Si({ points: l, inline: y = !1 }) {
|
|
|
159
159
|
}
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Ft({
|
|
163
163
|
label: l,
|
|
164
164
|
count: y,
|
|
165
|
-
filteredCount:
|
|
165
|
+
filteredCount: A,
|
|
166
166
|
active: P,
|
|
167
167
|
isLoading: G,
|
|
168
168
|
tone: f,
|
|
169
169
|
trend: h,
|
|
170
|
-
delta:
|
|
170
|
+
delta: N,
|
|
171
171
|
deltaBadIsUp: H,
|
|
172
172
|
onClick: xe
|
|
173
173
|
}) {
|
|
@@ -181,9 +181,9 @@ function Tt({
|
|
|
181
181
|
P && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
|
|
182
182
|
!P && !G && y === 0 && "opacity-50"
|
|
183
183
|
),
|
|
184
|
-
children: G ? /* @__PURE__ */ a(
|
|
185
|
-
/* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children:
|
|
186
|
-
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(In, { value:
|
|
184
|
+
children: G ? /* @__PURE__ */ a(si, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Ce, { children: [
|
|
185
|
+
/* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: A != null ? /* @__PURE__ */ d(Ce, { children: [
|
|
186
|
+
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(In, { value: A, format: ie }) }),
|
|
187
187
|
/* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
|
|
188
188
|
"/ ",
|
|
189
189
|
/* @__PURE__ */ a(In, { value: y, format: ie })
|
|
@@ -199,28 +199,28 @@ function Tt({
|
|
|
199
199
|
children: l
|
|
200
200
|
}
|
|
201
201
|
),
|
|
202
|
-
|
|
202
|
+
N != null && N !== 0 && /* @__PURE__ */ d(
|
|
203
203
|
"span",
|
|
204
204
|
{
|
|
205
205
|
className: R(
|
|
206
206
|
"text-[10px] font-medium leading-none",
|
|
207
|
-
H ?
|
|
207
|
+
H ? N > 0 ? "text-red-500" : "text-emerald-600" : "text-slate-400"
|
|
208
208
|
),
|
|
209
209
|
children: [
|
|
210
|
-
|
|
211
|
-
ie(Math.abs(
|
|
210
|
+
N > 0 ? "↑" : "↓",
|
|
211
|
+
ie(Math.abs(N))
|
|
212
212
|
]
|
|
213
213
|
}
|
|
214
214
|
),
|
|
215
|
-
h && y > 0 && /* @__PURE__ */ a(
|
|
215
|
+
h && y > 0 && /* @__PURE__ */ a(Ni, { points: h, inline: !0 })
|
|
216
216
|
] })
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Si({
|
|
221
221
|
label: l,
|
|
222
222
|
count: y,
|
|
223
|
-
filteredCount:
|
|
223
|
+
filteredCount: A,
|
|
224
224
|
color: P,
|
|
225
225
|
active: G,
|
|
226
226
|
onClick: f
|
|
@@ -243,8 +243,8 @@ function Ci({
|
|
|
243
243
|
}
|
|
244
244
|
),
|
|
245
245
|
l,
|
|
246
|
-
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
247
|
-
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ie(
|
|
246
|
+
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: A != null ? /* @__PURE__ */ d(Ce, { children: [
|
|
247
|
+
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ie(A) }),
|
|
248
248
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
249
249
|
" / ",
|
|
250
250
|
ie(y)
|
|
@@ -255,18 +255,18 @@ function Ci({
|
|
|
255
255
|
);
|
|
256
256
|
}
|
|
257
257
|
function lt(l) {
|
|
258
|
-
return l.split(".").map((y) => y.replace(/_/g, " ").replace(/\b\w/g, (
|
|
258
|
+
return l.split(".").map((y) => y.replace(/_/g, " ").replace(/\b\w/g, (A) => A.toUpperCase())).join(" → ");
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function Ci({
|
|
261
261
|
id: l,
|
|
262
262
|
label: y,
|
|
263
|
-
checked:
|
|
263
|
+
checked: A,
|
|
264
264
|
onCheckedChange: P
|
|
265
265
|
}) {
|
|
266
|
-
const { attributes: G, listeners: f, setNodeRef: h, transform:
|
|
266
|
+
const { attributes: G, listeners: f, setNodeRef: h, transform: N, transition: H, isDragging: xe } = uo({
|
|
267
267
|
id: l
|
|
268
268
|
}), g = {
|
|
269
|
-
transform: mo.Transform.toString(
|
|
269
|
+
transform: mo.Transform.toString(N),
|
|
270
270
|
transition: H,
|
|
271
271
|
opacity: xe ? 0.4 : 1
|
|
272
272
|
}, Y = `col-toggle-${l}`;
|
|
@@ -280,45 +280,45 @@ function $i({
|
|
|
280
280
|
children: /* @__PURE__ */ a(Eo, { className: "h-3.5 w-3.5" })
|
|
281
281
|
}
|
|
282
282
|
),
|
|
283
|
-
/* @__PURE__ */ a(Vn, { id: Y, checked:
|
|
284
|
-
/* @__PURE__ */ a(
|
|
283
|
+
/* @__PURE__ */ a(Vn, { id: Y, checked: A, onCheckedChange: P }),
|
|
284
|
+
/* @__PURE__ */ a(oi, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children: y })
|
|
285
285
|
] });
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Xc({
|
|
288
288
|
queueId: l,
|
|
289
289
|
realtime: y,
|
|
290
|
-
renderError:
|
|
290
|
+
renderError: A,
|
|
291
291
|
hideCreateActions: P = !1,
|
|
292
292
|
onAsk: G
|
|
293
293
|
}) {
|
|
294
294
|
var aa, la, oa, sa, ia, ca, da, ua, ma, pa, ba, ha, fa, ga, xa, ya, ka;
|
|
295
|
-
const f = po(), h = Ea(), { userId:
|
|
295
|
+
const f = po(), h = Ea(), { userId: N } = Sa(), H = Lo(), { navigate: xe } = Ao(), [g, Y] = v("all"), [de, O] = v(1), Gn = U(Wo()), [Tt, La] = v(() => {
|
|
296
296
|
try {
|
|
297
297
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
298
298
|
} catch {
|
|
299
299
|
return "compact";
|
|
300
300
|
}
|
|
301
|
-
}), [
|
|
302
|
-
sn.current =
|
|
303
|
-
const cn = 25, { data: i, error:
|
|
301
|
+
}), [$, je] = v("table"), [I, Ue] = v(""), [_, Q] = v({}), [Rt, Wn] = v(() => /* @__PURE__ */ new Set()), [C, ot] = v(null), [ye, tn] = v(/* @__PURE__ */ new Set()), [st, nn] = v(null), [it, rn] = v(null), [an, Et] = v(0), $e = ls(), ln = gs(), on = U({}).current, Hn = U(/* @__PURE__ */ new Set()), [Aa, Oa] = v(0), [Yn, Da] = v(0), qe = U(!1), Lt = U([]), Jn = U(null), zn = U(!1), Xn = U(0), sn = U("table");
|
|
302
|
+
sn.current = $;
|
|
303
|
+
const cn = 25, { data: i, error: At } = W({
|
|
304
304
|
queryKey: ["queue-meta", l],
|
|
305
|
-
queryFn: () => h.request(
|
|
305
|
+
queryFn: () => h.request(L(`/queues/${l}`)).then((e) => e.data),
|
|
306
306
|
enabled: !!l
|
|
307
|
-
}), { scopes:
|
|
307
|
+
}), { scopes: Ot, ready: Zn } = ks(), er = U(!1), [tr, nr] = v(!1), [Fe, Ka] = v({}), ue = U({});
|
|
308
308
|
M(() => {
|
|
309
309
|
if (er.current || !Zn || !i) return;
|
|
310
310
|
er.current = !0;
|
|
311
311
|
const e = (i.extra_field_meta ?? []).filter(
|
|
312
312
|
(t) => t.kind === "relation" && t.target_collection && t.display_field
|
|
313
313
|
);
|
|
314
|
-
if (e.length === 0 || !
|
|
314
|
+
if (e.length === 0 || !Ot) {
|
|
315
315
|
nr(!0);
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
(async () => {
|
|
319
319
|
const t = {}, n = {}, r = async (o, s) => {
|
|
320
320
|
const m = await h.request(
|
|
321
|
-
|
|
321
|
+
L(`/items/${o.target_collection}`, {
|
|
322
322
|
filter: JSON.stringify({ id: { _in: s } }),
|
|
323
323
|
fields: `id,${o.display_field}`,
|
|
324
324
|
limit: "200"
|
|
@@ -331,31 +331,24 @@ function Zc({
|
|
|
331
331
|
];
|
|
332
332
|
};
|
|
333
333
|
for (const o of e) {
|
|
334
|
-
const s = vs(
|
|
334
|
+
const s = vs(Ot, { collection: o.target_collection });
|
|
335
335
|
if (!s) continue;
|
|
336
336
|
const m = `extra.${o.path}`;
|
|
337
337
|
try {
|
|
338
|
-
const p =
|
|
338
|
+
const p = Ot.restricted[s.name] ?? [];
|
|
339
339
|
if (p.length > 0) {
|
|
340
|
-
const
|
|
341
|
-
|
|
340
|
+
const S = await r(o, p);
|
|
341
|
+
S.length > 0 && (n[m.slice(6)] = S);
|
|
342
342
|
}
|
|
343
|
-
const N = ws(ct, s.name);
|
|
344
|
-
if (N.length === 0) continue;
|
|
345
|
-
const k = _[m];
|
|
346
|
-
if (k && (Array.isArray(k) ? k.length > 0 : k !== ""))
|
|
347
|
-
continue;
|
|
348
|
-
const b = N.length ? await r(o, N) : [];
|
|
349
|
-
b.length > 0 && (t[m] = b);
|
|
350
343
|
} catch {
|
|
351
344
|
}
|
|
352
345
|
}
|
|
353
346
|
Object.keys(n).length > 0 && Ka(n), Object.keys(t).length > 0 && (ue.current = t, Q((o) => ({ ...o, ...t }))), nr(!0);
|
|
354
347
|
})();
|
|
355
|
-
}, [Zn,
|
|
348
|
+
}, [Zn, Ot, i]);
|
|
356
349
|
const Ie = ((la = (aa = i == null ? void 0 : i.sources) == null ? void 0 : aa.find((e) => e.type === "collection")) == null ? void 0 : la.collection) ?? null, { data: rr = [] } = W({
|
|
357
350
|
queryKey: ["queue-browser-quick-filters", Ie],
|
|
358
|
-
queryFn: () => h.request(
|
|
351
|
+
queryFn: () => h.request(L(`/collections/${Ie}`)).then((e) => {
|
|
359
352
|
var t, n;
|
|
360
353
|
return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
|
|
361
354
|
}).catch(() => []),
|
|
@@ -366,9 +359,9 @@ function Zc({
|
|
|
366
359
|
for (const n of (i == null ? void 0 : i.sources) ?? [])
|
|
367
360
|
n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
|
|
368
361
|
return t;
|
|
369
|
-
}, [i == null ? void 0 : i.sources]), Dt =
|
|
362
|
+
}, [i == null ? void 0 : i.sources]), Dt = ws(
|
|
370
363
|
re.length === 1 ? re[0] : null
|
|
371
|
-
), dn = 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"], Pa = (u == null ? void 0 : u.work_next) !== !1, Kt = (u == null ? void 0 : u.bulk_actions) !== !1, un =
|
|
364
|
+
), dn = 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"], Pa = (u == null ? void 0 : u.work_next) !== !1, Kt = (u == null ? void 0 : u.bulk_actions) !== !1, un = Fs(
|
|
372
365
|
[
|
|
373
366
|
...new Set(
|
|
374
367
|
((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -382,12 +375,12 @@ function Zc({
|
|
|
382
375
|
M(() => {
|
|
383
376
|
!i || ar.current || (ar.current = !0, Ue("-priority"));
|
|
384
377
|
}, [i]);
|
|
385
|
-
const [J, Ma] =
|
|
378
|
+
const [J, Ma] = v(!1);
|
|
386
379
|
M(() => {
|
|
387
|
-
i != null && i.display_config && !Te.includes(
|
|
388
|
-
}, [i,
|
|
380
|
+
i != null && i.display_config && !Te.includes($) && je(Te[0]);
|
|
381
|
+
}, [i, $, Te]), M(() => {
|
|
389
382
|
if (!(i != null && i.sources)) return;
|
|
390
|
-
const e = ln ? (b,
|
|
383
|
+
const e = ln ? (b, T) => ln.subscribeCollections(b, T) : y == null ? void 0 : y.subscribe;
|
|
391
384
|
if (!e) return;
|
|
392
385
|
const t = [
|
|
393
386
|
...new Set(
|
|
@@ -404,22 +397,22 @@ function Zc({
|
|
|
404
397
|
}, p = () => {
|
|
405
398
|
o || (o = setTimeout(() => {
|
|
406
399
|
if (o = null, Xn.current > 0 || zn.current) {
|
|
407
|
-
Lt.current = [],
|
|
400
|
+
Lt.current = [], Et((b) => b + 1);
|
|
408
401
|
return;
|
|
409
402
|
}
|
|
410
403
|
qe.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
|
|
411
404
|
}, 900));
|
|
412
|
-
},
|
|
413
|
-
let
|
|
405
|
+
}, S = (b) => {
|
|
406
|
+
let T = !1, k = 0, X = !1;
|
|
414
407
|
const Z = b.flatMap(
|
|
415
|
-
(
|
|
408
|
+
(F) => F ? as(F) : [F]
|
|
416
409
|
);
|
|
417
|
-
for (const
|
|
418
|
-
const ne =
|
|
419
|
-
if (
|
|
420
|
-
if (ne.includes(
|
|
421
|
-
const Ne =
|
|
422
|
-
X = !0, Ne.refresh && (
|
|
410
|
+
for (const F of Z) {
|
|
411
|
+
const ne = F == null ? void 0 : F.changed_fields, Xt = (F == null ? void 0 : F.collection) != null ? `${F.collection}:${String(F.item)}` : null, va = Xt != null && Hn.current.has(Xt);
|
|
412
|
+
if (F && !F.action && (ne != null && ne.length) && ne.every((Ne) => Ne.startsWith("$"))) {
|
|
413
|
+
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) && Oa((Ne) => Ne + 1), ne.includes(Ct.state)) {
|
|
414
|
+
const Ne = ci(va, sn.current === "kanban");
|
|
415
|
+
X = !0, Ne.refresh && (T = !0), k += Ne.pill;
|
|
423
416
|
}
|
|
424
417
|
r || (r = setTimeout(() => {
|
|
425
418
|
r = null;
|
|
@@ -429,16 +422,16 @@ function Zc({
|
|
|
429
422
|
continue;
|
|
430
423
|
}
|
|
431
424
|
X = !0;
|
|
432
|
-
const to = (
|
|
433
|
-
Xt && (va || (
|
|
425
|
+
const to = (F == null ? void 0 : F.collection) != null && ds(F.collection, F.item);
|
|
426
|
+
Xt && (va || (F == null ? void 0 : F.action) === "create" || sn.current === "kanban") ? (T = !0, to || Lt.current.push({ key: Xt, by: null })) : k += 1;
|
|
434
427
|
}
|
|
435
|
-
|
|
436
|
-
},
|
|
428
|
+
k > 0 && Et((F) => F + k), T && p(), X && m();
|
|
429
|
+
}, w = e(t, (b) => Io(on, [b ?? {}], S));
|
|
437
430
|
return () => {
|
|
438
|
-
|
|
431
|
+
w(), Vo(on), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
|
|
439
432
|
};
|
|
440
|
-
}, [ln, y, i == null ? void 0 : i.sources, f, l,
|
|
441
|
-
const Re = Do(_, 350), Qa = JSON.stringify(Re) === JSON.stringify(_), mn = U(!1), Ee =
|
|
433
|
+
}, [ln, y, i == null ? void 0 : i.sources, f, l, N, on]);
|
|
434
|
+
const Re = Do(_, 350), Qa = JSON.stringify(Re) === JSON.stringify(_), mn = U(!1), Ee = $ === "table" && !!C, lr = (() => {
|
|
442
435
|
const e = /* @__PURE__ */ new Set();
|
|
443
436
|
for (const t of (i == null ? void 0 : i.extra_field_meta) ?? [])
|
|
444
437
|
t.aggregate && t.aggregate !== "count" && e.add(t.path);
|
|
@@ -478,7 +471,7 @@ function Zc({
|
|
|
478
471
|
function Ia() {
|
|
479
472
|
Q({ ...ue.current }), Y("all"), O(1);
|
|
480
473
|
}
|
|
481
|
-
const [
|
|
474
|
+
const [ct, Va] = v(() => {
|
|
482
475
|
try {
|
|
483
476
|
return localStorage.getItem("nvr_queue_insights_open") === "1";
|
|
484
477
|
} catch {
|
|
@@ -487,13 +480,13 @@ function Zc({
|
|
|
487
480
|
});
|
|
488
481
|
M(() => {
|
|
489
482
|
try {
|
|
490
|
-
localStorage.setItem("nvr_queue_insights_open",
|
|
483
|
+
localStorage.setItem("nvr_queue_insights_open", ct ? "1" : "0");
|
|
491
484
|
} catch {
|
|
492
485
|
}
|
|
493
|
-
}, [
|
|
486
|
+
}, [ct]);
|
|
494
487
|
const { data: Ga = [] } = W({
|
|
495
488
|
queryKey: ["queue-view-subs", l],
|
|
496
|
-
queryFn: () => h.request(
|
|
489
|
+
queryFn: () => h.request(L("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
|
|
497
490
|
staleTime: 3e4
|
|
498
491
|
}), Pt = (e) => Ga.find((t) => t.queue_view_id === e), Wa = (e) => {
|
|
499
492
|
const t = Pt(e);
|
|
@@ -507,8 +500,8 @@ function Zc({
|
|
|
507
500
|
D.success(
|
|
508
501
|
t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
|
|
509
502
|
), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
|
|
510
|
-
}).catch((r) => D.error(
|
|
511
|
-
}, [or, pn] =
|
|
503
|
+
}).catch((r) => D.error($t(r, "Failed")));
|
|
504
|
+
}, [or, pn] = v(null), bn = [
|
|
512
505
|
...new Set(
|
|
513
506
|
((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
514
507
|
)
|
|
@@ -519,7 +512,7 @@ function Zc({
|
|
|
519
512
|
for (const t of bn.slice(0, 6))
|
|
520
513
|
try {
|
|
521
514
|
const n = await h.request(
|
|
522
|
-
|
|
515
|
+
L("/custom-actions", { collection: t })
|
|
523
516
|
);
|
|
524
517
|
e[t] = n.data ?? [];
|
|
525
518
|
} catch {
|
|
@@ -534,11 +527,11 @@ function Zc({
|
|
|
534
527
|
D.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
535
528
|
}).catch((n) => {
|
|
536
529
|
const r = n.response;
|
|
537
|
-
D.error((r == null ? void 0 : r.error) ??
|
|
530
|
+
D.error((r == null ? void 0 : r.error) ?? $t(n, `${e.label} failed`));
|
|
538
531
|
});
|
|
539
532
|
}, { data: hn = [] } = W({
|
|
540
533
|
queryKey: ["queue-triage-labels", l],
|
|
541
|
-
queryFn: () => h.request(
|
|
534
|
+
queryFn: () => h.request(L(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
|
|
542
535
|
staleTime: 3e4
|
|
543
536
|
}), sr = (e, t) => {
|
|
544
537
|
h.request(
|
|
@@ -549,11 +542,11 @@ function Zc({
|
|
|
549
542
|
})
|
|
550
543
|
).then(() => {
|
|
551
544
|
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
|
|
552
|
-
}).catch((n) => D.error(
|
|
545
|
+
}).catch((n) => D.error($t(n, "Label failed")));
|
|
553
546
|
}, {
|
|
554
547
|
data: c,
|
|
555
548
|
isLoading: ir,
|
|
556
|
-
isFetching:
|
|
549
|
+
isFetching: dt,
|
|
557
550
|
isPlaceholderData: za,
|
|
558
551
|
dataUpdatedAt: ce,
|
|
559
552
|
isError: cr,
|
|
@@ -566,12 +559,12 @@ function Zc({
|
|
|
566
559
|
g,
|
|
567
560
|
I,
|
|
568
561
|
Re,
|
|
569
|
-
|
|
570
|
-
|
|
562
|
+
$ === "table" && !C ? de : "all",
|
|
563
|
+
C
|
|
571
564
|
],
|
|
572
565
|
queryFn: async () => {
|
|
573
|
-
const e = !Ee &&
|
|
574
|
-
|
|
566
|
+
const e = !Ee && $ === "table", t = JSON.stringify([l, g, I, ke, cn]), n = e ? Ho(Gn.current, t, de, "").after : void 0, r = await h.request(
|
|
567
|
+
L(`/queues/${l}/items`, {
|
|
575
568
|
scope: g,
|
|
576
569
|
// Last State Change is Aging read the other way round: the newest
|
|
577
570
|
// move is the least aged.
|
|
@@ -580,9 +573,9 @@ function Zc({
|
|
|
580
573
|
// Table + group: headers only (rows load per group on expand, #741).
|
|
581
574
|
// Kanban renders the full matching set, grouped client-side.
|
|
582
575
|
...Ee ? {
|
|
583
|
-
group_by:
|
|
576
|
+
group_by: C,
|
|
584
577
|
...lr.length ? { group_sums: lr.join(",") } : {}
|
|
585
|
-
} :
|
|
578
|
+
} : $ === "table" ? { page: de, limit: cn, ...n ? { after: n } : {} } : {}
|
|
586
579
|
})
|
|
587
580
|
);
|
|
588
581
|
return n && Yo(Gn.current, t, de, r.next_cursor), r;
|
|
@@ -609,11 +602,11 @@ function Zc({
|
|
|
609
602
|
Object.entries(ke).filter(([e]) => !Ge.includes(e))
|
|
610
603
|
), { data: el } = W({
|
|
611
604
|
queryKey: ["queue-default-hidden", l, g, ur],
|
|
612
|
-
enabled: !!l && !!c && !
|
|
605
|
+
enabled: !!l && !!c && !dt && c.total === 0 && ((oa = c.empty) == null ? void 0 : oa.reason) === "filters" && Ge.length > 0 && !dr,
|
|
613
606
|
staleTime: 3e4,
|
|
614
607
|
retry: !1,
|
|
615
608
|
queryFn: () => h.request(
|
|
616
|
-
|
|
609
|
+
L(`/queues/${l}/items`, {
|
|
617
610
|
scope: g,
|
|
618
611
|
filters: JSON.stringify(ur),
|
|
619
612
|
page: 1,
|
|
@@ -641,27 +634,27 @@ function Zc({
|
|
|
641
634
|
}, r = t.find((o) => o.queue === l);
|
|
642
635
|
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 });
|
|
643
636
|
}, [ce]);
|
|
644
|
-
const We = ir && !c || !J || !tr && !c, br = (
|
|
637
|
+
const We = ir && !c || !J || !tr && !c, br = (dt && !ir || za && dt) && !qe.current, tl = V(
|
|
645
638
|
() => (Ee ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
646
639
|
[Ee, c == null ? void 0 : c.data]
|
|
647
|
-
), nl = ms(tl), Mt =
|
|
648
|
-
pending:
|
|
640
|
+
), nl = ms(tl), Mt = fi(), hr = Ko(dt && !qe.current), rl = Po({
|
|
641
|
+
pending: dt && !qe.current,
|
|
649
642
|
request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
|
|
650
643
|
noun: "items"
|
|
651
644
|
}), al = us();
|
|
652
645
|
async function fr(e, t) {
|
|
653
646
|
var p;
|
|
654
|
-
const r = (await h.request(
|
|
647
|
+
const r = (await h.request(L(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
|
|
655
648
|
if (!r || r.states.length === 0)
|
|
656
649
|
throw new Error("This item has no workflow instance");
|
|
657
|
-
const o = r.states.find((
|
|
650
|
+
const o = r.states.find((S) => S.key === t);
|
|
658
651
|
if (!o) throw new Error("Target state not found");
|
|
659
652
|
const s = r.available_transitions.find(
|
|
660
|
-
(
|
|
653
|
+
(S) => S.to_state === o.id
|
|
661
654
|
);
|
|
662
655
|
if (!s) throw new Error("No transition available to move this item here");
|
|
663
656
|
let m = null;
|
|
664
|
-
if (
|
|
657
|
+
if (gi(s) && (m = await Mt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
|
|
665
658
|
throw new Error("Not moved — this move needs a note");
|
|
666
659
|
await h.request(
|
|
667
660
|
se(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
|
|
@@ -678,9 +671,9 @@ function Zc({
|
|
|
678
671
|
f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
679
672
|
},
|
|
680
673
|
onError: (e) => {
|
|
681
|
-
D.error(
|
|
674
|
+
D.error($t(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
682
675
|
}
|
|
683
|
-
}),
|
|
676
|
+
}), Le = Se({
|
|
684
677
|
mutationFn: (e) => h.request(
|
|
685
678
|
se(`/queues/${l}/claim`, {
|
|
686
679
|
source_collection: e.collection,
|
|
@@ -700,13 +693,13 @@ function Zc({
|
|
|
700
693
|
onError: () => D.error("Failed to release item")
|
|
701
694
|
}), { data: Ye } = W({
|
|
702
695
|
queryKey: ["queue-column-prefs", l],
|
|
703
|
-
queryFn: () => h.request(
|
|
696
|
+
queryFn: () => h.request(L(`/queues/${l}/column-prefs`)),
|
|
704
697
|
enabled: !!l
|
|
705
|
-
}), [Qt, Bt] =
|
|
698
|
+
}), [Qt, Bt] = v(null), [Je, fn] = v(null);
|
|
706
699
|
M(() => {
|
|
707
700
|
Ye && fn(Ye.data.default_view_id);
|
|
708
701
|
}, [Ye]);
|
|
709
|
-
const [ol, gr] =
|
|
702
|
+
const [ol, gr] = v({}), be = Ee ? (c == null ? void 0 : c.groups) ?? null : null, jt = (be ?? []).filter((e) => !ye.has(e.key)).map((e) => e.key).flatMap(
|
|
710
703
|
(e) => Array.from({ length: ol[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
|
|
711
704
|
), gn = Be({
|
|
712
705
|
queries: jt.map(({ key: e, page: t }) => ({
|
|
@@ -717,19 +710,19 @@ function Zc({
|
|
|
717
710
|
g,
|
|
718
711
|
I,
|
|
719
712
|
Re,
|
|
720
|
-
|
|
713
|
+
C,
|
|
721
714
|
e,
|
|
722
715
|
t
|
|
723
716
|
],
|
|
724
717
|
queryFn: () => h.request(
|
|
725
|
-
|
|
718
|
+
L(`/queues/${l}/items`, {
|
|
726
719
|
scope: g,
|
|
727
720
|
sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
|
|
728
721
|
filters: JSON.stringify(ke),
|
|
729
|
-
group_by:
|
|
722
|
+
group_by: C,
|
|
730
723
|
group_key: e,
|
|
731
724
|
page: t,
|
|
732
|
-
limit:
|
|
725
|
+
limit: yi
|
|
733
726
|
})
|
|
734
727
|
).then((n) => ({ key: e, rows: n.data })),
|
|
735
728
|
enabled: !!c && Ee,
|
|
@@ -744,22 +737,22 @@ function Zc({
|
|
|
744
737
|
}), e;
|
|
745
738
|
}, [sl, jt.map((e) => `${e.key}\0${e.page}`).join("")]), il = new Set(
|
|
746
739
|
gn.flatMap((e, t) => e.isFetching ? [jt[t].key] : [])
|
|
747
|
-
),
|
|
748
|
-
|
|
740
|
+
), q = be ? [...xn.values()].flat() : (c == null ? void 0 : c.data) ?? [];
|
|
741
|
+
$s(
|
|
749
742
|
l ? {
|
|
750
743
|
queue: {
|
|
751
744
|
id: l,
|
|
752
745
|
label: i == null ? void 0 : i.name,
|
|
753
746
|
scope: g,
|
|
754
747
|
filters: JSON.stringify(ke),
|
|
755
|
-
items:
|
|
748
|
+
items: q.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
|
|
756
749
|
}
|
|
757
750
|
} : null
|
|
758
751
|
);
|
|
759
|
-
const cl =
|
|
752
|
+
const cl = qs(), ut = q.some((e) => e.fulfilment !== void 0), mt = q.some((e) => e.send_backs !== void 0), { data: Ut, dataUpdatedAt: dl } = W({
|
|
760
753
|
queryKey: ["queue-live-stats", l, g, Re, Yn],
|
|
761
754
|
queryFn: () => h.request(
|
|
762
|
-
|
|
755
|
+
L(`/queues/${l}/items`, {
|
|
763
756
|
scope: g,
|
|
764
757
|
filters: JSON.stringify(ke),
|
|
765
758
|
page: 1,
|
|
@@ -772,14 +765,14 @@ function Zc({
|
|
|
772
765
|
retry: !1
|
|
773
766
|
}), yn = !!Ut && dl > ce, x = yn ? Ut.stats : c == null ? void 0 : c.stats, z = yn ? Ut.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, xr = yn ? Ut.state_counts : c == null ? void 0 : c.state_counts, kn = (ia = z ?? x) == null ? void 0 : ia.aging, yr = U(void 0);
|
|
774
767
|
!_.aging_hours && kn && (yr.current = kn);
|
|
775
|
-
const
|
|
776
|
-
Hn.current = new Set(
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
|
|
768
|
+
const pt = _.aging_hours ? yr.current ?? (x == null ? void 0 : x.aging) : kn ?? (x == null ? void 0 : x.aging);
|
|
769
|
+
Hn.current = new Set(q.map((e) => `${e.collection}:${e.item_id}`));
|
|
770
|
+
const bt = os(
|
|
771
|
+
q.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
772
|
+
Aa
|
|
780
773
|
), kr = U(ce), vr = U(0);
|
|
781
774
|
!qe.current && ce !== vr.current && (kr.current = ce), M(() => {
|
|
782
|
-
const e = new Set(
|
|
775
|
+
const e = new Set(q.map((t) => `${t.collection}:${t.item_id}`));
|
|
783
776
|
if (qe.current) {
|
|
784
777
|
qe.current = !1, vr.current = ce;
|
|
785
778
|
const t = Lt.current;
|
|
@@ -794,23 +787,23 @@ function Zc({
|
|
|
794
787
|
}
|
|
795
788
|
Jn.current = e;
|
|
796
789
|
}, [ce]), M(() => {
|
|
797
|
-
|
|
790
|
+
Et(0);
|
|
798
791
|
}, [c]);
|
|
799
792
|
function ul() {
|
|
800
|
-
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }),
|
|
793
|
+
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Et(0);
|
|
801
794
|
}
|
|
802
795
|
const { data: he } = W({
|
|
803
796
|
queryKey: ["queue-trends", l],
|
|
804
|
-
queryFn: () => h.request(
|
|
797
|
+
queryFn: () => h.request(L(`/queues/${l}/trends`, { days: 14 })),
|
|
805
798
|
enabled: !!l,
|
|
806
799
|
staleTime: 300 * 1e3
|
|
807
800
|
}), { data: fe } = W({
|
|
808
801
|
queryKey: ["queue-trends", l, "mine"],
|
|
809
|
-
queryFn: () => h.request(
|
|
802
|
+
queryFn: () => h.request(L(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
|
|
810
803
|
enabled: !!l && g === "mine",
|
|
811
804
|
staleTime: 300 * 1e3
|
|
812
805
|
});
|
|
813
|
-
function
|
|
806
|
+
function ht(e) {
|
|
814
807
|
const n = (g === "all" ? he == null ? void 0 : he.data : g === "mine" ? fe == null ? void 0 : fe.data : void 0) ?? [];
|
|
815
808
|
if (n.length === 0) return {};
|
|
816
809
|
const r = n.map((s) => s[e]), o = n[n.length - 1];
|
|
@@ -823,7 +816,7 @@ function Zc({
|
|
|
823
816
|
(m) => g === "mine" ? m.owned ?? m.total : m.total
|
|
824
817
|
), r = n.slice(1).map((m, p) => m - n[p]), o = r.reduce((m, p) => m + p, 0) / r.length, s = x.total;
|
|
825
818
|
return Math.abs(o) < 0.05 ? { dir: "flat", pace: o, days: null } : o < 0 ? { dir: "down", pace: o, days: Math.max(1, Math.ceil(s / -o)) } : { dir: "up", pace: o, days: null };
|
|
826
|
-
}, [he == null ? void 0 : he.data, fe == null ? void 0 : fe.data, g, x]),
|
|
819
|
+
}, [he == null ? void 0 : he.data, fe == null ? void 0 : fe.data, g, x]), ft = V(
|
|
827
820
|
() => [
|
|
828
821
|
...new Set(
|
|
829
822
|
((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -832,13 +825,13 @@ function Zc({
|
|
|
832
825
|
[i == null ? void 0 : i.sources]
|
|
833
826
|
), { data: ml } = W({
|
|
834
827
|
queryKey: ["collections"],
|
|
835
|
-
queryFn: () => h.request(
|
|
828
|
+
queryFn: () => h.request(L("/collections")).then((e) => e.data),
|
|
836
829
|
staleTime: 300 * 1e3
|
|
837
830
|
}), ze = Be({
|
|
838
|
-
queries:
|
|
831
|
+
queries: ft.map((e) => ({
|
|
839
832
|
queryKey: ["queue-collection-addendums", e],
|
|
840
833
|
queryFn: () => h.request(
|
|
841
|
-
|
|
834
|
+
L(`/collections/${e}`)
|
|
842
835
|
).then((t) => {
|
|
843
836
|
var n;
|
|
844
837
|
return !!((n = t.data) != null && n.addendums_enabled);
|
|
@@ -847,19 +840,19 @@ function Zc({
|
|
|
847
840
|
}))
|
|
848
841
|
}).some((e) => e.data === !0), { data: vn = [] } = W({
|
|
849
842
|
queryKey: ["queue-integrations-collections"],
|
|
850
|
-
queryFn: () => h.request(
|
|
843
|
+
queryFn: () => h.request(L("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
|
|
851
844
|
staleTime: 300 * 1e3
|
|
852
|
-
}), ve =
|
|
845
|
+
}), ve = ft.some((e) => vn.includes(e)), wn = V(() => {
|
|
853
846
|
var t;
|
|
854
847
|
const e = {};
|
|
855
848
|
if (!ve) return e;
|
|
856
|
-
for (const n of
|
|
849
|
+
for (const n of q) {
|
|
857
850
|
if (!vn.includes(n.collection)) continue;
|
|
858
851
|
const r = e[t = n.collection] ?? (e[t] = []);
|
|
859
852
|
r.length < 500 && r.push(n.item_id);
|
|
860
853
|
}
|
|
861
854
|
return e;
|
|
862
|
-
}, [
|
|
855
|
+
}, [q, vn, ve]), wr = Object.keys(wn), _r = Be({
|
|
863
856
|
queries: wr.map((e) => ({
|
|
864
857
|
queryKey: ["queue-integrations-summary", e, wn[e].join(",")],
|
|
865
858
|
queryFn: () => h.request(
|
|
@@ -880,14 +873,14 @@ function Zc({
|
|
|
880
873
|
}, [pl]), _n = V(() => {
|
|
881
874
|
var t;
|
|
882
875
|
const e = {};
|
|
883
|
-
for (const n of
|
|
876
|
+
for (const n of q) {
|
|
884
877
|
if (!n.collection || n.collection === "tasks" || n.collection.startsWith("nivaro_"))
|
|
885
878
|
continue;
|
|
886
879
|
const r = e[t = n.collection] ?? (e[t] = []);
|
|
887
880
|
r.length < 500 && r.push(n.item_id);
|
|
888
881
|
}
|
|
889
882
|
return e;
|
|
890
|
-
}, [
|
|
883
|
+
}, [q]), Nn = Object.keys(_n), Nr = Be({
|
|
891
884
|
queries: Nn.map((e) => ({
|
|
892
885
|
queryKey: ["queue-task-counts", e, _n[e].join(",")],
|
|
893
886
|
queryFn: () => h.request(
|
|
@@ -902,10 +895,10 @@ function Zc({
|
|
|
902
895
|
for (const [o, s] of Object.entries(((r = Nr[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = s;
|
|
903
896
|
}), e;
|
|
904
897
|
}, [hl]), Sr = Nn.length > 0, Cr = Be({
|
|
905
|
-
queries:
|
|
898
|
+
queries: ft.map((e) => ({
|
|
906
899
|
queryKey: ["queue-collection-risk-rules", e],
|
|
907
900
|
queryFn: () => h.request(
|
|
908
|
-
|
|
901
|
+
L("/at-risk/rules/active", { collection: e })
|
|
909
902
|
).then((t) => t.data ?? []).catch(() => []),
|
|
910
903
|
staleTime: 300 * 1e3
|
|
911
904
|
}))
|
|
@@ -921,10 +914,10 @@ function Zc({
|
|
|
921
914
|
}
|
|
922
915
|
return [...e.values()];
|
|
923
916
|
}, [gl]), qr = Be({
|
|
924
|
-
queries:
|
|
917
|
+
queries: ft.map((e) => ({
|
|
925
918
|
queryKey: ["queue-collection-states", e],
|
|
926
919
|
queryFn: () => h.request(
|
|
927
|
-
|
|
920
|
+
L(`/queues/collection-states/${e}`)
|
|
928
921
|
).then((t) => t.data),
|
|
929
922
|
staleTime: 300 * 1e3
|
|
930
923
|
}))
|
|
@@ -949,35 +942,35 @@ function Zc({
|
|
|
949
942
|
const e = {};
|
|
950
943
|
for (const [t, n] of Object.entries(we)) e[t] = n.label;
|
|
951
944
|
return e;
|
|
952
|
-
}, [we]),
|
|
945
|
+
}, [we]), Ae = (e) => e ? e === "none" ? "No State" : Sn[e] ?? Fr(e) : "—", gt = (e) => {
|
|
953
946
|
if (e === en) return "Addendums";
|
|
954
947
|
const t = (ml ?? []).find((n) => n.collection === e);
|
|
955
948
|
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Fr(e);
|
|
956
|
-
}, le = V(() =>
|
|
949
|
+
}, le = V(() => C ? be ? be.map((e) => ({
|
|
957
950
|
key: e.key,
|
|
958
951
|
rows: xn.get(e.key) ?? [],
|
|
959
952
|
breached: e.breached,
|
|
960
953
|
atRisk: e.at_risk,
|
|
961
954
|
count: e.count,
|
|
962
955
|
sums: e.sums ?? {}
|
|
963
|
-
})) : bs(
|
|
956
|
+
})) : bs(q, C).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [q, C, be, xn]), Cn = U(null);
|
|
964
957
|
M(() => {
|
|
965
|
-
if (
|
|
958
|
+
if (!C || !le) {
|
|
966
959
|
Cn.current = null;
|
|
967
960
|
return;
|
|
968
961
|
}
|
|
969
|
-
if (Ee && !be || Cn.current ===
|
|
970
|
-
Cn.current =
|
|
962
|
+
if (Ee && !be || Cn.current === C) return;
|
|
963
|
+
Cn.current = C;
|
|
971
964
|
const e = le.reduce((t, n) => t + n.count, 0);
|
|
972
965
|
tn(e > 200 ? new Set(le.map((t) => t.key)) : /* @__PURE__ */ new Set()), gr({});
|
|
973
|
-
}, [
|
|
966
|
+
}, [C, be]);
|
|
974
967
|
function xl(e) {
|
|
975
968
|
tn((t) => {
|
|
976
969
|
const n = new Set(t);
|
|
977
970
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
978
971
|
});
|
|
979
972
|
}
|
|
980
|
-
const oe = V(() => le ? le.filter((e) => !ye.has(e.key)).flatMap((e) => e.rows) :
|
|
973
|
+
const oe = V(() => le ? le.filter((e) => !ye.has(e.key)).flatMap((e) => e.rows) : q, [le, q, ye]), K = (e) => `${e.collection}:${e.item_id}`, [_e, Oe] = v(null), [yl, $n] = v(!1), [It, Vt] = v(null), qn = (e) => {
|
|
981
974
|
if (e.collection === en && e.url) {
|
|
982
975
|
const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
|
|
983
976
|
if (t) {
|
|
@@ -996,7 +989,7 @@ function Zc({
|
|
|
996
989
|
itemId: e.item_id,
|
|
997
990
|
layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
|
|
998
991
|
};
|
|
999
|
-
},
|
|
992
|
+
}, xt = (e) => {
|
|
1000
993
|
var t;
|
|
1001
994
|
i && Fa({
|
|
1002
995
|
queue_id: l,
|
|
@@ -1004,14 +997,14 @@ function Zc({
|
|
|
1004
997
|
path: `${window.location.pathname}${window.location.search}`,
|
|
1005
998
|
at: Date.now(),
|
|
1006
999
|
scroll: ((t = Wt.current) == null ? void 0 : t.scrollTop) ?? 0,
|
|
1007
|
-
state: { scope: g, page: de, sort: I, filters: _, group_by:
|
|
1000
|
+
state: { scope: g, page: de, sort: I, filters: _, group_by: C, view: $ }
|
|
1008
1001
|
}), H.open(qn(e));
|
|
1009
|
-
}, [B,
|
|
1002
|
+
}, [B, yt] = v(
|
|
1010
1003
|
null
|
|
1011
1004
|
);
|
|
1012
1005
|
M(() => {
|
|
1013
1006
|
if (!B) return;
|
|
1014
|
-
const e = () =>
|
|
1007
|
+
const e = () => yt(null);
|
|
1015
1008
|
return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
|
|
1016
1009
|
window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
|
|
1017
1010
|
};
|
|
@@ -1020,7 +1013,7 @@ function Zc({
|
|
|
1020
1013
|
Vt(K(e));
|
|
1021
1014
|
const t = (u == null ? void 0 : u.row_click) ?? "preview";
|
|
1022
1015
|
if (t === "full" || e.collection === en) {
|
|
1023
|
-
|
|
1016
|
+
xt(e);
|
|
1024
1017
|
return;
|
|
1025
1018
|
}
|
|
1026
1019
|
if (t === "layout") {
|
|
@@ -1037,24 +1030,24 @@ function Zc({
|
|
|
1037
1030
|
};
|
|
1038
1031
|
M(() => {
|
|
1039
1032
|
if (!_e) return;
|
|
1040
|
-
const e =
|
|
1033
|
+
const e = q.find((t) => K(t) === K(_e));
|
|
1041
1034
|
e && e !== _e && Oe(e);
|
|
1042
|
-
}, [
|
|
1043
|
-
const kl = (e) => !e.claimed_by || e.claimed_by.id ===
|
|
1035
|
+
}, [q]);
|
|
1036
|
+
const kl = (e) => !e.claimed_by || e.claimed_by.id === N;
|
|
1044
1037
|
function Er(e) {
|
|
1045
1038
|
const t = e ? oe.findIndex((r) => K(r) === K(e)) + 1 : 0, n = oe.slice(t).find(kl);
|
|
1046
1039
|
if (!n) {
|
|
1047
1040
|
$n(!1), Oe(null), D.info("Nothing left to work on — queue clear!");
|
|
1048
1041
|
return;
|
|
1049
1042
|
}
|
|
1050
|
-
if (Vt(K(n)), me && !n.claimed_by &&
|
|
1051
|
-
|
|
1043
|
+
if (Vt(K(n)), me && !n.claimed_by && Le.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
|
|
1044
|
+
xt(n);
|
|
1052
1045
|
return;
|
|
1053
1046
|
}
|
|
1054
1047
|
$n(!0), Oe(n);
|
|
1055
1048
|
}
|
|
1056
1049
|
M(() => {
|
|
1057
|
-
if (
|
|
1050
|
+
if ($ !== "table") return;
|
|
1058
1051
|
function e(t) {
|
|
1059
1052
|
var o;
|
|
1060
1053
|
const n = t.target;
|
|
@@ -1074,17 +1067,17 @@ function Zc({
|
|
|
1074
1067
|
else if (t.key === "c" && r >= 0 && me) {
|
|
1075
1068
|
t.preventDefault();
|
|
1076
1069
|
const s = oe[r];
|
|
1077
|
-
((o = s.claimed_by) == null ? void 0 : o.id) ===
|
|
1078
|
-
} else t.key === "o" && r >= 0 && (t.preventDefault(),
|
|
1070
|
+
((o = s.claimed_by) == null ? void 0 : o.id) === N ? He.mutate(s) : Le.mutate(s);
|
|
1071
|
+
} else t.key === "o" && r >= 0 && (t.preventDefault(), xt(oe[r]));
|
|
1079
1072
|
}
|
|
1080
1073
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1081
|
-
}, [
|
|
1074
|
+
}, [$, oe, It, _e, N, Le, He, me]);
|
|
1082
1075
|
const { data: j } = W({
|
|
1083
1076
|
queryKey: ["queue-views", l],
|
|
1084
|
-
queryFn: () => h.request(
|
|
1077
|
+
queryFn: () => h.request(L(`/queues/${l}/views`)),
|
|
1085
1078
|
enabled: !!l
|
|
1086
|
-
}), [Xe, Ze] =
|
|
1087
|
-
function
|
|
1079
|
+
}), [Xe, Ze] = v(null), [vl, Fn] = v(!1), [Tn, Lr] = v(""), [Ar, Or] = v(!1), [kt, Dr] = v(!1);
|
|
1080
|
+
function vt(e) {
|
|
1088
1081
|
const t = e.state ?? {};
|
|
1089
1082
|
Y(t.scope ?? "all"), Q({ ...ue.current, ...t.filters ?? {} }), Ue(t.sort ?? ""), ot(t.group_by ?? null), Bt(t.columns ?? null), rn(t.pins ?? null), t.view && je(Te.includes(t.view) ? t.view : Te[0]), O(1), Ze(e.id);
|
|
1090
1083
|
}
|
|
@@ -1092,7 +1085,7 @@ function Zc({
|
|
|
1092
1085
|
var t, n;
|
|
1093
1086
|
const e = j == null ? void 0 : j.data.find((r) => r.is_default);
|
|
1094
1087
|
if (e) {
|
|
1095
|
-
|
|
1088
|
+
vt(e);
|
|
1096
1089
|
return;
|
|
1097
1090
|
}
|
|
1098
1091
|
Y(((t = i == null ? void 0 : i.display_config) == null ? void 0 : t.default_scope) ?? "all"), Q({ ...ue.current }), Ue(""), ot(null), Bt(null), rn(null), (n = i == null ? void 0 : i.display_config) != null && n.default_view && je(i.display_config.default_view), O(1), Ze(null);
|
|
@@ -1100,12 +1093,12 @@ function Zc({
|
|
|
1100
1093
|
M(() => {
|
|
1101
1094
|
if (J || !(i != null && i.display_config) || Ye === void 0 || j === void 0) return;
|
|
1102
1095
|
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);
|
|
1103
|
-
t ?
|
|
1096
|
+
t ? vt(t) : n ? vt(n) : (je(i.display_config.default_view), Y(i.display_config.default_scope)), Ma(!0);
|
|
1104
1097
|
}, [i, Ye, j, J]);
|
|
1105
1098
|
const Wt = U(null), Ht = U(null);
|
|
1106
1099
|
M(() => {
|
|
1107
1100
|
if (!J) return;
|
|
1108
|
-
const e =
|
|
1101
|
+
const e = Us();
|
|
1109
1102
|
if (!(e != null && e.restore) || e.queue_id !== l) return;
|
|
1110
1103
|
Fa({ ...e, restore: !1 });
|
|
1111
1104
|
const t = e.state ?? {};
|
|
@@ -1136,7 +1129,7 @@ function Zc({
|
|
|
1136
1129
|
}, [J]), M(() => {
|
|
1137
1130
|
if (!J) return;
|
|
1138
1131
|
const e = ts(ns(`queue:${l}`));
|
|
1139
|
-
e && (rs(),
|
|
1132
|
+
e && (rs(), vt({
|
|
1140
1133
|
id: -1,
|
|
1141
1134
|
// Saved views type filters loosely as strings; multi-selects ride as arrays there too.
|
|
1142
1135
|
state: e
|
|
@@ -1146,25 +1139,25 @@ function Zc({
|
|
|
1146
1139
|
scope: g,
|
|
1147
1140
|
filters: _,
|
|
1148
1141
|
sort: I,
|
|
1149
|
-
group_by:
|
|
1150
|
-
view:
|
|
1142
|
+
group_by: C,
|
|
1143
|
+
view: $,
|
|
1151
1144
|
columns: Qt,
|
|
1152
1145
|
pins: it,
|
|
1153
1146
|
...de > 1 ? { page: de } : {}
|
|
1154
1147
|
});
|
|
1155
1148
|
M(() => {
|
|
1156
|
-
Ht.current == null ||
|
|
1157
|
-
}, [
|
|
1158
|
-
const { isAdmin: De } = Sa(), Nl =
|
|
1159
|
-
() =>
|
|
1149
|
+
Ht.current == null || q.length === 0 || !Wt.current || (Wt.current.scrollTop = Ht.current, Ht.current = null);
|
|
1150
|
+
}, [q]);
|
|
1151
|
+
const { isAdmin: De } = Sa(), Nl = q.map((e) => `${e.collection}|${e.item_id}`).join(","), Sl = V(
|
|
1152
|
+
() => q.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
1160
1153
|
[Nl]
|
|
1161
|
-
), Kr =
|
|
1154
|
+
), Kr = Ys(Sl, De), Cl = (e) => It === K(e) ? (
|
|
1162
1155
|
// Pinned sticky cells use bg-inherit — the highlight must be
|
|
1163
1156
|
// OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
|
|
1164
1157
|
// scrolled content bleeds through the pinned columns. Same
|
|
1165
1158
|
// pair DataTable uses for selected rows when pins are active.
|
|
1166
1159
|
"bg-[#f2fdff] dark:bg-[#20303a]"
|
|
1167
|
-
) : e.at_risk ? ys(e.at_risk_color ?? "red") : void 0, Yt = De || (i == null ? void 0 : i.owner) != null && i.owner ===
|
|
1160
|
+
) : e.at_risk ? ys(e.at_risk_color ?? "red") : void 0, Yt = De || (i == null ? void 0 : i.owner) != null && i.owner === N, $l = Se({
|
|
1168
1161
|
mutationFn: ({ viewId: e, on: t }) => h.request(Ca(`/queues/views/${e}`, { is_default: t })),
|
|
1169
1162
|
onSuccess: () => {
|
|
1170
1163
|
f.invalidateQueries({ queryKey: ["queue-views", l] }), D.success("Queue default view updated");
|
|
@@ -1174,32 +1167,32 @@ function Zc({
|
|
|
1174
1167
|
mutationFn: () => h.request(
|
|
1175
1168
|
se(`/queues/${l}/views`, {
|
|
1176
1169
|
name: Tn.trim(),
|
|
1177
|
-
is_shared: Yt && (
|
|
1178
|
-
is_default:
|
|
1170
|
+
is_shared: Yt && (Ar || kt),
|
|
1171
|
+
is_default: kt,
|
|
1179
1172
|
state: {
|
|
1180
1173
|
scope: g,
|
|
1181
1174
|
filters: _,
|
|
1182
1175
|
sort: I,
|
|
1183
|
-
group_by:
|
|
1184
|
-
view:
|
|
1176
|
+
group_by: C,
|
|
1177
|
+
view: $,
|
|
1185
1178
|
columns: Qt,
|
|
1186
1179
|
pins: it
|
|
1187
1180
|
}
|
|
1188
1181
|
})
|
|
1189
1182
|
),
|
|
1190
1183
|
onSuccess: (e) => {
|
|
1191
|
-
Fn(!1),
|
|
1184
|
+
Fn(!1), Lr(""), Or(!1), Dr(!1), Ze(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), D.success("View saved");
|
|
1192
1185
|
},
|
|
1193
1186
|
onError: () => D.error("Failed to save view")
|
|
1194
|
-
}), [Mr, Qr] =
|
|
1187
|
+
}), [Mr, Qr] = v(null), Ke = Se({
|
|
1195
1188
|
mutationFn: (e) => h.request(
|
|
1196
1189
|
Ca(`/queues/views/${e.id}`, {
|
|
1197
1190
|
state: {
|
|
1198
1191
|
scope: g,
|
|
1199
1192
|
filters: _,
|
|
1200
1193
|
sort: I,
|
|
1201
|
-
group_by:
|
|
1202
|
-
view:
|
|
1194
|
+
group_by: C,
|
|
1195
|
+
view: $,
|
|
1203
1196
|
columns: Qt,
|
|
1204
1197
|
pins: it
|
|
1205
1198
|
}
|
|
@@ -1209,7 +1202,7 @@ function Zc({
|
|
|
1209
1202
|
f.invalidateQueries({ queryKey: ["queue-views", l] }), Qr(t.id), setTimeout(() => Qr((n) => n === t.id ? null : n), 2e3), D.success(`Saved "${t.name}" with the current filters, scope and sort`);
|
|
1210
1203
|
},
|
|
1211
1204
|
onError: () => D.error("Failed to update view")
|
|
1212
|
-
}), [Rn, Jt] =
|
|
1205
|
+
}), [Rn, Jt] = v(null);
|
|
1213
1206
|
M(() => {
|
|
1214
1207
|
if (Rn == null) return;
|
|
1215
1208
|
const e = setTimeout(() => Jt(null), 5e3);
|
|
@@ -1232,15 +1225,15 @@ function Zc({
|
|
|
1232
1225
|
onError: () => {
|
|
1233
1226
|
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), D.error("Failed to update default view");
|
|
1234
1227
|
}
|
|
1235
|
-
}), [Pe, et] =
|
|
1228
|
+
}), [Pe, et] = v([]), [ee, jr] = v(!1), Fl = () => {
|
|
1236
1229
|
ee && et([]), jr(!ee);
|
|
1237
1230
|
};
|
|
1238
1231
|
M(() => {
|
|
1239
|
-
|
|
1240
|
-
}, [
|
|
1241
|
-
const [Ur, Ir] =
|
|
1232
|
+
$ !== "table" && ee && (jr(!1), et([]));
|
|
1233
|
+
}, [$, ee]), Mo(), Xn.current = Pe.length;
|
|
1234
|
+
const [Ur, Ir] = v(!1);
|
|
1242
1235
|
async function En(e, t) {
|
|
1243
|
-
const n =
|
|
1236
|
+
const n = q.filter((m) => Pe.includes(K(m)));
|
|
1244
1237
|
Ir(!0), Mt.beginBatch();
|
|
1245
1238
|
const r = await Promise.allSettled(n.map(t));
|
|
1246
1239
|
Mt.endBatch();
|
|
@@ -1255,10 +1248,10 @@ function Zc({
|
|
|
1255
1248
|
}
|
|
1256
1249
|
return null;
|
|
1257
1250
|
}, Tl = (e) => {
|
|
1258
|
-
if (
|
|
1259
|
-
if (
|
|
1260
|
-
if (
|
|
1261
|
-
const t = Me(
|
|
1251
|
+
if (C === "state") return e === "No state" ? e : Ae(e);
|
|
1252
|
+
if (C === "collection") return gt(e);
|
|
1253
|
+
if (C != null && C.startsWith("extra.") && e !== "—") {
|
|
1254
|
+
const t = Me(C.slice(6));
|
|
1262
1255
|
if (t) return tt(e, t);
|
|
1263
1256
|
}
|
|
1264
1257
|
return e;
|
|
@@ -1317,13 +1310,13 @@ function Zc({
|
|
|
1317
1310
|
" at risk"
|
|
1318
1311
|
] })
|
|
1319
1312
|
] })
|
|
1320
|
-
})),
|
|
1321
|
-
...
|
|
1313
|
+
})), Ln = (((ca = c == null ? void 0 : c.available_values.collection) == null ? void 0 : ca.length) ?? 0) > 1, Vr = q.some((e) => !!e.unseen) || bt.size > 0 || q.some((e) => $e.isNew(K(e))), Gr = [
|
|
1314
|
+
...Ln ? [
|
|
1322
1315
|
{
|
|
1323
1316
|
key: "collection",
|
|
1324
1317
|
header: E("collection", "Collection"),
|
|
1325
1318
|
sortable: !0,
|
|
1326
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1319
|
+
render: (e) => /* @__PURE__ */ a(ri, { variant: "outline", children: gt(e.collection) })
|
|
1327
1320
|
}
|
|
1328
1321
|
] : [],
|
|
1329
1322
|
{
|
|
@@ -1338,15 +1331,15 @@ function Zc({
|
|
|
1338
1331
|
// a whole, but nothing on it said so — an underline is the one
|
|
1339
1332
|
// convention people already read as "this goes somewhere".
|
|
1340
1333
|
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
1341
|
-
|
|
1342
|
-
|
|
1334
|
+
bt.get(K(e)) || $e.isNew(K(e)) ? /* @__PURE__ */ a(
|
|
1335
|
+
Vs,
|
|
1343
1336
|
{
|
|
1344
|
-
lock:
|
|
1337
|
+
lock: bt.get(K(e)),
|
|
1345
1338
|
isNew: $e.isNew(K(e)),
|
|
1346
1339
|
dataAttr: "data-queue-live-mark",
|
|
1347
1340
|
hang: !0
|
|
1348
1341
|
}
|
|
1349
|
-
) : /* @__PURE__ */ a(
|
|
1342
|
+
) : /* @__PURE__ */ a(ni, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
|
|
1350
1343
|
/* @__PURE__ */ a(
|
|
1351
1344
|
"span",
|
|
1352
1345
|
{
|
|
@@ -1365,7 +1358,7 @@ function Zc({
|
|
|
1365
1358
|
t
|
|
1366
1359
|
)),
|
|
1367
1360
|
/* @__PURE__ */ a(
|
|
1368
|
-
|
|
1361
|
+
ti,
|
|
1369
1362
|
{
|
|
1370
1363
|
viewers: nl[ps(e.collection, e.item_id)],
|
|
1371
1364
|
dataAttr: "data-queue-presence"
|
|
@@ -1386,9 +1379,9 @@ function Zc({
|
|
|
1386
1379
|
backgroundColor: e.state_color ? `${e.state_color}1a` : void 0,
|
|
1387
1380
|
color: e.state_color ?? void 0
|
|
1388
1381
|
},
|
|
1389
|
-
title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${
|
|
1382
|
+
title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Ae(e.state)}` : Ae(e.state),
|
|
1390
1383
|
children: [
|
|
1391
|
-
|
|
1384
|
+
Ae(e.state),
|
|
1392
1385
|
e.via_addendum && /* @__PURE__ */ a("span", { className: "ml-1 rounded-sm bg-amber-500/15 px-1 text-[9px] font-bold uppercase tracking-wide text-amber-700 dark:text-amber-300", children: "Addendum" })
|
|
1393
1386
|
]
|
|
1394
1387
|
}
|
|
@@ -1398,13 +1391,13 @@ function Zc({
|
|
|
1398
1391
|
key: "owners",
|
|
1399
1392
|
header: E("owners", "Owners"),
|
|
1400
1393
|
sortable: !0,
|
|
1401
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1394
|
+
render: (e) => /* @__PURE__ */ a(di, { owners: e.owners })
|
|
1402
1395
|
},
|
|
1403
1396
|
{
|
|
1404
1397
|
key: "aging_hours",
|
|
1405
1398
|
header: E("aging_hours", "Aging"),
|
|
1406
1399
|
sortable: !0,
|
|
1407
|
-
render: (e) =>
|
|
1400
|
+
render: (e) => wi(e.aging_hours)
|
|
1408
1401
|
},
|
|
1409
1402
|
{
|
|
1410
1403
|
// When the record entered its current state — the same moment Aging
|
|
@@ -1418,7 +1411,7 @@ function Zc({
|
|
|
1418
1411
|
key: "sla_status",
|
|
1419
1412
|
header: E("sla_status", "SLA"),
|
|
1420
1413
|
sortable: !0,
|
|
1421
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1414
|
+
render: (e) => /* @__PURE__ */ a(_i, { status: e.sla_status })
|
|
1422
1415
|
},
|
|
1423
1416
|
{
|
|
1424
1417
|
key: "at_risk",
|
|
@@ -1437,16 +1430,16 @@ function Zc({
|
|
|
1437
1430
|
key: "addendums",
|
|
1438
1431
|
header: E("addendums", "Addendums"),
|
|
1439
1432
|
sortable: !1,
|
|
1440
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1433
|
+
render: (e) => /* @__PURE__ */ a(vi, { summary: e.addendums })
|
|
1441
1434
|
}
|
|
1442
1435
|
] : [],
|
|
1443
|
-
...
|
|
1436
|
+
...ut ? [
|
|
1444
1437
|
{
|
|
1445
1438
|
key: "fulfilment",
|
|
1446
1439
|
header: E("fulfilment", "Shipped"),
|
|
1447
1440
|
sortable: !0,
|
|
1448
1441
|
render: (e) => /* @__PURE__ */ a(
|
|
1449
|
-
|
|
1442
|
+
Ks,
|
|
1450
1443
|
{
|
|
1451
1444
|
collection: e.collection,
|
|
1452
1445
|
itemId: e.item_id,
|
|
@@ -1460,7 +1453,7 @@ function Zc({
|
|
|
1460
1453
|
key: "integrations",
|
|
1461
1454
|
header: E("integrations", "Integrations"),
|
|
1462
1455
|
sortable: !1,
|
|
1463
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1456
|
+
render: (e) => /* @__PURE__ */ a(Qs, { rows: bl[`${e.collection}:${e.item_id}`] })
|
|
1464
1457
|
}
|
|
1465
1458
|
] : [],
|
|
1466
1459
|
...Sr ? [
|
|
@@ -1484,12 +1477,12 @@ function Zc({
|
|
|
1484
1477
|
}
|
|
1485
1478
|
}
|
|
1486
1479
|
] : [],
|
|
1487
|
-
...
|
|
1480
|
+
...mt ? [
|
|
1488
1481
|
{
|
|
1489
1482
|
key: "send_backs",
|
|
1490
1483
|
header: E("send_backs", "Sent back"),
|
|
1491
1484
|
sortable: !0,
|
|
1492
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1485
|
+
render: (e) => /* @__PURE__ */ a(xi, { summary: e.send_backs })
|
|
1493
1486
|
}
|
|
1494
1487
|
] : []
|
|
1495
1488
|
], El = {
|
|
@@ -1510,13 +1503,13 @@ function Zc({
|
|
|
1510
1503
|
{
|
|
1511
1504
|
type: "button",
|
|
1512
1505
|
onClick: (t) => {
|
|
1513
|
-
t.stopPropagation(),
|
|
1506
|
+
t.stopPropagation(), Le.mutate(e);
|
|
1514
1507
|
},
|
|
1515
1508
|
className: "text-[11px] font-medium text-nvr-navy underline dark:text-nvr-cyan",
|
|
1516
1509
|
children: "Claim"
|
|
1517
1510
|
}
|
|
1518
1511
|
)
|
|
1519
|
-
},
|
|
1512
|
+
}, wt = (i == null ? void 0 : i.available_extra_fields) ?? [], _t = Oo("drill.queue"), ae = _t.value, Wr = (e) => _t.push([e]), Ll = (e) => {
|
|
1520
1513
|
var t;
|
|
1521
1514
|
for (const n of (i == null ? void 0 : i.sources) ?? []) {
|
|
1522
1515
|
const r = (t = n.drilldown) == null ? void 0 : t[e];
|
|
@@ -1528,7 +1521,7 @@ function Zc({
|
|
|
1528
1521
|
};
|
|
1529
1522
|
}
|
|
1530
1523
|
return { enabled: !0, layout_id: null, width: null };
|
|
1531
|
-
},
|
|
1524
|
+
}, Al = V(() => {
|
|
1532
1525
|
const e = {};
|
|
1533
1526
|
for (const t of (i == null ? void 0 : i.sources) ?? [])
|
|
1534
1527
|
for (const [n, r] of Object.entries(t.column_formats ?? {}))
|
|
@@ -1541,20 +1534,20 @@ function Zc({
|
|
|
1541
1534
|
const t = new Date(e);
|
|
1542
1535
|
if (!Number.isNaN(t.getTime()))
|
|
1543
1536
|
return {
|
|
1544
|
-
text:
|
|
1545
|
-
title:
|
|
1537
|
+
text: Cs(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
|
|
1538
|
+
title: Ss(t)
|
|
1546
1539
|
};
|
|
1547
1540
|
}
|
|
1548
1541
|
return { text: e, title: e };
|
|
1549
1542
|
}
|
|
1550
|
-
const
|
|
1543
|
+
const An = Jo(u == null ? void 0 : u.inline_edit), Hr = An.enabled ? [
|
|
1551
1544
|
...new Set(
|
|
1552
1545
|
((i == null ? void 0 : i.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
1553
1546
|
)
|
|
1554
1547
|
] : [], Pl = Be({
|
|
1555
1548
|
queries: Hr.map((e) => ({
|
|
1556
1549
|
queryKey: ["cbv-collection-meta", e],
|
|
1557
|
-
queryFn: () => h.request(
|
|
1550
|
+
queryFn: () => h.request(L(`/collections/${e}`)).then((t) => t.data),
|
|
1558
1551
|
staleTime: 10 * 6e4,
|
|
1559
1552
|
retry: !1
|
|
1560
1553
|
}))
|
|
@@ -1569,16 +1562,16 @@ function Zc({
|
|
|
1569
1562
|
});
|
|
1570
1563
|
const { data: Ml } = W({
|
|
1571
1564
|
queryKey: ["my-permissions"],
|
|
1572
|
-
queryFn: () => h.request(
|
|
1573
|
-
enabled:
|
|
1565
|
+
queryFn: () => h.request(L("/security/my/permissions")).then((e) => e.data),
|
|
1566
|
+
enabled: An.enabled && !De,
|
|
1574
1567
|
staleTime: 5 * 6e4
|
|
1575
|
-
}), Yr =
|
|
1568
|
+
}), Yr = Ws(), Jr = (e, t) => {
|
|
1576
1569
|
if (t.includes(".")) return null;
|
|
1577
1570
|
const n = On.get(e.collection);
|
|
1578
1571
|
if (!n) return null;
|
|
1579
|
-
const r =
|
|
1572
|
+
const r = bt.get(K(e));
|
|
1580
1573
|
return r && !r.is_mine ? null : Zo({
|
|
1581
|
-
config:
|
|
1574
|
+
config: An,
|
|
1582
1575
|
key: t,
|
|
1583
1576
|
field: n.fields.get(t),
|
|
1584
1577
|
collection: e.collection,
|
|
@@ -1589,7 +1582,7 @@ function Zc({
|
|
|
1589
1582
|
var r, o, s;
|
|
1590
1583
|
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;
|
|
1591
1584
|
}, Ql = (e, t, n, r, o) => {
|
|
1592
|
-
const s = (b) => `${K(e)}|${b}`, m = [...te].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!Jr(e, b)), p = o === 0 ? null : es(m, t, o),
|
|
1585
|
+
const s = (b) => `${K(e)}|${b}`, m = [...te].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!Jr(e, b)), p = o === 0 ? null : es(m, t, o), S = (b) => b.collection === e.collection && b.item_id === e.item_id, w = (b) => S(b) ? n === "m2o" ? {
|
|
1593
1586
|
...b,
|
|
1594
1587
|
extra_ids: { ...b.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
|
|
1595
1588
|
} : { ...b, extra: { ...b.extra ?? {}, [t]: r } } : b;
|
|
@@ -1604,11 +1597,11 @@ function Zc({
|
|
|
1604
1597
|
next: p ? s(p) : null,
|
|
1605
1598
|
optimistic: () => {
|
|
1606
1599
|
const b = f.getQueriesData({ queryKey: ["queue-items", l] });
|
|
1607
|
-
return f.setQueriesData({ queryKey: ["queue-items", l] }, (
|
|
1608
|
-
const
|
|
1609
|
-
return Array.isArray(
|
|
1600
|
+
return f.setQueriesData({ queryKey: ["queue-items", l] }, (T) => {
|
|
1601
|
+
const k = T;
|
|
1602
|
+
return Array.isArray(k == null ? void 0 : k.data) ? { ...k, data: k.data.map(w) } : Array.isArray(k == null ? void 0 : k.rows) ? { ...k, rows: k.rows.map(w) } : T;
|
|
1610
1603
|
}), () => {
|
|
1611
|
-
for (const [
|
|
1604
|
+
for (const [T, k] of b) f.setQueryData(T, k);
|
|
1612
1605
|
};
|
|
1613
1606
|
},
|
|
1614
1607
|
// Labels, rollups and the row's place in the queue follow the server.
|
|
@@ -1619,7 +1612,7 @@ function Zc({
|
|
|
1619
1612
|
if (!r) return n;
|
|
1620
1613
|
const o = On.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
|
|
1621
1614
|
return /* @__PURE__ */ a(
|
|
1622
|
-
|
|
1615
|
+
Hs,
|
|
1623
1616
|
{
|
|
1624
1617
|
controller: Yr,
|
|
1625
1618
|
cellKey: `${K(e)}|${t}`,
|
|
@@ -1632,7 +1625,7 @@ function Zc({
|
|
|
1632
1625
|
children: n
|
|
1633
1626
|
}
|
|
1634
1627
|
);
|
|
1635
|
-
}, jl =
|
|
1628
|
+
}, jl = wt.map((e) => ({
|
|
1636
1629
|
key: `extra.${e}`,
|
|
1637
1630
|
header: E(`extra.${e}`, lt(e)),
|
|
1638
1631
|
sortable: !0,
|
|
@@ -1643,40 +1636,40 @@ function Zc({
|
|
|
1643
1636
|
{
|
|
1644
1637
|
const o = (n = e.extra) == null ? void 0 : n[t];
|
|
1645
1638
|
if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
1646
|
-
const s = Me(t), m = s ? tt(String(o), s) : String(o), { text: p, title:
|
|
1647
|
-
return (
|
|
1639
|
+
const s = Me(t), m = s ? tt(String(o), s) : String(o), { text: p, title: S } = Kl(m), w = ((i == null ? void 0 : i.extra_field_meta) ?? []).find((k) => k.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], T = Ll(t);
|
|
1640
|
+
return (w == null ? void 0 : w.kind) === "relation" && w.target_collection && b.length > 0 && T.enabled && !w.aggregate ? /* @__PURE__ */ a(
|
|
1648
1641
|
"button",
|
|
1649
1642
|
{
|
|
1650
1643
|
type: "button",
|
|
1651
|
-
onClick: (
|
|
1652
|
-
|
|
1653
|
-
collection:
|
|
1644
|
+
onClick: (k) => {
|
|
1645
|
+
k.stopPropagation(), Wr({
|
|
1646
|
+
collection: w.target_collection,
|
|
1654
1647
|
itemId: b[0],
|
|
1655
|
-
layoutId:
|
|
1656
|
-
width:
|
|
1648
|
+
layoutId: T.layout_id,
|
|
1649
|
+
width: T.width,
|
|
1657
1650
|
title: m
|
|
1658
1651
|
});
|
|
1659
1652
|
},
|
|
1660
|
-
title:
|
|
1653
|
+
title: S,
|
|
1661
1654
|
className: "block max-w-[200px] truncate text-left text-[12px] text-slate-700 underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-nvr-navy hover:decoration-nvr-cyan dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
1662
1655
|
children: p
|
|
1663
1656
|
}
|
|
1664
|
-
) : (
|
|
1657
|
+
) : (w == null ? void 0 : w.kind) === "relation" && w.aggregate ? /* @__PURE__ */ a(
|
|
1665
1658
|
"button",
|
|
1666
1659
|
{
|
|
1667
1660
|
type: "button",
|
|
1668
|
-
onClick: (
|
|
1669
|
-
|
|
1661
|
+
onClick: (k) => {
|
|
1662
|
+
k.stopPropagation(), pn({ row: e, path: t, value: m });
|
|
1670
1663
|
},
|
|
1671
1664
|
title: "Show the rows behind this number",
|
|
1672
1665
|
className: "block max-w-[200px] truncate text-left text-[12px] tabular-nums underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-nvr-navy hover:decoration-nvr-cyan dark:hover:text-nvr-cyan",
|
|
1673
1666
|
children: p
|
|
1674
1667
|
}
|
|
1675
|
-
) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title:
|
|
1668
|
+
) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: S, children: p });
|
|
1676
1669
|
}
|
|
1677
1670
|
}
|
|
1678
1671
|
const Xr = [
|
|
1679
|
-
...
|
|
1672
|
+
...Ln ? ["collection"] : [],
|
|
1680
1673
|
"state",
|
|
1681
1674
|
"owners",
|
|
1682
1675
|
"aging_hours",
|
|
@@ -1684,43 +1677,43 @@ function Zc({
|
|
|
1684
1677
|
"sla_status",
|
|
1685
1678
|
"at_risk",
|
|
1686
1679
|
...ze ? ["addendums"] : [],
|
|
1687
|
-
...
|
|
1680
|
+
...ut ? ["fulfilment"] : [],
|
|
1688
1681
|
...ve ? ["integrations"] : [],
|
|
1689
|
-
...
|
|
1682
|
+
...mt ? ["send_backs"] : [],
|
|
1690
1683
|
...Sr ? ["tasks"] : [],
|
|
1691
|
-
...
|
|
1684
|
+
...wt.map((e) => `extra.${e}`)
|
|
1692
1685
|
], Il = [
|
|
1693
|
-
...
|
|
1686
|
+
...Ln ? ["collection"] : [],
|
|
1694
1687
|
"state",
|
|
1695
1688
|
"owners",
|
|
1696
1689
|
...ze ? ["addendums"] : [],
|
|
1697
|
-
...
|
|
1690
|
+
...ut ? ["fulfilment"] : [],
|
|
1698
1691
|
...ve ? ["integrations"] : [],
|
|
1699
|
-
...
|
|
1692
|
+
...mt ? ["send_backs"] : [],
|
|
1700
1693
|
"aging_hours",
|
|
1701
1694
|
"sla_status",
|
|
1702
1695
|
"at_risk",
|
|
1703
|
-
...
|
|
1696
|
+
...wt.slice(0, 2).map((e) => `extra.${e}`)
|
|
1704
1697
|
], Vl = (u == null ? void 0 : u.default_columns) ?? null, Dn = Qt ?? Vl, te = new Set(Dn ?? Il);
|
|
1705
|
-
ze && !
|
|
1698
|
+
ze && !Rt.has("addendums") && te.add("addendums"), ut && !Rt.has("fulfilment") && te.add("fulfilment"), ve && !Rt.has("integrations") && te.add("integrations"), mt && !Rt.has("send_backs") && te.add("send_backs");
|
|
1706
1699
|
const Gl = new Set(De ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
|
|
1707
1700
|
for (const e of Gl) te.delete(e);
|
|
1708
|
-
const
|
|
1701
|
+
const Nt = [
|
|
1709
1702
|
...(Dn ?? []).filter((e) => Xr.includes(e)),
|
|
1710
1703
|
...Xr.filter((e) => !(Dn ?? []).includes(e))
|
|
1711
1704
|
], Wl = no(ro(ao, { activationConstraint: { distance: 4 } }));
|
|
1712
1705
|
function Hl(e) {
|
|
1713
1706
|
const { active: t, over: n } = e;
|
|
1714
1707
|
if (!n || t.id === n.id) return;
|
|
1715
|
-
const r =
|
|
1708
|
+
const r = Nt.indexOf(String(t.id)), o = Nt.indexOf(String(n.id));
|
|
1716
1709
|
r === -1 || o === -1 || Bt(
|
|
1717
|
-
co(
|
|
1710
|
+
co(Nt, r, o).filter((s) => te.has(s))
|
|
1718
1711
|
);
|
|
1719
1712
|
}
|
|
1720
1713
|
const Zr = Gr.find((e) => e.key === "label"), Yl = {
|
|
1721
1714
|
...Zr,
|
|
1722
1715
|
render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
1723
|
-
/* @__PURE__ */ a(
|
|
1716
|
+
/* @__PURE__ */ a(Rs, { rowId: e.item_id }),
|
|
1724
1717
|
Zr.render(e, ...t)
|
|
1725
1718
|
] })
|
|
1726
1719
|
}, Jl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
|
|
@@ -1740,8 +1733,8 @@ function Zc({
|
|
|
1740
1733
|
return Number.isFinite(o) ? /* @__PURE__ */ a("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ a("span", { children: String(r) });
|
|
1741
1734
|
}
|
|
1742
1735
|
})
|
|
1743
|
-
), Kn = [...Gr, ...jl, ...Jl], ea =
|
|
1744
|
-
|
|
1736
|
+
), Kn = [...Gr, ...jl, ...Jl], ea = ii(
|
|
1737
|
+
Nt,
|
|
1745
1738
|
(e) => {
|
|
1746
1739
|
var n;
|
|
1747
1740
|
const t = (n = Kn.find((r) => r.key === e)) == null ? void 0 : n.header;
|
|
@@ -1752,18 +1745,18 @@ function Zc({
|
|
|
1752
1745
|
key: "__actions__",
|
|
1753
1746
|
header: "",
|
|
1754
1747
|
render: (e) => e.collection === "tasks" || e.collection === en ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
|
|
1755
|
-
|
|
1748
|
+
Es,
|
|
1756
1749
|
{
|
|
1757
1750
|
collection: e.collection,
|
|
1758
1751
|
id: e.item_id,
|
|
1759
1752
|
hasPipeline: e.state != null,
|
|
1760
|
-
onOpen: () =>
|
|
1753
|
+
onOpen: () => xt(e),
|
|
1761
1754
|
onPeek: () => Oe(e),
|
|
1762
1755
|
urlFor: H.urlFor,
|
|
1763
1756
|
onDeleted: () => {
|
|
1764
1757
|
h.request(jn(`/items/${e.collection}/${e.item_id}`)).then(() => {
|
|
1765
1758
|
D.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
1766
|
-
}).catch((t) => D.error(
|
|
1759
|
+
}).catch((t) => D.error($t(t, "Delete failed")));
|
|
1767
1760
|
},
|
|
1768
1761
|
onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
1769
1762
|
bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
|
|
@@ -1772,7 +1765,7 @@ function Zc({
|
|
|
1772
1765
|
) })
|
|
1773
1766
|
}, zt = [
|
|
1774
1767
|
Yl,
|
|
1775
|
-
...
|
|
1768
|
+
...Nt.filter((e) => te.has(e)).map((e) => Kn.find((t) => t.key === e)).filter((e) => e !== void 0),
|
|
1776
1769
|
...me ? [El] : [],
|
|
1777
1770
|
zl
|
|
1778
1771
|
], ta = V(() => {
|
|
@@ -1786,7 +1779,7 @@ function Zc({
|
|
|
1786
1779
|
{ value: "at_risk", label: "At risk" },
|
|
1787
1780
|
{ value: "owners", label: "Owner" },
|
|
1788
1781
|
{ value: "aging", label: "Aging" },
|
|
1789
|
-
...
|
|
1782
|
+
...wt.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: E(`extra.${e}`, lt(e)) }))
|
|
1790
1783
|
], ra = (e) => async (t, n) => {
|
|
1791
1784
|
if (!e.target_collection || !e.display_field) return [];
|
|
1792
1785
|
const r = {
|
|
@@ -1804,15 +1797,15 @@ function Zc({
|
|
|
1804
1797
|
];
|
|
1805
1798
|
s.length > 0 && (r.filter = JSON.stringify(s.length === 1 ? s[0] : { _and: s }));
|
|
1806
1799
|
const p = (await h.request(
|
|
1807
|
-
|
|
1808
|
-
)).data ?? [],
|
|
1809
|
-
for (const
|
|
1810
|
-
const X =
|
|
1800
|
+
L(`/items/${e.target_collection}`, r)
|
|
1801
|
+
)).data ?? [], S = Me(e.path), w = Fe[e.path] ? new Set(Fe[e.path]) : null, b = /* @__PURE__ */ new Set(), T = [];
|
|
1802
|
+
for (const k of p) {
|
|
1803
|
+
const X = k[e.display_field];
|
|
1811
1804
|
if (X == null || X === "") continue;
|
|
1812
1805
|
const Z = String(X);
|
|
1813
|
-
b.has(Z) ||
|
|
1806
|
+
b.has(Z) || w && !w.has(Z) || (b.add(Z), T.push({ label: S ? tt(Z, S) : Z, value: Z }));
|
|
1814
1807
|
}
|
|
1815
|
-
return
|
|
1808
|
+
return T;
|
|
1816
1809
|
}, Pn = new Map(((i == null ? void 0 : i.extra_field_meta) ?? []).map((e) => [e.path, e])), Qe = [
|
|
1817
1810
|
{
|
|
1818
1811
|
key: "collection",
|
|
@@ -1820,7 +1813,7 @@ function Zc({
|
|
|
1820
1813
|
type: "combobox",
|
|
1821
1814
|
multi: !0,
|
|
1822
1815
|
options: ((c == null ? void 0 : c.available_values.collection) ?? []).map((e) => ({
|
|
1823
|
-
label:
|
|
1816
|
+
label: gt(e),
|
|
1824
1817
|
value: e
|
|
1825
1818
|
}))
|
|
1826
1819
|
},
|
|
@@ -1836,7 +1829,7 @@ function Zc({
|
|
|
1836
1829
|
).map((e) => {
|
|
1837
1830
|
var t;
|
|
1838
1831
|
return {
|
|
1839
|
-
label:
|
|
1832
|
+
label: Ae(e),
|
|
1840
1833
|
value: e,
|
|
1841
1834
|
// How many rows sit in it under the other active filters (the State
|
|
1842
1835
|
// filter itself left out, or every other state would read 0).
|
|
@@ -1895,18 +1888,18 @@ function Zc({
|
|
|
1895
1888
|
key: "integrations",
|
|
1896
1889
|
placeholder: E("integrations", "Integrations"),
|
|
1897
1890
|
type: "select",
|
|
1898
|
-
options:
|
|
1891
|
+
options: Bs.map((e) => ({ label: e.label, value: e.value }))
|
|
1899
1892
|
}
|
|
1900
1893
|
] : [],
|
|
1901
|
-
...
|
|
1894
|
+
...ut ? [
|
|
1902
1895
|
{
|
|
1903
1896
|
key: "fulfilment",
|
|
1904
1897
|
placeholder: "Shipped",
|
|
1905
1898
|
type: "select",
|
|
1906
|
-
options:
|
|
1899
|
+
options: Ps
|
|
1907
1900
|
}
|
|
1908
1901
|
] : [],
|
|
1909
|
-
...
|
|
1902
|
+
...mt ? [
|
|
1910
1903
|
{
|
|
1911
1904
|
key: "send_backs",
|
|
1912
1905
|
placeholder: "Sent back",
|
|
@@ -1933,7 +1926,7 @@ function Zc({
|
|
|
1933
1926
|
type: "combobox",
|
|
1934
1927
|
multi: !0,
|
|
1935
1928
|
loadOptions: async (e) => ((await h.request(
|
|
1936
|
-
|
|
1929
|
+
L(`/queues/${l}/label-suggest`, e.trim() ? { q: e.trim() } : {})
|
|
1937
1930
|
)).data ?? []).map((n) => ({ label: n, value: n }))
|
|
1938
1931
|
},
|
|
1939
1932
|
{
|
|
@@ -1946,7 +1939,7 @@ function Zc({
|
|
|
1946
1939
|
value: e.id
|
|
1947
1940
|
}))
|
|
1948
1941
|
},
|
|
1949
|
-
...
|
|
1942
|
+
...wt.map((e) => {
|
|
1950
1943
|
var m, p;
|
|
1951
1944
|
const t = Pn.get(e), n = E(`extra.${e}`, lt(e)), r = { key: `extra.${e}`, placeholder: n }, o = Me(e);
|
|
1952
1945
|
if ((o == null ? void 0 : o.type) === "datetime") return { ...r, type: "date" };
|
|
@@ -1965,7 +1958,7 @@ function Zc({
|
|
|
1965
1958
|
...r,
|
|
1966
1959
|
type: "combobox",
|
|
1967
1960
|
multi: !0,
|
|
1968
|
-
options: s.map((
|
|
1961
|
+
options: s.map((S) => ({ label: o ? tt(S, o) : S, value: S }))
|
|
1969
1962
|
} : (t == null ? void 0 : t.kind) === "relation" ? {
|
|
1970
1963
|
...r,
|
|
1971
1964
|
type: "combobox",
|
|
@@ -1984,18 +1977,18 @@ function Zc({
|
|
|
1984
1977
|
const e = [];
|
|
1985
1978
|
for (const [o, s] of Object.entries(Re)) {
|
|
1986
1979
|
if (!s || Array.isArray(s) && s.length === 0) continue;
|
|
1987
|
-
const m = Qe.find((b) => b.key === o), p = o.startsWith("extra.") ? o.slice(6) : null,
|
|
1980
|
+
const m = Qe.find((b) => b.key === o), p = o.startsWith("extra.") ? o.slice(6) : null, S = p ? Me(p) : null, w = jo({
|
|
1988
1981
|
field: Qn(o),
|
|
1989
1982
|
type: (m == null ? void 0 : m.type) ?? "select",
|
|
1990
1983
|
value: s,
|
|
1991
1984
|
optionLabel: (b) => {
|
|
1992
|
-
var
|
|
1993
|
-
return (
|
|
1985
|
+
var T, k;
|
|
1986
|
+
return (k = (T = m == null ? void 0 : m.options) == null ? void 0 : T.find((X) => X.value === b)) == null ? void 0 : k.label;
|
|
1994
1987
|
},
|
|
1995
|
-
currency: (
|
|
1988
|
+
currency: (S == null ? void 0 : S.type) === "number" && S.prefix === "$",
|
|
1996
1989
|
rangeUnit: m == null ? void 0 : m.range_unit
|
|
1997
1990
|
});
|
|
1998
|
-
|
|
1991
|
+
w && e.push(w);
|
|
1999
1992
|
}
|
|
2000
1993
|
const t = c == null ? void 0 : c.total;
|
|
2001
1994
|
return Uo({
|
|
@@ -2006,7 +1999,7 @@ function Zc({
|
|
|
2006
1999
|
shown: typeof t == "number" ? t : null,
|
|
2007
2000
|
of: (x == null ? void 0 : x.total) ?? null
|
|
2008
2001
|
});
|
|
2009
|
-
})(),
|
|
2002
|
+
})(), St = new Set(Object.keys(ue.current)), Xl = ((e) => {
|
|
2010
2003
|
var n;
|
|
2011
2004
|
if (e.some((r) => r.key === "state")) return e;
|
|
2012
2005
|
const t = Qe.find((r) => r.key === "state");
|
|
@@ -2015,58 +2008,58 @@ function Zc({
|
|
|
2015
2008
|
(() => {
|
|
2016
2009
|
var o;
|
|
2017
2010
|
const e = (s) => {
|
|
2018
|
-
var X, Z,
|
|
2011
|
+
var X, Z, F;
|
|
2019
2012
|
if (!s.key.startsWith("extra.")) return null;
|
|
2020
2013
|
if (s.type === "combobox") return s;
|
|
2021
|
-
const m = s.key.slice(6), p = Pn.get(m),
|
|
2022
|
-
if ((p == null ? void 0 : p.kind) !== "relation" && !
|
|
2023
|
-
const
|
|
2014
|
+
const m = s.key.slice(6), p = Pn.get(m), S = St.has(s.key);
|
|
2015
|
+
if ((p == null ? void 0 : p.kind) !== "relation" && !S) return null;
|
|
2016
|
+
const w = Me(m), b = (X = c == null ? void 0 : c.available_values.extra) == null ? void 0 : X[m], T = s.placeholder.replace(/^Search (.*)…$/, "$1"), k = (p == null ? void 0 : p.kind) === "relation" && p.target_collection && p.display_field ? { collection: p.target_collection, field: p.display_field } : void 0;
|
|
2024
2017
|
return b != null && b.length ? {
|
|
2025
2018
|
key: s.key,
|
|
2026
|
-
placeholder:
|
|
2019
|
+
placeholder: T,
|
|
2027
2020
|
type: "combobox",
|
|
2028
2021
|
multi: !0,
|
|
2029
|
-
cascade:
|
|
2022
|
+
cascade: k,
|
|
2030
2023
|
restricted: !!((Z = Fe[m]) != null && Z.length),
|
|
2031
2024
|
options: b.map((ne) => ({
|
|
2032
|
-
label:
|
|
2025
|
+
label: w && w.type !== "number" ? tt(ne, w) : ne,
|
|
2033
2026
|
value: ne
|
|
2034
2027
|
}))
|
|
2035
2028
|
} : (p == null ? void 0 : p.kind) === "relation" ? {
|
|
2036
2029
|
key: s.key,
|
|
2037
|
-
placeholder:
|
|
2030
|
+
placeholder: T,
|
|
2038
2031
|
type: "combobox",
|
|
2039
2032
|
multi: !0,
|
|
2040
|
-
cascade:
|
|
2041
|
-
restricted: !!((
|
|
2033
|
+
cascade: k,
|
|
2034
|
+
restricted: !!((F = Fe[m]) != null && F.length),
|
|
2042
2035
|
loadOptions: ra(p)
|
|
2043
2036
|
} : null;
|
|
2044
2037
|
};
|
|
2045
2038
|
if (rr.length > 0) {
|
|
2046
2039
|
const s = [], m = /* @__PURE__ */ new Set();
|
|
2047
2040
|
for (const p of rr) {
|
|
2048
|
-
const
|
|
2049
|
-
let
|
|
2041
|
+
const S = (p.path ?? []).join(".");
|
|
2042
|
+
let w;
|
|
2050
2043
|
if (p.key === "state" || /(^|_)state$/.test(((o = p.path) == null ? void 0 : o[0]) ?? ""))
|
|
2051
|
-
|
|
2044
|
+
w = Qe.find((b) => b.key === "state");
|
|
2052
2045
|
else {
|
|
2053
|
-
const b = Qe.filter((
|
|
2046
|
+
const b = Qe.filter((k) => {
|
|
2054
2047
|
var Z;
|
|
2055
|
-
if (!
|
|
2056
|
-
const X =
|
|
2048
|
+
if (!k.key.startsWith("extra.") || m.has(k.key)) return !1;
|
|
2049
|
+
const X = k.key.slice(6);
|
|
2057
2050
|
return ((Z = Pn.get(X)) == null ? void 0 : Z.target_collection) === p.collection;
|
|
2058
|
-
}),
|
|
2059
|
-
|
|
2051
|
+
}), T = b.find((k) => k.key.slice(6).startsWith(`${S}.`)) ?? b[0];
|
|
2052
|
+
w = T ? e(T) : null;
|
|
2060
2053
|
}
|
|
2061
|
-
!
|
|
2054
|
+
!w || m.has(w.key) || (m.add(w.key), s.push(p.label ? { ...w, placeholder: p.label } : w));
|
|
2062
2055
|
}
|
|
2063
2056
|
for (const p of Qe.map(e))
|
|
2064
|
-
p && !m.has(p.key) && (
|
|
2057
|
+
p && !m.has(p.key) && (St.has(p.key) || p.restricted) && s.push(p);
|
|
2065
2058
|
if (s.length > 0) return s;
|
|
2066
2059
|
}
|
|
2067
2060
|
const t = Mn.map(e).filter((s) => s !== null), r = [
|
|
2068
|
-
...t.filter((s) =>
|
|
2069
|
-
...t.filter((s) => !
|
|
2061
|
+
...t.filter((s) => St.has(s.key) || s.restricted),
|
|
2062
|
+
...t.filter((s) => !St.has(s.key) && !s.restricted)
|
|
2070
2063
|
].slice(0, 6);
|
|
2071
2064
|
return r.length > 0 ? r : Mn.filter((s) => s.key === "state" || s.key === "owners");
|
|
2072
2065
|
})()
|
|
@@ -2149,7 +2142,7 @@ function Zc({
|
|
|
2149
2142
|
return r.delete(e), r;
|
|
2150
2143
|
})), Bt([...t]);
|
|
2151
2144
|
}
|
|
2152
|
-
return
|
|
2145
|
+
return At ? (A == null ? void 0 : A((At == null ? void 0 : At.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
|
|
2153
2146
|
/* @__PURE__ */ d("div", { className: "shrink-0", children: [
|
|
2154
2147
|
(c == null ? void 0 : c.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
|
|
2155
2148
|
/* @__PURE__ */ a(bo, { className: "h-4 w-4 shrink-0" }),
|
|
@@ -2161,7 +2154,7 @@ function Zc({
|
|
|
2161
2154
|
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",
|
|
2162
2155
|
"data-queue-toolbar": !0,
|
|
2163
2156
|
children: [
|
|
2164
|
-
J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children:
|
|
2157
|
+
J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: ki.filter((e) => me || e.value !== "claimed").map(
|
|
2165
2158
|
(e, t) => /* @__PURE__ */ a(
|
|
2166
2159
|
"button",
|
|
2167
2160
|
{
|
|
@@ -2193,7 +2186,7 @@ function Zc({
|
|
|
2193
2186
|
className: R(
|
|
2194
2187
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
2195
2188
|
t > 0 && "border-l border-slate-200 dark:border-border",
|
|
2196
|
-
|
|
2189
|
+
$ === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
|
|
2197
2190
|
),
|
|
2198
2191
|
children: e.label
|
|
2199
2192
|
},
|
|
@@ -2236,7 +2229,7 @@ function Zc({
|
|
|
2236
2229
|
}
|
|
2237
2230
|
),
|
|
2238
2231
|
ve && /* @__PURE__ */ a(
|
|
2239
|
-
|
|
2232
|
+
js,
|
|
2240
2233
|
{
|
|
2241
2234
|
label: E("integrations", "Integrations"),
|
|
2242
2235
|
value: _.integrations,
|
|
@@ -2246,8 +2239,8 @@ function Zc({
|
|
|
2246
2239
|
})
|
|
2247
2240
|
}
|
|
2248
2241
|
),
|
|
2249
|
-
/* @__PURE__ */ a(
|
|
2250
|
-
/* @__PURE__ */ a(
|
|
2242
|
+
/* @__PURE__ */ a(Xs, { className: "h-8" }),
|
|
2243
|
+
/* @__PURE__ */ a(Ds, {}),
|
|
2251
2244
|
an > 0 && /* @__PURE__ */ d(
|
|
2252
2245
|
"button",
|
|
2253
2246
|
{
|
|
@@ -2264,28 +2257,28 @@ function Zc({
|
|
|
2264
2257
|
}
|
|
2265
2258
|
),
|
|
2266
2259
|
/* @__PURE__ */ d("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
|
|
2267
|
-
|
|
2260
|
+
$ === "table" && /* @__PURE__ */ d(nt, { children: [
|
|
2268
2261
|
/* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2269
2262
|
"button",
|
|
2270
2263
|
{
|
|
2271
2264
|
type: "button",
|
|
2272
2265
|
className: R(
|
|
2273
2266
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2274
|
-
|
|
2267
|
+
C ? "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"
|
|
2275
2268
|
),
|
|
2276
2269
|
children: [
|
|
2277
2270
|
/* @__PURE__ */ a(wa, { className: "h-3.5 w-3.5" }),
|
|
2278
|
-
|
|
2271
|
+
C ? `Group: ${((da = na.find((e) => e.value === C)) == null ? void 0 : da.label) ?? C}` : "Group"
|
|
2279
2272
|
]
|
|
2280
2273
|
}
|
|
2281
2274
|
) }),
|
|
2282
2275
|
/* @__PURE__ */ a(at, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Ta, { children: [
|
|
2283
|
-
/* @__PURE__ */ a(
|
|
2276
|
+
/* @__PURE__ */ a(ai, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
|
|
2284
2277
|
/* @__PURE__ */ d(Ra, { children: [
|
|
2285
|
-
/* @__PURE__ */ a(
|
|
2286
|
-
/* @__PURE__ */ a(
|
|
2278
|
+
/* @__PURE__ */ a(li, { children: "No attribute found." }),
|
|
2279
|
+
/* @__PURE__ */ a(qt, { value: "__none__", onSelect: () => ot(null), children: "None" }),
|
|
2287
2280
|
na.map((e) => /* @__PURE__ */ a(
|
|
2288
|
-
|
|
2281
|
+
qt,
|
|
2289
2282
|
{
|
|
2290
2283
|
value: e.label,
|
|
2291
2284
|
onSelect: () => ot(e.value),
|
|
@@ -2296,7 +2289,7 @@ function Zc({
|
|
|
2296
2289
|
] })
|
|
2297
2290
|
] }) })
|
|
2298
2291
|
] }),
|
|
2299
|
-
|
|
2292
|
+
$ === "table" && /* @__PURE__ */ d(
|
|
2300
2293
|
"button",
|
|
2301
2294
|
{
|
|
2302
2295
|
type: "button",
|
|
@@ -2313,7 +2306,7 @@ function Zc({
|
|
|
2313
2306
|
]
|
|
2314
2307
|
}
|
|
2315
2308
|
),
|
|
2316
|
-
|
|
2309
|
+
$ === "table" && C && le && /* @__PURE__ */ a(
|
|
2317
2310
|
"button",
|
|
2318
2311
|
{
|
|
2319
2312
|
type: "button",
|
|
@@ -2324,7 +2317,7 @@ function Zc({
|
|
|
2324
2317
|
children: ye.size > 0 ? "Expand all" : "Collapse all"
|
|
2325
2318
|
}
|
|
2326
2319
|
),
|
|
2327
|
-
|
|
2320
|
+
$ === "kanban" && /* @__PURE__ */ d(nt, { children: [
|
|
2328
2321
|
/* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2329
2322
|
"button",
|
|
2330
2323
|
{
|
|
@@ -2340,9 +2333,9 @@ function Zc({
|
|
|
2340
2333
|
}
|
|
2341
2334
|
) }),
|
|
2342
2335
|
/* @__PURE__ */ a(at, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(Ta, { children: /* @__PURE__ */ d(Ra, { children: [
|
|
2343
|
-
/* @__PURE__ */ a(
|
|
2344
|
-
/* @__PURE__ */ a(
|
|
2345
|
-
/* @__PURE__ */ a(
|
|
2336
|
+
/* @__PURE__ */ a(qt, { value: "none", onSelect: () => nn(null), children: "None" }),
|
|
2337
|
+
/* @__PURE__ */ a(qt, { value: "collection", onSelect: () => nn("collection"), children: "Collection" }),
|
|
2338
|
+
/* @__PURE__ */ a(qt, { value: "owner", onSelect: () => nn("owners"), children: "Owner" })
|
|
2346
2339
|
] }) }) })
|
|
2347
2340
|
] }),
|
|
2348
2341
|
G && i && /* @__PURE__ */ d(
|
|
@@ -2359,17 +2352,17 @@ function Zc({
|
|
|
2359
2352
|
]
|
|
2360
2353
|
}
|
|
2361
2354
|
),
|
|
2362
|
-
/* @__PURE__ */ a(
|
|
2355
|
+
/* @__PURE__ */ a(Gs, { listKey: `queue:${l}`, getState: _l }),
|
|
2363
2356
|
/* @__PURE__ */ d(
|
|
2364
2357
|
"button",
|
|
2365
2358
|
{
|
|
2366
2359
|
type: "button",
|
|
2367
2360
|
onClick: () => Va((e) => !e),
|
|
2368
|
-
"aria-expanded":
|
|
2361
|
+
"aria-expanded": ct,
|
|
2369
2362
|
title: "Trends, aging, pace and states",
|
|
2370
2363
|
className: R(
|
|
2371
2364
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2372
|
-
|
|
2365
|
+
ct ? "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"
|
|
2373
2366
|
),
|
|
2374
2367
|
"data-queue-insights-toggle": !0,
|
|
2375
2368
|
children: [
|
|
@@ -2378,7 +2371,7 @@ function Zc({
|
|
|
2378
2371
|
]
|
|
2379
2372
|
}
|
|
2380
2373
|
),
|
|
2381
|
-
|
|
2374
|
+
$ === "table" && /* @__PURE__ */ d(nt, { children: [
|
|
2382
2375
|
/* @__PURE__ */ a(rt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2383
2376
|
"button",
|
|
2384
2377
|
{
|
|
@@ -2399,7 +2392,7 @@ function Zc({
|
|
|
2399
2392
|
children: /* @__PURE__ */ a(so, { items: ea, strategy: io, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: ea.map((e) => {
|
|
2400
2393
|
const t = Kn.find((n) => n.key === e);
|
|
2401
2394
|
return /* @__PURE__ */ a(
|
|
2402
|
-
|
|
2395
|
+
Ci,
|
|
2403
2396
|
{
|
|
2404
2397
|
id: e,
|
|
2405
2398
|
label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
|
|
@@ -2412,7 +2405,7 @@ function Zc({
|
|
|
2412
2405
|
}
|
|
2413
2406
|
) })
|
|
2414
2407
|
] }),
|
|
2415
|
-
|
|
2408
|
+
$ === "table" && Kt && /* @__PURE__ */ d(
|
|
2416
2409
|
"button",
|
|
2417
2410
|
{
|
|
2418
2411
|
type: "button",
|
|
@@ -2427,25 +2420,25 @@ function Zc({
|
|
|
2427
2420
|
]
|
|
2428
2421
|
}
|
|
2429
2422
|
),
|
|
2430
|
-
|
|
2423
|
+
$ === "table" && /* @__PURE__ */ a(
|
|
2431
2424
|
"button",
|
|
2432
2425
|
{
|
|
2433
2426
|
type: "button",
|
|
2434
2427
|
onClick: () => {
|
|
2435
|
-
const e =
|
|
2436
|
-
|
|
2428
|
+
const e = Tt === "compact" ? "comfortable" : "compact";
|
|
2429
|
+
La(e);
|
|
2437
2430
|
try {
|
|
2438
2431
|
localStorage.setItem("nvr_table_density", e);
|
|
2439
2432
|
} catch {
|
|
2440
2433
|
}
|
|
2441
2434
|
},
|
|
2442
2435
|
"aria-label": "Row density",
|
|
2443
|
-
title:
|
|
2436
|
+
title: Tt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
|
|
2444
2437
|
className: "flex h-8 w-8 items-center justify-center rounded-md border border-slate-200 bg-white text-slate-500 shadow-sm hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted",
|
|
2445
|
-
children:
|
|
2438
|
+
children: Tt === "compact" ? /* @__PURE__ */ a(wo, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(_o, { className: "h-3.5 w-3.5" })
|
|
2446
2439
|
}
|
|
2447
2440
|
),
|
|
2448
|
-
|
|
2441
|
+
$ === "table" && Pa && oe.length > 0 && /* @__PURE__ */ d(
|
|
2449
2442
|
"button",
|
|
2450
2443
|
{
|
|
2451
2444
|
type: "button",
|
|
@@ -2555,7 +2548,7 @@ function Zc({
|
|
|
2555
2548
|
)) })
|
|
2556
2549
|
] }),
|
|
2557
2550
|
!dn && Ie && xe && /* @__PURE__ */ a(
|
|
2558
|
-
|
|
2551
|
+
Ms,
|
|
2559
2552
|
{
|
|
2560
2553
|
collection: Ie,
|
|
2561
2554
|
onParsed: (e, t) => xe(`/collections/${Ie}/new`, {
|
|
@@ -2567,7 +2560,7 @@ function Zc({
|
|
|
2567
2560
|
]
|
|
2568
2561
|
}
|
|
2569
2562
|
),
|
|
2570
|
-
|
|
2563
|
+
ct && /* @__PURE__ */ d(
|
|
2571
2564
|
"div",
|
|
2572
2565
|
{
|
|
2573
2566
|
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",
|
|
@@ -2575,19 +2568,19 @@ function Zc({
|
|
|
2575
2568
|
children: [
|
|
2576
2569
|
/* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex divide-x divide-slate-200 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: [
|
|
2577
2570
|
/* @__PURE__ */ a(
|
|
2578
|
-
|
|
2571
|
+
Ft,
|
|
2579
2572
|
{
|
|
2580
2573
|
label: "Total",
|
|
2581
2574
|
count: (x == null ? void 0 : x.total) ?? 0,
|
|
2582
2575
|
filteredCount: z ? z.total : null,
|
|
2583
2576
|
active: Object.values(_).every(Ua) && g === "all",
|
|
2584
2577
|
isLoading: We,
|
|
2585
|
-
...
|
|
2578
|
+
...ht("total"),
|
|
2586
2579
|
onClick: Ia
|
|
2587
2580
|
}
|
|
2588
2581
|
),
|
|
2589
2582
|
/* @__PURE__ */ a(
|
|
2590
|
-
|
|
2583
|
+
Ft,
|
|
2591
2584
|
{
|
|
2592
2585
|
label: "Warning",
|
|
2593
2586
|
count: (x == null ? void 0 : x.sla_warning) ?? 0,
|
|
@@ -2596,12 +2589,12 @@ function Zc({
|
|
|
2596
2589
|
active: _.sla_status === "warning",
|
|
2597
2590
|
isLoading: We,
|
|
2598
2591
|
deltaBadIsUp: !0,
|
|
2599
|
-
...
|
|
2592
|
+
...ht("sla_warning"),
|
|
2600
2593
|
onClick: () => Ve("sla_status", "warning")
|
|
2601
2594
|
}
|
|
2602
2595
|
),
|
|
2603
2596
|
/* @__PURE__ */ a(
|
|
2604
|
-
|
|
2597
|
+
Ft,
|
|
2605
2598
|
{
|
|
2606
2599
|
label: "Breached",
|
|
2607
2600
|
count: (x == null ? void 0 : x.sla_breached) ?? 0,
|
|
@@ -2610,12 +2603,12 @@ function Zc({
|
|
|
2610
2603
|
active: _.sla_status === "breached",
|
|
2611
2604
|
isLoading: We,
|
|
2612
2605
|
deltaBadIsUp: !0,
|
|
2613
|
-
...
|
|
2606
|
+
...ht("sla_breached"),
|
|
2614
2607
|
onClick: () => Ve("sla_status", "breached")
|
|
2615
2608
|
}
|
|
2616
2609
|
),
|
|
2617
2610
|
/* @__PURE__ */ a(
|
|
2618
|
-
|
|
2611
|
+
Ft,
|
|
2619
2612
|
{
|
|
2620
2613
|
label: "At Risk",
|
|
2621
2614
|
count: (x == null ? void 0 : x.at_risk) ?? 0,
|
|
@@ -2624,12 +2617,12 @@ function Zc({
|
|
|
2624
2617
|
active: _.at_risk === "yes",
|
|
2625
2618
|
isLoading: We,
|
|
2626
2619
|
deltaBadIsUp: !0,
|
|
2627
|
-
...
|
|
2620
|
+
...ht("at_risk"),
|
|
2628
2621
|
onClick: () => Ve("at_risk", "yes")
|
|
2629
2622
|
}
|
|
2630
2623
|
),
|
|
2631
2624
|
/* @__PURE__ */ a(
|
|
2632
|
-
|
|
2625
|
+
Ft,
|
|
2633
2626
|
{
|
|
2634
2627
|
label: "Unowned",
|
|
2635
2628
|
count: (x == null ? void 0 : x.unowned) ?? 0,
|
|
@@ -2637,18 +2630,18 @@ function Zc({
|
|
|
2637
2630
|
active: g === "unowned",
|
|
2638
2631
|
isLoading: We,
|
|
2639
2632
|
deltaBadIsUp: !0,
|
|
2640
|
-
...
|
|
2633
|
+
...ht("unowned"),
|
|
2641
2634
|
onClick: () => {
|
|
2642
2635
|
Y(g === "unowned" ? "all" : "unowned"), O(1);
|
|
2643
2636
|
}
|
|
2644
2637
|
}
|
|
2645
2638
|
)
|
|
2646
2639
|
] }),
|
|
2647
|
-
|
|
2648
|
-
["0-1d", "0:24",
|
|
2649
|
-
["1-3d", "24:72",
|
|
2650
|
-
["3-7d", "72:168",
|
|
2651
|
-
["7d+", "168:",
|
|
2640
|
+
pt && x && x.total > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
|
|
2641
|
+
["0-1d", "0:24", pt.d1],
|
|
2642
|
+
["1-3d", "24:72", pt.d3],
|
|
2643
|
+
["3-7d", "72:168", pt.d7],
|
|
2644
|
+
["7d+", "168:", pt.over]
|
|
2652
2645
|
].map(([e, t, n]) => /* @__PURE__ */ d(
|
|
2653
2646
|
"button",
|
|
2654
2647
|
{
|
|
@@ -2696,9 +2689,9 @@ function Zc({
|
|
|
2696
2689
|
Tr.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Tr.map(([e, t]) => {
|
|
2697
2690
|
var n;
|
|
2698
2691
|
return /* @__PURE__ */ a(
|
|
2699
|
-
|
|
2692
|
+
Si,
|
|
2700
2693
|
{
|
|
2701
|
-
label:
|
|
2694
|
+
label: Ae(e),
|
|
2702
2695
|
count: t,
|
|
2703
2696
|
filteredCount: z ? z.by_state[e] ?? 0 : null,
|
|
2704
2697
|
color: ((n = we[e]) == null ? void 0 : n.color) ?? null,
|
|
@@ -2711,12 +2704,12 @@ function Zc({
|
|
|
2711
2704
|
]
|
|
2712
2705
|
}
|
|
2713
2706
|
),
|
|
2714
|
-
|
|
2715
|
-
|
|
2707
|
+
$ !== "workload" && /* @__PURE__ */ a(
|
|
2708
|
+
bi,
|
|
2716
2709
|
{
|
|
2717
2710
|
defs: Xl,
|
|
2718
2711
|
values: _,
|
|
2719
|
-
seededKeys:
|
|
2712
|
+
seededKeys: St,
|
|
2720
2713
|
onApply: (e) => {
|
|
2721
2714
|
Q((t) => ({ ...t, ...e })), O(1);
|
|
2722
2715
|
},
|
|
@@ -2835,7 +2828,7 @@ function Zc({
|
|
|
2835
2828
|
)
|
|
2836
2829
|
}
|
|
2837
2830
|
),
|
|
2838
|
-
/* @__PURE__ */ d("button", { type: "button", onClick: () =>
|
|
2831
|
+
/* @__PURE__ */ d("button", { type: "button", onClick: () => vt(e), children: [
|
|
2839
2832
|
e.name,
|
|
2840
2833
|
e.is_default ? /* @__PURE__ */ a("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ a("span", { className: "ml-1 text-slate-400", children: "· shared" })
|
|
2841
2834
|
] }),
|
|
@@ -2853,7 +2846,7 @@ function Zc({
|
|
|
2853
2846
|
children: /* @__PURE__ */ a(Co, { className: R("h-3 w-3", e.is_default && "fill-current") })
|
|
2854
2847
|
}
|
|
2855
2848
|
),
|
|
2856
|
-
(e.user ===
|
|
2849
|
+
(e.user === N || De) && Xe === e.id && /* @__PURE__ */ a(
|
|
2857
2850
|
"button",
|
|
2858
2851
|
{
|
|
2859
2852
|
type: "button",
|
|
@@ -2886,7 +2879,7 @@ function Zc({
|
|
|
2886
2879
|
children: /* @__PURE__ */ a(To, { className: R("h-3 w-3", Pt(e.id) && "fill-current") })
|
|
2887
2880
|
}
|
|
2888
2881
|
),
|
|
2889
|
-
e.user ===
|
|
2882
|
+
e.user === N && (Rn === e.id ? /* @__PURE__ */ d(
|
|
2890
2883
|
"span",
|
|
2891
2884
|
{
|
|
2892
2885
|
className: "flex shrink-0 items-center gap-1",
|
|
@@ -2944,7 +2937,7 @@ function Zc({
|
|
|
2944
2937
|
/* @__PURE__ */ d(at, { className: "w-[240px] p-3", align: "end", children: [
|
|
2945
2938
|
(() => {
|
|
2946
2939
|
const e = j == null ? void 0 : j.data.find((t) => t.id === Xe);
|
|
2947
|
-
return !e || e.user !==
|
|
2940
|
+
return !e || e.user !== N && !De ? null : /* @__PURE__ */ d(
|
|
2948
2941
|
"button",
|
|
2949
2942
|
{
|
|
2950
2943
|
type: "button",
|
|
@@ -2965,7 +2958,7 @@ function Zc({
|
|
|
2965
2958
|
"input",
|
|
2966
2959
|
{
|
|
2967
2960
|
value: Tn,
|
|
2968
|
-
onChange: (e) =>
|
|
2961
|
+
onChange: (e) => Lr(e.target.value),
|
|
2969
2962
|
placeholder: "View name",
|
|
2970
2963
|
className: "mb-2 w-full rounded-md border border-slate-200 px-2 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
|
|
2971
2964
|
}
|
|
@@ -2974,8 +2967,8 @@ function Zc({
|
|
|
2974
2967
|
/* @__PURE__ */ a(
|
|
2975
2968
|
Vn,
|
|
2976
2969
|
{
|
|
2977
|
-
checked:
|
|
2978
|
-
disabled:
|
|
2970
|
+
checked: Ar || kt,
|
|
2971
|
+
disabled: kt,
|
|
2979
2972
|
onCheckedChange: (e) => Or(e === !0)
|
|
2980
2973
|
}
|
|
2981
2974
|
),
|
|
@@ -2985,7 +2978,7 @@ function Zc({
|
|
|
2985
2978
|
/* @__PURE__ */ a(
|
|
2986
2979
|
Vn,
|
|
2987
2980
|
{
|
|
2988
|
-
checked:
|
|
2981
|
+
checked: kt,
|
|
2989
2982
|
onCheckedChange: (e) => Dr(e === !0)
|
|
2990
2983
|
}
|
|
2991
2984
|
),
|
|
@@ -3008,7 +3001,7 @@ function Zc({
|
|
|
3008
3001
|
)
|
|
3009
3002
|
] }),
|
|
3010
3003
|
/* @__PURE__ */ d("div", { ref: Wt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
|
|
3011
|
-
cr && /* @__PURE__ */ a(
|
|
3004
|
+
cr && /* @__PURE__ */ a(Is, { error: Xa, onRetry: () => void Za(), className: "mb-3" }),
|
|
3012
3005
|
Bn && /* @__PURE__ */ a(
|
|
3013
3006
|
"p",
|
|
3014
3007
|
{
|
|
@@ -3019,7 +3012,7 @@ function Zc({
|
|
|
3019
3012
|
children: Bn
|
|
3020
3013
|
}
|
|
3021
3014
|
),
|
|
3022
|
-
|
|
3015
|
+
$ === "table" ? /* @__PURE__ */ a(Ce, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
|
|
3023
3016
|
"div",
|
|
3024
3017
|
{
|
|
3025
3018
|
ref: $e.rootRef,
|
|
@@ -3036,14 +3029,14 @@ function Zc({
|
|
|
3036
3029
|
"s"
|
|
3037
3030
|
] }),
|
|
3038
3031
|
/* @__PURE__ */ a(
|
|
3039
|
-
|
|
3032
|
+
As,
|
|
3040
3033
|
{
|
|
3041
3034
|
fillHeight: !0,
|
|
3042
3035
|
enterKey: kr.current,
|
|
3043
|
-
density:
|
|
3036
|
+
density: Tt,
|
|
3044
3037
|
minBodyHeight: 360,
|
|
3045
3038
|
columns: zt,
|
|
3046
|
-
rows:
|
|
3039
|
+
rows: q,
|
|
3047
3040
|
rowKey: (e) => `${e.collection}:${e.item_id}`,
|
|
3048
3041
|
total: (c == null ? void 0 : c.total) ?? 0,
|
|
3049
3042
|
page: de,
|
|
@@ -3056,18 +3049,18 @@ function Zc({
|
|
|
3056
3049
|
...al.record(e.collection, e.item_id)
|
|
3057
3050
|
}),
|
|
3058
3051
|
onRowContextMenu: (e, t) => {
|
|
3059
|
-
t.preventDefault(),
|
|
3052
|
+
t.preventDefault(), yt({ x: t.clientX, y: t.clientY, row: e });
|
|
3060
3053
|
},
|
|
3061
3054
|
rowTitle: (e) => {
|
|
3062
|
-
const t =
|
|
3063
|
-
return $e.titleFor(K(e)) ?? (t && !t.is_mine ? ss(t) : void 0) ?? (Kr(e.collection, e.item_id) ?
|
|
3055
|
+
const t = bt.get(K(e));
|
|
3056
|
+
return $e.titleFor(K(e)) ?? (t && !t.is_mine ? ss(t) : void 0) ?? (Kr(e.collection, e.item_id) ? zs : void 0);
|
|
3064
3057
|
},
|
|
3065
3058
|
rowClassName: (e) => R(
|
|
3066
3059
|
Cl(e),
|
|
3067
|
-
Kr(e.collection, e.item_id) &&
|
|
3060
|
+
Kr(e.collection, e.item_id) && Js
|
|
3068
3061
|
),
|
|
3069
3062
|
emptyMessage: cr ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
|
|
3070
|
-
|
|
3063
|
+
Os,
|
|
3071
3064
|
{
|
|
3072
3065
|
icon: Ro,
|
|
3073
3066
|
title: ((pa = c == null ? void 0 : c.empty) == null ? void 0 : pa.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((ba = c == null ? void 0 : c.empty) == null ? void 0 : ba.reason) === "scope_mine" ? "Nothing waiting on you" : ((ha = c == null ? void 0 : c.empty) == null ? void 0 : ha.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
|
|
@@ -3143,9 +3136,9 @@ function Zc({
|
|
|
3143
3136
|
columnFilterRow: !0,
|
|
3144
3137
|
hScrollProxy: !0,
|
|
3145
3138
|
footer: /* @__PURE__ */ a(
|
|
3146
|
-
|
|
3139
|
+
ei,
|
|
3147
3140
|
{
|
|
3148
|
-
collections:
|
|
3141
|
+
collections: ft,
|
|
3149
3142
|
selectedIds: String(_.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
|
|
3150
3143
|
onToggle: (e) => {
|
|
3151
3144
|
const t = e.ids.join(",");
|
|
@@ -3161,26 +3154,26 @@ function Zc({
|
|
|
3161
3154
|
)
|
|
3162
3155
|
]
|
|
3163
3156
|
}
|
|
3164
|
-
) }) }) :
|
|
3165
|
-
|
|
3157
|
+
) }) }) : $ === "kanban" ? /* @__PURE__ */ a(
|
|
3158
|
+
pi,
|
|
3166
3159
|
{
|
|
3167
|
-
items:
|
|
3160
|
+
items: q,
|
|
3168
3161
|
onCardClick: (e) => Gt(e),
|
|
3169
3162
|
onDrop: (e, t) => ll.mutate({ item: e, targetState: t }),
|
|
3170
|
-
onClaim: (e) =>
|
|
3163
|
+
onClaim: (e) => Le.mutate(e),
|
|
3171
3164
|
onRelease: (e) => He.mutate(e),
|
|
3172
3165
|
swimlaneBy: st,
|
|
3173
3166
|
stateLabels: Sn,
|
|
3174
|
-
laneLabel: st === "collection" ?
|
|
3167
|
+
laneLabel: st === "collection" ? gt : void 0,
|
|
3175
3168
|
claimsEnabled: me,
|
|
3176
3169
|
onDraggingChange: (e) => {
|
|
3177
3170
|
zn.current = e;
|
|
3178
3171
|
}
|
|
3179
3172
|
}
|
|
3180
|
-
) : /* @__PURE__ */ a(
|
|
3173
|
+
) : /* @__PURE__ */ a(hi, { queueId: l })
|
|
3181
3174
|
] }),
|
|
3182
3175
|
Kt && ee && /* @__PURE__ */ d(
|
|
3183
|
-
|
|
3176
|
+
ui,
|
|
3184
3177
|
{
|
|
3185
3178
|
count: Pe.length,
|
|
3186
3179
|
claimsEnabled: me,
|
|
@@ -3189,7 +3182,7 @@ function Zc({
|
|
|
3189
3182
|
showTransition: un("transition"),
|
|
3190
3183
|
states: Rr((c == null ? void 0 : c.available_values.state) ?? []).map((e) => ({
|
|
3191
3184
|
value: e,
|
|
3192
|
-
label:
|
|
3185
|
+
label: Ae(e)
|
|
3193
3186
|
})),
|
|
3194
3187
|
busy: Ur,
|
|
3195
3188
|
onClaim: () => En(
|
|
@@ -3219,7 +3212,7 @@ function Zc({
|
|
|
3219
3212
|
type: "button",
|
|
3220
3213
|
onClick: () => {
|
|
3221
3214
|
const e = cs(
|
|
3222
|
-
|
|
3215
|
+
q.filter((t) => Pe.includes(K(t)) && t.collection !== "tasks").map((t) => H.urlFor(qn(t)))
|
|
3223
3216
|
);
|
|
3224
3217
|
e.blocked > 0 || e.capped > 0 ? D.warning($a(e)) : D.success($a(e));
|
|
3225
3218
|
},
|
|
@@ -3230,9 +3223,9 @@ function Zc({
|
|
|
3230
3223
|
}
|
|
3231
3224
|
),
|
|
3232
3225
|
/* @__PURE__ */ a(
|
|
3233
|
-
|
|
3226
|
+
Ts,
|
|
3234
3227
|
{
|
|
3235
|
-
targets:
|
|
3228
|
+
targets: q.filter((e) => Pe.includes(K(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
|
|
3236
3229
|
enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
|
|
3237
3230
|
tone: "light",
|
|
3238
3231
|
disabled: Ur,
|
|
@@ -3245,7 +3238,7 @@ function Zc({
|
|
|
3245
3238
|
}
|
|
3246
3239
|
),
|
|
3247
3240
|
ae != null && ae.length ? /* @__PURE__ */ a(
|
|
3248
|
-
|
|
3241
|
+
Zs,
|
|
3249
3242
|
{
|
|
3250
3243
|
collection: ae[0].collection,
|
|
3251
3244
|
itemId: ae[0].itemId,
|
|
@@ -3254,9 +3247,9 @@ function Zc({
|
|
|
3254
3247
|
width: ae[0].width,
|
|
3255
3248
|
title: ae[0].title,
|
|
3256
3249
|
stack: ae,
|
|
3257
|
-
onPush: (e) =>
|
|
3258
|
-
onPop: () =>
|
|
3259
|
-
onClose: () =>
|
|
3250
|
+
onPush: (e) => _t.push([...ae, e]),
|
|
3251
|
+
onPop: () => _t.back(),
|
|
3252
|
+
onClose: () => _t.back(ae.length)
|
|
3260
3253
|
}
|
|
3261
3254
|
) : null,
|
|
3262
3255
|
B && Na(
|
|
@@ -3277,11 +3270,11 @@ function Zc({
|
|
|
3277
3270
|
{ label: "Open", run: () => Gt(B.row) },
|
|
3278
3271
|
{
|
|
3279
3272
|
label: "Open full record",
|
|
3280
|
-
run: () =>
|
|
3273
|
+
run: () => xt(B.row)
|
|
3281
3274
|
},
|
|
3282
3275
|
{ label: "Peek", run: () => Oe(B.row) },
|
|
3283
3276
|
...me ? [
|
|
3284
|
-
((ka = B.row.claimed_by) == null ? void 0 : ka.id) ===
|
|
3277
|
+
((ka = B.row.claimed_by) == null ? void 0 : ka.id) === N ? { label: "Release claim", run: () => He.mutate(B.row) } : { label: "Claim", run: () => Le.mutate(B.row) }
|
|
3285
3278
|
] : [],
|
|
3286
3279
|
// The friendly id (PW26-76166), never the row id (army 6 M52);
|
|
3287
3280
|
// a record with no number has nothing to copy.
|
|
@@ -3313,7 +3306,7 @@ function Zc({
|
|
|
3313
3306
|
{
|
|
3314
3307
|
type: "button",
|
|
3315
3308
|
onClick: () => {
|
|
3316
|
-
e.run(),
|
|
3309
|
+
e.run(), yt(null);
|
|
3317
3310
|
},
|
|
3318
3311
|
className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
3319
3312
|
children: e.label
|
|
@@ -3329,7 +3322,7 @@ function Zc({
|
|
|
3329
3322
|
{
|
|
3330
3323
|
type: "button",
|
|
3331
3324
|
onClick: () => {
|
|
3332
|
-
sr(B.row, e),
|
|
3325
|
+
sr(B.row, e), yt(null);
|
|
3333
3326
|
},
|
|
3334
3327
|
className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
3335
3328
|
children: [
|
|
@@ -3353,7 +3346,7 @@ function Zc({
|
|
|
3353
3346
|
const n = e.target.elements.namedItem(
|
|
3354
3347
|
"newlabel"
|
|
3355
3348
|
).value.trim();
|
|
3356
|
-
n && (sr(B.row, n),
|
|
3349
|
+
n && (sr(B.row, n), yt(null));
|
|
3357
3350
|
},
|
|
3358
3351
|
className: "px-3 py-1",
|
|
3359
3352
|
children: /* @__PURE__ */ a(
|
|
@@ -3376,7 +3369,7 @@ function Zc({
|
|
|
3376
3369
|
),
|
|
3377
3370
|
or && Na(
|
|
3378
3371
|
/* @__PURE__ */ a(
|
|
3379
|
-
|
|
3372
|
+
$i,
|
|
3380
3373
|
{
|
|
3381
3374
|
queueId: l,
|
|
3382
3375
|
drill: or,
|
|
@@ -3389,19 +3382,19 @@ function Zc({
|
|
|
3389
3382
|
document.body
|
|
3390
3383
|
),
|
|
3391
3384
|
/* @__PURE__ */ a(
|
|
3392
|
-
|
|
3385
|
+
mi,
|
|
3393
3386
|
{
|
|
3394
3387
|
item: _e,
|
|
3395
3388
|
stateLabels: Sn,
|
|
3396
|
-
collectionLabel:
|
|
3389
|
+
collectionLabel: gt,
|
|
3397
3390
|
claimsEnabled: me,
|
|
3398
|
-
columnFormats:
|
|
3391
|
+
columnFormats: Al,
|
|
3399
3392
|
width: u == null ? void 0 : u.sheet_width,
|
|
3400
3393
|
itemLayout: u == null ? void 0 : u.item_layout,
|
|
3401
3394
|
onOpenChange: (e) => {
|
|
3402
3395
|
e || (Oe(null), $n(!1));
|
|
3403
3396
|
},
|
|
3404
|
-
onClaim: (e) =>
|
|
3397
|
+
onClaim: (e) => Le.mutate(e),
|
|
3405
3398
|
onRelease: (e) => He.mutate(e),
|
|
3406
3399
|
workNextActive: yl,
|
|
3407
3400
|
onNext: () => _e && Er(_e),
|
|
@@ -3411,32 +3404,32 @@ function Zc({
|
|
|
3411
3404
|
Mt.dialog
|
|
3412
3405
|
] });
|
|
3413
3406
|
}
|
|
3414
|
-
function
|
|
3407
|
+
function $i({
|
|
3415
3408
|
queueId: l,
|
|
3416
3409
|
drill: y,
|
|
3417
|
-
onClose:
|
|
3410
|
+
onClose: A,
|
|
3418
3411
|
onOpenRecord: P
|
|
3419
3412
|
}) {
|
|
3420
3413
|
const G = Ea(), { data: f, isLoading: h } = W({
|
|
3421
3414
|
queryKey: ["queue-agg-rows", l, y.row.collection, y.row.item_id, y.path],
|
|
3422
3415
|
queryFn: () => G.request(
|
|
3423
|
-
|
|
3416
|
+
L(`/queues/${l}/aggregate-rows`, {
|
|
3424
3417
|
collection: y.row.collection,
|
|
3425
3418
|
item_id: y.row.item_id,
|
|
3426
3419
|
path: y.path
|
|
3427
3420
|
})
|
|
3428
|
-
).then((
|
|
3421
|
+
).then((N) => N.data)
|
|
3429
3422
|
});
|
|
3430
3423
|
return /* @__PURE__ */ a(
|
|
3431
3424
|
"div",
|
|
3432
3425
|
{
|
|
3433
3426
|
className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/30 p-6",
|
|
3434
|
-
onClick:
|
|
3427
|
+
onClick: A,
|
|
3435
3428
|
children: /* @__PURE__ */ d(
|
|
3436
3429
|
"div",
|
|
3437
3430
|
{
|
|
3438
3431
|
className: "max-h-[70vh] w-[480px] overflow-y-auto rounded-xl border border-slate-200 bg-white p-4 shadow-2xl dark:border-border dark:bg-card",
|
|
3439
|
-
onClick: (
|
|
3432
|
+
onClick: (N) => N.stopPropagation(),
|
|
3440
3433
|
children: [
|
|
3441
3434
|
/* @__PURE__ */ d("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
3442
3435
|
/* @__PURE__ */ d("div", { children: [
|
|
@@ -3453,24 +3446,24 @@ function qi({
|
|
|
3453
3446
|
"button",
|
|
3454
3447
|
{
|
|
3455
3448
|
type: "button",
|
|
3456
|
-
onClick:
|
|
3449
|
+
onClick: A,
|
|
3457
3450
|
className: "rounded-md px-2 py-1 text-[12px] text-slate-400 hover:bg-muted",
|
|
3458
3451
|
children: "✕"
|
|
3459
3452
|
}
|
|
3460
3453
|
)
|
|
3461
3454
|
] }),
|
|
3462
|
-
h ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "Loading…" }) : ((f == null ? void 0 : f.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: f == null ? void 0 : f.rows.map((
|
|
3455
|
+
h ? /* @__PURE__ */ a("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "Loading…" }) : ((f == null ? void 0 : f.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: f == null ? void 0 : f.rows.map((N) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between gap-3 py-1.5", children: [
|
|
3463
3456
|
/* @__PURE__ */ a(
|
|
3464
3457
|
"button",
|
|
3465
3458
|
{
|
|
3466
3459
|
type: "button",
|
|
3467
|
-
onClick: () => f.target && P(f.target, String(
|
|
3460
|
+
onClick: () => f.target && P(f.target, String(N.id)),
|
|
3468
3461
|
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",
|
|
3469
|
-
children:
|
|
3462
|
+
children: N.label
|
|
3470
3463
|
}
|
|
3471
3464
|
),
|
|
3472
|
-
/* @__PURE__ */ a("span", { className: "shrink-0 tabular-nums text-[12px] text-slate-600 dark:text-slate-300", children:
|
|
3473
|
-
] }, String(
|
|
3465
|
+
/* @__PURE__ */ a("span", { className: "shrink-0 tabular-nums text-[12px] text-slate-600 dark:text-slate-300", children: N.leaf_value == null ? "—" : String(N.leaf_value) })
|
|
3466
|
+
] }, String(N.id))) })
|
|
3474
3467
|
]
|
|
3475
3468
|
}
|
|
3476
3469
|
)
|
|
@@ -3478,5 +3471,5 @@ function qi({
|
|
|
3478
3471
|
);
|
|
3479
3472
|
}
|
|
3480
3473
|
export {
|
|
3481
|
-
|
|
3474
|
+
Xc as QueueWorklist
|
|
3482
3475
|
};
|