@nivaro/react 0.3.56 → 0.3.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/shared/components/CollectionBrowserView.js +2521 -2487
- package/dist/shared/components/queue/QueueItemSheet.js +111 -111
- package/dist/shared/components/queue/QueueWorklist.js +923 -911
- package/dist/shared/components/queue/live-state-aspect.js +7 -3
- package/dist/shared/components/queue/path-label.js +14 -0
- package/dist/shared/lib/cbv-page-warm.js +36 -0
- package/dist/shared/lib/record-ref.js +78 -53
- package/package.json +1 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsxs as d, Fragment as
|
|
1
|
+
import { jsxs as d, Fragment as qe, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useSensors as no, useSensor as ro, PointerSensor as ao, DndContext as lo, closestCenter as oo } from "@dnd-kit/core";
|
|
3
3
|
import { SortableContext as so, verticalListSortingStrategy as io, arrayMove as co, useSortable as uo } from "@dnd-kit/sortable";
|
|
4
4
|
import { CSS as mo } from "@dnd-kit/utilities";
|
|
5
|
-
import { useQueryClient as po, useQuery as W, useMutation as
|
|
6
|
-
import { AlertTriangle as bo, FileDiff as ho, RefreshCw as fo, Rows3 as
|
|
7
|
-
import { useState as v, useRef as U, useEffect as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
import { toast as
|
|
10
|
-
import { useNivaroClient as
|
|
5
|
+
import { useQueryClient as po, useQuery as W, useMutation as $e, useQueries as Be } from "@tanstack/react-query";
|
|
6
|
+
import { AlertTriangle as bo, FileDiff as ho, RefreshCw as fo, Rows3 as _a, Flame as go, Sparkles as xo, BarChart3 as yo, SlidersHorizontal as ko, ListChecks as vo, Rows4 as wo, Rows2 as _o, Play as No, Plus as en, ChevronDown as Na, Star as So, Pin as Co, Loader2 as $o, Check as qo, Save as Fo, Bell as To, Inbox as Ro, GripVertical as Eo } from "lucide-react";
|
|
7
|
+
import { useState as v, useRef as U, useEffect as P, useMemo as V } from "react";
|
|
8
|
+
import { createPortal as Sa } from "react-dom";
|
|
9
|
+
import { toast as O } from "sonner";
|
|
10
|
+
import { useNivaroClient as La, useItemEditAuth as Ca, useItemNavigation as Lo, useNavigation as Ao, useOverlayState as Oo } from "../../context.js";
|
|
11
11
|
import { useDebounced as Do } from "../../hooks/useDebounced.js";
|
|
12
12
|
import { useElapsedLoading as Ko } from "../../hooks/useElapsedLoading.js";
|
|
13
13
|
import { useSlowReason as Po } from "../../hooks/useSlowReason.js";
|
|
14
14
|
import { useBulkProgressFeed as Mo } from "../../lib/bulk-progress.js";
|
|
15
|
-
import { get as L, post as se, patch as
|
|
15
|
+
import { get as L, post as se, patch as $a, del as In, put as Qo } from "../../lib/commands.js";
|
|
16
16
|
import { evaluateExpression as Bo } from "../../lib/expression.js";
|
|
17
17
|
import { clauseFromControlValue as jo, filterSentence as Uo } from "../../lib/filter-sentence.js";
|
|
18
18
|
import { deliverLive as Io, releaseLiveOwner as Vo } from "../../lib/focus-mode.js";
|
|
19
|
-
import { formatMultiValue as
|
|
19
|
+
import { formatMultiValue as nt, formatValue as Go } from "../../lib/format-value.js";
|
|
20
20
|
import { createCursorBook as Wo, pageRequest as Ho, noteNextCursor as Yo } from "../../lib/keyset-pager.js";
|
|
21
21
|
import { normalizeInlineEdit as Jo, inlineM2oTarget as zo, inlineChoices as Xo, inlineEditFor as Zo, nextInlineKey as es } from "../../lib/list-inline-edit.js";
|
|
22
22
|
import { sanitizeQueueLinkState as ts, readListLinkFromLocation as ns, dropListLinkParam as rs } from "../../lib/list-link.js";
|
|
23
|
-
import { expandCoalesced as as, LIVE_ASPECTS as
|
|
23
|
+
import { expandCoalesced as as, LIVE_ASPECTS as $t } from "../../lib/live.js";
|
|
24
24
|
import { useRowChanges as ls, useRowLocksByCollection as os, lockLabel as ss } from "../../lib/live-list.js";
|
|
25
|
-
import { OPEN_IN_TABS_CAP as is, openInTabs as cs, openInTabsMessage as
|
|
25
|
+
import { OPEN_IN_TABS_CAP as is, openInTabs as cs, openInTabsMessage as qa } from "../../lib/open-in-tabs.js";
|
|
26
26
|
import { isOwnWrite as ds } from "../../lib/own-writes.js";
|
|
27
27
|
import { usePrefetchIntent as us } from "../../lib/prefetch.js";
|
|
28
28
|
import { useRowPresence as ms, rowPresenceKey as ps } from "../../lib/presence-hooks.js";
|
|
29
29
|
import { buildGroups as bs } from "../../lib/queue-grouping.js";
|
|
30
30
|
import { cascadeFilter as hs, fetchCascadeRelations as fs } from "../../lib/quick-filter-cascade.js";
|
|
31
31
|
import { useOptionalRealtime as gs } from "../../lib/realtime.js";
|
|
32
|
-
import { copyIdText as
|
|
32
|
+
import { copyIdText as Fa } from "../../lib/record-ref.js";
|
|
33
33
|
import { rowHighlightTextClass as xs, rowHighlightClass as ys } from "../../lib/row-highlight.js";
|
|
34
|
-
import { userErrorMessage as
|
|
34
|
+
import { userErrorMessage as qt } from "../../lib/safe-error.js";
|
|
35
35
|
import { useMyScopes as ks, matchScopeDimension as vs } from "../../lib/use-my-scopes.js";
|
|
36
36
|
import { useNewItemLayouts as ws } from "../../lib/use-new-item-layouts.js";
|
|
37
|
-
import { formatNumber as ie, cn as
|
|
37
|
+
import { formatNumber as ie, cn as E, titleCase as Vn, humanHours as _s, formatRelative as Ns, formatDateTime as Ss, formatDate as Cs } from "../../lib/utils.js";
|
|
38
38
|
import { usePublishAskContext as $s, useAskRecordDrag as qs } from "../ai/ask-context.js";
|
|
39
39
|
import { useBuiltinGate as Fs, BulkActionButtons as Ts } from "../bulk/BulkActionButtons.js";
|
|
40
40
|
import { BulkRowMark as Rs } from "../bulk/BulkRowMark.js";
|
|
@@ -46,7 +46,7 @@ import { FulfilmentPill as Ks, FULFILMENT_FILTER_OPTIONS as Ps } from "../Fulfil
|
|
|
46
46
|
import { ImportFromFileButton as Ms } from "../import/ImportFromFileButton.js";
|
|
47
47
|
import { IntegrationDots as Qs, INTEGRATIONS_FILTER_OPTIONS as Bs } from "../integrations/IntegrationDots.js";
|
|
48
48
|
import { IntegrationsFilterPill as js } from "../integrations/IntegrationsFilterPill.js";
|
|
49
|
-
import { readQueueReturn as Us, writeQueueReturn as
|
|
49
|
+
import { readQueueReturn as Us, writeQueueReturn as Ta } from "../item-edit/QueueReturnChip.js";
|
|
50
50
|
import { ListLoadError as Is } from "../ListLoadError.js";
|
|
51
51
|
import { LiveRowMark as Vs } from "../LiveRowMark.js";
|
|
52
52
|
import { CopyListLinkButton as Gs } from "../list/CopyListLinkButton.js";
|
|
@@ -56,28 +56,29 @@ import { RealtimeStaleMark as Xs } from "../RealtimeStatusBanner.js";
|
|
|
56
56
|
import { RecordDrilldownSheet as Zs } from "../RecordDrilldownSheet.js";
|
|
57
57
|
import { RowHighlightLegend as ei } from "../RowHighlightLegend.js";
|
|
58
58
|
import { RowPresence as ti } from "../RowPresence.js";
|
|
59
|
-
import { TickerNumber as
|
|
59
|
+
import { TickerNumber as Gn } from "../TickerNumber.js";
|
|
60
60
|
import { UnseenDot as ni } from "../UnseenDot.js";
|
|
61
61
|
import { Badge as ri } from "../ui/badge.js";
|
|
62
|
-
import { Checkbox as
|
|
63
|
-
import { Command as
|
|
62
|
+
import { Checkbox as Wn } from "../ui/checkbox.js";
|
|
63
|
+
import { Command as Ra, CommandInput as ai, CommandList as Ea, CommandEmpty as li, CommandItem as Ft } from "../ui/command.js";
|
|
64
64
|
import { Label as oi } from "../ui/label.js";
|
|
65
|
-
import { Popover as
|
|
65
|
+
import { Popover as rt, PopoverTrigger as at, PopoverContent as lt } from "../ui/popover.js";
|
|
66
66
|
import { Skeleton as si } from "../ui/skeleton.js";
|
|
67
67
|
import { dedupeChooserKeys as ii } from "./column-chooser.js";
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
|
|
68
|
+
import { statsOutrunRows as ci, stateAspectEffect as di } from "./live-state-aspect.js";
|
|
69
|
+
import { pathHeader as ui } from "./path-label.js";
|
|
70
|
+
import { OwnerAvatars as mi } from "./OwnerAvatars.js";
|
|
71
|
+
import { QueueBulkBar as pi } from "./QueueBulkBar.js";
|
|
72
|
+
import { QueueItemSheet as bi } from "./QueueItemSheet.js";
|
|
73
|
+
import { QueueKanbanBoard as hi } from "./QueueKanbanBoard.js";
|
|
74
|
+
import { QueueQuickFilters as fi } from "./QueueQuickFilters.js";
|
|
75
|
+
import { QueueWorkloadView as gi } from "./QueueWorkloadView.js";
|
|
76
|
+
import { useTransitionNote as xi, needsTransitionNote as yi } from "./transition-note.js";
|
|
77
|
+
function ki({ summary: l }) {
|
|
77
78
|
if (!l || l.count === 0)
|
|
78
79
|
return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
|
|
79
|
-
const
|
|
80
|
-
|
|
80
|
+
const k = [l.last_from, l.last_to].filter(Boolean).join(" → "), K = [
|
|
81
|
+
k ? `Last: ${k}` : null,
|
|
81
82
|
l.last_at ? Ns(l.last_at) : null,
|
|
82
83
|
l.last_reason ? `“${l.last_reason}”` : "no reason given"
|
|
83
84
|
].filter(Boolean).join(" · ");
|
|
@@ -85,7 +86,7 @@ function xi({ summary: l }) {
|
|
|
85
86
|
"span",
|
|
86
87
|
{
|
|
87
88
|
className: "inline-flex max-w-[260px] items-center gap-1.5 truncate rounded-full border border-rose-200 bg-rose-50 px-2 py-0.5 text-[11px] font-medium text-rose-700 dark:border-rose-900/40 dark:bg-rose-900/10 dark:text-rose-300",
|
|
88
|
-
"data-tip":
|
|
89
|
+
"data-tip": K,
|
|
89
90
|
"data-send-backs": l.count,
|
|
90
91
|
children: [
|
|
91
92
|
/* @__PURE__ */ d("span", { className: "tabular-nums", children: [
|
|
@@ -100,35 +101,35 @@ function xi({ summary: l }) {
|
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
103
|
}
|
|
103
|
-
const
|
|
104
|
+
const vi = 50, tn = "nivaro_addendums", wi = [
|
|
104
105
|
{ value: "mine", label: "My Items" },
|
|
105
106
|
{ value: "unowned", label: "No Owners" },
|
|
106
107
|
{ value: "claimed", label: "Claimed by me" },
|
|
107
108
|
{ value: "all", label: "All Items" }
|
|
108
109
|
];
|
|
109
|
-
function
|
|
110
|
+
function _i({ summary: l }) {
|
|
110
111
|
if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
111
|
-
const
|
|
112
|
+
const k = l.active > 0, K = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", M = l.cost_impact, G = M != null && M !== 0 ? `${M > 0 ? "+" : "−"}$${Math.abs(M).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
|
|
112
113
|
return /* @__PURE__ */ d(
|
|
113
114
|
"span",
|
|
114
115
|
{
|
|
115
116
|
title: l.latest_title ?? void 0,
|
|
116
|
-
className:
|
|
117
|
+
className: E(
|
|
117
118
|
"inline-flex max-w-[220px] items-center gap-1.5 truncate rounded-full border px-2 py-0.5 text-[11px] font-medium",
|
|
118
|
-
|
|
119
|
+
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"
|
|
119
120
|
),
|
|
120
121
|
children: [
|
|
121
122
|
/* @__PURE__ */ a(
|
|
122
123
|
"span",
|
|
123
124
|
{
|
|
124
125
|
"aria-hidden": !0,
|
|
125
|
-
className:
|
|
126
|
+
className: E(
|
|
126
127
|
"h-1.5 w-1.5 shrink-0 rounded-full",
|
|
127
|
-
|
|
128
|
+
k ? "bg-amber-500" : "bg-slate-400"
|
|
128
129
|
)
|
|
129
130
|
}
|
|
130
131
|
),
|
|
131
|
-
|
|
132
|
+
k ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${K}` : `${l.total} ${K}`,
|
|
132
133
|
G && /* @__PURE__ */ d("span", { className: "tabular-nums opacity-80", children: [
|
|
133
134
|
"· ",
|
|
134
135
|
G
|
|
@@ -137,62 +138,62 @@ function vi({ summary: l }) {
|
|
|
137
138
|
}
|
|
138
139
|
);
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
+
function Ni(l) {
|
|
141
142
|
return _s(l);
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
return l ? /* @__PURE__ */ a("span", { className:
|
|
144
|
+
function Si({ status: l }) {
|
|
145
|
+
return l ? /* @__PURE__ */ a("span", { className: E("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function Ci({ points: l, inline: k = !1 }) {
|
|
147
148
|
if (l.length < 2) return null;
|
|
148
|
-
const
|
|
149
|
-
(
|
|
149
|
+
const K = k ? 40 : 64, M = k ? 14 : 18, G = Math.max(...l), f = Math.min(...l), h = G - f || 1, N = K / (l.length - 1), H = l.map(
|
|
150
|
+
(ye, g) => `${g === 0 ? "M" : "L"}${(g * N).toFixed(1)},${(M - 2 - (ye - f) / h * (M - 4)).toFixed(1)}`
|
|
150
151
|
).join(" ");
|
|
151
152
|
return /* @__PURE__ */ a(
|
|
152
153
|
"svg",
|
|
153
154
|
{
|
|
154
|
-
width:
|
|
155
|
-
height:
|
|
156
|
-
className:
|
|
155
|
+
width: K,
|
|
156
|
+
height: M,
|
|
157
|
+
className: k ? "opacity-40" : "mt-1.5 opacity-40",
|
|
157
158
|
"aria-hidden": "true",
|
|
158
159
|
children: /* @__PURE__ */ a("path", { d: H, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
|
|
159
160
|
}
|
|
160
161
|
);
|
|
161
162
|
}
|
|
162
|
-
function
|
|
163
|
+
function Tt({
|
|
163
164
|
label: l,
|
|
164
|
-
count:
|
|
165
|
-
filteredCount:
|
|
166
|
-
active:
|
|
165
|
+
count: k,
|
|
166
|
+
filteredCount: K,
|
|
167
|
+
active: M,
|
|
167
168
|
isLoading: G,
|
|
168
169
|
tone: f,
|
|
169
170
|
trend: h,
|
|
170
171
|
delta: N,
|
|
171
172
|
deltaBadIsUp: H,
|
|
172
|
-
onClick:
|
|
173
|
+
onClick: ye
|
|
173
174
|
}) {
|
|
174
175
|
return /* @__PURE__ */ a(
|
|
175
176
|
"button",
|
|
176
177
|
{
|
|
177
178
|
type: "button",
|
|
178
|
-
onClick:
|
|
179
|
-
className:
|
|
179
|
+
onClick: ye,
|
|
180
|
+
className: E(
|
|
180
181
|
"nvr-section-enter flex items-center gap-1.5 bg-white px-3 py-2 text-left transition-colors hover:bg-slate-50 dark:bg-card dark:hover:bg-card/80",
|
|
181
|
-
|
|
182
|
-
!
|
|
182
|
+
M && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
|
|
183
|
+
!M && !G && k === 0 && "opacity-50"
|
|
183
184
|
),
|
|
184
|
-
children: G ? /* @__PURE__ */ a(si, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(
|
|
185
|
-
/* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children:
|
|
186
|
-
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(
|
|
185
|
+
children: G ? /* @__PURE__ */ a(si, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(qe, { children: [
|
|
186
|
+
/* @__PURE__ */ a("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: K != null ? /* @__PURE__ */ d(qe, { children: [
|
|
187
|
+
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Gn, { value: K, format: ie }) }),
|
|
187
188
|
/* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
|
|
188
189
|
"/ ",
|
|
189
|
-
/* @__PURE__ */ a(
|
|
190
|
+
/* @__PURE__ */ a(Gn, { value: k, format: ie })
|
|
190
191
|
] })
|
|
191
|
-
] }) : /* @__PURE__ */ a(
|
|
192
|
+
] }) : /* @__PURE__ */ a(Gn, { value: k, format: ie }) }),
|
|
192
193
|
/* @__PURE__ */ a(
|
|
193
194
|
"span",
|
|
194
195
|
{
|
|
195
|
-
className:
|
|
196
|
+
className: E(
|
|
196
197
|
"text-[11px] font-medium leading-none",
|
|
197
198
|
f === "red" ? "text-red-500 dark:text-red-400" : f === "amber" ? "text-amber-600 dark:text-amber-400" : "text-slate-400 dark:text-muted-foreground"
|
|
198
199
|
),
|
|
@@ -202,7 +203,7 @@ function Ft({
|
|
|
202
203
|
N != null && N !== 0 && /* @__PURE__ */ d(
|
|
203
204
|
"span",
|
|
204
205
|
{
|
|
205
|
-
className:
|
|
206
|
+
className: E(
|
|
206
207
|
"text-[10px] font-medium leading-none",
|
|
207
208
|
H ? N > 0 ? "text-red-500" : "text-emerald-600" : "text-slate-400"
|
|
208
209
|
),
|
|
@@ -212,16 +213,16 @@ function Ft({
|
|
|
212
213
|
]
|
|
213
214
|
}
|
|
214
215
|
),
|
|
215
|
-
h &&
|
|
216
|
+
h && k > 0 && /* @__PURE__ */ a(Ci, { points: h, inline: !0 })
|
|
216
217
|
] })
|
|
217
218
|
}
|
|
218
219
|
);
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
+
function $i({
|
|
221
222
|
label: l,
|
|
222
|
-
count:
|
|
223
|
-
filteredCount:
|
|
224
|
-
color:
|
|
223
|
+
count: k,
|
|
224
|
+
filteredCount: K,
|
|
225
|
+
color: M,
|
|
225
226
|
active: G,
|
|
226
227
|
onClick: f
|
|
227
228
|
}) {
|
|
@@ -230,7 +231,7 @@ function Si({
|
|
|
230
231
|
{
|
|
231
232
|
type: "button",
|
|
232
233
|
onClick: f,
|
|
233
|
-
className:
|
|
234
|
+
className: E(
|
|
234
235
|
"flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px] font-medium transition-colors",
|
|
235
236
|
G ? "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"
|
|
236
237
|
),
|
|
@@ -239,36 +240,34 @@ function Si({
|
|
|
239
240
|
"span",
|
|
240
241
|
{
|
|
241
242
|
className: "h-2 w-2 shrink-0 rounded-full",
|
|
242
|
-
style: { backgroundColor:
|
|
243
|
+
style: { backgroundColor: M ?? "#94a3b8" }
|
|
243
244
|
}
|
|
244
245
|
),
|
|
245
246
|
l,
|
|
246
|
-
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
247
|
-
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ie(
|
|
247
|
+
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: K != null ? /* @__PURE__ */ d(qe, { children: [
|
|
248
|
+
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ie(K) }),
|
|
248
249
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
249
250
|
" / ",
|
|
250
|
-
ie(
|
|
251
|
+
ie(k)
|
|
251
252
|
] })
|
|
252
|
-
] }) : ie(
|
|
253
|
+
] }) : ie(k) })
|
|
253
254
|
]
|
|
254
255
|
}
|
|
255
256
|
);
|
|
256
257
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
function Ci({
|
|
258
|
+
const je = ui;
|
|
259
|
+
function qi({
|
|
261
260
|
id: l,
|
|
262
|
-
label:
|
|
263
|
-
checked:
|
|
264
|
-
onCheckedChange:
|
|
261
|
+
label: k,
|
|
262
|
+
checked: K,
|
|
263
|
+
onCheckedChange: M
|
|
265
264
|
}) {
|
|
266
|
-
const { attributes: G, listeners: f, setNodeRef: h, transform: N, transition: H, isDragging:
|
|
265
|
+
const { attributes: G, listeners: f, setNodeRef: h, transform: N, transition: H, isDragging: ye } = uo({
|
|
267
266
|
id: l
|
|
268
267
|
}), g = {
|
|
269
268
|
transform: mo.Transform.toString(N),
|
|
270
269
|
transition: H,
|
|
271
|
-
opacity:
|
|
270
|
+
opacity: ye ? 0.4 : 1
|
|
272
271
|
}, Y = `col-toggle-${l}`;
|
|
273
272
|
return /* @__PURE__ */ d("div", { ref: h, style: g, className: "flex items-center gap-2 text-[12px]", children: [
|
|
274
273
|
/* @__PURE__ */ a(
|
|
@@ -280,38 +279,38 @@ function Ci({
|
|
|
280
279
|
children: /* @__PURE__ */ a(Eo, { className: "h-3.5 w-3.5" })
|
|
281
280
|
}
|
|
282
281
|
),
|
|
283
|
-
/* @__PURE__ */ a(
|
|
284
|
-
/* @__PURE__ */ a(oi, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children:
|
|
282
|
+
/* @__PURE__ */ a(Wn, { id: Y, checked: K, onCheckedChange: M }),
|
|
283
|
+
/* @__PURE__ */ a(oi, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children: k })
|
|
285
284
|
] });
|
|
286
285
|
}
|
|
287
|
-
function
|
|
286
|
+
function td({
|
|
288
287
|
queueId: l,
|
|
289
|
-
realtime:
|
|
290
|
-
renderError:
|
|
291
|
-
hideCreateActions:
|
|
288
|
+
realtime: k,
|
|
289
|
+
renderError: K,
|
|
290
|
+
hideCreateActions: M = !1,
|
|
292
291
|
onAsk: G
|
|
293
292
|
}) {
|
|
294
|
-
var
|
|
295
|
-
const f = po(), h =
|
|
293
|
+
var la, oa, sa, ia, ca, da, ua, ma, pa, ba, ha, fa, ga, xa, ya, ka, va;
|
|
294
|
+
const f = po(), h = La(), { userId: N } = Ca(), H = Lo(), { navigate: ye } = Ao(), [g, Y] = v("all"), [de, A] = v(1), Hn = U(Wo()), [Rt, Aa] = v(() => {
|
|
296
295
|
try {
|
|
297
296
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
298
297
|
} catch {
|
|
299
298
|
return "compact";
|
|
300
299
|
}
|
|
301
|
-
}), [
|
|
302
|
-
|
|
303
|
-
const
|
|
300
|
+
}), [C, Ue] = v("table"), [I, Ie] = v(""), [_, Q] = v({}), [Et, Yn] = v(() => /* @__PURE__ */ new Set()), [$, ot] = v(null), [ke, nn] = v(/* @__PURE__ */ new Set()), [st, rn] = v(null), [it, an] = v(null), [ln, Lt] = v(0), Fe = ls(), on = gs(), sn = U({}).current, Jn = U(/* @__PURE__ */ new Set()), [Oa, Da] = v(0), [zn, Ka] = v(0), ue = U(!1), At = U([]), Xn = U(null), cn = U(!1), dn = U(0), un = U("table");
|
|
301
|
+
un.current = C;
|
|
302
|
+
const mn = 25, { data: c, error: Ot } = W({
|
|
304
303
|
queryKey: ["queue-meta", l],
|
|
305
304
|
queryFn: () => h.request(L(`/queues/${l}`)).then((e) => e.data),
|
|
306
305
|
enabled: !!l
|
|
307
|
-
}), { scopes:
|
|
308
|
-
|
|
309
|
-
if (er.current || !Zn || !
|
|
306
|
+
}), { scopes: Dt, ready: Zn } = ks(), er = U(!1), [tr, nr] = v(!1), [Te, Pa] = v({}), me = U({});
|
|
307
|
+
P(() => {
|
|
308
|
+
if (er.current || !Zn || !c) return;
|
|
310
309
|
er.current = !0;
|
|
311
|
-
const e = (
|
|
310
|
+
const e = (c.extra_field_meta ?? []).filter(
|
|
312
311
|
(t) => t.kind === "relation" && t.target_collection && t.display_field
|
|
313
312
|
);
|
|
314
|
-
if (e.length === 0 || !
|
|
313
|
+
if (e.length === 0 || !Dt) {
|
|
315
314
|
nr(!0);
|
|
316
315
|
return;
|
|
317
316
|
}
|
|
@@ -331,11 +330,11 @@ function Xc({
|
|
|
331
330
|
];
|
|
332
331
|
};
|
|
333
332
|
for (const o of e) {
|
|
334
|
-
const s = vs(
|
|
333
|
+
const s = vs(Dt, { collection: o.target_collection });
|
|
335
334
|
if (!s) continue;
|
|
336
335
|
const m = `extra.${o.path}`;
|
|
337
336
|
try {
|
|
338
|
-
const p =
|
|
337
|
+
const p = Dt.restricted[s.name] ?? [];
|
|
339
338
|
if (p.length > 0) {
|
|
340
339
|
const S = await r(o, p);
|
|
341
340
|
S.length > 0 && (n[m.slice(6)] = S);
|
|
@@ -343,48 +342,48 @@ function Xc({
|
|
|
343
342
|
} catch {
|
|
344
343
|
}
|
|
345
344
|
}
|
|
346
|
-
Object.keys(n).length > 0 &&
|
|
345
|
+
Object.keys(n).length > 0 && Pa(n), Object.keys(t).length > 0 && (me.current = t, Q((o) => ({ ...o, ...t }))), nr(!0);
|
|
347
346
|
})();
|
|
348
|
-
}, [Zn,
|
|
349
|
-
const
|
|
350
|
-
queryKey: ["queue-browser-quick-filters",
|
|
351
|
-
queryFn: () => h.request(L(`/collections/${
|
|
347
|
+
}, [Zn, Dt, c]);
|
|
348
|
+
const Ve = ((oa = (la = c == null ? void 0 : c.sources) == null ? void 0 : la.find((e) => e.type === "collection")) == null ? void 0 : oa.collection) ?? null, { data: rr = [] } = W({
|
|
349
|
+
queryKey: ["queue-browser-quick-filters", Ve],
|
|
350
|
+
queryFn: () => h.request(L(`/collections/${Ve}`)).then((e) => {
|
|
352
351
|
var t, n;
|
|
353
352
|
return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
|
|
354
353
|
}).catch(() => []),
|
|
355
|
-
enabled: !!
|
|
354
|
+
enabled: !!Ve,
|
|
356
355
|
staleTime: 3e5
|
|
357
356
|
}), re = V(() => {
|
|
358
357
|
const e = /* @__PURE__ */ new Set(), t = [];
|
|
359
|
-
for (const n of (
|
|
358
|
+
for (const n of (c == null ? void 0 : c.sources) ?? [])
|
|
360
359
|
n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
|
|
361
360
|
return t;
|
|
362
|
-
}, [
|
|
361
|
+
}, [c == null ? void 0 : c.sources]), Kt = ws(
|
|
363
362
|
re.length === 1 ? re[0] : null
|
|
364
|
-
),
|
|
363
|
+
), pn = M === !0 || Array.isArray(M) && re.length > 0 && re.every((e) => M.includes(e)), pe = (c == null ? void 0 : c.claims_enabled) !== !1, u = c == null ? void 0 : c.display_config, Re = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Ma = (u == null ? void 0 : u.work_next) !== !1, Pt = (u == null ? void 0 : u.bulk_actions) !== !1, bn = Fs(
|
|
365
364
|
[
|
|
366
365
|
...new Set(
|
|
367
|
-
((
|
|
366
|
+
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
368
367
|
)
|
|
369
368
|
],
|
|
370
369
|
(u == null ? void 0 : u.bulk_action_keys) ?? null
|
|
371
|
-
),
|
|
370
|
+
), T = (e, t) => {
|
|
372
371
|
var n, r;
|
|
373
|
-
return ((r = (n =
|
|
372
|
+
return ((r = (n = c == null ? void 0 : c.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
|
|
374
373
|
}, ar = U(!1);
|
|
375
|
-
|
|
376
|
-
!
|
|
377
|
-
}, [
|
|
378
|
-
const [J,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}, [
|
|
382
|
-
if (!(
|
|
383
|
-
const e =
|
|
374
|
+
P(() => {
|
|
375
|
+
!c || ar.current || (ar.current = !0, Ie("-priority"));
|
|
376
|
+
}, [c]);
|
|
377
|
+
const [J, Qa] = v(!1);
|
|
378
|
+
P(() => {
|
|
379
|
+
c != null && c.display_config && !Re.includes(C) && Ue(Re[0]);
|
|
380
|
+
}, [c, C, Re]), P(() => {
|
|
381
|
+
if (!(c != null && c.sources)) return;
|
|
382
|
+
const e = on ? (b, R) => on.subscribeCollections(b, R) : k == null ? void 0 : k.subscribe;
|
|
384
383
|
if (!e) return;
|
|
385
384
|
const t = [
|
|
386
385
|
...new Set(
|
|
387
|
-
|
|
386
|
+
c.sources.filter((b) => b.type === "collection" && b.collection).map((b) => b.collection)
|
|
388
387
|
)
|
|
389
388
|
];
|
|
390
389
|
if (t.length === 0) return;
|
|
@@ -392,58 +391,58 @@ function Xc({
|
|
|
392
391
|
let r = null, o = null, s = null;
|
|
393
392
|
const m = () => {
|
|
394
393
|
s || (s = setTimeout(() => {
|
|
395
|
-
s = null,
|
|
394
|
+
s = null, Ka((b) => b + 1);
|
|
396
395
|
}, 1500));
|
|
397
396
|
}, p = () => {
|
|
398
397
|
o || (o = setTimeout(() => {
|
|
399
|
-
if (o = null,
|
|
400
|
-
|
|
398
|
+
if (o = null, dn.current > 0 || cn.current) {
|
|
399
|
+
At.current = [], Lt((b) => b + 1);
|
|
401
400
|
return;
|
|
402
401
|
}
|
|
403
|
-
|
|
402
|
+
ue.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
|
|
404
403
|
}, 900));
|
|
405
404
|
}, S = (b) => {
|
|
406
|
-
let
|
|
405
|
+
let R = !1, y = 0, X = !1;
|
|
407
406
|
const Z = b.flatMap(
|
|
408
407
|
(F) => F ? as(F) : [F]
|
|
409
408
|
);
|
|
410
409
|
for (const F of Z) {
|
|
411
|
-
const ne = F == null ? void 0 : F.changed_fields,
|
|
412
|
-
if (F && !F.action && (ne != null && ne.length) && ne.every((
|
|
413
|
-
if (ne.includes(
|
|
414
|
-
const
|
|
415
|
-
X = !0,
|
|
410
|
+
const ne = F == null ? void 0 : F.changed_fields, Zt = (F == null ? void 0 : F.collection) != null ? `${F.collection}:${String(F.item)}` : null, wa = Zt != null && Jn.current.has(Zt);
|
|
411
|
+
if (F && !F.action && (ne != null && ne.length) && ne.every((Ce) => Ce.startsWith("$"))) {
|
|
412
|
+
if (ne.includes($t.tasks) && n.add("queue-task-counts"), ne.includes($t.integrations) && n.add("queue-integrations-summary"), ne.includes($t.addendums) && n.add("queue-collection-addendums"), ne.includes($t.lock) && Da((Ce) => Ce + 1), ne.includes($t.state)) {
|
|
413
|
+
const Ce = di(wa, un.current === "kanban");
|
|
414
|
+
X = !0, Ce.refresh && (R = !0), y += Ce.pill;
|
|
416
415
|
}
|
|
417
416
|
r || (r = setTimeout(() => {
|
|
418
417
|
r = null;
|
|
419
|
-
for (const
|
|
418
|
+
for (const Ce of n) f.invalidateQueries({ queryKey: [Ce] });
|
|
420
419
|
n.clear();
|
|
421
420
|
}, 300));
|
|
422
421
|
continue;
|
|
423
422
|
}
|
|
424
423
|
X = !0;
|
|
425
424
|
const to = (F == null ? void 0 : F.collection) != null && ds(F.collection, F.item);
|
|
426
|
-
|
|
425
|
+
Zt && (wa || (F == null ? void 0 : F.action) === "create" || un.current === "kanban") ? (R = !0, to || At.current.push({ key: Zt, by: null })) : y += 1;
|
|
427
426
|
}
|
|
428
|
-
|
|
429
|
-
}, w = e(t, (b) => Io(
|
|
427
|
+
y > 0 && Lt((F) => F + y), R && p(), X && m();
|
|
428
|
+
}, w = e(t, (b) => Io(sn, [b ?? {}], S));
|
|
430
429
|
return () => {
|
|
431
|
-
w(), Vo(
|
|
430
|
+
w(), Vo(sn), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
|
|
432
431
|
};
|
|
433
|
-
}, [
|
|
434
|
-
const
|
|
432
|
+
}, [on, k, c == null ? void 0 : c.sources, f, l, N, sn]);
|
|
433
|
+
const Ee = Do(_, 350), Ba = JSON.stringify(Ee) === JSON.stringify(_), hn = U(!1), ve = C === "table" && !!$, lr = (() => {
|
|
435
434
|
const e = /* @__PURE__ */ new Set();
|
|
436
|
-
for (const t of (
|
|
435
|
+
for (const t of (c == null ? void 0 : c.extra_field_meta) ?? [])
|
|
437
436
|
t.aggregate && t.aggregate !== "count" && e.add(t.path);
|
|
438
|
-
for (const t of (
|
|
437
|
+
for (const t of (c == null ? void 0 : c.sources) ?? []) {
|
|
439
438
|
for (const [n, r] of Object.entries(t.column_formats ?? {}))
|
|
440
439
|
(r == null ? void 0 : r.type) === "number" && e.add(n);
|
|
441
440
|
t.type === "addendums" && e.add("cost_impact");
|
|
442
441
|
}
|
|
443
442
|
return [...e].slice(0, 12);
|
|
444
|
-
})(),
|
|
443
|
+
})(), we = (() => {
|
|
445
444
|
const e = {};
|
|
446
|
-
for (const [t, n] of Object.entries(
|
|
445
|
+
for (const [t, n] of Object.entries(Ee))
|
|
447
446
|
if (n) {
|
|
448
447
|
if (Array.isArray(n)) {
|
|
449
448
|
n.length > 0 && (e[t] = n);
|
|
@@ -458,58 +457,58 @@ function Xc({
|
|
|
458
457
|
}
|
|
459
458
|
return e;
|
|
460
459
|
})();
|
|
461
|
-
function
|
|
462
|
-
Q((n) => ({ ...n, [e]: n[e] === t ? "" : t })),
|
|
460
|
+
function Ge(e, t) {
|
|
461
|
+
Q((n) => ({ ...n, [e]: n[e] === t ? "" : t })), A(1);
|
|
463
462
|
}
|
|
464
|
-
function
|
|
463
|
+
function ja(e) {
|
|
465
464
|
Q((t) => {
|
|
466
465
|
const n = t.state, r = Array.isArray(n) ? n : n ? [n] : [], o = r.includes(e) ? r.filter((s) => s !== e) : [...r, e];
|
|
467
466
|
return { ...t, state: o };
|
|
468
|
-
}),
|
|
467
|
+
}), A(1);
|
|
469
468
|
}
|
|
470
|
-
const
|
|
471
|
-
function
|
|
472
|
-
Q({ ...
|
|
469
|
+
const Ua = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Ia = (e) => !e || Array.isArray(e) && e.length === 0;
|
|
470
|
+
function Va() {
|
|
471
|
+
Q({ ...me.current }), Y("all"), A(1);
|
|
473
472
|
}
|
|
474
|
-
const [ct,
|
|
473
|
+
const [ct, Ga] = v(() => {
|
|
475
474
|
try {
|
|
476
475
|
return localStorage.getItem("nvr_queue_insights_open") === "1";
|
|
477
476
|
} catch {
|
|
478
477
|
return !1;
|
|
479
478
|
}
|
|
480
479
|
});
|
|
481
|
-
|
|
480
|
+
P(() => {
|
|
482
481
|
try {
|
|
483
482
|
localStorage.setItem("nvr_queue_insights_open", ct ? "1" : "0");
|
|
484
483
|
} catch {
|
|
485
484
|
}
|
|
486
485
|
}, [ct]);
|
|
487
|
-
const { data:
|
|
486
|
+
const { data: Wa = [] } = W({
|
|
488
487
|
queryKey: ["queue-view-subs", l],
|
|
489
488
|
queryFn: () => h.request(L("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
|
|
490
489
|
staleTime: 3e4
|
|
491
|
-
}),
|
|
492
|
-
const t =
|
|
493
|
-
(t ? h.request(
|
|
490
|
+
}), Mt = (e) => Wa.find((t) => t.queue_view_id === e), Ha = (e) => {
|
|
491
|
+
const t = Mt(e);
|
|
492
|
+
(t ? h.request(In(`/notification-subscriptions/${t.id}`)) : h.request(
|
|
494
493
|
se("/notification-subscriptions", {
|
|
495
494
|
queue_id: l,
|
|
496
495
|
queue_view_id: e,
|
|
497
496
|
digest_frequency: "instant"
|
|
498
497
|
})
|
|
499
498
|
)).then(() => {
|
|
500
|
-
|
|
499
|
+
O.success(
|
|
501
500
|
t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
|
|
502
501
|
), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
|
|
503
|
-
}).catch((r) =>
|
|
504
|
-
}, [or,
|
|
502
|
+
}).catch((r) => O.error(qt(r, "Failed")));
|
|
503
|
+
}, [or, fn] = v(null), gn = [
|
|
505
504
|
...new Set(
|
|
506
|
-
((
|
|
505
|
+
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
507
506
|
)
|
|
508
|
-
], { data:
|
|
509
|
-
queryKey: ["queue-custom-actions", l,
|
|
507
|
+
], { data: Ya = {} } = W({
|
|
508
|
+
queryKey: ["queue-custom-actions", l, gn.join(",")],
|
|
510
509
|
queryFn: async () => {
|
|
511
510
|
const e = {};
|
|
512
|
-
for (const t of
|
|
511
|
+
for (const t of gn.slice(0, 6))
|
|
513
512
|
try {
|
|
514
513
|
const n = await h.request(
|
|
515
514
|
L("/custom-actions", { collection: t })
|
|
@@ -520,16 +519,16 @@ function Xc({
|
|
|
520
519
|
}
|
|
521
520
|
return e;
|
|
522
521
|
},
|
|
523
|
-
enabled:
|
|
522
|
+
enabled: gn.length > 0,
|
|
524
523
|
staleTime: 6e4
|
|
525
|
-
}),
|
|
524
|
+
}), Ja = (e) => Ya[e] ?? [], za = (e, t) => {
|
|
526
525
|
h.request(se(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
|
|
527
|
-
|
|
526
|
+
O.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
528
527
|
}).catch((n) => {
|
|
529
528
|
const r = n.response;
|
|
530
|
-
|
|
529
|
+
O.error((r == null ? void 0 : r.error) ?? qt(n, `${e.label} failed`));
|
|
531
530
|
});
|
|
532
|
-
}, { data:
|
|
531
|
+
}, { data: xn = [] } = W({
|
|
533
532
|
queryKey: ["queue-triage-labels", l],
|
|
534
533
|
queryFn: () => h.request(L(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
|
|
535
534
|
staleTime: 3e4
|
|
@@ -542,43 +541,43 @@ function Xc({
|
|
|
542
541
|
})
|
|
543
542
|
).then(() => {
|
|
544
543
|
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
|
|
545
|
-
}).catch((n) =>
|
|
544
|
+
}).catch((n) => O.error(qt(n, "Label failed")));
|
|
546
545
|
}, {
|
|
547
|
-
data:
|
|
546
|
+
data: i,
|
|
548
547
|
isLoading: ir,
|
|
549
548
|
isFetching: dt,
|
|
550
|
-
isPlaceholderData:
|
|
549
|
+
isPlaceholderData: Xa,
|
|
551
550
|
dataUpdatedAt: ce,
|
|
552
551
|
isError: cr,
|
|
553
|
-
error:
|
|
554
|
-
refetch:
|
|
552
|
+
error: Za,
|
|
553
|
+
refetch: el
|
|
555
554
|
} = W({
|
|
556
555
|
queryKey: [
|
|
557
556
|
"queue-items",
|
|
558
557
|
l,
|
|
559
558
|
g,
|
|
560
559
|
I,
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
560
|
+
Ee,
|
|
561
|
+
C === "table" && !$ ? de : "all",
|
|
562
|
+
$
|
|
564
563
|
],
|
|
565
564
|
queryFn: async () => {
|
|
566
|
-
const e = !
|
|
565
|
+
const e = !ve && C === "table", t = JSON.stringify([l, g, I, we, mn]), n = e ? Ho(Hn.current, t, de, "").after : void 0, r = await h.request(
|
|
567
566
|
L(`/queues/${l}/items`, {
|
|
568
567
|
scope: g,
|
|
569
568
|
// Last State Change is Aging read the other way round: the newest
|
|
570
569
|
// move is the least aged.
|
|
571
570
|
sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
|
|
572
|
-
filters: JSON.stringify(
|
|
571
|
+
filters: JSON.stringify(we),
|
|
573
572
|
// Table + group: headers only (rows load per group on expand, #741).
|
|
574
573
|
// Kanban renders the full matching set, grouped client-side.
|
|
575
|
-
...
|
|
576
|
-
group_by:
|
|
574
|
+
...ve ? {
|
|
575
|
+
group_by: $,
|
|
577
576
|
...lr.length ? { group_sums: lr.join(",") } : {}
|
|
578
|
-
} :
|
|
577
|
+
} : C === "table" ? { page: de, limit: mn, ...n ? { after: n } : {} } : {}
|
|
579
578
|
})
|
|
580
579
|
);
|
|
581
|
-
return n && Yo(
|
|
580
|
+
return n && Yo(Hn.current, t, de, r.next_cursor), r;
|
|
582
581
|
},
|
|
583
582
|
// Wait for display_config AND scope seeding so the first fetch uses the
|
|
584
583
|
// configured defaults and already carries the viewer's restricted filters.
|
|
@@ -587,22 +586,22 @@ function Xc({
|
|
|
587
586
|
// first fetch went out WITHOUT the seeded scope and refired ~350ms later
|
|
588
587
|
// with it (3.3s + 8.7s of work for one page). The first fetch now also
|
|
589
588
|
// waits for the debounced copy to settle; later typing still debounces.
|
|
590
|
-
enabled: !!l && J && tr && (
|
|
589
|
+
enabled: !!l && J && tr && (hn.current || Ba),
|
|
591
590
|
// Keep the previous page rendered while a sort/filter/page change refetches —
|
|
592
591
|
// swapping to skeletons collapsed the table height and jittered the page.
|
|
593
592
|
placeholderData: (e) => e
|
|
594
593
|
});
|
|
595
|
-
|
|
596
|
-
const
|
|
594
|
+
i && !hn.current && (hn.current = !0);
|
|
595
|
+
const We = Object.entries(me.current).filter(
|
|
597
596
|
([e, t]) => {
|
|
598
597
|
var n;
|
|
599
|
-
return !((n =
|
|
598
|
+
return !((n = Te[e.slice(6)]) != null && n.length) && JSON.stringify(we[e] ?? null) === JSON.stringify(t);
|
|
600
599
|
}
|
|
601
|
-
).map(([e]) => e), dr =
|
|
602
|
-
Object.entries(
|
|
603
|
-
), { data:
|
|
600
|
+
).map(([e]) => e), dr = We.length > 0 && Object.keys(we).every((e) => We.includes(e)), ur = Object.fromEntries(
|
|
601
|
+
Object.entries(we).filter(([e]) => !We.includes(e))
|
|
602
|
+
), { data: tl } = W({
|
|
604
603
|
queryKey: ["queue-default-hidden", l, g, ur],
|
|
605
|
-
enabled: !!l && !!
|
|
604
|
+
enabled: !!l && !!i && !dt && i.total === 0 && ((sa = i.empty) == null ? void 0 : sa.reason) === "filters" && We.length > 0 && !dr,
|
|
606
605
|
staleTime: 3e4,
|
|
607
606
|
retry: !1,
|
|
608
607
|
queryFn: () => h.request(
|
|
@@ -613,14 +612,14 @@ function Xc({
|
|
|
613
612
|
limit: 1
|
|
614
613
|
})
|
|
615
614
|
).then((e) => Number(e.total ?? 0))
|
|
616
|
-
}),
|
|
615
|
+
}), be = dr ? Math.max(0, (((ia = i == null ? void 0 : i.stats) == null ? void 0 : ia.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : tl ?? 0, mr = (e) => We.map(e).join(" and "), pr = () => {
|
|
617
616
|
Q((e) => {
|
|
618
617
|
const t = { ...e };
|
|
619
|
-
for (const n of
|
|
618
|
+
for (const n of We) delete t[n];
|
|
620
619
|
return t;
|
|
621
|
-
}),
|
|
620
|
+
}), A(1);
|
|
622
621
|
};
|
|
623
|
-
|
|
622
|
+
P(() => {
|
|
624
623
|
if (typeof window > "u" || !ce) return;
|
|
625
624
|
const e = window;
|
|
626
625
|
e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
|
|
@@ -629,19 +628,19 @@ function Xc({
|
|
|
629
628
|
at: ce,
|
|
630
629
|
scope: g,
|
|
631
630
|
sort: I,
|
|
632
|
-
filters: JSON.stringify(
|
|
631
|
+
filters: JSON.stringify(Ee),
|
|
633
632
|
page: de
|
|
634
633
|
}, r = t.find((o) => o.queue === l);
|
|
635
634
|
t.push(n), t.length > 50 && t.shift(), r && r !== n && ce - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
|
|
636
635
|
}, [ce]);
|
|
637
|
-
const
|
|
638
|
-
() => (
|
|
639
|
-
[
|
|
640
|
-
),
|
|
641
|
-
pending: dt && !
|
|
636
|
+
const He = ir && !i || !J || !tr && !i, br = (dt && !ir || Xa && dt) && !ue.current, nl = V(
|
|
637
|
+
() => (ve ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
638
|
+
[ve, i == null ? void 0 : i.data]
|
|
639
|
+
), rl = ms(nl), Qt = xi(), hr = Ko(dt && !ue.current), al = Po({
|
|
640
|
+
pending: dt && !ue.current,
|
|
642
641
|
request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
|
|
643
642
|
noun: "items"
|
|
644
|
-
}),
|
|
643
|
+
}), ll = us();
|
|
645
644
|
async function fr(e, t) {
|
|
646
645
|
var p;
|
|
647
646
|
const r = (await h.request(L(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
|
|
@@ -654,7 +653,7 @@ function Xc({
|
|
|
654
653
|
);
|
|
655
654
|
if (!s) throw new Error("No transition available to move this item here");
|
|
656
655
|
let m = null;
|
|
657
|
-
if (
|
|
656
|
+
if (yi(s) && (m = await Qt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
|
|
658
657
|
throw new Error("Not moved — this move needs a note");
|
|
659
658
|
await h.request(
|
|
660
659
|
se(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
|
|
@@ -663,7 +662,7 @@ function Xc({
|
|
|
663
662
|
})
|
|
664
663
|
);
|
|
665
664
|
}
|
|
666
|
-
const
|
|
665
|
+
const ol = $e({
|
|
667
666
|
mutationFn: async ({ item: e, targetState: t }) => {
|
|
668
667
|
await fr(e, t);
|
|
669
668
|
},
|
|
@@ -671,9 +670,9 @@ function Xc({
|
|
|
671
670
|
f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
672
671
|
},
|
|
673
672
|
onError: (e) => {
|
|
674
|
-
|
|
673
|
+
O.error(qt(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
675
674
|
}
|
|
676
|
-
}), Le =
|
|
675
|
+
}), Le = $e({
|
|
677
676
|
mutationFn: (e) => h.request(
|
|
678
677
|
se(`/queues/${l}/claim`, {
|
|
679
678
|
source_collection: e.collection,
|
|
@@ -681,8 +680,8 @@ function Xc({
|
|
|
681
680
|
})
|
|
682
681
|
),
|
|
683
682
|
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
684
|
-
onError: () =>
|
|
685
|
-
}),
|
|
683
|
+
onError: () => O.error("Failed to claim item")
|
|
684
|
+
}), Ye = $e({
|
|
686
685
|
mutationFn: (e) => h.request(
|
|
687
686
|
se(`/queues/${l}/release`, {
|
|
688
687
|
source_collection: e.collection,
|
|
@@ -690,27 +689,27 @@ function Xc({
|
|
|
690
689
|
})
|
|
691
690
|
),
|
|
692
691
|
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
693
|
-
onError: () =>
|
|
694
|
-
}), { data:
|
|
692
|
+
onError: () => O.error("Failed to release item")
|
|
693
|
+
}), { data: Je } = W({
|
|
695
694
|
queryKey: ["queue-column-prefs", l],
|
|
696
695
|
queryFn: () => h.request(L(`/queues/${l}/column-prefs`)),
|
|
697
696
|
enabled: !!l
|
|
698
|
-
}), [
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}, [
|
|
702
|
-
const [
|
|
703
|
-
(e) => Array.from({ length:
|
|
704
|
-
),
|
|
705
|
-
queries:
|
|
697
|
+
}), [Bt, jt] = v(null), [ze, yn] = v(null);
|
|
698
|
+
P(() => {
|
|
699
|
+
Je && yn(Je.data.default_view_id);
|
|
700
|
+
}, [Je]);
|
|
701
|
+
const [sl, gr] = v({}), he = ve ? (i == null ? void 0 : i.groups) ?? null : null, Ut = (he ?? []).filter((e) => !ke.has(e.key)).map((e) => e.key).flatMap(
|
|
702
|
+
(e) => Array.from({ length: sl[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
|
|
703
|
+
), kn = Be({
|
|
704
|
+
queries: Ut.map(({ key: e, page: t }) => ({
|
|
706
705
|
queryKey: [
|
|
707
706
|
"queue-items",
|
|
708
707
|
l,
|
|
709
708
|
"group-rows",
|
|
710
709
|
g,
|
|
711
710
|
I,
|
|
712
|
-
|
|
713
|
-
|
|
711
|
+
Ee,
|
|
712
|
+
$,
|
|
714
713
|
e,
|
|
715
714
|
t
|
|
716
715
|
],
|
|
@@ -718,117 +717,128 @@ function Xc({
|
|
|
718
717
|
L(`/queues/${l}/items`, {
|
|
719
718
|
scope: g,
|
|
720
719
|
sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
|
|
721
|
-
filters: JSON.stringify(
|
|
722
|
-
group_by:
|
|
720
|
+
filters: JSON.stringify(we),
|
|
721
|
+
group_by: $,
|
|
723
722
|
group_key: e,
|
|
724
723
|
page: t,
|
|
725
|
-
limit:
|
|
724
|
+
limit: vi
|
|
726
725
|
})
|
|
727
726
|
).then((n) => ({ key: e, rows: n.data })),
|
|
728
|
-
enabled: !!
|
|
727
|
+
enabled: !!i && ve,
|
|
729
728
|
placeholderData: (n) => n
|
|
730
729
|
}))
|
|
731
|
-
}),
|
|
730
|
+
}), il = kn.map((e) => e.dataUpdatedAt).join(","), vn = V(() => {
|
|
732
731
|
const e = /* @__PURE__ */ new Map();
|
|
733
|
-
return
|
|
732
|
+
return kn.forEach((t, n) => {
|
|
734
733
|
if (!t.data) return;
|
|
735
|
-
const r =
|
|
734
|
+
const r = Ut[n].key;
|
|
736
735
|
e.set(r, [...e.get(r) ?? [], ...t.data.rows]);
|
|
737
736
|
}), e;
|
|
738
|
-
}, [
|
|
739
|
-
|
|
740
|
-
), q =
|
|
737
|
+
}, [il, Ut.map((e) => `${e.key}\0${e.page}`).join("")]), cl = new Set(
|
|
738
|
+
kn.flatMap((e, t) => e.isFetching ? [Ut[t].key] : [])
|
|
739
|
+
), q = he ? [...vn.values()].flat() : (i == null ? void 0 : i.data) ?? [];
|
|
741
740
|
$s(
|
|
742
741
|
l ? {
|
|
743
742
|
queue: {
|
|
744
743
|
id: l,
|
|
745
|
-
label:
|
|
744
|
+
label: c == null ? void 0 : c.name,
|
|
746
745
|
scope: g,
|
|
747
|
-
filters: JSON.stringify(
|
|
746
|
+
filters: JSON.stringify(we),
|
|
748
747
|
items: q.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
|
|
749
748
|
}
|
|
750
749
|
} : null
|
|
751
750
|
);
|
|
752
|
-
const
|
|
753
|
-
queryKey: ["queue-live-stats", l, g,
|
|
751
|
+
const dl = qs(), ut = q.some((e) => e.fulfilment !== void 0), mt = q.some((e) => e.send_backs !== void 0), { data: pt, dataUpdatedAt: xr } = W({
|
|
752
|
+
queryKey: ["queue-live-stats", l, g, Ee, zn],
|
|
754
753
|
queryFn: () => h.request(
|
|
755
754
|
L(`/queues/${l}/items`, {
|
|
756
755
|
scope: g,
|
|
757
|
-
filters: JSON.stringify(
|
|
756
|
+
filters: JSON.stringify(we),
|
|
758
757
|
page: 1,
|
|
759
758
|
limit: 1
|
|
760
759
|
})
|
|
761
760
|
),
|
|
762
|
-
enabled:
|
|
761
|
+
enabled: zn > 0 && !!i,
|
|
763
762
|
staleTime: Number.POSITIVE_INFINITY,
|
|
764
763
|
placeholderData: (e) => e,
|
|
765
764
|
retry: !1
|
|
766
|
-
}),
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
765
|
+
}), It = !!pt && xr > ce, x = It ? pt.stats : i == null ? void 0 : i.stats, z = It ? pt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, yr = It ? pt.state_counts : i == null ? void 0 : i.state_counts;
|
|
766
|
+
P(() => {
|
|
767
|
+
!It || !ci({
|
|
768
|
+
liveTotal: pt.total,
|
|
769
|
+
rowsTotal: i == null ? void 0 : i.total,
|
|
770
|
+
table: C === "table" && !ve,
|
|
771
|
+
busy: dn.current > 0 || cn.current
|
|
772
|
+
}) || (ue.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l, g] }).finally(() => {
|
|
773
|
+
ue.current = !1;
|
|
774
|
+
}));
|
|
775
|
+
}, [xr]);
|
|
776
|
+
const wn = (ca = z ?? x) == null ? void 0 : ca.aging, kr = U(void 0);
|
|
777
|
+
!_.aging_hours && wn && (kr.current = wn);
|
|
778
|
+
const bt = _.aging_hours ? kr.current ?? (x == null ? void 0 : x.aging) : wn ?? (x == null ? void 0 : x.aging);
|
|
779
|
+
Jn.current = new Set(q.map((e) => `${e.collection}:${e.item_id}`));
|
|
780
|
+
const ht = os(
|
|
771
781
|
q.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
772
|
-
|
|
773
|
-
),
|
|
774
|
-
!
|
|
782
|
+
Oa
|
|
783
|
+
), vr = U(ce), wr = U(0);
|
|
784
|
+
!ue.current && ce !== wr.current && (vr.current = ce), P(() => {
|
|
775
785
|
const e = new Set(q.map((t) => `${t.collection}:${t.item_id}`));
|
|
776
|
-
if (
|
|
777
|
-
|
|
778
|
-
const t =
|
|
779
|
-
|
|
780
|
-
const n =
|
|
786
|
+
if (ue.current) {
|
|
787
|
+
ue.current = !1, wr.current = ce;
|
|
788
|
+
const t = At.current;
|
|
789
|
+
At.current = [];
|
|
790
|
+
const n = Xn.current, r = /* @__PURE__ */ new Set();
|
|
781
791
|
for (const o of t)
|
|
782
|
-
!e.has(o.key) || r.has(o.key) || (r.add(o.key),
|
|
792
|
+
!e.has(o.key) || r.has(o.key) || (r.add(o.key), Fe.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
|
|
783
793
|
if (n) {
|
|
784
794
|
const o = [...e].filter((s) => !n.has(s) && !r.has(s));
|
|
785
|
-
o.length > 0 && o.length <= 20 &&
|
|
795
|
+
o.length > 0 && o.length <= 20 && Fe.note(o, null, "create");
|
|
786
796
|
}
|
|
787
797
|
}
|
|
788
|
-
|
|
789
|
-
}, [ce]),
|
|
790
|
-
|
|
791
|
-
}, [
|
|
798
|
+
Xn.current = e;
|
|
799
|
+
}, [ce]), P(() => {
|
|
800
|
+
Lt(0);
|
|
801
|
+
}, [i]);
|
|
792
802
|
function ul() {
|
|
793
|
-
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }),
|
|
803
|
+
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Lt(0);
|
|
794
804
|
}
|
|
795
|
-
const { data:
|
|
805
|
+
const { data: fe } = W({
|
|
796
806
|
queryKey: ["queue-trends", l],
|
|
797
807
|
queryFn: () => h.request(L(`/queues/${l}/trends`, { days: 14 })),
|
|
798
808
|
enabled: !!l,
|
|
799
809
|
staleTime: 300 * 1e3
|
|
800
|
-
}), { data:
|
|
810
|
+
}), { data: ge } = W({
|
|
801
811
|
queryKey: ["queue-trends", l, "mine"],
|
|
802
812
|
queryFn: () => h.request(L(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
|
|
803
813
|
enabled: !!l && g === "mine",
|
|
804
814
|
staleTime: 300 * 1e3
|
|
805
815
|
});
|
|
806
|
-
function
|
|
807
|
-
const n = (g === "all" ?
|
|
816
|
+
function ft(e) {
|
|
817
|
+
const n = (g === "all" ? fe == null ? void 0 : fe.data : g === "mine" ? ge == null ? void 0 : ge.data : void 0) ?? [];
|
|
808
818
|
if (n.length === 0) return {};
|
|
809
819
|
const r = n.map((s) => s[e]), o = n[n.length - 1];
|
|
810
820
|
return { trend: r, delta: ((x == null ? void 0 : x[e]) ?? 0) - o[e] };
|
|
811
821
|
}
|
|
812
|
-
const
|
|
813
|
-
const t = (g === "all" ?
|
|
822
|
+
const xe = V(() => {
|
|
823
|
+
const t = (g === "all" ? fe == null ? void 0 : fe.data : g === "mine" ? ge == null ? void 0 : ge.data : void 0) ?? [];
|
|
814
824
|
if (t.length < 3 || !x) return null;
|
|
815
825
|
const n = t.map(
|
|
816
826
|
(m) => g === "mine" ? m.owned ?? m.total : m.total
|
|
817
827
|
), r = n.slice(1).map((m, p) => m - n[p]), o = r.reduce((m, p) => m + p, 0) / r.length, s = x.total;
|
|
818
828
|
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 };
|
|
819
|
-
}, [
|
|
829
|
+
}, [fe == null ? void 0 : fe.data, ge == null ? void 0 : ge.data, g, x]), gt = V(
|
|
820
830
|
() => [
|
|
821
831
|
...new Set(
|
|
822
|
-
((
|
|
832
|
+
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
823
833
|
)
|
|
824
834
|
],
|
|
825
|
-
[
|
|
835
|
+
[c == null ? void 0 : c.sources]
|
|
826
836
|
), { data: ml } = W({
|
|
827
837
|
queryKey: ["collections"],
|
|
828
838
|
queryFn: () => h.request(L("/collections")).then((e) => e.data),
|
|
829
839
|
staleTime: 300 * 1e3
|
|
830
|
-
}),
|
|
831
|
-
queries:
|
|
840
|
+
}), Xe = Be({
|
|
841
|
+
queries: gt.map((e) => ({
|
|
832
842
|
queryKey: ["queue-collection-addendums", e],
|
|
833
843
|
queryFn: () => h.request(
|
|
834
844
|
L(`/collections/${e}`)
|
|
@@ -838,39 +848,39 @@ function Xc({
|
|
|
838
848
|
}).catch(() => !1),
|
|
839
849
|
staleTime: 300 * 1e3
|
|
840
850
|
}))
|
|
841
|
-
}).some((e) => e.data === !0), { data:
|
|
851
|
+
}).some((e) => e.data === !0), { data: _n = [] } = W({
|
|
842
852
|
queryKey: ["queue-integrations-collections"],
|
|
843
853
|
queryFn: () => h.request(L("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
|
|
844
854
|
staleTime: 300 * 1e3
|
|
845
|
-
}),
|
|
855
|
+
}), _e = gt.some((e) => _n.includes(e)), Nn = V(() => {
|
|
846
856
|
var t;
|
|
847
857
|
const e = {};
|
|
848
|
-
if (!
|
|
858
|
+
if (!_e) return e;
|
|
849
859
|
for (const n of q) {
|
|
850
|
-
if (!
|
|
860
|
+
if (!_n.includes(n.collection)) continue;
|
|
851
861
|
const r = e[t = n.collection] ?? (e[t] = []);
|
|
852
862
|
r.length < 500 && r.push(n.item_id);
|
|
853
863
|
}
|
|
854
864
|
return e;
|
|
855
|
-
}, [q,
|
|
856
|
-
queries:
|
|
857
|
-
queryKey: ["queue-integrations-summary", e,
|
|
865
|
+
}, [q, _n, _e]), _r = Object.keys(Nn), Nr = Be({
|
|
866
|
+
queries: _r.map((e) => ({
|
|
867
|
+
queryKey: ["queue-integrations-summary", e, Nn[e].join(",")],
|
|
858
868
|
queryFn: () => h.request(
|
|
859
869
|
se("/integration-obligations/summary", {
|
|
860
870
|
collection: e,
|
|
861
|
-
ids:
|
|
871
|
+
ids: Nn[e]
|
|
862
872
|
})
|
|
863
873
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
864
874
|
staleTime: 3e4
|
|
865
875
|
}))
|
|
866
|
-
}), pl =
|
|
876
|
+
}), pl = Nr.map((e) => e.dataUpdatedAt).join(","), bl = V(() => {
|
|
867
877
|
const e = {};
|
|
868
|
-
return
|
|
878
|
+
return _r.forEach((t, n) => {
|
|
869
879
|
var o;
|
|
870
|
-
const r = ((o =
|
|
880
|
+
const r = ((o = Nr[n]) == null ? void 0 : o.data) ?? {};
|
|
871
881
|
for (const [s, m] of Object.entries(r)) e[`${t}:${s}`] = m;
|
|
872
882
|
}), e;
|
|
873
|
-
}, [pl]),
|
|
883
|
+
}, [pl]), Sn = V(() => {
|
|
874
884
|
var t;
|
|
875
885
|
const e = {};
|
|
876
886
|
for (const n of q) {
|
|
@@ -880,31 +890,31 @@ function Xc({
|
|
|
880
890
|
r.length < 500 && r.push(n.item_id);
|
|
881
891
|
}
|
|
882
892
|
return e;
|
|
883
|
-
}, [q]),
|
|
884
|
-
queries:
|
|
885
|
-
queryKey: ["queue-task-counts", e,
|
|
893
|
+
}, [q]), Cn = Object.keys(Sn), Sr = Be({
|
|
894
|
+
queries: Cn.map((e) => ({
|
|
895
|
+
queryKey: ["queue-task-counts", e, Sn[e].join(",")],
|
|
886
896
|
queryFn: () => h.request(
|
|
887
|
-
se("/tasks/counts", { collection: e, ids:
|
|
897
|
+
se("/tasks/counts", { collection: e, ids: Sn[e] })
|
|
888
898
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
889
899
|
staleTime: 3e4
|
|
890
900
|
}))
|
|
891
|
-
}), hl =
|
|
901
|
+
}), hl = Sr.map((e) => e.dataUpdatedAt).join(","), fl = V(() => {
|
|
892
902
|
const e = {};
|
|
893
|
-
return
|
|
903
|
+
return Cn.forEach((t, n) => {
|
|
894
904
|
var r;
|
|
895
|
-
for (const [o, s] of Object.entries(((r =
|
|
905
|
+
for (const [o, s] of Object.entries(((r = Sr[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = s;
|
|
896
906
|
}), e;
|
|
897
|
-
}, [hl]),
|
|
898
|
-
queries:
|
|
907
|
+
}, [hl]), Cr = Cn.length > 0, $r = Be({
|
|
908
|
+
queries: gt.map((e) => ({
|
|
899
909
|
queryKey: ["queue-collection-risk-rules", e],
|
|
900
910
|
queryFn: () => h.request(
|
|
901
911
|
L("/at-risk/rules/active", { collection: e })
|
|
902
912
|
).then((t) => t.data ?? []).catch(() => []),
|
|
903
913
|
staleTime: 300 * 1e3
|
|
904
914
|
}))
|
|
905
|
-
}), gl =
|
|
915
|
+
}), gl = $r.map((e) => e.dataUpdatedAt).join(","), qr = V(() => {
|
|
906
916
|
const e = /* @__PURE__ */ new Map();
|
|
907
|
-
for (const t of
|
|
917
|
+
for (const t of $r)
|
|
908
918
|
for (const n of t.data ?? []) {
|
|
909
919
|
const r = e.get(n.name);
|
|
910
920
|
e.set(n.name, {
|
|
@@ -913,65 +923,65 @@ function Xc({
|
|
|
913
923
|
});
|
|
914
924
|
}
|
|
915
925
|
return [...e.values()];
|
|
916
|
-
}, [gl]),
|
|
917
|
-
queries:
|
|
926
|
+
}, [gl]), Fr = Be({
|
|
927
|
+
queries: gt.map((e) => ({
|
|
918
928
|
queryKey: ["queue-collection-states", e],
|
|
919
929
|
queryFn: () => h.request(
|
|
920
930
|
L(`/queues/collection-states/${e}`)
|
|
921
931
|
).then((t) => t.data),
|
|
922
932
|
staleTime: 300 * 1e3
|
|
923
933
|
}))
|
|
924
|
-
}),
|
|
934
|
+
}), Tr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), Ne = V(() => {
|
|
925
935
|
const e = {};
|
|
926
|
-
for (const t of
|
|
936
|
+
for (const t of Fr)
|
|
927
937
|
(t.data ?? []).forEach((n, r) => {
|
|
928
938
|
e[n.key] = { label: n.label, color: n.color, sort: r };
|
|
929
939
|
});
|
|
930
940
|
return e;
|
|
931
|
-
}, [
|
|
941
|
+
}, [Fr.map((e) => e.data)]), Rr = x ? Object.entries(x.by_state).sort(
|
|
932
942
|
(e, t) => {
|
|
933
943
|
var n, r;
|
|
934
|
-
return (((n =
|
|
944
|
+
return (((n = Ne[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = Ne[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
935
945
|
}
|
|
936
|
-
) : [],
|
|
946
|
+
) : [], Er = (e) => [...e].sort(
|
|
937
947
|
(t, n) => {
|
|
938
948
|
var r, o;
|
|
939
|
-
return (((r =
|
|
949
|
+
return (((r = Ne[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = Ne[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
940
950
|
}
|
|
941
|
-
),
|
|
951
|
+
), $n = V(() => {
|
|
942
952
|
const e = {};
|
|
943
|
-
for (const [t, n] of Object.entries(
|
|
953
|
+
for (const [t, n] of Object.entries(Ne)) e[t] = n.label;
|
|
944
954
|
return e;
|
|
945
|
-
}, [
|
|
946
|
-
if (e ===
|
|
955
|
+
}, [Ne]), Ae = (e) => e ? e === "none" ? "No State" : $n[e] ?? Tr(e) : "—", xt = (e) => {
|
|
956
|
+
if (e === tn) return "Addendums";
|
|
947
957
|
const t = (ml ?? []).find((n) => n.collection === e);
|
|
948
|
-
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) ||
|
|
949
|
-
}, le = V(() =>
|
|
958
|
+
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Tr(e);
|
|
959
|
+
}, le = V(() => $ ? he ? he.map((e) => ({
|
|
950
960
|
key: e.key,
|
|
951
|
-
rows:
|
|
961
|
+
rows: vn.get(e.key) ?? [],
|
|
952
962
|
breached: e.breached,
|
|
953
963
|
atRisk: e.at_risk,
|
|
954
964
|
count: e.count,
|
|
955
965
|
sums: e.sums ?? {}
|
|
956
|
-
})) : bs(q,
|
|
957
|
-
|
|
958
|
-
if (
|
|
959
|
-
|
|
966
|
+
})) : bs(q, $).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [q, $, he, vn]), qn = U(null);
|
|
967
|
+
P(() => {
|
|
968
|
+
if (!$ || !le) {
|
|
969
|
+
qn.current = null;
|
|
960
970
|
return;
|
|
961
971
|
}
|
|
962
|
-
if (
|
|
963
|
-
|
|
972
|
+
if (ve && !he || qn.current === $) return;
|
|
973
|
+
qn.current = $;
|
|
964
974
|
const e = le.reduce((t, n) => t + n.count, 0);
|
|
965
|
-
|
|
966
|
-
}, [
|
|
975
|
+
nn(e > 200 ? new Set(le.map((t) => t.key)) : /* @__PURE__ */ new Set()), gr({});
|
|
976
|
+
}, [$, he]);
|
|
967
977
|
function xl(e) {
|
|
968
|
-
|
|
978
|
+
nn((t) => {
|
|
969
979
|
const n = new Set(t);
|
|
970
980
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
971
981
|
});
|
|
972
982
|
}
|
|
973
|
-
const oe = V(() => le ? le.filter((e) => !
|
|
974
|
-
if (e.collection ===
|
|
983
|
+
const oe = V(() => le ? le.filter((e) => !ke.has(e.key)).flatMap((e) => e.rows) : q, [le, q, ke]), D = (e) => `${e.collection}:${e.item_id}`, [Se, Oe] = v(null), [yl, Fn] = v(!1), [Vt, Gt] = v(null), Tn = (e) => {
|
|
984
|
+
if (e.collection === tn && e.url) {
|
|
975
985
|
const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
|
|
976
986
|
if (t) {
|
|
977
987
|
const n = {};
|
|
@@ -989,35 +999,35 @@ function Xc({
|
|
|
989
999
|
itemId: e.item_id,
|
|
990
1000
|
layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
|
|
991
1001
|
};
|
|
992
|
-
},
|
|
1002
|
+
}, yt = (e) => {
|
|
993
1003
|
var t;
|
|
994
|
-
|
|
1004
|
+
c && Ta({
|
|
995
1005
|
queue_id: l,
|
|
996
|
-
name:
|
|
1006
|
+
name: c.name,
|
|
997
1007
|
path: `${window.location.pathname}${window.location.search}`,
|
|
998
1008
|
at: Date.now(),
|
|
999
|
-
scroll: ((t =
|
|
1000
|
-
state: { scope: g, page: de, sort: I, filters: _, group_by:
|
|
1001
|
-
}), H.open(
|
|
1002
|
-
}, [B,
|
|
1009
|
+
scroll: ((t = Ht.current) == null ? void 0 : t.scrollTop) ?? 0,
|
|
1010
|
+
state: { scope: g, page: de, sort: I, filters: _, group_by: $, view: C }
|
|
1011
|
+
}), H.open(Tn(e));
|
|
1012
|
+
}, [B, kt] = v(
|
|
1003
1013
|
null
|
|
1004
1014
|
);
|
|
1005
|
-
|
|
1015
|
+
P(() => {
|
|
1006
1016
|
if (!B) return;
|
|
1007
|
-
const e = () =>
|
|
1017
|
+
const e = () => kt(null);
|
|
1008
1018
|
return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
|
|
1009
1019
|
window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
|
|
1010
1020
|
};
|
|
1011
1021
|
}, [B]);
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1022
|
+
const Wt = (e) => {
|
|
1023
|
+
Gt(D(e));
|
|
1014
1024
|
const t = (u == null ? void 0 : u.row_click) ?? "preview";
|
|
1015
|
-
if (t === "full" || e.collection ===
|
|
1016
|
-
|
|
1025
|
+
if (t === "full" || e.collection === tn) {
|
|
1026
|
+
yt(e);
|
|
1017
1027
|
return;
|
|
1018
1028
|
}
|
|
1019
1029
|
if (t === "layout") {
|
|
1020
|
-
|
|
1030
|
+
Hr({
|
|
1021
1031
|
collection: e.collection,
|
|
1022
1032
|
itemId: e.item_id,
|
|
1023
1033
|
rootLayoutSlug: (u == null ? void 0 : u.item_layout) ?? null,
|
|
@@ -1028,82 +1038,82 @@ function Xc({
|
|
|
1028
1038
|
}
|
|
1029
1039
|
Oe(e);
|
|
1030
1040
|
};
|
|
1031
|
-
|
|
1032
|
-
if (!
|
|
1033
|
-
const e = q.find((t) =>
|
|
1034
|
-
e && e !==
|
|
1041
|
+
P(() => {
|
|
1042
|
+
if (!Se) return;
|
|
1043
|
+
const e = q.find((t) => D(t) === D(Se));
|
|
1044
|
+
e && e !== Se && Oe(e);
|
|
1035
1045
|
}, [q]);
|
|
1036
1046
|
const kl = (e) => !e.claimed_by || e.claimed_by.id === N;
|
|
1037
|
-
function
|
|
1038
|
-
const t = e ? oe.findIndex((r) =>
|
|
1047
|
+
function Lr(e) {
|
|
1048
|
+
const t = e ? oe.findIndex((r) => D(r) === D(e)) + 1 : 0, n = oe.slice(t).find(kl);
|
|
1039
1049
|
if (!n) {
|
|
1040
|
-
|
|
1050
|
+
Fn(!1), Oe(null), O.info("Nothing left to work on — queue clear!");
|
|
1041
1051
|
return;
|
|
1042
1052
|
}
|
|
1043
|
-
if (
|
|
1044
|
-
|
|
1053
|
+
if (Gt(D(n)), pe && !n.claimed_by && Le.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
|
|
1054
|
+
yt(n);
|
|
1045
1055
|
return;
|
|
1046
1056
|
}
|
|
1047
|
-
|
|
1057
|
+
Fn(!0), Oe(n);
|
|
1048
1058
|
}
|
|
1049
|
-
|
|
1050
|
-
if (
|
|
1059
|
+
P(() => {
|
|
1060
|
+
if (C !== "table") return;
|
|
1051
1061
|
function e(t) {
|
|
1052
1062
|
var o;
|
|
1053
1063
|
const n = t.target;
|
|
1054
1064
|
if (n && (n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.tagName === "SELECT" || n.isContentEditable))
|
|
1055
1065
|
return;
|
|
1056
|
-
const r =
|
|
1066
|
+
const r = Vt ? oe.findIndex((s) => D(s) === Vt) : -1;
|
|
1057
1067
|
if (t.key === "j" || t.key === "ArrowDown") {
|
|
1058
1068
|
t.preventDefault();
|
|
1059
1069
|
const s = oe[Math.min(r + 1, oe.length - 1)];
|
|
1060
|
-
s &&
|
|
1070
|
+
s && Gt(D(s));
|
|
1061
1071
|
} else if (t.key === "k" || t.key === "ArrowUp") {
|
|
1062
1072
|
t.preventDefault();
|
|
1063
1073
|
const s = oe[Math.max(r - 1, 0)];
|
|
1064
|
-
s &&
|
|
1065
|
-
} else if (t.key === "Enter" && r >= 0 && !
|
|
1066
|
-
t.preventDefault(),
|
|
1067
|
-
else if (t.key === "c" && r >= 0 &&
|
|
1074
|
+
s && Gt(D(s));
|
|
1075
|
+
} else if (t.key === "Enter" && r >= 0 && !Se)
|
|
1076
|
+
t.preventDefault(), Wt(oe[r]);
|
|
1077
|
+
else if (t.key === "c" && r >= 0 && pe) {
|
|
1068
1078
|
t.preventDefault();
|
|
1069
1079
|
const s = oe[r];
|
|
1070
|
-
((o = s.claimed_by) == null ? void 0 : o.id) === N ?
|
|
1071
|
-
} else t.key === "o" && r >= 0 && (t.preventDefault(),
|
|
1080
|
+
((o = s.claimed_by) == null ? void 0 : o.id) === N ? Ye.mutate(s) : Le.mutate(s);
|
|
1081
|
+
} else t.key === "o" && r >= 0 && (t.preventDefault(), yt(oe[r]));
|
|
1072
1082
|
}
|
|
1073
1083
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1074
|
-
}, [
|
|
1084
|
+
}, [C, oe, Vt, Se, N, Le, Ye, pe]);
|
|
1075
1085
|
const { data: j } = W({
|
|
1076
1086
|
queryKey: ["queue-views", l],
|
|
1077
1087
|
queryFn: () => h.request(L(`/queues/${l}/views`)),
|
|
1078
1088
|
enabled: !!l
|
|
1079
|
-
}), [
|
|
1080
|
-
function
|
|
1089
|
+
}), [Ze, et] = v(null), [vl, Rn] = v(!1), [En, Ar] = v(""), [Or, Dr] = v(!1), [vt, Kr] = v(!1);
|
|
1090
|
+
function wt(e) {
|
|
1081
1091
|
const t = e.state ?? {};
|
|
1082
|
-
Y(t.scope ?? "all"), Q({ ...
|
|
1092
|
+
Y(t.scope ?? "all"), Q({ ...me.current, ...t.filters ?? {} }), Ie(t.sort ?? ""), ot(t.group_by ?? null), jt(t.columns ?? null), an(t.pins ?? null), t.view && Ue(Re.includes(t.view) ? t.view : Re[0]), A(1), et(e.id);
|
|
1083
1093
|
}
|
|
1084
1094
|
function wl() {
|
|
1085
1095
|
var t, n;
|
|
1086
1096
|
const e = j == null ? void 0 : j.data.find((r) => r.is_default);
|
|
1087
1097
|
if (e) {
|
|
1088
|
-
|
|
1098
|
+
wt(e);
|
|
1089
1099
|
return;
|
|
1090
1100
|
}
|
|
1091
|
-
Y(((t =
|
|
1101
|
+
Y(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), Q({ ...me.current }), Ie(""), ot(null), jt(null), an(null), (n = c == null ? void 0 : c.display_config) != null && n.default_view && Ue(c.display_config.default_view), A(1), et(null);
|
|
1092
1102
|
}
|
|
1093
|
-
|
|
1094
|
-
if (J || !(
|
|
1095
|
-
const e =
|
|
1096
|
-
t ?
|
|
1097
|
-
}, [
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1103
|
+
P(() => {
|
|
1104
|
+
if (J || !(c != null && c.display_config) || Je === void 0 || j === void 0) return;
|
|
1105
|
+
const e = Je.data.default_view_id, t = e != null ? j.data.find((r) => r.id === e) : void 0, n = j.data.find((r) => r.is_default);
|
|
1106
|
+
t ? wt(t) : n ? wt(n) : (Ue(c.display_config.default_view), Y(c.display_config.default_scope)), Qa(!0);
|
|
1107
|
+
}, [c, Je, j, J]);
|
|
1108
|
+
const Ht = U(null), Yt = U(null);
|
|
1109
|
+
P(() => {
|
|
1100
1110
|
if (!J) return;
|
|
1101
1111
|
const e = Us();
|
|
1102
1112
|
if (!(e != null && e.restore) || e.queue_id !== l) return;
|
|
1103
|
-
|
|
1113
|
+
Ta({ ...e, restore: !1 });
|
|
1104
1114
|
const t = e.state ?? {};
|
|
1105
|
-
t.scope && Y(t.scope), t.filters && Q({ ...
|
|
1106
|
-
}, [J, l]),
|
|
1115
|
+
t.scope && Y(t.scope), t.filters && Q({ ...me.current, ...t.filters }), t.sort != null && Ie(t.sort), ot(t.group_by ?? null), t.view && Ue(t.view), t.page && A(t.page), Yt.current = e.scroll ?? 0;
|
|
1116
|
+
}, [J, l]), P(() => {
|
|
1107
1117
|
var s;
|
|
1108
1118
|
if (!J || typeof window > "u") return;
|
|
1109
1119
|
const e = new URLSearchParams(window.location.search), t = e.get("scope"), n = ((s = e.get("state")) == null ? void 0 : s.trim()) || null, r = t === "all" || t === "mine";
|
|
@@ -1114,8 +1124,8 @@ function Xc({
|
|
|
1114
1124
|
window.history.state,
|
|
1115
1125
|
"",
|
|
1116
1126
|
`${window.location.pathname}${o ? `?${o}` : ""}${window.location.hash}`
|
|
1117
|
-
), r && Y(t), n && Q((m) => ({ ...m, state: [n] })),
|
|
1118
|
-
}, [J]),
|
|
1127
|
+
), r && Y(t), n && Q((m) => ({ ...m, state: [n] })), A(1);
|
|
1128
|
+
}, [J]), P(() => {
|
|
1119
1129
|
if (!J || typeof window > "u") return;
|
|
1120
1130
|
const e = new URLSearchParams(window.location.search), t = e.get("owner");
|
|
1121
1131
|
if (!t) return;
|
|
@@ -1125,140 +1135,140 @@ function Xc({
|
|
|
1125
1135
|
window.history.state,
|
|
1126
1136
|
"",
|
|
1127
1137
|
`${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
|
|
1128
|
-
), Y("all"), Q((r) => ({ ...r, owners: [t] })),
|
|
1129
|
-
}, [J]),
|
|
1138
|
+
), Y("all"), Q((r) => ({ ...r, owners: [t] })), et(null), A(1);
|
|
1139
|
+
}, [J]), P(() => {
|
|
1130
1140
|
if (!J) return;
|
|
1131
1141
|
const e = ts(ns(`queue:${l}`));
|
|
1132
|
-
e && (rs(),
|
|
1142
|
+
e && (rs(), wt({
|
|
1133
1143
|
id: -1,
|
|
1134
1144
|
// Saved views type filters loosely as strings; multi-selects ride as arrays there too.
|
|
1135
1145
|
state: e
|
|
1136
|
-
}),
|
|
1146
|
+
}), et(null), e.page && A(e.page));
|
|
1137
1147
|
}, [J]);
|
|
1138
1148
|
const _l = () => ({
|
|
1139
1149
|
scope: g,
|
|
1140
1150
|
filters: _,
|
|
1141
1151
|
sort: I,
|
|
1142
|
-
group_by:
|
|
1143
|
-
view:
|
|
1144
|
-
columns:
|
|
1152
|
+
group_by: $,
|
|
1153
|
+
view: C,
|
|
1154
|
+
columns: Bt,
|
|
1145
1155
|
pins: it,
|
|
1146
1156
|
...de > 1 ? { page: de } : {}
|
|
1147
1157
|
});
|
|
1148
|
-
|
|
1149
|
-
|
|
1158
|
+
P(() => {
|
|
1159
|
+
Yt.current == null || q.length === 0 || !Ht.current || (Ht.current.scrollTop = Yt.current, Yt.current = null);
|
|
1150
1160
|
}, [q]);
|
|
1151
|
-
const { isAdmin: De } =
|
|
1161
|
+
const { isAdmin: De } = Ca(), Nl = q.map((e) => `${e.collection}|${e.item_id}`).join(","), Sl = V(
|
|
1152
1162
|
() => q.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
1153
1163
|
[Nl]
|
|
1154
|
-
),
|
|
1164
|
+
), Pr = Ys(Sl, De), Cl = (e) => Vt === D(e) ? (
|
|
1155
1165
|
// Pinned sticky cells use bg-inherit — the highlight must be
|
|
1156
1166
|
// OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
|
|
1157
1167
|
// scrolled content bleeds through the pinned columns. Same
|
|
1158
1168
|
// pair DataTable uses for selected rows when pins are active.
|
|
1159
1169
|
"bg-[#f2fdff] dark:bg-[#20303a]"
|
|
1160
|
-
) : e.at_risk ? ys(e.at_risk_color ?? "red") : void 0,
|
|
1161
|
-
mutationFn: ({ viewId: e, on: t }) => h.request(
|
|
1170
|
+
) : e.at_risk ? ys(e.at_risk_color ?? "red") : void 0, Jt = De || (c == null ? void 0 : c.owner) != null && c.owner === N, $l = $e({
|
|
1171
|
+
mutationFn: ({ viewId: e, on: t }) => h.request($a(`/queues/views/${e}`, { is_default: t })),
|
|
1162
1172
|
onSuccess: () => {
|
|
1163
|
-
f.invalidateQueries({ queryKey: ["queue-views", l] }),
|
|
1173
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("Queue default view updated");
|
|
1164
1174
|
},
|
|
1165
|
-
onError: () =>
|
|
1166
|
-
}),
|
|
1175
|
+
onError: () => O.error("Could not update the queue default view")
|
|
1176
|
+
}), Mr = $e({
|
|
1167
1177
|
mutationFn: () => h.request(
|
|
1168
1178
|
se(`/queues/${l}/views`, {
|
|
1169
|
-
name:
|
|
1170
|
-
is_shared:
|
|
1171
|
-
is_default:
|
|
1179
|
+
name: En.trim(),
|
|
1180
|
+
is_shared: Jt && (Or || vt),
|
|
1181
|
+
is_default: vt,
|
|
1172
1182
|
state: {
|
|
1173
1183
|
scope: g,
|
|
1174
1184
|
filters: _,
|
|
1175
1185
|
sort: I,
|
|
1176
|
-
group_by:
|
|
1177
|
-
view:
|
|
1178
|
-
columns:
|
|
1186
|
+
group_by: $,
|
|
1187
|
+
view: C,
|
|
1188
|
+
columns: Bt,
|
|
1179
1189
|
pins: it
|
|
1180
1190
|
}
|
|
1181
1191
|
})
|
|
1182
1192
|
),
|
|
1183
1193
|
onSuccess: (e) => {
|
|
1184
|
-
|
|
1194
|
+
Rn(!1), Ar(""), Dr(!1), Kr(!1), et(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("View saved");
|
|
1185
1195
|
},
|
|
1186
|
-
onError: () =>
|
|
1187
|
-
}), [
|
|
1196
|
+
onError: () => O.error("Failed to save view")
|
|
1197
|
+
}), [Qr, Br] = v(null), Ke = $e({
|
|
1188
1198
|
mutationFn: (e) => h.request(
|
|
1189
|
-
|
|
1199
|
+
$a(`/queues/views/${e.id}`, {
|
|
1190
1200
|
state: {
|
|
1191
1201
|
scope: g,
|
|
1192
1202
|
filters: _,
|
|
1193
1203
|
sort: I,
|
|
1194
|
-
group_by:
|
|
1195
|
-
view:
|
|
1196
|
-
columns:
|
|
1204
|
+
group_by: $,
|
|
1205
|
+
view: C,
|
|
1206
|
+
columns: Bt,
|
|
1197
1207
|
pins: it
|
|
1198
1208
|
}
|
|
1199
1209
|
})
|
|
1200
1210
|
),
|
|
1201
1211
|
onSuccess: (e, t) => {
|
|
1202
|
-
f.invalidateQueries({ queryKey: ["queue-views", l] }),
|
|
1212
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), Br(t.id), setTimeout(() => Br((n) => n === t.id ? null : n), 2e3), O.success(`Saved "${t.name}" with the current filters, scope and sort`);
|
|
1203
1213
|
},
|
|
1204
|
-
onError: () =>
|
|
1205
|
-
}), [
|
|
1206
|
-
|
|
1207
|
-
if (
|
|
1208
|
-
const e = setTimeout(() =>
|
|
1214
|
+
onError: () => O.error("Failed to update view")
|
|
1215
|
+
}), [Ln, zt] = v(null);
|
|
1216
|
+
P(() => {
|
|
1217
|
+
if (Ln == null) return;
|
|
1218
|
+
const e = setTimeout(() => zt(null), 5e3);
|
|
1209
1219
|
return () => clearTimeout(e);
|
|
1210
|
-
}, [
|
|
1211
|
-
const
|
|
1212
|
-
mutationFn: (e) => h.request(
|
|
1220
|
+
}, [Ln]);
|
|
1221
|
+
const jr = $e({
|
|
1222
|
+
mutationFn: (e) => h.request(In(`/queues/views/${e}`)),
|
|
1213
1223
|
onSuccess: (e, t) => {
|
|
1214
|
-
|
|
1224
|
+
zt(null), f.invalidateQueries({ queryKey: ["queue-views", l] }), et(null), ze === t && yn(null);
|
|
1215
1225
|
},
|
|
1216
|
-
onError: () =>
|
|
1217
|
-
}), ql =
|
|
1226
|
+
onError: () => O.error("Failed to delete view")
|
|
1227
|
+
}), ql = $e({
|
|
1218
1228
|
mutationFn: (e) => h.request(Qo(`/queues/${l}/default-view`, { view_id: e })),
|
|
1219
|
-
onMutate: (e) =>
|
|
1229
|
+
onMutate: (e) => yn(e),
|
|
1220
1230
|
onSuccess: (e, t) => {
|
|
1221
|
-
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }),
|
|
1231
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.success(
|
|
1222
1232
|
t === null ? "Reverted to the general default" : "Set as your default view"
|
|
1223
1233
|
);
|
|
1224
1234
|
},
|
|
1225
1235
|
onError: () => {
|
|
1226
|
-
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }),
|
|
1236
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.error("Failed to update default view");
|
|
1227
1237
|
}
|
|
1228
|
-
}), [Pe,
|
|
1229
|
-
ee &&
|
|
1238
|
+
}), [Pe, tt] = v([]), [ee, Ur] = v(!1), Fl = () => {
|
|
1239
|
+
ee && tt([]), Ur(!ee);
|
|
1230
1240
|
};
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
}, [
|
|
1234
|
-
const [
|
|
1235
|
-
async function
|
|
1236
|
-
const n = q.filter((m) => Pe.includes(
|
|
1237
|
-
|
|
1241
|
+
P(() => {
|
|
1242
|
+
C !== "table" && ee && (Ur(!1), tt([]));
|
|
1243
|
+
}, [C, ee]), Mo(), dn.current = Pe.length;
|
|
1244
|
+
const [Ir, Vr] = v(!1);
|
|
1245
|
+
async function An(e, t) {
|
|
1246
|
+
const n = q.filter((m) => Pe.includes(D(m)));
|
|
1247
|
+
Vr(!0), Qt.beginBatch();
|
|
1238
1248
|
const r = await Promise.allSettled(n.map(t));
|
|
1239
|
-
|
|
1249
|
+
Qt.endBatch();
|
|
1240
1250
|
const o = r.filter((m) => m.status === "fulfilled").length, s = r.length - o;
|
|
1241
|
-
|
|
1251
|
+
Vr(!1), tt([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? O.warning(`${e}: ${o} succeeded, ${s} failed`) : O.success(`${e}: ${o} succeeded`);
|
|
1242
1252
|
}
|
|
1243
1253
|
const Me = (e) => {
|
|
1244
1254
|
var t;
|
|
1245
|
-
for (const n of (
|
|
1255
|
+
for (const n of (c == null ? void 0 : c.sources) ?? []) {
|
|
1246
1256
|
const r = (t = n.column_formats) == null ? void 0 : t[e];
|
|
1247
1257
|
if (r) return r;
|
|
1248
1258
|
}
|
|
1249
1259
|
return null;
|
|
1250
1260
|
}, Tl = (e) => {
|
|
1251
|
-
if (
|
|
1252
|
-
if (
|
|
1253
|
-
if (
|
|
1254
|
-
const t = Me(
|
|
1255
|
-
if (t) return
|
|
1261
|
+
if ($ === "state") return e === "No state" ? e : Ae(e);
|
|
1262
|
+
if ($ === "collection") return xt(e);
|
|
1263
|
+
if ($ != null && $.startsWith("extra.") && e !== "—") {
|
|
1264
|
+
const t = Me($.slice(6));
|
|
1265
|
+
if (t) return nt(e, t);
|
|
1256
1266
|
}
|
|
1257
1267
|
return e;
|
|
1258
1268
|
}, Rl = le == null ? void 0 : le.map((e) => ({
|
|
1259
1269
|
key: e.key,
|
|
1260
1270
|
rows: e.rows,
|
|
1261
|
-
header: /* @__PURE__ */ d(
|
|
1271
|
+
header: /* @__PURE__ */ d(qe, { children: [
|
|
1262
1272
|
/* @__PURE__ */ a("span", { children: Tl(e.key) }),
|
|
1263
1273
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
1264
1274
|
"(",
|
|
@@ -1273,17 +1283,17 @@ function Xc({
|
|
|
1273
1283
|
className: "font-normal tabular-nums text-slate-500 dark:text-slate-400",
|
|
1274
1284
|
"data-queue-group-sum": t,
|
|
1275
1285
|
children: [
|
|
1276
|
-
|
|
1286
|
+
T(`extra.${t}`, je(t)),
|
|
1277
1287
|
":",
|
|
1278
1288
|
" ",
|
|
1279
|
-
r ?
|
|
1289
|
+
r ? nt(String(n), r) : ie(n)
|
|
1280
1290
|
]
|
|
1281
1291
|
},
|
|
1282
1292
|
t
|
|
1283
1293
|
);
|
|
1284
1294
|
}),
|
|
1285
|
-
|
|
1286
|
-
|
|
1295
|
+
he && !ke.has(e.key) && cl.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
|
|
1296
|
+
he && !ke.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
|
|
1287
1297
|
"button",
|
|
1288
1298
|
{
|
|
1289
1299
|
type: "button",
|
|
@@ -1310,32 +1320,32 @@ function Xc({
|
|
|
1310
1320
|
" at risk"
|
|
1311
1321
|
] })
|
|
1312
1322
|
] })
|
|
1313
|
-
})),
|
|
1314
|
-
...
|
|
1323
|
+
})), On = (((da = i == null ? void 0 : i.available_values.collection) == null ? void 0 : da.length) ?? 0) > 1, Gr = q.some((e) => !!e.unseen) || ht.size > 0 || q.some((e) => Fe.isNew(D(e))), Wr = [
|
|
1324
|
+
...On ? [
|
|
1315
1325
|
{
|
|
1316
1326
|
key: "collection",
|
|
1317
|
-
header:
|
|
1327
|
+
header: T("collection", "Collection"),
|
|
1318
1328
|
sortable: !0,
|
|
1319
|
-
render: (e) => /* @__PURE__ */ a(ri, { variant: "outline", children:
|
|
1329
|
+
render: (e) => /* @__PURE__ */ a(ri, { variant: "outline", children: xt(e.collection) })
|
|
1320
1330
|
}
|
|
1321
1331
|
] : [],
|
|
1322
1332
|
{
|
|
1323
1333
|
key: "label",
|
|
1324
|
-
header:
|
|
1334
|
+
header: T("label", "Item"),
|
|
1325
1335
|
sortable: !0,
|
|
1326
1336
|
// Room in the left padding for the hanging unseen mark (#643).
|
|
1327
|
-
className:
|
|
1328
|
-
headerClassName:
|
|
1337
|
+
className: Gr ? "pl-[30px]" : void 0,
|
|
1338
|
+
headerClassName: Gr ? "pl-[30px]" : void 0,
|
|
1329
1339
|
render: (e) => (
|
|
1330
1340
|
// Underlined because clicking opens the item. The row is clickable as
|
|
1331
1341
|
// a whole, but nothing on it said so — an underline is the one
|
|
1332
1342
|
// convention people already read as "this goes somewhere".
|
|
1333
1343
|
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
1334
|
-
|
|
1344
|
+
ht.get(D(e)) || Fe.isNew(D(e)) ? /* @__PURE__ */ a(
|
|
1335
1345
|
Vs,
|
|
1336
1346
|
{
|
|
1337
|
-
lock:
|
|
1338
|
-
isNew:
|
|
1347
|
+
lock: ht.get(D(e)),
|
|
1348
|
+
isNew: Fe.isNew(D(e)),
|
|
1339
1349
|
dataAttr: "data-queue-live-mark",
|
|
1340
1350
|
hang: !0
|
|
1341
1351
|
}
|
|
@@ -1360,7 +1370,7 @@ function Xc({
|
|
|
1360
1370
|
/* @__PURE__ */ a(
|
|
1361
1371
|
ti,
|
|
1362
1372
|
{
|
|
1363
|
-
viewers:
|
|
1373
|
+
viewers: rl[ps(e.collection, e.item_id)],
|
|
1364
1374
|
dataAttr: "data-queue-presence"
|
|
1365
1375
|
}
|
|
1366
1376
|
)
|
|
@@ -1369,7 +1379,7 @@ function Xc({
|
|
|
1369
1379
|
},
|
|
1370
1380
|
{
|
|
1371
1381
|
key: "state",
|
|
1372
|
-
header:
|
|
1382
|
+
header: T("state", "State"),
|
|
1373
1383
|
sortable: !0,
|
|
1374
1384
|
render: (e) => e.state ? /* @__PURE__ */ d(
|
|
1375
1385
|
"span",
|
|
@@ -1389,33 +1399,33 @@ function Xc({
|
|
|
1389
1399
|
},
|
|
1390
1400
|
{
|
|
1391
1401
|
key: "owners",
|
|
1392
|
-
header:
|
|
1402
|
+
header: T("owners", "Owners"),
|
|
1393
1403
|
sortable: !0,
|
|
1394
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1404
|
+
render: (e) => /* @__PURE__ */ a(mi, { owners: e.owners })
|
|
1395
1405
|
},
|
|
1396
1406
|
{
|
|
1397
1407
|
key: "aging_hours",
|
|
1398
|
-
header:
|
|
1408
|
+
header: T("aging_hours", "Aging"),
|
|
1399
1409
|
sortable: !0,
|
|
1400
|
-
render: (e) =>
|
|
1410
|
+
render: (e) => Ni(e.aging_hours)
|
|
1401
1411
|
},
|
|
1402
1412
|
{
|
|
1403
1413
|
// When the record entered its current state — the same moment Aging
|
|
1404
1414
|
// counts from (the pipeline history, not the legacy column).
|
|
1405
1415
|
key: "state_entered",
|
|
1406
|
-
header:
|
|
1416
|
+
header: T("state_entered", "Last State Change"),
|
|
1407
1417
|
sortable: !0,
|
|
1408
1418
|
render: (e) => e.state_entered_at ? Go(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
|
|
1409
1419
|
},
|
|
1410
1420
|
{
|
|
1411
1421
|
key: "sla_status",
|
|
1412
|
-
header:
|
|
1422
|
+
header: T("sla_status", "SLA"),
|
|
1413
1423
|
sortable: !0,
|
|
1414
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1424
|
+
render: (e) => /* @__PURE__ */ a(Si, { status: e.sla_status })
|
|
1415
1425
|
},
|
|
1416
1426
|
{
|
|
1417
1427
|
key: "at_risk",
|
|
1418
|
-
header:
|
|
1428
|
+
header: T("at_risk", "Risk"),
|
|
1419
1429
|
sortable: !0,
|
|
1420
1430
|
render: (e) => {
|
|
1421
1431
|
var t;
|
|
@@ -1425,18 +1435,18 @@ function Xc({
|
|
|
1425
1435
|
] }) : e.predicted_risk ? /* @__PURE__ */ a("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
|
|
1426
1436
|
}
|
|
1427
1437
|
},
|
|
1428
|
-
...
|
|
1438
|
+
...Xe ? [
|
|
1429
1439
|
{
|
|
1430
1440
|
key: "addendums",
|
|
1431
|
-
header:
|
|
1441
|
+
header: T("addendums", "Addendums"),
|
|
1432
1442
|
sortable: !1,
|
|
1433
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1443
|
+
render: (e) => /* @__PURE__ */ a(_i, { summary: e.addendums })
|
|
1434
1444
|
}
|
|
1435
1445
|
] : [],
|
|
1436
1446
|
...ut ? [
|
|
1437
1447
|
{
|
|
1438
1448
|
key: "fulfilment",
|
|
1439
|
-
header:
|
|
1449
|
+
header: T("fulfilment", "Shipped"),
|
|
1440
1450
|
sortable: !0,
|
|
1441
1451
|
render: (e) => /* @__PURE__ */ a(
|
|
1442
1452
|
Ks,
|
|
@@ -1448,18 +1458,18 @@ function Xc({
|
|
|
1448
1458
|
)
|
|
1449
1459
|
}
|
|
1450
1460
|
] : [],
|
|
1451
|
-
...
|
|
1461
|
+
..._e ? [
|
|
1452
1462
|
{
|
|
1453
1463
|
key: "integrations",
|
|
1454
|
-
header:
|
|
1464
|
+
header: T("integrations", "Integrations"),
|
|
1455
1465
|
sortable: !1,
|
|
1456
1466
|
render: (e) => /* @__PURE__ */ a(Qs, { rows: bl[`${e.collection}:${e.item_id}`] })
|
|
1457
1467
|
}
|
|
1458
1468
|
] : [],
|
|
1459
|
-
...
|
|
1469
|
+
...Cr ? [
|
|
1460
1470
|
{
|
|
1461
1471
|
key: "tasks",
|
|
1462
|
-
header:
|
|
1472
|
+
header: T("tasks", "Tasks"),
|
|
1463
1473
|
sortable: !1,
|
|
1464
1474
|
render: (e) => {
|
|
1465
1475
|
const t = fl[`${e.collection}:${e.item_id}`];
|
|
@@ -1480,9 +1490,9 @@ function Xc({
|
|
|
1480
1490
|
...mt ? [
|
|
1481
1491
|
{
|
|
1482
1492
|
key: "send_backs",
|
|
1483
|
-
header:
|
|
1493
|
+
header: T("send_backs", "Sent back"),
|
|
1484
1494
|
sortable: !0,
|
|
1485
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1495
|
+
render: (e) => /* @__PURE__ */ a(ki, { summary: e.send_backs })
|
|
1486
1496
|
}
|
|
1487
1497
|
] : []
|
|
1488
1498
|
], El = {
|
|
@@ -1493,7 +1503,7 @@ function Xc({
|
|
|
1493
1503
|
{
|
|
1494
1504
|
type: "button",
|
|
1495
1505
|
onClick: (t) => {
|
|
1496
|
-
t.stopPropagation(),
|
|
1506
|
+
t.stopPropagation(), Ye.mutate(e);
|
|
1497
1507
|
},
|
|
1498
1508
|
className: "text-[11px] text-slate-400 underline hover:text-slate-600",
|
|
1499
1509
|
children: "Release"
|
|
@@ -1509,9 +1519,9 @@ function Xc({
|
|
|
1509
1519
|
children: "Claim"
|
|
1510
1520
|
}
|
|
1511
1521
|
)
|
|
1512
|
-
},
|
|
1522
|
+
}, _t = (c == null ? void 0 : c.available_extra_fields) ?? [], Nt = Oo("drill.queue"), ae = Nt.value, Hr = (e) => Nt.push([e]), Ll = (e) => {
|
|
1513
1523
|
var t;
|
|
1514
|
-
for (const n of (
|
|
1524
|
+
for (const n of (c == null ? void 0 : c.sources) ?? []) {
|
|
1515
1525
|
const r = (t = n.drilldown) == null ? void 0 : t[e];
|
|
1516
1526
|
if (r)
|
|
1517
1527
|
return {
|
|
@@ -1523,11 +1533,11 @@ function Xc({
|
|
|
1523
1533
|
return { enabled: !0, layout_id: null, width: null };
|
|
1524
1534
|
}, Al = V(() => {
|
|
1525
1535
|
const e = {};
|
|
1526
|
-
for (const t of (
|
|
1536
|
+
for (const t of (c == null ? void 0 : c.sources) ?? [])
|
|
1527
1537
|
for (const [n, r] of Object.entries(t.column_formats ?? {}))
|
|
1528
1538
|
n in e || (e[n] = r);
|
|
1529
1539
|
return e;
|
|
1530
|
-
}, [
|
|
1540
|
+
}, [c == null ? void 0 : c.sources]), Ol = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Dl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
|
|
1531
1541
|
function Kl(e) {
|
|
1532
1542
|
if (Ol.test(e)) return { text: e.split("@")[0], title: e };
|
|
1533
1543
|
if (Dl.test(e)) {
|
|
@@ -1540,22 +1550,22 @@ function Xc({
|
|
|
1540
1550
|
}
|
|
1541
1551
|
return { text: e, title: e };
|
|
1542
1552
|
}
|
|
1543
|
-
const
|
|
1553
|
+
const Dn = Jo(u == null ? void 0 : u.inline_edit), Yr = Dn.enabled ? [
|
|
1544
1554
|
...new Set(
|
|
1545
|
-
((
|
|
1555
|
+
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
1546
1556
|
)
|
|
1547
1557
|
] : [], Pl = Be({
|
|
1548
|
-
queries:
|
|
1558
|
+
queries: Yr.map((e) => ({
|
|
1549
1559
|
queryKey: ["cbv-collection-meta", e],
|
|
1550
1560
|
queryFn: () => h.request(L(`/collections/${e}`)).then((t) => t.data),
|
|
1551
1561
|
staleTime: 10 * 6e4,
|
|
1552
1562
|
retry: !1
|
|
1553
1563
|
}))
|
|
1554
|
-
}),
|
|
1555
|
-
|
|
1564
|
+
}), Kn = /* @__PURE__ */ new Map();
|
|
1565
|
+
Yr.forEach((e, t) => {
|
|
1556
1566
|
var r;
|
|
1557
1567
|
const n = (r = Pl[t]) == null ? void 0 : r.data;
|
|
1558
|
-
n &&
|
|
1568
|
+
n && Kn.set(e, {
|
|
1559
1569
|
fields: new Map((n.fields ?? []).map((o) => [o.field, o])),
|
|
1560
1570
|
relations: n.relations ?? []
|
|
1561
1571
|
});
|
|
@@ -1563,71 +1573,71 @@ function Xc({
|
|
|
1563
1573
|
const { data: Ml } = W({
|
|
1564
1574
|
queryKey: ["my-permissions"],
|
|
1565
1575
|
queryFn: () => h.request(L("/security/my/permissions")).then((e) => e.data),
|
|
1566
|
-
enabled:
|
|
1576
|
+
enabled: Dn.enabled && !De,
|
|
1567
1577
|
staleTime: 5 * 6e4
|
|
1568
|
-
}),
|
|
1578
|
+
}), Jr = Ws(), zr = (e, t) => {
|
|
1569
1579
|
if (t.includes(".")) return null;
|
|
1570
|
-
const n =
|
|
1580
|
+
const n = Kn.get(e.collection);
|
|
1571
1581
|
if (!n) return null;
|
|
1572
|
-
const r =
|
|
1582
|
+
const r = ht.get(D(e));
|
|
1573
1583
|
return r && !r.is_mine ? null : Zo({
|
|
1574
|
-
config:
|
|
1584
|
+
config: Dn,
|
|
1575
1585
|
key: t,
|
|
1576
1586
|
field: n.fields.get(t),
|
|
1577
1587
|
collection: e.collection,
|
|
1578
1588
|
relations: n.relations,
|
|
1579
1589
|
mayUpdate: De || Ls(Ml, e.collection)
|
|
1580
1590
|
});
|
|
1581
|
-
},
|
|
1591
|
+
}, Xr = (e, t, n) => {
|
|
1582
1592
|
var r, o, s;
|
|
1583
1593
|
return n === "m2o" ? ((o = (r = e.extra_ids) == null ? void 0 : r[t]) == null ? void 0 : o[0]) ?? null : ((s = e.extra) == null ? void 0 : s[t]) ?? null;
|
|
1584
1594
|
}, Ql = (e, t, n, r, o) => {
|
|
1585
|
-
const s = (b) => `${
|
|
1595
|
+
const s = (b) => `${D(e)}|${b}`, m = [...te].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!zr(e, b)), p = o === 0 ? null : es(m, t, o), S = (b) => b.collection === e.collection && b.item_id === e.item_id, w = (b) => S(b) ? n === "m2o" ? {
|
|
1586
1596
|
...b,
|
|
1587
1597
|
extra_ids: { ...b.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
|
|
1588
1598
|
} : { ...b, extra: { ...b.extra ?? {}, [t]: r } } : b;
|
|
1589
|
-
|
|
1599
|
+
Jr.commit({
|
|
1590
1600
|
cellKey: s(t),
|
|
1591
1601
|
collection: e.collection,
|
|
1592
1602
|
id: e.item_id,
|
|
1593
1603
|
field: t,
|
|
1594
1604
|
kind: n,
|
|
1595
|
-
before:
|
|
1605
|
+
before: Xr(e, t, n),
|
|
1596
1606
|
value: r,
|
|
1597
1607
|
next: p ? s(p) : null,
|
|
1598
1608
|
optimistic: () => {
|
|
1599
1609
|
const b = f.getQueriesData({ queryKey: ["queue-items", l] });
|
|
1600
|
-
return f.setQueriesData({ queryKey: ["queue-items", l] }, (
|
|
1601
|
-
const
|
|
1602
|
-
return Array.isArray(
|
|
1610
|
+
return f.setQueriesData({ queryKey: ["queue-items", l] }, (R) => {
|
|
1611
|
+
const y = R;
|
|
1612
|
+
return Array.isArray(y == null ? void 0 : y.data) ? { ...y, data: y.data.map(w) } : Array.isArray(y == null ? void 0 : y.rows) ? { ...y, rows: y.rows.map(w) } : R;
|
|
1603
1613
|
}), () => {
|
|
1604
|
-
for (const [
|
|
1614
|
+
for (const [R, y] of b) f.setQueryData(R, y);
|
|
1605
1615
|
};
|
|
1606
1616
|
},
|
|
1607
1617
|
// Labels, rollups and the row's place in the queue follow the server.
|
|
1608
1618
|
onSaved: () => void f.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
1609
1619
|
});
|
|
1610
1620
|
}, Bl = (e, t, n) => {
|
|
1611
|
-
const r =
|
|
1621
|
+
const r = zr(e, t);
|
|
1612
1622
|
if (!r) return n;
|
|
1613
|
-
const o =
|
|
1623
|
+
const o = Kn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
|
|
1614
1624
|
return /* @__PURE__ */ a(
|
|
1615
1625
|
Hs,
|
|
1616
1626
|
{
|
|
1617
|
-
controller:
|
|
1618
|
-
cellKey: `${
|
|
1627
|
+
controller: Jr,
|
|
1628
|
+
cellKey: `${D(e)}|${t}`,
|
|
1619
1629
|
kind: r,
|
|
1620
|
-
value:
|
|
1621
|
-
label:
|
|
1630
|
+
value: Xr(e, t, r),
|
|
1631
|
+
label: T(`extra.${t}`, je(t)),
|
|
1622
1632
|
choices: s ? Xo(s) : void 0,
|
|
1623
1633
|
target: r === "m2o" && o ? zo(o.relations, e.collection, t) : null,
|
|
1624
1634
|
onCommit: (m, p) => Ql(e, t, r, m, p),
|
|
1625
1635
|
children: n
|
|
1626
1636
|
}
|
|
1627
1637
|
);
|
|
1628
|
-
}, jl =
|
|
1638
|
+
}, jl = _t.map((e) => ({
|
|
1629
1639
|
key: `extra.${e}`,
|
|
1630
|
-
header:
|
|
1640
|
+
header: T(`extra.${e}`, je(e)),
|
|
1631
1641
|
sortable: !0,
|
|
1632
1642
|
render: (t) => Bl(t, e, Ul(t, e))
|
|
1633
1643
|
}));
|
|
@@ -1636,17 +1646,17 @@ function Xc({
|
|
|
1636
1646
|
{
|
|
1637
1647
|
const o = (n = e.extra) == null ? void 0 : n[t];
|
|
1638
1648
|
if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
1639
|
-
const s = Me(t), m = s ?
|
|
1640
|
-
return (w == null ? void 0 : w.kind) === "relation" && w.target_collection && b.length > 0 &&
|
|
1649
|
+
const s = Me(t), m = s ? nt(String(o), s) : String(o), { text: p, title: S } = Kl(m), w = ((c == null ? void 0 : c.extra_field_meta) ?? []).find((y) => y.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], R = Ll(t);
|
|
1650
|
+
return (w == null ? void 0 : w.kind) === "relation" && w.target_collection && b.length > 0 && R.enabled && !w.aggregate ? /* @__PURE__ */ a(
|
|
1641
1651
|
"button",
|
|
1642
1652
|
{
|
|
1643
1653
|
type: "button",
|
|
1644
|
-
onClick: (
|
|
1645
|
-
|
|
1654
|
+
onClick: (y) => {
|
|
1655
|
+
y.stopPropagation(), Hr({
|
|
1646
1656
|
collection: w.target_collection,
|
|
1647
1657
|
itemId: b[0],
|
|
1648
|
-
layoutId:
|
|
1649
|
-
width:
|
|
1658
|
+
layoutId: R.layout_id,
|
|
1659
|
+
width: R.width,
|
|
1650
1660
|
title: m
|
|
1651
1661
|
});
|
|
1652
1662
|
},
|
|
@@ -1658,8 +1668,8 @@ function Xc({
|
|
|
1658
1668
|
"button",
|
|
1659
1669
|
{
|
|
1660
1670
|
type: "button",
|
|
1661
|
-
onClick: (
|
|
1662
|
-
|
|
1671
|
+
onClick: (y) => {
|
|
1672
|
+
y.stopPropagation(), fn({ row: e, path: t, value: m });
|
|
1663
1673
|
},
|
|
1664
1674
|
title: "Show the rows behind this number",
|
|
1665
1675
|
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",
|
|
@@ -1668,53 +1678,53 @@ function Xc({
|
|
|
1668
1678
|
) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: S, children: p });
|
|
1669
1679
|
}
|
|
1670
1680
|
}
|
|
1671
|
-
const
|
|
1672
|
-
...
|
|
1681
|
+
const Zr = [
|
|
1682
|
+
...On ? ["collection"] : [],
|
|
1673
1683
|
"state",
|
|
1674
1684
|
"owners",
|
|
1675
1685
|
"aging_hours",
|
|
1676
1686
|
"state_entered",
|
|
1677
1687
|
"sla_status",
|
|
1678
1688
|
"at_risk",
|
|
1679
|
-
...
|
|
1689
|
+
...Xe ? ["addendums"] : [],
|
|
1680
1690
|
...ut ? ["fulfilment"] : [],
|
|
1681
|
-
...
|
|
1691
|
+
..._e ? ["integrations"] : [],
|
|
1682
1692
|
...mt ? ["send_backs"] : [],
|
|
1683
|
-
...
|
|
1684
|
-
...
|
|
1693
|
+
...Cr ? ["tasks"] : [],
|
|
1694
|
+
..._t.map((e) => `extra.${e}`)
|
|
1685
1695
|
], Il = [
|
|
1686
|
-
...
|
|
1696
|
+
...On ? ["collection"] : [],
|
|
1687
1697
|
"state",
|
|
1688
1698
|
"owners",
|
|
1689
|
-
...
|
|
1699
|
+
...Xe ? ["addendums"] : [],
|
|
1690
1700
|
...ut ? ["fulfilment"] : [],
|
|
1691
|
-
...
|
|
1701
|
+
..._e ? ["integrations"] : [],
|
|
1692
1702
|
...mt ? ["send_backs"] : [],
|
|
1693
1703
|
"aging_hours",
|
|
1694
1704
|
"sla_status",
|
|
1695
1705
|
"at_risk",
|
|
1696
|
-
...
|
|
1697
|
-
], Vl = (u == null ? void 0 : u.default_columns) ?? null,
|
|
1698
|
-
|
|
1706
|
+
..._t.slice(0, 2).map((e) => `extra.${e}`)
|
|
1707
|
+
], Vl = (u == null ? void 0 : u.default_columns) ?? null, Pn = Bt ?? Vl, te = new Set(Pn ?? Il);
|
|
1708
|
+
Xe && !Et.has("addendums") && te.add("addendums"), ut && !Et.has("fulfilment") && te.add("fulfilment"), _e && !Et.has("integrations") && te.add("integrations"), mt && !Et.has("send_backs") && te.add("send_backs");
|
|
1699
1709
|
const Gl = new Set(De ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
|
|
1700
1710
|
for (const e of Gl) te.delete(e);
|
|
1701
|
-
const
|
|
1702
|
-
...(
|
|
1703
|
-
...
|
|
1711
|
+
const St = [
|
|
1712
|
+
...(Pn ?? []).filter((e) => Zr.includes(e)),
|
|
1713
|
+
...Zr.filter((e) => !(Pn ?? []).includes(e))
|
|
1704
1714
|
], Wl = no(ro(ao, { activationConstraint: { distance: 4 } }));
|
|
1705
1715
|
function Hl(e) {
|
|
1706
1716
|
const { active: t, over: n } = e;
|
|
1707
1717
|
if (!n || t.id === n.id) return;
|
|
1708
|
-
const r =
|
|
1709
|
-
r === -1 || o === -1 ||
|
|
1710
|
-
co(
|
|
1718
|
+
const r = St.indexOf(String(t.id)), o = St.indexOf(String(n.id));
|
|
1719
|
+
r === -1 || o === -1 || jt(
|
|
1720
|
+
co(St, r, o).filter((s) => te.has(s))
|
|
1711
1721
|
);
|
|
1712
1722
|
}
|
|
1713
|
-
const
|
|
1714
|
-
...
|
|
1723
|
+
const ea = Wr.find((e) => e.key === "label"), Yl = {
|
|
1724
|
+
...ea,
|
|
1715
1725
|
render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
1716
1726
|
/* @__PURE__ */ a(Rs, { rowId: e.item_id }),
|
|
1717
|
-
|
|
1727
|
+
ea.render(e, ...t)
|
|
1718
1728
|
] })
|
|
1719
1729
|
}, Jl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
|
|
1720
1730
|
(e) => ({
|
|
@@ -1733,54 +1743,55 @@ function Xc({
|
|
|
1733
1743
|
return Number.isFinite(o) ? /* @__PURE__ */ a("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ a("span", { children: String(r) });
|
|
1734
1744
|
}
|
|
1735
1745
|
})
|
|
1736
|
-
),
|
|
1737
|
-
|
|
1746
|
+
), Mn = [...Wr, ...jl, ...Jl], ta = ii(
|
|
1747
|
+
St,
|
|
1738
1748
|
(e) => {
|
|
1739
1749
|
var n;
|
|
1740
|
-
const t = (n =
|
|
1750
|
+
const t = (n = Mn.find((r) => r.key === e)) == null ? void 0 : n.header;
|
|
1741
1751
|
return typeof t == "string" ? t : e;
|
|
1742
1752
|
},
|
|
1743
1753
|
te
|
|
1744
1754
|
), zl = {
|
|
1745
1755
|
key: "__actions__",
|
|
1746
1756
|
header: "",
|
|
1747
|
-
render: (e) => e.collection === "tasks" || e.collection ===
|
|
1757
|
+
render: (e) => e.collection === "tasks" || e.collection === tn ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
|
|
1748
1758
|
Es,
|
|
1749
1759
|
{
|
|
1750
1760
|
collection: e.collection,
|
|
1751
1761
|
id: e.item_id,
|
|
1762
|
+
label: e.label,
|
|
1752
1763
|
hasPipeline: e.state != null,
|
|
1753
|
-
onOpen: () =>
|
|
1764
|
+
onOpen: () => yt(e),
|
|
1754
1765
|
onPeek: () => Oe(e),
|
|
1755
1766
|
urlFor: H.urlFor,
|
|
1756
1767
|
onDeleted: () => {
|
|
1757
|
-
h.request(
|
|
1758
|
-
|
|
1759
|
-
}).catch((t) =>
|
|
1768
|
+
h.request(In(`/items/${e.collection}/${e.item_id}`)).then(() => {
|
|
1769
|
+
O.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
1770
|
+
}).catch((t) => O.error(qt(t, "Delete failed")));
|
|
1760
1771
|
},
|
|
1761
1772
|
onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
1762
1773
|
bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
|
|
1763
1774
|
disabled: ee
|
|
1764
1775
|
}
|
|
1765
1776
|
) })
|
|
1766
|
-
},
|
|
1777
|
+
}, Xt = [
|
|
1767
1778
|
Yl,
|
|
1768
|
-
...
|
|
1769
|
-
...
|
|
1779
|
+
...St.filter((e) => te.has(e)).map((e) => Mn.find((t) => t.key === e)).filter((e) => e !== void 0),
|
|
1780
|
+
...pe ? [El] : [],
|
|
1770
1781
|
zl
|
|
1771
|
-
],
|
|
1782
|
+
], na = V(() => {
|
|
1772
1783
|
var r;
|
|
1773
|
-
const e = u == null ? void 0 : u.default_pins, t = it ?? (e && Object.keys(e).length > 0 ? e : { [((r =
|
|
1784
|
+
const e = u == null ? void 0 : u.default_pins, t = it ?? (e && Object.keys(e).length > 0 ? e : { [((r = Xt[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(Xt.map((o) => o.key));
|
|
1774
1785
|
return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
|
|
1775
|
-
}, [it, u == null ? void 0 : u.default_pins,
|
|
1786
|
+
}, [it, u == null ? void 0 : u.default_pins, Xt.map((e) => e.key).join("|")]), ra = [
|
|
1776
1787
|
{ value: "state", label: "State" },
|
|
1777
1788
|
{ value: "collection", label: "Collection" },
|
|
1778
1789
|
{ value: "sla_status", label: "SLA status" },
|
|
1779
1790
|
{ value: "at_risk", label: "At risk" },
|
|
1780
1791
|
{ value: "owners", label: "Owner" },
|
|
1781
1792
|
{ value: "aging", label: "Aging" },
|
|
1782
|
-
...
|
|
1783
|
-
],
|
|
1793
|
+
..._t.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: T(`extra.${e}`, je(e)) }))
|
|
1794
|
+
], aa = (e) => async (t, n) => {
|
|
1784
1795
|
if (!e.target_collection || !e.display_field) return [];
|
|
1785
1796
|
const r = {
|
|
1786
1797
|
limit: 25,
|
|
@@ -1798,34 +1809,34 @@ function Xc({
|
|
|
1798
1809
|
s.length > 0 && (r.filter = JSON.stringify(s.length === 1 ? s[0] : { _and: s }));
|
|
1799
1810
|
const p = (await h.request(
|
|
1800
1811
|
L(`/items/${e.target_collection}`, r)
|
|
1801
|
-
)).data ?? [], S = Me(e.path), w =
|
|
1802
|
-
for (const
|
|
1803
|
-
const X =
|
|
1812
|
+
)).data ?? [], S = Me(e.path), w = Te[e.path] ? new Set(Te[e.path]) : null, b = /* @__PURE__ */ new Set(), R = [];
|
|
1813
|
+
for (const y of p) {
|
|
1814
|
+
const X = y[e.display_field];
|
|
1804
1815
|
if (X == null || X === "") continue;
|
|
1805
1816
|
const Z = String(X);
|
|
1806
|
-
b.has(Z) || w && !w.has(Z) || (b.add(Z),
|
|
1817
|
+
b.has(Z) || w && !w.has(Z) || (b.add(Z), R.push({ label: S ? nt(Z, S) : Z, value: Z }));
|
|
1807
1818
|
}
|
|
1808
|
-
return
|
|
1809
|
-
},
|
|
1819
|
+
return R;
|
|
1820
|
+
}, Qn = new Map(((c == null ? void 0 : c.extra_field_meta) ?? []).map((e) => [e.path, e])), Qe = [
|
|
1810
1821
|
{
|
|
1811
1822
|
key: "collection",
|
|
1812
|
-
placeholder:
|
|
1823
|
+
placeholder: T("collection", "Collection"),
|
|
1813
1824
|
type: "combobox",
|
|
1814
1825
|
multi: !0,
|
|
1815
|
-
options: ((
|
|
1816
|
-
label:
|
|
1826
|
+
options: ((i == null ? void 0 : i.available_values.collection) ?? []).map((e) => ({
|
|
1827
|
+
label: xt(e),
|
|
1817
1828
|
value: e
|
|
1818
1829
|
}))
|
|
1819
1830
|
},
|
|
1820
1831
|
{
|
|
1821
1832
|
key: "state",
|
|
1822
|
-
placeholder:
|
|
1833
|
+
placeholder: T("state", "State"),
|
|
1823
1834
|
type: "combobox",
|
|
1824
1835
|
multi: !0,
|
|
1825
1836
|
// Until the rows land, the pipeline's own states (no counts yet) rather
|
|
1826
1837
|
// than an empty list.
|
|
1827
|
-
options:
|
|
1828
|
-
|
|
1838
|
+
options: Er(
|
|
1839
|
+
i ? i.available_values.state ?? [] : Object.keys(Ne)
|
|
1829
1840
|
).map((e) => {
|
|
1830
1841
|
var t;
|
|
1831
1842
|
return {
|
|
@@ -1833,7 +1844,7 @@ function Xc({
|
|
|
1833
1844
|
value: e,
|
|
1834
1845
|
// How many rows sit in it under the other active filters (the State
|
|
1835
1846
|
// filter itself left out, or every other state would read 0).
|
|
1836
|
-
count:
|
|
1847
|
+
count: yr ? yr[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
|
|
1837
1848
|
};
|
|
1838
1849
|
})
|
|
1839
1850
|
},
|
|
@@ -1856,21 +1867,21 @@ function Xc({
|
|
|
1856
1867
|
{ label: "No", value: "no" }
|
|
1857
1868
|
]
|
|
1858
1869
|
},
|
|
1859
|
-
|
|
1870
|
+
...qr.length > 0 ? [
|
|
1860
1871
|
{
|
|
1861
1872
|
key: "at_risk_rule",
|
|
1862
1873
|
placeholder: "Highlight rule",
|
|
1863
1874
|
type: "select",
|
|
1864
|
-
options:
|
|
1875
|
+
options: qr
|
|
1865
1876
|
}
|
|
1866
1877
|
] : [],
|
|
1867
1878
|
{
|
|
1868
1879
|
key: "aging_hours",
|
|
1869
|
-
placeholder:
|
|
1880
|
+
placeholder: T("aging_hours", "Aging (hours)"),
|
|
1870
1881
|
type: "range",
|
|
1871
1882
|
range_unit: "h"
|
|
1872
1883
|
},
|
|
1873
|
-
...
|
|
1884
|
+
...Xe ? [
|
|
1874
1885
|
{
|
|
1875
1886
|
key: "addendums",
|
|
1876
1887
|
placeholder: "Addendums",
|
|
@@ -1883,10 +1894,10 @@ function Xc({
|
|
|
1883
1894
|
] : [],
|
|
1884
1895
|
// #630 — integration partners; the queue read model filters on it
|
|
1885
1896
|
// (live path in memory, materialized cache in SQL).
|
|
1886
|
-
...
|
|
1897
|
+
..._e ? [
|
|
1887
1898
|
{
|
|
1888
1899
|
key: "integrations",
|
|
1889
|
-
placeholder:
|
|
1900
|
+
placeholder: T("integrations", "Integrations"),
|
|
1890
1901
|
type: "select",
|
|
1891
1902
|
options: Bs.map((e) => ({ label: e.label, value: e.value }))
|
|
1892
1903
|
}
|
|
@@ -1911,18 +1922,18 @@ function Xc({
|
|
|
1911
1922
|
]
|
|
1912
1923
|
}
|
|
1913
1924
|
] : [],
|
|
1914
|
-
...
|
|
1925
|
+
...xn.length > 0 ? [
|
|
1915
1926
|
{
|
|
1916
1927
|
key: "labels",
|
|
1917
1928
|
placeholder: "Triage label",
|
|
1918
1929
|
type: "combobox",
|
|
1919
1930
|
multi: !0,
|
|
1920
|
-
options:
|
|
1931
|
+
options: xn.map((e) => ({ label: e, value: e }))
|
|
1921
1932
|
}
|
|
1922
1933
|
] : [],
|
|
1923
1934
|
{
|
|
1924
1935
|
key: "label",
|
|
1925
|
-
placeholder:
|
|
1936
|
+
placeholder: T("label", "Item"),
|
|
1926
1937
|
type: "combobox",
|
|
1927
1938
|
multi: !0,
|
|
1928
1939
|
loadOptions: async (e) => ((await h.request(
|
|
@@ -1931,17 +1942,17 @@ function Xc({
|
|
|
1931
1942
|
},
|
|
1932
1943
|
{
|
|
1933
1944
|
key: "owners",
|
|
1934
|
-
placeholder:
|
|
1945
|
+
placeholder: T("owners", "Owners"),
|
|
1935
1946
|
type: "combobox",
|
|
1936
1947
|
multi: !0,
|
|
1937
|
-
options: ((
|
|
1948
|
+
options: ((i == null ? void 0 : i.available_values.owners) ?? []).map((e) => ({
|
|
1938
1949
|
label: e.name,
|
|
1939
1950
|
value: e.id
|
|
1940
1951
|
}))
|
|
1941
1952
|
},
|
|
1942
|
-
...
|
|
1953
|
+
..._t.map((e) => {
|
|
1943
1954
|
var m, p;
|
|
1944
|
-
const t =
|
|
1955
|
+
const t = Qn.get(e), n = T(`extra.${e}`, je(e)), r = { key: `extra.${e}`, placeholder: n }, o = Me(e);
|
|
1945
1956
|
if ((o == null ? void 0 : o.type) === "datetime") return { ...r, type: "date" };
|
|
1946
1957
|
if ((o == null ? void 0 : o.type) === "number") return { ...r, type: "number" };
|
|
1947
1958
|
if ((o == null ? void 0 : o.type) === "boolean")
|
|
@@ -1953,57 +1964,57 @@ function Xc({
|
|
|
1953
1964
|
{ label: o.false_label ?? "No", value: "bool:false" }
|
|
1954
1965
|
]
|
|
1955
1966
|
};
|
|
1956
|
-
const s = (m =
|
|
1967
|
+
const s = (m = i == null ? void 0 : i.available_values.extra) == null ? void 0 : m[e];
|
|
1957
1968
|
return s != null && s.length ? {
|
|
1958
1969
|
...r,
|
|
1959
1970
|
type: "combobox",
|
|
1960
1971
|
multi: !0,
|
|
1961
|
-
options: s.map((S) => ({ label: o ?
|
|
1972
|
+
options: s.map((S) => ({ label: o ? nt(S, o) : S, value: S }))
|
|
1962
1973
|
} : (t == null ? void 0 : t.kind) === "relation" ? {
|
|
1963
1974
|
...r,
|
|
1964
1975
|
type: "combobox",
|
|
1965
1976
|
multi: !0,
|
|
1966
|
-
restricted: !!((p =
|
|
1967
|
-
loadOptions:
|
|
1977
|
+
restricted: !!((p = Te[e]) != null && p.length),
|
|
1978
|
+
loadOptions: aa(t)
|
|
1968
1979
|
} : { ...r, placeholder: `Search ${n}…`, type: "text" };
|
|
1969
1980
|
})
|
|
1970
|
-
],
|
|
1981
|
+
], Bn = Qe.filter(
|
|
1971
1982
|
(e) => te.has(e.key) || e.key === "label" || e.key === "owners"
|
|
1972
|
-
),
|
|
1983
|
+
), jn = (e) => {
|
|
1973
1984
|
var t;
|
|
1974
1985
|
return (((t = Qe.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
|
|
1975
|
-
},
|
|
1986
|
+
}, Un = (() => {
|
|
1976
1987
|
var n, r;
|
|
1977
1988
|
const e = [];
|
|
1978
|
-
for (const [o, s] of Object.entries(
|
|
1989
|
+
for (const [o, s] of Object.entries(Ee)) {
|
|
1979
1990
|
if (!s || Array.isArray(s) && s.length === 0) continue;
|
|
1980
1991
|
const m = Qe.find((b) => b.key === o), p = o.startsWith("extra.") ? o.slice(6) : null, S = p ? Me(p) : null, w = jo({
|
|
1981
|
-
field:
|
|
1992
|
+
field: jn(o),
|
|
1982
1993
|
type: (m == null ? void 0 : m.type) ?? "select",
|
|
1983
1994
|
value: s,
|
|
1984
1995
|
optionLabel: (b) => {
|
|
1985
|
-
var
|
|
1986
|
-
return (
|
|
1996
|
+
var R, y;
|
|
1997
|
+
return (y = (R = m == null ? void 0 : m.options) == null ? void 0 : R.find((X) => X.value === b)) == null ? void 0 : y.label;
|
|
1987
1998
|
},
|
|
1988
1999
|
currency: (S == null ? void 0 : S.type) === "number" && S.prefix === "$",
|
|
1989
2000
|
rangeUnit: m == null ? void 0 : m.range_unit
|
|
1990
2001
|
});
|
|
1991
2002
|
w && e.push(w);
|
|
1992
2003
|
}
|
|
1993
|
-
const t =
|
|
2004
|
+
const t = i == null ? void 0 : i.total;
|
|
1994
2005
|
return Uo({
|
|
1995
2006
|
noun: "items",
|
|
1996
2007
|
scope: g === "mine" ? "you own" : g === "unowned" ? "with no owners" : g === "claimed" ? "you claimed" : null,
|
|
1997
|
-
viewName: ((r = (n = j == null ? void 0 : j.data) == null ? void 0 : n.find((o) => o.id ===
|
|
2008
|
+
viewName: ((r = (n = j == null ? void 0 : j.data) == null ? void 0 : n.find((o) => o.id === Ze)) == null ? void 0 : r.name) ?? null,
|
|
1998
2009
|
clauses: e,
|
|
1999
2010
|
shown: typeof t == "number" ? t : null,
|
|
2000
2011
|
of: (x == null ? void 0 : x.total) ?? null
|
|
2001
2012
|
});
|
|
2002
|
-
})(),
|
|
2013
|
+
})(), Ct = new Set(Object.keys(me.current)), Xl = ((e) => {
|
|
2003
2014
|
var n;
|
|
2004
2015
|
if (e.some((r) => r.key === "state")) return e;
|
|
2005
2016
|
const t = Qe.find((r) => r.key === "state");
|
|
2006
|
-
return !t ||
|
|
2017
|
+
return !t || i && !((n = i.available_values.state) != null && n.length) ? e : [...e, t];
|
|
2007
2018
|
})(
|
|
2008
2019
|
(() => {
|
|
2009
2020
|
var o;
|
|
@@ -2011,28 +2022,28 @@ function Xc({
|
|
|
2011
2022
|
var X, Z, F;
|
|
2012
2023
|
if (!s.key.startsWith("extra.")) return null;
|
|
2013
2024
|
if (s.type === "combobox") return s;
|
|
2014
|
-
const m = s.key.slice(6), p =
|
|
2025
|
+
const m = s.key.slice(6), p = Qn.get(m), S = Ct.has(s.key);
|
|
2015
2026
|
if ((p == null ? void 0 : p.kind) !== "relation" && !S) return null;
|
|
2016
|
-
const w = Me(m), b = (X =
|
|
2027
|
+
const w = Me(m), b = (X = i == null ? void 0 : i.available_values.extra) == null ? void 0 : X[m], R = s.placeholder.replace(/^Search (.*)…$/, "$1"), y = (p == null ? void 0 : p.kind) === "relation" && p.target_collection && p.display_field ? { collection: p.target_collection, field: p.display_field } : void 0;
|
|
2017
2028
|
return b != null && b.length ? {
|
|
2018
2029
|
key: s.key,
|
|
2019
|
-
placeholder:
|
|
2030
|
+
placeholder: R,
|
|
2020
2031
|
type: "combobox",
|
|
2021
2032
|
multi: !0,
|
|
2022
|
-
cascade:
|
|
2023
|
-
restricted: !!((Z =
|
|
2033
|
+
cascade: y,
|
|
2034
|
+
restricted: !!((Z = Te[m]) != null && Z.length),
|
|
2024
2035
|
options: b.map((ne) => ({
|
|
2025
|
-
label: w && w.type !== "number" ?
|
|
2036
|
+
label: w && w.type !== "number" ? nt(ne, w) : ne,
|
|
2026
2037
|
value: ne
|
|
2027
2038
|
}))
|
|
2028
2039
|
} : (p == null ? void 0 : p.kind) === "relation" ? {
|
|
2029
2040
|
key: s.key,
|
|
2030
|
-
placeholder:
|
|
2041
|
+
placeholder: R,
|
|
2031
2042
|
type: "combobox",
|
|
2032
2043
|
multi: !0,
|
|
2033
|
-
cascade:
|
|
2034
|
-
restricted: !!((F =
|
|
2035
|
-
loadOptions:
|
|
2044
|
+
cascade: y,
|
|
2045
|
+
restricted: !!((F = Te[m]) != null && F.length),
|
|
2046
|
+
loadOptions: aa(p)
|
|
2036
2047
|
} : null;
|
|
2037
2048
|
};
|
|
2038
2049
|
if (rr.length > 0) {
|
|
@@ -2043,25 +2054,25 @@ function Xc({
|
|
|
2043
2054
|
if (p.key === "state" || /(^|_)state$/.test(((o = p.path) == null ? void 0 : o[0]) ?? ""))
|
|
2044
2055
|
w = Qe.find((b) => b.key === "state");
|
|
2045
2056
|
else {
|
|
2046
|
-
const b = Qe.filter((
|
|
2057
|
+
const b = Qe.filter((y) => {
|
|
2047
2058
|
var Z;
|
|
2048
|
-
if (!
|
|
2049
|
-
const X =
|
|
2050
|
-
return ((Z =
|
|
2051
|
-
}),
|
|
2052
|
-
w =
|
|
2059
|
+
if (!y.key.startsWith("extra.") || m.has(y.key)) return !1;
|
|
2060
|
+
const X = y.key.slice(6);
|
|
2061
|
+
return ((Z = Qn.get(X)) == null ? void 0 : Z.target_collection) === p.collection;
|
|
2062
|
+
}), R = b.find((y) => y.key.slice(6).startsWith(`${S}.`)) ?? b[0];
|
|
2063
|
+
w = R ? e(R) : null;
|
|
2053
2064
|
}
|
|
2054
2065
|
!w || m.has(w.key) || (m.add(w.key), s.push(p.label ? { ...w, placeholder: p.label } : w));
|
|
2055
2066
|
}
|
|
2056
2067
|
for (const p of Qe.map(e))
|
|
2057
|
-
p && !m.has(p.key) && (
|
|
2068
|
+
p && !m.has(p.key) && (Ct.has(p.key) || p.restricted) && s.push(p);
|
|
2058
2069
|
if (s.length > 0) return s;
|
|
2059
2070
|
}
|
|
2060
|
-
const t =
|
|
2061
|
-
...t.filter((s) =>
|
|
2062
|
-
...t.filter((s) => !
|
|
2071
|
+
const t = Bn.map(e).filter((s) => s !== null), r = [
|
|
2072
|
+
...t.filter((s) => Ct.has(s.key) || s.restricted),
|
|
2073
|
+
...t.filter((s) => !Ct.has(s.key) && !s.restricted)
|
|
2063
2074
|
].slice(0, 6);
|
|
2064
|
-
return r.length > 0 ? r :
|
|
2075
|
+
return r.length > 0 ? r : Bn.filter((s) => s.key === "state" || s.key === "owners");
|
|
2065
2076
|
})()
|
|
2066
2077
|
), Zl = (() => {
|
|
2067
2078
|
if (!x) return null;
|
|
@@ -2072,7 +2083,7 @@ function Xc({
|
|
|
2072
2083
|
label: "past SLA",
|
|
2073
2084
|
tone: "text-red-600 dark:text-red-400",
|
|
2074
2085
|
on: _.sla_status === "breached",
|
|
2075
|
-
toggle: () =>
|
|
2086
|
+
toggle: () => Ge("sla_status", "breached")
|
|
2076
2087
|
},
|
|
2077
2088
|
{
|
|
2078
2089
|
key: "warning",
|
|
@@ -2080,7 +2091,7 @@ function Xc({
|
|
|
2080
2091
|
label: "SLA soon",
|
|
2081
2092
|
tone: "text-amber-700 dark:text-amber-400",
|
|
2082
2093
|
on: _.sla_status === "warning",
|
|
2083
|
-
toggle: () =>
|
|
2094
|
+
toggle: () => Ge("sla_status", "warning")
|
|
2084
2095
|
},
|
|
2085
2096
|
{
|
|
2086
2097
|
key: "at_risk",
|
|
@@ -2088,7 +2099,7 @@ function Xc({
|
|
|
2088
2099
|
label: "at risk",
|
|
2089
2100
|
tone: "text-red-600 dark:text-red-400",
|
|
2090
2101
|
on: _.at_risk === "yes",
|
|
2091
|
-
toggle: () =>
|
|
2102
|
+
toggle: () => Ge("at_risk", "yes")
|
|
2092
2103
|
},
|
|
2093
2104
|
{
|
|
2094
2105
|
key: "unowned",
|
|
@@ -2097,7 +2108,7 @@ function Xc({
|
|
|
2097
2108
|
tone: "text-slate-600 dark:text-slate-300",
|
|
2098
2109
|
on: g === "unowned",
|
|
2099
2110
|
toggle: () => {
|
|
2100
|
-
Y(g === "unowned" ? "all" : "unowned"),
|
|
2111
|
+
Y(g === "unowned" ? "all" : "unowned"), A(1);
|
|
2101
2112
|
}
|
|
2102
2113
|
}
|
|
2103
2114
|
].filter((n) => n.n > 0 || n.on);
|
|
@@ -2113,13 +2124,13 @@ function Xc({
|
|
|
2113
2124
|
type: "button",
|
|
2114
2125
|
onClick: n.toggle,
|
|
2115
2126
|
"aria-pressed": n.on,
|
|
2116
|
-
className:
|
|
2127
|
+
className: E(
|
|
2117
2128
|
"rounded px-1 tabular-nums hover:bg-slate-100 dark:hover:bg-slate-800",
|
|
2118
2129
|
n.on && "bg-slate-100 dark:bg-slate-800"
|
|
2119
2130
|
),
|
|
2120
2131
|
"data-queue-summary-item": n.key,
|
|
2121
2132
|
children: [
|
|
2122
|
-
/* @__PURE__ */ a("span", { className:
|
|
2133
|
+
/* @__PURE__ */ a("span", { className: E("font-semibold", n.tone), children: n.n.toLocaleString() }),
|
|
2123
2134
|
" ",
|
|
2124
2135
|
n.label
|
|
2125
2136
|
]
|
|
@@ -2127,9 +2138,9 @@ function Xc({
|
|
|
2127
2138
|
n.key
|
|
2128
2139
|
)),
|
|
2129
2140
|
/* @__PURE__ */ d("span", { className: "tabular-nums", "data-queue-summary-total": !0, children: [
|
|
2130
|
-
((
|
|
2141
|
+
((i == null ? void 0 : i.total) ?? e.total).toLocaleString(),
|
|
2131
2142
|
" item",
|
|
2132
|
-
((
|
|
2143
|
+
((i == null ? void 0 : i.total) ?? e.total) === 1 ? "" : "s"
|
|
2133
2144
|
] })
|
|
2134
2145
|
]
|
|
2135
2146
|
}
|
|
@@ -2137,14 +2148,14 @@ function Xc({
|
|
|
2137
2148
|
})();
|
|
2138
2149
|
function eo(e) {
|
|
2139
2150
|
const t = new Set(te);
|
|
2140
|
-
t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") &&
|
|
2151
|
+
t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Yn((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Yn((n) => {
|
|
2141
2152
|
const r = new Set(n);
|
|
2142
2153
|
return r.delete(e), r;
|
|
2143
|
-
})),
|
|
2154
|
+
})), jt([...t]);
|
|
2144
2155
|
}
|
|
2145
|
-
return
|
|
2156
|
+
return Ot ? (K == null ? void 0 : K((Ot == null ? void 0 : Ot.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
|
|
2146
2157
|
/* @__PURE__ */ d("div", { className: "shrink-0", children: [
|
|
2147
|
-
(
|
|
2158
|
+
(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: [
|
|
2148
2159
|
/* @__PURE__ */ a(bo, { className: "h-4 w-4 shrink-0" }),
|
|
2149
2160
|
/* @__PURE__ */ a("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." })
|
|
2150
2161
|
] }),
|
|
@@ -2154,15 +2165,15 @@ function Xc({
|
|
|
2154
2165
|
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",
|
|
2155
2166
|
"data-queue-toolbar": !0,
|
|
2156
2167
|
children: [
|
|
2157
|
-
J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children:
|
|
2168
|
+
J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: wi.filter((e) => pe || e.value !== "claimed").map(
|
|
2158
2169
|
(e, t) => /* @__PURE__ */ a(
|
|
2159
2170
|
"button",
|
|
2160
2171
|
{
|
|
2161
2172
|
type: "button",
|
|
2162
2173
|
onClick: () => {
|
|
2163
|
-
Y(e.value),
|
|
2174
|
+
Y(e.value), A(1);
|
|
2164
2175
|
},
|
|
2165
|
-
className:
|
|
2176
|
+
className: E(
|
|
2166
2177
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
2167
2178
|
t > 0 && "border-l border-slate-200 dark:border-border",
|
|
2168
2179
|
g === 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"
|
|
@@ -2172,21 +2183,21 @@ function Xc({
|
|
|
2172
2183
|
e.value
|
|
2173
2184
|
)
|
|
2174
2185
|
) }) : /* @__PURE__ */ a("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
2175
|
-
J ?
|
|
2186
|
+
J ? Re.length <= 1 ? null : (
|
|
2176
2187
|
// One allowed view means nothing to switch to — no button.
|
|
2177
2188
|
/* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
|
|
2178
2189
|
{ value: "table", label: "Table" },
|
|
2179
2190
|
{ value: "kanban", label: "Kanban" },
|
|
2180
2191
|
{ value: "workload", label: "Workload" }
|
|
2181
|
-
].filter((e) =>
|
|
2192
|
+
].filter((e) => Re.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
|
|
2182
2193
|
"button",
|
|
2183
2194
|
{
|
|
2184
2195
|
type: "button",
|
|
2185
|
-
onClick: () =>
|
|
2186
|
-
className:
|
|
2196
|
+
onClick: () => Ue(e.value),
|
|
2197
|
+
className: E(
|
|
2187
2198
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
2188
2199
|
t > 0 && "border-l border-slate-200 dark:border-border",
|
|
2189
|
-
|
|
2200
|
+
C === 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"
|
|
2190
2201
|
),
|
|
2191
2202
|
children: e.label
|
|
2192
2203
|
},
|
|
@@ -2211,7 +2222,7 @@ function Xc({
|
|
|
2211
2222
|
]
|
|
2212
2223
|
}
|
|
2213
2224
|
),
|
|
2214
|
-
|
|
2225
|
+
Xe && /* @__PURE__ */ d(
|
|
2215
2226
|
"button",
|
|
2216
2227
|
{
|
|
2217
2228
|
type: "button",
|
|
@@ -2228,10 +2239,10 @@ function Xc({
|
|
|
2228
2239
|
]
|
|
2229
2240
|
}
|
|
2230
2241
|
),
|
|
2231
|
-
|
|
2242
|
+
_e && /* @__PURE__ */ a(
|
|
2232
2243
|
js,
|
|
2233
2244
|
{
|
|
2234
|
-
label:
|
|
2245
|
+
label: T("integrations", "Integrations"),
|
|
2235
2246
|
value: _.integrations,
|
|
2236
2247
|
onChange: (e) => Q((t) => {
|
|
2237
2248
|
const n = { ...t };
|
|
@@ -2241,7 +2252,7 @@ function Xc({
|
|
|
2241
2252
|
),
|
|
2242
2253
|
/* @__PURE__ */ a(Xs, { className: "h-8" }),
|
|
2243
2254
|
/* @__PURE__ */ a(Ds, {}),
|
|
2244
|
-
|
|
2255
|
+
ln > 0 && /* @__PURE__ */ d(
|
|
2245
2256
|
"button",
|
|
2246
2257
|
{
|
|
2247
2258
|
type: "button",
|
|
@@ -2249,36 +2260,36 @@ function Xc({
|
|
|
2249
2260
|
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",
|
|
2250
2261
|
children: [
|
|
2251
2262
|
/* @__PURE__ */ a(fo, { className: "h-3 w-3" }),
|
|
2252
|
-
|
|
2263
|
+
ln,
|
|
2253
2264
|
" update",
|
|
2254
|
-
|
|
2265
|
+
ln === 1 ? "" : "s",
|
|
2255
2266
|
" · Refresh"
|
|
2256
2267
|
]
|
|
2257
2268
|
}
|
|
2258
2269
|
),
|
|
2259
2270
|
/* @__PURE__ */ d("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
|
|
2260
|
-
|
|
2261
|
-
/* @__PURE__ */ a(
|
|
2271
|
+
C === "table" && /* @__PURE__ */ d(rt, { children: [
|
|
2272
|
+
/* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2262
2273
|
"button",
|
|
2263
2274
|
{
|
|
2264
2275
|
type: "button",
|
|
2265
|
-
className:
|
|
2276
|
+
className: E(
|
|
2266
2277
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2267
|
-
|
|
2278
|
+
$ ? "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"
|
|
2268
2279
|
),
|
|
2269
2280
|
children: [
|
|
2270
|
-
/* @__PURE__ */ a(
|
|
2271
|
-
|
|
2281
|
+
/* @__PURE__ */ a(_a, { className: "h-3.5 w-3.5" }),
|
|
2282
|
+
$ ? `Group: ${((ua = ra.find((e) => e.value === $)) == null ? void 0 : ua.label) ?? $}` : "Group"
|
|
2272
2283
|
]
|
|
2273
2284
|
}
|
|
2274
2285
|
) }),
|
|
2275
|
-
/* @__PURE__ */ a(
|
|
2286
|
+
/* @__PURE__ */ a(lt, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Ra, { children: [
|
|
2276
2287
|
/* @__PURE__ */ a(ai, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
|
|
2277
|
-
/* @__PURE__ */ d(
|
|
2288
|
+
/* @__PURE__ */ d(Ea, { children: [
|
|
2278
2289
|
/* @__PURE__ */ a(li, { children: "No attribute found." }),
|
|
2279
|
-
/* @__PURE__ */ a(
|
|
2280
|
-
|
|
2281
|
-
|
|
2290
|
+
/* @__PURE__ */ a(Ft, { value: "__none__", onSelect: () => ot(null), children: "None" }),
|
|
2291
|
+
ra.map((e) => /* @__PURE__ */ a(
|
|
2292
|
+
Ft,
|
|
2282
2293
|
{
|
|
2283
2294
|
value: e.label,
|
|
2284
2295
|
onSelect: () => ot(e.value),
|
|
@@ -2289,14 +2300,14 @@ function Xc({
|
|
|
2289
2300
|
] })
|
|
2290
2301
|
] }) })
|
|
2291
2302
|
] }),
|
|
2292
|
-
|
|
2303
|
+
C === "table" && /* @__PURE__ */ d(
|
|
2293
2304
|
"button",
|
|
2294
2305
|
{
|
|
2295
2306
|
type: "button",
|
|
2296
2307
|
onClick: () => {
|
|
2297
|
-
|
|
2308
|
+
Ie(I === "-priority" ? "" : "-priority"), A(1);
|
|
2298
2309
|
},
|
|
2299
|
-
className:
|
|
2310
|
+
className: E(
|
|
2300
2311
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2301
2312
|
I === "-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"
|
|
2302
2313
|
),
|
|
@@ -2306,43 +2317,43 @@ function Xc({
|
|
|
2306
2317
|
]
|
|
2307
2318
|
}
|
|
2308
2319
|
),
|
|
2309
|
-
|
|
2320
|
+
C === "table" && $ && le && /* @__PURE__ */ a(
|
|
2310
2321
|
"button",
|
|
2311
2322
|
{
|
|
2312
2323
|
type: "button",
|
|
2313
|
-
onClick: () =>
|
|
2314
|
-
|
|
2324
|
+
onClick: () => nn(
|
|
2325
|
+
ke.size > 0 ? /* @__PURE__ */ new Set() : new Set(le.map((e) => e.key))
|
|
2315
2326
|
),
|
|
2316
2327
|
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",
|
|
2317
|
-
children:
|
|
2328
|
+
children: ke.size > 0 ? "Expand all" : "Collapse all"
|
|
2318
2329
|
}
|
|
2319
2330
|
),
|
|
2320
|
-
|
|
2321
|
-
/* @__PURE__ */ a(
|
|
2331
|
+
C === "kanban" && /* @__PURE__ */ d(rt, { children: [
|
|
2332
|
+
/* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2322
2333
|
"button",
|
|
2323
2334
|
{
|
|
2324
2335
|
type: "button",
|
|
2325
|
-
className:
|
|
2336
|
+
className: E(
|
|
2326
2337
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2327
2338
|
st ? "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"
|
|
2328
2339
|
),
|
|
2329
2340
|
children: [
|
|
2330
|
-
/* @__PURE__ */ a(
|
|
2341
|
+
/* @__PURE__ */ a(_a, { className: "h-3.5 w-3.5" }),
|
|
2331
2342
|
st ? `Lanes: ${st === "collection" ? "Collection" : "Owner"}` : "Lanes"
|
|
2332
2343
|
]
|
|
2333
2344
|
}
|
|
2334
2345
|
) }),
|
|
2335
|
-
/* @__PURE__ */ a(
|
|
2336
|
-
/* @__PURE__ */ a(
|
|
2337
|
-
/* @__PURE__ */ a(
|
|
2338
|
-
/* @__PURE__ */ a(
|
|
2346
|
+
/* @__PURE__ */ a(lt, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(Ra, { children: /* @__PURE__ */ d(Ea, { children: [
|
|
2347
|
+
/* @__PURE__ */ a(Ft, { value: "none", onSelect: () => rn(null), children: "None" }),
|
|
2348
|
+
/* @__PURE__ */ a(Ft, { value: "collection", onSelect: () => rn("collection"), children: "Collection" }),
|
|
2349
|
+
/* @__PURE__ */ a(Ft, { value: "owner", onSelect: () => rn("owners"), children: "Owner" })
|
|
2339
2350
|
] }) }) })
|
|
2340
2351
|
] }),
|
|
2341
|
-
G &&
|
|
2352
|
+
G && c && /* @__PURE__ */ d(
|
|
2342
2353
|
"button",
|
|
2343
2354
|
{
|
|
2344
2355
|
type: "button",
|
|
2345
|
-
onClick: () => G({ id:
|
|
2356
|
+
onClick: () => G({ id: c.id, name: c.name }),
|
|
2346
2357
|
"data-tip": "Open Ask AI with a question about this queue",
|
|
2347
2358
|
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",
|
|
2348
2359
|
"data-queue-ask": !0,
|
|
@@ -2357,10 +2368,10 @@ function Xc({
|
|
|
2357
2368
|
"button",
|
|
2358
2369
|
{
|
|
2359
2370
|
type: "button",
|
|
2360
|
-
onClick: () =>
|
|
2371
|
+
onClick: () => Ga((e) => !e),
|
|
2361
2372
|
"aria-expanded": ct,
|
|
2362
2373
|
title: "Trends, aging, pace and states",
|
|
2363
|
-
className:
|
|
2374
|
+
className: E(
|
|
2364
2375
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2365
2376
|
ct ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2366
2377
|
),
|
|
@@ -2371,8 +2382,8 @@ function Xc({
|
|
|
2371
2382
|
]
|
|
2372
2383
|
}
|
|
2373
2384
|
),
|
|
2374
|
-
|
|
2375
|
-
/* @__PURE__ */ a(
|
|
2385
|
+
C === "table" && /* @__PURE__ */ d(rt, { children: [
|
|
2386
|
+
/* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2376
2387
|
"button",
|
|
2377
2388
|
{
|
|
2378
2389
|
type: "button",
|
|
@@ -2383,16 +2394,16 @@ function Xc({
|
|
|
2383
2394
|
]
|
|
2384
2395
|
}
|
|
2385
2396
|
) }),
|
|
2386
|
-
/* @__PURE__ */ a(
|
|
2397
|
+
/* @__PURE__ */ a(lt, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ a(
|
|
2387
2398
|
lo,
|
|
2388
2399
|
{
|
|
2389
2400
|
sensors: Wl,
|
|
2390
2401
|
collisionDetection: oo,
|
|
2391
2402
|
onDragEnd: Hl,
|
|
2392
|
-
children: /* @__PURE__ */ a(so, { items:
|
|
2393
|
-
const t =
|
|
2403
|
+
children: /* @__PURE__ */ a(so, { items: ta, strategy: io, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: ta.map((e) => {
|
|
2404
|
+
const t = Mn.find((n) => n.key === e);
|
|
2394
2405
|
return /* @__PURE__ */ a(
|
|
2395
|
-
|
|
2406
|
+
qi,
|
|
2396
2407
|
{
|
|
2397
2408
|
id: e,
|
|
2398
2409
|
label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
|
|
@@ -2405,7 +2416,7 @@ function Xc({
|
|
|
2405
2416
|
}
|
|
2406
2417
|
) })
|
|
2407
2418
|
] }),
|
|
2408
|
-
|
|
2419
|
+
C === "table" && Pt && /* @__PURE__ */ d(
|
|
2409
2420
|
"button",
|
|
2410
2421
|
{
|
|
2411
2422
|
type: "button",
|
|
@@ -2420,29 +2431,29 @@ function Xc({
|
|
|
2420
2431
|
]
|
|
2421
2432
|
}
|
|
2422
2433
|
),
|
|
2423
|
-
|
|
2434
|
+
C === "table" && /* @__PURE__ */ a(
|
|
2424
2435
|
"button",
|
|
2425
2436
|
{
|
|
2426
2437
|
type: "button",
|
|
2427
2438
|
onClick: () => {
|
|
2428
|
-
const e =
|
|
2429
|
-
|
|
2439
|
+
const e = Rt === "compact" ? "comfortable" : "compact";
|
|
2440
|
+
Aa(e);
|
|
2430
2441
|
try {
|
|
2431
2442
|
localStorage.setItem("nvr_table_density", e);
|
|
2432
2443
|
} catch {
|
|
2433
2444
|
}
|
|
2434
2445
|
},
|
|
2435
2446
|
"aria-label": "Row density",
|
|
2436
|
-
title:
|
|
2447
|
+
title: Rt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
|
|
2437
2448
|
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",
|
|
2438
|
-
children:
|
|
2449
|
+
children: Rt === "compact" ? /* @__PURE__ */ a(wo, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(_o, { className: "h-3.5 w-3.5" })
|
|
2439
2450
|
}
|
|
2440
2451
|
),
|
|
2441
|
-
|
|
2452
|
+
C === "table" && Ma && oe.length > 0 && /* @__PURE__ */ d(
|
|
2442
2453
|
"button",
|
|
2443
2454
|
{
|
|
2444
2455
|
type: "button",
|
|
2445
|
-
onClick: () =>
|
|
2456
|
+
onClick: () => Lr(),
|
|
2446
2457
|
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",
|
|
2447
2458
|
children: [
|
|
2448
2459
|
/* @__PURE__ */ a(No, { className: "h-3 w-3 fill-current" }),
|
|
@@ -2450,21 +2461,21 @@ function Xc({
|
|
|
2450
2461
|
]
|
|
2451
2462
|
}
|
|
2452
2463
|
),
|
|
2453
|
-
!
|
|
2454
|
-
/* @__PURE__ */ a(
|
|
2464
|
+
!pn && re.length === 1 && (Kt ? /* @__PURE__ */ d(rt, { children: [
|
|
2465
|
+
/* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2455
2466
|
"button",
|
|
2456
2467
|
{
|
|
2457
2468
|
type: "button",
|
|
2458
2469
|
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",
|
|
2459
2470
|
children: [
|
|
2460
|
-
/* @__PURE__ */ a(
|
|
2471
|
+
/* @__PURE__ */ a(en, { className: "h-3.5 w-3.5" }),
|
|
2461
2472
|
"New ",
|
|
2462
|
-
|
|
2463
|
-
/* @__PURE__ */ a(
|
|
2473
|
+
Vn(re[0]),
|
|
2474
|
+
/* @__PURE__ */ a(Na, { className: "h-3 w-3 opacity-60" })
|
|
2464
2475
|
]
|
|
2465
2476
|
}
|
|
2466
2477
|
) }),
|
|
2467
|
-
/* @__PURE__ */ d(
|
|
2478
|
+
/* @__PURE__ */ d(lt, { align: "end", className: "w-60 p-1", children: [
|
|
2468
2479
|
/* @__PURE__ */ d(
|
|
2469
2480
|
"button",
|
|
2470
2481
|
{
|
|
@@ -2477,12 +2488,12 @@ function Xc({
|
|
|
2477
2488
|
}),
|
|
2478
2489
|
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",
|
|
2479
2490
|
children: [
|
|
2480
|
-
((
|
|
2491
|
+
((ma = Kt.active) == null ? void 0 : ma.create_label) ?? ((pa = Kt.active) == null ? void 0 : pa.name) ?? "Default layout",
|
|
2481
2492
|
/* @__PURE__ */ a("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
|
|
2482
2493
|
]
|
|
2483
2494
|
}
|
|
2484
2495
|
),
|
|
2485
|
-
|
|
2496
|
+
Kt.options.map((e) => /* @__PURE__ */ a(
|
|
2486
2497
|
"button",
|
|
2487
2498
|
{
|
|
2488
2499
|
type: "button",
|
|
@@ -2510,26 +2521,26 @@ function Xc({
|
|
|
2510
2521
|
}),
|
|
2511
2522
|
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",
|
|
2512
2523
|
children: [
|
|
2513
|
-
/* @__PURE__ */ a(
|
|
2524
|
+
/* @__PURE__ */ a(en, { className: "h-3.5 w-3.5" }),
|
|
2514
2525
|
"New ",
|
|
2515
|
-
|
|
2526
|
+
Vn(re[0])
|
|
2516
2527
|
]
|
|
2517
2528
|
}
|
|
2518
2529
|
)),
|
|
2519
|
-
!
|
|
2520
|
-
/* @__PURE__ */ a(
|
|
2530
|
+
!pn && re.length > 1 && /* @__PURE__ */ d(rt, { children: [
|
|
2531
|
+
/* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2521
2532
|
"button",
|
|
2522
2533
|
{
|
|
2523
2534
|
type: "button",
|
|
2524
2535
|
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",
|
|
2525
2536
|
children: [
|
|
2526
|
-
/* @__PURE__ */ a(
|
|
2537
|
+
/* @__PURE__ */ a(en, { className: "h-3.5 w-3.5" }),
|
|
2527
2538
|
"New",
|
|
2528
|
-
/* @__PURE__ */ a(
|
|
2539
|
+
/* @__PURE__ */ a(Na, { className: "h-3 w-3 opacity-60" })
|
|
2529
2540
|
]
|
|
2530
2541
|
}
|
|
2531
2542
|
) }),
|
|
2532
|
-
/* @__PURE__ */ a(
|
|
2543
|
+
/* @__PURE__ */ a(lt, { align: "end", className: "w-56 p-1", children: re.map((e) => /* @__PURE__ */ d(
|
|
2533
2544
|
"button",
|
|
2534
2545
|
{
|
|
2535
2546
|
type: "button",
|
|
@@ -2540,18 +2551,18 @@ function Xc({
|
|
|
2540
2551
|
}),
|
|
2541
2552
|
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",
|
|
2542
2553
|
children: [
|
|
2543
|
-
/* @__PURE__ */ a(
|
|
2544
|
-
|
|
2554
|
+
/* @__PURE__ */ a(en, { className: "h-3 w-3 opacity-60" }),
|
|
2555
|
+
Vn(e)
|
|
2545
2556
|
]
|
|
2546
2557
|
},
|
|
2547
2558
|
e
|
|
2548
2559
|
)) })
|
|
2549
2560
|
] }),
|
|
2550
|
-
!
|
|
2561
|
+
!pn && Ve && ye && /* @__PURE__ */ a(
|
|
2551
2562
|
Ms,
|
|
2552
2563
|
{
|
|
2553
|
-
collection:
|
|
2554
|
-
onParsed: (e, t) =>
|
|
2564
|
+
collection: Ve,
|
|
2565
|
+
onParsed: (e, t) => ye(`/collections/${Ve}/new`, {
|
|
2555
2566
|
state: { importResult: e, importTemplateId: t.id }
|
|
2556
2567
|
})
|
|
2557
2568
|
}
|
|
@@ -2568,80 +2579,80 @@ function Xc({
|
|
|
2568
2579
|
children: [
|
|
2569
2580
|
/* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex divide-x divide-slate-200 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: [
|
|
2570
2581
|
/* @__PURE__ */ a(
|
|
2571
|
-
|
|
2582
|
+
Tt,
|
|
2572
2583
|
{
|
|
2573
2584
|
label: "Total",
|
|
2574
2585
|
count: (x == null ? void 0 : x.total) ?? 0,
|
|
2575
2586
|
filteredCount: z ? z.total : null,
|
|
2576
|
-
active: Object.values(_).every(
|
|
2577
|
-
isLoading:
|
|
2578
|
-
...
|
|
2579
|
-
onClick:
|
|
2587
|
+
active: Object.values(_).every(Ia) && g === "all",
|
|
2588
|
+
isLoading: He,
|
|
2589
|
+
...ft("total"),
|
|
2590
|
+
onClick: Va
|
|
2580
2591
|
}
|
|
2581
2592
|
),
|
|
2582
2593
|
/* @__PURE__ */ a(
|
|
2583
|
-
|
|
2594
|
+
Tt,
|
|
2584
2595
|
{
|
|
2585
2596
|
label: "Warning",
|
|
2586
2597
|
count: (x == null ? void 0 : x.sla_warning) ?? 0,
|
|
2587
2598
|
filteredCount: z ? z.sla_warning : null,
|
|
2588
2599
|
tone: "amber",
|
|
2589
2600
|
active: _.sla_status === "warning",
|
|
2590
|
-
isLoading:
|
|
2601
|
+
isLoading: He,
|
|
2591
2602
|
deltaBadIsUp: !0,
|
|
2592
|
-
...
|
|
2593
|
-
onClick: () =>
|
|
2603
|
+
...ft("sla_warning"),
|
|
2604
|
+
onClick: () => Ge("sla_status", "warning")
|
|
2594
2605
|
}
|
|
2595
2606
|
),
|
|
2596
2607
|
/* @__PURE__ */ a(
|
|
2597
|
-
|
|
2608
|
+
Tt,
|
|
2598
2609
|
{
|
|
2599
2610
|
label: "Breached",
|
|
2600
2611
|
count: (x == null ? void 0 : x.sla_breached) ?? 0,
|
|
2601
2612
|
filteredCount: z ? z.sla_breached : null,
|
|
2602
2613
|
tone: "red",
|
|
2603
2614
|
active: _.sla_status === "breached",
|
|
2604
|
-
isLoading:
|
|
2615
|
+
isLoading: He,
|
|
2605
2616
|
deltaBadIsUp: !0,
|
|
2606
|
-
...
|
|
2607
|
-
onClick: () =>
|
|
2617
|
+
...ft("sla_breached"),
|
|
2618
|
+
onClick: () => Ge("sla_status", "breached")
|
|
2608
2619
|
}
|
|
2609
2620
|
),
|
|
2610
2621
|
/* @__PURE__ */ a(
|
|
2611
|
-
|
|
2622
|
+
Tt,
|
|
2612
2623
|
{
|
|
2613
2624
|
label: "At Risk",
|
|
2614
2625
|
count: (x == null ? void 0 : x.at_risk) ?? 0,
|
|
2615
2626
|
filteredCount: z ? z.at_risk : null,
|
|
2616
2627
|
tone: "red",
|
|
2617
2628
|
active: _.at_risk === "yes",
|
|
2618
|
-
isLoading:
|
|
2629
|
+
isLoading: He,
|
|
2619
2630
|
deltaBadIsUp: !0,
|
|
2620
|
-
...
|
|
2621
|
-
onClick: () =>
|
|
2631
|
+
...ft("at_risk"),
|
|
2632
|
+
onClick: () => Ge("at_risk", "yes")
|
|
2622
2633
|
}
|
|
2623
2634
|
),
|
|
2624
2635
|
/* @__PURE__ */ a(
|
|
2625
|
-
|
|
2636
|
+
Tt,
|
|
2626
2637
|
{
|
|
2627
2638
|
label: "Unowned",
|
|
2628
2639
|
count: (x == null ? void 0 : x.unowned) ?? 0,
|
|
2629
2640
|
filteredCount: z ? z.unowned : null,
|
|
2630
2641
|
active: g === "unowned",
|
|
2631
|
-
isLoading:
|
|
2642
|
+
isLoading: He,
|
|
2632
2643
|
deltaBadIsUp: !0,
|
|
2633
|
-
...
|
|
2644
|
+
...ft("unowned"),
|
|
2634
2645
|
onClick: () => {
|
|
2635
|
-
Y(g === "unowned" ? "all" : "unowned"),
|
|
2646
|
+
Y(g === "unowned" ? "all" : "unowned"), A(1);
|
|
2636
2647
|
}
|
|
2637
2648
|
}
|
|
2638
2649
|
)
|
|
2639
2650
|
] }),
|
|
2640
|
-
|
|
2641
|
-
["0-1d", "0:24",
|
|
2642
|
-
["1-3d", "24:72",
|
|
2643
|
-
["3-7d", "72:168",
|
|
2644
|
-
["7d+", "168:",
|
|
2651
|
+
bt && x && x.total > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
|
|
2652
|
+
["0-1d", "0:24", bt.d1],
|
|
2653
|
+
["1-3d", "24:72", bt.d3],
|
|
2654
|
+
["3-7d", "72:168", bt.d7],
|
|
2655
|
+
["7d+", "168:", bt.over]
|
|
2645
2656
|
].map(([e, t, n]) => /* @__PURE__ */ d(
|
|
2646
2657
|
"button",
|
|
2647
2658
|
{
|
|
@@ -2650,9 +2661,9 @@ function Xc({
|
|
|
2650
2661
|
Q((r) => ({
|
|
2651
2662
|
...r,
|
|
2652
2663
|
aging_hours: r.aging_hours === t ? "" : t
|
|
2653
|
-
})),
|
|
2664
|
+
})), A(1);
|
|
2654
2665
|
},
|
|
2655
|
-
className:
|
|
2666
|
+
className: E(
|
|
2656
2667
|
"rounded-md border px-2 py-1 tabular-nums transition-colors",
|
|
2657
2668
|
_.aging_hours === t ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-[#0e7490] dark:text-[#67e8f9]" : "border-slate-200 text-slate-500 hover:bg-muted dark:border-border dark:text-muted-foreground",
|
|
2658
2669
|
n === 0 && "opacity-45"
|
|
@@ -2665,38 +2676,38 @@ function Xc({
|
|
|
2665
2676
|
},
|
|
2666
2677
|
e
|
|
2667
2678
|
)) }),
|
|
2668
|
-
|
|
2679
|
+
xe && /* @__PURE__ */ a(
|
|
2669
2680
|
"span",
|
|
2670
2681
|
{
|
|
2671
2682
|
"data-queue-burndown": !0,
|
|
2672
|
-
className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${
|
|
2683
|
+
className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${xe.dir === "down" ? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400" : xe.dir === "up" ? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"}`,
|
|
2673
2684
|
"data-tip": "Average net change per day over the last 14 days of snapshots",
|
|
2674
|
-
children:
|
|
2685
|
+
children: xe.dir === "down" ? /* @__PURE__ */ d(qe, { children: [
|
|
2675
2686
|
"▼ ",
|
|
2676
|
-
Math.abs(
|
|
2687
|
+
Math.abs(xe.pace).toFixed(1),
|
|
2677
2688
|
"/day — clears in ~",
|
|
2678
|
-
|
|
2689
|
+
xe.days,
|
|
2679
2690
|
" day",
|
|
2680
|
-
|
|
2691
|
+
xe.days === 1 ? "" : "s",
|
|
2681
2692
|
" at this pace"
|
|
2682
|
-
] }) :
|
|
2693
|
+
] }) : xe.dir === "up" ? /* @__PURE__ */ d(qe, { children: [
|
|
2683
2694
|
"▲ Growing ",
|
|
2684
|
-
|
|
2695
|
+
xe.pace.toFixed(1),
|
|
2685
2696
|
"/day"
|
|
2686
|
-
] }) : /* @__PURE__ */ a(
|
|
2697
|
+
] }) : /* @__PURE__ */ a(qe, { children: "→ Holding steady" })
|
|
2687
2698
|
}
|
|
2688
2699
|
),
|
|
2689
|
-
|
|
2700
|
+
Rr.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Rr.map(([e, t]) => {
|
|
2690
2701
|
var n;
|
|
2691
2702
|
return /* @__PURE__ */ a(
|
|
2692
|
-
|
|
2703
|
+
$i,
|
|
2693
2704
|
{
|
|
2694
2705
|
label: Ae(e),
|
|
2695
2706
|
count: t,
|
|
2696
2707
|
filteredCount: z ? z.by_state[e] ?? 0 : null,
|
|
2697
|
-
color: ((n =
|
|
2698
|
-
active:
|
|
2699
|
-
onClick: () =>
|
|
2708
|
+
color: ((n = Ne[e]) == null ? void 0 : n.color) ?? null,
|
|
2709
|
+
active: Ua.includes(e),
|
|
2710
|
+
onClick: () => ja(e)
|
|
2700
2711
|
},
|
|
2701
2712
|
e
|
|
2702
2713
|
);
|
|
@@ -2704,17 +2715,17 @@ function Xc({
|
|
|
2704
2715
|
]
|
|
2705
2716
|
}
|
|
2706
2717
|
),
|
|
2707
|
-
|
|
2708
|
-
|
|
2718
|
+
C !== "workload" && /* @__PURE__ */ a(
|
|
2719
|
+
fi,
|
|
2709
2720
|
{
|
|
2710
2721
|
defs: Xl,
|
|
2711
2722
|
values: _,
|
|
2712
|
-
seededKeys:
|
|
2723
|
+
seededKeys: Ct,
|
|
2713
2724
|
onApply: (e) => {
|
|
2714
|
-
Q((t) => ({ ...t, ...e })),
|
|
2725
|
+
Q((t) => ({ ...t, ...e })), A(1);
|
|
2715
2726
|
},
|
|
2716
2727
|
onClear: () => {
|
|
2717
|
-
Q({ ...
|
|
2728
|
+
Q({ ...me.current }), A(1);
|
|
2718
2729
|
},
|
|
2719
2730
|
right: Zl
|
|
2720
2731
|
}
|
|
@@ -2725,19 +2736,19 @@ function Xc({
|
|
|
2725
2736
|
className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900",
|
|
2726
2737
|
"data-queue-saved-views": !0,
|
|
2727
2738
|
children: [
|
|
2728
|
-
((
|
|
2739
|
+
((i == null ? void 0 : i.total) ?? 0) > 0 && be > 0 && /* @__PURE__ */ d(
|
|
2729
2740
|
"span",
|
|
2730
2741
|
{
|
|
2731
|
-
"data-queue-default-hiding":
|
|
2742
|
+
"data-queue-default-hiding": be,
|
|
2732
2743
|
className: "inline-flex h-6 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.06] px-2.5 text-[12px] text-slate-700 dark:text-slate-200",
|
|
2733
2744
|
children: [
|
|
2734
2745
|
"Your default ",
|
|
2735
|
-
mr(
|
|
2746
|
+
mr(jn),
|
|
2736
2747
|
" filter is hiding",
|
|
2737
2748
|
" ",
|
|
2738
|
-
|
|
2749
|
+
be.toLocaleString("en-US"),
|
|
2739
2750
|
" item",
|
|
2740
|
-
|
|
2751
|
+
be === 1 ? "" : "s",
|
|
2741
2752
|
" ·",
|
|
2742
2753
|
/* @__PURE__ */ a(
|
|
2743
2754
|
"button",
|
|
@@ -2762,7 +2773,7 @@ function Xc({
|
|
|
2762
2773
|
_.owners.map(
|
|
2763
2774
|
(e) => {
|
|
2764
2775
|
var t, n;
|
|
2765
|
-
return ((n = (t =
|
|
2776
|
+
return ((n = (t = i == null ? void 0 : i.available_values.owners) == null ? void 0 : t.find(
|
|
2766
2777
|
(r) => String(r.id).toUpperCase() === String(e).toUpperCase()
|
|
2767
2778
|
)) == null ? void 0 : n.name) ?? "someone";
|
|
2768
2779
|
}
|
|
@@ -2777,7 +2788,7 @@ function Xc({
|
|
|
2777
2788
|
Q((e) => {
|
|
2778
2789
|
const { owners: t, ...n } = e;
|
|
2779
2790
|
return n;
|
|
2780
|
-
}),
|
|
2791
|
+
}), A(1);
|
|
2781
2792
|
},
|
|
2782
2793
|
className: "flex h-4 w-4 items-center justify-center rounded-full text-[10px] hover:bg-black/10 dark:hover:bg-white/10",
|
|
2783
2794
|
children: "✕"
|
|
@@ -2792,9 +2803,9 @@ function Xc({
|
|
|
2792
2803
|
type: "button",
|
|
2793
2804
|
onClick: wl,
|
|
2794
2805
|
title: "Revert to the queue default (filters, columns and sort cleared)",
|
|
2795
|
-
className:
|
|
2806
|
+
className: E(
|
|
2796
2807
|
"inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
|
|
2797
|
-
|
|
2808
|
+
Ze == 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"
|
|
2798
2809
|
),
|
|
2799
2810
|
children: "Default"
|
|
2800
2811
|
}
|
|
@@ -2804,49 +2815,49 @@ function Xc({
|
|
|
2804
2815
|
return /* @__PURE__ */ d(
|
|
2805
2816
|
"span",
|
|
2806
2817
|
{
|
|
2807
|
-
className:
|
|
2818
|
+
className: E(
|
|
2808
2819
|
"group inline-flex h-6 items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors",
|
|
2809
|
-
|
|
2820
|
+
Ze === 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"
|
|
2810
2821
|
),
|
|
2811
2822
|
children: [
|
|
2812
2823
|
/* @__PURE__ */ a(
|
|
2813
2824
|
"button",
|
|
2814
2825
|
{
|
|
2815
2826
|
type: "button",
|
|
2816
|
-
title:
|
|
2817
|
-
onClick: () => ql.mutate(
|
|
2818
|
-
className:
|
|
2827
|
+
title: ze === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
|
|
2828
|
+
onClick: () => ql.mutate(ze === e.id ? null : e.id),
|
|
2829
|
+
className: E(
|
|
2819
2830
|
"shrink-0",
|
|
2820
|
-
|
|
2831
|
+
ze === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
|
|
2821
2832
|
),
|
|
2822
2833
|
children: /* @__PURE__ */ a(
|
|
2823
2834
|
So,
|
|
2824
2835
|
{
|
|
2825
|
-
className:
|
|
2826
|
-
"aria-label":
|
|
2836
|
+
className: E("h-3 w-3", ze === e.id && "fill-current"),
|
|
2837
|
+
"aria-label": ze === e.id ? "Default view" : "Set as default"
|
|
2827
2838
|
}
|
|
2828
2839
|
)
|
|
2829
2840
|
}
|
|
2830
2841
|
),
|
|
2831
|
-
/* @__PURE__ */ d("button", { type: "button", onClick: () =>
|
|
2842
|
+
/* @__PURE__ */ d("button", { type: "button", onClick: () => wt(e), children: [
|
|
2832
2843
|
e.name,
|
|
2833
2844
|
e.is_default ? /* @__PURE__ */ a("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ a("span", { className: "ml-1 text-slate-400", children: "· shared" })
|
|
2834
2845
|
] }),
|
|
2835
|
-
|
|
2846
|
+
Jt && /* @__PURE__ */ a(
|
|
2836
2847
|
"button",
|
|
2837
2848
|
{
|
|
2838
2849
|
type: "button",
|
|
2839
2850
|
onClick: () => $l.mutate({ viewId: e.id, on: !e.is_default }),
|
|
2840
2851
|
title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
|
|
2841
|
-
className:
|
|
2852
|
+
className: E(
|
|
2842
2853
|
"shrink-0",
|
|
2843
2854
|
e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
2844
2855
|
),
|
|
2845
2856
|
"aria-label": e.is_default ? "Unset queue default" : "Set queue default",
|
|
2846
|
-
children: /* @__PURE__ */ a(Co, { className:
|
|
2857
|
+
children: /* @__PURE__ */ a(Co, { className: E("h-3 w-3", e.is_default && "fill-current") })
|
|
2847
2858
|
}
|
|
2848
2859
|
),
|
|
2849
|
-
(e.user === N || De) &&
|
|
2860
|
+
(e.user === N || De) && Ze === e.id && /* @__PURE__ */ a(
|
|
2850
2861
|
"button",
|
|
2851
2862
|
{
|
|
2852
2863
|
type: "button",
|
|
@@ -2855,8 +2866,8 @@ function Xc({
|
|
|
2855
2866
|
title: "Update this view with the current filters, scope and sort",
|
|
2856
2867
|
className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
|
|
2857
2868
|
"aria-label": `Update view ${e.name}`,
|
|
2858
|
-
"data-view-update-state": Ke.isPending ? "saving" :
|
|
2859
|
-
children: Ke.isPending && ((t = Ke.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a($o, { className: "h-3 w-3 animate-spin" }) :
|
|
2869
|
+
"data-view-update-state": Ke.isPending ? "saving" : Qr === e.id ? "saved" : "idle",
|
|
2870
|
+
children: Ke.isPending && ((t = Ke.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a($o, { className: "h-3 w-3 animate-spin" }) : Qr === e.id ? /* @__PURE__ */ a(
|
|
2860
2871
|
qo,
|
|
2861
2872
|
{
|
|
2862
2873
|
className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
|
|
@@ -2865,21 +2876,21 @@ function Xc({
|
|
|
2865
2876
|
) : /* @__PURE__ */ a(Fo, { className: "h-3 w-3" })
|
|
2866
2877
|
}
|
|
2867
2878
|
),
|
|
2868
|
-
|
|
2879
|
+
Ze === e.id && /* @__PURE__ */ a(
|
|
2869
2880
|
"button",
|
|
2870
2881
|
{
|
|
2871
2882
|
type: "button",
|
|
2872
|
-
onClick: () =>
|
|
2873
|
-
title:
|
|
2874
|
-
className:
|
|
2883
|
+
onClick: () => Ha(e.id),
|
|
2884
|
+
title: Mt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
|
|
2885
|
+
className: E(
|
|
2875
2886
|
"shrink-0",
|
|
2876
|
-
|
|
2887
|
+
Mt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
2877
2888
|
),
|
|
2878
2889
|
"aria-label": `Subscribe to view ${e.name}`,
|
|
2879
|
-
children: /* @__PURE__ */ a(To, { className:
|
|
2890
|
+
children: /* @__PURE__ */ a(To, { className: E("h-3 w-3", Mt(e.id) && "fill-current") })
|
|
2880
2891
|
}
|
|
2881
2892
|
),
|
|
2882
|
-
e.user === N && (
|
|
2893
|
+
e.user === N && (Ln === e.id ? /* @__PURE__ */ d(
|
|
2883
2894
|
"span",
|
|
2884
2895
|
{
|
|
2885
2896
|
className: "flex shrink-0 items-center gap-1",
|
|
@@ -2890,8 +2901,8 @@ function Xc({
|
|
|
2890
2901
|
"button",
|
|
2891
2902
|
{
|
|
2892
2903
|
type: "button",
|
|
2893
|
-
onClick: () =>
|
|
2894
|
-
disabled:
|
|
2904
|
+
onClick: () => jr.mutate(e.id),
|
|
2905
|
+
disabled: jr.isPending,
|
|
2895
2906
|
className: "font-semibold text-red-600 hover:underline disabled:opacity-50 dark:text-red-400",
|
|
2896
2907
|
"aria-label": `Yes, delete view ${e.name}`,
|
|
2897
2908
|
children: "Yes"
|
|
@@ -2901,7 +2912,7 @@ function Xc({
|
|
|
2901
2912
|
"button",
|
|
2902
2913
|
{
|
|
2903
2914
|
type: "button",
|
|
2904
|
-
onClick: () =>
|
|
2915
|
+
onClick: () => zt(null),
|
|
2905
2916
|
className: "text-slate-500 hover:underline dark:text-slate-400",
|
|
2906
2917
|
"aria-label": `Keep view ${e.name}`,
|
|
2907
2918
|
children: "No"
|
|
@@ -2913,7 +2924,7 @@ function Xc({
|
|
|
2913
2924
|
"button",
|
|
2914
2925
|
{
|
|
2915
2926
|
type: "button",
|
|
2916
|
-
onClick: () =>
|
|
2927
|
+
onClick: () => zt(e.id),
|
|
2917
2928
|
className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
|
|
2918
2929
|
"aria-label": `Delete view ${e.name}`,
|
|
2919
2930
|
children: "×"
|
|
@@ -2924,8 +2935,8 @@ function Xc({
|
|
|
2924
2935
|
e.id
|
|
2925
2936
|
);
|
|
2926
2937
|
}),
|
|
2927
|
-
/* @__PURE__ */ d(
|
|
2928
|
-
/* @__PURE__ */ a(
|
|
2938
|
+
/* @__PURE__ */ d(rt, { open: vl, onOpenChange: Rn, children: [
|
|
2939
|
+
/* @__PURE__ */ a(at, { asChild: !0, children: /* @__PURE__ */ a(
|
|
2929
2940
|
"button",
|
|
2930
2941
|
{
|
|
2931
2942
|
type: "button",
|
|
@@ -2934,16 +2945,16 @@ function Xc({
|
|
|
2934
2945
|
children: "☆ Save view"
|
|
2935
2946
|
}
|
|
2936
2947
|
) }),
|
|
2937
|
-
/* @__PURE__ */ d(
|
|
2948
|
+
/* @__PURE__ */ d(lt, { className: "w-[240px] p-3", align: "end", children: [
|
|
2938
2949
|
(() => {
|
|
2939
|
-
const e = j == null ? void 0 : j.data.find((t) => t.id ===
|
|
2950
|
+
const e = j == null ? void 0 : j.data.find((t) => t.id === Ze);
|
|
2940
2951
|
return !e || e.user !== N && !De ? null : /* @__PURE__ */ d(
|
|
2941
2952
|
"button",
|
|
2942
2953
|
{
|
|
2943
2954
|
type: "button",
|
|
2944
2955
|
disabled: Ke.isPending,
|
|
2945
2956
|
onClick: () => {
|
|
2946
|
-
Ke.mutate(e),
|
|
2957
|
+
Ke.mutate(e), Rn(!1);
|
|
2947
2958
|
},
|
|
2948
2959
|
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",
|
|
2949
2960
|
children: [
|
|
@@ -2957,29 +2968,29 @@ function Xc({
|
|
|
2957
2968
|
/* @__PURE__ */ a(
|
|
2958
2969
|
"input",
|
|
2959
2970
|
{
|
|
2960
|
-
value:
|
|
2961
|
-
onChange: (e) =>
|
|
2971
|
+
value: En,
|
|
2972
|
+
onChange: (e) => Ar(e.target.value),
|
|
2962
2973
|
placeholder: "View name",
|
|
2963
2974
|
className: "mb-2 w-full rounded-md border border-slate-200 px-2 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
|
|
2964
2975
|
}
|
|
2965
2976
|
),
|
|
2966
|
-
|
|
2977
|
+
Jt && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
2967
2978
|
/* @__PURE__ */ a(
|
|
2968
|
-
|
|
2979
|
+
Wn,
|
|
2969
2980
|
{
|
|
2970
|
-
checked:
|
|
2971
|
-
disabled:
|
|
2972
|
-
onCheckedChange: (e) =>
|
|
2981
|
+
checked: Or || vt,
|
|
2982
|
+
disabled: vt,
|
|
2983
|
+
onCheckedChange: (e) => Dr(e === !0)
|
|
2973
2984
|
}
|
|
2974
2985
|
),
|
|
2975
2986
|
"Share with everyone"
|
|
2976
2987
|
] }),
|
|
2977
|
-
|
|
2988
|
+
Jt && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
2978
2989
|
/* @__PURE__ */ a(
|
|
2979
|
-
|
|
2990
|
+
Wn,
|
|
2980
2991
|
{
|
|
2981
|
-
checked:
|
|
2982
|
-
onCheckedChange: (e) =>
|
|
2992
|
+
checked: vt,
|
|
2993
|
+
onCheckedChange: (e) => Kr(e === !0)
|
|
2983
2994
|
}
|
|
2984
2995
|
),
|
|
2985
2996
|
"Set as queue default (everyone starts here)"
|
|
@@ -2988,8 +2999,8 @@ function Xc({
|
|
|
2988
2999
|
"button",
|
|
2989
3000
|
{
|
|
2990
3001
|
type: "button",
|
|
2991
|
-
disabled: !
|
|
2992
|
-
onClick: () =>
|
|
3002
|
+
disabled: !En.trim() || Mr.isPending,
|
|
3003
|
+
onClick: () => Mr.mutate(),
|
|
2993
3004
|
className: "w-full rounded-md bg-nvr-cyan px-2 py-1.5 text-[12px] font-semibold text-white hover:bg-nvr-cyan/90 disabled:opacity-50",
|
|
2994
3005
|
children: "Save current view"
|
|
2995
3006
|
}
|
|
@@ -3000,30 +3011,30 @@ function Xc({
|
|
|
3000
3011
|
}
|
|
3001
3012
|
)
|
|
3002
3013
|
] }),
|
|
3003
|
-
/* @__PURE__ */ d("div", { ref:
|
|
3004
|
-
cr && /* @__PURE__ */ a(Is, { error:
|
|
3005
|
-
|
|
3014
|
+
/* @__PURE__ */ d("div", { ref: Ht, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
|
|
3015
|
+
cr && /* @__PURE__ */ a(Is, { error: Za, onRetry: () => void el(), className: "mb-3" }),
|
|
3016
|
+
Un && /* @__PURE__ */ a(
|
|
3006
3017
|
"p",
|
|
3007
3018
|
{
|
|
3008
3019
|
"data-filter-sentence": !0,
|
|
3009
|
-
"data-tip":
|
|
3020
|
+
"data-tip": Un,
|
|
3010
3021
|
"aria-live": "polite",
|
|
3011
3022
|
className: "mb-1.5 shrink-0 truncate px-0.5 text-[11.5px] text-slate-500 dark:text-slate-400",
|
|
3012
|
-
children:
|
|
3023
|
+
children: Un
|
|
3013
3024
|
}
|
|
3014
3025
|
),
|
|
3015
|
-
|
|
3026
|
+
C === "table" ? /* @__PURE__ */ a(qe, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
|
|
3016
3027
|
"div",
|
|
3017
3028
|
{
|
|
3018
|
-
ref:
|
|
3019
|
-
className:
|
|
3029
|
+
ref: Fe.rootRef,
|
|
3030
|
+
className: E(
|
|
3020
3031
|
"relative min-w-0 flex-1 transition-opacity duration-200",
|
|
3021
3032
|
br && "pointer-events-none opacity-60"
|
|
3022
3033
|
),
|
|
3023
3034
|
"aria-busy": br || void 0,
|
|
3024
3035
|
children: [
|
|
3025
3036
|
hr != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
|
|
3026
|
-
|
|
3037
|
+
al.text ?? "Still working",
|
|
3027
3038
|
" — ",
|
|
3028
3039
|
hr,
|
|
3029
3040
|
"s"
|
|
@@ -3032,41 +3043,41 @@ function Xc({
|
|
|
3032
3043
|
As,
|
|
3033
3044
|
{
|
|
3034
3045
|
fillHeight: !0,
|
|
3035
|
-
enterKey:
|
|
3036
|
-
density:
|
|
3046
|
+
enterKey: vr.current,
|
|
3047
|
+
density: Rt,
|
|
3037
3048
|
minBodyHeight: 360,
|
|
3038
|
-
columns:
|
|
3049
|
+
columns: Xt,
|
|
3039
3050
|
rows: q,
|
|
3040
3051
|
rowKey: (e) => `${e.collection}:${e.item_id}`,
|
|
3041
|
-
total: (
|
|
3052
|
+
total: (i == null ? void 0 : i.total) ?? 0,
|
|
3042
3053
|
page: de,
|
|
3043
|
-
limit:
|
|
3044
|
-
isLoading:
|
|
3045
|
-
onPageChange:
|
|
3046
|
-
onRowClick: (e) =>
|
|
3054
|
+
limit: mn,
|
|
3055
|
+
isLoading: He,
|
|
3056
|
+
onPageChange: A,
|
|
3057
|
+
onRowClick: (e) => Wt(e),
|
|
3047
3058
|
rowDragProps: (e) => ({
|
|
3048
|
-
...
|
|
3049
|
-
...
|
|
3059
|
+
...dl({ collection: e.collection, id: e.item_id }),
|
|
3060
|
+
...ll.record(e.collection, e.item_id)
|
|
3050
3061
|
}),
|
|
3051
3062
|
onRowContextMenu: (e, t) => {
|
|
3052
|
-
t.preventDefault(),
|
|
3063
|
+
t.preventDefault(), kt({ x: t.clientX, y: t.clientY, row: e });
|
|
3053
3064
|
},
|
|
3054
3065
|
rowTitle: (e) => {
|
|
3055
|
-
const t =
|
|
3056
|
-
return
|
|
3066
|
+
const t = ht.get(D(e));
|
|
3067
|
+
return Fe.titleFor(D(e)) ?? (t && !t.is_mine ? ss(t) : void 0) ?? (Pr(e.collection, e.item_id) ? zs : void 0);
|
|
3057
3068
|
},
|
|
3058
|
-
rowClassName: (e) =>
|
|
3069
|
+
rowClassName: (e) => E(
|
|
3059
3070
|
Cl(e),
|
|
3060
|
-
|
|
3071
|
+
Pr(e.collection, e.item_id) && Js
|
|
3061
3072
|
),
|
|
3062
3073
|
emptyMessage: cr ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
|
|
3063
3074
|
Os,
|
|
3064
3075
|
{
|
|
3065
3076
|
icon: Ro,
|
|
3066
|
-
title: ((
|
|
3067
|
-
detail: ((
|
|
3068
|
-
action: ((
|
|
3069
|
-
|
|
3077
|
+
title: ((ba = i == null ? void 0 : i.empty) == null ? void 0 : ba.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((ha = i == null ? void 0 : i.empty) == null ? void 0 : ha.reason) === "scope_mine" ? "Nothing waiting on you" : ((fa = i == null ? void 0 : i.empty) == null ? void 0 : fa.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
|
|
3078
|
+
detail: ((ga = i == null ? void 0 : i.empty) == null ? void 0 : ga.reason) === "filters" && be > 0 ? `Your default ${mr(jn)} filter is hiding ${be.toLocaleString("en-US")} item${be === 1 ? "" : "s"} here.` : ((xa = i == null ? void 0 : i.empty) == null ? void 0 : xa.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((ya = i == null ? void 0 : i.empty) == null ? void 0 : ya.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
|
|
3079
|
+
action: ((ka = i == null ? void 0 : i.empty) == null ? void 0 : ka.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
|
|
3080
|
+
be > 0 && /* @__PURE__ */ d(
|
|
3070
3081
|
"button",
|
|
3071
3082
|
{
|
|
3072
3083
|
type: "button",
|
|
@@ -3075,7 +3086,7 @@ function Xc({
|
|
|
3075
3086
|
"data-queue-empty-defaults": !0,
|
|
3076
3087
|
children: [
|
|
3077
3088
|
"Show all ",
|
|
3078
|
-
|
|
3089
|
+
be.toLocaleString("en-US")
|
|
3079
3090
|
]
|
|
3080
3091
|
}
|
|
3081
3092
|
),
|
|
@@ -3086,9 +3097,9 @@ function Xc({
|
|
|
3086
3097
|
onClick: () => {
|
|
3087
3098
|
var t;
|
|
3088
3099
|
const e = {};
|
|
3089
|
-
for (const [n, r] of Object.entries(
|
|
3090
|
-
(t =
|
|
3091
|
-
Q(e),
|
|
3100
|
+
for (const [n, r] of Object.entries(me.current))
|
|
3101
|
+
(t = Te[n.slice(6)]) != null && t.length && (e[n] = r);
|
|
3102
|
+
Q(e), A(1);
|
|
3092
3103
|
},
|
|
3093
3104
|
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",
|
|
3094
3105
|
"data-queue-empty-clear": !0,
|
|
@@ -3100,7 +3111,7 @@ function Xc({
|
|
|
3100
3111
|
{
|
|
3101
3112
|
type: "button",
|
|
3102
3113
|
onClick: () => {
|
|
3103
|
-
Y("all"),
|
|
3114
|
+
Y("all"), A(1);
|
|
3104
3115
|
},
|
|
3105
3116
|
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",
|
|
3106
3117
|
"data-queue-empty-all": !0,
|
|
@@ -3112,24 +3123,24 @@ function Xc({
|
|
|
3112
3123
|
),
|
|
3113
3124
|
sort: I,
|
|
3114
3125
|
onSortChange: (e) => {
|
|
3115
|
-
|
|
3126
|
+
Ie(e), A(1);
|
|
3116
3127
|
},
|
|
3117
|
-
filterDefs:
|
|
3128
|
+
filterDefs: Bn,
|
|
3118
3129
|
filterValues: _,
|
|
3119
3130
|
onFilterChange: (e, t) => {
|
|
3120
|
-
Q((n) => ({ ...n, [e]: t })),
|
|
3131
|
+
Q((n) => ({ ...n, [e]: t })), A(1);
|
|
3121
3132
|
},
|
|
3122
3133
|
rowGroups: Rl ?? void 0,
|
|
3123
|
-
collapsedGroups:
|
|
3134
|
+
collapsedGroups: ke,
|
|
3124
3135
|
onToggleGroup: xl,
|
|
3125
|
-
selectedIds:
|
|
3126
|
-
onSelectionChange:
|
|
3136
|
+
selectedIds: Pt && ee ? Pe : void 0,
|
|
3137
|
+
onSelectionChange: Pt && ee ? tt : void 0,
|
|
3127
3138
|
hideFilterRow: !0,
|
|
3128
3139
|
nowrapCells: !0,
|
|
3129
|
-
columnPins:
|
|
3140
|
+
columnPins: na,
|
|
3130
3141
|
onColumnPinChange: (e, t) => {
|
|
3131
|
-
|
|
3132
|
-
const r = { ...n ??
|
|
3142
|
+
an((n) => {
|
|
3143
|
+
const r = { ...n ?? na };
|
|
3133
3144
|
return t ? r[e] = t : delete r[e], r;
|
|
3134
3145
|
});
|
|
3135
3146
|
},
|
|
@@ -3138,14 +3149,14 @@ function Xc({
|
|
|
3138
3149
|
footer: /* @__PURE__ */ a(
|
|
3139
3150
|
ei,
|
|
3140
3151
|
{
|
|
3141
|
-
collections:
|
|
3152
|
+
collections: gt,
|
|
3142
3153
|
selectedIds: String(_.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
|
|
3143
3154
|
onToggle: (e) => {
|
|
3144
3155
|
const t = e.ids.join(",");
|
|
3145
3156
|
Q((n) => ({
|
|
3146
3157
|
...n,
|
|
3147
3158
|
at_risk_rule: n.at_risk_rule === t ? "" : t
|
|
3148
|
-
})),
|
|
3159
|
+
})), A(1);
|
|
3149
3160
|
},
|
|
3150
3161
|
className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
|
|
3151
3162
|
}
|
|
@@ -3154,38 +3165,38 @@ function Xc({
|
|
|
3154
3165
|
)
|
|
3155
3166
|
]
|
|
3156
3167
|
}
|
|
3157
|
-
) }) }) :
|
|
3158
|
-
|
|
3168
|
+
) }) }) : C === "kanban" ? /* @__PURE__ */ a(
|
|
3169
|
+
hi,
|
|
3159
3170
|
{
|
|
3160
3171
|
items: q,
|
|
3161
|
-
onCardClick: (e) =>
|
|
3162
|
-
onDrop: (e, t) =>
|
|
3172
|
+
onCardClick: (e) => Wt(e),
|
|
3173
|
+
onDrop: (e, t) => ol.mutate({ item: e, targetState: t }),
|
|
3163
3174
|
onClaim: (e) => Le.mutate(e),
|
|
3164
|
-
onRelease: (e) =>
|
|
3175
|
+
onRelease: (e) => Ye.mutate(e),
|
|
3165
3176
|
swimlaneBy: st,
|
|
3166
|
-
stateLabels:
|
|
3167
|
-
laneLabel: st === "collection" ?
|
|
3168
|
-
claimsEnabled:
|
|
3177
|
+
stateLabels: $n,
|
|
3178
|
+
laneLabel: st === "collection" ? xt : void 0,
|
|
3179
|
+
claimsEnabled: pe,
|
|
3169
3180
|
onDraggingChange: (e) => {
|
|
3170
|
-
|
|
3181
|
+
cn.current = e;
|
|
3171
3182
|
}
|
|
3172
3183
|
}
|
|
3173
|
-
) : /* @__PURE__ */ a(
|
|
3184
|
+
) : /* @__PURE__ */ a(gi, { queueId: l })
|
|
3174
3185
|
] }),
|
|
3175
|
-
|
|
3176
|
-
|
|
3186
|
+
Pt && ee && /* @__PURE__ */ d(
|
|
3187
|
+
pi,
|
|
3177
3188
|
{
|
|
3178
3189
|
count: Pe.length,
|
|
3179
|
-
claimsEnabled:
|
|
3180
|
-
showClaim:
|
|
3181
|
-
showRelease:
|
|
3182
|
-
showTransition:
|
|
3183
|
-
states:
|
|
3190
|
+
claimsEnabled: pe,
|
|
3191
|
+
showClaim: bn("claim"),
|
|
3192
|
+
showRelease: bn("release"),
|
|
3193
|
+
showTransition: bn("transition"),
|
|
3194
|
+
states: Er((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
|
|
3184
3195
|
value: e,
|
|
3185
3196
|
label: Ae(e)
|
|
3186
3197
|
})),
|
|
3187
|
-
busy:
|
|
3188
|
-
onClaim: () =>
|
|
3198
|
+
busy: Ir,
|
|
3199
|
+
onClaim: () => An(
|
|
3189
3200
|
"Claim",
|
|
3190
3201
|
(e) => h.request(
|
|
3191
3202
|
se(`/queues/${l}/claim`, {
|
|
@@ -3194,7 +3205,7 @@ function Xc({
|
|
|
3194
3205
|
})
|
|
3195
3206
|
)
|
|
3196
3207
|
),
|
|
3197
|
-
onRelease: () =>
|
|
3208
|
+
onRelease: () => An(
|
|
3198
3209
|
"Release",
|
|
3199
3210
|
(e) => h.request(
|
|
3200
3211
|
se(`/queues/${l}/release`, {
|
|
@@ -3203,8 +3214,8 @@ function Xc({
|
|
|
3203
3214
|
})
|
|
3204
3215
|
)
|
|
3205
3216
|
),
|
|
3206
|
-
onTransition: (e) =>
|
|
3207
|
-
onClear: () =>
|
|
3217
|
+
onTransition: (e) => An("Transition", (t) => fr(t, e)),
|
|
3218
|
+
onClear: () => tt([]),
|
|
3208
3219
|
children: [
|
|
3209
3220
|
Pe.length >= 2 && /* @__PURE__ */ a(
|
|
3210
3221
|
"button",
|
|
@@ -3212,9 +3223,9 @@ function Xc({
|
|
|
3212
3223
|
type: "button",
|
|
3213
3224
|
onClick: () => {
|
|
3214
3225
|
const e = cs(
|
|
3215
|
-
q.filter((t) => Pe.includes(
|
|
3226
|
+
q.filter((t) => Pe.includes(D(t)) && t.collection !== "tasks").map((t) => H.urlFor(Tn(t)))
|
|
3216
3227
|
);
|
|
3217
|
-
e.blocked > 0 || e.capped > 0 ?
|
|
3228
|
+
e.blocked > 0 || e.capped > 0 ? O.warning(qa(e)) : O.success(qa(e));
|
|
3218
3229
|
},
|
|
3219
3230
|
"data-bulk-open-tabs": !0,
|
|
3220
3231
|
title: `Open the selected records in new tabs (up to ${is})`,
|
|
@@ -3225,12 +3236,12 @@ function Xc({
|
|
|
3225
3236
|
/* @__PURE__ */ a(
|
|
3226
3237
|
Ts,
|
|
3227
3238
|
{
|
|
3228
|
-
targets: q.filter((e) => Pe.includes(
|
|
3239
|
+
targets: q.filter((e) => Pe.includes(D(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
|
|
3229
3240
|
enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
|
|
3230
3241
|
tone: "light",
|
|
3231
|
-
disabled:
|
|
3242
|
+
disabled: Ir,
|
|
3232
3243
|
onDone: (e) => {
|
|
3233
|
-
e.failed === 0 &&
|
|
3244
|
+
e.failed === 0 && tt([]), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
3234
3245
|
}
|
|
3235
3246
|
}
|
|
3236
3247
|
)
|
|
@@ -3247,12 +3258,12 @@ function Xc({
|
|
|
3247
3258
|
width: ae[0].width,
|
|
3248
3259
|
title: ae[0].title,
|
|
3249
3260
|
stack: ae,
|
|
3250
|
-
onPush: (e) =>
|
|
3251
|
-
onPop: () =>
|
|
3252
|
-
onClose: () =>
|
|
3261
|
+
onPush: (e) => Nt.push([...ae, e]),
|
|
3262
|
+
onPop: () => Nt.back(),
|
|
3263
|
+
onClose: () => Nt.back(ae.length)
|
|
3253
3264
|
}
|
|
3254
3265
|
) : null,
|
|
3255
|
-
B &&
|
|
3266
|
+
B && Sa(
|
|
3256
3267
|
/* @__PURE__ */ d(
|
|
3257
3268
|
"div",
|
|
3258
3269
|
{
|
|
@@ -3267,23 +3278,23 @@ function Xc({
|
|
|
3267
3278
|
"data-queue-row-menu": !0,
|
|
3268
3279
|
children: [
|
|
3269
3280
|
[
|
|
3270
|
-
{ label: "Open", run: () =>
|
|
3281
|
+
{ label: "Open", run: () => Wt(B.row) },
|
|
3271
3282
|
{
|
|
3272
3283
|
label: "Open full record",
|
|
3273
|
-
run: () =>
|
|
3284
|
+
run: () => yt(B.row)
|
|
3274
3285
|
},
|
|
3275
3286
|
{ label: "Peek", run: () => Oe(B.row) },
|
|
3276
|
-
...
|
|
3277
|
-
((
|
|
3287
|
+
...pe ? [
|
|
3288
|
+
((va = B.row.claimed_by) == null ? void 0 : va.id) === N ? { label: "Release claim", run: () => Ye.mutate(B.row) } : { label: "Claim", run: () => Le.mutate(B.row) }
|
|
3278
3289
|
] : [],
|
|
3279
3290
|
// The friendly id (PW26-76166), never the row id (army 6 M52);
|
|
3280
3291
|
// a record with no number has nothing to copy.
|
|
3281
|
-
...
|
|
3292
|
+
...Fa(B.row) ? [
|
|
3282
3293
|
{
|
|
3283
3294
|
label: "Copy ID",
|
|
3284
3295
|
run: () => {
|
|
3285
3296
|
var e;
|
|
3286
|
-
return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
|
|
3297
|
+
return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(Fa(B.row) ?? ""));
|
|
3287
3298
|
}
|
|
3288
3299
|
}
|
|
3289
3300
|
] : [],
|
|
@@ -3292,21 +3303,21 @@ function Xc({
|
|
|
3292
3303
|
run: () => {
|
|
3293
3304
|
var e;
|
|
3294
3305
|
return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
|
|
3295
|
-
`${window.location.origin}${H.urlFor(
|
|
3306
|
+
`${window.location.origin}${H.urlFor(Tn(B.row))}`
|
|
3296
3307
|
));
|
|
3297
3308
|
}
|
|
3298
3309
|
},
|
|
3299
3310
|
// Custom actions (#125): the record's registered actions, right here.
|
|
3300
|
-
...
|
|
3311
|
+
...Ja(B.row.collection).map((e) => ({
|
|
3301
3312
|
label: e.label,
|
|
3302
|
-
run: () =>
|
|
3313
|
+
run: () => za(e, B.row)
|
|
3303
3314
|
}))
|
|
3304
3315
|
].map((e) => /* @__PURE__ */ a(
|
|
3305
3316
|
"button",
|
|
3306
3317
|
{
|
|
3307
3318
|
type: "button",
|
|
3308
3319
|
onClick: () => {
|
|
3309
|
-
e.run(),
|
|
3320
|
+
e.run(), kt(null);
|
|
3310
3321
|
},
|
|
3311
3322
|
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",
|
|
3312
3323
|
children: e.label
|
|
@@ -3315,14 +3326,14 @@ function Xc({
|
|
|
3315
3326
|
)),
|
|
3316
3327
|
B.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
|
|
3317
3328
|
/* @__PURE__ */ a("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
|
|
3318
|
-
|
|
3329
|
+
xn.slice(0, 8).map((e) => {
|
|
3319
3330
|
const t = (B.row.labels ?? []).includes(e);
|
|
3320
3331
|
return /* @__PURE__ */ d(
|
|
3321
3332
|
"button",
|
|
3322
3333
|
{
|
|
3323
3334
|
type: "button",
|
|
3324
3335
|
onClick: () => {
|
|
3325
|
-
sr(B.row, e),
|
|
3336
|
+
sr(B.row, e), kt(null);
|
|
3326
3337
|
},
|
|
3327
3338
|
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",
|
|
3328
3339
|
children: [
|
|
@@ -3346,7 +3357,7 @@ function Xc({
|
|
|
3346
3357
|
const n = e.target.elements.namedItem(
|
|
3347
3358
|
"newlabel"
|
|
3348
3359
|
).value.trim();
|
|
3349
|
-
n && (sr(B.row, n),
|
|
3360
|
+
n && (sr(B.row, n), kt(null));
|
|
3350
3361
|
},
|
|
3351
3362
|
className: "px-3 py-1",
|
|
3352
3363
|
children: /* @__PURE__ */ a(
|
|
@@ -3367,56 +3378,57 @@ function Xc({
|
|
|
3367
3378
|
),
|
|
3368
3379
|
document.body
|
|
3369
3380
|
),
|
|
3370
|
-
or &&
|
|
3381
|
+
or && Sa(
|
|
3371
3382
|
/* @__PURE__ */ a(
|
|
3372
|
-
|
|
3383
|
+
Fi,
|
|
3373
3384
|
{
|
|
3374
3385
|
queueId: l,
|
|
3375
3386
|
drill: or,
|
|
3376
|
-
onClose: () =>
|
|
3387
|
+
onClose: () => fn(null),
|
|
3377
3388
|
onOpenRecord: (e, t) => {
|
|
3378
|
-
|
|
3389
|
+
fn(null), H.open({ collection: e, itemId: t, layoutSlug: null });
|
|
3379
3390
|
}
|
|
3380
3391
|
}
|
|
3381
3392
|
),
|
|
3382
3393
|
document.body
|
|
3383
3394
|
),
|
|
3384
3395
|
/* @__PURE__ */ a(
|
|
3385
|
-
|
|
3396
|
+
bi,
|
|
3386
3397
|
{
|
|
3387
|
-
item:
|
|
3388
|
-
stateLabels:
|
|
3389
|
-
collectionLabel:
|
|
3390
|
-
claimsEnabled:
|
|
3398
|
+
item: Se,
|
|
3399
|
+
stateLabels: $n,
|
|
3400
|
+
collectionLabel: xt,
|
|
3401
|
+
claimsEnabled: pe,
|
|
3391
3402
|
columnFormats: Al,
|
|
3403
|
+
fieldLabel: (e) => T(`extra.${e}`, je(e)),
|
|
3392
3404
|
width: u == null ? void 0 : u.sheet_width,
|
|
3393
3405
|
itemLayout: u == null ? void 0 : u.item_layout,
|
|
3394
3406
|
onOpenChange: (e) => {
|
|
3395
|
-
e || (Oe(null),
|
|
3407
|
+
e || (Oe(null), Fn(!1));
|
|
3396
3408
|
},
|
|
3397
3409
|
onClaim: (e) => Le.mutate(e),
|
|
3398
|
-
onRelease: (e) =>
|
|
3410
|
+
onRelease: (e) => Ye.mutate(e),
|
|
3399
3411
|
workNextActive: yl,
|
|
3400
|
-
onNext: () =>
|
|
3412
|
+
onNext: () => Se && Lr(Se),
|
|
3401
3413
|
refetchItems: () => f.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
3402
3414
|
}
|
|
3403
3415
|
),
|
|
3404
|
-
|
|
3416
|
+
Qt.dialog
|
|
3405
3417
|
] });
|
|
3406
3418
|
}
|
|
3407
|
-
function
|
|
3419
|
+
function Fi({
|
|
3408
3420
|
queueId: l,
|
|
3409
|
-
drill:
|
|
3410
|
-
onClose:
|
|
3411
|
-
onOpenRecord:
|
|
3421
|
+
drill: k,
|
|
3422
|
+
onClose: K,
|
|
3423
|
+
onOpenRecord: M
|
|
3412
3424
|
}) {
|
|
3413
|
-
const G =
|
|
3414
|
-
queryKey: ["queue-agg-rows", l,
|
|
3425
|
+
const G = La(), { data: f, isLoading: h } = W({
|
|
3426
|
+
queryKey: ["queue-agg-rows", l, k.row.collection, k.row.item_id, k.path],
|
|
3415
3427
|
queryFn: () => G.request(
|
|
3416
3428
|
L(`/queues/${l}/aggregate-rows`, {
|
|
3417
|
-
collection:
|
|
3418
|
-
item_id:
|
|
3419
|
-
path:
|
|
3429
|
+
collection: k.row.collection,
|
|
3430
|
+
item_id: k.row.item_id,
|
|
3431
|
+
path: k.path
|
|
3420
3432
|
})
|
|
3421
3433
|
).then((N) => N.data)
|
|
3422
3434
|
});
|
|
@@ -3424,7 +3436,7 @@ function $i({
|
|
|
3424
3436
|
"div",
|
|
3425
3437
|
{
|
|
3426
3438
|
className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/30 p-6",
|
|
3427
|
-
onClick:
|
|
3439
|
+
onClick: K,
|
|
3428
3440
|
children: /* @__PURE__ */ d(
|
|
3429
3441
|
"div",
|
|
3430
3442
|
{
|
|
@@ -3433,11 +3445,11 @@ function $i({
|
|
|
3433
3445
|
children: [
|
|
3434
3446
|
/* @__PURE__ */ d("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
3435
3447
|
/* @__PURE__ */ d("div", { children: [
|
|
3436
|
-
/* @__PURE__ */ a("p", { className: "text-[13px] font-semibold", children:
|
|
3448
|
+
/* @__PURE__ */ a("p", { className: "text-[13px] font-semibold", children: k.row.label }),
|
|
3437
3449
|
/* @__PURE__ */ d("p", { className: "text-[11.5px] text-muted-foreground", children: [
|
|
3438
|
-
|
|
3450
|
+
je(k.path),
|
|
3439
3451
|
" = ",
|
|
3440
|
-
/* @__PURE__ */ a("span", { className: "tabular-nums", children:
|
|
3452
|
+
/* @__PURE__ */ a("span", { className: "tabular-nums", children: k.value }),
|
|
3441
3453
|
" ",
|
|
3442
3454
|
"— the rows behind this number"
|
|
3443
3455
|
] })
|
|
@@ -3446,7 +3458,7 @@ function $i({
|
|
|
3446
3458
|
"button",
|
|
3447
3459
|
{
|
|
3448
3460
|
type: "button",
|
|
3449
|
-
onClick:
|
|
3461
|
+
onClick: K,
|
|
3450
3462
|
className: "rounded-md px-2 py-1 text-[12px] text-slate-400 hover:bg-muted",
|
|
3451
3463
|
children: "✕"
|
|
3452
3464
|
}
|
|
@@ -3457,7 +3469,7 @@ function $i({
|
|
|
3457
3469
|
"button",
|
|
3458
3470
|
{
|
|
3459
3471
|
type: "button",
|
|
3460
|
-
onClick: () => f.target &&
|
|
3472
|
+
onClick: () => f.target && M(f.target, String(N.id)),
|
|
3461
3473
|
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",
|
|
3462
3474
|
children: N.label
|
|
3463
3475
|
}
|
|
@@ -3471,5 +3483,5 @@ function $i({
|
|
|
3471
3483
|
);
|
|
3472
3484
|
}
|
|
3473
3485
|
export {
|
|
3474
|
-
|
|
3486
|
+
td as QueueWorklist
|
|
3475
3487
|
};
|