@nivaro/react 0.3.78 → 0.3.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/chat/ChatPanel.js +867 -833
- package/dist/shared/components/item-edit/MembershipSetField.js +165 -147
- package/dist/shared/components/queue/QueueBulkBar.js +70 -66
- package/dist/shared/components/queue/QueueBulkMove.js +215 -0
- package/dist/shared/components/queue/QueueWorklist.js +790 -773
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as d, Fragment as Se, jsx as
|
|
1
|
+
import { jsxs as d, Fragment as Se, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useSensors as bo, useSensor as fo, PointerSensor as ho, DndContext as go, closestCenter as xo } from "@dnd-kit/core";
|
|
3
3
|
import { SortableContext as yo, verticalListSortingStrategy as ko, arrayMove as vo, useSortable as wo } from "@dnd-kit/sortable";
|
|
4
4
|
import { CSS as _o } from "@dnd-kit/utilities";
|
|
5
|
-
import { useQueryClient as No, useQuery as X, useMutation as Te, useQueries as
|
|
6
|
-
import { AlertTriangle as So, FileDiff as Co, RefreshCw as $o, Rows3 as Fa, Flame as qo, Sparkles as Ro, Download as Fo, BarChart3 as Lo, SlidersHorizontal as To, ListChecks as Eo, Rows4 as Ao, Rows2 as Oo, Play as Ko, Plus as on, ChevronDown as La, Star as
|
|
7
|
-
import { useState as w, useRef as Q, useEffect as
|
|
5
|
+
import { useQueryClient as No, useQuery as X, useMutation as Te, useQueries as Ve } from "@tanstack/react-query";
|
|
6
|
+
import { AlertTriangle as So, FileDiff as Co, RefreshCw as $o, Rows3 as Fa, Flame as qo, Sparkles as Ro, Download as Fo, BarChart3 as Lo, SlidersHorizontal as To, ListChecks as Eo, Rows4 as Ao, Rows2 as Oo, Play as Ko, Plus as on, ChevronDown as La, Star as Do, Pin as Po, Loader2 as Mo, Check as Bo, Save as Qo, Bell as jo, Inbox as Uo, GripVertical as Vo } from "lucide-react";
|
|
7
|
+
import { useState as w, useRef as Q, useEffect as P, useMemo as J } from "react";
|
|
8
8
|
import { createPortal as Ta } from "react-dom";
|
|
9
9
|
import { toast as A } from "sonner";
|
|
10
10
|
import { useNivaroClient as ja, useItemEditAuth as Ea, useItemNavigation as Io, useNavigation as Go, useOverlayState as Wo } from "../../context.js";
|
|
@@ -17,7 +17,7 @@ import { deepenForLightSurface as Zo } from "../../lib/display-prefs.js";
|
|
|
17
17
|
import { evaluateExpression as es } from "../../lib/expression.js";
|
|
18
18
|
import { clauseFromControlValue as ts, filterSentence as ns } from "../../lib/filter-sentence.js";
|
|
19
19
|
import { deliverLive as rs, releaseLiveOwner as as } from "../../lib/focus-mode.js";
|
|
20
|
-
import { formatMultiValue as
|
|
20
|
+
import { formatMultiValue as Ie } from "../../lib/format-value.js";
|
|
21
21
|
import { createCursorBook as ls, pageRequest as os, noteNextCursor as ss } from "../../lib/keyset-pager.js";
|
|
22
22
|
import { normalizeInlineEdit as is, inlineM2oTarget as cs, inlineChoices as ds, inlineEditFor as us, nextInlineKey as ms } from "../../lib/list-inline-edit.js";
|
|
23
23
|
import { sanitizeQueueLinkState as ps, readListLinkFromLocation as bs, dropListLinkParam as fs, encodeListLink as hs, replaceListLinkParam as gs } from "../../lib/list-link.js";
|
|
@@ -33,10 +33,10 @@ import { cascadeFilter as Ts, fetchCascadeRelations as Es } from "../../lib/quic
|
|
|
33
33
|
import { useOptionalRealtime as As } from "../../lib/realtime.js";
|
|
34
34
|
import { copyIdText as Ka } from "../../lib/record-ref.js";
|
|
35
35
|
import { rowHighlightTextClass as Os, rowHighlightClass as Ks } from "../../lib/row-highlight.js";
|
|
36
|
-
import { userErrorMessage as
|
|
37
|
-
import { useMyScopes as
|
|
36
|
+
import { userErrorMessage as ut } from "../../lib/safe-error.js";
|
|
37
|
+
import { useMyScopes as Ds, matchScopeDimension as Ps } from "../../lib/use-my-scopes.js";
|
|
38
38
|
import { useNewItemLayouts as Ms } from "../../lib/use-new-item-layouts.js";
|
|
39
|
-
import { formatNumber as ee, cn as L, formatDateTime as
|
|
39
|
+
import { formatNumber as ee, cn as L, formatDateTime as Da, titleCase as Xn, humanHours as Bs, formatRelative as Qs, formatDate as js } from "../../lib/utils.js";
|
|
40
40
|
import { usePublishAskContext as Us, useAskRecordDrag as Vs } from "../ai/ask-context.js";
|
|
41
41
|
import { useBuiltinGate as Is, BulkActionButtons as Gs } from "../bulk/BulkActionButtons.js";
|
|
42
42
|
import { BulkCompareButton as Ws } from "../bulk/BulkCompareButton.js";
|
|
@@ -51,7 +51,7 @@ import { FulfilmentPill as ri, FULFILMENT_FILTER_OPTIONS as ai } from "../Fulfil
|
|
|
51
51
|
import { ImportFromFileButton as li } from "../import/ImportFromFileButton.js";
|
|
52
52
|
import { IntegrationDots as oi, INTEGRATIONS_FILTER_OPTIONS as si } from "../integrations/IntegrationDots.js";
|
|
53
53
|
import { IntegrationsFilterPill as ii } from "../integrations/IntegrationsFilterPill.js";
|
|
54
|
-
import { readQueueReturn as ci, queueReturnApplies as di, writeQueueReturn as
|
|
54
|
+
import { readQueueReturn as ci, queueReturnApplies as di, writeQueueReturn as Pa } from "../item-edit/QueueReturnChip.js";
|
|
55
55
|
import { ListLoadError as ui } from "../ListLoadError.js";
|
|
56
56
|
import { LiveRowMark as mi } from "../LiveRowMark.js";
|
|
57
57
|
import { CopyListLinkButton as pi } from "../list/CopyListLinkButton.js";
|
|
@@ -67,7 +67,7 @@ import { Badge as Ni } from "../ui/badge.js";
|
|
|
67
67
|
import { Checkbox as er } from "../ui/checkbox.js";
|
|
68
68
|
import { Command as Ma, CommandInput as Si, CommandList as Ba, CommandEmpty as Ci, CommandItem as Ot } from "../ui/command.js";
|
|
69
69
|
import { Label as $i } from "../ui/label.js";
|
|
70
|
-
import { Popover as
|
|
70
|
+
import { Popover as mt, PopoverTrigger as pt, PopoverContent as bt } from "../ui/popover.js";
|
|
71
71
|
import { Skeleton as qi } from "../ui/skeleton.js";
|
|
72
72
|
import { dedupeChooserKeys as Ri } from "./column-chooser.js";
|
|
73
73
|
import { groupSumPathsFor as Fi } from "./group-sums.js";
|
|
@@ -75,16 +75,17 @@ import { offscreenPill as Li, statsOutrunRows as Ti, stateAspectEffect as Ei } f
|
|
|
75
75
|
import { OwnerAvatars as Ai } from "./OwnerAvatars.js";
|
|
76
76
|
import { pathHeader as Oi } from "./path-label.js";
|
|
77
77
|
import { QueueBulkBar as Ki } from "./QueueBulkBar.js";
|
|
78
|
+
import { QueueBulkMove as Di } from "./QueueBulkMove.js";
|
|
78
79
|
import { QueueItemSheet as Pi } from "./QueueItemSheet.js";
|
|
79
|
-
import { QueueKanbanBoard as
|
|
80
|
-
import { QueueQuickFilters as
|
|
81
|
-
import { QueueWorkloadView as
|
|
82
|
-
import { useTransitionNote as
|
|
83
|
-
import { worklistCsv as
|
|
84
|
-
import { extraChoiceText as Kt, atRiskBreakdown as Qa, worklistKeyTarget as
|
|
85
|
-
function
|
|
80
|
+
import { QueueKanbanBoard as Mi } from "./QueueKanbanBoard.js";
|
|
81
|
+
import { QueueQuickFilters as Bi } from "./QueueQuickFilters.js";
|
|
82
|
+
import { QueueWorkloadView as Qi } from "./QueueWorkloadView.js";
|
|
83
|
+
import { useTransitionNote as ji, needsTransitionNote as Ui } from "./transition-note.js";
|
|
84
|
+
import { worklistCsv as Vi, worklistCsvName as Ii } from "./worklist-csv.js";
|
|
85
|
+
import { extraChoiceText as Kt, atRiskBreakdown as Qa, worklistKeyTarget as Gi } from "./worklist-helpers.js";
|
|
86
|
+
function Wi({ summary: l }) {
|
|
86
87
|
if (!l || l.count === 0)
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
|
|
88
89
|
const k = [l.last_from, l.last_to].filter(Boolean).join(" → "), K = [
|
|
89
90
|
k ? `Last: ${k}` : null,
|
|
90
91
|
l.last_at ? Qs(l.last_at) : null,
|
|
@@ -109,14 +110,14 @@ function Gi({ summary: l }) {
|
|
|
109
110
|
}
|
|
110
111
|
);
|
|
111
112
|
}
|
|
112
|
-
const
|
|
113
|
+
const Hi = 50, sn = "nivaro_addendums", Ji = [
|
|
113
114
|
{ value: "mine", label: "My Items" },
|
|
114
115
|
{ value: "unowned", label: "No Owners" },
|
|
115
116
|
{ value: "claimed", label: "Claimed by me" },
|
|
116
117
|
{ value: "all", label: "All Items" }
|
|
117
118
|
];
|
|
118
|
-
function
|
|
119
|
-
if (!l || l.total === 0) return /* @__PURE__ */
|
|
119
|
+
function Yi({ summary: l }) {
|
|
120
|
+
if (!l || l.total === 0) return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
|
|
120
121
|
const k = l.active > 0, K = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", M = l.cost_impact, Z = M != null && M !== 0 ? `${M > 0 ? "+" : "−"}$${Math.abs(M).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
|
|
121
122
|
return /* @__PURE__ */ d(
|
|
122
123
|
"span",
|
|
@@ -127,7 +128,7 @@ function Ji({ summary: l }) {
|
|
|
127
128
|
k ? "border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-500/50 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300"
|
|
128
129
|
),
|
|
129
130
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ r(
|
|
131
132
|
"span",
|
|
132
133
|
{
|
|
133
134
|
"aria-hidden": !0,
|
|
@@ -146,42 +147,42 @@ function Ji({ summary: l }) {
|
|
|
146
147
|
}
|
|
147
148
|
);
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
+
function zi(l) {
|
|
150
151
|
return Bs(l);
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
-
return l ? /* @__PURE__ */
|
|
153
|
+
function Xi({ status: l }) {
|
|
154
|
+
return l ? /* @__PURE__ */ r("span", { className: L("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__ */ r("span", { className: "text-slate-300", children: "—" });
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
+
function Zi({ points: l, inline: k = !1 }) {
|
|
156
157
|
if (l.length < 2) return null;
|
|
157
|
-
const K = k ? 40 : 64, M = k ? 14 : 18, Z = Math.max(...l),
|
|
158
|
-
(de, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(M - 2 - (de -
|
|
158
|
+
const K = k ? 40 : 64, M = k ? 14 : 18, Z = Math.max(...l), f = Math.min(...l), h = Z - f || 1, S = K / (l.length - 1), Y = l.map(
|
|
159
|
+
(de, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(M - 2 - (de - f) / h * (M - 4)).toFixed(1)}`
|
|
159
160
|
).join(" ");
|
|
160
|
-
return /* @__PURE__ */
|
|
161
|
+
return /* @__PURE__ */ r(
|
|
161
162
|
"svg",
|
|
162
163
|
{
|
|
163
164
|
width: K,
|
|
164
165
|
height: M,
|
|
165
166
|
className: k ? "opacity-40" : "mt-1.5 opacity-40",
|
|
166
167
|
"aria-hidden": "true",
|
|
167
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ r("path", { d: Y, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
|
|
168
169
|
}
|
|
169
170
|
);
|
|
170
171
|
}
|
|
171
|
-
function
|
|
172
|
+
function Dt({
|
|
172
173
|
label: l,
|
|
173
174
|
count: k,
|
|
174
175
|
filteredCount: K,
|
|
175
176
|
active: M,
|
|
176
177
|
isLoading: Z,
|
|
177
|
-
tone:
|
|
178
|
-
trend:
|
|
178
|
+
tone: f,
|
|
179
|
+
trend: h,
|
|
179
180
|
delta: S,
|
|
180
181
|
deltaBadIsUp: Y,
|
|
181
182
|
breakdown: de,
|
|
182
183
|
onClick: g
|
|
183
184
|
}) {
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
+
return /* @__PURE__ */ r(
|
|
185
186
|
"button",
|
|
186
187
|
{
|
|
187
188
|
type: "button",
|
|
@@ -198,8 +199,8 @@ function Pt({
|
|
|
198
199
|
"grow justify-center sm:justify-start",
|
|
199
200
|
M && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10"
|
|
200
201
|
),
|
|
201
|
-
children: Z ? /* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
202
|
+
children: Z ? /* @__PURE__ */ r(qi, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Se, { children: [
|
|
203
|
+
/* @__PURE__ */ r(
|
|
203
204
|
"span",
|
|
204
205
|
{
|
|
205
206
|
className: L(
|
|
@@ -207,25 +208,25 @@ function Pt({
|
|
|
207
208
|
k === 0 && !M ? "text-slate-500 dark:text-slate-400" : "text-slate-900 dark:text-foreground"
|
|
208
209
|
),
|
|
209
210
|
children: K != null ? /* @__PURE__ */ d(Se, { children: [
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(Zn, { value: K, format: ee }) }),
|
|
211
212
|
/* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
212
213
|
"/ ",
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ r(Zn, { value: k, format: ee })
|
|
214
215
|
] })
|
|
215
|
-
] }) : /* @__PURE__ */
|
|
216
|
+
] }) : /* @__PURE__ */ r(Zn, { value: k, format: ee })
|
|
216
217
|
}
|
|
217
218
|
),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ r(
|
|
219
220
|
"span",
|
|
220
221
|
{
|
|
221
222
|
className: L(
|
|
222
223
|
"whitespace-nowrap text-[11px] font-medium leading-none",
|
|
223
|
-
|
|
224
|
+
f === "red" ? "text-red-700 dark:text-red-400" : f === "amber" ? "text-amber-800 dark:text-amber-400" : "text-slate-500 dark:text-muted-foreground"
|
|
224
225
|
),
|
|
225
226
|
children: l
|
|
226
227
|
}
|
|
227
228
|
),
|
|
228
|
-
de && /* @__PURE__ */
|
|
229
|
+
de && /* @__PURE__ */ r(
|
|
229
230
|
"span",
|
|
230
231
|
{
|
|
231
232
|
"data-stat-breakdown": !0,
|
|
@@ -246,30 +247,30 @@ function Pt({
|
|
|
246
247
|
]
|
|
247
248
|
}
|
|
248
249
|
),
|
|
249
|
-
|
|
250
|
+
h && k > 0 && /* @__PURE__ */ r(Zi, { points: h, inline: !0 })
|
|
250
251
|
] })
|
|
251
252
|
}
|
|
252
253
|
);
|
|
253
254
|
}
|
|
254
|
-
function
|
|
255
|
+
function ec({
|
|
255
256
|
label: l,
|
|
256
257
|
count: k,
|
|
257
258
|
filteredCount: K,
|
|
258
259
|
color: M,
|
|
259
260
|
active: Z,
|
|
260
|
-
onClick:
|
|
261
|
+
onClick: f
|
|
261
262
|
}) {
|
|
262
263
|
return /* @__PURE__ */ d(
|
|
263
264
|
"button",
|
|
264
265
|
{
|
|
265
266
|
type: "button",
|
|
266
|
-
onClick:
|
|
267
|
+
onClick: f,
|
|
267
268
|
className: L(
|
|
268
269
|
"flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px] font-medium transition-colors",
|
|
269
270
|
Z ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300"
|
|
270
271
|
),
|
|
271
272
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ r(
|
|
273
274
|
"span",
|
|
274
275
|
{
|
|
275
276
|
className: "h-2 w-2 shrink-0 rounded-full",
|
|
@@ -277,8 +278,8 @@ function Zi({
|
|
|
277
278
|
}
|
|
278
279
|
),
|
|
279
280
|
l,
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ r("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: K != null ? /* @__PURE__ */ d(Se, { children: [
|
|
282
|
+
/* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ee(K) }),
|
|
282
283
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
283
284
|
" / ",
|
|
284
285
|
ee(k)
|
|
@@ -288,35 +289,35 @@ function Zi({
|
|
|
288
289
|
}
|
|
289
290
|
);
|
|
290
291
|
}
|
|
291
|
-
const
|
|
292
|
-
function
|
|
292
|
+
const Ge = Oi;
|
|
293
|
+
function tc({
|
|
293
294
|
id: l,
|
|
294
295
|
label: k,
|
|
295
296
|
checked: K,
|
|
296
297
|
onCheckedChange: M
|
|
297
298
|
}) {
|
|
298
|
-
const { attributes: Z, listeners:
|
|
299
|
+
const { attributes: Z, listeners: f, setNodeRef: h, transform: S, transition: Y, isDragging: de } = wo({
|
|
299
300
|
id: l
|
|
300
301
|
}), g = {
|
|
301
302
|
transform: _o.Transform.toString(S),
|
|
302
303
|
transition: Y,
|
|
303
304
|
opacity: de ? 0.4 : 1
|
|
304
305
|
}, te = `col-toggle-${l}`;
|
|
305
|
-
return /* @__PURE__ */ d("div", { ref:
|
|
306
|
-
/* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ d("div", { ref: h, style: g, className: "flex items-center gap-2 text-[12px]", children: [
|
|
307
|
+
/* @__PURE__ */ r(
|
|
307
308
|
"span",
|
|
308
309
|
{
|
|
309
310
|
...Z,
|
|
310
|
-
...
|
|
311
|
+
...f,
|
|
311
312
|
className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
|
|
312
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ r(Vo, { className: "h-3.5 w-3.5" })
|
|
313
314
|
}
|
|
314
315
|
),
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ r(er, { id: te, checked: K, onCheckedChange: M }),
|
|
317
|
+
/* @__PURE__ */ r($i, { htmlFor: te, className: "cursor-pointer text-[12px] font-normal", children: k })
|
|
317
318
|
] });
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function Dd({
|
|
320
321
|
queueId: l,
|
|
321
322
|
realtime: k,
|
|
322
323
|
renderError: K,
|
|
@@ -324,20 +325,20 @@ function Od({
|
|
|
324
325
|
onAsk: Z
|
|
325
326
|
}) {
|
|
326
327
|
var pa, ba, fa, ha, ga, xa, ya, ka, va, wa, _a, Na, Sa, Ca, $a, qa, Ra;
|
|
327
|
-
const
|
|
328
|
+
const f = No(), h = ja(), { userId: S } = Ea(), Y = Io(), { navigate: de } = Go(), [g, te] = w("all"), [ue, D] = w(1), tr = Q(ls()), [Pt, Ua] = w(() => {
|
|
328
329
|
try {
|
|
329
330
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
330
331
|
} catch {
|
|
331
332
|
return "compact";
|
|
332
333
|
}
|
|
333
|
-
}), [
|
|
334
|
-
xn.current =
|
|
334
|
+
}), [$, We] = w("table"), [B, He] = w(""), [_, j] = w({}), [Mt, nr] = w(() => /* @__PURE__ */ new Set()), [R, ft] = w(null), [Ce, cn] = w(/* @__PURE__ */ new Set()), [ht, dn] = w(null), [Je, un] = w(null), [mn, Bt] = w(0), pn = Q(0), Ee = ws(), bn = As(), fn = Q({}).current, rr = Q(/* @__PURE__ */ new Set()), [Va, Ia] = w(0), [ar, Ga] = w(0), be = Q(!1), Qt = Q([]), lr = Q(null), hn = Q(!1), gn = Q(0), xn = Q("table");
|
|
335
|
+
xn.current = $;
|
|
335
336
|
const yn = 25, { data: c, error: jt } = X({
|
|
336
337
|
queryKey: ["queue-meta", l],
|
|
337
|
-
queryFn: () =>
|
|
338
|
+
queryFn: () => h.request(O(`/queues/${l}`)).then((e) => e.data),
|
|
338
339
|
enabled: !!l
|
|
339
|
-
}), { scopes: Ut, ready: or } =
|
|
340
|
-
|
|
340
|
+
}), { scopes: Ut, ready: or } = Ds(), sr = Q(!1), [ir, cr] = w(!1), [fe, Wa] = w({}), he = Q({});
|
|
341
|
+
P(() => {
|
|
341
342
|
if (sr.current || !or || !c) return;
|
|
342
343
|
sr.current = !0;
|
|
343
344
|
const e = (c.extra_field_meta ?? []).filter(
|
|
@@ -348,8 +349,8 @@ function Od({
|
|
|
348
349
|
return;
|
|
349
350
|
}
|
|
350
351
|
(async () => {
|
|
351
|
-
const t = {}, n = {},
|
|
352
|
-
const u = await
|
|
352
|
+
const t = {}, n = {}, a = async (o, s) => {
|
|
353
|
+
const u = await h.request(
|
|
353
354
|
O(`/items/${o.target_collection}`, {
|
|
354
355
|
filter: JSON.stringify({ id: { _in: s } }),
|
|
355
356
|
fields: `id,${o.display_field}`,
|
|
@@ -363,13 +364,13 @@ function Od({
|
|
|
363
364
|
];
|
|
364
365
|
};
|
|
365
366
|
for (const o of e) {
|
|
366
|
-
const s =
|
|
367
|
+
const s = Ps(Ut, { collection: o.target_collection });
|
|
367
368
|
if (!s) continue;
|
|
368
369
|
const u = `extra.${o.path}`;
|
|
369
370
|
try {
|
|
370
371
|
const m = Ut.restricted[s.name] ?? [];
|
|
371
372
|
if (m.length > 0) {
|
|
372
|
-
const y = await
|
|
373
|
+
const y = await a(o, m);
|
|
373
374
|
y.length > 0 && (n[u.slice(6)] = y);
|
|
374
375
|
}
|
|
375
376
|
} catch {
|
|
@@ -378,13 +379,13 @@ function Od({
|
|
|
378
379
|
Object.keys(n).length > 0 && Wa(n), Object.keys(t).length > 0 && (he.current = t, j((o) => ({ ...o, ...t }))), cr(!0);
|
|
379
380
|
})();
|
|
380
381
|
}, [or, Ut, c]);
|
|
381
|
-
const
|
|
382
|
-
queryKey: ["queue-browser-quick-filters",
|
|
383
|
-
queryFn: () =>
|
|
382
|
+
const Ye = ((ba = (pa = c == null ? void 0 : c.sources) == null ? void 0 : pa.find((e) => e.type === "collection")) == null ? void 0 : ba.collection) ?? null, { data: dr = [] } = X({
|
|
383
|
+
queryKey: ["queue-browser-quick-filters", Ye],
|
|
384
|
+
queryFn: () => h.request(O(`/collections/${Ye}`)).then((e) => {
|
|
384
385
|
var t, n;
|
|
385
386
|
return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
|
|
386
387
|
}).catch(() => []),
|
|
387
|
-
enabled: !!
|
|
388
|
+
enabled: !!Ye,
|
|
388
389
|
staleTime: 3e5
|
|
389
390
|
}), le = J(() => {
|
|
390
391
|
const e = /* @__PURE__ */ new Set(), t = [];
|
|
@@ -393,7 +394,7 @@ function Od({
|
|
|
393
394
|
return t;
|
|
394
395
|
}, [c == null ? void 0 : c.sources]), Vt = Ms(
|
|
395
396
|
le.length === 1 ? le[0] : null
|
|
396
|
-
), kn = M === !0 || Array.isArray(M) && le.length > 0 && le.every((e) => M.includes(e)), ge = (c == null ? void 0 : c.claims_enabled) !== !1, p = c == null ? void 0 : c.display_config, Ae = (p == null ? void 0 : p.views) ?? ["table", "kanban", "workload"], Ha = (p == null ? void 0 : p.work_next) !== !1, It = (p == null ? void 0 : p.bulk_actions) !== !1,
|
|
397
|
+
), kn = M === !0 || Array.isArray(M) && le.length > 0 && le.every((e) => M.includes(e)), ge = (c == null ? void 0 : c.claims_enabled) !== !1, p = c == null ? void 0 : c.display_config, Ae = (p == null ? void 0 : p.views) ?? ["table", "kanban", "workload"], Ha = (p == null ? void 0 : p.work_next) !== !1, It = (p == null ? void 0 : p.bulk_actions) !== !1, Oe = Is(
|
|
397
398
|
[
|
|
398
399
|
...new Set(
|
|
399
400
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -401,16 +402,16 @@ function Od({
|
|
|
401
402
|
],
|
|
402
403
|
(p == null ? void 0 : p.bulk_action_keys) ?? null
|
|
403
404
|
), T = (e, t) => {
|
|
404
|
-
var n,
|
|
405
|
-
return ((
|
|
405
|
+
var n, a;
|
|
406
|
+
return ((a = (n = c == null ? void 0 : c.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : a.trim()) || t;
|
|
406
407
|
}, ur = Q(!1);
|
|
407
|
-
|
|
408
|
-
!c || ur.current || (ur.current = !0,
|
|
408
|
+
P(() => {
|
|
409
|
+
!c || ur.current || (ur.current = !0, He("-priority"));
|
|
409
410
|
}, [c]);
|
|
410
411
|
const [z, Ja] = w(!1);
|
|
411
|
-
|
|
412
|
-
c != null && c.display_config && !Ae.includes(
|
|
413
|
-
}, [c,
|
|
412
|
+
P(() => {
|
|
413
|
+
c != null && c.display_config && !Ae.includes($) && We(Ae[0]);
|
|
414
|
+
}, [c, $, Ae]), P(() => {
|
|
414
415
|
if (!(c != null && c.sources)) return;
|
|
415
416
|
const e = bn ? (b, E) => bn.subscribeCollections(b, E) : k == null ? void 0 : k.subscribe;
|
|
416
417
|
if (!e) return;
|
|
@@ -421,7 +422,7 @@ function Od({
|
|
|
421
422
|
];
|
|
422
423
|
if (t.length === 0) return;
|
|
423
424
|
const n = /* @__PURE__ */ new Set();
|
|
424
|
-
let
|
|
425
|
+
let a = null, o = null, s = null;
|
|
425
426
|
const u = () => {
|
|
426
427
|
s || (s = setTimeout(() => {
|
|
427
428
|
s = null, Ga((b) => b + 1);
|
|
@@ -432,7 +433,7 @@ function Od({
|
|
|
432
433
|
Qt.current = [], Bt((b) => b + 1);
|
|
433
434
|
return;
|
|
434
435
|
}
|
|
435
|
-
be.current = !0,
|
|
436
|
+
be.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
|
|
436
437
|
}, 900));
|
|
437
438
|
}, y = (b) => {
|
|
438
439
|
let E = !1, v = 0, ae = !1;
|
|
@@ -446,9 +447,9 @@ function Od({
|
|
|
446
447
|
const Le = Ei(ln, xn.current === "kanban");
|
|
447
448
|
ae = !0, Le.refresh && (E = !0), v += Le.pill;
|
|
448
449
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
for (const Le of n)
|
|
450
|
+
a || (a = setTimeout(() => {
|
|
451
|
+
a = null;
|
|
452
|
+
for (const Le of n) f.invalidateQueries({ queryKey: [Le] });
|
|
452
453
|
n.clear();
|
|
453
454
|
}, 300));
|
|
454
455
|
continue;
|
|
@@ -460,59 +461,59 @@ function Od({
|
|
|
460
461
|
v > 0 && (pn.current += v), E && m(), ae && u();
|
|
461
462
|
}, N = e(t, (b) => rs(fn, [b ?? {}], y));
|
|
462
463
|
return () => {
|
|
463
|
-
N(), as(fn),
|
|
464
|
+
N(), as(fn), a && clearTimeout(a), o && clearTimeout(o), s && clearTimeout(s);
|
|
464
465
|
};
|
|
465
|
-
}, [bn, k, c == null ? void 0 : c.sources,
|
|
466
|
-
const
|
|
466
|
+
}, [bn, k, c == null ? void 0 : c.sources, f, l, S, fn]);
|
|
467
|
+
const Ke = Ho(_, 350), Ya = JSON.stringify(Ke) === JSON.stringify(_), vn = Q(!1), $e = $ === "table" && !!R, mr = Fi(c), xe = (() => {
|
|
467
468
|
const e = {};
|
|
468
|
-
for (const [t, n] of Object.entries(
|
|
469
|
+
for (const [t, n] of Object.entries(Ke))
|
|
469
470
|
if (n) {
|
|
470
471
|
if (Array.isArray(n)) {
|
|
471
472
|
n.length > 0 && (e[t] = n);
|
|
472
473
|
continue;
|
|
473
474
|
}
|
|
474
475
|
if (t === "aging_hours") {
|
|
475
|
-
const [
|
|
476
|
-
|
|
476
|
+
const [a, o] = n.split(":"), s = {};
|
|
477
|
+
a && (s.min = Number(a)), o && (s.max = Number(o)), (s.min !== void 0 || s.max !== void 0) && (e[t] = s);
|
|
477
478
|
continue;
|
|
478
479
|
}
|
|
479
480
|
e[t] = n;
|
|
480
481
|
}
|
|
481
482
|
return e;
|
|
482
483
|
})();
|
|
483
|
-
function
|
|
484
|
-
j((n) => ({ ...n, [e]: n[e] === t ? "" : t })),
|
|
484
|
+
function ze(e, t) {
|
|
485
|
+
j((n) => ({ ...n, [e]: n[e] === t ? "" : t })), D(1);
|
|
485
486
|
}
|
|
486
487
|
function za(e) {
|
|
487
488
|
j((t) => {
|
|
488
|
-
const n = t.state,
|
|
489
|
+
const n = t.state, a = Array.isArray(n) ? n : n ? [n] : [], o = a.includes(e) ? a.filter((s) => s !== e) : [...a, e];
|
|
489
490
|
return { ...t, state: o };
|
|
490
|
-
}),
|
|
491
|
+
}), D(1);
|
|
491
492
|
}
|
|
492
493
|
const Xa = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Za = (e) => !e || Array.isArray(e) && e.length === 0;
|
|
493
494
|
function el() {
|
|
494
|
-
j({ ...he.current }), te("all"),
|
|
495
|
+
j({ ...he.current }), te("all"), D(1);
|
|
495
496
|
}
|
|
496
|
-
const [
|
|
497
|
+
const [gt, tl] = w(() => {
|
|
497
498
|
try {
|
|
498
499
|
return localStorage.getItem("nvr_queue_insights_open") === "1";
|
|
499
500
|
} catch {
|
|
500
501
|
return !1;
|
|
501
502
|
}
|
|
502
503
|
});
|
|
503
|
-
|
|
504
|
+
P(() => {
|
|
504
505
|
try {
|
|
505
|
-
localStorage.setItem("nvr_queue_insights_open",
|
|
506
|
+
localStorage.setItem("nvr_queue_insights_open", gt ? "1" : "0");
|
|
506
507
|
} catch {
|
|
507
508
|
}
|
|
508
|
-
}, [
|
|
509
|
+
}, [gt]);
|
|
509
510
|
const { data: nl = [] } = X({
|
|
510
511
|
queryKey: ["queue-view-subs", l],
|
|
511
|
-
queryFn: () =>
|
|
512
|
+
queryFn: () => h.request(O("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
|
|
512
513
|
staleTime: 3e4
|
|
513
514
|
}), Gt = (e) => nl.find((t) => t.queue_view_id === e), rl = (e) => {
|
|
514
515
|
const t = Gt(e);
|
|
515
|
-
(t ?
|
|
516
|
+
(t ? h.request(zn(`/notification-subscriptions/${t.id}`)) : h.request(
|
|
516
517
|
ce("/notification-subscriptions", {
|
|
517
518
|
queue_id: l,
|
|
518
519
|
queue_view_id: e,
|
|
@@ -521,8 +522,8 @@ function Od({
|
|
|
521
522
|
)).then(() => {
|
|
522
523
|
A.success(
|
|
523
524
|
t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
|
|
524
|
-
),
|
|
525
|
-
}).catch((
|
|
525
|
+
), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
|
|
526
|
+
}).catch((a) => A.error(ut(a, "Failed")));
|
|
526
527
|
}, [pr, wn] = w(null), _n = [
|
|
527
528
|
...new Set(
|
|
528
529
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -533,7 +534,7 @@ function Od({
|
|
|
533
534
|
const e = {};
|
|
534
535
|
for (const t of _n.slice(0, 6))
|
|
535
536
|
try {
|
|
536
|
-
const n = await
|
|
537
|
+
const n = await h.request(
|
|
537
538
|
O("/custom-actions", { collection: t })
|
|
538
539
|
);
|
|
539
540
|
e[t] = n.data ?? [];
|
|
@@ -545,32 +546,32 @@ function Od({
|
|
|
545
546
|
enabled: _n.length > 0,
|
|
546
547
|
staleTime: 6e4
|
|
547
548
|
}), ll = (e) => al[e] ?? [], ol = (e, t) => {
|
|
548
|
-
|
|
549
|
-
A.success(`${e.label} ran`),
|
|
549
|
+
h.request(ce(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
|
|
550
|
+
A.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
550
551
|
}).catch((n) => {
|
|
551
|
-
const
|
|
552
|
-
A.error((
|
|
552
|
+
const a = n.response;
|
|
553
|
+
A.error((a == null ? void 0 : a.error) ?? ut(n, `${e.label} failed`));
|
|
553
554
|
});
|
|
554
555
|
}, { data: Nn = [] } = X({
|
|
555
556
|
queryKey: ["queue-triage-labels", l],
|
|
556
|
-
queryFn: () =>
|
|
557
|
+
queryFn: () => h.request(O(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
|
|
557
558
|
staleTime: 3e4
|
|
558
559
|
}), br = (e, t) => {
|
|
559
|
-
|
|
560
|
+
h.request(
|
|
560
561
|
ce(`/queues/${l}/triage-labels/toggle`, {
|
|
561
562
|
collection: e.collection,
|
|
562
563
|
item_id: e.item_id,
|
|
563
564
|
label: t
|
|
564
565
|
})
|
|
565
566
|
).then(() => {
|
|
566
|
-
|
|
567
|
-
}).catch((n) => A.error(
|
|
567
|
+
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
|
|
568
|
+
}).catch((n) => A.error(ut(n, "Label failed")));
|
|
568
569
|
}, {
|
|
569
570
|
data: i,
|
|
570
571
|
isLoading: fr,
|
|
571
|
-
isFetching:
|
|
572
|
+
isFetching: xt,
|
|
572
573
|
isPlaceholderData: sl,
|
|
573
|
-
dataUpdatedAt:
|
|
574
|
+
dataUpdatedAt: se,
|
|
574
575
|
isError: hr,
|
|
575
576
|
error: il,
|
|
576
577
|
refetch: cl
|
|
@@ -580,12 +581,12 @@ function Od({
|
|
|
580
581
|
l,
|
|
581
582
|
g,
|
|
582
583
|
B,
|
|
583
|
-
|
|
584
|
-
|
|
584
|
+
Ke,
|
|
585
|
+
$ === "table" && !R ? ue : "all",
|
|
585
586
|
R
|
|
586
587
|
],
|
|
587
588
|
queryFn: async () => {
|
|
588
|
-
const e = !$e &&
|
|
589
|
+
const e = !$e && $ === "table", t = JSON.stringify([l, g, B, xe, yn]), n = e ? os(tr.current, t, ue, "").after : void 0, a = await h.request(
|
|
589
590
|
O(`/queues/${l}/items`, {
|
|
590
591
|
scope: g,
|
|
591
592
|
// Last State Change is Aging read the other way round: the newest
|
|
@@ -597,10 +598,10 @@ function Od({
|
|
|
597
598
|
...$e ? {
|
|
598
599
|
group_by: R,
|
|
599
600
|
...mr.length ? { group_sums: mr.join(",") } : {}
|
|
600
|
-
} :
|
|
601
|
+
} : $ === "table" ? { page: ue, limit: yn, ...n ? { after: n } : {} } : {}
|
|
601
602
|
})
|
|
602
603
|
);
|
|
603
|
-
return n && ss(tr.current, t, ue,
|
|
604
|
+
return n && ss(tr.current, t, ue, a.next_cursor), a;
|
|
604
605
|
},
|
|
605
606
|
// Wait for display_config AND scope seeding so the first fetch uses the
|
|
606
607
|
// configured defaults and already carries the viewer's restricted filters.
|
|
@@ -615,19 +616,19 @@ function Od({
|
|
|
615
616
|
placeholderData: (e) => e
|
|
616
617
|
});
|
|
617
618
|
i && !vn.current && (vn.current = !0);
|
|
618
|
-
const
|
|
619
|
+
const Xe = Object.entries(he.current).filter(
|
|
619
620
|
([e, t]) => {
|
|
620
621
|
var n;
|
|
621
622
|
return !((n = fe[e.slice(6)]) != null && n.length) && JSON.stringify(xe[e] ?? null) === JSON.stringify(t);
|
|
622
623
|
}
|
|
623
|
-
).map(([e]) => e), gr =
|
|
624
|
-
Object.entries(xe).filter(([e]) => !
|
|
624
|
+
).map(([e]) => e), gr = Xe.length > 0 && Object.keys(xe).every((e) => Xe.includes(e)), xr = Object.fromEntries(
|
|
625
|
+
Object.entries(xe).filter(([e]) => !Xe.includes(e))
|
|
625
626
|
), { data: dl } = X({
|
|
626
627
|
queryKey: ["queue-default-hidden", l, g, xr],
|
|
627
|
-
enabled: !!l && !!i && !
|
|
628
|
+
enabled: !!l && !!i && !xt && i.total === 0 && ((fa = i.empty) == null ? void 0 : fa.reason) === "filters" && Xe.length > 0 && !gr,
|
|
628
629
|
staleTime: 3e4,
|
|
629
630
|
retry: !1,
|
|
630
|
-
queryFn: () =>
|
|
631
|
+
queryFn: () => h.request(
|
|
631
632
|
O(`/queues/${l}/items`, {
|
|
632
633
|
scope: g,
|
|
633
634
|
filters: JSON.stringify(xr),
|
|
@@ -635,50 +636,50 @@ function Od({
|
|
|
635
636
|
limit: 1
|
|
636
637
|
})
|
|
637
638
|
).then((e) => Number(e.total ?? 0))
|
|
638
|
-
}), ye = gr ? Math.max(0, (((ha = i == null ? void 0 : i.stats) == null ? void 0 : ha.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : dl ?? 0, yr = (e) =>
|
|
639
|
+
}), ye = gr ? Math.max(0, (((ha = i == null ? void 0 : i.stats) == null ? void 0 : ha.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : dl ?? 0, yr = (e) => Xe.map(e).join(" and "), kr = () => {
|
|
639
640
|
j((e) => {
|
|
640
641
|
const t = { ...e };
|
|
641
|
-
for (const n of
|
|
642
|
+
for (const n of Xe) delete t[n];
|
|
642
643
|
return t;
|
|
643
|
-
}),
|
|
644
|
+
}), D(1);
|
|
644
645
|
};
|
|
645
|
-
|
|
646
|
-
if (typeof window > "u" || !
|
|
646
|
+
P(() => {
|
|
647
|
+
if (typeof window > "u" || !se) return;
|
|
647
648
|
const e = window;
|
|
648
649
|
e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
|
|
649
650
|
const t = e.__nvrQueueTrace, n = {
|
|
650
651
|
queue: l,
|
|
651
|
-
at:
|
|
652
|
+
at: se,
|
|
652
653
|
scope: g,
|
|
653
654
|
sort: B,
|
|
654
|
-
filters: JSON.stringify(
|
|
655
|
+
filters: JSON.stringify(Ke),
|
|
655
656
|
page: ue
|
|
656
|
-
},
|
|
657
|
-
t.push(n), t.length > 50 && t.shift(),
|
|
658
|
-
}, [
|
|
659
|
-
const
|
|
657
|
+
}, a = t.find((o) => o.queue === l);
|
|
658
|
+
t.push(n), t.length > 50 && t.shift(), a && a !== n && se - Number(a.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: a, second: n });
|
|
659
|
+
}, [se]);
|
|
660
|
+
const Ze = fr && !i || !z || !ir && !i, vr = (xt && !fr || sl && xt) && !be.current, ul = J(
|
|
660
661
|
() => ($e ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
661
662
|
[$e, i == null ? void 0 : i.data]
|
|
662
|
-
), ml = Rs(ul), Wt =
|
|
663
|
-
pending:
|
|
663
|
+
), ml = Rs(ul), Wt = ji(), wr = Jo(xt && !be.current), pl = Yo({
|
|
664
|
+
pending: xt && !be.current,
|
|
664
665
|
request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
|
|
665
666
|
noun: "items"
|
|
666
667
|
}), bl = qs();
|
|
667
668
|
async function _r(e, t) {
|
|
668
669
|
var m;
|
|
669
|
-
const
|
|
670
|
-
if (!
|
|
670
|
+
const a = (await h.request(O(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
|
|
671
|
+
if (!a || a.states.length === 0)
|
|
671
672
|
throw new Error("This item has no workflow instance");
|
|
672
|
-
const o =
|
|
673
|
+
const o = a.states.find((y) => y.key === t);
|
|
673
674
|
if (!o) throw new Error("Target state not found");
|
|
674
|
-
const s =
|
|
675
|
+
const s = a.available_transitions.find(
|
|
675
676
|
(y) => y.to_state === o.id
|
|
676
677
|
);
|
|
677
678
|
if (!s) throw new Error("No transition available to move this item here");
|
|
678
679
|
let u = null;
|
|
679
|
-
if (
|
|
680
|
+
if (Ui(s) && (u = await Wt.ask(((m = s.label) == null ? void 0 : m.trim()) || "Move"), !u))
|
|
680
681
|
throw new Error("Not moved — this move needs a note");
|
|
681
|
-
await
|
|
682
|
+
await h.request(
|
|
682
683
|
ce(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
|
|
683
684
|
transition_id: s.id,
|
|
684
685
|
...u ? { comment: u } : {}
|
|
@@ -690,40 +691,40 @@ function Od({
|
|
|
690
691
|
await _r(e, t);
|
|
691
692
|
},
|
|
692
693
|
onSuccess: () => {
|
|
693
|
-
|
|
694
|
+
f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
694
695
|
},
|
|
695
696
|
onError: (e) => {
|
|
696
|
-
A.error(
|
|
697
|
+
A.error(ut(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
697
698
|
}
|
|
698
|
-
}),
|
|
699
|
-
mutationFn: (e) =>
|
|
699
|
+
}), De = Te({
|
|
700
|
+
mutationFn: (e) => h.request(
|
|
700
701
|
ce(`/queues/${l}/claim`, {
|
|
701
702
|
source_collection: e.collection,
|
|
702
703
|
item_id: e.item_id
|
|
703
704
|
})
|
|
704
705
|
),
|
|
705
|
-
onSuccess: () =>
|
|
706
|
+
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
706
707
|
onError: () => A.error("Failed to claim item")
|
|
707
|
-
}),
|
|
708
|
-
mutationFn: (e) =>
|
|
708
|
+
}), et = Te({
|
|
709
|
+
mutationFn: (e) => h.request(
|
|
709
710
|
ce(`/queues/${l}/release`, {
|
|
710
711
|
source_collection: e.collection,
|
|
711
712
|
item_id: e.item_id
|
|
712
713
|
})
|
|
713
714
|
),
|
|
714
|
-
onSuccess: () =>
|
|
715
|
+
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
715
716
|
onError: () => A.error("Failed to release item")
|
|
716
|
-
}), { data:
|
|
717
|
+
}), { data: tt } = X({
|
|
717
718
|
queryKey: ["queue-column-prefs", l],
|
|
718
|
-
queryFn: () =>
|
|
719
|
+
queryFn: () => h.request(O(`/queues/${l}/column-prefs`)),
|
|
719
720
|
enabled: !!l
|
|
720
|
-
}), [
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
}, [
|
|
721
|
+
}), [yt, Ht] = w(null), [nt, Sn] = w(null);
|
|
722
|
+
P(() => {
|
|
723
|
+
tt && Sn(tt.data.default_view_id);
|
|
724
|
+
}, [tt]);
|
|
724
725
|
const [hl, Nr] = w({}), ke = $e ? (i == null ? void 0 : i.groups) ?? null : null, Jt = (ke ?? []).filter((e) => !Ce.has(e.key)).map((e) => e.key).flatMap(
|
|
725
726
|
(e) => Array.from({ length: hl[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
|
|
726
|
-
), Cn =
|
|
727
|
+
), Cn = Ve({
|
|
727
728
|
queries: Jt.map(({ key: e, page: t }) => ({
|
|
728
729
|
queryKey: [
|
|
729
730
|
"queue-items",
|
|
@@ -731,12 +732,12 @@ function Od({
|
|
|
731
732
|
"group-rows",
|
|
732
733
|
g,
|
|
733
734
|
B,
|
|
734
|
-
|
|
735
|
+
Ke,
|
|
735
736
|
R,
|
|
736
737
|
e,
|
|
737
738
|
t
|
|
738
739
|
],
|
|
739
|
-
queryFn: () =>
|
|
740
|
+
queryFn: () => h.request(
|
|
740
741
|
O(`/queues/${l}/items`, {
|
|
741
742
|
scope: g,
|
|
742
743
|
sort: B === "state_entered" ? "-aging_hours" : B === "-state_entered" ? "aging_hours" : B,
|
|
@@ -744,7 +745,7 @@ function Od({
|
|
|
744
745
|
group_by: R,
|
|
745
746
|
group_key: e,
|
|
746
747
|
page: t,
|
|
747
|
-
limit:
|
|
748
|
+
limit: Hi
|
|
748
749
|
})
|
|
749
750
|
).then((n) => ({ key: e, rows: n.data })),
|
|
750
751
|
enabled: !!i && $e,
|
|
@@ -754,12 +755,12 @@ function Od({
|
|
|
754
755
|
const e = /* @__PURE__ */ new Map();
|
|
755
756
|
return Cn.forEach((t, n) => {
|
|
756
757
|
if (!t.data) return;
|
|
757
|
-
const
|
|
758
|
-
e.set(
|
|
758
|
+
const a = Jt[n].key;
|
|
759
|
+
e.set(a, [...e.get(a) ?? [], ...t.data.rows]);
|
|
759
760
|
}), e;
|
|
760
761
|
}, [gl, Jt.map((e) => `${e.key}\0${e.page}`).join("")]), xl = new Set(
|
|
761
762
|
Cn.flatMap((e, t) => e.isFetching ? [Jt[t].key] : [])
|
|
762
|
-
),
|
|
763
|
+
), C = ke ? [...$n.values()].flat() : (i == null ? void 0 : i.data) ?? [];
|
|
763
764
|
Us(
|
|
764
765
|
l ? {
|
|
765
766
|
queue: {
|
|
@@ -767,13 +768,13 @@ function Od({
|
|
|
767
768
|
label: c == null ? void 0 : c.name,
|
|
768
769
|
scope: g,
|
|
769
770
|
filters: JSON.stringify(xe),
|
|
770
|
-
items:
|
|
771
|
+
items: C.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
|
|
771
772
|
}
|
|
772
773
|
} : null
|
|
773
774
|
);
|
|
774
|
-
const yl = Vs(),
|
|
775
|
-
queryKey: ["queue-live-stats", l, g,
|
|
776
|
-
queryFn: () =>
|
|
775
|
+
const yl = Vs(), kt = C.some((e) => e.fulfilment !== void 0), vt = C.some((e) => e.send_backs !== void 0), { data: rt, dataUpdatedAt: Sr } = X({
|
|
776
|
+
queryKey: ["queue-live-stats", l, g, Ke, ar],
|
|
777
|
+
queryFn: () => h.request(
|
|
777
778
|
O(`/queues/${l}/items`, {
|
|
778
779
|
scope: g,
|
|
779
780
|
filters: JSON.stringify(xe),
|
|
@@ -785,24 +786,24 @@ function Od({
|
|
|
785
786
|
staleTime: Number.POSITIVE_INFINITY,
|
|
786
787
|
placeholderData: (e) => e,
|
|
787
788
|
retry: !1
|
|
788
|
-
}), Yt = !!
|
|
789
|
-
|
|
789
|
+
}), Yt = !!rt && Sr > se, x = Yt ? rt.stats : i == null ? void 0 : i.stats, I = Yt ? rt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, Cr = Yt ? rt.state_counts : i == null ? void 0 : i.state_counts;
|
|
790
|
+
P(() => {
|
|
790
791
|
if (!Yt) return;
|
|
791
792
|
const e = gn.current > 0 || hn.current, t = Li({
|
|
792
793
|
pending: pn.current,
|
|
793
|
-
liveTotal:
|
|
794
|
+
liveTotal: rt.total,
|
|
794
795
|
rowsTotal: i == null ? void 0 : i.total,
|
|
795
796
|
// Only a table re-reads its rows quietly; the other views keep the pill.
|
|
796
|
-
busy: e ||
|
|
797
|
+
busy: e || $ !== "table"
|
|
797
798
|
});
|
|
798
|
-
pn.current = 0, t > 0 && Bt((
|
|
799
|
-
liveTotal:
|
|
799
|
+
pn.current = 0, t > 0 && Bt((a) => a + t), Ti({
|
|
800
|
+
liveTotal: rt.total,
|
|
800
801
|
rowsTotal: i == null ? void 0 : i.total,
|
|
801
802
|
// Grouped tables too (army 8 b08-N6): their headers count the whole set, and
|
|
802
803
|
// nothing else re-read them — "37 of 38" with the strip at 38 for minutes.
|
|
803
|
-
table:
|
|
804
|
+
table: $ === "table",
|
|
804
805
|
busy: e
|
|
805
|
-
}) && (be.current = !0,
|
|
806
|
+
}) && (be.current = !0, f.invalidateQueries({
|
|
806
807
|
queryKey: $e ? ["queue-items", l] : ["queue-items", l, g]
|
|
807
808
|
}).finally(() => {
|
|
808
809
|
be.current = !1;
|
|
@@ -810,59 +811,59 @@ function Od({
|
|
|
810
811
|
}, [Sr]);
|
|
811
812
|
const qn = (ga = I ?? x) == null ? void 0 : ga.aging, $r = Q(void 0);
|
|
812
813
|
!_.aging_hours && qn && ($r.current = qn);
|
|
813
|
-
const
|
|
814
|
-
rr.current = new Set(
|
|
815
|
-
const
|
|
816
|
-
|
|
814
|
+
const wt = _.aging_hours ? $r.current ?? (x == null ? void 0 : x.aging) : qn ?? (x == null ? void 0 : x.aging);
|
|
815
|
+
rr.current = new Set(C.map((e) => `${e.collection}:${e.item_id}`));
|
|
816
|
+
const _t = _s(
|
|
817
|
+
C.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
817
818
|
Va
|
|
818
|
-
), qr = Q(
|
|
819
|
-
!be.current &&
|
|
820
|
-
const e = new Set(
|
|
819
|
+
), qr = Q(se), Rr = Q(0);
|
|
820
|
+
!be.current && se !== Rr.current && (qr.current = se), P(() => {
|
|
821
|
+
const e = new Set(C.map((t) => `${t.collection}:${t.item_id}`));
|
|
821
822
|
if (be.current) {
|
|
822
|
-
be.current = !1, Rr.current =
|
|
823
|
+
be.current = !1, Rr.current = se;
|
|
823
824
|
const t = Qt.current;
|
|
824
825
|
Qt.current = [];
|
|
825
|
-
const n = lr.current,
|
|
826
|
+
const n = lr.current, a = /* @__PURE__ */ new Set();
|
|
826
827
|
for (const o of t)
|
|
827
|
-
!e.has(o.key) ||
|
|
828
|
+
!e.has(o.key) || a.has(o.key) || (a.add(o.key), Ee.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
|
|
828
829
|
if (n) {
|
|
829
|
-
const o = [...e].filter((s) => !n.has(s) && !
|
|
830
|
+
const o = [...e].filter((s) => !n.has(s) && !a.has(s));
|
|
830
831
|
o.length > 0 && o.length <= 20 && Ee.note(o, null, "create");
|
|
831
832
|
}
|
|
832
833
|
}
|
|
833
834
|
lr.current = e;
|
|
834
|
-
}, [
|
|
835
|
+
}, [se]), P(() => {
|
|
835
836
|
Bt(0);
|
|
836
|
-
}, [
|
|
837
|
+
}, [se]);
|
|
837
838
|
function kl() {
|
|
838
|
-
|
|
839
|
+
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Bt(0);
|
|
839
840
|
}
|
|
840
841
|
const { data: ve } = X({
|
|
841
842
|
queryKey: ["queue-trends", l],
|
|
842
|
-
queryFn: () =>
|
|
843
|
+
queryFn: () => h.request(O(`/queues/${l}/trends`, { days: 14 })),
|
|
843
844
|
enabled: !!l,
|
|
844
845
|
staleTime: 300 * 1e3
|
|
845
846
|
}), { data: we } = X({
|
|
846
847
|
queryKey: ["queue-trends", l, "mine"],
|
|
847
|
-
queryFn: () =>
|
|
848
|
+
queryFn: () => h.request(O(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
|
|
848
849
|
enabled: !!l && g === "mine",
|
|
849
850
|
staleTime: 300 * 1e3
|
|
850
851
|
});
|
|
851
|
-
function
|
|
852
|
+
function Nt(e) {
|
|
852
853
|
const n = (g === "all" ? ve == null ? void 0 : ve.data : g === "mine" ? we == null ? void 0 : we.data : void 0) ?? [];
|
|
853
854
|
if (n.length === 0) return {};
|
|
854
855
|
if (I) return {};
|
|
855
|
-
const
|
|
856
|
-
return { trend:
|
|
856
|
+
const a = n.map((s) => s[e]), o = n[n.length - 1];
|
|
857
|
+
return { trend: a, delta: ((x == null ? void 0 : x[e]) ?? 0) - o[e] };
|
|
857
858
|
}
|
|
858
859
|
const _e = J(() => {
|
|
859
860
|
const t = (g === "all" ? ve == null ? void 0 : ve.data : g === "mine" ? we == null ? void 0 : we.data : void 0) ?? [];
|
|
860
861
|
if (t.length < 3 || !x || I) return null;
|
|
861
862
|
const n = t.map(
|
|
862
863
|
(u) => g === "mine" ? u.owned ?? u.total : u.total
|
|
863
|
-
),
|
|
864
|
+
), a = n.slice(1).map((u, m) => u - n[m]), o = a.reduce((u, m) => u + m, 0) / a.length, s = x.total;
|
|
864
865
|
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 };
|
|
865
|
-
}, [ve == null ? void 0 : ve.data, we == null ? void 0 : we.data, g, x, I]),
|
|
866
|
+
}, [ve == null ? void 0 : ve.data, we == null ? void 0 : we.data, g, x, I]), St = J(
|
|
866
867
|
() => [
|
|
867
868
|
...new Set(
|
|
868
869
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -871,12 +872,12 @@ function Od({
|
|
|
871
872
|
[c == null ? void 0 : c.sources]
|
|
872
873
|
), { data: vl } = X({
|
|
873
874
|
queryKey: ["collections"],
|
|
874
|
-
queryFn: () =>
|
|
875
|
+
queryFn: () => h.request(O("/collections")).then((e) => e.data),
|
|
875
876
|
staleTime: 300 * 1e3
|
|
876
|
-
}),
|
|
877
|
-
queries:
|
|
877
|
+
}), at = Ve({
|
|
878
|
+
queries: St.map((e) => ({
|
|
878
879
|
queryKey: ["queue-collection-addendums", e],
|
|
879
|
-
queryFn: () =>
|
|
880
|
+
queryFn: () => h.request(
|
|
880
881
|
O(`/collections/${e}`)
|
|
881
882
|
).then((t) => {
|
|
882
883
|
var n;
|
|
@@ -886,22 +887,22 @@ function Od({
|
|
|
886
887
|
}))
|
|
887
888
|
}).some((e) => e.data === !0), { data: Rn = [] } = X({
|
|
888
889
|
queryKey: ["queue-integrations-collections"],
|
|
889
|
-
queryFn: () =>
|
|
890
|
+
queryFn: () => h.request(O("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
|
|
890
891
|
staleTime: 300 * 1e3
|
|
891
|
-
}), qe =
|
|
892
|
+
}), qe = St.some((e) => Rn.includes(e)), Fn = J(() => {
|
|
892
893
|
var t;
|
|
893
894
|
const e = {};
|
|
894
895
|
if (!qe) return e;
|
|
895
|
-
for (const n of
|
|
896
|
+
for (const n of C) {
|
|
896
897
|
if (!Rn.includes(n.collection)) continue;
|
|
897
|
-
const
|
|
898
|
-
|
|
898
|
+
const a = e[t = n.collection] ?? (e[t] = []);
|
|
899
|
+
a.length < 500 && a.push(n.item_id);
|
|
899
900
|
}
|
|
900
901
|
return e;
|
|
901
|
-
}, [
|
|
902
|
+
}, [C, Rn, qe]), Fr = Object.keys(Fn), Lr = Ve({
|
|
902
903
|
queries: Fr.map((e) => ({
|
|
903
904
|
queryKey: ["queue-integrations-summary", e, Fn[e].join(",")],
|
|
904
|
-
queryFn: () =>
|
|
905
|
+
queryFn: () => h.request(
|
|
905
906
|
ce("/integration-obligations/summary", {
|
|
906
907
|
collection: e,
|
|
907
908
|
ids: Fn[e]
|
|
@@ -913,23 +914,23 @@ function Od({
|
|
|
913
914
|
const e = {};
|
|
914
915
|
return Fr.forEach((t, n) => {
|
|
915
916
|
var o;
|
|
916
|
-
const
|
|
917
|
-
for (const [s, u] of Object.entries(
|
|
917
|
+
const a = ((o = Lr[n]) == null ? void 0 : o.data) ?? {};
|
|
918
|
+
for (const [s, u] of Object.entries(a)) e[`${t}:${s}`] = u;
|
|
918
919
|
}), e;
|
|
919
920
|
}, [wl]), Ln = J(() => {
|
|
920
921
|
var t;
|
|
921
922
|
const e = {};
|
|
922
|
-
for (const n of
|
|
923
|
+
for (const n of C) {
|
|
923
924
|
if (!n.collection || n.collection === "tasks" || n.collection.startsWith("nivaro_"))
|
|
924
925
|
continue;
|
|
925
|
-
const
|
|
926
|
-
|
|
926
|
+
const a = e[t = n.collection] ?? (e[t] = []);
|
|
927
|
+
a.length < 500 && a.push(n.item_id);
|
|
927
928
|
}
|
|
928
929
|
return e;
|
|
929
|
-
}, [
|
|
930
|
+
}, [C]), Tn = Object.keys(Ln), Tr = Ve({
|
|
930
931
|
queries: Tn.map((e) => ({
|
|
931
932
|
queryKey: ["queue-task-counts", e, Ln[e].join(",")],
|
|
932
|
-
queryFn: () =>
|
|
933
|
+
queryFn: () => h.request(
|
|
933
934
|
ce("/tasks/counts", { collection: e, ids: Ln[e] })
|
|
934
935
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
935
936
|
staleTime: 3e4
|
|
@@ -937,13 +938,13 @@ function Od({
|
|
|
937
938
|
}), Nl = Tr.map((e) => e.dataUpdatedAt).join(","), Sl = J(() => {
|
|
938
939
|
const e = {};
|
|
939
940
|
return Tn.forEach((t, n) => {
|
|
940
|
-
var
|
|
941
|
-
for (const [o, s] of Object.entries(((
|
|
941
|
+
var a;
|
|
942
|
+
for (const [o, s] of Object.entries(((a = Tr[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = s;
|
|
942
943
|
}), e;
|
|
943
|
-
}, [Nl]), Er = Tn.length > 0, Ar =
|
|
944
|
-
queries:
|
|
944
|
+
}, [Nl]), Er = Tn.length > 0, Ar = Ve({
|
|
945
|
+
queries: St.map((e) => ({
|
|
945
946
|
queryKey: ["queue-collection-risk-rules", e],
|
|
946
|
-
queryFn: () =>
|
|
947
|
+
queryFn: () => h.request(
|
|
947
948
|
O("/at-risk/rules/active", { collection: e })
|
|
948
949
|
).then((t) => t.data ?? []).catch(() => []),
|
|
949
950
|
staleTime: 300 * 1e3
|
|
@@ -952,63 +953,63 @@ function Od({
|
|
|
952
953
|
const e = /* @__PURE__ */ new Map();
|
|
953
954
|
for (const t of Ar)
|
|
954
955
|
for (const n of t.data ?? []) {
|
|
955
|
-
const
|
|
956
|
+
const a = e.get(n.name);
|
|
956
957
|
e.set(n.name, {
|
|
957
958
|
label: n.name,
|
|
958
|
-
value:
|
|
959
|
+
value: a ? `${a.value},${n.id}` : String(n.id)
|
|
959
960
|
});
|
|
960
961
|
}
|
|
961
962
|
return [...e.values()];
|
|
962
|
-
}, [Cl]), Kr =
|
|
963
|
-
queries:
|
|
963
|
+
}, [Cl]), Kr = Ve({
|
|
964
|
+
queries: St.map((e) => ({
|
|
964
965
|
queryKey: ["queue-collection-states", e],
|
|
965
|
-
queryFn: () =>
|
|
966
|
+
queryFn: () => h.request(
|
|
966
967
|
O(`/queues/collection-states/${e}`)
|
|
967
968
|
).then((t) => t.data),
|
|
968
969
|
staleTime: 300 * 1e3
|
|
969
970
|
}))
|
|
970
|
-
}),
|
|
971
|
+
}), Dr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), Re = J(() => {
|
|
971
972
|
const e = {};
|
|
972
973
|
for (const t of Kr)
|
|
973
|
-
(t.data ?? []).forEach((n,
|
|
974
|
-
e[n.key] = { label: n.label, color: n.color, sort:
|
|
974
|
+
(t.data ?? []).forEach((n, a) => {
|
|
975
|
+
e[n.key] = { label: n.label, color: n.color, sort: a };
|
|
975
976
|
});
|
|
976
977
|
return e;
|
|
977
|
-
}, [Kr.map((e) => e.data)]),
|
|
978
|
+
}, [Kr.map((e) => e.data)]), Pr = x ? Object.entries(x.by_state).sort(
|
|
978
979
|
(e, t) => {
|
|
979
|
-
var n,
|
|
980
|
-
return (((n = Re[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((
|
|
980
|
+
var n, a;
|
|
981
|
+
return (((n = Re[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((a = Re[t[0]]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
981
982
|
}
|
|
982
983
|
) : [], Mr = (e) => [...e].sort(
|
|
983
984
|
(t, n) => {
|
|
984
|
-
var
|
|
985
|
-
return (((
|
|
985
|
+
var a, o;
|
|
986
|
+
return (((a = Re[t]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = Re[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
986
987
|
}
|
|
987
988
|
), En = J(() => {
|
|
988
989
|
const e = {};
|
|
989
990
|
for (const [t, n] of Object.entries(Re)) e[t] = n.label;
|
|
990
991
|
return e;
|
|
991
|
-
}, [Re]), Fe = (e) => e ? e === "none" ? "No State" : En[e] ??
|
|
992
|
+
}, [Re]), Fe = (e) => e ? e === "none" ? "No State" : En[e] ?? Dr(e) : "—", lt = (e) => {
|
|
992
993
|
if (e === sn) return "Addendums";
|
|
993
994
|
const t = (vl ?? []).find((n) => n.collection === e);
|
|
994
|
-
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) ||
|
|
995
|
-
},
|
|
995
|
+
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Dr(e);
|
|
996
|
+
}, ie = J(() => R ? ke ? ke.map((e) => ({
|
|
996
997
|
key: e.key,
|
|
997
998
|
rows: $n.get(e.key) ?? [],
|
|
998
999
|
breached: e.breached,
|
|
999
1000
|
atRisk: e.at_risk,
|
|
1000
1001
|
count: e.count,
|
|
1001
1002
|
sums: e.sums ?? {}
|
|
1002
|
-
})) : Ls(
|
|
1003
|
-
|
|
1004
|
-
if (!R || !
|
|
1003
|
+
})) : Ls(C, R).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [C, R, ke, $n]), An = Q(null);
|
|
1004
|
+
P(() => {
|
|
1005
|
+
if (!R || !ie) {
|
|
1005
1006
|
An.current = null;
|
|
1006
1007
|
return;
|
|
1007
1008
|
}
|
|
1008
1009
|
if ($e && !ke || An.current === R) return;
|
|
1009
1010
|
An.current = R;
|
|
1010
|
-
const e =
|
|
1011
|
-
cn(e > 200 ? new Set(
|
|
1011
|
+
const e = ie.reduce((t, n) => t + n.count, 0);
|
|
1012
|
+
cn(e > 200 ? new Set(ie.map((t) => t.key)) : /* @__PURE__ */ new Set()), Nr({});
|
|
1012
1013
|
}, [R, ke]);
|
|
1013
1014
|
function $l(e) {
|
|
1014
1015
|
cn((t) => {
|
|
@@ -1016,12 +1017,12 @@ function Od({
|
|
|
1016
1017
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
1017
1018
|
});
|
|
1018
1019
|
}
|
|
1019
|
-
const me = J(() =>
|
|
1020
|
+
const me = J(() => ie ? ie.filter((e) => !Ce.has(e.key)).flatMap((e) => e.rows) : C, [ie, C, Ce]), F = (e) => `${e.collection}:${e.item_id}`, [Pe, Me] = w(null), [ql, On] = w(!1), [Ct, zt] = w(null), Kn = (e) => {
|
|
1020
1021
|
if (e.collection === sn && e.url) {
|
|
1021
1022
|
const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
|
|
1022
1023
|
if (t) {
|
|
1023
1024
|
const n = {};
|
|
1024
|
-
for (const [
|
|
1025
|
+
for (const [a, o] of new URLSearchParams(t[3] ?? "")) n[a] = o;
|
|
1025
1026
|
return {
|
|
1026
1027
|
collection: decodeURIComponent(t[1]),
|
|
1027
1028
|
itemId: decodeURIComponent(t[2]),
|
|
@@ -1037,16 +1038,16 @@ function Od({
|
|
|
1037
1038
|
};
|
|
1038
1039
|
}, Br = () => {
|
|
1039
1040
|
var e;
|
|
1040
|
-
c &&
|
|
1041
|
+
c && Pa({
|
|
1041
1042
|
queue_id: l,
|
|
1042
1043
|
name: c.name,
|
|
1043
1044
|
path: `${window.location.pathname}${window.location.search}`,
|
|
1044
1045
|
at: Date.now(),
|
|
1045
1046
|
scroll: ((e = Zt.current) == null ? void 0 : e.scrollTop) ?? 0,
|
|
1046
|
-
state: { scope: g, page: ue, sort: B, filters: _, group_by: R, view:
|
|
1047
|
+
state: { scope: g, page: ue, sort: B, filters: _, group_by: R, view: $ },
|
|
1047
1048
|
entry: ks()
|
|
1048
1049
|
});
|
|
1049
|
-
},
|
|
1050
|
+
}, ot = (e) => {
|
|
1050
1051
|
Br(), Y.open(Kn(e));
|
|
1051
1052
|
}, Rl = (e) => {
|
|
1052
1053
|
Br();
|
|
@@ -1056,21 +1057,21 @@ function Od({
|
|
|
1056
1057
|
itemId: e.itemId,
|
|
1057
1058
|
layoutSlug: n ? (p == null ? void 0 : p.item_layout) ?? null : null
|
|
1058
1059
|
});
|
|
1059
|
-
}, [U,
|
|
1060
|
+
}, [U, $t] = w(
|
|
1060
1061
|
null
|
|
1061
1062
|
);
|
|
1062
|
-
|
|
1063
|
+
P(() => {
|
|
1063
1064
|
if (!U) return;
|
|
1064
|
-
const e = () =>
|
|
1065
|
+
const e = () => $t(null);
|
|
1065
1066
|
return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
|
|
1066
1067
|
window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
|
|
1067
1068
|
};
|
|
1068
1069
|
}, [U]);
|
|
1069
|
-
const
|
|
1070
|
+
const Dn = (e) => {
|
|
1070
1071
|
zt(F(e));
|
|
1071
1072
|
const t = (p == null ? void 0 : p.row_click) ?? "preview";
|
|
1072
1073
|
if (t === "full" || e.collection === sn) {
|
|
1073
|
-
|
|
1074
|
+
ot(e);
|
|
1074
1075
|
return;
|
|
1075
1076
|
}
|
|
1076
1077
|
if (t === "layout") {
|
|
@@ -1083,32 +1084,32 @@ function Od({
|
|
|
1083
1084
|
});
|
|
1084
1085
|
return;
|
|
1085
1086
|
}
|
|
1086
|
-
|
|
1087
|
+
Me(e);
|
|
1087
1088
|
};
|
|
1088
|
-
|
|
1089
|
+
P(() => {
|
|
1089
1090
|
if (!Pe) return;
|
|
1090
|
-
const e =
|
|
1091
|
-
e && e !== Pe &&
|
|
1092
|
-
}, [
|
|
1091
|
+
const e = C.find((t) => F(t) === F(Pe));
|
|
1092
|
+
e && e !== Pe && Me(e);
|
|
1093
|
+
}, [C]);
|
|
1093
1094
|
const Fl = (e) => !e.claimed_by || e.claimed_by.id === S;
|
|
1094
1095
|
function Qr(e) {
|
|
1095
|
-
const t = e ? me.findIndex((
|
|
1096
|
+
const t = e ? me.findIndex((a) => F(a) === F(e)) + 1 : 0, n = me.slice(t).find(Fl);
|
|
1096
1097
|
if (!n) {
|
|
1097
|
-
On(!1),
|
|
1098
|
+
On(!1), Me(null), A.info("Nothing left to work on — queue clear!");
|
|
1098
1099
|
return;
|
|
1099
1100
|
}
|
|
1100
|
-
if (zt(F(n)), ge && !n.claimed_by &&
|
|
1101
|
-
|
|
1101
|
+
if (zt(F(n)), ge && !n.claimed_by && De.mutate(n), (p == null ? void 0 : p.row_click) === "full") {
|
|
1102
|
+
ot(n);
|
|
1102
1103
|
return;
|
|
1103
1104
|
}
|
|
1104
|
-
On(!0),
|
|
1105
|
+
On(!0), Me(n);
|
|
1105
1106
|
}
|
|
1106
|
-
|
|
1107
|
-
if (
|
|
1107
|
+
P(() => {
|
|
1108
|
+
if ($ !== "table") return;
|
|
1108
1109
|
function e(t) {
|
|
1109
1110
|
var o;
|
|
1110
|
-
if (t.metaKey || t.ctrlKey || t.altKey || !
|
|
1111
|
-
const n =
|
|
1111
|
+
if (t.metaKey || t.ctrlKey || t.altKey || !Gi(t.target)) return;
|
|
1112
|
+
const n = Ct ? me.findIndex((s) => F(s) === Ct) : -1, a = (s) => {
|
|
1112
1113
|
zt(F(s));
|
|
1113
1114
|
const u = F(s), m = [...document.querySelectorAll("tr[data-row-key]")].find(
|
|
1114
1115
|
(y) => y.getAttribute("data-row-key") === u
|
|
@@ -1118,63 +1119,63 @@ function Od({
|
|
|
1118
1119
|
if (t.key === "j" || t.key === "ArrowDown") {
|
|
1119
1120
|
t.preventDefault();
|
|
1120
1121
|
const s = me[Math.min(n + 1, me.length - 1)];
|
|
1121
|
-
s &&
|
|
1122
|
+
s && a(s);
|
|
1122
1123
|
} else if (t.key === "k" || t.key === "ArrowUp") {
|
|
1123
1124
|
t.preventDefault();
|
|
1124
1125
|
const s = me[Math.max(n - 1, 0)];
|
|
1125
|
-
s &&
|
|
1126
|
+
s && a(s);
|
|
1126
1127
|
} else if (t.key === "c" && n >= 0 && ge) {
|
|
1127
1128
|
t.preventDefault();
|
|
1128
1129
|
const s = me[n];
|
|
1129
|
-
((o = s.claimed_by) == null ? void 0 : o.id) === S ?
|
|
1130
|
-
} else t.key === "o" && n >= 0 && (t.preventDefault(),
|
|
1130
|
+
((o = s.claimed_by) == null ? void 0 : o.id) === S ? et.mutate(s) : De.mutate(s);
|
|
1131
|
+
} else t.key === "o" && n >= 0 && (t.preventDefault(), ot(me[n]));
|
|
1131
1132
|
}
|
|
1132
1133
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1133
|
-
}, [
|
|
1134
|
+
}, [$, me, Ct, Pe, S, De, et, ge]);
|
|
1134
1135
|
const { data: G } = X({
|
|
1135
1136
|
queryKey: ["queue-views", l],
|
|
1136
|
-
queryFn: () =>
|
|
1137
|
+
queryFn: () => h.request(O(`/queues/${l}/views`)),
|
|
1137
1138
|
enabled: !!l
|
|
1138
|
-
}), [
|
|
1139
|
-
function
|
|
1139
|
+
}), [st, it] = w(null), [Ll, Pn] = w(!1), [Xt, jr] = w(""), [Ur, Vr] = w(!1), [qt, Ir] = w(!1);
|
|
1140
|
+
function Rt(e) {
|
|
1140
1141
|
const t = e.state ?? {};
|
|
1141
|
-
te(t.scope ?? "all"), j({ ...he.current, ...t.filters ?? {} }),
|
|
1142
|
+
te(t.scope ?? "all"), j({ ...he.current, ...t.filters ?? {} }), He(t.sort ?? ""), ft(t.group_by ?? null), Ht(t.columns ?? null), un(t.pins ?? null), t.view && We(Ae.includes(t.view) ? t.view : Ae[0]), D(1), it(e.id);
|
|
1142
1143
|
}
|
|
1143
1144
|
function Tl() {
|
|
1144
1145
|
var t, n;
|
|
1145
|
-
const e = G == null ? void 0 : G.data.find((
|
|
1146
|
+
const e = G == null ? void 0 : G.data.find((a) => a.is_default);
|
|
1146
1147
|
if (e) {
|
|
1147
|
-
|
|
1148
|
+
Rt(e);
|
|
1148
1149
|
return;
|
|
1149
1150
|
}
|
|
1150
|
-
te(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), j({ ...he.current }),
|
|
1151
|
+
te(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), j({ ...he.current }), He(""), ft(null), Ht(null), un(null), (n = c == null ? void 0 : c.display_config) != null && n.default_view && We(c.display_config.default_view), D(1), it(null);
|
|
1151
1152
|
}
|
|
1152
|
-
|
|
1153
|
-
if (z || !(c != null && c.display_config) ||
|
|
1154
|
-
const e =
|
|
1155
|
-
t ?
|
|
1156
|
-
}, [c,
|
|
1153
|
+
P(() => {
|
|
1154
|
+
if (z || !(c != null && c.display_config) || tt === void 0 || G === void 0) return;
|
|
1155
|
+
const e = tt.data.default_view_id, t = e != null ? G.data.find((a) => a.id === e) : void 0, n = G.data.find((a) => a.is_default);
|
|
1156
|
+
t ? Rt(t) : n ? Rt(n) : (We(c.display_config.default_view), te(c.display_config.default_scope)), Ja(!0);
|
|
1157
|
+
}, [c, tt, G, z]);
|
|
1157
1158
|
const Zt = Q(null), en = Q(null);
|
|
1158
|
-
|
|
1159
|
+
P(() => {
|
|
1159
1160
|
if (!z) return;
|
|
1160
1161
|
const e = ci();
|
|
1161
1162
|
if (!e || !di(e, l, ys(), xs())) return;
|
|
1162
|
-
|
|
1163
|
+
Pa({ ...e, restore: !1 });
|
|
1163
1164
|
const t = e.state ?? {};
|
|
1164
|
-
t.scope && te(t.scope), t.filters && j({ ...he.current, ...t.filters }), t.sort != null &&
|
|
1165
|
-
}, [z, l]),
|
|
1165
|
+
t.scope && te(t.scope), t.filters && j({ ...he.current, ...t.filters }), t.sort != null && He(t.sort), ft(t.group_by ?? null), t.view && We(t.view), t.page && D(t.page), en.current = e.scroll ?? 0, W && W.length > 0 && dt.back(W.length);
|
|
1166
|
+
}, [z, l]), P(() => {
|
|
1166
1167
|
var s;
|
|
1167
1168
|
if (!z || typeof window > "u") return;
|
|
1168
|
-
const e = new URLSearchParams(window.location.search), t = e.get("scope"), n = ((s = e.get("state")) == null ? void 0 : s.trim()) || null,
|
|
1169
|
-
if (!
|
|
1169
|
+
const e = new URLSearchParams(window.location.search), t = e.get("scope"), n = ((s = e.get("state")) == null ? void 0 : s.trim()) || null, a = t === "all" || t === "mine";
|
|
1170
|
+
if (!a && !n) return;
|
|
1170
1171
|
e.delete("scope"), e.delete("state");
|
|
1171
1172
|
const o = e.toString();
|
|
1172
1173
|
window.history.replaceState(
|
|
1173
1174
|
window.history.state,
|
|
1174
1175
|
"",
|
|
1175
1176
|
`${window.location.pathname}${o ? `?${o}` : ""}${window.location.hash}`
|
|
1176
|
-
),
|
|
1177
|
-
}, [z]),
|
|
1177
|
+
), a && te(t), n && j((u) => ({ ...u, state: [n] })), D(1);
|
|
1178
|
+
}, [z]), P(() => {
|
|
1178
1179
|
if (!z || typeof window > "u") return;
|
|
1179
1180
|
const e = new URLSearchParams(window.location.search), t = e.get("owner");
|
|
1180
1181
|
if (!t) return;
|
|
@@ -1184,167 +1185,167 @@ function Od({
|
|
|
1184
1185
|
window.history.state,
|
|
1185
1186
|
"",
|
|
1186
1187
|
`${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
|
|
1187
|
-
), te("all"), j((
|
|
1188
|
-
}, [z]),
|
|
1188
|
+
), te("all"), j((a) => ({ ...a, owners: [t] })), it(null), D(1);
|
|
1189
|
+
}, [z]), P(() => {
|
|
1189
1190
|
if (!z) return;
|
|
1190
1191
|
const e = ps(bs(`queue:${l}`));
|
|
1191
|
-
e && (fs(),
|
|
1192
|
+
e && (fs(), Rt({
|
|
1192
1193
|
id: -1,
|
|
1193
1194
|
// Saved views type filters loosely as strings; multi-selects ride as arrays there too.
|
|
1194
1195
|
state: e
|
|
1195
|
-
}),
|
|
1196
|
+
}), it(null), e.page && D(e.page));
|
|
1196
1197
|
}, [z]);
|
|
1197
1198
|
const Gr = () => ({
|
|
1198
1199
|
scope: g,
|
|
1199
1200
|
filters: _,
|
|
1200
1201
|
sort: B,
|
|
1201
1202
|
group_by: R,
|
|
1202
|
-
view:
|
|
1203
|
-
columns:
|
|
1204
|
-
pins:
|
|
1203
|
+
view: $,
|
|
1204
|
+
columns: yt,
|
|
1205
|
+
pins: Je,
|
|
1205
1206
|
...ue > 1 ? { page: ue } : {}
|
|
1206
1207
|
});
|
|
1207
|
-
|
|
1208
|
-
en.current == null ||
|
|
1209
|
-
}, [
|
|
1210
|
-
const { isAdmin:
|
|
1211
|
-
() =>
|
|
1208
|
+
P(() => {
|
|
1209
|
+
en.current == null || C.length === 0 || !Zt.current || (Zt.current.scrollTop = en.current, en.current = null);
|
|
1210
|
+
}, [C]);
|
|
1211
|
+
const { isAdmin: Be } = Ea(), El = C.map((e) => `${e.collection}|${e.item_id}`).join(","), Al = J(
|
|
1212
|
+
() => C.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
1212
1213
|
[El]
|
|
1213
|
-
), Wr = hi(Al,
|
|
1214
|
+
), Wr = hi(Al, Be), Ol = (e) => Ct === F(e) ? (
|
|
1214
1215
|
// Pinned sticky cells use bg-inherit — the highlight must be
|
|
1215
1216
|
// OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
|
|
1216
1217
|
// scrolled content bleeds through the pinned columns. Same
|
|
1217
1218
|
// pair DataTable uses for selected rows when pins are active.
|
|
1218
1219
|
"bg-[#f2fdff] dark:bg-[#20303a]"
|
|
1219
|
-
) : e.at_risk ? Ks(e.at_risk_color ?? "red") : void 0, tn =
|
|
1220
|
-
mutationFn: ({ viewId: e, on: t }) =>
|
|
1220
|
+
) : e.at_risk ? Ks(e.at_risk_color ?? "red") : void 0, tn = Be || (c == null ? void 0 : c.owner) != null && c.owner === S, Kl = Te({
|
|
1221
|
+
mutationFn: ({ viewId: e, on: t }) => h.request(Aa(`/queues/views/${e}`, { is_default: t })),
|
|
1221
1222
|
onSuccess: () => {
|
|
1222
|
-
|
|
1223
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("Queue default view updated");
|
|
1223
1224
|
},
|
|
1224
1225
|
onError: () => A.error("Could not update the queue default view")
|
|
1225
1226
|
}), nn = Te({
|
|
1226
|
-
mutationFn: () =>
|
|
1227
|
+
mutationFn: () => h.request(
|
|
1227
1228
|
ce(`/queues/${l}/views`, {
|
|
1228
1229
|
name: Xt.trim(),
|
|
1229
|
-
is_shared: tn && (Ur ||
|
|
1230
|
-
is_default:
|
|
1230
|
+
is_shared: tn && (Ur || qt),
|
|
1231
|
+
is_default: qt,
|
|
1231
1232
|
state: {
|
|
1232
1233
|
scope: g,
|
|
1233
1234
|
filters: _,
|
|
1234
1235
|
sort: B,
|
|
1235
1236
|
group_by: R,
|
|
1236
|
-
view:
|
|
1237
|
-
columns:
|
|
1238
|
-
pins:
|
|
1237
|
+
view: $,
|
|
1238
|
+
columns: yt,
|
|
1239
|
+
pins: Je
|
|
1239
1240
|
}
|
|
1240
1241
|
})
|
|
1241
1242
|
),
|
|
1242
1243
|
onSuccess: (e) => {
|
|
1243
|
-
|
|
1244
|
+
Pn(!1), jr(""), Vr(!1), Ir(!1), it(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("View saved");
|
|
1244
1245
|
},
|
|
1245
1246
|
onError: () => A.error("Failed to save view")
|
|
1246
|
-
}), [Hr, Jr] = w(null),
|
|
1247
|
-
mutationFn: (e) =>
|
|
1247
|
+
}), [Hr, Jr] = w(null), Qe = Te({
|
|
1248
|
+
mutationFn: (e) => h.request(
|
|
1248
1249
|
Aa(`/queues/views/${e.id}`, {
|
|
1249
1250
|
state: {
|
|
1250
1251
|
scope: g,
|
|
1251
1252
|
filters: _,
|
|
1252
1253
|
sort: B,
|
|
1253
1254
|
group_by: R,
|
|
1254
|
-
view:
|
|
1255
|
-
columns:
|
|
1256
|
-
pins:
|
|
1255
|
+
view: $,
|
|
1256
|
+
columns: yt,
|
|
1257
|
+
pins: Je
|
|
1257
1258
|
}
|
|
1258
1259
|
})
|
|
1259
1260
|
),
|
|
1260
1261
|
onSuccess: (e, t) => {
|
|
1261
|
-
|
|
1262
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), Jr(t.id), setTimeout(() => Jr((n) => n === t.id ? null : n), 2e3), A.success(`Saved "${t.name}" with the current filters, scope and sort`);
|
|
1262
1263
|
},
|
|
1263
1264
|
onError: () => A.error("Failed to update view")
|
|
1264
1265
|
}), [Mn, rn] = w(null);
|
|
1265
|
-
|
|
1266
|
+
P(() => {
|
|
1266
1267
|
if (Mn == null) return;
|
|
1267
1268
|
const e = setTimeout(() => rn(null), 5e3);
|
|
1268
1269
|
return () => clearTimeout(e);
|
|
1269
1270
|
}, [Mn]);
|
|
1270
1271
|
const Yr = Te({
|
|
1271
|
-
mutationFn: (e) =>
|
|
1272
|
+
mutationFn: (e) => h.request(zn(`/queues/views/${e}`)),
|
|
1272
1273
|
onSuccess: (e, t) => {
|
|
1273
|
-
rn(null),
|
|
1274
|
+
rn(null), f.invalidateQueries({ queryKey: ["queue-views", l] }), it(null), nt === t && Sn(null);
|
|
1274
1275
|
},
|
|
1275
1276
|
onError: () => A.error("Failed to delete view")
|
|
1276
|
-
}),
|
|
1277
|
-
mutationFn: (e) =>
|
|
1277
|
+
}), Dl = Te({
|
|
1278
|
+
mutationFn: (e) => h.request(Xo(`/queues/${l}/default-view`, { view_id: e })),
|
|
1278
1279
|
onMutate: (e) => Sn(e),
|
|
1279
1280
|
onSuccess: (e, t) => {
|
|
1280
|
-
|
|
1281
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.success(
|
|
1281
1282
|
t === null ? "Reverted to the general default" : "Set as your default view"
|
|
1282
1283
|
);
|
|
1283
1284
|
},
|
|
1284
1285
|
onError: () => {
|
|
1285
|
-
|
|
1286
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.error("Failed to update default view");
|
|
1286
1287
|
}
|
|
1287
|
-
}), [
|
|
1288
|
-
ne &&
|
|
1288
|
+
}), [oe, je] = w([]), [ne, zr] = w(!1), Pl = () => {
|
|
1289
|
+
ne && je([]), zr(!ne);
|
|
1289
1290
|
};
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
}, [
|
|
1293
|
-
const [
|
|
1291
|
+
P(() => {
|
|
1292
|
+
$ !== "table" && ne && (zr(!1), je([]));
|
|
1293
|
+
}, [$, ne]), zo(), gn.current = oe.length;
|
|
1294
|
+
const [ct, Xr] = w(!1);
|
|
1294
1295
|
async function Bn(e, t) {
|
|
1295
|
-
const n =
|
|
1296
|
+
const n = C.filter((u) => oe.includes(F(u)));
|
|
1296
1297
|
Xr(!0), Wt.beginBatch();
|
|
1297
|
-
const
|
|
1298
|
+
const a = await Promise.allSettled(n.map(t));
|
|
1298
1299
|
Wt.endBatch();
|
|
1299
|
-
const o =
|
|
1300
|
-
Xr(!1),
|
|
1300
|
+
const o = a.filter((u) => u.status === "fulfilled").length, s = a.length - o;
|
|
1301
|
+
Xr(!1), je([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? A.warning(`${e}: ${o} succeeded, ${s} failed`) : A.success(`${e}: ${o} succeeded`);
|
|
1301
1302
|
}
|
|
1302
1303
|
const Ne = (e) => {
|
|
1303
1304
|
var t;
|
|
1304
1305
|
for (const n of (c == null ? void 0 : c.sources) ?? []) {
|
|
1305
|
-
const
|
|
1306
|
-
if (
|
|
1306
|
+
const a = (t = n.column_formats) == null ? void 0 : t[e];
|
|
1307
|
+
if (a) return a;
|
|
1307
1308
|
}
|
|
1308
1309
|
return null;
|
|
1309
1310
|
}, Ml = (e) => {
|
|
1310
1311
|
if (R === "state") return e === "No state" ? e : Fe(e);
|
|
1311
|
-
if (R === "collection") return
|
|
1312
|
+
if (R === "collection") return lt(e);
|
|
1312
1313
|
if (R != null && R.startsWith("extra.") && e !== "—") {
|
|
1313
1314
|
const t = R.slice(6), n = Ne(t);
|
|
1314
|
-
return n ?
|
|
1315
|
-
((c == null ? void 0 : c.extra_field_meta) ?? []).find((
|
|
1315
|
+
return n ? Ie(e, n) : Kt(
|
|
1316
|
+
((c == null ? void 0 : c.extra_field_meta) ?? []).find((a) => a.path === t),
|
|
1316
1317
|
e
|
|
1317
1318
|
);
|
|
1318
1319
|
}
|
|
1319
1320
|
return e;
|
|
1320
|
-
}, Bl =
|
|
1321
|
+
}, Bl = ie == null ? void 0 : ie.map((e) => ({
|
|
1321
1322
|
key: e.key,
|
|
1322
1323
|
rows: e.rows,
|
|
1323
1324
|
header: /* @__PURE__ */ d(Se, { children: [
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ r("span", { children: Ml(e.key) }),
|
|
1325
1326
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
1326
1327
|
"(",
|
|
1327
1328
|
ee(e.count),
|
|
1328
1329
|
")"
|
|
1329
1330
|
] }),
|
|
1330
1331
|
Object.entries(e.sums).map(([t, n]) => {
|
|
1331
|
-
const
|
|
1332
|
+
const a = Ne(t);
|
|
1332
1333
|
return /* @__PURE__ */ d(
|
|
1333
1334
|
"span",
|
|
1334
1335
|
{
|
|
1335
1336
|
className: "font-normal tabular-nums text-slate-500 dark:text-slate-400",
|
|
1336
1337
|
"data-queue-group-sum": t,
|
|
1337
1338
|
children: [
|
|
1338
|
-
T(`extra.${t}`,
|
|
1339
|
+
T(`extra.${t}`, Ge(t)),
|
|
1339
1340
|
":",
|
|
1340
1341
|
" ",
|
|
1341
|
-
|
|
1342
|
+
a ? Ie(String(n), a) : ee(n)
|
|
1342
1343
|
]
|
|
1343
1344
|
},
|
|
1344
1345
|
t
|
|
1345
1346
|
);
|
|
1346
1347
|
}),
|
|
1347
|
-
ke && !Ce.has(e.key) && xl.has(e.key) && /* @__PURE__ */
|
|
1348
|
+
ke && !Ce.has(e.key) && xl.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
|
|
1348
1349
|
ke && !Ce.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
|
|
1349
1350
|
"button",
|
|
1350
1351
|
{
|
|
@@ -1372,13 +1373,13 @@ function Od({
|
|
|
1372
1373
|
" at risk"
|
|
1373
1374
|
] })
|
|
1374
1375
|
] })
|
|
1375
|
-
})), Qn = (((xa = i == null ? void 0 : i.available_values.collection) == null ? void 0 : xa.length) ?? 0) > 1, Zr =
|
|
1376
|
+
})), Qn = (((xa = i == null ? void 0 : i.available_values.collection) == null ? void 0 : xa.length) ?? 0) > 1, Zr = C.some((e) => !!e.unseen) || _t.size > 0 || C.some((e) => Ee.isNew(F(e))), ea = [
|
|
1376
1377
|
...Qn ? [
|
|
1377
1378
|
{
|
|
1378
1379
|
key: "collection",
|
|
1379
1380
|
header: T("collection", "Collection"),
|
|
1380
1381
|
sortable: !0,
|
|
1381
|
-
render: (e) => /* @__PURE__ */
|
|
1382
|
+
render: (e) => /* @__PURE__ */ r(Ni, { variant: "outline", children: lt(e.collection) })
|
|
1382
1383
|
}
|
|
1383
1384
|
] : [],
|
|
1384
1385
|
{
|
|
@@ -1393,16 +1394,16 @@ function Od({
|
|
|
1393
1394
|
// a whole, but nothing on it said so — an underline is the one
|
|
1394
1395
|
// convention people already read as "this goes somewhere".
|
|
1395
1396
|
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
1396
|
-
|
|
1397
|
+
_t.get(F(e)) || Ee.isNew(F(e)) ? /* @__PURE__ */ r(
|
|
1397
1398
|
mi,
|
|
1398
1399
|
{
|
|
1399
|
-
lock:
|
|
1400
|
+
lock: _t.get(F(e)),
|
|
1400
1401
|
isNew: Ee.isNew(F(e)),
|
|
1401
1402
|
dataAttr: "data-queue-live-mark",
|
|
1402
1403
|
hang: !0
|
|
1403
1404
|
}
|
|
1404
|
-
) : /* @__PURE__ */
|
|
1405
|
-
/* @__PURE__ */
|
|
1405
|
+
) : /* @__PURE__ */ r(_i, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
|
|
1406
|
+
/* @__PURE__ */ r(
|
|
1406
1407
|
"span",
|
|
1407
1408
|
{
|
|
1408
1409
|
className: "block max-w-[160px] truncate font-medium underline decoration-slate-300 decoration-dotted underline-offset-2 group-hover/row:decoration-nvr-cyan dark:decoration-slate-600",
|
|
@@ -1410,7 +1411,7 @@ function Od({
|
|
|
1410
1411
|
children: e.label
|
|
1411
1412
|
}
|
|
1412
1413
|
),
|
|
1413
|
-
(e.labels ?? []).slice(0, 3).map((t) => /* @__PURE__ */
|
|
1414
|
+
(e.labels ?? []).slice(0, 3).map((t) => /* @__PURE__ */ r(
|
|
1414
1415
|
"span",
|
|
1415
1416
|
{
|
|
1416
1417
|
className: "shrink-0 rounded-full bg-violet-100 px-1.5 py-px text-[9.5px] font-medium text-violet-700 dark:bg-violet-500/15 dark:text-violet-300",
|
|
@@ -1419,7 +1420,7 @@ function Od({
|
|
|
1419
1420
|
},
|
|
1420
1421
|
t
|
|
1421
1422
|
)),
|
|
1422
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ r(
|
|
1423
1424
|
wi,
|
|
1424
1425
|
{
|
|
1425
1426
|
viewers: ml[Fs(e.collection, e.item_id)],
|
|
@@ -1448,22 +1449,22 @@ function Od({
|
|
|
1448
1449
|
title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Fe(e.state)}` : Fe(e.state),
|
|
1449
1450
|
children: [
|
|
1450
1451
|
Fe(e.state),
|
|
1451
|
-
e.via_addendum && /* @__PURE__ */
|
|
1452
|
+
e.via_addendum && /* @__PURE__ */ r("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" })
|
|
1452
1453
|
]
|
|
1453
1454
|
}
|
|
1454
|
-
) : /* @__PURE__ */
|
|
1455
|
+
) : /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" })
|
|
1455
1456
|
},
|
|
1456
1457
|
{
|
|
1457
1458
|
key: "owners",
|
|
1458
1459
|
header: T("owners", "Owners"),
|
|
1459
1460
|
sortable: !0,
|
|
1460
|
-
render: (e) => /* @__PURE__ */
|
|
1461
|
+
render: (e) => /* @__PURE__ */ r(Ai, { owners: e.owners })
|
|
1461
1462
|
},
|
|
1462
1463
|
{
|
|
1463
1464
|
key: "aging_hours",
|
|
1464
1465
|
header: T("aging_hours", "Aging"),
|
|
1465
1466
|
sortable: !0,
|
|
1466
|
-
render: (e) =>
|
|
1467
|
+
render: (e) => zi(e.aging_hours)
|
|
1467
1468
|
},
|
|
1468
1469
|
{
|
|
1469
1470
|
// When the record entered its current state — the same moment Aging
|
|
@@ -1471,13 +1472,13 @@ function Od({
|
|
|
1471
1472
|
key: "state_entered",
|
|
1472
1473
|
header: T("state_entered", "Last State Change"),
|
|
1473
1474
|
sortable: !0,
|
|
1474
|
-
render: (e) => e.state_entered_at ?
|
|
1475
|
+
render: (e) => e.state_entered_at ? Da(e.state_entered_at) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
|
|
1475
1476
|
},
|
|
1476
1477
|
{
|
|
1477
1478
|
key: "sla_status",
|
|
1478
1479
|
header: T("sla_status", "SLA"),
|
|
1479
1480
|
sortable: !0,
|
|
1480
|
-
render: (e) => /* @__PURE__ */
|
|
1481
|
+
render: (e) => /* @__PURE__ */ r(Xi, { status: e.sla_status })
|
|
1481
1482
|
},
|
|
1482
1483
|
{
|
|
1483
1484
|
key: "at_risk",
|
|
@@ -1488,23 +1489,23 @@ function Od({
|
|
|
1488
1489
|
return e.at_risk ? /* @__PURE__ */ d("span", { className: Os(e.at_risk_color ?? "red"), children: [
|
|
1489
1490
|
"⚑ ",
|
|
1490
1491
|
((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
|
|
1491
|
-
] }) : e.predicted_risk ? /* @__PURE__ */
|
|
1492
|
+
] }) : e.predicted_risk ? /* @__PURE__ */ r("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
|
|
1492
1493
|
}
|
|
1493
1494
|
},
|
|
1494
|
-
...
|
|
1495
|
+
...at ? [
|
|
1495
1496
|
{
|
|
1496
1497
|
key: "addendums",
|
|
1497
1498
|
header: T("addendums", "Addendums"),
|
|
1498
1499
|
sortable: !1,
|
|
1499
|
-
render: (e) => /* @__PURE__ */
|
|
1500
|
+
render: (e) => /* @__PURE__ */ r(Yi, { summary: e.addendums })
|
|
1500
1501
|
}
|
|
1501
1502
|
] : [],
|
|
1502
|
-
...
|
|
1503
|
+
...kt ? [
|
|
1503
1504
|
{
|
|
1504
1505
|
key: "fulfilment",
|
|
1505
1506
|
header: T("fulfilment", "Shipped"),
|
|
1506
1507
|
sortable: !0,
|
|
1507
|
-
render: (e) => /* @__PURE__ */
|
|
1508
|
+
render: (e) => /* @__PURE__ */ r(
|
|
1508
1509
|
ri,
|
|
1509
1510
|
{
|
|
1510
1511
|
collection: e.collection,
|
|
@@ -1519,7 +1520,7 @@ function Od({
|
|
|
1519
1520
|
key: "integrations",
|
|
1520
1521
|
header: T("integrations", "Integrations"),
|
|
1521
1522
|
sortable: !1,
|
|
1522
|
-
render: (e) => /* @__PURE__ */
|
|
1523
|
+
render: (e) => /* @__PURE__ */ r(oi, { rows: _l[`${e.collection}:${e.item_id}`] })
|
|
1523
1524
|
}
|
|
1524
1525
|
] : [],
|
|
1525
1526
|
...Er ? [
|
|
@@ -1529,7 +1530,7 @@ function Od({
|
|
|
1529
1530
|
sortable: !1,
|
|
1530
1531
|
render: (e) => {
|
|
1531
1532
|
const t = Sl[`${e.collection}:${e.item_id}`];
|
|
1532
|
-
return !t || t.open === 0 ? /* @__PURE__ */
|
|
1533
|
+
return !t || t.open === 0 ? /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400", children: "—" }) : /* @__PURE__ */ d(
|
|
1533
1534
|
"span",
|
|
1534
1535
|
{
|
|
1535
1536
|
"data-queue-task-count": t.open,
|
|
@@ -1543,44 +1544,44 @@ function Od({
|
|
|
1543
1544
|
}
|
|
1544
1545
|
}
|
|
1545
1546
|
] : [],
|
|
1546
|
-
...
|
|
1547
|
+
...vt ? [
|
|
1547
1548
|
{
|
|
1548
1549
|
key: "send_backs",
|
|
1549
1550
|
header: T("send_backs", "Sent back"),
|
|
1550
1551
|
sortable: !0,
|
|
1551
|
-
render: (e) => /* @__PURE__ */
|
|
1552
|
+
render: (e) => /* @__PURE__ */ r(Wi, { summary: e.send_backs })
|
|
1552
1553
|
}
|
|
1553
1554
|
] : []
|
|
1554
1555
|
], Ql = {
|
|
1555
1556
|
key: "claim",
|
|
1556
1557
|
header: "",
|
|
1557
|
-
render: (e) => e.claimed_by ? /* @__PURE__ */
|
|
1558
|
+
render: (e) => e.claimed_by ? /* @__PURE__ */ r(
|
|
1558
1559
|
"button",
|
|
1559
1560
|
{
|
|
1560
1561
|
type: "button",
|
|
1561
1562
|
onClick: (t) => {
|
|
1562
|
-
t.stopPropagation(),
|
|
1563
|
+
t.stopPropagation(), et.mutate(e);
|
|
1563
1564
|
},
|
|
1564
1565
|
className: "text-[11px] text-slate-400 underline hover:text-slate-600",
|
|
1565
1566
|
children: "Release"
|
|
1566
1567
|
}
|
|
1567
|
-
) : /* @__PURE__ */
|
|
1568
|
+
) : /* @__PURE__ */ r(
|
|
1568
1569
|
"button",
|
|
1569
1570
|
{
|
|
1570
1571
|
type: "button",
|
|
1571
1572
|
onClick: (t) => {
|
|
1572
|
-
t.stopPropagation(),
|
|
1573
|
+
t.stopPropagation(), De.mutate(e);
|
|
1573
1574
|
},
|
|
1574
1575
|
className: "text-[11px] font-medium text-nvr-navy underline dark:text-nvr-cyan",
|
|
1575
1576
|
children: "Claim"
|
|
1576
1577
|
}
|
|
1577
1578
|
)
|
|
1578
|
-
}, Ft = (c == null ? void 0 : c.available_extra_fields) ?? [],
|
|
1579
|
-
|
|
1580
|
-
var
|
|
1579
|
+
}, Ft = (c == null ? void 0 : c.available_extra_fields) ?? [], dt = Wo("drill.queue"), W = dt.value, ta = (e) => dt.push([e]), jn = Q(null);
|
|
1580
|
+
P(() => {
|
|
1581
|
+
var a;
|
|
1581
1582
|
if (!z || !l) return;
|
|
1582
1583
|
const e = `queue:${l}`, t = Gr(), n = hs(e, t);
|
|
1583
|
-
if (((
|
|
1584
|
+
if (((a = jn.current) == null ? void 0 : a.queue) !== l) {
|
|
1584
1585
|
jn.current = { queue: l, enc: n };
|
|
1585
1586
|
return;
|
|
1586
1587
|
}
|
|
@@ -1592,29 +1593,29 @@ function Od({
|
|
|
1592
1593
|
_,
|
|
1593
1594
|
B,
|
|
1594
1595
|
R,
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1596
|
+
$,
|
|
1597
|
+
yt,
|
|
1598
|
+
Je,
|
|
1598
1599
|
ue,
|
|
1599
1600
|
W
|
|
1600
1601
|
]);
|
|
1601
1602
|
const jl = (e) => {
|
|
1602
1603
|
var t;
|
|
1603
1604
|
for (const n of (c == null ? void 0 : c.sources) ?? []) {
|
|
1604
|
-
const
|
|
1605
|
-
if (
|
|
1605
|
+
const a = (t = n.drilldown) == null ? void 0 : t[e];
|
|
1606
|
+
if (a)
|
|
1606
1607
|
return {
|
|
1607
|
-
enabled:
|
|
1608
|
-
layout_id:
|
|
1609
|
-
width:
|
|
1608
|
+
enabled: a.enabled !== !1,
|
|
1609
|
+
layout_id: a.layout_id ?? null,
|
|
1610
|
+
width: a.width ?? null
|
|
1610
1611
|
};
|
|
1611
1612
|
}
|
|
1612
1613
|
return { enabled: !0, layout_id: null, width: null };
|
|
1613
1614
|
}, Ul = J(() => {
|
|
1614
1615
|
const e = {};
|
|
1615
1616
|
for (const t of (c == null ? void 0 : c.sources) ?? [])
|
|
1616
|
-
for (const [n,
|
|
1617
|
-
n in e || (e[n] =
|
|
1617
|
+
for (const [n, a] of Object.entries(t.column_formats ?? {}))
|
|
1618
|
+
n in e || (e[n] = a);
|
|
1618
1619
|
return e;
|
|
1619
1620
|
}, [c == null ? void 0 : c.sources]), Vl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Il = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
|
|
1620
1621
|
function Gl(e) {
|
|
@@ -1625,7 +1626,7 @@ function Od({
|
|
|
1625
1626
|
return {
|
|
1626
1627
|
// The one read-only date style (army 11), the full stamp on hover.
|
|
1627
1628
|
text: js(t),
|
|
1628
|
-
title:
|
|
1629
|
+
title: Da(t)
|
|
1629
1630
|
};
|
|
1630
1631
|
}
|
|
1631
1632
|
return { text: e, title: e };
|
|
@@ -1634,17 +1635,17 @@ function Od({
|
|
|
1634
1635
|
...new Set(
|
|
1635
1636
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
1636
1637
|
)
|
|
1637
|
-
] : [], Wl =
|
|
1638
|
+
] : [], Wl = Ve({
|
|
1638
1639
|
queries: na.map((e) => ({
|
|
1639
1640
|
queryKey: ["cbv-collection-meta", e],
|
|
1640
|
-
queryFn: () =>
|
|
1641
|
+
queryFn: () => h.request(O(`/collections/${e}`)).then((t) => t.data),
|
|
1641
1642
|
staleTime: 10 * 6e4,
|
|
1642
1643
|
retry: !1
|
|
1643
1644
|
}))
|
|
1644
1645
|
}), Vn = /* @__PURE__ */ new Map();
|
|
1645
1646
|
na.forEach((e, t) => {
|
|
1646
|
-
var
|
|
1647
|
-
const n = (
|
|
1647
|
+
var a;
|
|
1648
|
+
const n = (a = Wl[t]) == null ? void 0 : a.data;
|
|
1648
1649
|
n && Vn.set(e, {
|
|
1649
1650
|
fields: new Map((n.fields ?? []).map((o) => [o.field, o])),
|
|
1650
1651
|
relations: n.relations ?? []
|
|
@@ -1652,30 +1653,30 @@ function Od({
|
|
|
1652
1653
|
});
|
|
1653
1654
|
const { data: Hl } = X({
|
|
1654
1655
|
queryKey: ["my-permissions"],
|
|
1655
|
-
queryFn: () =>
|
|
1656
|
-
enabled: Un.enabled && !
|
|
1656
|
+
queryFn: () => h.request(O("/security/my/permissions")).then((e) => e.data),
|
|
1657
|
+
enabled: Un.enabled && !Be,
|
|
1657
1658
|
staleTime: 5 * 6e4
|
|
1658
1659
|
}), ra = bi(), aa = (e, t) => {
|
|
1659
1660
|
if (t.includes(".")) return null;
|
|
1660
1661
|
const n = Vn.get(e.collection);
|
|
1661
1662
|
if (!n) return null;
|
|
1662
|
-
const
|
|
1663
|
-
return
|
|
1663
|
+
const a = _t.get(F(e));
|
|
1664
|
+
return a && !a.is_mine ? null : us({
|
|
1664
1665
|
config: Un,
|
|
1665
1666
|
key: t,
|
|
1666
1667
|
field: n.fields.get(t),
|
|
1667
1668
|
collection: e.collection,
|
|
1668
1669
|
relations: n.relations,
|
|
1669
|
-
mayUpdate:
|
|
1670
|
+
mayUpdate: Be || Zs(Hl, e.collection)
|
|
1670
1671
|
});
|
|
1671
1672
|
}, la = (e, t, n) => {
|
|
1672
|
-
var
|
|
1673
|
-
return n === "m2o" ? ((o = (
|
|
1674
|
-
}, Jl = (e, t, n,
|
|
1673
|
+
var a, o, s;
|
|
1674
|
+
return n === "m2o" ? ((o = (a = e.extra_ids) == null ? void 0 : a[t]) == null ? void 0 : o[0]) ?? null : ((s = e.extra) == null ? void 0 : s[t]) ?? null;
|
|
1675
|
+
}, Jl = (e, t, n, a, o) => {
|
|
1675
1676
|
const s = (b) => `${F(e)}|${b}`, u = [...re].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!aa(e, b)), m = o === 0 ? null : ms(u, t, o), y = (b) => b.collection === e.collection && b.item_id === e.item_id, N = (b) => y(b) ? n === "m2o" ? {
|
|
1676
1677
|
...b,
|
|
1677
|
-
extra_ids: { ...b.extra_ids ?? {}, [t]:
|
|
1678
|
-
} : { ...b, extra: { ...b.extra ?? {}, [t]:
|
|
1678
|
+
extra_ids: { ...b.extra_ids ?? {}, [t]: a == null ? [] : [String(a)] }
|
|
1679
|
+
} : { ...b, extra: { ...b.extra ?? {}, [t]: a } } : b;
|
|
1679
1680
|
ra.commit({
|
|
1680
1681
|
cellKey: s(t),
|
|
1681
1682
|
collection: e.collection,
|
|
@@ -1683,51 +1684,51 @@ function Od({
|
|
|
1683
1684
|
field: t,
|
|
1684
1685
|
kind: n,
|
|
1685
1686
|
before: la(e, t, n),
|
|
1686
|
-
value:
|
|
1687
|
+
value: a,
|
|
1687
1688
|
next: m ? s(m) : null,
|
|
1688
1689
|
optimistic: () => {
|
|
1689
|
-
const b =
|
|
1690
|
-
return
|
|
1690
|
+
const b = f.getQueriesData({ queryKey: ["queue-items", l] });
|
|
1691
|
+
return f.setQueriesData({ queryKey: ["queue-items", l] }, (E) => {
|
|
1691
1692
|
const v = E;
|
|
1692
1693
|
return Array.isArray(v == null ? void 0 : v.data) ? { ...v, data: v.data.map(N) } : Array.isArray(v == null ? void 0 : v.rows) ? { ...v, rows: v.rows.map(N) } : E;
|
|
1693
1694
|
}), () => {
|
|
1694
|
-
for (const [E, v] of b)
|
|
1695
|
+
for (const [E, v] of b) f.setQueryData(E, v);
|
|
1695
1696
|
};
|
|
1696
1697
|
},
|
|
1697
1698
|
// Labels, rollups and the row's place in the queue follow the server.
|
|
1698
|
-
onSaved: () => void
|
|
1699
|
+
onSaved: () => void f.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
1699
1700
|
});
|
|
1700
1701
|
}, Yl = (e, t, n) => {
|
|
1701
|
-
const
|
|
1702
|
-
if (!
|
|
1702
|
+
const a = aa(e, t);
|
|
1703
|
+
if (!a) return n;
|
|
1703
1704
|
const o = Vn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
|
|
1704
|
-
return /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ r(
|
|
1705
1706
|
fi,
|
|
1706
1707
|
{
|
|
1707
1708
|
controller: ra,
|
|
1708
1709
|
cellKey: `${F(e)}|${t}`,
|
|
1709
|
-
kind:
|
|
1710
|
-
value: la(e, t,
|
|
1711
|
-
label: T(`extra.${t}`,
|
|
1710
|
+
kind: a,
|
|
1711
|
+
value: la(e, t, a),
|
|
1712
|
+
label: T(`extra.${t}`, Ge(t)),
|
|
1712
1713
|
choices: s ? ds(s) : void 0,
|
|
1713
|
-
target:
|
|
1714
|
-
onCommit: (u, m) => Jl(e, t,
|
|
1714
|
+
target: a === "m2o" && o ? cs(o.relations, e.collection, t) : null,
|
|
1715
|
+
onCommit: (u, m) => Jl(e, t, a, u, m),
|
|
1715
1716
|
children: n
|
|
1716
1717
|
}
|
|
1717
1718
|
);
|
|
1718
1719
|
}, zl = Ft.map((e) => ({
|
|
1719
1720
|
key: `extra.${e}`,
|
|
1720
|
-
header: T(`extra.${e}`,
|
|
1721
|
+
header: T(`extra.${e}`, Ge(e)),
|
|
1721
1722
|
sortable: !0,
|
|
1722
1723
|
render: (t) => Yl(t, e, Xl(t, e))
|
|
1723
1724
|
}));
|
|
1724
1725
|
function Xl(e, t) {
|
|
1725
|
-
var n,
|
|
1726
|
+
var n, a;
|
|
1726
1727
|
{
|
|
1727
1728
|
const o = (n = e.extra) == null ? void 0 : n[t];
|
|
1728
|
-
if (o == null || o === "") return /* @__PURE__ */
|
|
1729
|
-
const s = Ne(t), u = ((c == null ? void 0 : c.extra_field_meta) ?? []).find((v) => v.path === t), m = s ?
|
|
1730
|
-
return (u == null ? void 0 : u.kind) === "relation" && u.target_collection && b.length > 0 && E.enabled && !u.aggregate ? /* @__PURE__ */
|
|
1729
|
+
if (o == null || o === "") return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
|
|
1730
|
+
const s = Ne(t), u = ((c == null ? void 0 : c.extra_field_meta) ?? []).find((v) => v.path === t), m = s ? Ie(String(o), s) : Kt(u, String(o)), { text: y, title: N } = Gl(m), b = ((a = e.extra_ids) == null ? void 0 : a[t]) ?? [], E = jl(t);
|
|
1731
|
+
return (u == null ? void 0 : u.kind) === "relation" && u.target_collection && b.length > 0 && E.enabled && !u.aggregate ? /* @__PURE__ */ r(
|
|
1731
1732
|
"button",
|
|
1732
1733
|
{
|
|
1733
1734
|
type: "button",
|
|
@@ -1744,7 +1745,7 @@ function Od({
|
|
|
1744
1745
|
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",
|
|
1745
1746
|
children: y
|
|
1746
1747
|
}
|
|
1747
|
-
) : (u == null ? void 0 : u.kind) === "relation" && u.aggregate ? /* @__PURE__ */
|
|
1748
|
+
) : (u == null ? void 0 : u.kind) === "relation" && u.aggregate ? /* @__PURE__ */ r(
|
|
1748
1749
|
"button",
|
|
1749
1750
|
{
|
|
1750
1751
|
type: "button",
|
|
@@ -1755,7 +1756,7 @@ function Od({
|
|
|
1755
1756
|
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",
|
|
1756
1757
|
children: y
|
|
1757
1758
|
}
|
|
1758
|
-
) : /* @__PURE__ */
|
|
1759
|
+
) : /* @__PURE__ */ r("span", { className: "block max-w-[200px] truncate text-[12px]", title: N, children: y });
|
|
1759
1760
|
}
|
|
1760
1761
|
}
|
|
1761
1762
|
const oa = [
|
|
@@ -1766,27 +1767,27 @@ function Od({
|
|
|
1766
1767
|
"state_entered",
|
|
1767
1768
|
"sla_status",
|
|
1768
1769
|
"at_risk",
|
|
1769
|
-
...
|
|
1770
|
-
...
|
|
1770
|
+
...at ? ["addendums"] : [],
|
|
1771
|
+
...kt ? ["fulfilment"] : [],
|
|
1771
1772
|
...qe ? ["integrations"] : [],
|
|
1772
|
-
...
|
|
1773
|
+
...vt ? ["send_backs"] : [],
|
|
1773
1774
|
...Er ? ["tasks"] : [],
|
|
1774
1775
|
...Ft.map((e) => `extra.${e}`)
|
|
1775
1776
|
], Zl = [
|
|
1776
1777
|
...Qn ? ["collection"] : [],
|
|
1777
1778
|
"state",
|
|
1778
1779
|
"owners",
|
|
1779
|
-
...
|
|
1780
|
-
...
|
|
1780
|
+
...at ? ["addendums"] : [],
|
|
1781
|
+
...kt ? ["fulfilment"] : [],
|
|
1781
1782
|
...qe ? ["integrations"] : [],
|
|
1782
|
-
...
|
|
1783
|
+
...vt ? ["send_backs"] : [],
|
|
1783
1784
|
"aging_hours",
|
|
1784
1785
|
"sla_status",
|
|
1785
1786
|
"at_risk",
|
|
1786
1787
|
...Ft.slice(0, 2).map((e) => `extra.${e}`)
|
|
1787
|
-
], eo = (p == null ? void 0 : p.default_columns) ?? null, In =
|
|
1788
|
-
|
|
1789
|
-
const to = new Set(
|
|
1788
|
+
], eo = (p == null ? void 0 : p.default_columns) ?? null, In = yt ?? eo, re = new Set(In ?? Zl);
|
|
1789
|
+
at && !Mt.has("addendums") && re.add("addendums"), kt && !Mt.has("fulfilment") && re.add("fulfilment"), qe && !Mt.has("integrations") && re.add("integrations"), vt && !Mt.has("send_backs") && re.add("send_backs");
|
|
1790
|
+
const to = new Set(Be ? [] : (p == null ? void 0 : p.admin_only_columns) ?? []);
|
|
1790
1791
|
for (const e of to) re.delete(e);
|
|
1791
1792
|
const Lt = [
|
|
1792
1793
|
...(In ?? []).filter((e) => oa.includes(e)),
|
|
@@ -1795,15 +1796,15 @@ function Od({
|
|
|
1795
1796
|
function ro(e) {
|
|
1796
1797
|
const { active: t, over: n } = e;
|
|
1797
1798
|
if (!n || t.id === n.id) return;
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1800
|
-
vo(Lt,
|
|
1799
|
+
const a = Lt.indexOf(String(t.id)), o = Lt.indexOf(String(n.id));
|
|
1800
|
+
a === -1 || o === -1 || Ht(
|
|
1801
|
+
vo(Lt, a, o).filter((s) => re.has(s))
|
|
1801
1802
|
);
|
|
1802
1803
|
}
|
|
1803
1804
|
const sa = ea.find((e) => e.key === "label"), ao = {
|
|
1804
1805
|
...sa,
|
|
1805
1806
|
render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ r(Js, { rowId: e.item_id }),
|
|
1807
1808
|
sa.render(e, ...t)
|
|
1808
1809
|
] })
|
|
1809
1810
|
}, lo = ((p == null ? void 0 : p.formula_columns) ?? []).map(
|
|
@@ -1814,42 +1815,42 @@ function Od({
|
|
|
1814
1815
|
const n = {
|
|
1815
1816
|
...t,
|
|
1816
1817
|
...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([s, u]) => [`extra.${s}`, u])) : {}
|
|
1817
|
-
},
|
|
1818
|
+
}, a = es(e.formula, (s) => {
|
|
1818
1819
|
const u = n[s] ?? (t.extra ? t.extra[s] : void 0), m = Number(u);
|
|
1819
1820
|
return Number.isFinite(m) ? m : u ?? null;
|
|
1820
1821
|
});
|
|
1821
|
-
if (
|
|
1822
|
-
const o = Number(
|
|
1823
|
-
return Number.isFinite(o) ? /* @__PURE__ */
|
|
1822
|
+
if (a == null || typeof a == "boolean") return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
|
|
1823
|
+
const o = Number(a);
|
|
1824
|
+
return Number.isFinite(o) ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ r("span", { children: String(a) });
|
|
1824
1825
|
}
|
|
1825
1826
|
})
|
|
1826
1827
|
), Gn = [...ea, ...zl, ...lo], ia = Ri(
|
|
1827
1828
|
Lt,
|
|
1828
1829
|
(e) => {
|
|
1829
1830
|
var n;
|
|
1830
|
-
const t = (n = Gn.find((
|
|
1831
|
+
const t = (n = Gn.find((a) => a.key === e)) == null ? void 0 : n.header;
|
|
1831
1832
|
return typeof t == "string" ? t : e;
|
|
1832
1833
|
},
|
|
1833
1834
|
re
|
|
1834
1835
|
), oo = {
|
|
1835
1836
|
key: "__actions__",
|
|
1836
1837
|
header: "",
|
|
1837
|
-
render: (e) => e.collection === "tasks" || e.collection === sn ? null : /* @__PURE__ */
|
|
1838
|
+
render: (e) => e.collection === "tasks" || e.collection === sn ? null : /* @__PURE__ */ r("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(
|
|
1838
1839
|
Xs,
|
|
1839
1840
|
{
|
|
1840
1841
|
collection: e.collection,
|
|
1841
1842
|
id: e.item_id,
|
|
1842
1843
|
label: e.label,
|
|
1843
1844
|
hasPipeline: e.state != null,
|
|
1844
|
-
onOpen: () =>
|
|
1845
|
-
onPeek: () =>
|
|
1845
|
+
onOpen: () => ot(e),
|
|
1846
|
+
onPeek: () => Me(e),
|
|
1846
1847
|
urlFor: Y.urlFor,
|
|
1847
1848
|
onDeleted: () => {
|
|
1848
|
-
|
|
1849
|
-
A.success("Moved to trash"),
|
|
1850
|
-
}).catch((t) => A.error(
|
|
1849
|
+
h.request(zn(`/items/${e.collection}/${e.item_id}`)).then(() => {
|
|
1850
|
+
A.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
1851
|
+
}).catch((t) => A.error(ut(t, "Delete failed")));
|
|
1851
1852
|
},
|
|
1852
|
-
onAfterTransition: () => void
|
|
1853
|
+
onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
1853
1854
|
bulkEnabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
|
|
1854
1855
|
disabled: ne
|
|
1855
1856
|
}
|
|
@@ -1866,7 +1867,7 @@ function Od({
|
|
|
1866
1867
|
try {
|
|
1867
1868
|
const t = [];
|
|
1868
1869
|
for (let m = 1; t.length < 1e4; m++) {
|
|
1869
|
-
const y = await
|
|
1870
|
+
const y = await h.request(
|
|
1870
1871
|
O(`/queues/${l}/items`, {
|
|
1871
1872
|
scope: g,
|
|
1872
1873
|
sort: B === "state_entered" ? "-aging_hours" : B === "-state_entered" ? "aging_hours" : B,
|
|
@@ -1877,7 +1878,7 @@ function Od({
|
|
|
1877
1878
|
), N = y.data ?? [];
|
|
1878
1879
|
if (t.push(...N), N.length < 100 || t.length >= (y.total ?? 0)) break;
|
|
1879
1880
|
}
|
|
1880
|
-
const n = (m) => (c.extra_field_meta ?? []).find((y) => y.path === m),
|
|
1881
|
+
const n = (m) => (c.extra_field_meta ?? []).find((y) => y.path === m), a = Vi(
|
|
1881
1882
|
t.slice(0, 1e4),
|
|
1882
1883
|
Tt.map((m) => ({
|
|
1883
1884
|
key: m.key,
|
|
@@ -1885,42 +1886,42 @@ function Od({
|
|
|
1885
1886
|
})),
|
|
1886
1887
|
{
|
|
1887
1888
|
stateLabel: Fe,
|
|
1888
|
-
collectionLabel:
|
|
1889
|
+
collectionLabel: lt,
|
|
1889
1890
|
extraText: (m, y) => {
|
|
1890
1891
|
const N = Ne(m);
|
|
1891
|
-
return N && N.type !== "number" ?
|
|
1892
|
+
return N && N.type !== "number" ? Ie(y, N) : Kt(n(m), y);
|
|
1892
1893
|
},
|
|
1893
1894
|
extraIsNumber: (m) => {
|
|
1894
1895
|
var y;
|
|
1895
1896
|
return ((y = Ne(m)) == null ? void 0 : y.type) === "number";
|
|
1896
1897
|
}
|
|
1897
1898
|
}
|
|
1898
|
-
), o = new Blob([
|
|
1899
|
-
u.href = s, u.download =
|
|
1899
|
+
), o = new Blob([a], { type: "text/csv;charset=utf-8" }), s = URL.createObjectURL(o), u = document.createElement("a");
|
|
1900
|
+
u.href = s, u.download = Ii(c.name), document.body.appendChild(u), u.click(), u.remove(), setTimeout(() => URL.revokeObjectURL(s), 1e3), A.success(
|
|
1900
1901
|
t.length >= 1e4 ? `Exported the first ${1e4.toLocaleString("en-US")} rows` : `Exported ${t.length.toLocaleString("en-US")} ${t.length === 1 ? "row" : "rows"}`
|
|
1901
1902
|
);
|
|
1902
1903
|
} catch (e) {
|
|
1903
|
-
A.error(
|
|
1904
|
+
A.error(ut(e, "Could not export this worklist"));
|
|
1904
1905
|
} finally {
|
|
1905
1906
|
ca(!1);
|
|
1906
1907
|
}
|
|
1907
1908
|
}
|
|
1908
1909
|
}
|
|
1909
1910
|
const da = J(() => {
|
|
1910
|
-
var
|
|
1911
|
-
const e = p == null ? void 0 : p.default_pins, t =
|
|
1911
|
+
var a;
|
|
1912
|
+
const e = p == null ? void 0 : p.default_pins, t = Je ?? (e && Object.keys(e).length > 0 ? e : { [((a = Tt[0]) == null ? void 0 : a.key) ?? "label"]: "left" }), n = new Set(Tt.map((o) => o.key));
|
|
1912
1913
|
return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
|
|
1913
|
-
}, [
|
|
1914
|
+
}, [Je, p == null ? void 0 : p.default_pins, Tt.map((e) => e.key).join("|")]), ua = [
|
|
1914
1915
|
{ value: "state", label: "State" },
|
|
1915
1916
|
{ value: "collection", label: "Collection" },
|
|
1916
1917
|
{ value: "sla_status", label: "SLA status" },
|
|
1917
1918
|
{ value: "at_risk", label: "At risk" },
|
|
1918
1919
|
{ value: "owners", label: "Owner" },
|
|
1919
1920
|
{ value: "aging", label: "Aging" },
|
|
1920
|
-
...Ft.filter((e) => re.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: T(`extra.${e}`,
|
|
1921
|
+
...Ft.filter((e) => re.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: T(`extra.${e}`, Ge(e)) }))
|
|
1921
1922
|
], ma = (e) => async (t, n) => {
|
|
1922
1923
|
if (!e.target_collection || !e.display_field) return [];
|
|
1923
|
-
const
|
|
1924
|
+
const a = {
|
|
1924
1925
|
limit: 25,
|
|
1925
1926
|
sort: e.display_field,
|
|
1926
1927
|
// Records hidden from pickers (a retired zone) are not offered.
|
|
@@ -1933,31 +1934,31 @@ function Od({
|
|
|
1933
1934
|
}
|
|
1934
1935
|
const u = [...o, ...s], m = u.length ? Ts(
|
|
1935
1936
|
e.target_collection,
|
|
1936
|
-
await Es(
|
|
1937
|
+
await Es(h, f, e.target_collection),
|
|
1937
1938
|
u
|
|
1938
1939
|
) : null, y = [
|
|
1939
1940
|
...t.trim() ? [{ [e.display_field]: { _contains: t.trim() } }] : [],
|
|
1940
1941
|
...m ? [m] : []
|
|
1941
1942
|
];
|
|
1942
|
-
y.length > 0 && (
|
|
1943
|
-
const b = (await
|
|
1944
|
-
O(`/items/${e.target_collection}`,
|
|
1943
|
+
y.length > 0 && (a.filter = JSON.stringify(y.length === 1 ? y[0] : { _and: y }));
|
|
1944
|
+
const b = (await h.request(
|
|
1945
|
+
O(`/items/${e.target_collection}`, a)
|
|
1945
1946
|
)).data ?? [], E = Ne(e.path), v = fe[e.path] ? new Set(fe[e.path]) : null, ae = /* @__PURE__ */ new Set(), pe = [];
|
|
1946
1947
|
for (const q of b) {
|
|
1947
1948
|
const V = q[e.display_field];
|
|
1948
1949
|
if (V == null || V === "") continue;
|
|
1949
1950
|
const H = String(V);
|
|
1950
|
-
ae.has(H) || v && !v.has(H) || (ae.add(H), pe.push({ label: E ?
|
|
1951
|
+
ae.has(H) || v && !v.has(H) || (ae.add(H), pe.push({ label: E ? Ie(H, E) : H, value: H }));
|
|
1951
1952
|
}
|
|
1952
1953
|
return pe;
|
|
1953
|
-
}, an = new Map(((c == null ? void 0 : c.extra_field_meta) ?? []).map((e) => [e.path, e])),
|
|
1954
|
+
}, an = new Map(((c == null ? void 0 : c.extra_field_meta) ?? []).map((e) => [e.path, e])), Ue = [
|
|
1954
1955
|
{
|
|
1955
1956
|
key: "collection",
|
|
1956
1957
|
placeholder: T("collection", "Collection"),
|
|
1957
1958
|
type: "combobox",
|
|
1958
1959
|
multi: !0,
|
|
1959
1960
|
options: ((i == null ? void 0 : i.available_values.collection) ?? []).map((e) => ({
|
|
1960
|
-
label:
|
|
1961
|
+
label: lt(e),
|
|
1961
1962
|
value: e
|
|
1962
1963
|
}))
|
|
1963
1964
|
},
|
|
@@ -2014,7 +2015,7 @@ function Od({
|
|
|
2014
2015
|
type: "range",
|
|
2015
2016
|
range_unit: "h"
|
|
2016
2017
|
},
|
|
2017
|
-
...
|
|
2018
|
+
...at ? [
|
|
2018
2019
|
{
|
|
2019
2020
|
key: "addendums",
|
|
2020
2021
|
placeholder: "Addendums",
|
|
@@ -2035,7 +2036,7 @@ function Od({
|
|
|
2035
2036
|
options: si.map((e) => ({ label: e.label, value: e.value }))
|
|
2036
2037
|
}
|
|
2037
2038
|
] : [],
|
|
2038
|
-
...
|
|
2039
|
+
...kt ? [
|
|
2039
2040
|
{
|
|
2040
2041
|
key: "fulfilment",
|
|
2041
2042
|
placeholder: "Shipped",
|
|
@@ -2043,7 +2044,7 @@ function Od({
|
|
|
2043
2044
|
options: ai
|
|
2044
2045
|
}
|
|
2045
2046
|
] : [],
|
|
2046
|
-
...
|
|
2047
|
+
...vt ? [
|
|
2047
2048
|
{
|
|
2048
2049
|
key: "send_backs",
|
|
2049
2050
|
placeholder: "Sent back",
|
|
@@ -2069,7 +2070,7 @@ function Od({
|
|
|
2069
2070
|
placeholder: T("label", "Item"),
|
|
2070
2071
|
type: "combobox",
|
|
2071
2072
|
multi: !0,
|
|
2072
|
-
loadOptions: async (e) => ((await
|
|
2073
|
+
loadOptions: async (e) => ((await h.request(
|
|
2073
2074
|
O(`/queues/${l}/label-suggest`, e.trim() ? { q: e.trim() } : {})
|
|
2074
2075
|
)).data ?? []).map((n) => ({ label: n, value: n }))
|
|
2075
2076
|
},
|
|
@@ -2086,12 +2087,12 @@ function Od({
|
|
|
2086
2087
|
},
|
|
2087
2088
|
...Ft.map((e) => {
|
|
2088
2089
|
var u, m, y;
|
|
2089
|
-
const t = an.get(e), n = T(`extra.${e}`,
|
|
2090
|
-
if ((o == null ? void 0 : o.type) === "datetime") return { ...
|
|
2091
|
-
if ((o == null ? void 0 : o.type) === "number") return { ...
|
|
2090
|
+
const t = an.get(e), n = T(`extra.${e}`, Ge(e)), a = { key: `extra.${e}`, placeholder: n }, o = Ne(e);
|
|
2091
|
+
if ((o == null ? void 0 : o.type) === "datetime") return { ...a, type: "date" };
|
|
2092
|
+
if ((o == null ? void 0 : o.type) === "number") return { ...a, type: "number" };
|
|
2092
2093
|
if ((o == null ? void 0 : o.type) === "boolean")
|
|
2093
2094
|
return {
|
|
2094
|
-
...
|
|
2095
|
+
...a,
|
|
2095
2096
|
type: "select",
|
|
2096
2097
|
options: [
|
|
2097
2098
|
{ label: o.true_label ?? "Yes", value: "bool:true" },
|
|
@@ -2100,35 +2101,35 @@ function Od({
|
|
|
2100
2101
|
};
|
|
2101
2102
|
const s = (u = i == null ? void 0 : i.available_values.extra) == null ? void 0 : u[e];
|
|
2102
2103
|
return s != null && s.length ? {
|
|
2103
|
-
...
|
|
2104
|
+
...a,
|
|
2104
2105
|
type: "combobox",
|
|
2105
2106
|
multi: !0,
|
|
2106
2107
|
// The "your access" mark follows the person's restriction on every tab,
|
|
2107
2108
|
// not only on an empty one (army 11 Q2-1).
|
|
2108
2109
|
restricted: !!((m = fe[e]) != null && m.length),
|
|
2109
2110
|
options: s.map((N) => ({
|
|
2110
|
-
label: o ?
|
|
2111
|
+
label: o ? Ie(N, o) : Kt(t, N),
|
|
2111
2112
|
value: N
|
|
2112
2113
|
}))
|
|
2113
2114
|
} : (t == null ? void 0 : t.kind) === "relation" ? {
|
|
2114
|
-
...
|
|
2115
|
+
...a,
|
|
2115
2116
|
type: "combobox",
|
|
2116
2117
|
multi: !0,
|
|
2117
2118
|
restricted: !!((y = fe[e]) != null && y.length),
|
|
2118
2119
|
loadOptions: ma(t)
|
|
2119
|
-
} : { ...
|
|
2120
|
+
} : { ...a, placeholder: `Search ${n}…`, type: "text" };
|
|
2120
2121
|
})
|
|
2121
|
-
], Hn =
|
|
2122
|
+
], Hn = Ue.filter(
|
|
2122
2123
|
(e) => re.has(e.key) || e.key === "label" || e.key === "owners"
|
|
2123
2124
|
), Jn = (e) => {
|
|
2124
2125
|
var t;
|
|
2125
|
-
return (((t =
|
|
2126
|
+
return (((t = Ue.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
|
|
2126
2127
|
}, Yn = (() => {
|
|
2127
|
-
var n,
|
|
2128
|
+
var n, a;
|
|
2128
2129
|
const e = [];
|
|
2129
|
-
for (const [o, s] of Object.entries(
|
|
2130
|
+
for (const [o, s] of Object.entries(Ke)) {
|
|
2130
2131
|
if (!s || Array.isArray(s) && s.length === 0) continue;
|
|
2131
|
-
const u =
|
|
2132
|
+
const u = Ue.find((b) => b.key === o), m = o.startsWith("extra.") ? o.slice(6) : null, y = m ? Ne(m) : null, N = ts({
|
|
2132
2133
|
field: Jn(o),
|
|
2133
2134
|
type: (u == null ? void 0 : u.type) ?? "select",
|
|
2134
2135
|
value: s,
|
|
@@ -2145,15 +2146,15 @@ function Od({
|
|
|
2145
2146
|
return ns({
|
|
2146
2147
|
noun: "items",
|
|
2147
2148
|
scope: g === "mine" ? "you own" : g === "unowned" ? "with no owners" : g === "claimed" ? "you claimed" : null,
|
|
2148
|
-
viewName: ((
|
|
2149
|
+
viewName: ((a = (n = G == null ? void 0 : G.data) == null ? void 0 : n.find((o) => o.id === st)) == null ? void 0 : a.name) ?? null,
|
|
2149
2150
|
clauses: e,
|
|
2150
2151
|
shown: typeof t == "number" ? t : null,
|
|
2151
2152
|
of: (x == null ? void 0 : x.total) ?? null
|
|
2152
2153
|
});
|
|
2153
2154
|
})(), Et = new Set(Object.keys(he.current)), io = ((e) => {
|
|
2154
2155
|
var n;
|
|
2155
|
-
if (e.some((
|
|
2156
|
-
const t =
|
|
2156
|
+
if (e.some((a) => a.key === "state")) return e;
|
|
2157
|
+
const t = Ue.find((a) => a.key === "state");
|
|
2157
2158
|
return !t || i && !((n = i.available_values.state) != null && n.length) ? e : [...e, t];
|
|
2158
2159
|
})(
|
|
2159
2160
|
(() => {
|
|
@@ -2173,7 +2174,7 @@ function Od({
|
|
|
2173
2174
|
cascade: v,
|
|
2174
2175
|
restricted: !!((pe = fe[u]) != null && pe.length),
|
|
2175
2176
|
options: b.map((V) => ({
|
|
2176
|
-
label: N && N.type !== "number" ?
|
|
2177
|
+
label: N && N.type !== "number" ? Ie(V, N) : Kt(m, V),
|
|
2177
2178
|
value: V
|
|
2178
2179
|
}))
|
|
2179
2180
|
} : (m == null ? void 0 : m.kind) === "relation" ? {
|
|
@@ -2192,9 +2193,9 @@ function Od({
|
|
|
2192
2193
|
const y = (m.path ?? []).join(".");
|
|
2193
2194
|
let N;
|
|
2194
2195
|
if (m.key === "state" || /(^|_)state$/.test(((o = m.path) == null ? void 0 : o[0]) ?? ""))
|
|
2195
|
-
N =
|
|
2196
|
+
N = Ue.find((b) => b.key === "state");
|
|
2196
2197
|
else {
|
|
2197
|
-
const b =
|
|
2198
|
+
const b = Ue.filter((v) => {
|
|
2198
2199
|
var pe;
|
|
2199
2200
|
if (!v.key.startsWith("extra.") || u.has(v.key)) return !1;
|
|
2200
2201
|
const ae = v.key.slice(6);
|
|
@@ -2204,15 +2205,15 @@ function Od({
|
|
|
2204
2205
|
}
|
|
2205
2206
|
!N || u.has(N.key) || (u.add(N.key), s.push(m.label ? { ...N, placeholder: m.label } : N));
|
|
2206
2207
|
}
|
|
2207
|
-
for (const m of
|
|
2208
|
+
for (const m of Ue.map(e))
|
|
2208
2209
|
m && !u.has(m.key) && (Et.has(m.key) || m.restricted) && s.push(m);
|
|
2209
2210
|
if (s.length > 0) return s;
|
|
2210
2211
|
}
|
|
2211
|
-
const t = Hn.map(e).filter((s) => s !== null),
|
|
2212
|
+
const t = Hn.map(e).filter((s) => s !== null), a = [
|
|
2212
2213
|
...t.filter((s) => Et.has(s.key) || s.restricted),
|
|
2213
2214
|
...t.filter((s) => !Et.has(s.key) && !s.restricted)
|
|
2214
2215
|
].slice(0, 6);
|
|
2215
|
-
return
|
|
2216
|
+
return a.length > 0 ? a : Hn.filter((s) => s.key === "state" || s.key === "owners");
|
|
2216
2217
|
})()
|
|
2217
2218
|
), co = (x == null ? void 0 : x.sla_tracked) !== 0 || _.sla_status === "warning" || _.sla_status === "breached", uo = (() => {
|
|
2218
2219
|
if (!x) return null;
|
|
@@ -2223,7 +2224,7 @@ function Od({
|
|
|
2223
2224
|
label: "past SLA",
|
|
2224
2225
|
tone: "text-red-600 dark:text-red-400",
|
|
2225
2226
|
on: _.sla_status === "breached",
|
|
2226
|
-
toggle: () =>
|
|
2227
|
+
toggle: () => ze("sla_status", "breached")
|
|
2227
2228
|
},
|
|
2228
2229
|
{
|
|
2229
2230
|
key: "warning",
|
|
@@ -2231,7 +2232,7 @@ function Od({
|
|
|
2231
2232
|
label: "SLA soon",
|
|
2232
2233
|
tone: "text-amber-700 dark:text-amber-400",
|
|
2233
2234
|
on: _.sla_status === "warning",
|
|
2234
|
-
toggle: () =>
|
|
2235
|
+
toggle: () => ze("sla_status", "warning")
|
|
2235
2236
|
},
|
|
2236
2237
|
{
|
|
2237
2238
|
key: "at_risk",
|
|
@@ -2239,7 +2240,7 @@ function Od({
|
|
|
2239
2240
|
label: "at risk",
|
|
2240
2241
|
tone: "text-red-600 dark:text-red-400",
|
|
2241
2242
|
on: _.at_risk === "yes",
|
|
2242
|
-
toggle: () =>
|
|
2243
|
+
toggle: () => ze("at_risk", "yes")
|
|
2243
2244
|
},
|
|
2244
2245
|
{
|
|
2245
2246
|
key: "unowned",
|
|
@@ -2248,7 +2249,7 @@ function Od({
|
|
|
2248
2249
|
tone: "text-slate-600 dark:text-slate-300",
|
|
2249
2250
|
on: g === "unowned",
|
|
2250
2251
|
toggle: () => {
|
|
2251
|
-
te(g === "unowned" ? "all" : "unowned"),
|
|
2252
|
+
te(g === "unowned" ? "all" : "unowned"), D(1);
|
|
2252
2253
|
}
|
|
2253
2254
|
}
|
|
2254
2255
|
].filter((n) => n.n > 0 || n.on);
|
|
@@ -2270,7 +2271,7 @@ function Od({
|
|
|
2270
2271
|
),
|
|
2271
2272
|
"data-queue-summary-item": n.key,
|
|
2272
2273
|
children: [
|
|
2273
|
-
/* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ r("span", { className: L("font-semibold", n.tone), children: n.n.toLocaleString() }),
|
|
2274
2275
|
" ",
|
|
2275
2276
|
n.label
|
|
2276
2277
|
]
|
|
@@ -2289,15 +2290,15 @@ function Od({
|
|
|
2289
2290
|
function mo(e) {
|
|
2290
2291
|
const t = new Set(re);
|
|
2291
2292
|
t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && nr((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && nr((n) => {
|
|
2292
|
-
const
|
|
2293
|
-
return
|
|
2293
|
+
const a = new Set(n);
|
|
2294
|
+
return a.delete(e), a;
|
|
2294
2295
|
})), Ht([...t]);
|
|
2295
2296
|
}
|
|
2296
2297
|
return jt ? (K == null ? void 0 : K((jt == null ? void 0 : jt.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
|
|
2297
2298
|
/* @__PURE__ */ d("div", { className: "shrink-0", children: [
|
|
2298
2299
|
(i == null ? void 0 : i.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: [
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2300
|
+
/* @__PURE__ */ r(So, { className: "h-4 w-4 shrink-0" }),
|
|
2301
|
+
/* @__PURE__ */ r("span", { children: "This view hit the row safety limit — the table below may not include every matching item, but the totals above are exact. Narrow the filters (or clear the priority sort on a large queue) to browse everything." })
|
|
2301
2302
|
] }),
|
|
2302
2303
|
/* @__PURE__ */ d(
|
|
2303
2304
|
"div",
|
|
@@ -2305,13 +2306,13 @@ function Od({
|
|
|
2305
2306
|
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",
|
|
2306
2307
|
"data-queue-toolbar": !0,
|
|
2307
2308
|
children: [
|
|
2308
|
-
z ? /* @__PURE__ */
|
|
2309
|
-
(e, t) => /* @__PURE__ */
|
|
2309
|
+
z ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: Ji.filter((e) => ge || e.value !== "claimed").map(
|
|
2310
|
+
(e, t) => /* @__PURE__ */ r(
|
|
2310
2311
|
"button",
|
|
2311
2312
|
{
|
|
2312
2313
|
type: "button",
|
|
2313
2314
|
onClick: () => {
|
|
2314
|
-
te(e.value),
|
|
2315
|
+
te(e.value), D(1);
|
|
2315
2316
|
},
|
|
2316
2317
|
className: L(
|
|
2317
2318
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
@@ -2322,28 +2323,28 @@ function Od({
|
|
|
2322
2323
|
},
|
|
2323
2324
|
e.value
|
|
2324
2325
|
)
|
|
2325
|
-
) }) : /* @__PURE__ */
|
|
2326
|
+
) }) : /* @__PURE__ */ r("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
2326
2327
|
z ? Ae.length <= 1 ? null : (
|
|
2327
2328
|
// One allowed view means nothing to switch to — no button.
|
|
2328
|
-
/* @__PURE__ */
|
|
2329
|
+
/* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
|
|
2329
2330
|
{ value: "table", label: "Table" },
|
|
2330
2331
|
{ value: "kanban", label: "Kanban" },
|
|
2331
2332
|
{ value: "workload", label: "Workload" }
|
|
2332
|
-
].filter((e) => Ae.includes(e.value)).map((e, t) => /* @__PURE__ */
|
|
2333
|
+
].filter((e) => Ae.includes(e.value)).map((e, t) => /* @__PURE__ */ r(
|
|
2333
2334
|
"button",
|
|
2334
2335
|
{
|
|
2335
2336
|
type: "button",
|
|
2336
|
-
onClick: () =>
|
|
2337
|
+
onClick: () => We(e.value),
|
|
2337
2338
|
className: L(
|
|
2338
2339
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
2339
2340
|
t > 0 && "border-l border-slate-200 dark:border-border",
|
|
2340
|
-
|
|
2341
|
+
$ === 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"
|
|
2341
2342
|
),
|
|
2342
2343
|
children: e.label
|
|
2343
2344
|
},
|
|
2344
2345
|
e.value
|
|
2345
2346
|
)) })
|
|
2346
|
-
) : /* @__PURE__ */
|
|
2347
|
+
) : /* @__PURE__ */ r("div", { className: "h-8 w-40 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
2347
2348
|
/* @__PURE__ */ d(
|
|
2348
2349
|
"button",
|
|
2349
2350
|
{
|
|
@@ -2357,12 +2358,12 @@ function Od({
|
|
|
2357
2358
|
}),
|
|
2358
2359
|
className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${_.unseen === "yes" ? "border-nvr-cyan/40 bg-[#f2fdff] text-nvr-navy dark:border-nvr-cyan/40 dark:bg-[#20303a] dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
|
|
2359
2360
|
children: [
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ r("span", { className: "h-2 w-2 rounded-full bg-nvr-cyan" }),
|
|
2361
2362
|
"Unseen changes"
|
|
2362
2363
|
]
|
|
2363
2364
|
}
|
|
2364
2365
|
),
|
|
2365
|
-
|
|
2366
|
+
at && /* @__PURE__ */ d(
|
|
2366
2367
|
"button",
|
|
2367
2368
|
{
|
|
2368
2369
|
type: "button",
|
|
@@ -2374,12 +2375,12 @@ function Od({
|
|
|
2374
2375
|
}),
|
|
2375
2376
|
className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${_.addendums === "active" ? "border-amber-400 bg-amber-50 text-amber-800 dark:border-amber-500/60 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
|
|
2376
2377
|
children: [
|
|
2377
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ r(Co, { className: "h-3.5 w-3.5" }),
|
|
2378
2379
|
"Active addendums"
|
|
2379
2380
|
]
|
|
2380
2381
|
}
|
|
2381
2382
|
),
|
|
2382
|
-
qe && /* @__PURE__ */
|
|
2383
|
+
qe && /* @__PURE__ */ r(
|
|
2383
2384
|
ii,
|
|
2384
2385
|
{
|
|
2385
2386
|
label: T("integrations", "Integrations"),
|
|
@@ -2390,8 +2391,8 @@ function Od({
|
|
|
2390
2391
|
})
|
|
2391
2392
|
}
|
|
2392
2393
|
),
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2394
|
+
/* @__PURE__ */ r(yi, { className: "h-8" }),
|
|
2395
|
+
/* @__PURE__ */ r(ni, {}),
|
|
2395
2396
|
mn > 0 && /* @__PURE__ */ d(
|
|
2396
2397
|
"button",
|
|
2397
2398
|
{
|
|
@@ -2399,7 +2400,7 @@ function Od({
|
|
|
2399
2400
|
onClick: kl,
|
|
2400
2401
|
className: "nvr-pop-in flex h-8 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-2.5 text-[12px] font-medium transition-colors text-nvr-navy hover:bg-nvr-cyan/20 dark:text-nvr-cyan",
|
|
2401
2402
|
children: [
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
+
/* @__PURE__ */ r($o, { className: "h-3 w-3" }),
|
|
2403
2404
|
mn,
|
|
2404
2405
|
" update",
|
|
2405
2406
|
mn === 1 ? "" : "s",
|
|
@@ -2408,8 +2409,8 @@ function Od({
|
|
|
2408
2409
|
}
|
|
2409
2410
|
),
|
|
2410
2411
|
/* @__PURE__ */ d("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
|
|
2411
|
-
|
|
2412
|
-
/* @__PURE__ */
|
|
2412
|
+
$ === "table" && /* @__PURE__ */ d(mt, { children: [
|
|
2413
|
+
/* @__PURE__ */ r(pt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2413
2414
|
"button",
|
|
2414
2415
|
{
|
|
2415
2416
|
type: "button",
|
|
@@ -2418,21 +2419,21 @@ function Od({
|
|
|
2418
2419
|
R ? "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"
|
|
2419
2420
|
),
|
|
2420
2421
|
children: [
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
+
/* @__PURE__ */ r(Fa, { className: "h-3.5 w-3.5" }),
|
|
2422
2423
|
R ? `Group: ${((ya = ua.find((e) => e.value === R)) == null ? void 0 : ya.label) ?? R}` : "Group"
|
|
2423
2424
|
]
|
|
2424
2425
|
}
|
|
2425
2426
|
) }),
|
|
2426
|
-
/* @__PURE__ */
|
|
2427
|
-
/* @__PURE__ */
|
|
2427
|
+
/* @__PURE__ */ r(bt, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Ma, { children: [
|
|
2428
|
+
/* @__PURE__ */ r(Si, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
|
|
2428
2429
|
/* @__PURE__ */ d(Ba, { children: [
|
|
2429
|
-
/* @__PURE__ */
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
ua.map((e) => /* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ r(Ci, { children: "No attribute found." }),
|
|
2431
|
+
/* @__PURE__ */ r(Ot, { value: "__none__", onSelect: () => ft(null), children: "None" }),
|
|
2432
|
+
ua.map((e) => /* @__PURE__ */ r(
|
|
2432
2433
|
Ot,
|
|
2433
2434
|
{
|
|
2434
2435
|
value: e.label,
|
|
2435
|
-
onSelect: () =>
|
|
2436
|
+
onSelect: () => ft(e.value),
|
|
2436
2437
|
children: e.label
|
|
2437
2438
|
},
|
|
2438
2439
|
e.value
|
|
@@ -2440,53 +2441,53 @@ function Od({
|
|
|
2440
2441
|
] })
|
|
2441
2442
|
] }) })
|
|
2442
2443
|
] }),
|
|
2443
|
-
|
|
2444
|
+
$ === "table" && /* @__PURE__ */ d(
|
|
2444
2445
|
"button",
|
|
2445
2446
|
{
|
|
2446
2447
|
type: "button",
|
|
2447
2448
|
onClick: () => {
|
|
2448
|
-
|
|
2449
|
+
He(B === "-priority" ? "" : "-priority"), D(1);
|
|
2449
2450
|
},
|
|
2450
2451
|
className: L(
|
|
2451
2452
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2452
2453
|
B === "-priority" ? "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"
|
|
2453
2454
|
),
|
|
2454
2455
|
children: [
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
+
/* @__PURE__ */ r(qo, { className: "h-3.5 w-3.5" }),
|
|
2456
2457
|
"Priority"
|
|
2457
2458
|
]
|
|
2458
2459
|
}
|
|
2459
2460
|
),
|
|
2460
|
-
|
|
2461
|
+
$ === "table" && R && ie && /* @__PURE__ */ r(
|
|
2461
2462
|
"button",
|
|
2462
2463
|
{
|
|
2463
2464
|
type: "button",
|
|
2464
2465
|
onClick: () => cn(
|
|
2465
|
-
Ce.size > 0 ? /* @__PURE__ */ new Set() : new Set(
|
|
2466
|
+
Ce.size > 0 ? /* @__PURE__ */ new Set() : new Set(ie.map((e) => e.key))
|
|
2466
2467
|
),
|
|
2467
2468
|
className: "flex h-8 items-center rounded-md px-2 text-[12px] text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
|
|
2468
2469
|
children: Ce.size > 0 ? "Expand all" : "Collapse all"
|
|
2469
2470
|
}
|
|
2470
2471
|
),
|
|
2471
|
-
|
|
2472
|
-
/* @__PURE__ */
|
|
2472
|
+
$ === "kanban" && /* @__PURE__ */ d(mt, { children: [
|
|
2473
|
+
/* @__PURE__ */ r(pt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2473
2474
|
"button",
|
|
2474
2475
|
{
|
|
2475
2476
|
type: "button",
|
|
2476
2477
|
className: L(
|
|
2477
2478
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2478
|
-
|
|
2479
|
+
ht ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2479
2480
|
),
|
|
2480
2481
|
children: [
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
|
|
2482
|
+
/* @__PURE__ */ r(Fa, { className: "h-3.5 w-3.5" }),
|
|
2483
|
+
ht ? `Lanes: ${ht === "collection" ? "Collection" : "Owner"}` : "Lanes"
|
|
2483
2484
|
]
|
|
2484
2485
|
}
|
|
2485
2486
|
) }),
|
|
2486
|
-
/* @__PURE__ */
|
|
2487
|
-
/* @__PURE__ */
|
|
2488
|
-
/* @__PURE__ */
|
|
2489
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ r(bt, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(Ma, { children: /* @__PURE__ */ d(Ba, { children: [
|
|
2488
|
+
/* @__PURE__ */ r(Ot, { value: "none", onSelect: () => dn(null), children: "None" }),
|
|
2489
|
+
/* @__PURE__ */ r(Ot, { value: "collection", onSelect: () => dn("collection"), children: "Collection" }),
|
|
2490
|
+
/* @__PURE__ */ r(Ot, { value: "owner", onSelect: () => dn("owners"), children: "Owner" })
|
|
2490
2491
|
] }) }) })
|
|
2491
2492
|
] }),
|
|
2492
2493
|
Z && c && /* @__PURE__ */ d(
|
|
@@ -2498,13 +2499,13 @@ function Od({
|
|
|
2498
2499
|
className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
|
|
2499
2500
|
"data-queue-ask": !0,
|
|
2500
2501
|
children: [
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ r(Ro, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
|
|
2502
2503
|
"Ask about this queue"
|
|
2503
2504
|
]
|
|
2504
2505
|
}
|
|
2505
2506
|
),
|
|
2506
|
-
/* @__PURE__ */
|
|
2507
|
-
|
|
2507
|
+
/* @__PURE__ */ r(pi, { listKey: `queue:${l}`, getState: Gr }),
|
|
2508
|
+
$ === "table" && /* @__PURE__ */ d(
|
|
2508
2509
|
"button",
|
|
2509
2510
|
{
|
|
2510
2511
|
type: "button",
|
|
@@ -2515,7 +2516,7 @@ function Od({
|
|
|
2515
2516
|
className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
|
|
2516
2517
|
"data-queue-export": !0,
|
|
2517
2518
|
children: [
|
|
2518
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ r(Fo, { className: "h-3.5 w-3.5" }),
|
|
2519
2520
|
Wn ? "Exporting…" : "Export"
|
|
2520
2521
|
]
|
|
2521
2522
|
}
|
|
@@ -2525,41 +2526,41 @@ function Od({
|
|
|
2525
2526
|
{
|
|
2526
2527
|
type: "button",
|
|
2527
2528
|
onClick: () => tl((e) => !e),
|
|
2528
|
-
"aria-expanded":
|
|
2529
|
+
"aria-expanded": gt,
|
|
2529
2530
|
title: "Trends, aging, pace and states",
|
|
2530
2531
|
className: L(
|
|
2531
2532
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2532
|
-
|
|
2533
|
+
gt ? "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"
|
|
2533
2534
|
),
|
|
2534
2535
|
"data-queue-insights-toggle": !0,
|
|
2535
2536
|
children: [
|
|
2536
|
-
/* @__PURE__ */
|
|
2537
|
+
/* @__PURE__ */ r(Lo, { className: "h-3.5 w-3.5" }),
|
|
2537
2538
|
"Insights"
|
|
2538
2539
|
]
|
|
2539
2540
|
}
|
|
2540
2541
|
),
|
|
2541
|
-
|
|
2542
|
-
/* @__PURE__ */
|
|
2542
|
+
$ === "table" && /* @__PURE__ */ d(mt, { children: [
|
|
2543
|
+
/* @__PURE__ */ r(pt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2543
2544
|
"button",
|
|
2544
2545
|
{
|
|
2545
2546
|
type: "button",
|
|
2546
2547
|
className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
|
|
2547
2548
|
children: [
|
|
2548
|
-
/* @__PURE__ */
|
|
2549
|
+
/* @__PURE__ */ r(To, { className: "h-3.5 w-3.5" }),
|
|
2549
2550
|
"Columns"
|
|
2550
2551
|
]
|
|
2551
2552
|
}
|
|
2552
2553
|
) }),
|
|
2553
|
-
/* @__PURE__ */
|
|
2554
|
+
/* @__PURE__ */ r(bt, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ r(
|
|
2554
2555
|
go,
|
|
2555
2556
|
{
|
|
2556
2557
|
sensors: no,
|
|
2557
2558
|
collisionDetection: xo,
|
|
2558
2559
|
onDragEnd: ro,
|
|
2559
|
-
children: /* @__PURE__ */
|
|
2560
|
+
children: /* @__PURE__ */ r(yo, { items: ia, strategy: ko, children: /* @__PURE__ */ r("div", { className: "space-y-1.5", children: ia.map((e) => {
|
|
2560
2561
|
const t = Gn.find((n) => n.key === e);
|
|
2561
|
-
return /* @__PURE__ */
|
|
2562
|
-
|
|
2562
|
+
return /* @__PURE__ */ r(
|
|
2563
|
+
tc,
|
|
2563
2564
|
{
|
|
2564
2565
|
id: e,
|
|
2565
2566
|
label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
|
|
@@ -2572,27 +2573,27 @@ function Od({
|
|
|
2572
2573
|
}
|
|
2573
2574
|
) })
|
|
2574
2575
|
] }),
|
|
2575
|
-
|
|
2576
|
+
$ === "table" && It && /* @__PURE__ */ d(
|
|
2576
2577
|
"button",
|
|
2577
2578
|
{
|
|
2578
2579
|
type: "button",
|
|
2579
|
-
onClick:
|
|
2580
|
+
onClick: Pl,
|
|
2580
2581
|
"aria-pressed": ne,
|
|
2581
2582
|
"data-queue-bulk-mode": ne ? "on" : "off",
|
|
2582
2583
|
"data-tip": ne ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
|
|
2583
2584
|
className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${ne ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted"}`,
|
|
2584
2585
|
children: [
|
|
2585
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ r(Eo, { className: "h-3.5 w-3.5" }),
|
|
2586
2587
|
ne ? "Done" : "Bulk select"
|
|
2587
2588
|
]
|
|
2588
2589
|
}
|
|
2589
2590
|
),
|
|
2590
|
-
|
|
2591
|
+
$ === "table" && /* @__PURE__ */ r(
|
|
2591
2592
|
"button",
|
|
2592
2593
|
{
|
|
2593
2594
|
type: "button",
|
|
2594
2595
|
onClick: () => {
|
|
2595
|
-
const e =
|
|
2596
|
+
const e = Pt === "compact" ? "comfortable" : "compact";
|
|
2596
2597
|
Ua(e);
|
|
2597
2598
|
try {
|
|
2598
2599
|
localStorage.setItem("nvr_table_density", e);
|
|
@@ -2600,38 +2601,38 @@ function Od({
|
|
|
2600
2601
|
}
|
|
2601
2602
|
},
|
|
2602
2603
|
"aria-label": "Row density",
|
|
2603
|
-
title:
|
|
2604
|
+
title: Pt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
|
|
2604
2605
|
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",
|
|
2605
|
-
children:
|
|
2606
|
+
children: Pt === "compact" ? /* @__PURE__ */ r(Ao, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(Oo, { className: "h-3.5 w-3.5" })
|
|
2606
2607
|
}
|
|
2607
2608
|
),
|
|
2608
|
-
|
|
2609
|
+
$ === "table" && Ha && me.length > 0 && /* @__PURE__ */ d(
|
|
2609
2610
|
"button",
|
|
2610
2611
|
{
|
|
2611
2612
|
type: "button",
|
|
2612
2613
|
onClick: () => Qr(),
|
|
2613
2614
|
className: "flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-110",
|
|
2614
2615
|
children: [
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
+
/* @__PURE__ */ r(Ko, { className: "h-3 w-3 fill-current" }),
|
|
2616
2617
|
"Work Next"
|
|
2617
2618
|
]
|
|
2618
2619
|
}
|
|
2619
2620
|
),
|
|
2620
|
-
!kn && le.length === 1 && (Vt ? /* @__PURE__ */ d(
|
|
2621
|
-
/* @__PURE__ */
|
|
2621
|
+
!kn && le.length === 1 && (Vt ? /* @__PURE__ */ d(mt, { children: [
|
|
2622
|
+
/* @__PURE__ */ r(pt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2622
2623
|
"button",
|
|
2623
2624
|
{
|
|
2624
2625
|
type: "button",
|
|
2625
2626
|
className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
2626
2627
|
children: [
|
|
2627
|
-
/* @__PURE__ */
|
|
2628
|
+
/* @__PURE__ */ r(on, { className: "h-3.5 w-3.5" }),
|
|
2628
2629
|
"New ",
|
|
2629
2630
|
Xn(le[0]),
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
+
/* @__PURE__ */ r(La, { className: "h-3 w-3 opacity-60" })
|
|
2631
2632
|
]
|
|
2632
2633
|
}
|
|
2633
2634
|
) }),
|
|
2634
|
-
/* @__PURE__ */ d(
|
|
2635
|
+
/* @__PURE__ */ d(bt, { align: "end", className: "w-60 p-1", children: [
|
|
2635
2636
|
/* @__PURE__ */ d(
|
|
2636
2637
|
"button",
|
|
2637
2638
|
{
|
|
@@ -2645,11 +2646,11 @@ function Od({
|
|
|
2645
2646
|
className: "flex w-full items-center rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
|
|
2646
2647
|
children: [
|
|
2647
2648
|
((ka = Vt.active) == null ? void 0 : ka.create_label) ?? ((va = Vt.active) == null ? void 0 : va.name) ?? "Default layout",
|
|
2648
|
-
/* @__PURE__ */
|
|
2649
|
+
/* @__PURE__ */ r("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
|
|
2649
2650
|
]
|
|
2650
2651
|
}
|
|
2651
2652
|
),
|
|
2652
|
-
Vt.options.map((e) => /* @__PURE__ */
|
|
2653
|
+
Vt.options.map((e) => /* @__PURE__ */ r(
|
|
2653
2654
|
"button",
|
|
2654
2655
|
{
|
|
2655
2656
|
type: "button",
|
|
@@ -2677,26 +2678,26 @@ function Od({
|
|
|
2677
2678
|
}),
|
|
2678
2679
|
className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
2679
2680
|
children: [
|
|
2680
|
-
/* @__PURE__ */
|
|
2681
|
+
/* @__PURE__ */ r(on, { className: "h-3.5 w-3.5" }),
|
|
2681
2682
|
"New ",
|
|
2682
2683
|
Xn(le[0])
|
|
2683
2684
|
]
|
|
2684
2685
|
}
|
|
2685
2686
|
)),
|
|
2686
|
-
!kn && le.length > 1 && /* @__PURE__ */ d(
|
|
2687
|
-
/* @__PURE__ */
|
|
2687
|
+
!kn && le.length > 1 && /* @__PURE__ */ d(mt, { children: [
|
|
2688
|
+
/* @__PURE__ */ r(pt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2688
2689
|
"button",
|
|
2689
2690
|
{
|
|
2690
2691
|
type: "button",
|
|
2691
2692
|
className: "flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
2692
2693
|
children: [
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
+
/* @__PURE__ */ r(on, { className: "h-3.5 w-3.5" }),
|
|
2694
2695
|
"New",
|
|
2695
|
-
/* @__PURE__ */
|
|
2696
|
+
/* @__PURE__ */ r(La, { className: "h-3 w-3 opacity-60" })
|
|
2696
2697
|
]
|
|
2697
2698
|
}
|
|
2698
2699
|
) }),
|
|
2699
|
-
/* @__PURE__ */
|
|
2700
|
+
/* @__PURE__ */ r(bt, { align: "end", className: "w-56 p-1", children: le.map((e) => /* @__PURE__ */ d(
|
|
2700
2701
|
"button",
|
|
2701
2702
|
{
|
|
2702
2703
|
type: "button",
|
|
@@ -2707,18 +2708,18 @@ function Od({
|
|
|
2707
2708
|
}),
|
|
2708
2709
|
className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
|
|
2709
2710
|
children: [
|
|
2710
|
-
/* @__PURE__ */
|
|
2711
|
+
/* @__PURE__ */ r(on, { className: "h-3 w-3 opacity-60" }),
|
|
2711
2712
|
Xn(e)
|
|
2712
2713
|
]
|
|
2713
2714
|
},
|
|
2714
2715
|
e
|
|
2715
2716
|
)) })
|
|
2716
2717
|
] }),
|
|
2717
|
-
!kn &&
|
|
2718
|
+
!kn && Ye && de && /* @__PURE__ */ r(
|
|
2718
2719
|
li,
|
|
2719
2720
|
{
|
|
2720
|
-
collection:
|
|
2721
|
-
onParsed: (e, t) => de(`/collections/${
|
|
2721
|
+
collection: Ye,
|
|
2722
|
+
onParsed: (e, t) => de(`/collections/${Ye}/new`, {
|
|
2722
2723
|
state: { importResult: e, importTemplateId: t.id }
|
|
2723
2724
|
})
|
|
2724
2725
|
}
|
|
@@ -2727,57 +2728,57 @@ function Od({
|
|
|
2727
2728
|
]
|
|
2728
2729
|
}
|
|
2729
2730
|
),
|
|
2730
|
-
|
|
2731
|
+
gt && /* @__PURE__ */ d(
|
|
2731
2732
|
"div",
|
|
2732
2733
|
{
|
|
2733
2734
|
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",
|
|
2734
2735
|
"data-queue-insights": !0,
|
|
2735
2736
|
children: [
|
|
2736
2737
|
/* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex max-w-full flex-wrap gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
|
|
2737
|
-
/* @__PURE__ */
|
|
2738
|
-
|
|
2738
|
+
/* @__PURE__ */ r(
|
|
2739
|
+
Dt,
|
|
2739
2740
|
{
|
|
2740
2741
|
label: "Total",
|
|
2741
2742
|
count: (x == null ? void 0 : x.total) ?? 0,
|
|
2742
2743
|
filteredCount: I ? I.total : null,
|
|
2743
2744
|
active: Object.values(_).every(Za) && g === "all",
|
|
2744
|
-
isLoading:
|
|
2745
|
-
...
|
|
2745
|
+
isLoading: Ze,
|
|
2746
|
+
...Nt("total"),
|
|
2746
2747
|
onClick: el
|
|
2747
2748
|
}
|
|
2748
2749
|
),
|
|
2749
2750
|
co && /* @__PURE__ */ d(Se, { children: [
|
|
2750
|
-
/* @__PURE__ */
|
|
2751
|
-
|
|
2751
|
+
/* @__PURE__ */ r(
|
|
2752
|
+
Dt,
|
|
2752
2753
|
{
|
|
2753
2754
|
label: "Warning",
|
|
2754
2755
|
count: (x == null ? void 0 : x.sla_warning) ?? 0,
|
|
2755
2756
|
filteredCount: I ? I.sla_warning : null,
|
|
2756
2757
|
tone: "amber",
|
|
2757
2758
|
active: _.sla_status === "warning",
|
|
2758
|
-
isLoading:
|
|
2759
|
+
isLoading: Ze,
|
|
2759
2760
|
deltaBadIsUp: !0,
|
|
2760
|
-
...
|
|
2761
|
-
onClick: () =>
|
|
2761
|
+
...Nt("sla_warning"),
|
|
2762
|
+
onClick: () => ze("sla_status", "warning")
|
|
2762
2763
|
}
|
|
2763
2764
|
),
|
|
2764
|
-
/* @__PURE__ */
|
|
2765
|
-
|
|
2765
|
+
/* @__PURE__ */ r(
|
|
2766
|
+
Dt,
|
|
2766
2767
|
{
|
|
2767
2768
|
label: "Breached",
|
|
2768
2769
|
count: (x == null ? void 0 : x.sla_breached) ?? 0,
|
|
2769
2770
|
filteredCount: I ? I.sla_breached : null,
|
|
2770
2771
|
tone: "red",
|
|
2771
2772
|
active: _.sla_status === "breached",
|
|
2772
|
-
isLoading:
|
|
2773
|
+
isLoading: Ze,
|
|
2773
2774
|
deltaBadIsUp: !0,
|
|
2774
|
-
...
|
|
2775
|
-
onClick: () =>
|
|
2775
|
+
...Nt("sla_breached"),
|
|
2776
|
+
onClick: () => ze("sla_status", "breached")
|
|
2776
2777
|
}
|
|
2777
2778
|
)
|
|
2778
2779
|
] }),
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
|
|
2780
|
+
/* @__PURE__ */ r(
|
|
2781
|
+
Dt,
|
|
2781
2782
|
{
|
|
2782
2783
|
label: "At Risk",
|
|
2783
2784
|
breakdown: I ? Qa(I.at_risk_by_rule) : Qa(x == null ? void 0 : x.at_risk_by_rule),
|
|
@@ -2785,42 +2786,42 @@ function Od({
|
|
|
2785
2786
|
filteredCount: I ? I.at_risk : null,
|
|
2786
2787
|
tone: "red",
|
|
2787
2788
|
active: _.at_risk === "yes",
|
|
2788
|
-
isLoading:
|
|
2789
|
+
isLoading: Ze,
|
|
2789
2790
|
deltaBadIsUp: !0,
|
|
2790
|
-
...
|
|
2791
|
-
onClick: () =>
|
|
2791
|
+
...Nt("at_risk"),
|
|
2792
|
+
onClick: () => ze("at_risk", "yes")
|
|
2792
2793
|
}
|
|
2793
2794
|
),
|
|
2794
|
-
/* @__PURE__ */
|
|
2795
|
-
|
|
2795
|
+
/* @__PURE__ */ r(
|
|
2796
|
+
Dt,
|
|
2796
2797
|
{
|
|
2797
2798
|
label: "Unowned",
|
|
2798
2799
|
count: (x == null ? void 0 : x.unowned) ?? 0,
|
|
2799
2800
|
filteredCount: I ? I.unowned : null,
|
|
2800
2801
|
active: g === "unowned",
|
|
2801
|
-
isLoading:
|
|
2802
|
+
isLoading: Ze,
|
|
2802
2803
|
deltaBadIsUp: !0,
|
|
2803
|
-
...
|
|
2804
|
+
...Nt("unowned"),
|
|
2804
2805
|
onClick: () => {
|
|
2805
|
-
te(g === "unowned" ? "all" : "unowned"),
|
|
2806
|
+
te(g === "unowned" ? "all" : "unowned"), D(1);
|
|
2806
2807
|
}
|
|
2807
2808
|
}
|
|
2808
2809
|
)
|
|
2809
2810
|
] }),
|
|
2810
|
-
|
|
2811
|
-
["0-1d", "0:24",
|
|
2812
|
-
["1-3d", "24:72",
|
|
2813
|
-
["3-7d", "72:168",
|
|
2814
|
-
["7d+", "168:",
|
|
2811
|
+
wt && x && x.total > 0 && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
|
|
2812
|
+
["0-1d", "0:24", wt.d1],
|
|
2813
|
+
["1-3d", "24:72", wt.d3],
|
|
2814
|
+
["3-7d", "72:168", wt.d7],
|
|
2815
|
+
["7d+", "168:", wt.over]
|
|
2815
2816
|
].map(([e, t, n]) => /* @__PURE__ */ d(
|
|
2816
2817
|
"button",
|
|
2817
2818
|
{
|
|
2818
2819
|
type: "button",
|
|
2819
2820
|
onClick: () => {
|
|
2820
|
-
j((
|
|
2821
|
-
...
|
|
2822
|
-
aging_hours:
|
|
2823
|
-
})),
|
|
2821
|
+
j((a) => ({
|
|
2822
|
+
...a,
|
|
2823
|
+
aging_hours: a.aging_hours === t ? "" : t
|
|
2824
|
+
})), D(1);
|
|
2824
2825
|
},
|
|
2825
2826
|
className: L(
|
|
2826
2827
|
"rounded-md border px-2 py-1 tabular-nums transition-colors",
|
|
@@ -2835,7 +2836,7 @@ function Od({
|
|
|
2835
2836
|
},
|
|
2836
2837
|
e
|
|
2837
2838
|
)) }),
|
|
2838
|
-
_e && /* @__PURE__ */
|
|
2839
|
+
_e && /* @__PURE__ */ r(
|
|
2839
2840
|
"span",
|
|
2840
2841
|
{
|
|
2841
2842
|
"data-queue-burndown": !0,
|
|
@@ -2853,13 +2854,13 @@ function Od({
|
|
|
2853
2854
|
"▲ Growing ",
|
|
2854
2855
|
_e.pace.toFixed(1),
|
|
2855
2856
|
"/day"
|
|
2856
|
-
] }) : /* @__PURE__ */
|
|
2857
|
+
] }) : /* @__PURE__ */ r(Se, { children: "→ Holding steady" })
|
|
2857
2858
|
}
|
|
2858
2859
|
),
|
|
2859
|
-
|
|
2860
|
+
Pr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Pr.map(([e, t]) => {
|
|
2860
2861
|
var n;
|
|
2861
|
-
return /* @__PURE__ */
|
|
2862
|
-
|
|
2862
|
+
return /* @__PURE__ */ r(
|
|
2863
|
+
ec,
|
|
2863
2864
|
{
|
|
2864
2865
|
label: Fe(e),
|
|
2865
2866
|
count: t,
|
|
@@ -2874,17 +2875,17 @@ function Od({
|
|
|
2874
2875
|
]
|
|
2875
2876
|
}
|
|
2876
2877
|
),
|
|
2877
|
-
|
|
2878
|
-
|
|
2878
|
+
$ !== "workload" && /* @__PURE__ */ r(
|
|
2879
|
+
Bi,
|
|
2879
2880
|
{
|
|
2880
2881
|
defs: io,
|
|
2881
2882
|
values: _,
|
|
2882
2883
|
seededKeys: Et,
|
|
2883
2884
|
onApply: (e) => {
|
|
2884
|
-
j((t) => ({ ...t, ...e })),
|
|
2885
|
+
j((t) => ({ ...t, ...e })), D(1);
|
|
2885
2886
|
},
|
|
2886
2887
|
onClear: () => {
|
|
2887
|
-
j({ ...he.current }),
|
|
2888
|
+
j({ ...he.current }), D(1);
|
|
2888
2889
|
},
|
|
2889
2890
|
right: uo
|
|
2890
2891
|
}
|
|
@@ -2909,7 +2910,7 @@ function Od({
|
|
|
2909
2910
|
" item",
|
|
2910
2911
|
ye === 1 ? "" : "s",
|
|
2911
2912
|
" ·",
|
|
2912
|
-
/* @__PURE__ */
|
|
2913
|
+
/* @__PURE__ */ r(
|
|
2913
2914
|
"button",
|
|
2914
2915
|
{
|
|
2915
2916
|
type: "button",
|
|
@@ -2933,11 +2934,11 @@ function Od({
|
|
|
2933
2934
|
(e) => {
|
|
2934
2935
|
var t, n;
|
|
2935
2936
|
return ((n = (t = i == null ? void 0 : i.available_values.owners) == null ? void 0 : t.find(
|
|
2936
|
-
(
|
|
2937
|
+
(a) => String(a.id).toUpperCase() === String(e).toUpperCase()
|
|
2937
2938
|
)) == null ? void 0 : n.name) ?? "someone";
|
|
2938
2939
|
}
|
|
2939
2940
|
).join(", "),
|
|
2940
|
-
/* @__PURE__ */
|
|
2941
|
+
/* @__PURE__ */ r(
|
|
2941
2942
|
"button",
|
|
2942
2943
|
{
|
|
2943
2944
|
type: "button",
|
|
@@ -2947,7 +2948,7 @@ function Od({
|
|
|
2947
2948
|
j((e) => {
|
|
2948
2949
|
const { owners: t, ...n } = e;
|
|
2949
2950
|
return n;
|
|
2950
|
-
}),
|
|
2951
|
+
}), D(1);
|
|
2951
2952
|
},
|
|
2952
2953
|
className: "flex h-4 w-4 items-center justify-center rounded-full text-[10px] hover:bg-black/10 dark:hover:bg-white/10",
|
|
2953
2954
|
children: "✕"
|
|
@@ -2956,7 +2957,7 @@ function Od({
|
|
|
2956
2957
|
]
|
|
2957
2958
|
}
|
|
2958
2959
|
),
|
|
2959
|
-
!((G == null ? void 0 : G.data) ?? []).some((e) => e.is_default) && /* @__PURE__ */
|
|
2960
|
+
!((G == null ? void 0 : G.data) ?? []).some((e) => e.is_default) && /* @__PURE__ */ r(
|
|
2960
2961
|
"button",
|
|
2961
2962
|
{
|
|
2962
2963
|
type: "button",
|
|
@@ -2964,7 +2965,7 @@ function Od({
|
|
|
2964
2965
|
title: "Revert to the queue default (filters, columns and sort cleared)",
|
|
2965
2966
|
className: L(
|
|
2966
2967
|
"inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
|
|
2967
|
-
|
|
2968
|
+
st == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
|
|
2968
2969
|
),
|
|
2969
2970
|
children: "Default"
|
|
2970
2971
|
}
|
|
@@ -2976,33 +2977,33 @@ function Od({
|
|
|
2976
2977
|
{
|
|
2977
2978
|
className: L(
|
|
2978
2979
|
"group inline-flex h-6 items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors",
|
|
2979
|
-
|
|
2980
|
+
st === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
|
|
2980
2981
|
),
|
|
2981
2982
|
children: [
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
+
/* @__PURE__ */ r(
|
|
2983
2984
|
"button",
|
|
2984
2985
|
{
|
|
2985
2986
|
type: "button",
|
|
2986
|
-
title:
|
|
2987
|
-
onClick: () =>
|
|
2987
|
+
title: nt === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
|
|
2988
|
+
onClick: () => Dl.mutate(nt === e.id ? null : e.id),
|
|
2988
2989
|
className: L(
|
|
2989
2990
|
"shrink-0",
|
|
2990
|
-
|
|
2991
|
+
nt === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
|
|
2991
2992
|
),
|
|
2992
|
-
children: /* @__PURE__ */
|
|
2993
|
-
|
|
2993
|
+
children: /* @__PURE__ */ r(
|
|
2994
|
+
Do,
|
|
2994
2995
|
{
|
|
2995
|
-
className: L("h-3 w-3",
|
|
2996
|
-
"aria-label":
|
|
2996
|
+
className: L("h-3 w-3", nt === e.id && "fill-current"),
|
|
2997
|
+
"aria-label": nt === e.id ? "Default view" : "Set as default"
|
|
2997
2998
|
}
|
|
2998
2999
|
)
|
|
2999
3000
|
}
|
|
3000
3001
|
),
|
|
3001
|
-
/* @__PURE__ */ d("button", { type: "button", onClick: () =>
|
|
3002
|
+
/* @__PURE__ */ d("button", { type: "button", onClick: () => Rt(e), children: [
|
|
3002
3003
|
e.name,
|
|
3003
|
-
e.is_default ? /* @__PURE__ */
|
|
3004
|
+
e.is_default ? /* @__PURE__ */ r("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ r("span", { className: "ml-1 text-slate-400", children: "· shared" })
|
|
3004
3005
|
] }),
|
|
3005
|
-
tn && /* @__PURE__ */
|
|
3006
|
+
tn && /* @__PURE__ */ r(
|
|
3006
3007
|
"button",
|
|
3007
3008
|
{
|
|
3008
3009
|
type: "button",
|
|
@@ -3013,29 +3014,29 @@ function Od({
|
|
|
3013
3014
|
e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
3014
3015
|
),
|
|
3015
3016
|
"aria-label": e.is_default ? "Unset queue default" : "Set queue default",
|
|
3016
|
-
children: /* @__PURE__ */
|
|
3017
|
+
children: /* @__PURE__ */ r(Po, { className: L("h-3 w-3", e.is_default && "fill-current") })
|
|
3017
3018
|
}
|
|
3018
3019
|
),
|
|
3019
|
-
(e.user === S ||
|
|
3020
|
+
(e.user === S || Be) && st === e.id && /* @__PURE__ */ r(
|
|
3020
3021
|
"button",
|
|
3021
3022
|
{
|
|
3022
3023
|
type: "button",
|
|
3023
|
-
onClick: () =>
|
|
3024
|
-
disabled:
|
|
3024
|
+
onClick: () => Qe.mutate(e),
|
|
3025
|
+
disabled: Qe.isPending,
|
|
3025
3026
|
title: "Update this view with the current filters, scope and sort",
|
|
3026
3027
|
className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
|
|
3027
3028
|
"aria-label": `Update view ${e.name}`,
|
|
3028
|
-
"data-view-update-state":
|
|
3029
|
-
children:
|
|
3029
|
+
"data-view-update-state": Qe.isPending ? "saving" : Hr === e.id ? "saved" : "idle",
|
|
3030
|
+
children: Qe.isPending && ((t = Qe.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(Mo, { className: "h-3 w-3 animate-spin" }) : Hr === e.id ? /* @__PURE__ */ r(
|
|
3030
3031
|
Bo,
|
|
3031
3032
|
{
|
|
3032
3033
|
className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
|
|
3033
3034
|
strokeWidth: 3
|
|
3034
3035
|
}
|
|
3035
|
-
) : /* @__PURE__ */
|
|
3036
|
+
) : /* @__PURE__ */ r(Qo, { className: "h-3 w-3" })
|
|
3036
3037
|
}
|
|
3037
3038
|
),
|
|
3038
|
-
|
|
3039
|
+
st === e.id && /* @__PURE__ */ r(
|
|
3039
3040
|
"button",
|
|
3040
3041
|
{
|
|
3041
3042
|
type: "button",
|
|
@@ -3046,7 +3047,7 @@ function Od({
|
|
|
3046
3047
|
Gt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
3047
3048
|
),
|
|
3048
3049
|
"aria-label": `Subscribe to view ${e.name}`,
|
|
3049
|
-
children: /* @__PURE__ */
|
|
3050
|
+
children: /* @__PURE__ */ r(jo, { className: L("h-3 w-3", Gt(e.id) && "fill-current") })
|
|
3050
3051
|
}
|
|
3051
3052
|
),
|
|
3052
3053
|
e.user === S && (Mn === e.id ? /* @__PURE__ */ d(
|
|
@@ -3055,8 +3056,8 @@ function Od({
|
|
|
3055
3056
|
className: "flex shrink-0 items-center gap-1",
|
|
3056
3057
|
"data-view-delete-confirm": e.id,
|
|
3057
3058
|
children: [
|
|
3058
|
-
/* @__PURE__ */
|
|
3059
|
-
/* @__PURE__ */
|
|
3059
|
+
/* @__PURE__ */ r("span", { className: "text-red-600 dark:text-red-400", children: "Delete?" }),
|
|
3060
|
+
/* @__PURE__ */ r(
|
|
3060
3061
|
"button",
|
|
3061
3062
|
{
|
|
3062
3063
|
type: "button",
|
|
@@ -3067,7 +3068,7 @@ function Od({
|
|
|
3067
3068
|
children: "Yes"
|
|
3068
3069
|
}
|
|
3069
3070
|
),
|
|
3070
|
-
/* @__PURE__ */
|
|
3071
|
+
/* @__PURE__ */ r(
|
|
3071
3072
|
"button",
|
|
3072
3073
|
{
|
|
3073
3074
|
type: "button",
|
|
@@ -3079,7 +3080,7 @@ function Od({
|
|
|
3079
3080
|
)
|
|
3080
3081
|
]
|
|
3081
3082
|
}
|
|
3082
|
-
) : /* @__PURE__ */
|
|
3083
|
+
) : /* @__PURE__ */ r(
|
|
3083
3084
|
"button",
|
|
3084
3085
|
{
|
|
3085
3086
|
type: "button",
|
|
@@ -3094,8 +3095,8 @@ function Od({
|
|
|
3094
3095
|
e.id
|
|
3095
3096
|
);
|
|
3096
3097
|
}),
|
|
3097
|
-
/* @__PURE__ */ d(
|
|
3098
|
-
/* @__PURE__ */
|
|
3098
|
+
/* @__PURE__ */ d(mt, { open: Ll, onOpenChange: Pn, children: [
|
|
3099
|
+
/* @__PURE__ */ r(pt, { asChild: !0, children: /* @__PURE__ */ r(
|
|
3099
3100
|
"button",
|
|
3100
3101
|
{
|
|
3101
3102
|
type: "button",
|
|
@@ -3104,16 +3105,16 @@ function Od({
|
|
|
3104
3105
|
children: "☆ Save view"
|
|
3105
3106
|
}
|
|
3106
3107
|
) }),
|
|
3107
|
-
/* @__PURE__ */ d(
|
|
3108
|
+
/* @__PURE__ */ d(bt, { className: "w-[240px] p-3", align: "end", children: [
|
|
3108
3109
|
(() => {
|
|
3109
|
-
const e = G == null ? void 0 : G.data.find((t) => t.id ===
|
|
3110
|
-
return !e || e.user !== S && !
|
|
3110
|
+
const e = G == null ? void 0 : G.data.find((t) => t.id === st);
|
|
3111
|
+
return !e || e.user !== S && !Be ? null : /* @__PURE__ */ d(
|
|
3111
3112
|
"button",
|
|
3112
3113
|
{
|
|
3113
3114
|
type: "button",
|
|
3114
|
-
disabled:
|
|
3115
|
+
disabled: Qe.isPending,
|
|
3115
3116
|
onClick: () => {
|
|
3116
|
-
|
|
3117
|
+
Qe.mutate(e), Pn(!1);
|
|
3117
3118
|
},
|
|
3118
3119
|
className: "mb-2 w-full rounded-md border border-nvr-cyan/40 bg-nvr-cyan/5 px-2 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 disabled:opacity-50 dark:text-nvr-cyan",
|
|
3119
3120
|
children: [
|
|
@@ -3124,7 +3125,7 @@ function Od({
|
|
|
3124
3125
|
}
|
|
3125
3126
|
);
|
|
3126
3127
|
})(),
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
+
/* @__PURE__ */ r(
|
|
3128
3129
|
"input",
|
|
3129
3130
|
{
|
|
3130
3131
|
value: Xt,
|
|
@@ -3138,27 +3139,27 @@ function Od({
|
|
|
3138
3139
|
}
|
|
3139
3140
|
),
|
|
3140
3141
|
tn && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
3141
|
-
/* @__PURE__ */
|
|
3142
|
+
/* @__PURE__ */ r(
|
|
3142
3143
|
er,
|
|
3143
3144
|
{
|
|
3144
|
-
checked: Ur ||
|
|
3145
|
-
disabled:
|
|
3145
|
+
checked: Ur || qt,
|
|
3146
|
+
disabled: qt,
|
|
3146
3147
|
onCheckedChange: (e) => Vr(e === !0)
|
|
3147
3148
|
}
|
|
3148
3149
|
),
|
|
3149
3150
|
"Share with everyone"
|
|
3150
3151
|
] }),
|
|
3151
3152
|
tn && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
3152
|
-
/* @__PURE__ */
|
|
3153
|
+
/* @__PURE__ */ r(
|
|
3153
3154
|
er,
|
|
3154
3155
|
{
|
|
3155
|
-
checked:
|
|
3156
|
+
checked: qt,
|
|
3156
3157
|
onCheckedChange: (e) => Ir(e === !0)
|
|
3157
3158
|
}
|
|
3158
3159
|
),
|
|
3159
3160
|
"Set as queue default (everyone starts here)"
|
|
3160
3161
|
] }),
|
|
3161
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ r(
|
|
3162
3163
|
"button",
|
|
3163
3164
|
{
|
|
3164
3165
|
type: "button",
|
|
@@ -3175,8 +3176,8 @@ function Od({
|
|
|
3175
3176
|
)
|
|
3176
3177
|
] }),
|
|
3177
3178
|
/* @__PURE__ */ d("div", { ref: Zt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
|
|
3178
|
-
hr && /* @__PURE__ */
|
|
3179
|
-
Yn && /* @__PURE__ */
|
|
3179
|
+
hr && /* @__PURE__ */ r(ui, { error: il, onRetry: () => void cl(), className: "mb-3" }),
|
|
3180
|
+
Yn && /* @__PURE__ */ r(
|
|
3180
3181
|
"p",
|
|
3181
3182
|
{
|
|
3182
3183
|
"data-filter-sentence": !0,
|
|
@@ -3186,7 +3187,7 @@ function Od({
|
|
|
3186
3187
|
children: Yn
|
|
3187
3188
|
}
|
|
3188
3189
|
),
|
|
3189
|
-
|
|
3190
|
+
$ === "table" ? /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
|
|
3190
3191
|
"div",
|
|
3191
3192
|
{
|
|
3192
3193
|
ref: Ee.rootRef,
|
|
@@ -3202,41 +3203,41 @@ function Od({
|
|
|
3202
3203
|
wr,
|
|
3203
3204
|
"s"
|
|
3204
3205
|
] }),
|
|
3205
|
-
/* @__PURE__ */
|
|
3206
|
+
/* @__PURE__ */ r(
|
|
3206
3207
|
ei,
|
|
3207
3208
|
{
|
|
3208
3209
|
fillHeight: !0,
|
|
3209
3210
|
enterKey: qr.current,
|
|
3210
|
-
density:
|
|
3211
|
+
density: Pt,
|
|
3211
3212
|
minBodyHeight: 360,
|
|
3212
3213
|
columns: Tt,
|
|
3213
|
-
rows:
|
|
3214
|
+
rows: C,
|
|
3214
3215
|
rowKey: (e) => `${e.collection}:${e.item_id}`,
|
|
3215
3216
|
total: (i == null ? void 0 : i.total) ?? 0,
|
|
3216
3217
|
page: ue,
|
|
3217
3218
|
limit: yn,
|
|
3218
|
-
isLoading:
|
|
3219
|
-
onPageChange:
|
|
3220
|
-
onRowClick: (e) =>
|
|
3219
|
+
isLoading: Ze,
|
|
3220
|
+
onPageChange: D,
|
|
3221
|
+
onRowClick: (e) => Dn(e),
|
|
3221
3222
|
onRowFocus: (e) => zt(F(e)),
|
|
3222
|
-
activeRowKey:
|
|
3223
|
+
activeRowKey: Ct,
|
|
3223
3224
|
rowAriaLabel: (e) => e.label || void 0,
|
|
3224
3225
|
rowDragProps: (e) => ({
|
|
3225
3226
|
...yl({ collection: e.collection, id: e.item_id }),
|
|
3226
3227
|
...bl.record(e.collection, e.item_id)
|
|
3227
3228
|
}),
|
|
3228
3229
|
onRowContextMenu: (e, t) => {
|
|
3229
|
-
t.preventDefault(),
|
|
3230
|
+
t.preventDefault(), $t({ x: t.clientX, y: t.clientY, row: e });
|
|
3230
3231
|
},
|
|
3231
3232
|
rowTitle: (e) => {
|
|
3232
|
-
const t =
|
|
3233
|
+
const t = _t.get(F(e));
|
|
3233
3234
|
return Ee.titleFor(F(e)) ?? (t && !t.is_mine ? Ns(t) : void 0) ?? (Wr(e.collection, e.item_id) ? xi : void 0);
|
|
3234
3235
|
},
|
|
3235
3236
|
rowClassName: (e) => L(
|
|
3236
3237
|
Ol(e),
|
|
3237
3238
|
Wr(e.collection, e.item_id) && gi
|
|
3238
3239
|
),
|
|
3239
|
-
emptyMessage: hr ? /* @__PURE__ */
|
|
3240
|
+
emptyMessage: hr ? /* @__PURE__ */ r("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ r(
|
|
3240
3241
|
ti,
|
|
3241
3242
|
{
|
|
3242
3243
|
icon: Uo,
|
|
@@ -3256,28 +3257,28 @@ function Od({
|
|
|
3256
3257
|
]
|
|
3257
3258
|
}
|
|
3258
3259
|
),
|
|
3259
|
-
/* @__PURE__ */
|
|
3260
|
+
/* @__PURE__ */ r(
|
|
3260
3261
|
"button",
|
|
3261
3262
|
{
|
|
3262
3263
|
type: "button",
|
|
3263
3264
|
onClick: () => {
|
|
3264
3265
|
var t;
|
|
3265
3266
|
const e = {};
|
|
3266
|
-
for (const [n,
|
|
3267
|
-
(t = fe[n.slice(6)]) != null && t.length && (e[n] =
|
|
3268
|
-
j(e),
|
|
3267
|
+
for (const [n, a] of Object.entries(he.current))
|
|
3268
|
+
(t = fe[n.slice(6)]) != null && t.length && (e[n] = a);
|
|
3269
|
+
j(e), D(1);
|
|
3269
3270
|
},
|
|
3270
3271
|
className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
3271
3272
|
"data-queue-empty-clear": !0,
|
|
3272
3273
|
children: "Clear filters"
|
|
3273
3274
|
}
|
|
3274
3275
|
),
|
|
3275
|
-
g !== "all" && /* @__PURE__ */
|
|
3276
|
+
g !== "all" && /* @__PURE__ */ r(
|
|
3276
3277
|
"button",
|
|
3277
3278
|
{
|
|
3278
3279
|
type: "button",
|
|
3279
3280
|
onClick: () => {
|
|
3280
|
-
te("all"),
|
|
3281
|
+
te("all"), D(1);
|
|
3281
3282
|
},
|
|
3282
3283
|
className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
3283
3284
|
"data-queue-empty-all": !0,
|
|
@@ -3289,40 +3290,40 @@ function Od({
|
|
|
3289
3290
|
),
|
|
3290
3291
|
sort: B,
|
|
3291
3292
|
onSortChange: (e) => {
|
|
3292
|
-
|
|
3293
|
+
He(e), D(1);
|
|
3293
3294
|
},
|
|
3294
3295
|
filterDefs: Hn,
|
|
3295
3296
|
filterValues: _,
|
|
3296
3297
|
onFilterChange: (e, t) => {
|
|
3297
|
-
j((n) => ({ ...n, [e]: t })),
|
|
3298
|
+
j((n) => ({ ...n, [e]: t })), D(1);
|
|
3298
3299
|
},
|
|
3299
3300
|
rowGroups: Bl ?? void 0,
|
|
3300
3301
|
collapsedGroups: Ce,
|
|
3301
3302
|
onToggleGroup: $l,
|
|
3302
|
-
selectedIds: It && ne ?
|
|
3303
|
-
onSelectionChange: It && ne ?
|
|
3303
|
+
selectedIds: It && ne ? oe : void 0,
|
|
3304
|
+
onSelectionChange: It && ne ? je : void 0,
|
|
3304
3305
|
hideFilterRow: !0,
|
|
3305
3306
|
nowrapCells: !0,
|
|
3306
3307
|
columnPins: da,
|
|
3307
3308
|
onColumnPinChange: (e, t) => {
|
|
3308
3309
|
un((n) => {
|
|
3309
|
-
const
|
|
3310
|
-
return t ?
|
|
3310
|
+
const a = { ...n ?? da };
|
|
3311
|
+
return t ? a[e] = t : delete a[e], a;
|
|
3311
3312
|
});
|
|
3312
3313
|
},
|
|
3313
3314
|
columnFilterRow: !0,
|
|
3314
3315
|
hScrollProxy: !0,
|
|
3315
|
-
footer: /* @__PURE__ */
|
|
3316
|
+
footer: /* @__PURE__ */ r(
|
|
3316
3317
|
vi,
|
|
3317
3318
|
{
|
|
3318
|
-
collections:
|
|
3319
|
+
collections: St,
|
|
3319
3320
|
selectedIds: String(_.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
|
|
3320
3321
|
onToggle: (e) => {
|
|
3321
3322
|
const t = e.ids.join(",");
|
|
3322
3323
|
j((n) => ({
|
|
3323
3324
|
...n,
|
|
3324
3325
|
at_risk_rule: n.at_risk_rule === t ? "" : t
|
|
3325
|
-
})),
|
|
3326
|
+
})), D(1);
|
|
3326
3327
|
},
|
|
3327
3328
|
className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
|
|
3328
3329
|
}
|
|
@@ -3331,40 +3332,40 @@ function Od({
|
|
|
3331
3332
|
)
|
|
3332
3333
|
]
|
|
3333
3334
|
}
|
|
3334
|
-
) }) }) :
|
|
3335
|
-
|
|
3335
|
+
) }) }) : $ === "kanban" ? /* @__PURE__ */ r(
|
|
3336
|
+
Mi,
|
|
3336
3337
|
{
|
|
3337
|
-
items:
|
|
3338
|
-
onCardClick: (e) =>
|
|
3338
|
+
items: C,
|
|
3339
|
+
onCardClick: (e) => Dn(e),
|
|
3339
3340
|
onDrop: (e, t) => fl.mutate({ item: e, targetState: t }),
|
|
3340
|
-
onClaim: (e) =>
|
|
3341
|
-
onRelease: (e) =>
|
|
3342
|
-
swimlaneBy:
|
|
3341
|
+
onClaim: (e) => De.mutate(e),
|
|
3342
|
+
onRelease: (e) => et.mutate(e),
|
|
3343
|
+
swimlaneBy: ht,
|
|
3343
3344
|
stateLabels: En,
|
|
3344
|
-
laneLabel:
|
|
3345
|
+
laneLabel: ht === "collection" ? lt : void 0,
|
|
3345
3346
|
claimsEnabled: ge,
|
|
3346
3347
|
onDraggingChange: (e) => {
|
|
3347
3348
|
hn.current = e;
|
|
3348
3349
|
}
|
|
3349
3350
|
}
|
|
3350
|
-
) : /* @__PURE__ */
|
|
3351
|
+
) : /* @__PURE__ */ r(Qi, { queueId: l })
|
|
3351
3352
|
] }),
|
|
3352
3353
|
It && ne && /* @__PURE__ */ d(
|
|
3353
3354
|
Ki,
|
|
3354
3355
|
{
|
|
3355
|
-
count:
|
|
3356
|
+
count: oe.length,
|
|
3356
3357
|
claimsEnabled: ge,
|
|
3357
|
-
showClaim:
|
|
3358
|
-
showRelease:
|
|
3359
|
-
showTransition:
|
|
3358
|
+
showClaim: Oe("claim"),
|
|
3359
|
+
showRelease: Oe("release"),
|
|
3360
|
+
showTransition: Oe("transition"),
|
|
3360
3361
|
states: Mr((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
|
|
3361
3362
|
value: e,
|
|
3362
3363
|
label: Fe(e)
|
|
3363
3364
|
})),
|
|
3364
|
-
busy:
|
|
3365
|
+
busy: ct,
|
|
3365
3366
|
onClaim: () => Bn(
|
|
3366
3367
|
"Claim",
|
|
3367
|
-
(e) =>
|
|
3368
|
+
(e) => h.request(
|
|
3368
3369
|
ce(`/queues/${l}/claim`, {
|
|
3369
3370
|
source_collection: e.collection,
|
|
3370
3371
|
item_id: e.item_id
|
|
@@ -3373,7 +3374,7 @@ function Od({
|
|
|
3373
3374
|
),
|
|
3374
3375
|
onRelease: () => Bn(
|
|
3375
3376
|
"Release",
|
|
3376
|
-
(e) =>
|
|
3377
|
+
(e) => h.request(
|
|
3377
3378
|
ce(`/queues/${l}/release`, {
|
|
3378
3379
|
source_collection: e.collection,
|
|
3379
3380
|
item_id: e.item_id
|
|
@@ -3381,15 +3382,15 @@ function Od({
|
|
|
3381
3382
|
)
|
|
3382
3383
|
),
|
|
3383
3384
|
onTransition: (e) => Bn("Transition", (t) => _r(t, e)),
|
|
3384
|
-
onClear: () =>
|
|
3385
|
+
onClear: () => je([]),
|
|
3385
3386
|
children: [
|
|
3386
|
-
|
|
3387
|
+
oe.length >= 2 && /* @__PURE__ */ r(
|
|
3387
3388
|
"button",
|
|
3388
3389
|
{
|
|
3389
3390
|
type: "button",
|
|
3390
3391
|
onClick: () => {
|
|
3391
3392
|
const e = Cs(
|
|
3392
|
-
|
|
3393
|
+
C.filter((t) => oe.includes(F(t)) && t.collection !== "tasks").map((t) => Y.urlFor(Kn(t)))
|
|
3393
3394
|
);
|
|
3394
3395
|
e.blocked > 0 || e.capped > 0 ? A.warning(Oa(e)) : A.success(Oa(e));
|
|
3395
3396
|
},
|
|
@@ -3399,57 +3400,73 @@ function Od({
|
|
|
3399
3400
|
children: "Open in tabs"
|
|
3400
3401
|
}
|
|
3401
3402
|
),
|
|
3402
|
-
|
|
3403
|
+
Oe("transition") && (() => {
|
|
3404
|
+
const e = C.filter(
|
|
3405
|
+
(n) => oe.includes(F(n)) && n.collection !== "tasks"
|
|
3406
|
+
), t = [...new Set(e.map((n) => n.collection))];
|
|
3407
|
+
return e.length > 0 ? /* @__PURE__ */ r(
|
|
3408
|
+
Di,
|
|
3409
|
+
{
|
|
3410
|
+
collection: t.length === 1 ? t[0] : null,
|
|
3411
|
+
ids: e.map((n) => n.item_id),
|
|
3412
|
+
disabled: ct,
|
|
3413
|
+
onDone: () => {
|
|
3414
|
+
je([]), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
) : null;
|
|
3418
|
+
})(),
|
|
3419
|
+
/* @__PURE__ */ r(
|
|
3403
3420
|
Gs,
|
|
3404
3421
|
{
|
|
3405
|
-
targets:
|
|
3422
|
+
targets: C.filter((e) => oe.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
|
|
3406
3423
|
enabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
|
|
3407
3424
|
tone: "light",
|
|
3408
|
-
disabled:
|
|
3425
|
+
disabled: ct,
|
|
3409
3426
|
onDone: (e) => {
|
|
3410
|
-
e.failed === 0 &&
|
|
3427
|
+
e.failed === 0 && je([]), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
3411
3428
|
}
|
|
3412
3429
|
}
|
|
3413
3430
|
),
|
|
3414
|
-
|
|
3431
|
+
Oe("update-field") && /* @__PURE__ */ r(
|
|
3415
3432
|
Hs,
|
|
3416
3433
|
{
|
|
3417
|
-
targets:
|
|
3418
|
-
disabled:
|
|
3419
|
-
onDone: () => void
|
|
3434
|
+
targets: C.filter((e) => oe.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3435
|
+
disabled: ct,
|
|
3436
|
+
onDone: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
3420
3437
|
className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
|
|
3421
3438
|
}
|
|
3422
3439
|
),
|
|
3423
|
-
|
|
3440
|
+
Oe("compare") && /* @__PURE__ */ r(
|
|
3424
3441
|
Ws,
|
|
3425
3442
|
{
|
|
3426
|
-
targets:
|
|
3427
|
-
renderValue: (e, t, n,
|
|
3443
|
+
targets: C.filter((e) => oe.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3444
|
+
renderValue: (e, t, n, a) => {
|
|
3428
3445
|
var o;
|
|
3429
3446
|
return zs(
|
|
3430
|
-
((o =
|
|
3447
|
+
((o = C.find((s) => oe.includes(F(s)))) == null ? void 0 : o.collection) ?? "",
|
|
3431
3448
|
e,
|
|
3432
3449
|
t,
|
|
3433
3450
|
n,
|
|
3434
|
-
|
|
3451
|
+
a
|
|
3435
3452
|
);
|
|
3436
3453
|
},
|
|
3437
|
-
disabled:
|
|
3454
|
+
disabled: ct,
|
|
3438
3455
|
className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
|
|
3439
3456
|
}
|
|
3440
3457
|
),
|
|
3441
|
-
|
|
3458
|
+
Oe("message") && /* @__PURE__ */ r(
|
|
3442
3459
|
Ys,
|
|
3443
3460
|
{
|
|
3444
|
-
targets:
|
|
3445
|
-
disabled:
|
|
3461
|
+
targets: C.filter((e) => oe.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3462
|
+
disabled: ct,
|
|
3446
3463
|
className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
|
|
3447
3464
|
}
|
|
3448
3465
|
)
|
|
3449
3466
|
]
|
|
3450
3467
|
}
|
|
3451
3468
|
),
|
|
3452
|
-
W != null && W.length ? /* @__PURE__ */
|
|
3469
|
+
W != null && W.length ? /* @__PURE__ */ r(
|
|
3453
3470
|
ki,
|
|
3454
3471
|
{
|
|
3455
3472
|
collection: W[0].collection,
|
|
@@ -3459,9 +3476,9 @@ function Od({
|
|
|
3459
3476
|
width: W[0].width,
|
|
3460
3477
|
title: W[0].title,
|
|
3461
3478
|
stack: W,
|
|
3462
|
-
onPush: (e) =>
|
|
3463
|
-
onPop: () =>
|
|
3464
|
-
onClose: () =>
|
|
3479
|
+
onPush: (e) => dt.push([...W, e]),
|
|
3480
|
+
onPop: () => dt.back(),
|
|
3481
|
+
onClose: () => dt.back(W.length),
|
|
3465
3482
|
onOpenRecord: Rl
|
|
3466
3483
|
}
|
|
3467
3484
|
) : null,
|
|
@@ -3480,14 +3497,14 @@ function Od({
|
|
|
3480
3497
|
"data-queue-row-menu": !0,
|
|
3481
3498
|
children: [
|
|
3482
3499
|
[
|
|
3483
|
-
{ label: "Open", run: () =>
|
|
3500
|
+
{ label: "Open", run: () => Dn(U.row) },
|
|
3484
3501
|
{
|
|
3485
3502
|
label: "Open full record",
|
|
3486
|
-
run: () =>
|
|
3503
|
+
run: () => ot(U.row)
|
|
3487
3504
|
},
|
|
3488
|
-
{ label: "Peek", run: () =>
|
|
3505
|
+
{ label: "Peek", run: () => Me(U.row) },
|
|
3489
3506
|
...ge ? [
|
|
3490
|
-
((Ra = U.row.claimed_by) == null ? void 0 : Ra.id) === S ? { label: "Release claim", run: () =>
|
|
3507
|
+
((Ra = U.row.claimed_by) == null ? void 0 : Ra.id) === S ? { label: "Release claim", run: () => et.mutate(U.row) } : { label: "Claim", run: () => De.mutate(U.row) }
|
|
3491
3508
|
] : [],
|
|
3492
3509
|
// The friendly id (PW26-76166), never the row id (army 6 M52);
|
|
3493
3510
|
// a record with no number has nothing to copy.
|
|
@@ -3514,12 +3531,12 @@ function Od({
|
|
|
3514
3531
|
label: e.label,
|
|
3515
3532
|
run: () => ol(e, U.row)
|
|
3516
3533
|
}))
|
|
3517
|
-
].map((e) => /* @__PURE__ */
|
|
3534
|
+
].map((e) => /* @__PURE__ */ r(
|
|
3518
3535
|
"button",
|
|
3519
3536
|
{
|
|
3520
3537
|
type: "button",
|
|
3521
3538
|
onClick: () => {
|
|
3522
|
-
e.run(),
|
|
3539
|
+
e.run(), $t(null);
|
|
3523
3540
|
},
|
|
3524
3541
|
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",
|
|
3525
3542
|
children: e.label
|
|
@@ -3527,7 +3544,7 @@ function Od({
|
|
|
3527
3544
|
e.label
|
|
3528
3545
|
)),
|
|
3529
3546
|
U.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
|
|
3530
|
-
/* @__PURE__ */
|
|
3547
|
+
/* @__PURE__ */ r("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
|
|
3531
3548
|
Nn.slice(0, 8).map((e) => {
|
|
3532
3549
|
const t = (U.row.labels ?? []).includes(e);
|
|
3533
3550
|
return /* @__PURE__ */ d(
|
|
@@ -3535,11 +3552,11 @@ function Od({
|
|
|
3535
3552
|
{
|
|
3536
3553
|
type: "button",
|
|
3537
3554
|
onClick: () => {
|
|
3538
|
-
br(U.row, e),
|
|
3555
|
+
br(U.row, e), $t(null);
|
|
3539
3556
|
},
|
|
3540
3557
|
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",
|
|
3541
3558
|
children: [
|
|
3542
|
-
/* @__PURE__ */
|
|
3559
|
+
/* @__PURE__ */ r(
|
|
3543
3560
|
"span",
|
|
3544
3561
|
{
|
|
3545
3562
|
className: t ? "h-1.5 w-1.5 rounded-full bg-violet-500" : "h-1.5 w-1.5 rounded-full border border-slate-300 dark:border-slate-600"
|
|
@@ -3551,7 +3568,7 @@ function Od({
|
|
|
3551
3568
|
e
|
|
3552
3569
|
);
|
|
3553
3570
|
}),
|
|
3554
|
-
/* @__PURE__ */
|
|
3571
|
+
/* @__PURE__ */ r(
|
|
3555
3572
|
"form",
|
|
3556
3573
|
{
|
|
3557
3574
|
onSubmit: (e) => {
|
|
@@ -3559,10 +3576,10 @@ function Od({
|
|
|
3559
3576
|
const n = e.target.elements.namedItem(
|
|
3560
3577
|
"newlabel"
|
|
3561
3578
|
).value.trim();
|
|
3562
|
-
n && (br(U.row, n),
|
|
3579
|
+
n && (br(U.row, n), $t(null));
|
|
3563
3580
|
},
|
|
3564
3581
|
className: "px-3 py-1",
|
|
3565
|
-
children: /* @__PURE__ */
|
|
3582
|
+
children: /* @__PURE__ */ r(
|
|
3566
3583
|
"input",
|
|
3567
3584
|
{
|
|
3568
3585
|
name: "newlabel",
|
|
@@ -3581,8 +3598,8 @@ function Od({
|
|
|
3581
3598
|
document.body
|
|
3582
3599
|
),
|
|
3583
3600
|
pr && Ta(
|
|
3584
|
-
/* @__PURE__ */
|
|
3585
|
-
|
|
3601
|
+
/* @__PURE__ */ r(
|
|
3602
|
+
nc,
|
|
3586
3603
|
{
|
|
3587
3604
|
queueId: l,
|
|
3588
3605
|
drill: pr,
|
|
@@ -3594,38 +3611,38 @@ function Od({
|
|
|
3594
3611
|
),
|
|
3595
3612
|
document.body
|
|
3596
3613
|
),
|
|
3597
|
-
/* @__PURE__ */
|
|
3614
|
+
/* @__PURE__ */ r(
|
|
3598
3615
|
Pi,
|
|
3599
3616
|
{
|
|
3600
3617
|
item: Pe,
|
|
3601
3618
|
stateLabels: En,
|
|
3602
|
-
collectionLabel:
|
|
3619
|
+
collectionLabel: lt,
|
|
3603
3620
|
claimsEnabled: ge,
|
|
3604
3621
|
columnFormats: Ul,
|
|
3605
|
-
fieldLabel: (e) => T(`extra.${e}`,
|
|
3622
|
+
fieldLabel: (e) => T(`extra.${e}`, Ge(e)),
|
|
3606
3623
|
width: p == null ? void 0 : p.sheet_width,
|
|
3607
3624
|
itemLayout: p == null ? void 0 : p.item_layout,
|
|
3608
|
-
onOpenRecord: (e) =>
|
|
3625
|
+
onOpenRecord: (e) => ot(e),
|
|
3609
3626
|
onOpenChange: (e) => {
|
|
3610
|
-
e || (
|
|
3627
|
+
e || (Me(null), On(!1));
|
|
3611
3628
|
},
|
|
3612
|
-
onClaim: (e) =>
|
|
3613
|
-
onRelease: (e) =>
|
|
3629
|
+
onClaim: (e) => De.mutate(e),
|
|
3630
|
+
onRelease: (e) => et.mutate(e),
|
|
3614
3631
|
workNextActive: ql,
|
|
3615
3632
|
onNext: () => Pe && Qr(Pe),
|
|
3616
|
-
refetchItems: () =>
|
|
3633
|
+
refetchItems: () => f.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
3617
3634
|
}
|
|
3618
3635
|
),
|
|
3619
3636
|
Wt.dialog
|
|
3620
3637
|
] });
|
|
3621
3638
|
}
|
|
3622
|
-
function
|
|
3639
|
+
function nc({
|
|
3623
3640
|
queueId: l,
|
|
3624
3641
|
drill: k,
|
|
3625
3642
|
onClose: K,
|
|
3626
3643
|
onOpenRecord: M
|
|
3627
3644
|
}) {
|
|
3628
|
-
const Z = ja(), { data:
|
|
3645
|
+
const Z = ja(), { data: f, isLoading: h } = X({
|
|
3629
3646
|
queryKey: ["queue-agg-rows", l, k.row.collection, k.row.item_id, k.path],
|
|
3630
3647
|
queryFn: () => Z.request(
|
|
3631
3648
|
O(`/queues/${l}/aggregate-rows`, {
|
|
@@ -3635,7 +3652,7 @@ function tc({
|
|
|
3635
3652
|
})
|
|
3636
3653
|
).then((S) => S.data)
|
|
3637
3654
|
});
|
|
3638
|
-
return /* @__PURE__ */
|
|
3655
|
+
return /* @__PURE__ */ r(
|
|
3639
3656
|
"div",
|
|
3640
3657
|
{
|
|
3641
3658
|
className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/30 p-6",
|
|
@@ -3648,16 +3665,16 @@ function tc({
|
|
|
3648
3665
|
children: [
|
|
3649
3666
|
/* @__PURE__ */ d("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
3650
3667
|
/* @__PURE__ */ d("div", { children: [
|
|
3651
|
-
/* @__PURE__ */
|
|
3668
|
+
/* @__PURE__ */ r("p", { className: "text-[13px] font-semibold", children: k.row.label }),
|
|
3652
3669
|
/* @__PURE__ */ d("p", { className: "text-[11.5px] text-muted-foreground", children: [
|
|
3653
|
-
|
|
3670
|
+
Ge(k.path),
|
|
3654
3671
|
" = ",
|
|
3655
|
-
/* @__PURE__ */
|
|
3672
|
+
/* @__PURE__ */ r("span", { className: "tabular-nums", children: k.value }),
|
|
3656
3673
|
" ",
|
|
3657
3674
|
"— the rows behind this number"
|
|
3658
3675
|
] })
|
|
3659
3676
|
] }),
|
|
3660
|
-
/* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ r(
|
|
3661
3678
|
"button",
|
|
3662
3679
|
{
|
|
3663
3680
|
type: "button",
|
|
@@ -3667,17 +3684,17 @@ function tc({
|
|
|
3667
3684
|
}
|
|
3668
3685
|
)
|
|
3669
3686
|
] }),
|
|
3670
|
-
|
|
3671
|
-
/* @__PURE__ */
|
|
3687
|
+
h ? /* @__PURE__ */ r("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "Loading…" }) : ((f == null ? void 0 : f.rows) ?? []).length === 0 ? /* @__PURE__ */ r("p", { className: "py-6 text-center text-[12.5px] text-slate-400", children: "No contributing rows resolved." }) : /* @__PURE__ */ r("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: f == null ? void 0 : f.rows.map((S) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between gap-3 py-1.5", children: [
|
|
3688
|
+
/* @__PURE__ */ r(
|
|
3672
3689
|
"button",
|
|
3673
3690
|
{
|
|
3674
3691
|
type: "button",
|
|
3675
|
-
onClick: () =>
|
|
3692
|
+
onClick: () => f.target && M(f.target, String(S.id)),
|
|
3676
3693
|
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",
|
|
3677
3694
|
children: S.label
|
|
3678
3695
|
}
|
|
3679
3696
|
),
|
|
3680
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ r("span", { className: "shrink-0 tabular-nums text-[12px] text-slate-600 dark:text-slate-300", children: S.leaf_value == null ? "—" : String(S.leaf_value) })
|
|
3681
3698
|
] }, String(S.id))) })
|
|
3682
3699
|
]
|
|
3683
3700
|
}
|
|
@@ -3686,5 +3703,5 @@ function tc({
|
|
|
3686
3703
|
);
|
|
3687
3704
|
}
|
|
3688
3705
|
export {
|
|
3689
|
-
|
|
3706
|
+
Dd as QueueWorklist
|
|
3690
3707
|
};
|