@nivaro/react 0.3.9 → 0.3.10
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/components/fields/FileField.js +20 -19
- package/dist/full.css +1 -1
- package/dist/hooks/useNivaroForm.js +129 -126
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +69 -1
- package/dist/index.js +512 -501
- package/dist/shared/components/CollectionBrowserView.js +1000 -1001
- package/dist/shared/components/ConformanceView.js +36 -35
- package/dist/shared/components/ForceReloadBanner.js +58 -34
- package/dist/shared/components/ItemEditForm.js +3687 -3580
- package/dist/shared/components/JsonMapEditor.js +18 -17
- package/dist/shared/components/MatrixEditor.js +8 -7
- package/dist/shared/components/MyWorkView.js +32 -31
- package/dist/shared/components/PageRenderer.js +146 -145
- package/dist/shared/components/RecordGridEditor.js +76 -75
- package/dist/shared/components/ai/AiMemorySuggestions.js +15 -14
- package/dist/shared/components/ai/AskPanel.js +55 -54
- package/dist/shared/components/bulk/BulkActionButtons.js +30 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +57 -56
- package/dist/shared/components/chat/SlashCommands.js +30 -29
- package/dist/shared/components/chat/chat-outbox.js +76 -75
- package/dist/shared/components/help-videos/recorder/useLeaveWarning.js +6 -5
- package/dist/shared/components/integrations/console/SignalCard.js +124 -123
- package/dist/shared/components/integrations/console/SnoozeMenu.js +24 -23
- package/dist/shared/components/item-edit/CloneDialog.js +85 -78
- package/dist/shared/components/item-edit/InlineTableField.js +301 -300
- package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
- package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
- package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
- package/dist/shared/components/item-edit/staged-links.js +86 -0
- package/dist/shared/components/layout-editor/LayoutEditor.js +275 -274
- package/dist/shared/components/layout-editor/editors/cascade-rule-row.js +18 -17
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +37 -36
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +50 -49
- package/dist/shared/components/profile/AiMemoryCard.js +15 -14
- package/dist/shared/components/profile/PersonAdminTools.js +70 -67
- package/dist/shared/components/queue/QueueItemSheet.js +36 -35
- package/dist/shared/components/queue/QueueWorklist.js +597 -598
- package/dist/shared/lib/client-version.js +63 -0
- package/dist/shared/lib/force-reload.js +36 -0
- package/dist/shared/lib/load-error.js +11 -10
- package/dist/shared/lib/presence-live.js +54 -35
- package/dist/shared/lib/record-outbox.js +76 -75
- package/dist/shared/lib/safe-error.js +39 -0
- package/dist/shared/lib/server-clock.js +11 -7
- package/dist/shared/lib/unsaved-work.js +62 -0
- package/package.json +1 -1
|
@@ -1,69 +1,70 @@
|
|
|
1
1
|
import { jsxs as d, Fragment as ke, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useSensors as
|
|
3
|
-
import { SortableContext as
|
|
4
|
-
import { CSS as
|
|
5
|
-
import { useQueryClient as
|
|
6
|
-
import { AlertTriangle as
|
|
2
|
+
import { useSensors as ul, useSensor as ml, PointerSensor as bl, DndContext as pl, closestCenter as hl } from "@dnd-kit/core";
|
|
3
|
+
import { SortableContext as fl, verticalListSortingStrategy as gl, arrayMove as xl, useSortable as yl } from "@dnd-kit/sortable";
|
|
4
|
+
import { CSS as kl } from "@dnd-kit/utilities";
|
|
5
|
+
import { useQueryClient as vl, useQuery as H, useMutation as ye, useQueries as Ve } from "@tanstack/react-query";
|
|
6
|
+
import { AlertTriangle as wl, FileDiff as _l, RefreshCw as Nl, Rows3 as Gr, Flame as Sl, Sparkles as Cl, BarChart3 as $l, SlidersHorizontal as ql, Rows4 as Fl, Rows2 as Rl, Play as Tl, Plus as Ut, ChevronDown as Wr, Star as Al, Pin as Ol, Loader2 as El, Check as Ll, Save as Dl, Bell as Pl, Inbox as Kl, GripVertical as Ml } from "lucide-react";
|
|
7
7
|
import { useState as k, useRef as B, useEffect as j, useMemo as G } from "react";
|
|
8
|
-
import { createPortal as
|
|
8
|
+
import { createPortal as Hr } from "react-dom";
|
|
9
9
|
import { toast as T } from "sonner";
|
|
10
|
-
import { useNivaroClient as
|
|
11
|
-
import { useDebounced as
|
|
12
|
-
import { useElapsedLoading as
|
|
13
|
-
import { useBulkProgressFeed as
|
|
14
|
-
import { get as
|
|
15
|
-
import { evaluateExpression as
|
|
16
|
-
import { deliverLive as
|
|
17
|
-
import { formatMultiValue as Ge, formatValue as
|
|
18
|
-
import { createCursorBook as
|
|
19
|
-
import { expandCoalesced as
|
|
20
|
-
import { useRowChanges as
|
|
21
|
-
import { OPEN_IN_TABS_CAP as
|
|
22
|
-
import { isOwnWrite as
|
|
23
|
-
import { useRowPresence as
|
|
24
|
-
import { buildGroups as
|
|
25
|
-
import { useOptionalRealtime as
|
|
26
|
-
import { rowHighlightTextClass as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
10
|
+
import { useNivaroClient as ta, useItemEditAuth as Jr, useItemNavigation as Ql, useNavigation as Bl, useOverlayState as jl } from "../../context.js";
|
|
11
|
+
import { useDebounced as Ul } from "../../hooks/useDebounced.js";
|
|
12
|
+
import { useElapsedLoading as Il } from "../../hooks/useElapsedLoading.js";
|
|
13
|
+
import { useBulkProgressFeed as Vl } from "../../lib/bulk-progress.js";
|
|
14
|
+
import { get as O, post as ne, patch as Yr, del as qn, put as Gl } from "../../lib/commands.js";
|
|
15
|
+
import { evaluateExpression as Wl } from "../../lib/expression.js";
|
|
16
|
+
import { deliverLive as Hl, releaseLiveOwner as Jl } from "../../lib/focus-mode.js";
|
|
17
|
+
import { formatMultiValue as Ge, formatValue as Yl } from "../../lib/format-value.js";
|
|
18
|
+
import { createCursorBook as zl, pageRequest as Xl, noteNextCursor as Zl } from "../../lib/keyset-pager.js";
|
|
19
|
+
import { expandCoalesced as eo, LIVE_ASPECTS as ft } from "../../lib/live.js";
|
|
20
|
+
import { useRowChanges as to, useRowLocksByCollection as no, lockLabel as ro } from "../../lib/live-list.js";
|
|
21
|
+
import { OPEN_IN_TABS_CAP as ao, openInTabs as lo, openInTabsMessage as zr } from "../../lib/open-in-tabs.js";
|
|
22
|
+
import { isOwnWrite as oo } from "../../lib/own-writes.js";
|
|
23
|
+
import { useRowPresence as so, rowPresenceKey as io } from "../../lib/presence-hooks.js";
|
|
24
|
+
import { buildGroups as co } from "../../lib/queue-grouping.js";
|
|
25
|
+
import { useOptionalRealtime as uo } from "../../lib/realtime.js";
|
|
26
|
+
import { rowHighlightTextClass as mo, rowHighlightClass as bo } from "../../lib/row-highlight.js";
|
|
27
|
+
import { userErrorMessage as gt } from "../../lib/safe-error.js";
|
|
28
|
+
import { useMyScopes as po, matchScopeDimension as ho, effectiveScopeSeedIds as fo } from "../../lib/use-my-scopes.js";
|
|
29
|
+
import { useNewItemLayouts as go } from "../../lib/use-new-item-layouts.js";
|
|
30
|
+
import { formatNumber as re, cn as C, titleCase as Fn, humanHours as xo, formatRelative as yo, formatDateTime as ko, formatDate as vo } from "../../lib/utils.js";
|
|
31
|
+
import { usePublishAskContext as wo, useAskRecordDrag as _o } from "../ai/ask-context.js";
|
|
32
|
+
import { useBuiltinGate as No, BulkActionButtons as So } from "../bulk/BulkActionButtons.js";
|
|
33
|
+
import { BulkRowMark as Co } from "../bulk/BulkRowMark.js";
|
|
34
|
+
import { RowActionsMenu as $o } from "../CollectionBrowserView.js";
|
|
35
|
+
import { DataTable as qo } from "../DataTable.js";
|
|
36
|
+
import { EmptyState as Fo } from "../EmptyState.js";
|
|
37
|
+
import { FocusModeToggle as Ro } from "../FocusModeToggle.js";
|
|
38
|
+
import { FulfilmentPill as To, FULFILMENT_FILTER_OPTIONS as Ao } from "../FulfilmentPill.js";
|
|
39
|
+
import { ImportFromFileButton as Oo } from "../import/ImportFromFileButton.js";
|
|
40
|
+
import { IntegrationDots as Eo, INTEGRATIONS_FILTER_OPTIONS as Lo } from "../integrations/IntegrationDots.js";
|
|
41
|
+
import { IntegrationsFilterPill as Do } from "../integrations/IntegrationsFilterPill.js";
|
|
42
|
+
import { readQueueReturn as Po, writeQueueReturn as Xr } from "../item-edit/QueueReturnChip.js";
|
|
43
|
+
import { LiveRowMark as Ko } from "../LiveRowMark.js";
|
|
44
|
+
import { RealtimeStaleMark as Mo } from "../RealtimeStatusBanner.js";
|
|
45
|
+
import { RecordDrilldownSheet as Qo } from "../RecordDrilldownSheet.js";
|
|
46
|
+
import { RowHighlightLegend as Bo } from "../RowHighlightLegend.js";
|
|
47
|
+
import { RowPresence as jo } from "../RowPresence.js";
|
|
48
|
+
import { TickerNumber as Rn } from "../TickerNumber.js";
|
|
49
|
+
import { UnseenDot as Uo } from "../UnseenDot.js";
|
|
50
|
+
import { Badge as Io } from "../ui/badge.js";
|
|
51
|
+
import { Checkbox as Tn } from "../ui/checkbox.js";
|
|
52
|
+
import { Command as Zr, CommandInput as Vo, CommandList as ea, CommandEmpty as Go, CommandItem as xt } from "../ui/command.js";
|
|
53
|
+
import { Label as Wo } from "../ui/label.js";
|
|
53
54
|
import { Popover as We, PopoverTrigger as He, PopoverContent as Je } from "../ui/popover.js";
|
|
54
|
-
import { Skeleton as
|
|
55
|
-
import { OwnerAvatars as
|
|
56
|
-
import { QueueBulkBar as
|
|
57
|
-
import { QueueItemSheet as
|
|
58
|
-
import { QueueKanbanBoard as
|
|
59
|
-
import { QueueQuickFilters as
|
|
60
|
-
import { QueueWorkloadView as
|
|
61
|
-
function
|
|
55
|
+
import { Skeleton as Ho } from "../ui/skeleton.js";
|
|
56
|
+
import { OwnerAvatars as Jo } from "./OwnerAvatars.js";
|
|
57
|
+
import { QueueBulkBar as Yo } from "./QueueBulkBar.js";
|
|
58
|
+
import { QueueItemSheet as zo } from "./QueueItemSheet.js";
|
|
59
|
+
import { QueueKanbanBoard as Xo } from "./QueueKanbanBoard.js";
|
|
60
|
+
import { QueueQuickFilters as Zo } from "./QueueQuickFilters.js";
|
|
61
|
+
import { QueueWorkloadView as es } from "./QueueWorkloadView.js";
|
|
62
|
+
function ts({ summary: l }) {
|
|
62
63
|
if (!l || l.count === 0)
|
|
63
64
|
return /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
|
|
64
65
|
const f = [l.last_from, l.last_to].filter(Boolean).join(" → "), $ = [
|
|
65
66
|
f ? `Last: ${f}` : null,
|
|
66
|
-
l.last_at ?
|
|
67
|
+
l.last_at ? yo(l.last_at) : null,
|
|
67
68
|
l.last_reason ? `“${l.last_reason}”` : "no reason given"
|
|
68
69
|
].filter(Boolean).join(" · ");
|
|
69
70
|
return /* @__PURE__ */ d(
|
|
@@ -85,15 +86,15 @@ function es({ summary: l }) {
|
|
|
85
86
|
}
|
|
86
87
|
);
|
|
87
88
|
}
|
|
88
|
-
const
|
|
89
|
+
const ns = 50, It = "nivaro_addendums", rs = [
|
|
89
90
|
{ value: "mine", label: "My Items" },
|
|
90
91
|
{ value: "unowned", label: "No Owners" },
|
|
91
92
|
{ value: "claimed", label: "Claimed by me" },
|
|
92
93
|
{ value: "all", label: "All Items" }
|
|
93
94
|
];
|
|
94
|
-
function
|
|
95
|
+
function as({ summary: l }) {
|
|
95
96
|
if (!l || l.total === 0) return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
|
|
96
|
-
const f = l.active > 0, $ = l.latest_status === "review" ? "in review" : l.latest_status ?? "active",
|
|
97
|
+
const f = l.active > 0, $ = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", E = l.cost_impact, U = E != null && E !== 0 ? `${E > 0 ? "+" : "−"}$${Math.abs(E).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
|
|
97
98
|
return /* @__PURE__ */ d(
|
|
98
99
|
"span",
|
|
99
100
|
{
|
|
@@ -122,33 +123,33 @@ function rs({ summary: l }) {
|
|
|
122
123
|
}
|
|
123
124
|
);
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
-
return
|
|
126
|
+
function ls(l) {
|
|
127
|
+
return xo(l);
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function os({ status: l }) {
|
|
129
130
|
return l ? /* @__PURE__ */ r("span", { className: C("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
|
|
130
131
|
}
|
|
131
|
-
function
|
|
132
|
+
function ss({ points: l, inline: f = !1 }) {
|
|
132
133
|
if (l.length < 2) return null;
|
|
133
|
-
const $ = f ? 40 : 64,
|
|
134
|
-
(me, g) => `${g === 0 ? "M" : "L"}${(g * v).toFixed(1)},${(
|
|
134
|
+
const $ = f ? 40 : 64, E = f ? 14 : 18, U = Math.max(...l), h = Math.min(...l), p = U - h || 1, v = $ / (l.length - 1), W = l.map(
|
|
135
|
+
(me, g) => `${g === 0 ? "M" : "L"}${(g * v).toFixed(1)},${(E - 2 - (me - h) / p * (E - 4)).toFixed(1)}`
|
|
135
136
|
).join(" ");
|
|
136
137
|
return /* @__PURE__ */ r(
|
|
137
138
|
"svg",
|
|
138
139
|
{
|
|
139
140
|
width: $,
|
|
140
|
-
height:
|
|
141
|
+
height: E,
|
|
141
142
|
className: f ? "opacity-40" : "mt-1.5 opacity-40",
|
|
142
143
|
"aria-hidden": "true",
|
|
143
144
|
children: /* @__PURE__ */ r("path", { d: W, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
|
|
144
145
|
}
|
|
145
146
|
);
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function yt({
|
|
148
149
|
label: l,
|
|
149
150
|
count: f,
|
|
150
151
|
filteredCount: $,
|
|
151
|
-
active:
|
|
152
|
+
active: E,
|
|
152
153
|
isLoading: U,
|
|
153
154
|
tone: h,
|
|
154
155
|
trend: p,
|
|
@@ -163,17 +164,17 @@ function xt({
|
|
|
163
164
|
onClick: me,
|
|
164
165
|
className: C(
|
|
165
166
|
"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",
|
|
166
|
-
|
|
167
|
-
!
|
|
167
|
+
E && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
|
|
168
|
+
!E && !U && f === 0 && "opacity-50"
|
|
168
169
|
),
|
|
169
|
-
children: U ? /* @__PURE__ */ r(
|
|
170
|
+
children: U ? /* @__PURE__ */ r(Ho, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(ke, { children: [
|
|
170
171
|
/* @__PURE__ */ r("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: $ != null ? /* @__PURE__ */ d(ke, { children: [
|
|
171
|
-
/* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(
|
|
172
|
+
/* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(Rn, { value: $, format: re }) }),
|
|
172
173
|
/* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
|
|
173
174
|
"/ ",
|
|
174
|
-
/* @__PURE__ */ r(
|
|
175
|
+
/* @__PURE__ */ r(Rn, { value: f, format: re })
|
|
175
176
|
] })
|
|
176
|
-
] }) : /* @__PURE__ */ r(
|
|
177
|
+
] }) : /* @__PURE__ */ r(Rn, { value: f, format: re }) }),
|
|
177
178
|
/* @__PURE__ */ r(
|
|
178
179
|
"span",
|
|
179
180
|
{
|
|
@@ -197,16 +198,16 @@ function xt({
|
|
|
197
198
|
]
|
|
198
199
|
}
|
|
199
200
|
),
|
|
200
|
-
p && f > 0 && /* @__PURE__ */ r(
|
|
201
|
+
p && f > 0 && /* @__PURE__ */ r(ss, { points: p, inline: !0 })
|
|
201
202
|
] })
|
|
202
203
|
}
|
|
203
204
|
);
|
|
204
205
|
}
|
|
205
|
-
function
|
|
206
|
+
function is({
|
|
206
207
|
label: l,
|
|
207
208
|
count: f,
|
|
208
209
|
filteredCount: $,
|
|
209
|
-
color:
|
|
210
|
+
color: E,
|
|
210
211
|
active: U,
|
|
211
212
|
onClick: h
|
|
212
213
|
}) {
|
|
@@ -224,7 +225,7 @@ function ss({
|
|
|
224
225
|
"span",
|
|
225
226
|
{
|
|
226
227
|
className: "h-2 w-2 shrink-0 rounded-full",
|
|
227
|
-
style: { backgroundColor:
|
|
228
|
+
style: { backgroundColor: E ?? "#94a3b8" }
|
|
228
229
|
}
|
|
229
230
|
),
|
|
230
231
|
l,
|
|
@@ -239,19 +240,19 @@ function ss({
|
|
|
239
240
|
}
|
|
240
241
|
);
|
|
241
242
|
}
|
|
242
|
-
function
|
|
243
|
+
function kt(l) {
|
|
243
244
|
return l.split(".").map((f) => f.replace(/_/g, " ").replace(/\b\w/g, ($) => $.toUpperCase())).join(" → ");
|
|
244
245
|
}
|
|
245
|
-
function
|
|
246
|
+
function cs({
|
|
246
247
|
id: l,
|
|
247
248
|
label: f,
|
|
248
249
|
checked: $,
|
|
249
|
-
onCheckedChange:
|
|
250
|
+
onCheckedChange: E
|
|
250
251
|
}) {
|
|
251
|
-
const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: me } =
|
|
252
|
+
const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: me } = yl({
|
|
252
253
|
id: l
|
|
253
254
|
}), g = {
|
|
254
|
-
transform:
|
|
255
|
+
transform: kl.Transform.toString(v),
|
|
255
256
|
transition: W,
|
|
256
257
|
opacity: me ? 0.4 : 1
|
|
257
258
|
}, J = `col-toggle-${l}`;
|
|
@@ -262,48 +263,48 @@ function is({
|
|
|
262
263
|
...U,
|
|
263
264
|
...h,
|
|
264
265
|
className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
|
|
265
|
-
children: /* @__PURE__ */ r(
|
|
266
|
+
children: /* @__PURE__ */ r(Ml, { className: "h-3.5 w-3.5" })
|
|
266
267
|
}
|
|
267
268
|
),
|
|
268
|
-
/* @__PURE__ */ r(
|
|
269
|
-
/* @__PURE__ */ r(
|
|
269
|
+
/* @__PURE__ */ r(Tn, { id: J, checked: $, onCheckedChange: E }),
|
|
270
|
+
/* @__PURE__ */ r(Wo, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: f })
|
|
270
271
|
] });
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
+
function vi({
|
|
273
274
|
queueId: l,
|
|
274
275
|
realtime: f,
|
|
275
276
|
renderError: $,
|
|
276
|
-
hideCreateActions:
|
|
277
|
+
hideCreateActions: E = !1,
|
|
277
278
|
onAsk: U
|
|
278
279
|
}) {
|
|
279
|
-
var
|
|
280
|
-
const h =
|
|
280
|
+
var Ar, Or, Er, Lr, Dr, Pr, Kr, Mr, Qr, Br, jr, Ur, Ir;
|
|
281
|
+
const h = vl(), p = ta(), { userId: v } = Jr(), W = Ql(), { navigate: me } = Bl(), [g, J] = k("all"), [ve, L] = k(1), An = B(zl()), [vt, na] = k(() => {
|
|
281
282
|
try {
|
|
282
283
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
283
284
|
} catch {
|
|
284
285
|
return "compact";
|
|
285
286
|
}
|
|
286
|
-
}), [A, Te] = k("table"), [I, Ae] = k(""), [w, M] = k({}), [
|
|
287
|
-
|
|
288
|
-
const
|
|
287
|
+
}), [A, Te] = k("table"), [I, Ae] = k(""), [w, M] = k({}), [wt, On] = k(() => /* @__PURE__ */ new Set()), [N, Ye] = k(null), [be, Vt] = k(/* @__PURE__ */ new Set()), [ze, Gt] = k(null), [_t, Wt] = k(null), [Ht, Nt] = k(0), we = to(), Jt = uo(), Yt = B({}).current, En = B(/* @__PURE__ */ new Set()), [ra, aa] = k(0), [Ln, la] = k(0), Oe = B(!1), St = B([]), Dn = B(null), Pn = B(!1), Kn = B(0), zt = B("table");
|
|
288
|
+
zt.current = A;
|
|
289
|
+
const Xt = 25, { data: s, error: Ct } = H({
|
|
289
290
|
queryKey: ["queue-meta", l],
|
|
290
|
-
queryFn: () => p.request(
|
|
291
|
+
queryFn: () => p.request(O(`/queues/${l}`)).then((e) => e.data),
|
|
291
292
|
enabled: !!l
|
|
292
|
-
}), { scopes: Xe, ready:
|
|
293
|
+
}), { scopes: Xe, ready: Mn } = po(), Qn = B(!1), [Bn, jn] = k(!1), [Ee, oa] = k({}), pe = B({});
|
|
293
294
|
j(() => {
|
|
294
|
-
if (
|
|
295
|
-
|
|
295
|
+
if (Qn.current || !Mn || !s) return;
|
|
296
|
+
Qn.current = !0;
|
|
296
297
|
const e = (s.extra_field_meta ?? []).filter(
|
|
297
298
|
(t) => t.kind === "relation" && t.target_collection && t.display_field
|
|
298
299
|
);
|
|
299
300
|
if (e.length === 0 || !Xe) {
|
|
300
|
-
|
|
301
|
+
jn(!0);
|
|
301
302
|
return;
|
|
302
303
|
}
|
|
303
304
|
(async () => {
|
|
304
305
|
const t = {}, n = {}, a = async (o, i) => {
|
|
305
306
|
const b = await p.request(
|
|
306
|
-
|
|
307
|
+
O(`/items/${o.target_collection}`, {
|
|
307
308
|
filter: JSON.stringify({ id: { _in: i } }),
|
|
308
309
|
fields: `id,${o.display_field}`,
|
|
309
310
|
limit: "200"
|
|
@@ -316,7 +317,7 @@ function yi({
|
|
|
316
317
|
];
|
|
317
318
|
};
|
|
318
319
|
for (const o of e) {
|
|
319
|
-
const i =
|
|
320
|
+
const i = ho(Xe, { collection: o.target_collection });
|
|
320
321
|
if (!i) continue;
|
|
321
322
|
const b = `extra.${o.path}`;
|
|
322
323
|
try {
|
|
@@ -325,7 +326,7 @@ function yi({
|
|
|
325
326
|
const R = await a(o, m);
|
|
326
327
|
R.length > 0 && (n[b.slice(6)] = R);
|
|
327
328
|
}
|
|
328
|
-
const K =
|
|
329
|
+
const K = fo(Xe, i.name);
|
|
329
330
|
if (K.length === 0) continue;
|
|
330
331
|
const F = w[b];
|
|
331
332
|
if (F && (Array.isArray(F) ? F.length > 0 : F !== ""))
|
|
@@ -335,12 +336,12 @@ function yi({
|
|
|
335
336
|
} catch {
|
|
336
337
|
}
|
|
337
338
|
}
|
|
338
|
-
Object.keys(n).length > 0 &&
|
|
339
|
+
Object.keys(n).length > 0 && oa(n), Object.keys(t).length > 0 && (pe.current = t, M((o) => ({ ...o, ...t }))), jn(!0);
|
|
339
340
|
})();
|
|
340
|
-
}, [
|
|
341
|
-
const Le = ((
|
|
341
|
+
}, [Mn, Xe, s]);
|
|
342
|
+
const Le = ((Or = (Ar = s == null ? void 0 : s.sources) == null ? void 0 : Ar.find((e) => e.type === "collection")) == null ? void 0 : Or.collection) ?? null, { data: Un = [] } = H({
|
|
342
343
|
queryKey: ["queue-browser-quick-filters", Le],
|
|
343
|
-
queryFn: () => p.request(
|
|
344
|
+
queryFn: () => p.request(O(`/collections/${Le}`)).then((e) => {
|
|
344
345
|
var t, n;
|
|
345
346
|
return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
|
|
346
347
|
}).catch(() => []),
|
|
@@ -351,9 +352,9 @@ function yi({
|
|
|
351
352
|
for (const n of (s == null ? void 0 : s.sources) ?? [])
|
|
352
353
|
n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
|
|
353
354
|
return t;
|
|
354
|
-
}, [s == null ? void 0 : s.sources]),
|
|
355
|
+
}, [s == null ? void 0 : s.sources]), $t = go(
|
|
355
356
|
z.length === 1 ? z[0] : null
|
|
356
|
-
),
|
|
357
|
+
), Zt = E === !0 || Array.isArray(E) && z.length > 0 && z.every((e) => E.includes(e)), oe = (s == null ? void 0 : s.claims_enabled) !== !1, u = s == null ? void 0 : s.display_config, _e = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], sa = (u == null ? void 0 : u.work_next) !== !1, en = (u == null ? void 0 : u.bulk_actions) !== !1, tn = No(
|
|
357
358
|
[
|
|
358
359
|
...new Set(
|
|
359
360
|
((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -363,16 +364,16 @@ function yi({
|
|
|
363
364
|
), q = (e, t) => {
|
|
364
365
|
var n, a;
|
|
365
366
|
return ((a = (n = s == null ? void 0 : s.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : a.trim()) || t;
|
|
366
|
-
},
|
|
367
|
+
}, In = B(!1);
|
|
367
368
|
j(() => {
|
|
368
|
-
!s ||
|
|
369
|
+
!s || In.current || (In.current = !0, Ae("-priority"));
|
|
369
370
|
}, [s]);
|
|
370
|
-
const [ae,
|
|
371
|
+
const [ae, ia] = k(!1);
|
|
371
372
|
j(() => {
|
|
372
373
|
s != null && s.display_config && !_e.includes(A) && Te(_e[0]);
|
|
373
374
|
}, [s, A, _e]), j(() => {
|
|
374
375
|
if (!(s != null && s.sources)) return;
|
|
375
|
-
const e =
|
|
376
|
+
const e = Jt ? (y, R) => Jt.subscribeCollections(y, R) : f == null ? void 0 : f.subscribe;
|
|
376
377
|
if (!e) return;
|
|
377
378
|
const t = [
|
|
378
379
|
...new Set(
|
|
@@ -384,25 +385,25 @@ function yi({
|
|
|
384
385
|
let a = null, o = null, i = null;
|
|
385
386
|
const b = () => {
|
|
386
387
|
i || (i = setTimeout(() => {
|
|
387
|
-
i = null,
|
|
388
|
+
i = null, la((y) => y + 1);
|
|
388
389
|
}, 1500));
|
|
389
390
|
}, m = () => {
|
|
390
391
|
o || (o = setTimeout(() => {
|
|
391
|
-
if (o = null,
|
|
392
|
-
|
|
392
|
+
if (o = null, Kn.current > 0 || Pn.current) {
|
|
393
|
+
St.current = [], Nt((y) => y + 1);
|
|
393
394
|
return;
|
|
394
395
|
}
|
|
395
|
-
|
|
396
|
+
Oe.current = !0, h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] });
|
|
396
397
|
}, 900));
|
|
397
398
|
}, K = (y) => {
|
|
398
399
|
let R = !1, Q = 0, xe = !1;
|
|
399
400
|
const Re = y.flatMap(
|
|
400
|
-
(_) => _ ?
|
|
401
|
+
(_) => _ ? eo(_) : [_]
|
|
401
402
|
);
|
|
402
403
|
for (const _ of Re) {
|
|
403
|
-
const ue = _ == null ? void 0 : _.changed_fields,
|
|
404
|
+
const ue = _ == null ? void 0 : _.changed_fields, jt = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, Vr = jt != null && En.current.has(jt);
|
|
404
405
|
if (_ && !_.action && (ue != null && ue.length) && ue.every((ht) => ht.startsWith("$"))) {
|
|
405
|
-
ue.includes(ft.tasks) && n.add("queue-task-counts"), ue.includes(ft.integrations) && n.add("queue-integrations-summary"), ue.includes(ft.addendums) && n.add("queue-collection-addendums"), ue.includes(ft.lock) &&
|
|
406
|
+
ue.includes(ft.tasks) && n.add("queue-task-counts"), ue.includes(ft.integrations) && n.add("queue-integrations-summary"), ue.includes(ft.addendums) && n.add("queue-collection-addendums"), ue.includes(ft.lock) && aa((ht) => ht + 1), ue.includes(ft.state) && (xe = !0, (Vr || zt.current === "kanban") && (R = !0)), a || (a = setTimeout(() => {
|
|
406
407
|
a = null;
|
|
407
408
|
for (const ht of n) h.invalidateQueries({ queryKey: [ht] });
|
|
408
409
|
n.clear();
|
|
@@ -410,16 +411,16 @@ function yi({
|
|
|
410
411
|
continue;
|
|
411
412
|
}
|
|
412
413
|
xe = !0;
|
|
413
|
-
const
|
|
414
|
-
|
|
414
|
+
const dl = (_ == null ? void 0 : _.collection) != null && oo(_.collection, _.item);
|
|
415
|
+
jt && (Vr || (_ == null ? void 0 : _.action) === "create" || zt.current === "kanban") ? (R = !0, dl || St.current.push({ key: jt, by: null })) : Q += 1;
|
|
415
416
|
}
|
|
416
|
-
Q > 0 &&
|
|
417
|
-
}, F = e(t, (y) =>
|
|
417
|
+
Q > 0 && Nt((_) => _ + Q), R && m(), xe && b();
|
|
418
|
+
}, F = e(t, (y) => Hl(Yt, [y ?? {}], K));
|
|
418
419
|
return () => {
|
|
419
|
-
F(),
|
|
420
|
+
F(), Jl(Yt), a && clearTimeout(a), o && clearTimeout(o), i && clearTimeout(i);
|
|
420
421
|
};
|
|
421
|
-
}, [
|
|
422
|
-
const De =
|
|
422
|
+
}, [Jt, f, s == null ? void 0 : s.sources, h, l, v, Yt]);
|
|
423
|
+
const De = Ul(w, 350), ca = JSON.stringify(De) === JSON.stringify(w), nn = B(!1), Ne = A === "table" && !!N, Vn = (() => {
|
|
423
424
|
const e = /* @__PURE__ */ new Set();
|
|
424
425
|
for (const t of (s == null ? void 0 : s.extra_field_meta) ?? [])
|
|
425
426
|
t.aggregate && t.aggregate !== "count" && e.add(t.path);
|
|
@@ -449,17 +450,17 @@ function yi({
|
|
|
449
450
|
function Pe(e, t) {
|
|
450
451
|
M((n) => ({ ...n, [e]: n[e] === t ? "" : t })), L(1);
|
|
451
452
|
}
|
|
452
|
-
function
|
|
453
|
+
function da(e) {
|
|
453
454
|
M((t) => {
|
|
454
455
|
const n = t.state, a = Array.isArray(n) ? n : n ? [n] : [], o = a.includes(e) ? a.filter((i) => i !== e) : [...a, e];
|
|
455
456
|
return { ...t, state: o };
|
|
456
457
|
}), L(1);
|
|
457
458
|
}
|
|
458
|
-
const
|
|
459
|
-
function
|
|
459
|
+
const ua = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], ma = (e) => !e || Array.isArray(e) && e.length === 0;
|
|
460
|
+
function ba() {
|
|
460
461
|
M({ ...pe.current }), J("all"), L(1);
|
|
461
462
|
}
|
|
462
|
-
const [et,
|
|
463
|
+
const [et, pa] = k(() => {
|
|
463
464
|
try {
|
|
464
465
|
return localStorage.getItem("nvr_queue_insights_open") === "1";
|
|
465
466
|
} catch {
|
|
@@ -472,13 +473,13 @@ function yi({
|
|
|
472
473
|
} catch {
|
|
473
474
|
}
|
|
474
475
|
}, [et]);
|
|
475
|
-
const { data:
|
|
476
|
+
const { data: ha = [] } = H({
|
|
476
477
|
queryKey: ["queue-view-subs", l],
|
|
477
|
-
queryFn: () => p.request(
|
|
478
|
+
queryFn: () => p.request(O("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
|
|
478
479
|
staleTime: 3e4
|
|
479
|
-
}),
|
|
480
|
-
const t =
|
|
481
|
-
(t ? p.request(
|
|
480
|
+
}), qt = (e) => ha.find((t) => t.queue_view_id === e), fa = (e) => {
|
|
481
|
+
const t = qt(e);
|
|
482
|
+
(t ? p.request(qn(`/notification-subscriptions/${t.id}`)) : p.request(
|
|
482
483
|
ne("/notification-subscriptions", {
|
|
483
484
|
queue_id: l,
|
|
484
485
|
queue_view_id: e,
|
|
@@ -488,19 +489,19 @@ function yi({
|
|
|
488
489
|
T.success(
|
|
489
490
|
t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
|
|
490
491
|
), h.invalidateQueries({ queryKey: ["queue-view-subs", l] });
|
|
491
|
-
}).catch((a) => T.error(a
|
|
492
|
-
}, [
|
|
492
|
+
}).catch((a) => T.error(gt(a, "Failed")));
|
|
493
|
+
}, [Gn, rn] = k(null), an = [
|
|
493
494
|
...new Set(
|
|
494
495
|
((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
495
496
|
)
|
|
496
|
-
], { data:
|
|
497
|
-
queryKey: ["queue-custom-actions", l,
|
|
497
|
+
], { data: ga = {} } = H({
|
|
498
|
+
queryKey: ["queue-custom-actions", l, an.join(",")],
|
|
498
499
|
queryFn: async () => {
|
|
499
500
|
const e = {};
|
|
500
|
-
for (const t of
|
|
501
|
+
for (const t of an.slice(0, 6))
|
|
501
502
|
try {
|
|
502
503
|
const n = await p.request(
|
|
503
|
-
|
|
504
|
+
O("/custom-actions", { collection: t })
|
|
504
505
|
);
|
|
505
506
|
e[t] = n.data ?? [];
|
|
506
507
|
} catch {
|
|
@@ -508,20 +509,20 @@ function yi({
|
|
|
508
509
|
}
|
|
509
510
|
return e;
|
|
510
511
|
},
|
|
511
|
-
enabled:
|
|
512
|
+
enabled: an.length > 0,
|
|
512
513
|
staleTime: 6e4
|
|
513
|
-
}),
|
|
514
|
+
}), xa = (e) => ga[e] ?? [], ya = (e, t) => {
|
|
514
515
|
p.request(ne(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
|
|
515
516
|
T.success(`${e.label} ran`), h.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
516
517
|
}).catch((n) => {
|
|
517
518
|
const a = n.response;
|
|
518
|
-
T.error((a == null ? void 0 : a.error) ?? (n
|
|
519
|
+
T.error((a == null ? void 0 : a.error) ?? gt(n, `${e.label} failed`));
|
|
519
520
|
});
|
|
520
|
-
}, { data:
|
|
521
|
+
}, { data: ln = [] } = H({
|
|
521
522
|
queryKey: ["queue-triage-labels", l],
|
|
522
|
-
queryFn: () => p.request(
|
|
523
|
+
queryFn: () => p.request(O(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
|
|
523
524
|
staleTime: 3e4
|
|
524
|
-
}),
|
|
525
|
+
}), Wn = (e, t) => {
|
|
525
526
|
p.request(
|
|
526
527
|
ne(`/queues/${l}/triage-labels/toggle`, {
|
|
527
528
|
collection: e.collection,
|
|
@@ -530,8 +531,8 @@ function yi({
|
|
|
530
531
|
})
|
|
531
532
|
).then(() => {
|
|
532
533
|
h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
|
|
533
|
-
}).catch((n) => T.error(n
|
|
534
|
-
}, { data: c, isLoading:
|
|
534
|
+
}).catch((n) => T.error(gt(n, "Label failed")));
|
|
535
|
+
}, { data: c, isLoading: Hn, isFetching: on, isPlaceholderData: ka, dataUpdatedAt: le } = H({
|
|
535
536
|
queryKey: [
|
|
536
537
|
"queue-items",
|
|
537
538
|
l,
|
|
@@ -542,8 +543,8 @@ function yi({
|
|
|
542
543
|
N
|
|
543
544
|
],
|
|
544
545
|
queryFn: async () => {
|
|
545
|
-
const e = !Ne && A === "table", t = JSON.stringify([l, g, I, Ze,
|
|
546
|
-
|
|
546
|
+
const e = !Ne && A === "table", t = JSON.stringify([l, g, I, Ze, Xt]), n = e ? Xl(An.current, t, ve, "").after : void 0, a = await p.request(
|
|
547
|
+
O(`/queues/${l}/items`, {
|
|
547
548
|
scope: g,
|
|
548
549
|
// Last State Change is Aging read the other way round: the newest
|
|
549
550
|
// move is the least aged.
|
|
@@ -553,11 +554,11 @@ function yi({
|
|
|
553
554
|
// Kanban renders the full matching set, grouped client-side.
|
|
554
555
|
...Ne ? {
|
|
555
556
|
group_by: N,
|
|
556
|
-
...
|
|
557
|
-
} : A === "table" ? { page: ve, limit:
|
|
557
|
+
...Vn.length ? { group_sums: Vn.join(",") } : {}
|
|
558
|
+
} : A === "table" ? { page: ve, limit: Xt, ...n ? { after: n } : {} } : {}
|
|
558
559
|
})
|
|
559
560
|
);
|
|
560
|
-
return n &&
|
|
561
|
+
return n && Zl(An.current, t, ve, a.next_cursor), a;
|
|
561
562
|
},
|
|
562
563
|
// Wait for display_config AND scope seeding so the first fetch uses the
|
|
563
564
|
// configured defaults and already carries the viewer's restricted filters.
|
|
@@ -566,12 +567,12 @@ function yi({
|
|
|
566
567
|
// first fetch went out WITHOUT the seeded scope and refired ~350ms later
|
|
567
568
|
// with it (3.3s + 8.7s of work for one page). The first fetch now also
|
|
568
569
|
// waits for the debounced copy to settle; later typing still debounces.
|
|
569
|
-
enabled: !!l && ae &&
|
|
570
|
+
enabled: !!l && ae && Bn && (nn.current || ca),
|
|
570
571
|
// Keep the previous page rendered while a sort/filter/page change refetches —
|
|
571
572
|
// swapping to skeletons collapsed the table height and jittered the page.
|
|
572
573
|
placeholderData: (e) => e
|
|
573
574
|
});
|
|
574
|
-
c && !
|
|
575
|
+
c && !nn.current && (nn.current = !0), j(() => {
|
|
575
576
|
if (typeof window > "u" || !le) return;
|
|
576
577
|
const e = window;
|
|
577
578
|
e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
|
|
@@ -585,12 +586,12 @@ function yi({
|
|
|
585
586
|
}, a = t.find((o) => o.queue === l);
|
|
586
587
|
t.push(n), t.length > 50 && t.shift(), a && a !== n && le - Number(a.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: a, second: n });
|
|
587
588
|
}, [le]);
|
|
588
|
-
const Ke =
|
|
589
|
+
const Ke = Hn && !c || !ae || !Bn && !c, Jn = (on && !Hn || ka && on) && !Oe.current, va = G(
|
|
589
590
|
() => (Ne ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
590
591
|
[Ne, c == null ? void 0 : c.data]
|
|
591
|
-
),
|
|
592
|
-
async function
|
|
593
|
-
const a = (await p.request(
|
|
592
|
+
), wa = so(va), Yn = Il(on && !Oe.current);
|
|
593
|
+
async function zn(e, t) {
|
|
594
|
+
const a = (await p.request(O(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
|
|
594
595
|
if (!a || a.states.length === 0)
|
|
595
596
|
throw new Error("This item has no workflow instance");
|
|
596
597
|
const o = a.states.find((b) => b.key === t);
|
|
@@ -605,15 +606,15 @@ function yi({
|
|
|
605
606
|
})
|
|
606
607
|
);
|
|
607
608
|
}
|
|
608
|
-
const
|
|
609
|
+
const _a = ye({
|
|
609
610
|
mutationFn: async ({ item: e, targetState: t }) => {
|
|
610
|
-
await
|
|
611
|
+
await zn(e, t);
|
|
611
612
|
},
|
|
612
613
|
onSuccess: () => {
|
|
613
614
|
h.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
614
615
|
},
|
|
615
616
|
onError: (e) => {
|
|
616
|
-
T.error(e
|
|
617
|
+
T.error(gt(e, "Failed to move item")), h.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
617
618
|
}
|
|
618
619
|
}), Se = ye({
|
|
619
620
|
mutationFn: (e) => p.request(
|
|
@@ -635,16 +636,16 @@ function yi({
|
|
|
635
636
|
onError: () => T.error("Failed to release item")
|
|
636
637
|
}), { data: Qe } = H({
|
|
637
638
|
queryKey: ["queue-column-prefs", l],
|
|
638
|
-
queryFn: () => p.request(
|
|
639
|
+
queryFn: () => p.request(O(`/queues/${l}/column-prefs`)),
|
|
639
640
|
enabled: !!l
|
|
640
|
-
}), [
|
|
641
|
+
}), [sn, Ft] = k(null), [Be, cn] = k(null);
|
|
641
642
|
j(() => {
|
|
642
|
-
Qe &&
|
|
643
|
+
Qe && cn(Qe.data.default_view_id);
|
|
643
644
|
}, [Qe]);
|
|
644
|
-
const [
|
|
645
|
-
(e) => Array.from({ length:
|
|
646
|
-
),
|
|
647
|
-
queries:
|
|
645
|
+
const [Na, Xn] = k({}), se = Ne ? (c == null ? void 0 : c.groups) ?? null : null, Rt = (se ?? []).filter((e) => !be.has(e.key)).map((e) => e.key).flatMap(
|
|
646
|
+
(e) => Array.from({ length: Na[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
|
|
647
|
+
), dn = Ve({
|
|
648
|
+
queries: Rt.map(({ key: e, page: t }) => ({
|
|
648
649
|
queryKey: [
|
|
649
650
|
"queue-items",
|
|
650
651
|
l,
|
|
@@ -657,30 +658,30 @@ function yi({
|
|
|
657
658
|
t
|
|
658
659
|
],
|
|
659
660
|
queryFn: () => p.request(
|
|
660
|
-
|
|
661
|
+
O(`/queues/${l}/items`, {
|
|
661
662
|
scope: g,
|
|
662
663
|
sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
|
|
663
664
|
filters: JSON.stringify(Ze),
|
|
664
665
|
group_by: N,
|
|
665
666
|
group_key: e,
|
|
666
667
|
page: t,
|
|
667
|
-
limit:
|
|
668
|
+
limit: ns
|
|
668
669
|
})
|
|
669
670
|
).then((n) => ({ key: e, rows: n.data })),
|
|
670
671
|
enabled: !!c && Ne,
|
|
671
672
|
placeholderData: (n) => n
|
|
672
673
|
}))
|
|
673
|
-
}),
|
|
674
|
+
}), Sa = dn.map((e) => e.dataUpdatedAt).join(","), un = G(() => {
|
|
674
675
|
const e = /* @__PURE__ */ new Map();
|
|
675
|
-
return
|
|
676
|
+
return dn.forEach((t, n) => {
|
|
676
677
|
if (!t.data) return;
|
|
677
|
-
const a =
|
|
678
|
+
const a = Rt[n].key;
|
|
678
679
|
e.set(a, [...e.get(a) ?? [], ...t.data.rows]);
|
|
679
680
|
}), e;
|
|
680
|
-
}, [
|
|
681
|
-
|
|
682
|
-
), S = se ? [...
|
|
683
|
-
|
|
681
|
+
}, [Sa, Rt.map((e) => `${e.key}\0${e.page}`).join("")]), Ca = new Set(
|
|
682
|
+
dn.flatMap((e, t) => e.isFetching ? [Rt[t].key] : [])
|
|
683
|
+
), S = se ? [...un.values()].flat() : (c == null ? void 0 : c.data) ?? [];
|
|
684
|
+
wo(
|
|
684
685
|
l ? {
|
|
685
686
|
queue: {
|
|
686
687
|
id: l,
|
|
@@ -691,33 +692,33 @@ function yi({
|
|
|
691
692
|
}
|
|
692
693
|
} : null
|
|
693
694
|
);
|
|
694
|
-
const
|
|
695
|
-
queryKey: ["queue-live-stats", l, g, De,
|
|
695
|
+
const $a = _o(), tt = S.some((e) => e.fulfilment !== void 0), nt = S.some((e) => e.send_backs !== void 0), { data: Tt, dataUpdatedAt: qa } = H({
|
|
696
|
+
queryKey: ["queue-live-stats", l, g, De, Ln],
|
|
696
697
|
queryFn: () => p.request(
|
|
697
|
-
|
|
698
|
+
O(`/queues/${l}/items`, {
|
|
698
699
|
scope: g,
|
|
699
700
|
filters: JSON.stringify(Ze),
|
|
700
701
|
page: 1,
|
|
701
702
|
limit: 1
|
|
702
703
|
})
|
|
703
704
|
),
|
|
704
|
-
enabled:
|
|
705
|
+
enabled: Ln > 0 && !!c,
|
|
705
706
|
staleTime: Number.POSITIVE_INFINITY,
|
|
706
707
|
placeholderData: (e) => e,
|
|
707
708
|
retry: !1
|
|
708
|
-
}),
|
|
709
|
+
}), mn = !!Tt && qa > le, x = mn ? Tt.stats : c == null ? void 0 : c.stats, Y = mn ? Tt.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, Zn = mn ? Tt.state_counts : c == null ? void 0 : c.state_counts;
|
|
709
710
|
En.current = new Set(S.map((e) => `${e.collection}:${e.item_id}`));
|
|
710
|
-
const
|
|
711
|
+
const At = no(
|
|
711
712
|
S.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
712
|
-
|
|
713
|
-
),
|
|
714
|
-
!
|
|
713
|
+
ra
|
|
714
|
+
), er = B(le), tr = B(0);
|
|
715
|
+
!Oe.current && le !== tr.current && (er.current = le), j(() => {
|
|
715
716
|
const e = new Set(S.map((t) => `${t.collection}:${t.item_id}`));
|
|
716
|
-
if (
|
|
717
|
-
|
|
718
|
-
const t =
|
|
719
|
-
|
|
720
|
-
const n =
|
|
717
|
+
if (Oe.current) {
|
|
718
|
+
Oe.current = !1, tr.current = le;
|
|
719
|
+
const t = St.current;
|
|
720
|
+
St.current = [];
|
|
721
|
+
const n = Dn.current, a = /* @__PURE__ */ new Set();
|
|
721
722
|
for (const o of t)
|
|
722
723
|
!e.has(o.key) || a.has(o.key) || (a.add(o.key), we.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
|
|
723
724
|
if (n) {
|
|
@@ -725,21 +726,21 @@ function yi({
|
|
|
725
726
|
o.length > 0 && o.length <= 20 && we.note(o, null, "create");
|
|
726
727
|
}
|
|
727
728
|
}
|
|
728
|
-
|
|
729
|
+
Dn.current = e;
|
|
729
730
|
}, [le]), j(() => {
|
|
730
|
-
|
|
731
|
+
Nt(0);
|
|
731
732
|
}, [c]);
|
|
732
|
-
function
|
|
733
|
-
h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }),
|
|
733
|
+
function Fa() {
|
|
734
|
+
h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }), Nt(0);
|
|
734
735
|
}
|
|
735
736
|
const { data: ie } = H({
|
|
736
737
|
queryKey: ["queue-trends", l],
|
|
737
|
-
queryFn: () => p.request(
|
|
738
|
+
queryFn: () => p.request(O(`/queues/${l}/trends`, { days: 14 })),
|
|
738
739
|
enabled: !!l,
|
|
739
740
|
staleTime: 300 * 1e3
|
|
740
741
|
}), { data: ce } = H({
|
|
741
742
|
queryKey: ["queue-trends", l, "mine"],
|
|
742
|
-
queryFn: () => p.request(
|
|
743
|
+
queryFn: () => p.request(O(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
|
|
743
744
|
enabled: !!l && g === "mine",
|
|
744
745
|
staleTime: 300 * 1e3
|
|
745
746
|
});
|
|
@@ -763,54 +764,54 @@ function yi({
|
|
|
763
764
|
)
|
|
764
765
|
],
|
|
765
766
|
[s == null ? void 0 : s.sources]
|
|
766
|
-
), { data:
|
|
767
|
+
), { data: Ra } = H({
|
|
767
768
|
queryKey: ["collections"],
|
|
768
|
-
queryFn: () => p.request(
|
|
769
|
+
queryFn: () => p.request(O("/collections")).then((e) => e.data),
|
|
769
770
|
staleTime: 300 * 1e3
|
|
770
771
|
}), je = Ve({
|
|
771
772
|
queries: at.map((e) => ({
|
|
772
773
|
queryKey: ["queue-collection-addendums", e],
|
|
773
774
|
queryFn: () => p.request(
|
|
774
|
-
|
|
775
|
+
O(`/collections/${e}`)
|
|
775
776
|
).then((t) => {
|
|
776
777
|
var n;
|
|
777
778
|
return !!((n = t.data) != null && n.addendums_enabled);
|
|
778
779
|
}).catch(() => !1),
|
|
779
780
|
staleTime: 300 * 1e3
|
|
780
781
|
}))
|
|
781
|
-
}).some((e) => e.data === !0), { data:
|
|
782
|
+
}).some((e) => e.data === !0), { data: bn = [] } = H({
|
|
782
783
|
queryKey: ["queue-integrations-collections"],
|
|
783
|
-
queryFn: () => p.request(
|
|
784
|
+
queryFn: () => p.request(O("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
|
|
784
785
|
staleTime: 300 * 1e3
|
|
785
|
-
}), he = at.some((e) =>
|
|
786
|
+
}), he = at.some((e) => bn.includes(e)), pn = G(() => {
|
|
786
787
|
var t;
|
|
787
788
|
const e = {};
|
|
788
789
|
if (!he) return e;
|
|
789
790
|
for (const n of S) {
|
|
790
|
-
if (!
|
|
791
|
+
if (!bn.includes(n.collection)) continue;
|
|
791
792
|
const a = e[t = n.collection] ?? (e[t] = []);
|
|
792
793
|
a.length < 500 && a.push(n.item_id);
|
|
793
794
|
}
|
|
794
795
|
return e;
|
|
795
|
-
}, [S,
|
|
796
|
-
queries:
|
|
797
|
-
queryKey: ["queue-integrations-summary", e,
|
|
796
|
+
}, [S, bn, he]), nr = Object.keys(pn), rr = Ve({
|
|
797
|
+
queries: nr.map((e) => ({
|
|
798
|
+
queryKey: ["queue-integrations-summary", e, pn[e].join(",")],
|
|
798
799
|
queryFn: () => p.request(
|
|
799
800
|
ne("/integration-obligations/summary", {
|
|
800
801
|
collection: e,
|
|
801
|
-
ids:
|
|
802
|
+
ids: pn[e]
|
|
802
803
|
})
|
|
803
804
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
804
805
|
staleTime: 3e4
|
|
805
806
|
}))
|
|
806
|
-
}),
|
|
807
|
+
}), Ta = rr.map((e) => e.dataUpdatedAt).join(","), Aa = G(() => {
|
|
807
808
|
const e = {};
|
|
808
|
-
return
|
|
809
|
+
return nr.forEach((t, n) => {
|
|
809
810
|
var o;
|
|
810
|
-
const a = ((o =
|
|
811
|
+
const a = ((o = rr[n]) == null ? void 0 : o.data) ?? {};
|
|
811
812
|
for (const [i, b] of Object.entries(a)) e[`${t}:${i}`] = b;
|
|
812
813
|
}), e;
|
|
813
|
-
}, [
|
|
814
|
+
}, [Ta]), hn = G(() => {
|
|
814
815
|
var t;
|
|
815
816
|
const e = {};
|
|
816
817
|
for (const n of S) {
|
|
@@ -820,31 +821,31 @@ function yi({
|
|
|
820
821
|
a.length < 500 && a.push(n.item_id);
|
|
821
822
|
}
|
|
822
823
|
return e;
|
|
823
|
-
}, [S]),
|
|
824
|
-
queries:
|
|
825
|
-
queryKey: ["queue-task-counts", e,
|
|
824
|
+
}, [S]), fn = Object.keys(hn), ar = Ve({
|
|
825
|
+
queries: fn.map((e) => ({
|
|
826
|
+
queryKey: ["queue-task-counts", e, hn[e].join(",")],
|
|
826
827
|
queryFn: () => p.request(
|
|
827
|
-
ne("/tasks/counts", { collection: e, ids:
|
|
828
|
+
ne("/tasks/counts", { collection: e, ids: hn[e] })
|
|
828
829
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
829
830
|
staleTime: 3e4
|
|
830
831
|
}))
|
|
831
|
-
}),
|
|
832
|
+
}), Oa = ar.map((e) => e.dataUpdatedAt).join(","), Ea = G(() => {
|
|
832
833
|
const e = {};
|
|
833
|
-
return
|
|
834
|
+
return fn.forEach((t, n) => {
|
|
834
835
|
var a;
|
|
835
|
-
for (const [o, i] of Object.entries(((a =
|
|
836
|
+
for (const [o, i] of Object.entries(((a = ar[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = i;
|
|
836
837
|
}), e;
|
|
837
|
-
}, [
|
|
838
|
+
}, [Oa]), lr = fn.length > 0, or = Ve({
|
|
838
839
|
queries: at.map((e) => ({
|
|
839
840
|
queryKey: ["queue-collection-risk-rules", e],
|
|
840
841
|
queryFn: () => p.request(
|
|
841
|
-
|
|
842
|
+
O("/at-risk/rules/active", { collection: e })
|
|
842
843
|
).then((t) => t.data ?? []).catch(() => []),
|
|
843
844
|
staleTime: 300 * 1e3
|
|
844
845
|
}))
|
|
845
|
-
}),
|
|
846
|
+
}), La = or.map((e) => e.dataUpdatedAt).join(","), sr = G(() => {
|
|
846
847
|
const e = /* @__PURE__ */ new Map();
|
|
847
|
-
for (const t of
|
|
848
|
+
for (const t of or)
|
|
848
849
|
for (const n of t.data ?? []) {
|
|
849
850
|
const a = e.get(n.name);
|
|
850
851
|
e.set(n.name, {
|
|
@@ -853,65 +854,65 @@ function yi({
|
|
|
853
854
|
});
|
|
854
855
|
}
|
|
855
856
|
return [...e.values()];
|
|
856
|
-
}, [
|
|
857
|
+
}, [La]), ir = Ve({
|
|
857
858
|
queries: at.map((e) => ({
|
|
858
859
|
queryKey: ["queue-collection-states", e],
|
|
859
860
|
queryFn: () => p.request(
|
|
860
|
-
|
|
861
|
+
O(`/queues/collection-states/${e}`)
|
|
861
862
|
).then((t) => t.data),
|
|
862
863
|
staleTime: 300 * 1e3
|
|
863
864
|
}))
|
|
864
|
-
}),
|
|
865
|
+
}), cr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), fe = G(() => {
|
|
865
866
|
const e = {};
|
|
866
|
-
for (const t of
|
|
867
|
+
for (const t of ir)
|
|
867
868
|
(t.data ?? []).forEach((n, a) => {
|
|
868
869
|
e[n.key] = { label: n.label, color: n.color, sort: a };
|
|
869
870
|
});
|
|
870
871
|
return e;
|
|
871
|
-
}, [
|
|
872
|
+
}, [ir.map((e) => e.data)]), dr = x ? Object.entries(x.by_state).sort(
|
|
872
873
|
(e, t) => {
|
|
873
874
|
var n, a;
|
|
874
875
|
return (((n = fe[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((a = fe[t[0]]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
875
876
|
}
|
|
876
|
-
) : [],
|
|
877
|
+
) : [], ur = (e) => [...e].sort(
|
|
877
878
|
(t, n) => {
|
|
878
879
|
var a, o;
|
|
879
880
|
return (((a = fe[t]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = fe[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
880
881
|
}
|
|
881
|
-
),
|
|
882
|
+
), gn = G(() => {
|
|
882
883
|
const e = {};
|
|
883
884
|
for (const [t, n] of Object.entries(fe)) e[t] = n.label;
|
|
884
885
|
return e;
|
|
885
|
-
}, [fe]), Ce = (e) => e ? e === "none" ? "No State" :
|
|
886
|
-
if (e ===
|
|
887
|
-
const t = (
|
|
888
|
-
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) ||
|
|
886
|
+
}, [fe]), Ce = (e) => e ? e === "none" ? "No State" : gn[e] ?? cr(e) : "—", lt = (e) => {
|
|
887
|
+
if (e === It) return "Addendums";
|
|
888
|
+
const t = (Ra ?? []).find((n) => n.collection === e);
|
|
889
|
+
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || cr(e);
|
|
889
890
|
}, Z = G(() => N ? se ? se.map((e) => ({
|
|
890
891
|
key: e.key,
|
|
891
|
-
rows:
|
|
892
|
+
rows: un.get(e.key) ?? [],
|
|
892
893
|
breached: e.breached,
|
|
893
894
|
atRisk: e.at_risk,
|
|
894
895
|
count: e.count,
|
|
895
896
|
sums: e.sums ?? {}
|
|
896
|
-
})) :
|
|
897
|
+
})) : co(S, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [S, N, se, un]), xn = B(null);
|
|
897
898
|
j(() => {
|
|
898
899
|
if (!N || !Z) {
|
|
899
|
-
|
|
900
|
+
xn.current = null;
|
|
900
901
|
return;
|
|
901
902
|
}
|
|
902
|
-
if (Ne && !se ||
|
|
903
|
-
|
|
903
|
+
if (Ne && !se || xn.current === N) return;
|
|
904
|
+
xn.current = N;
|
|
904
905
|
const e = Z.reduce((t, n) => t + n.count, 0);
|
|
905
|
-
|
|
906
|
+
Vt(e > 200 ? new Set(Z.map((t) => t.key)) : /* @__PURE__ */ new Set()), Xn({});
|
|
906
907
|
}, [N, se]);
|
|
907
|
-
function
|
|
908
|
-
|
|
908
|
+
function Da(e) {
|
|
909
|
+
Vt((t) => {
|
|
909
910
|
const n = new Set(t);
|
|
910
911
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
911
912
|
});
|
|
912
913
|
}
|
|
913
|
-
const ee = G(() => Z ? Z.filter((e) => !be.has(e.key)).flatMap((e) => e.rows) : S, [Z, S, be]), D = (e) => `${e.collection}:${e.item_id}`, [ge, $e] = k(null), [
|
|
914
|
-
if (e.collection ===
|
|
914
|
+
const ee = G(() => Z ? Z.filter((e) => !be.has(e.key)).flatMap((e) => e.rows) : S, [Z, S, be]), D = (e) => `${e.collection}:${e.item_id}`, [ge, $e] = k(null), [Pa, yn] = k(!1), [Ot, Et] = k(null), kn = (e) => {
|
|
915
|
+
if (e.collection === It && e.url) {
|
|
915
916
|
const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
|
|
916
917
|
if (t) {
|
|
917
918
|
const n = {};
|
|
@@ -931,14 +932,14 @@ function yi({
|
|
|
931
932
|
};
|
|
932
933
|
}, ot = (e) => {
|
|
933
934
|
var t;
|
|
934
|
-
s &&
|
|
935
|
+
s && Xr({
|
|
935
936
|
queue_id: l,
|
|
936
937
|
name: s.name,
|
|
937
938
|
path: `${window.location.pathname}${window.location.search}`,
|
|
938
939
|
at: Date.now(),
|
|
939
|
-
scroll: ((t =
|
|
940
|
+
scroll: ((t = Pt.current) == null ? void 0 : t.scrollTop) ?? 0,
|
|
940
941
|
state: { scope: g, page: ve, sort: I, filters: w, group_by: N, view: A }
|
|
941
|
-
}), W.open(
|
|
942
|
+
}), W.open(kn(e));
|
|
942
943
|
}, [P, st] = k(
|
|
943
944
|
null
|
|
944
945
|
);
|
|
@@ -949,15 +950,15 @@ function yi({
|
|
|
949
950
|
window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
|
|
950
951
|
};
|
|
951
952
|
}, [P]);
|
|
952
|
-
const
|
|
953
|
+
const Lt = (e) => {
|
|
953
954
|
Et(D(e));
|
|
954
955
|
const t = (u == null ? void 0 : u.row_click) ?? "preview";
|
|
955
|
-
if (t === "full" || e.collection ===
|
|
956
|
+
if (t === "full" || e.collection === It) {
|
|
956
957
|
ot(e);
|
|
957
958
|
return;
|
|
958
959
|
}
|
|
959
960
|
if (t === "layout") {
|
|
960
|
-
|
|
961
|
+
Sr({
|
|
961
962
|
collection: e.collection,
|
|
962
963
|
itemId: e.item_id,
|
|
963
964
|
rootLayoutSlug: (u == null ? void 0 : u.item_layout) ?? null,
|
|
@@ -973,18 +974,18 @@ function yi({
|
|
|
973
974
|
const e = S.find((t) => D(t) === D(ge));
|
|
974
975
|
e && e !== ge && $e(e);
|
|
975
976
|
}, [S]);
|
|
976
|
-
const
|
|
977
|
-
function
|
|
978
|
-
const t = e ? ee.findIndex((a) => D(a) === D(e)) + 1 : 0, n = ee.slice(t).find(
|
|
977
|
+
const Ka = (e) => !e.claimed_by || e.claimed_by.id === v;
|
|
978
|
+
function mr(e) {
|
|
979
|
+
const t = e ? ee.findIndex((a) => D(a) === D(e)) + 1 : 0, n = ee.slice(t).find(Ka);
|
|
979
980
|
if (!n) {
|
|
980
|
-
|
|
981
|
+
yn(!1), $e(null), T.info("Nothing left to work on — queue clear!");
|
|
981
982
|
return;
|
|
982
983
|
}
|
|
983
984
|
if (Et(D(n)), oe && !n.claimed_by && Se.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
|
|
984
985
|
ot(n);
|
|
985
986
|
return;
|
|
986
987
|
}
|
|
987
|
-
|
|
988
|
+
yn(!0), $e(n);
|
|
988
989
|
}
|
|
989
990
|
j(() => {
|
|
990
991
|
if (A !== "table") return;
|
|
@@ -993,7 +994,7 @@ function yi({
|
|
|
993
994
|
const n = t.target;
|
|
994
995
|
if (n && (n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.tagName === "SELECT" || n.isContentEditable))
|
|
995
996
|
return;
|
|
996
|
-
const a =
|
|
997
|
+
const a = Ot ? ee.findIndex((i) => D(i) === Ot) : -1;
|
|
997
998
|
if (t.key === "j" || t.key === "ArrowDown") {
|
|
998
999
|
t.preventDefault();
|
|
999
1000
|
const i = ee[Math.min(a + 1, ee.length - 1)];
|
|
@@ -1003,7 +1004,7 @@ function yi({
|
|
|
1003
1004
|
const i = ee[Math.max(a - 1, 0)];
|
|
1004
1005
|
i && Et(D(i));
|
|
1005
1006
|
} else if (t.key === "Enter" && a >= 0 && !ge)
|
|
1006
|
-
t.preventDefault(),
|
|
1007
|
+
t.preventDefault(), Lt(ee[a]);
|
|
1007
1008
|
else if (t.key === "c" && a >= 0 && oe) {
|
|
1008
1009
|
t.preventDefault();
|
|
1009
1010
|
const i = ee[a];
|
|
@@ -1011,38 +1012,38 @@ function yi({
|
|
|
1011
1012
|
} else t.key === "o" && a >= 0 && (t.preventDefault(), ot(ee[a]));
|
|
1012
1013
|
}
|
|
1013
1014
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1014
|
-
}, [A, ee,
|
|
1015
|
+
}, [A, ee, Ot, ge, v, Se, Me, oe]);
|
|
1015
1016
|
const { data: V } = H({
|
|
1016
1017
|
queryKey: ["queue-views", l],
|
|
1017
|
-
queryFn: () => p.request(
|
|
1018
|
+
queryFn: () => p.request(O(`/queues/${l}/views`)),
|
|
1018
1019
|
enabled: !!l
|
|
1019
|
-
}), [it, ct] = k(null), [
|
|
1020
|
-
function
|
|
1020
|
+
}), [it, ct] = k(null), [Ma, vn] = k(!1), [wn, br] = k(""), [pr, hr] = k(!1), [dt, fr] = k(!1);
|
|
1021
|
+
function Dt(e) {
|
|
1021
1022
|
const t = e.state ?? {};
|
|
1022
|
-
J(t.scope ?? "all"), M({ ...pe.current, ...t.filters ?? {} }), Ae(t.sort ?? ""), Ye(t.group_by ?? null),
|
|
1023
|
+
J(t.scope ?? "all"), M({ ...pe.current, ...t.filters ?? {} }), Ae(t.sort ?? ""), Ye(t.group_by ?? null), Ft(t.columns ?? null), Wt(t.pins ?? null), t.view && Te(_e.includes(t.view) ? t.view : _e[0]), L(1), ct(e.id);
|
|
1023
1024
|
}
|
|
1024
|
-
function
|
|
1025
|
+
function Qa() {
|
|
1025
1026
|
var t, n;
|
|
1026
1027
|
const e = V == null ? void 0 : V.data.find((a) => a.is_default);
|
|
1027
1028
|
if (e) {
|
|
1028
|
-
|
|
1029
|
+
Dt(e);
|
|
1029
1030
|
return;
|
|
1030
1031
|
}
|
|
1031
|
-
J(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), M({ ...pe.current }), Ae(""), Ye(null),
|
|
1032
|
+
J(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), M({ ...pe.current }), Ae(""), Ye(null), Ft(null), Wt(null), (n = s == null ? void 0 : s.display_config) != null && n.default_view && Te(s.display_config.default_view), L(1), ct(null);
|
|
1032
1033
|
}
|
|
1033
1034
|
j(() => {
|
|
1034
1035
|
if (ae || !(s != null && s.display_config) || Qe === void 0 || V === void 0) return;
|
|
1035
1036
|
const e = Qe.data.default_view_id, t = e != null ? V.data.find((a) => a.id === e) : void 0, n = V.data.find((a) => a.is_default);
|
|
1036
|
-
t ?
|
|
1037
|
+
t ? Dt(t) : n ? Dt(n) : (Te(s.display_config.default_view), J(s.display_config.default_scope)), ia(!0);
|
|
1037
1038
|
}, [s, Qe, V, ae]);
|
|
1038
|
-
const
|
|
1039
|
+
const Pt = B(null), Kt = B(null);
|
|
1039
1040
|
j(() => {
|
|
1040
1041
|
if (!ae) return;
|
|
1041
|
-
const e =
|
|
1042
|
+
const e = Po();
|
|
1042
1043
|
if (!(e != null && e.restore) || e.queue_id !== l) return;
|
|
1043
|
-
|
|
1044
|
+
Xr({ ...e, restore: !1 });
|
|
1044
1045
|
const t = e.state ?? {};
|
|
1045
|
-
t.scope && J(t.scope), t.filters && M({ ...pe.current, ...t.filters }), t.sort != null && Ae(t.sort), Ye(t.group_by ?? null), t.view && Te(t.view), t.page && L(t.page),
|
|
1046
|
+
t.scope && J(t.scope), t.filters && M({ ...pe.current, ...t.filters }), t.sort != null && Ae(t.sort), Ye(t.group_by ?? null), t.view && Te(t.view), t.page && L(t.page), Kt.current = e.scroll ?? 0;
|
|
1046
1047
|
}, [ae, l]), j(() => {
|
|
1047
1048
|
if (!ae || typeof window > "u") return;
|
|
1048
1049
|
const e = new URLSearchParams(window.location.search), t = e.get("owner");
|
|
@@ -1055,19 +1056,19 @@ function yi({
|
|
|
1055
1056
|
`${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
|
|
1056
1057
|
), J("all"), M((a) => ({ ...a, owners: [t] })), ct(null), L(1);
|
|
1057
1058
|
}, [ae]), j(() => {
|
|
1058
|
-
|
|
1059
|
+
Kt.current == null || S.length === 0 || !Pt.current || (Pt.current.scrollTop = Kt.current, Kt.current = null);
|
|
1059
1060
|
}, [S]);
|
|
1060
|
-
const { isAdmin:
|
|
1061
|
-
mutationFn: ({ viewId: e, on: t }) => p.request(
|
|
1061
|
+
const { isAdmin: Mt } = Jr(), gr = Mt || (s == null ? void 0 : s.owner) != null && s.owner === v, Ba = ye({
|
|
1062
|
+
mutationFn: ({ viewId: e, on: t }) => p.request(Yr(`/queues/views/${e}`, { is_default: t })),
|
|
1062
1063
|
onSuccess: () => {
|
|
1063
1064
|
h.invalidateQueries({ queryKey: ["queue-views", l] }), T.success("Queue default view updated");
|
|
1064
1065
|
},
|
|
1065
1066
|
onError: () => T.error("Could not update the queue default view")
|
|
1066
|
-
}),
|
|
1067
|
+
}), xr = ye({
|
|
1067
1068
|
mutationFn: () => p.request(
|
|
1068
1069
|
ne(`/queues/${l}/views`, {
|
|
1069
|
-
name:
|
|
1070
|
-
is_shared:
|
|
1070
|
+
name: wn.trim(),
|
|
1071
|
+
is_shared: pr || dt,
|
|
1071
1072
|
is_default: dt,
|
|
1072
1073
|
state: {
|
|
1073
1074
|
scope: g,
|
|
@@ -1075,42 +1076,42 @@ function yi({
|
|
|
1075
1076
|
sort: I,
|
|
1076
1077
|
group_by: N,
|
|
1077
1078
|
view: A,
|
|
1078
|
-
columns:
|
|
1079
|
-
pins:
|
|
1079
|
+
columns: sn,
|
|
1080
|
+
pins: _t
|
|
1080
1081
|
}
|
|
1081
1082
|
})
|
|
1082
1083
|
),
|
|
1083
1084
|
onSuccess: (e) => {
|
|
1084
|
-
|
|
1085
|
+
vn(!1), br(""), hr(!1), fr(!1), ct(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), T.success("View saved");
|
|
1085
1086
|
},
|
|
1086
1087
|
onError: () => T.error("Failed to save view")
|
|
1087
|
-
}), [
|
|
1088
|
+
}), [yr, kr] = k(null), qe = ye({
|
|
1088
1089
|
mutationFn: (e) => p.request(
|
|
1089
|
-
|
|
1090
|
+
Yr(`/queues/views/${e.id}`, {
|
|
1090
1091
|
state: {
|
|
1091
1092
|
scope: g,
|
|
1092
1093
|
filters: w,
|
|
1093
1094
|
sort: I,
|
|
1094
1095
|
group_by: N,
|
|
1095
1096
|
view: A,
|
|
1096
|
-
columns:
|
|
1097
|
-
pins:
|
|
1097
|
+
columns: sn,
|
|
1098
|
+
pins: _t
|
|
1098
1099
|
}
|
|
1099
1100
|
})
|
|
1100
1101
|
),
|
|
1101
1102
|
onSuccess: (e, t) => {
|
|
1102
|
-
h.invalidateQueries({ queryKey: ["queue-views", l] }),
|
|
1103
|
+
h.invalidateQueries({ queryKey: ["queue-views", l] }), kr(t.id), setTimeout(() => kr((n) => n === t.id ? null : n), 2e3), T.success(`Saved "${t.name}" with the current filters, scope and sort`);
|
|
1103
1104
|
},
|
|
1104
1105
|
onError: () => T.error("Failed to update view")
|
|
1105
|
-
}),
|
|
1106
|
-
mutationFn: (e) => p.request(
|
|
1106
|
+
}), ja = ye({
|
|
1107
|
+
mutationFn: (e) => p.request(qn(`/queues/views/${e}`)),
|
|
1107
1108
|
onSuccess: (e, t) => {
|
|
1108
|
-
h.invalidateQueries({ queryKey: ["queue-views", l] }), ct(null), Be === t &&
|
|
1109
|
+
h.invalidateQueries({ queryKey: ["queue-views", l] }), ct(null), Be === t && cn(null);
|
|
1109
1110
|
},
|
|
1110
1111
|
onError: () => T.error("Failed to delete view")
|
|
1111
|
-
}),
|
|
1112
|
-
mutationFn: (e) => p.request(
|
|
1113
|
-
onMutate: (e) =>
|
|
1112
|
+
}), Ua = ye({
|
|
1113
|
+
mutationFn: (e) => p.request(Gl(`/queues/${l}/default-view`, { view_id: e })),
|
|
1114
|
+
onMutate: (e) => cn(e),
|
|
1114
1115
|
onSuccess: (e, t) => {
|
|
1115
1116
|
h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), T.success(
|
|
1116
1117
|
t === null ? "Reverted to the general default" : "Set as your default view"
|
|
@@ -1119,14 +1120,14 @@ function yi({
|
|
|
1119
1120
|
onError: () => {
|
|
1120
1121
|
h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), T.error("Failed to update default view");
|
|
1121
1122
|
}
|
|
1122
|
-
}), [Fe,
|
|
1123
|
-
|
|
1124
|
-
const [
|
|
1125
|
-
async function
|
|
1123
|
+
}), [Fe, Qt] = k([]);
|
|
1124
|
+
Vl(), Kn.current = Fe.length;
|
|
1125
|
+
const [vr, wr] = k(!1);
|
|
1126
|
+
async function _n(e, t) {
|
|
1126
1127
|
const n = S.filter((b) => Fe.includes(D(b)));
|
|
1127
|
-
|
|
1128
|
+
wr(!0);
|
|
1128
1129
|
const a = await Promise.allSettled(n.map(t)), o = a.filter((b) => b.status === "fulfilled").length, i = a.length - o;
|
|
1129
|
-
|
|
1130
|
+
wr(!1), Qt([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), i ? T.warning(`${e}: ${o} succeeded, ${i} failed`) : T.success(`${e}: ${o} succeeded`);
|
|
1130
1131
|
}
|
|
1131
1132
|
const Ue = (e) => {
|
|
1132
1133
|
var t;
|
|
@@ -1135,7 +1136,7 @@ function yi({
|
|
|
1135
1136
|
if (a) return a;
|
|
1136
1137
|
}
|
|
1137
1138
|
return null;
|
|
1138
|
-
},
|
|
1139
|
+
}, Ia = (e) => {
|
|
1139
1140
|
if (N === "state") return e === "No state" ? e : Ce(e);
|
|
1140
1141
|
if (N === "collection") return lt(e);
|
|
1141
1142
|
if (N != null && N.startsWith("extra.") && e !== "—") {
|
|
@@ -1143,11 +1144,11 @@ function yi({
|
|
|
1143
1144
|
if (t) return Ge(e, t);
|
|
1144
1145
|
}
|
|
1145
1146
|
return e;
|
|
1146
|
-
},
|
|
1147
|
+
}, Va = Z == null ? void 0 : Z.map((e) => ({
|
|
1147
1148
|
key: e.key,
|
|
1148
1149
|
rows: e.rows,
|
|
1149
1150
|
header: /* @__PURE__ */ d(ke, { children: [
|
|
1150
|
-
/* @__PURE__ */ r("span", { children:
|
|
1151
|
+
/* @__PURE__ */ r("span", { children: Ia(e.key) }),
|
|
1151
1152
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
1152
1153
|
"(",
|
|
1153
1154
|
re(e.count),
|
|
@@ -1161,7 +1162,7 @@ function yi({
|
|
|
1161
1162
|
className: "font-normal tabular-nums text-slate-500 dark:text-slate-400",
|
|
1162
1163
|
"data-queue-group-sum": t,
|
|
1163
1164
|
children: [
|
|
1164
|
-
q(`extra.${t}`,
|
|
1165
|
+
q(`extra.${t}`, kt(t)),
|
|
1165
1166
|
":",
|
|
1166
1167
|
" ",
|
|
1167
1168
|
a ? Ge(String(n), a) : re(n)
|
|
@@ -1170,14 +1171,14 @@ function yi({
|
|
|
1170
1171
|
t
|
|
1171
1172
|
);
|
|
1172
1173
|
}),
|
|
1173
|
-
se && !be.has(e.key) &&
|
|
1174
|
+
se && !be.has(e.key) && Ca.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
|
|
1174
1175
|
se && !be.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
|
|
1175
1176
|
"button",
|
|
1176
1177
|
{
|
|
1177
1178
|
type: "button",
|
|
1178
1179
|
"data-queue-group-more": e.key,
|
|
1179
1180
|
onClick: (t) => {
|
|
1180
|
-
t.stopPropagation(),
|
|
1181
|
+
t.stopPropagation(), Xn((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
|
|
1181
1182
|
},
|
|
1182
1183
|
className: "rounded px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 dark:text-nvr-cyan",
|
|
1183
1184
|
children: [
|
|
@@ -1198,13 +1199,13 @@ function yi({
|
|
|
1198
1199
|
" at risk"
|
|
1199
1200
|
] })
|
|
1200
1201
|
] })
|
|
1201
|
-
})),
|
|
1202
|
-
...
|
|
1202
|
+
})), Nn = (((Er = c == null ? void 0 : c.available_values.collection) == null ? void 0 : Er.length) ?? 0) > 1, _r = S.some((e) => !!e.unseen) || At.size > 0 || S.some((e) => we.isNew(D(e))), Nr = [
|
|
1203
|
+
...Nn ? [
|
|
1203
1204
|
{
|
|
1204
1205
|
key: "collection",
|
|
1205
1206
|
header: q("collection", "Collection"),
|
|
1206
1207
|
sortable: !0,
|
|
1207
|
-
render: (e) => /* @__PURE__ */ r(
|
|
1208
|
+
render: (e) => /* @__PURE__ */ r(Io, { variant: "outline", children: lt(e.collection) })
|
|
1208
1209
|
}
|
|
1209
1210
|
] : [],
|
|
1210
1211
|
{
|
|
@@ -1212,22 +1213,22 @@ function yi({
|
|
|
1212
1213
|
header: q("label", "Item"),
|
|
1213
1214
|
sortable: !0,
|
|
1214
1215
|
// Room in the left padding for the hanging unseen mark (#643).
|
|
1215
|
-
className:
|
|
1216
|
-
headerClassName:
|
|
1216
|
+
className: _r ? "pl-[30px]" : void 0,
|
|
1217
|
+
headerClassName: _r ? "pl-[30px]" : void 0,
|
|
1217
1218
|
render: (e) => (
|
|
1218
1219
|
// Underlined because clicking opens the item. The row is clickable as
|
|
1219
1220
|
// a whole, but nothing on it said so — an underline is the one
|
|
1220
1221
|
// convention people already read as "this goes somewhere".
|
|
1221
1222
|
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
1222
|
-
|
|
1223
|
-
|
|
1223
|
+
At.get(D(e)) || we.isNew(D(e)) ? /* @__PURE__ */ r(
|
|
1224
|
+
Ko,
|
|
1224
1225
|
{
|
|
1225
|
-
lock:
|
|
1226
|
+
lock: At.get(D(e)),
|
|
1226
1227
|
isNew: we.isNew(D(e)),
|
|
1227
1228
|
dataAttr: "data-queue-live-mark",
|
|
1228
1229
|
hang: !0
|
|
1229
1230
|
}
|
|
1230
|
-
) : /* @__PURE__ */ r(
|
|
1231
|
+
) : /* @__PURE__ */ r(Uo, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
|
|
1231
1232
|
/* @__PURE__ */ r(
|
|
1232
1233
|
"span",
|
|
1233
1234
|
{
|
|
@@ -1246,9 +1247,9 @@ function yi({
|
|
|
1246
1247
|
t
|
|
1247
1248
|
)),
|
|
1248
1249
|
/* @__PURE__ */ r(
|
|
1249
|
-
|
|
1250
|
+
jo,
|
|
1250
1251
|
{
|
|
1251
|
-
viewers:
|
|
1252
|
+
viewers: wa[io(e.collection, e.item_id)],
|
|
1252
1253
|
dataAttr: "data-queue-presence"
|
|
1253
1254
|
}
|
|
1254
1255
|
)
|
|
@@ -1279,13 +1280,13 @@ function yi({
|
|
|
1279
1280
|
key: "owners",
|
|
1280
1281
|
header: q("owners", "Owners"),
|
|
1281
1282
|
sortable: !0,
|
|
1282
|
-
render: (e) => /* @__PURE__ */ r(
|
|
1283
|
+
render: (e) => /* @__PURE__ */ r(Jo, { owners: e.owners })
|
|
1283
1284
|
},
|
|
1284
1285
|
{
|
|
1285
1286
|
key: "aging_hours",
|
|
1286
1287
|
header: q("aging_hours", "Aging"),
|
|
1287
1288
|
sortable: !0,
|
|
1288
|
-
render: (e) =>
|
|
1289
|
+
render: (e) => ls(e.aging_hours)
|
|
1289
1290
|
},
|
|
1290
1291
|
{
|
|
1291
1292
|
// When the record entered its current state — the same moment Aging
|
|
@@ -1293,13 +1294,13 @@ function yi({
|
|
|
1293
1294
|
key: "state_entered",
|
|
1294
1295
|
header: q("state_entered", "Last State Change"),
|
|
1295
1296
|
sortable: !0,
|
|
1296
|
-
render: (e) => e.state_entered_at ?
|
|
1297
|
+
render: (e) => e.state_entered_at ? Yl(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
|
|
1297
1298
|
},
|
|
1298
1299
|
{
|
|
1299
1300
|
key: "sla_status",
|
|
1300
1301
|
header: q("sla_status", "SLA"),
|
|
1301
1302
|
sortable: !0,
|
|
1302
|
-
render: (e) => /* @__PURE__ */ r(
|
|
1303
|
+
render: (e) => /* @__PURE__ */ r(os, { status: e.sla_status })
|
|
1303
1304
|
},
|
|
1304
1305
|
{
|
|
1305
1306
|
key: "at_risk",
|
|
@@ -1307,7 +1308,7 @@ function yi({
|
|
|
1307
1308
|
sortable: !0,
|
|
1308
1309
|
render: (e) => {
|
|
1309
1310
|
var t;
|
|
1310
|
-
return e.at_risk ? /* @__PURE__ */ d("span", { className:
|
|
1311
|
+
return e.at_risk ? /* @__PURE__ */ d("span", { className: mo(e.at_risk_color ?? "red"), children: [
|
|
1311
1312
|
"⚑ ",
|
|
1312
1313
|
((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
|
|
1313
1314
|
] }) : e.predicted_risk ? /* @__PURE__ */ r("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
|
|
@@ -1318,7 +1319,7 @@ function yi({
|
|
|
1318
1319
|
key: "addendums",
|
|
1319
1320
|
header: q("addendums", "Addendums"),
|
|
1320
1321
|
sortable: !1,
|
|
1321
|
-
render: (e) => /* @__PURE__ */ r(
|
|
1322
|
+
render: (e) => /* @__PURE__ */ r(as, { summary: e.addendums })
|
|
1322
1323
|
}
|
|
1323
1324
|
] : [],
|
|
1324
1325
|
...tt ? [
|
|
@@ -1327,7 +1328,7 @@ function yi({
|
|
|
1327
1328
|
header: q("fulfilment", "Shipped"),
|
|
1328
1329
|
sortable: !0,
|
|
1329
1330
|
render: (e) => /* @__PURE__ */ r(
|
|
1330
|
-
|
|
1331
|
+
To,
|
|
1331
1332
|
{
|
|
1332
1333
|
collection: e.collection,
|
|
1333
1334
|
itemId: e.item_id,
|
|
@@ -1341,10 +1342,10 @@ function yi({
|
|
|
1341
1342
|
key: "integrations",
|
|
1342
1343
|
header: q("integrations", "Integrations"),
|
|
1343
1344
|
sortable: !1,
|
|
1344
|
-
render: (e) => /* @__PURE__ */ r(Eo, { rows:
|
|
1345
|
+
render: (e) => /* @__PURE__ */ r(Eo, { rows: Aa[`${e.collection}:${e.item_id}`] })
|
|
1345
1346
|
}
|
|
1346
1347
|
] : [],
|
|
1347
|
-
...
|
|
1348
|
+
...lr ? [
|
|
1348
1349
|
{
|
|
1349
1350
|
key: "tasks",
|
|
1350
1351
|
header: q("tasks", "Tasks"),
|
|
@@ -1370,10 +1371,10 @@ function yi({
|
|
|
1370
1371
|
key: "send_backs",
|
|
1371
1372
|
header: q("send_backs", "Sent back"),
|
|
1372
1373
|
sortable: !0,
|
|
1373
|
-
render: (e) => /* @__PURE__ */ r(
|
|
1374
|
+
render: (e) => /* @__PURE__ */ r(ts, { summary: e.send_backs })
|
|
1374
1375
|
}
|
|
1375
1376
|
] : []
|
|
1376
|
-
],
|
|
1377
|
+
], Ga = {
|
|
1377
1378
|
key: "claim",
|
|
1378
1379
|
header: "",
|
|
1379
1380
|
render: (e) => e.claimed_by ? /* @__PURE__ */ r(
|
|
@@ -1397,7 +1398,7 @@ function yi({
|
|
|
1397
1398
|
children: "Claim"
|
|
1398
1399
|
}
|
|
1399
1400
|
)
|
|
1400
|
-
}, ut = (s == null ? void 0 : s.available_extra_fields) ?? [], mt =
|
|
1401
|
+
}, ut = (s == null ? void 0 : s.available_extra_fields) ?? [], mt = jl("drill.queue"), X = mt.value, Sr = (e) => mt.push([e]), Wa = (e) => {
|
|
1401
1402
|
var t;
|
|
1402
1403
|
for (const n of (s == null ? void 0 : s.sources) ?? []) {
|
|
1403
1404
|
const a = (t = n.drilldown) == null ? void 0 : t[e];
|
|
@@ -1409,40 +1410,40 @@ function yi({
|
|
|
1409
1410
|
};
|
|
1410
1411
|
}
|
|
1411
1412
|
return { enabled: !0, layout_id: null, width: null };
|
|
1412
|
-
},
|
|
1413
|
+
}, Ha = G(() => {
|
|
1413
1414
|
const e = {};
|
|
1414
1415
|
for (const t of (s == null ? void 0 : s.sources) ?? [])
|
|
1415
1416
|
for (const [n, a] of Object.entries(t.column_formats ?? {}))
|
|
1416
1417
|
n in e || (e[n] = a);
|
|
1417
1418
|
return e;
|
|
1418
|
-
}, [s == null ? void 0 : s.sources]),
|
|
1419
|
-
function
|
|
1420
|
-
if (
|
|
1421
|
-
if (
|
|
1419
|
+
}, [s == null ? void 0 : s.sources]), Ja = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ya = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
|
|
1420
|
+
function za(e) {
|
|
1421
|
+
if (Ja.test(e)) return { text: e.split("@")[0], title: e };
|
|
1422
|
+
if (Ya.test(e)) {
|
|
1422
1423
|
const t = new Date(e);
|
|
1423
1424
|
if (!Number.isNaN(t.getTime()))
|
|
1424
1425
|
return {
|
|
1425
|
-
text:
|
|
1426
|
-
title:
|
|
1426
|
+
text: vo(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
|
|
1427
|
+
title: ko(t)
|
|
1427
1428
|
};
|
|
1428
1429
|
}
|
|
1429
1430
|
return { text: e, title: e };
|
|
1430
1431
|
}
|
|
1431
|
-
const
|
|
1432
|
+
const Xa = ut.map((e) => ({
|
|
1432
1433
|
key: `extra.${e}`,
|
|
1433
|
-
header: q(`extra.${e}`,
|
|
1434
|
+
header: q(`extra.${e}`, kt(e)),
|
|
1434
1435
|
sortable: !0,
|
|
1435
1436
|
render: (t) => {
|
|
1436
1437
|
var y, R;
|
|
1437
1438
|
const n = (y = t.extra) == null ? void 0 : y[e];
|
|
1438
1439
|
if (n == null || n === "") return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
|
|
1439
|
-
const a = Ue(e), o = a ? Ge(String(n), a) : String(n), { text: i, title: b } =
|
|
1440
|
+
const a = Ue(e), o = a ? Ge(String(n), a) : String(n), { text: i, title: b } = za(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((Q) => Q.path === e), K = ((R = t.extra_ids) == null ? void 0 : R[e]) ?? [], F = Wa(e);
|
|
1440
1441
|
return (m == null ? void 0 : m.kind) === "relation" && m.target_collection && K.length > 0 && F.enabled && !m.aggregate ? /* @__PURE__ */ r(
|
|
1441
1442
|
"button",
|
|
1442
1443
|
{
|
|
1443
1444
|
type: "button",
|
|
1444
1445
|
onClick: (Q) => {
|
|
1445
|
-
Q.stopPropagation(),
|
|
1446
|
+
Q.stopPropagation(), Sr({
|
|
1446
1447
|
collection: m.target_collection,
|
|
1447
1448
|
itemId: K[0],
|
|
1448
1449
|
layoutId: F.layout_id,
|
|
@@ -1459,7 +1460,7 @@ function yi({
|
|
|
1459
1460
|
{
|
|
1460
1461
|
type: "button",
|
|
1461
1462
|
onClick: (Q) => {
|
|
1462
|
-
Q.stopPropagation(),
|
|
1463
|
+
Q.stopPropagation(), rn({ row: t, path: e, value: o });
|
|
1463
1464
|
},
|
|
1464
1465
|
title: "Show the rows behind this number",
|
|
1465
1466
|
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",
|
|
@@ -1467,8 +1468,8 @@ function yi({
|
|
|
1467
1468
|
}
|
|
1468
1469
|
) : /* @__PURE__ */ r("span", { className: "block max-w-[200px] truncate text-[12px]", title: b, children: i });
|
|
1469
1470
|
}
|
|
1470
|
-
})),
|
|
1471
|
-
...
|
|
1471
|
+
})), Cr = [
|
|
1472
|
+
...Nn ? ["collection"] : [],
|
|
1472
1473
|
"state",
|
|
1473
1474
|
"owners",
|
|
1474
1475
|
"aging_hours",
|
|
@@ -1479,10 +1480,10 @@ function yi({
|
|
|
1479
1480
|
...tt ? ["fulfilment"] : [],
|
|
1480
1481
|
...he ? ["integrations"] : [],
|
|
1481
1482
|
...nt ? ["send_backs"] : [],
|
|
1482
|
-
...
|
|
1483
|
+
...lr ? ["tasks"] : [],
|
|
1483
1484
|
...ut.map((e) => `extra.${e}`)
|
|
1484
|
-
],
|
|
1485
|
-
...
|
|
1485
|
+
], Za = [
|
|
1486
|
+
...Nn ? ["collection"] : [],
|
|
1486
1487
|
"state",
|
|
1487
1488
|
"owners",
|
|
1488
1489
|
...je ? ["addendums"] : [],
|
|
@@ -1493,29 +1494,29 @@ function yi({
|
|
|
1493
1494
|
"sla_status",
|
|
1494
1495
|
"at_risk",
|
|
1495
1496
|
...ut.slice(0, 2).map((e) => `extra.${e}`)
|
|
1496
|
-
],
|
|
1497
|
-
je && !
|
|
1498
|
-
const
|
|
1499
|
-
for (const e of
|
|
1497
|
+
], el = (u == null ? void 0 : u.default_columns) ?? null, Sn = sn ?? el, te = new Set(Sn ?? Za);
|
|
1498
|
+
je && !wt.has("addendums") && te.add("addendums"), tt && !wt.has("fulfilment") && te.add("fulfilment"), he && !wt.has("integrations") && te.add("integrations"), nt && !wt.has("send_backs") && te.add("send_backs");
|
|
1499
|
+
const tl = new Set(Mt ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
|
|
1500
|
+
for (const e of tl) te.delete(e);
|
|
1500
1501
|
const Ie = [
|
|
1501
|
-
...(
|
|
1502
|
-
...
|
|
1503
|
-
],
|
|
1504
|
-
function
|
|
1502
|
+
...(Sn ?? []).filter((e) => Cr.includes(e)),
|
|
1503
|
+
...Cr.filter((e) => !(Sn ?? []).includes(e))
|
|
1504
|
+
], nl = ul(ml(bl, { activationConstraint: { distance: 4 } }));
|
|
1505
|
+
function rl(e) {
|
|
1505
1506
|
const { active: t, over: n } = e;
|
|
1506
1507
|
if (!n || t.id === n.id) return;
|
|
1507
1508
|
const a = Ie.indexOf(String(t.id)), o = Ie.indexOf(String(n.id));
|
|
1508
|
-
a === -1 || o === -1 ||
|
|
1509
|
-
|
|
1509
|
+
a === -1 || o === -1 || Ft(
|
|
1510
|
+
xl(Ie, a, o).filter((i) => te.has(i))
|
|
1510
1511
|
);
|
|
1511
1512
|
}
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1513
|
+
const $r = Nr.find((e) => e.key === "label"), al = {
|
|
1514
|
+
...$r,
|
|
1514
1515
|
render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
1515
|
-
/* @__PURE__ */ r(
|
|
1516
|
-
|
|
1516
|
+
/* @__PURE__ */ r(Co, { rowId: e.item_id }),
|
|
1517
|
+
$r.render(e, ...t)
|
|
1517
1518
|
] })
|
|
1518
|
-
},
|
|
1519
|
+
}, ll = ((u == null ? void 0 : u.formula_columns) ?? []).map(
|
|
1519
1520
|
(e) => ({
|
|
1520
1521
|
key: `formula.${e.key}`,
|
|
1521
1522
|
header: e.label,
|
|
@@ -1523,7 +1524,7 @@ function yi({
|
|
|
1523
1524
|
const n = {
|
|
1524
1525
|
...t,
|
|
1525
1526
|
...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([i, b]) => [`extra.${i}`, b])) : {}
|
|
1526
|
-
}, a =
|
|
1527
|
+
}, a = Wl(e.formula, (i) => {
|
|
1527
1528
|
const b = n[i] ?? (t.extra ? t.extra[i] : void 0), m = Number(b);
|
|
1528
1529
|
return Number.isFinite(m) ? m : b ?? null;
|
|
1529
1530
|
});
|
|
@@ -1532,11 +1533,11 @@ function yi({
|
|
|
1532
1533
|
return Number.isFinite(o) ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ r("span", { children: String(a) });
|
|
1533
1534
|
}
|
|
1534
1535
|
})
|
|
1535
|
-
),
|
|
1536
|
+
), qr = [...Nr, ...Xa, ...ll], ol = {
|
|
1536
1537
|
key: "__actions__",
|
|
1537
1538
|
header: "",
|
|
1538
|
-
render: (e) => e.collection === "tasks" || e.collection ===
|
|
1539
|
-
|
|
1539
|
+
render: (e) => e.collection === "tasks" || e.collection === It ? null : /* @__PURE__ */ r("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(
|
|
1540
|
+
$o,
|
|
1540
1541
|
{
|
|
1541
1542
|
collection: e.collection,
|
|
1542
1543
|
id: e.item_id,
|
|
@@ -1545,34 +1546,32 @@ function yi({
|
|
|
1545
1546
|
onPeek: () => $e(e),
|
|
1546
1547
|
urlFor: W.urlFor,
|
|
1547
1548
|
onDeleted: () => {
|
|
1548
|
-
p.request(
|
|
1549
|
+
p.request(qn(`/items/${e.collection}/${e.item_id}`)).then(() => {
|
|
1549
1550
|
T.success("Moved to trash"), h.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
1550
|
-
}).catch(
|
|
1551
|
-
(t) => T.error(t instanceof Error ? t.message : "Delete failed")
|
|
1552
|
-
);
|
|
1551
|
+
}).catch((t) => T.error(gt(t, "Delete failed")));
|
|
1553
1552
|
},
|
|
1554
1553
|
onAfterTransition: () => void h.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
1555
1554
|
bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null
|
|
1556
1555
|
}
|
|
1557
1556
|
) })
|
|
1558
|
-
},
|
|
1559
|
-
|
|
1560
|
-
...Ie.filter((e) => te.has(e)).map((e) =>
|
|
1561
|
-
...oe ? [
|
|
1562
|
-
|
|
1563
|
-
],
|
|
1557
|
+
}, Bt = [
|
|
1558
|
+
al,
|
|
1559
|
+
...Ie.filter((e) => te.has(e)).map((e) => qr.find((t) => t.key === e)).filter((e) => e !== void 0),
|
|
1560
|
+
...oe ? [Ga] : [],
|
|
1561
|
+
ol
|
|
1562
|
+
], Fr = G(() => {
|
|
1564
1563
|
var a;
|
|
1565
|
-
const e = u == null ? void 0 : u.default_pins, t =
|
|
1564
|
+
const e = u == null ? void 0 : u.default_pins, t = _t ?? (e && Object.keys(e).length > 0 ? e : { [((a = Bt[0]) == null ? void 0 : a.key) ?? "label"]: "left" }), n = new Set(Bt.map((o) => o.key));
|
|
1566
1565
|
return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
|
|
1567
|
-
}, [
|
|
1566
|
+
}, [_t, u == null ? void 0 : u.default_pins, Bt.map((e) => e.key).join("|")]), Rr = [
|
|
1568
1567
|
{ value: "state", label: "State" },
|
|
1569
1568
|
{ value: "collection", label: "Collection" },
|
|
1570
1569
|
{ value: "sla_status", label: "SLA status" },
|
|
1571
1570
|
{ value: "at_risk", label: "At risk" },
|
|
1572
1571
|
{ value: "owners", label: "Owner" },
|
|
1573
1572
|
{ value: "aging", label: "Aging" },
|
|
1574
|
-
...ut.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: q(`extra.${e}`,
|
|
1575
|
-
],
|
|
1573
|
+
...ut.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: q(`extra.${e}`, kt(e)) }))
|
|
1574
|
+
], Tr = (e) => async (t) => {
|
|
1576
1575
|
if (!e.target_collection || !e.display_field) return [];
|
|
1577
1576
|
const n = {
|
|
1578
1577
|
limit: 25,
|
|
@@ -1580,8 +1579,8 @@ function yi({
|
|
|
1580
1579
|
};
|
|
1581
1580
|
t.trim() && (n.filter = JSON.stringify({ [e.display_field]: { _contains: t.trim() } }));
|
|
1582
1581
|
const o = (await p.request(
|
|
1583
|
-
|
|
1584
|
-
)).data ?? [], i = Ue(e.path), b =
|
|
1582
|
+
O(`/items/${e.target_collection}`, n)
|
|
1583
|
+
)).data ?? [], i = Ue(e.path), b = Ee[e.path] ? new Set(Ee[e.path]) : null, m = /* @__PURE__ */ new Set(), K = [];
|
|
1585
1584
|
for (const F of o) {
|
|
1586
1585
|
const y = F[e.display_field];
|
|
1587
1586
|
if (y == null || y === "") continue;
|
|
@@ -1589,7 +1588,7 @@ function yi({
|
|
|
1589
1588
|
m.has(R) || b && !b.has(R) || (m.add(R), K.push({ label: i ? Ge(R, i) : R, value: R }));
|
|
1590
1589
|
}
|
|
1591
1590
|
return K;
|
|
1592
|
-
},
|
|
1591
|
+
}, Cn = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), bt = [
|
|
1593
1592
|
{
|
|
1594
1593
|
key: "collection",
|
|
1595
1594
|
placeholder: q("collection", "Collection"),
|
|
@@ -1607,7 +1606,7 @@ function yi({
|
|
|
1607
1606
|
multi: !0,
|
|
1608
1607
|
// Until the rows land, the pipeline's own states (no counts yet) rather
|
|
1609
1608
|
// than an empty list.
|
|
1610
|
-
options:
|
|
1609
|
+
options: ur(
|
|
1611
1610
|
c ? c.available_values.state ?? [] : Object.keys(fe)
|
|
1612
1611
|
).map((e) => {
|
|
1613
1612
|
var t;
|
|
@@ -1616,7 +1615,7 @@ function yi({
|
|
|
1616
1615
|
value: e,
|
|
1617
1616
|
// How many rows sit in it under the other active filters (the State
|
|
1618
1617
|
// filter itself left out, or every other state would read 0).
|
|
1619
|
-
count:
|
|
1618
|
+
count: Zn ? Zn[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
|
|
1620
1619
|
};
|
|
1621
1620
|
})
|
|
1622
1621
|
},
|
|
@@ -1639,12 +1638,12 @@ function yi({
|
|
|
1639
1638
|
{ label: "No", value: "no" }
|
|
1640
1639
|
]
|
|
1641
1640
|
},
|
|
1642
|
-
...
|
|
1641
|
+
...sr.length > 0 ? [
|
|
1643
1642
|
{
|
|
1644
1643
|
key: "at_risk_rule",
|
|
1645
1644
|
placeholder: "Highlight rule",
|
|
1646
1645
|
type: "select",
|
|
1647
|
-
options:
|
|
1646
|
+
options: sr
|
|
1648
1647
|
}
|
|
1649
1648
|
] : [],
|
|
1650
1649
|
{
|
|
@@ -1671,7 +1670,7 @@ function yi({
|
|
|
1671
1670
|
key: "integrations",
|
|
1672
1671
|
placeholder: q("integrations", "Integrations"),
|
|
1673
1672
|
type: "select",
|
|
1674
|
-
options:
|
|
1673
|
+
options: Lo.map((e) => ({ label: e.label, value: e.value }))
|
|
1675
1674
|
}
|
|
1676
1675
|
] : [],
|
|
1677
1676
|
...tt ? [
|
|
@@ -1679,7 +1678,7 @@ function yi({
|
|
|
1679
1678
|
key: "fulfilment",
|
|
1680
1679
|
placeholder: "Shipped",
|
|
1681
1680
|
type: "select",
|
|
1682
|
-
options:
|
|
1681
|
+
options: Ao
|
|
1683
1682
|
}
|
|
1684
1683
|
] : [],
|
|
1685
1684
|
...nt ? [
|
|
@@ -1694,13 +1693,13 @@ function yi({
|
|
|
1694
1693
|
]
|
|
1695
1694
|
}
|
|
1696
1695
|
] : [],
|
|
1697
|
-
...
|
|
1696
|
+
...ln.length > 0 ? [
|
|
1698
1697
|
{
|
|
1699
1698
|
key: "labels",
|
|
1700
1699
|
placeholder: "Triage label",
|
|
1701
1700
|
type: "combobox",
|
|
1702
1701
|
multi: !0,
|
|
1703
|
-
options:
|
|
1702
|
+
options: ln.map((e) => ({ label: e, value: e }))
|
|
1704
1703
|
}
|
|
1705
1704
|
] : [],
|
|
1706
1705
|
{
|
|
@@ -1709,7 +1708,7 @@ function yi({
|
|
|
1709
1708
|
type: "combobox",
|
|
1710
1709
|
multi: !0,
|
|
1711
1710
|
loadOptions: async (e) => ((await p.request(
|
|
1712
|
-
|
|
1711
|
+
O(`/queues/${l}/label-suggest`, e.trim() ? { q: e.trim() } : {})
|
|
1713
1712
|
)).data ?? []).map((n) => ({ label: n, value: n }))
|
|
1714
1713
|
},
|
|
1715
1714
|
{
|
|
@@ -1724,7 +1723,7 @@ function yi({
|
|
|
1724
1723
|
},
|
|
1725
1724
|
...ut.map((e) => {
|
|
1726
1725
|
var b, m;
|
|
1727
|
-
const t =
|
|
1726
|
+
const t = Cn.get(e), n = q(`extra.${e}`, kt(e)), a = { key: `extra.${e}`, placeholder: n }, o = Ue(e);
|
|
1728
1727
|
if ((o == null ? void 0 : o.type) === "datetime") return { ...a, type: "date" };
|
|
1729
1728
|
if ((o == null ? void 0 : o.type) === "number") return { ...a, type: "number" };
|
|
1730
1729
|
if ((o == null ? void 0 : o.type) === "boolean")
|
|
@@ -1746,13 +1745,13 @@ function yi({
|
|
|
1746
1745
|
...a,
|
|
1747
1746
|
type: "combobox",
|
|
1748
1747
|
multi: !0,
|
|
1749
|
-
restricted: !!((m =
|
|
1750
|
-
loadOptions:
|
|
1748
|
+
restricted: !!((m = Ee[e]) != null && m.length),
|
|
1749
|
+
loadOptions: Tr(t)
|
|
1751
1750
|
} : { ...a, placeholder: `Search ${n}…`, type: "text" };
|
|
1752
1751
|
})
|
|
1753
|
-
],
|
|
1752
|
+
], $n = bt.filter(
|
|
1754
1753
|
(e) => te.has(e.key) || e.key === "label" || e.key === "owners"
|
|
1755
|
-
), pt = new Set(Object.keys(pe.current)),
|
|
1754
|
+
), pt = new Set(Object.keys(pe.current)), sl = ((e) => {
|
|
1756
1755
|
var n;
|
|
1757
1756
|
if (e.some((a) => a.key === "state")) return e;
|
|
1758
1757
|
const t = bt.find((a) => a.key === "state");
|
|
@@ -1764,7 +1763,7 @@ function yi({
|
|
|
1764
1763
|
var Q, xe, Re;
|
|
1765
1764
|
if (!i.key.startsWith("extra.")) return null;
|
|
1766
1765
|
if (i.type === "combobox") return i;
|
|
1767
|
-
const b = i.key.slice(6), m =
|
|
1766
|
+
const b = i.key.slice(6), m = Cn.get(b), K = pt.has(i.key);
|
|
1768
1767
|
if ((m == null ? void 0 : m.kind) !== "relation" && !K) return null;
|
|
1769
1768
|
const F = Ue(b), y = (Q = c == null ? void 0 : c.available_values.extra) == null ? void 0 : Q[b], R = i.placeholder.replace(/^Search (.*)…$/, "$1");
|
|
1770
1769
|
return y != null && y.length ? {
|
|
@@ -1772,7 +1771,7 @@ function yi({
|
|
|
1772
1771
|
placeholder: R,
|
|
1773
1772
|
type: "combobox",
|
|
1774
1773
|
multi: !0,
|
|
1775
|
-
restricted: !!((xe =
|
|
1774
|
+
restricted: !!((xe = Ee[b]) != null && xe.length),
|
|
1776
1775
|
options: y.map((_) => ({
|
|
1777
1776
|
label: F && F.type !== "number" ? Ge(_, F) : _,
|
|
1778
1777
|
value: _
|
|
@@ -1782,13 +1781,13 @@ function yi({
|
|
|
1782
1781
|
placeholder: R,
|
|
1783
1782
|
type: "combobox",
|
|
1784
1783
|
multi: !0,
|
|
1785
|
-
restricted: !!((Re =
|
|
1786
|
-
loadOptions:
|
|
1784
|
+
restricted: !!((Re = Ee[b]) != null && Re.length),
|
|
1785
|
+
loadOptions: Tr(m)
|
|
1787
1786
|
} : null;
|
|
1788
1787
|
};
|
|
1789
|
-
if (
|
|
1788
|
+
if (Un.length > 0) {
|
|
1790
1789
|
const i = [], b = /* @__PURE__ */ new Set();
|
|
1791
|
-
for (const m of
|
|
1790
|
+
for (const m of Un) {
|
|
1792
1791
|
const K = (m.path ?? []).join(".");
|
|
1793
1792
|
let F;
|
|
1794
1793
|
if (m.key === "state" || /(^|_)state$/.test(((o = m.path) == null ? void 0 : o[0]) ?? ""))
|
|
@@ -1798,7 +1797,7 @@ function yi({
|
|
|
1798
1797
|
var Re;
|
|
1799
1798
|
if (!Q.key.startsWith("extra.") || b.has(Q.key)) return !1;
|
|
1800
1799
|
const xe = Q.key.slice(6);
|
|
1801
|
-
return ((Re =
|
|
1800
|
+
return ((Re = Cn.get(xe)) == null ? void 0 : Re.target_collection) === m.collection;
|
|
1802
1801
|
}), R = y.find((Q) => Q.key.slice(6).startsWith(`${K}.`)) ?? y[0];
|
|
1803
1802
|
F = R ? e(R) : null;
|
|
1804
1803
|
}
|
|
@@ -1808,13 +1807,13 @@ function yi({
|
|
|
1808
1807
|
m && !b.has(m.key) && (pt.has(m.key) || m.restricted) && i.push(m);
|
|
1809
1808
|
if (i.length > 0) return i;
|
|
1810
1809
|
}
|
|
1811
|
-
const t =
|
|
1810
|
+
const t = $n.map(e).filter((i) => i !== null), a = [
|
|
1812
1811
|
...t.filter((i) => pt.has(i.key) || i.restricted),
|
|
1813
1812
|
...t.filter((i) => !pt.has(i.key) && !i.restricted)
|
|
1814
1813
|
].slice(0, 6);
|
|
1815
|
-
return a.length > 0 ? a :
|
|
1814
|
+
return a.length > 0 ? a : $n.filter((i) => i.key === "state" || i.key === "owners");
|
|
1816
1815
|
})()
|
|
1817
|
-
),
|
|
1816
|
+
), il = (() => {
|
|
1818
1817
|
if (!x) return null;
|
|
1819
1818
|
const e = Y ?? x, t = [
|
|
1820
1819
|
{
|
|
@@ -1886,17 +1885,17 @@ function yi({
|
|
|
1886
1885
|
}
|
|
1887
1886
|
);
|
|
1888
1887
|
})();
|
|
1889
|
-
function
|
|
1888
|
+
function cl(e) {
|
|
1890
1889
|
const t = new Set(te);
|
|
1891
|
-
t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") &&
|
|
1890
|
+
t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && On((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && On((n) => {
|
|
1892
1891
|
const a = new Set(n);
|
|
1893
1892
|
return a.delete(e), a;
|
|
1894
|
-
})),
|
|
1893
|
+
})), Ft([...t]);
|
|
1895
1894
|
}
|
|
1896
|
-
return
|
|
1895
|
+
return Ct ? ($ == null ? void 0 : $((Ct == null ? void 0 : Ct.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
|
|
1897
1896
|
/* @__PURE__ */ d("div", { className: "shrink-0", children: [
|
|
1898
1897
|
(c == null ? void 0 : c.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
|
|
1899
|
-
/* @__PURE__ */ r(
|
|
1898
|
+
/* @__PURE__ */ r(wl, { className: "h-4 w-4 shrink-0" }),
|
|
1900
1899
|
/* @__PURE__ */ r("span", { children: "This view hit the row safety limit — the table below may not include every matching item, but the totals above are exact. Narrow the filters (or clear the priority sort on a large queue) to browse everything." })
|
|
1901
1900
|
] }),
|
|
1902
1901
|
/* @__PURE__ */ d(
|
|
@@ -1905,7 +1904,7 @@ function yi({
|
|
|
1905
1904
|
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",
|
|
1906
1905
|
"data-queue-toolbar": !0,
|
|
1907
1906
|
children: [
|
|
1908
|
-
ae ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children:
|
|
1907
|
+
ae ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: rs.filter((e) => oe || e.value !== "claimed").map(
|
|
1909
1908
|
(e, t) => /* @__PURE__ */ r(
|
|
1910
1909
|
"button",
|
|
1911
1910
|
{
|
|
@@ -1974,13 +1973,13 @@ function yi({
|
|
|
1974
1973
|
}),
|
|
1975
1974
|
className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${w.addendums === "active" ? "border-amber-400 bg-amber-50 text-amber-800 dark:border-amber-500/60 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
|
|
1976
1975
|
children: [
|
|
1977
|
-
/* @__PURE__ */ r(
|
|
1976
|
+
/* @__PURE__ */ r(_l, { className: "h-3.5 w-3.5" }),
|
|
1978
1977
|
"Active addendums"
|
|
1979
1978
|
]
|
|
1980
1979
|
}
|
|
1981
1980
|
),
|
|
1982
1981
|
he && /* @__PURE__ */ r(
|
|
1983
|
-
|
|
1982
|
+
Do,
|
|
1984
1983
|
{
|
|
1985
1984
|
label: q("integrations", "Integrations"),
|
|
1986
1985
|
value: w.integrations,
|
|
@@ -1990,19 +1989,19 @@ function yi({
|
|
|
1990
1989
|
})
|
|
1991
1990
|
}
|
|
1992
1991
|
),
|
|
1993
|
-
/* @__PURE__ */ r(
|
|
1994
|
-
/* @__PURE__ */ r(
|
|
1995
|
-
|
|
1992
|
+
/* @__PURE__ */ r(Mo, { className: "h-8" }),
|
|
1993
|
+
/* @__PURE__ */ r(Ro, {}),
|
|
1994
|
+
Ht > 0 && /* @__PURE__ */ d(
|
|
1996
1995
|
"button",
|
|
1997
1996
|
{
|
|
1998
1997
|
type: "button",
|
|
1999
|
-
onClick:
|
|
1998
|
+
onClick: Fa,
|
|
2000
1999
|
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",
|
|
2001
2000
|
children: [
|
|
2002
|
-
/* @__PURE__ */ r(
|
|
2003
|
-
|
|
2001
|
+
/* @__PURE__ */ r(Nl, { className: "h-3 w-3" }),
|
|
2002
|
+
Ht,
|
|
2004
2003
|
" update",
|
|
2005
|
-
|
|
2004
|
+
Ht === 1 ? "" : "s",
|
|
2006
2005
|
" · Refresh"
|
|
2007
2006
|
]
|
|
2008
2007
|
}
|
|
@@ -2018,18 +2017,18 @@ function yi({
|
|
|
2018
2017
|
N ? "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"
|
|
2019
2018
|
),
|
|
2020
2019
|
children: [
|
|
2021
|
-
/* @__PURE__ */ r(
|
|
2022
|
-
N ? `Group: ${((
|
|
2020
|
+
/* @__PURE__ */ r(Gr, { className: "h-3.5 w-3.5" }),
|
|
2021
|
+
N ? `Group: ${((Lr = Rr.find((e) => e.value === N)) == null ? void 0 : Lr.label) ?? N}` : "Group"
|
|
2023
2022
|
]
|
|
2024
2023
|
}
|
|
2025
2024
|
) }),
|
|
2026
|
-
/* @__PURE__ */ r(Je, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(
|
|
2027
|
-
/* @__PURE__ */ r(
|
|
2028
|
-
/* @__PURE__ */ d(
|
|
2029
|
-
/* @__PURE__ */ r(
|
|
2030
|
-
/* @__PURE__ */ r(
|
|
2031
|
-
|
|
2032
|
-
|
|
2025
|
+
/* @__PURE__ */ r(Je, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Zr, { children: [
|
|
2026
|
+
/* @__PURE__ */ r(Vo, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
|
|
2027
|
+
/* @__PURE__ */ d(ea, { children: [
|
|
2028
|
+
/* @__PURE__ */ r(Go, { children: "No attribute found." }),
|
|
2029
|
+
/* @__PURE__ */ r(xt, { value: "__none__", onSelect: () => Ye(null), children: "None" }),
|
|
2030
|
+
Rr.map((e) => /* @__PURE__ */ r(
|
|
2031
|
+
xt,
|
|
2033
2032
|
{
|
|
2034
2033
|
value: e.label,
|
|
2035
2034
|
onSelect: () => Ye(e.value),
|
|
@@ -2052,7 +2051,7 @@ function yi({
|
|
|
2052
2051
|
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"
|
|
2053
2052
|
),
|
|
2054
2053
|
children: [
|
|
2055
|
-
/* @__PURE__ */ r(
|
|
2054
|
+
/* @__PURE__ */ r(Sl, { className: "h-3.5 w-3.5" }),
|
|
2056
2055
|
"Priority"
|
|
2057
2056
|
]
|
|
2058
2057
|
}
|
|
@@ -2061,7 +2060,7 @@ function yi({
|
|
|
2061
2060
|
"button",
|
|
2062
2061
|
{
|
|
2063
2062
|
type: "button",
|
|
2064
|
-
onClick: () =>
|
|
2063
|
+
onClick: () => Vt(
|
|
2065
2064
|
be.size > 0 ? /* @__PURE__ */ new Set() : new Set(Z.map((e) => e.key))
|
|
2066
2065
|
),
|
|
2067
2066
|
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",
|
|
@@ -2078,15 +2077,15 @@ function yi({
|
|
|
2078
2077
|
ze ? "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"
|
|
2079
2078
|
),
|
|
2080
2079
|
children: [
|
|
2081
|
-
/* @__PURE__ */ r(
|
|
2080
|
+
/* @__PURE__ */ r(Gr, { className: "h-3.5 w-3.5" }),
|
|
2082
2081
|
ze ? `Lanes: ${ze === "collection" ? "Collection" : "Owner"}` : "Lanes"
|
|
2083
2082
|
]
|
|
2084
2083
|
}
|
|
2085
2084
|
) }),
|
|
2086
|
-
/* @__PURE__ */ r(Je, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(
|
|
2087
|
-
/* @__PURE__ */ r(
|
|
2088
|
-
/* @__PURE__ */ r(
|
|
2089
|
-
/* @__PURE__ */ r(
|
|
2085
|
+
/* @__PURE__ */ r(Je, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(Zr, { children: /* @__PURE__ */ d(ea, { children: [
|
|
2086
|
+
/* @__PURE__ */ r(xt, { value: "none", onSelect: () => Gt(null), children: "None" }),
|
|
2087
|
+
/* @__PURE__ */ r(xt, { value: "collection", onSelect: () => Gt("collection"), children: "Collection" }),
|
|
2088
|
+
/* @__PURE__ */ r(xt, { value: "owner", onSelect: () => Gt("owners"), children: "Owner" })
|
|
2090
2089
|
] }) }) })
|
|
2091
2090
|
] }),
|
|
2092
2091
|
U && s && /* @__PURE__ */ d(
|
|
@@ -2098,7 +2097,7 @@ function yi({
|
|
|
2098
2097
|
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",
|
|
2099
2098
|
"data-queue-ask": !0,
|
|
2100
2099
|
children: [
|
|
2101
|
-
/* @__PURE__ */ r(
|
|
2100
|
+
/* @__PURE__ */ r(Cl, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
|
|
2102
2101
|
"Ask about this queue"
|
|
2103
2102
|
]
|
|
2104
2103
|
}
|
|
@@ -2107,7 +2106,7 @@ function yi({
|
|
|
2107
2106
|
"button",
|
|
2108
2107
|
{
|
|
2109
2108
|
type: "button",
|
|
2110
|
-
onClick: () =>
|
|
2109
|
+
onClick: () => pa((e) => !e),
|
|
2111
2110
|
"aria-expanded": et,
|
|
2112
2111
|
title: "Trends, aging, pace and states",
|
|
2113
2112
|
className: C(
|
|
@@ -2116,7 +2115,7 @@ function yi({
|
|
|
2116
2115
|
),
|
|
2117
2116
|
"data-queue-insights-toggle": !0,
|
|
2118
2117
|
children: [
|
|
2119
|
-
/* @__PURE__ */ r(
|
|
2118
|
+
/* @__PURE__ */ r($l, { className: "h-3.5 w-3.5" }),
|
|
2120
2119
|
"Insights"
|
|
2121
2120
|
]
|
|
2122
2121
|
}
|
|
@@ -2128,31 +2127,31 @@ function yi({
|
|
|
2128
2127
|
type: "button",
|
|
2129
2128
|
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",
|
|
2130
2129
|
children: [
|
|
2131
|
-
/* @__PURE__ */ r(
|
|
2130
|
+
/* @__PURE__ */ r(ql, { className: "h-3.5 w-3.5" }),
|
|
2132
2131
|
"Columns"
|
|
2133
2132
|
]
|
|
2134
2133
|
}
|
|
2135
2134
|
) }),
|
|
2136
2135
|
/* @__PURE__ */ r(Je, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ r(
|
|
2137
|
-
|
|
2136
|
+
pl,
|
|
2138
2137
|
{
|
|
2139
|
-
sensors:
|
|
2140
|
-
collisionDetection:
|
|
2141
|
-
onDragEnd:
|
|
2138
|
+
sensors: nl,
|
|
2139
|
+
collisionDetection: hl,
|
|
2140
|
+
onDragEnd: rl,
|
|
2142
2141
|
children: /* @__PURE__ */ r(
|
|
2143
|
-
|
|
2142
|
+
fl,
|
|
2144
2143
|
{
|
|
2145
2144
|
items: Ie,
|
|
2146
|
-
strategy:
|
|
2145
|
+
strategy: gl,
|
|
2147
2146
|
children: /* @__PURE__ */ r("div", { className: "space-y-1.5", children: Ie.map((e) => {
|
|
2148
|
-
const t =
|
|
2147
|
+
const t = qr.find((n) => n.key === e);
|
|
2149
2148
|
return /* @__PURE__ */ r(
|
|
2150
|
-
|
|
2149
|
+
cs,
|
|
2151
2150
|
{
|
|
2152
2151
|
id: e,
|
|
2153
2152
|
label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
|
|
2154
2153
|
checked: te.has(e),
|
|
2155
|
-
onCheckedChange: () =>
|
|
2154
|
+
onCheckedChange: () => cl(e)
|
|
2156
2155
|
},
|
|
2157
2156
|
e
|
|
2158
2157
|
);
|
|
@@ -2167,42 +2166,42 @@ function yi({
|
|
|
2167
2166
|
{
|
|
2168
2167
|
type: "button",
|
|
2169
2168
|
onClick: () => {
|
|
2170
|
-
const e =
|
|
2171
|
-
|
|
2169
|
+
const e = vt === "compact" ? "comfortable" : "compact";
|
|
2170
|
+
na(e);
|
|
2172
2171
|
try {
|
|
2173
2172
|
localStorage.setItem("nvr_table_density", e);
|
|
2174
2173
|
} catch {
|
|
2175
2174
|
}
|
|
2176
2175
|
},
|
|
2177
2176
|
"aria-label": "Row density",
|
|
2178
|
-
title:
|
|
2177
|
+
title: vt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
|
|
2179
2178
|
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",
|
|
2180
|
-
children:
|
|
2179
|
+
children: vt === "compact" ? /* @__PURE__ */ r(Fl, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(Rl, { className: "h-3.5 w-3.5" })
|
|
2181
2180
|
}
|
|
2182
2181
|
),
|
|
2183
|
-
A === "table" &&
|
|
2182
|
+
A === "table" && sa && ee.length > 0 && /* @__PURE__ */ d(
|
|
2184
2183
|
"button",
|
|
2185
2184
|
{
|
|
2186
2185
|
type: "button",
|
|
2187
|
-
onClick: () =>
|
|
2186
|
+
onClick: () => mr(),
|
|
2188
2187
|
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",
|
|
2189
2188
|
children: [
|
|
2190
|
-
/* @__PURE__ */ r(
|
|
2189
|
+
/* @__PURE__ */ r(Tl, { className: "h-3 w-3 fill-current" }),
|
|
2191
2190
|
"Work Next"
|
|
2192
2191
|
]
|
|
2193
2192
|
}
|
|
2194
2193
|
),
|
|
2195
|
-
!
|
|
2194
|
+
!Zt && z.length === 1 && ($t ? /* @__PURE__ */ d(We, { children: [
|
|
2196
2195
|
/* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2197
2196
|
"button",
|
|
2198
2197
|
{
|
|
2199
2198
|
type: "button",
|
|
2200
2199
|
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",
|
|
2201
2200
|
children: [
|
|
2202
|
-
/* @__PURE__ */ r(
|
|
2201
|
+
/* @__PURE__ */ r(Ut, { className: "h-3.5 w-3.5" }),
|
|
2203
2202
|
"New ",
|
|
2204
|
-
|
|
2205
|
-
/* @__PURE__ */ r(
|
|
2203
|
+
Fn(z[0]),
|
|
2204
|
+
/* @__PURE__ */ r(Wr, { className: "h-3 w-3 opacity-60" })
|
|
2206
2205
|
]
|
|
2207
2206
|
}
|
|
2208
2207
|
) }),
|
|
@@ -2219,12 +2218,12 @@ function yi({
|
|
|
2219
2218
|
}),
|
|
2220
2219
|
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",
|
|
2221
2220
|
children: [
|
|
2222
|
-
((
|
|
2221
|
+
((Dr = $t.active) == null ? void 0 : Dr.create_label) ?? ((Pr = $t.active) == null ? void 0 : Pr.name) ?? "Default layout",
|
|
2223
2222
|
/* @__PURE__ */ r("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
|
|
2224
2223
|
]
|
|
2225
2224
|
}
|
|
2226
2225
|
),
|
|
2227
|
-
|
|
2226
|
+
$t.options.map((e) => /* @__PURE__ */ r(
|
|
2228
2227
|
"button",
|
|
2229
2228
|
{
|
|
2230
2229
|
type: "button",
|
|
@@ -2252,22 +2251,22 @@ function yi({
|
|
|
2252
2251
|
}),
|
|
2253
2252
|
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",
|
|
2254
2253
|
children: [
|
|
2255
|
-
/* @__PURE__ */ r(
|
|
2254
|
+
/* @__PURE__ */ r(Ut, { className: "h-3.5 w-3.5" }),
|
|
2256
2255
|
"New ",
|
|
2257
|
-
|
|
2256
|
+
Fn(z[0])
|
|
2258
2257
|
]
|
|
2259
2258
|
}
|
|
2260
2259
|
)),
|
|
2261
|
-
!
|
|
2260
|
+
!Zt && z.length > 1 && /* @__PURE__ */ d(We, { children: [
|
|
2262
2261
|
/* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2263
2262
|
"button",
|
|
2264
2263
|
{
|
|
2265
2264
|
type: "button",
|
|
2266
2265
|
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",
|
|
2267
2266
|
children: [
|
|
2268
|
-
/* @__PURE__ */ r(
|
|
2267
|
+
/* @__PURE__ */ r(Ut, { className: "h-3.5 w-3.5" }),
|
|
2269
2268
|
"New",
|
|
2270
|
-
/* @__PURE__ */ r(
|
|
2269
|
+
/* @__PURE__ */ r(Wr, { className: "h-3 w-3 opacity-60" })
|
|
2271
2270
|
]
|
|
2272
2271
|
}
|
|
2273
2272
|
) }),
|
|
@@ -2282,15 +2281,15 @@ function yi({
|
|
|
2282
2281
|
}),
|
|
2283
2282
|
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",
|
|
2284
2283
|
children: [
|
|
2285
|
-
/* @__PURE__ */ r(
|
|
2286
|
-
|
|
2284
|
+
/* @__PURE__ */ r(Ut, { className: "h-3 w-3 opacity-60" }),
|
|
2285
|
+
Fn(e)
|
|
2287
2286
|
]
|
|
2288
2287
|
},
|
|
2289
2288
|
e
|
|
2290
2289
|
)) })
|
|
2291
2290
|
] }),
|
|
2292
|
-
!
|
|
2293
|
-
|
|
2291
|
+
!Zt && Le && me && /* @__PURE__ */ r(
|
|
2292
|
+
Oo,
|
|
2294
2293
|
{
|
|
2295
2294
|
collection: Le,
|
|
2296
2295
|
onParsed: (e, t) => me(`/collections/${Le}/new`, {
|
|
@@ -2310,19 +2309,19 @@ function yi({
|
|
|
2310
2309
|
children: [
|
|
2311
2310
|
/* @__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: [
|
|
2312
2311
|
/* @__PURE__ */ r(
|
|
2313
|
-
|
|
2312
|
+
yt,
|
|
2314
2313
|
{
|
|
2315
2314
|
label: "Total",
|
|
2316
2315
|
count: (x == null ? void 0 : x.total) ?? 0,
|
|
2317
2316
|
filteredCount: Y ? Y.total : null,
|
|
2318
|
-
active: Object.values(w).every(
|
|
2317
|
+
active: Object.values(w).every(ma) && g === "all",
|
|
2319
2318
|
isLoading: Ke,
|
|
2320
2319
|
...rt("total"),
|
|
2321
|
-
onClick:
|
|
2320
|
+
onClick: ba
|
|
2322
2321
|
}
|
|
2323
2322
|
),
|
|
2324
2323
|
/* @__PURE__ */ r(
|
|
2325
|
-
|
|
2324
|
+
yt,
|
|
2326
2325
|
{
|
|
2327
2326
|
label: "Warning",
|
|
2328
2327
|
count: (x == null ? void 0 : x.sla_warning) ?? 0,
|
|
@@ -2336,7 +2335,7 @@ function yi({
|
|
|
2336
2335
|
}
|
|
2337
2336
|
),
|
|
2338
2337
|
/* @__PURE__ */ r(
|
|
2339
|
-
|
|
2338
|
+
yt,
|
|
2340
2339
|
{
|
|
2341
2340
|
label: "Breached",
|
|
2342
2341
|
count: (x == null ? void 0 : x.sla_breached) ?? 0,
|
|
@@ -2350,7 +2349,7 @@ function yi({
|
|
|
2350
2349
|
}
|
|
2351
2350
|
),
|
|
2352
2351
|
/* @__PURE__ */ r(
|
|
2353
|
-
|
|
2352
|
+
yt,
|
|
2354
2353
|
{
|
|
2355
2354
|
label: "At Risk",
|
|
2356
2355
|
count: (x == null ? void 0 : x.at_risk) ?? 0,
|
|
@@ -2364,7 +2363,7 @@ function yi({
|
|
|
2364
2363
|
}
|
|
2365
2364
|
),
|
|
2366
2365
|
/* @__PURE__ */ r(
|
|
2367
|
-
|
|
2366
|
+
yt,
|
|
2368
2367
|
{
|
|
2369
2368
|
label: "Unowned",
|
|
2370
2369
|
count: (x == null ? void 0 : x.unowned) ?? 0,
|
|
@@ -2428,17 +2427,17 @@ function yi({
|
|
|
2428
2427
|
] }) : /* @__PURE__ */ r(ke, { children: "→ Holding steady" })
|
|
2429
2428
|
}
|
|
2430
2429
|
),
|
|
2431
|
-
|
|
2430
|
+
dr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: dr.map(([e, t]) => {
|
|
2432
2431
|
var n;
|
|
2433
2432
|
return /* @__PURE__ */ r(
|
|
2434
|
-
|
|
2433
|
+
is,
|
|
2435
2434
|
{
|
|
2436
2435
|
label: Ce(e),
|
|
2437
2436
|
count: t,
|
|
2438
2437
|
filteredCount: Y ? Y.by_state[e] ?? 0 : null,
|
|
2439
2438
|
color: ((n = fe[e]) == null ? void 0 : n.color) ?? null,
|
|
2440
|
-
active:
|
|
2441
|
-
onClick: () =>
|
|
2439
|
+
active: ua.includes(e),
|
|
2440
|
+
onClick: () => da(e)
|
|
2442
2441
|
},
|
|
2443
2442
|
e
|
|
2444
2443
|
);
|
|
@@ -2447,9 +2446,9 @@ function yi({
|
|
|
2447
2446
|
}
|
|
2448
2447
|
),
|
|
2449
2448
|
A !== "workload" && /* @__PURE__ */ r(
|
|
2450
|
-
|
|
2449
|
+
Zo,
|
|
2451
2450
|
{
|
|
2452
|
-
defs:
|
|
2451
|
+
defs: sl,
|
|
2453
2452
|
values: w,
|
|
2454
2453
|
seededKeys: pt,
|
|
2455
2454
|
onApply: (e) => {
|
|
@@ -2458,7 +2457,7 @@ function yi({
|
|
|
2458
2457
|
onClear: () => {
|
|
2459
2458
|
M({ ...pe.current }), L(1);
|
|
2460
2459
|
},
|
|
2461
|
-
right:
|
|
2460
|
+
right: il
|
|
2462
2461
|
}
|
|
2463
2462
|
),
|
|
2464
2463
|
/* @__PURE__ */ d(
|
|
@@ -2506,7 +2505,7 @@ function yi({
|
|
|
2506
2505
|
"button",
|
|
2507
2506
|
{
|
|
2508
2507
|
type: "button",
|
|
2509
|
-
onClick:
|
|
2508
|
+
onClick: Qa,
|
|
2510
2509
|
title: "Revert to the queue default (filters, columns and sort cleared)",
|
|
2511
2510
|
className: C(
|
|
2512
2511
|
"inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
|
|
@@ -2530,13 +2529,13 @@ function yi({
|
|
|
2530
2529
|
{
|
|
2531
2530
|
type: "button",
|
|
2532
2531
|
title: Be === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
|
|
2533
|
-
onClick: () =>
|
|
2532
|
+
onClick: () => Ua.mutate(Be === e.id ? null : e.id),
|
|
2534
2533
|
className: C(
|
|
2535
2534
|
"shrink-0",
|
|
2536
2535
|
Be === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
|
|
2537
2536
|
),
|
|
2538
2537
|
children: /* @__PURE__ */ r(
|
|
2539
|
-
|
|
2538
|
+
Al,
|
|
2540
2539
|
{
|
|
2541
2540
|
className: C("h-3 w-3", Be === e.id && "fill-current"),
|
|
2542
2541
|
"aria-label": Be === e.id ? "Default view" : "Set as default"
|
|
@@ -2544,25 +2543,25 @@ function yi({
|
|
|
2544
2543
|
)
|
|
2545
2544
|
}
|
|
2546
2545
|
),
|
|
2547
|
-
/* @__PURE__ */ d("button", { type: "button", onClick: () =>
|
|
2546
|
+
/* @__PURE__ */ d("button", { type: "button", onClick: () => Dt(e), children: [
|
|
2548
2547
|
e.name,
|
|
2549
2548
|
e.is_default ? /* @__PURE__ */ r("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ r("span", { className: "ml-1 text-slate-400", children: "· shared" })
|
|
2550
2549
|
] }),
|
|
2551
|
-
|
|
2550
|
+
gr && /* @__PURE__ */ r(
|
|
2552
2551
|
"button",
|
|
2553
2552
|
{
|
|
2554
2553
|
type: "button",
|
|
2555
|
-
onClick: () =>
|
|
2554
|
+
onClick: () => Ba.mutate({ viewId: e.id, on: !e.is_default }),
|
|
2556
2555
|
title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
|
|
2557
2556
|
className: C(
|
|
2558
2557
|
"shrink-0",
|
|
2559
2558
|
e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
2560
2559
|
),
|
|
2561
2560
|
"aria-label": e.is_default ? "Unset queue default" : "Set queue default",
|
|
2562
|
-
children: /* @__PURE__ */ r(
|
|
2561
|
+
children: /* @__PURE__ */ r(Ol, { className: C("h-3 w-3", e.is_default && "fill-current") })
|
|
2563
2562
|
}
|
|
2564
2563
|
),
|
|
2565
|
-
(e.user === v ||
|
|
2564
|
+
(e.user === v || Mt) && it === e.id && /* @__PURE__ */ r(
|
|
2566
2565
|
"button",
|
|
2567
2566
|
{
|
|
2568
2567
|
type: "button",
|
|
@@ -2571,35 +2570,35 @@ function yi({
|
|
|
2571
2570
|
title: "Update this view with the current filters, scope and sort",
|
|
2572
2571
|
className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
|
|
2573
2572
|
"aria-label": `Update view ${e.name}`,
|
|
2574
|
-
"data-view-update-state": qe.isPending ? "saving" :
|
|
2575
|
-
children: qe.isPending && ((t = qe.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(El, { className: "h-3 w-3 animate-spin" }) :
|
|
2576
|
-
|
|
2573
|
+
"data-view-update-state": qe.isPending ? "saving" : yr === e.id ? "saved" : "idle",
|
|
2574
|
+
children: qe.isPending && ((t = qe.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(El, { className: "h-3 w-3 animate-spin" }) : yr === e.id ? /* @__PURE__ */ r(
|
|
2575
|
+
Ll,
|
|
2577
2576
|
{
|
|
2578
2577
|
className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
|
|
2579
2578
|
strokeWidth: 3
|
|
2580
2579
|
}
|
|
2581
|
-
) : /* @__PURE__ */ r(
|
|
2580
|
+
) : /* @__PURE__ */ r(Dl, { className: "h-3 w-3" })
|
|
2582
2581
|
}
|
|
2583
2582
|
),
|
|
2584
2583
|
it === e.id && /* @__PURE__ */ r(
|
|
2585
2584
|
"button",
|
|
2586
2585
|
{
|
|
2587
2586
|
type: "button",
|
|
2588
|
-
onClick: () =>
|
|
2589
|
-
title:
|
|
2587
|
+
onClick: () => fa(e.id),
|
|
2588
|
+
title: qt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
|
|
2590
2589
|
className: C(
|
|
2591
2590
|
"shrink-0",
|
|
2592
|
-
|
|
2591
|
+
qt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
2593
2592
|
),
|
|
2594
2593
|
"aria-label": `Subscribe to view ${e.name}`,
|
|
2595
|
-
children: /* @__PURE__ */ r(
|
|
2594
|
+
children: /* @__PURE__ */ r(Pl, { className: C("h-3 w-3", qt(e.id) && "fill-current") })
|
|
2596
2595
|
}
|
|
2597
2596
|
),
|
|
2598
2597
|
e.user === v && /* @__PURE__ */ r(
|
|
2599
2598
|
"button",
|
|
2600
2599
|
{
|
|
2601
2600
|
type: "button",
|
|
2602
|
-
onClick: () =>
|
|
2601
|
+
onClick: () => ja.mutate(e.id),
|
|
2603
2602
|
className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
|
|
2604
2603
|
"aria-label": `Delete view ${e.name}`,
|
|
2605
2604
|
children: "×"
|
|
@@ -2610,7 +2609,7 @@ function yi({
|
|
|
2610
2609
|
e.id
|
|
2611
2610
|
);
|
|
2612
2611
|
}),
|
|
2613
|
-
/* @__PURE__ */ d(We, { open:
|
|
2612
|
+
/* @__PURE__ */ d(We, { open: Ma, onOpenChange: vn, children: [
|
|
2614
2613
|
/* @__PURE__ */ r(He, { asChild: !0, children: /* @__PURE__ */ r(
|
|
2615
2614
|
"button",
|
|
2616
2615
|
{
|
|
@@ -2623,13 +2622,13 @@ function yi({
|
|
|
2623
2622
|
/* @__PURE__ */ d(Je, { className: "w-[240px] p-3", align: "end", children: [
|
|
2624
2623
|
(() => {
|
|
2625
2624
|
const e = V == null ? void 0 : V.data.find((t) => t.id === it);
|
|
2626
|
-
return !e || e.user !== v && !
|
|
2625
|
+
return !e || e.user !== v && !Mt ? null : /* @__PURE__ */ d(
|
|
2627
2626
|
"button",
|
|
2628
2627
|
{
|
|
2629
2628
|
type: "button",
|
|
2630
2629
|
disabled: qe.isPending,
|
|
2631
2630
|
onClick: () => {
|
|
2632
|
-
qe.mutate(e),
|
|
2631
|
+
qe.mutate(e), vn(!1);
|
|
2633
2632
|
},
|
|
2634
2633
|
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",
|
|
2635
2634
|
children: [
|
|
@@ -2643,29 +2642,29 @@ function yi({
|
|
|
2643
2642
|
/* @__PURE__ */ r(
|
|
2644
2643
|
"input",
|
|
2645
2644
|
{
|
|
2646
|
-
value:
|
|
2647
|
-
onChange: (e) =>
|
|
2645
|
+
value: wn,
|
|
2646
|
+
onChange: (e) => br(e.target.value),
|
|
2648
2647
|
placeholder: "View name",
|
|
2649
2648
|
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"
|
|
2650
2649
|
}
|
|
2651
2650
|
),
|
|
2652
2651
|
/* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
2653
2652
|
/* @__PURE__ */ r(
|
|
2654
|
-
|
|
2653
|
+
Tn,
|
|
2655
2654
|
{
|
|
2656
|
-
checked:
|
|
2655
|
+
checked: pr || dt,
|
|
2657
2656
|
disabled: dt,
|
|
2658
|
-
onCheckedChange: (e) =>
|
|
2657
|
+
onCheckedChange: (e) => hr(e === !0)
|
|
2659
2658
|
}
|
|
2660
2659
|
),
|
|
2661
2660
|
"Share with everyone"
|
|
2662
2661
|
] }),
|
|
2663
|
-
|
|
2662
|
+
gr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
2664
2663
|
/* @__PURE__ */ r(
|
|
2665
|
-
|
|
2664
|
+
Tn,
|
|
2666
2665
|
{
|
|
2667
2666
|
checked: dt,
|
|
2668
|
-
onCheckedChange: (e) =>
|
|
2667
|
+
onCheckedChange: (e) => fr(e === !0)
|
|
2669
2668
|
}
|
|
2670
2669
|
),
|
|
2671
2670
|
"Set as queue default (everyone starts here)"
|
|
@@ -2674,8 +2673,8 @@ function yi({
|
|
|
2674
2673
|
"button",
|
|
2675
2674
|
{
|
|
2676
2675
|
type: "button",
|
|
2677
|
-
disabled: !
|
|
2678
|
-
onClick: () =>
|
|
2676
|
+
disabled: !wn.trim() || xr.isPending,
|
|
2677
|
+
onClick: () => xr.mutate(),
|
|
2679
2678
|
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",
|
|
2680
2679
|
children: "Save current view"
|
|
2681
2680
|
}
|
|
@@ -2686,59 +2685,59 @@ function yi({
|
|
|
2686
2685
|
}
|
|
2687
2686
|
)
|
|
2688
2687
|
] }),
|
|
2689
|
-
/* @__PURE__ */ r("div", { ref:
|
|
2688
|
+
/* @__PURE__ */ r("div", { ref: Pt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: A === "table" ? /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
|
|
2690
2689
|
"div",
|
|
2691
2690
|
{
|
|
2692
2691
|
ref: we.rootRef,
|
|
2693
2692
|
className: C(
|
|
2694
2693
|
"relative min-w-0 flex-1 transition-opacity duration-200",
|
|
2695
|
-
|
|
2694
|
+
Jn && "pointer-events-none opacity-60"
|
|
2696
2695
|
),
|
|
2697
|
-
"aria-busy":
|
|
2696
|
+
"aria-busy": Jn || void 0,
|
|
2698
2697
|
children: [
|
|
2699
|
-
|
|
2698
|
+
Yn != 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: [
|
|
2700
2699
|
"Still working — ",
|
|
2701
|
-
|
|
2700
|
+
Yn,
|
|
2702
2701
|
"s"
|
|
2703
2702
|
] }),
|
|
2704
2703
|
/* @__PURE__ */ r(
|
|
2705
|
-
|
|
2704
|
+
qo,
|
|
2706
2705
|
{
|
|
2707
2706
|
fillHeight: !0,
|
|
2708
|
-
enterKey:
|
|
2709
|
-
density:
|
|
2707
|
+
enterKey: er.current,
|
|
2708
|
+
density: vt,
|
|
2710
2709
|
minBodyHeight: 360,
|
|
2711
|
-
columns:
|
|
2710
|
+
columns: Bt,
|
|
2712
2711
|
rows: S,
|
|
2713
2712
|
rowKey: (e) => `${e.collection}:${e.item_id}`,
|
|
2714
2713
|
total: (c == null ? void 0 : c.total) ?? 0,
|
|
2715
2714
|
page: ve,
|
|
2716
|
-
limit:
|
|
2715
|
+
limit: Xt,
|
|
2717
2716
|
isLoading: Ke,
|
|
2718
2717
|
onPageChange: L,
|
|
2719
|
-
onRowClick: (e) =>
|
|
2720
|
-
rowDragProps: (e) =>
|
|
2718
|
+
onRowClick: (e) => Lt(e),
|
|
2719
|
+
rowDragProps: (e) => $a({ collection: e.collection, id: e.item_id }),
|
|
2721
2720
|
onRowContextMenu: (e, t) => {
|
|
2722
2721
|
t.preventDefault(), st({ x: t.clientX, y: t.clientY, row: e });
|
|
2723
2722
|
},
|
|
2724
2723
|
rowTitle: (e) => {
|
|
2725
|
-
const t =
|
|
2726
|
-
return we.titleFor(D(e)) ?? (t && !t.is_mine ?
|
|
2724
|
+
const t = At.get(D(e));
|
|
2725
|
+
return we.titleFor(D(e)) ?? (t && !t.is_mine ? ro(t) : void 0);
|
|
2727
2726
|
},
|
|
2728
|
-
rowClassName: (e) =>
|
|
2727
|
+
rowClassName: (e) => Ot === D(e) ? (
|
|
2729
2728
|
// Pinned sticky cells use bg-inherit — the highlight must be
|
|
2730
2729
|
// OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
|
|
2731
2730
|
// scrolled content bleeds through the pinned columns. Same
|
|
2732
2731
|
// pair DataTable uses for selected rows when pins are active.
|
|
2733
2732
|
"bg-[#f2fdff] dark:bg-[#20303a]"
|
|
2734
|
-
) : e.at_risk ?
|
|
2733
|
+
) : e.at_risk ? bo(e.at_risk_color ?? "red") : void 0,
|
|
2735
2734
|
emptyMessage: /* @__PURE__ */ r(
|
|
2736
|
-
|
|
2735
|
+
Fo,
|
|
2737
2736
|
{
|
|
2738
|
-
icon:
|
|
2739
|
-
title: ((
|
|
2740
|
-
detail: ((
|
|
2741
|
-
action: ((
|
|
2737
|
+
icon: Kl,
|
|
2738
|
+
title: ((Kr = c == null ? void 0 : c.empty) == null ? void 0 : Kr.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Mr = c == null ? void 0 : c.empty) == null ? void 0 : Mr.reason) === "scope_mine" ? "Nothing waiting on you" : ((Qr = c == null ? void 0 : c.empty) == null ? void 0 : Qr.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
|
|
2739
|
+
detail: ((Br = c == null ? void 0 : c.empty) == null ? void 0 : Br.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." : ((jr = c == null ? void 0 : c.empty) == null ? void 0 : jr.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
|
|
2740
|
+
action: ((Ur = c == null ? void 0 : c.empty) == null ? void 0 : Ur.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
|
|
2742
2741
|
/* @__PURE__ */ r(
|
|
2743
2742
|
"button",
|
|
2744
2743
|
{
|
|
@@ -2747,7 +2746,7 @@ function yi({
|
|
|
2747
2746
|
var t;
|
|
2748
2747
|
const e = {};
|
|
2749
2748
|
for (const [n, a] of Object.entries(pe.current))
|
|
2750
|
-
(t =
|
|
2749
|
+
(t = Ee[n.slice(6)]) != null && t.length && (e[n] = a);
|
|
2751
2750
|
M(e), L(1);
|
|
2752
2751
|
},
|
|
2753
2752
|
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",
|
|
@@ -2774,29 +2773,29 @@ function yi({
|
|
|
2774
2773
|
onSortChange: (e) => {
|
|
2775
2774
|
Ae(e), L(1);
|
|
2776
2775
|
},
|
|
2777
|
-
filterDefs:
|
|
2776
|
+
filterDefs: $n,
|
|
2778
2777
|
filterValues: w,
|
|
2779
2778
|
onFilterChange: (e, t) => {
|
|
2780
2779
|
M((n) => ({ ...n, [e]: t })), L(1);
|
|
2781
2780
|
},
|
|
2782
|
-
rowGroups:
|
|
2781
|
+
rowGroups: Va ?? void 0,
|
|
2783
2782
|
collapsedGroups: be,
|
|
2784
|
-
onToggleGroup:
|
|
2785
|
-
selectedIds:
|
|
2786
|
-
onSelectionChange:
|
|
2783
|
+
onToggleGroup: Da,
|
|
2784
|
+
selectedIds: en ? Fe : void 0,
|
|
2785
|
+
onSelectionChange: en ? Qt : void 0,
|
|
2787
2786
|
hideFilterRow: !0,
|
|
2788
2787
|
nowrapCells: !0,
|
|
2789
|
-
columnPins:
|
|
2788
|
+
columnPins: Fr,
|
|
2790
2789
|
onColumnPinChange: (e, t) => {
|
|
2791
|
-
|
|
2792
|
-
const a = { ...n ??
|
|
2790
|
+
Wt((n) => {
|
|
2791
|
+
const a = { ...n ?? Fr };
|
|
2793
2792
|
return t ? a[e] = t : delete a[e], a;
|
|
2794
2793
|
});
|
|
2795
2794
|
},
|
|
2796
2795
|
columnFilterRow: !0,
|
|
2797
2796
|
hScrollProxy: !0,
|
|
2798
2797
|
footer: /* @__PURE__ */ r(
|
|
2799
|
-
|
|
2798
|
+
Bo,
|
|
2800
2799
|
{
|
|
2801
2800
|
collections: at,
|
|
2802
2801
|
selectedIds: String(w.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
|
|
@@ -2815,36 +2814,36 @@ function yi({
|
|
|
2815
2814
|
]
|
|
2816
2815
|
}
|
|
2817
2816
|
) }) }) : A === "kanban" ? /* @__PURE__ */ r(
|
|
2818
|
-
|
|
2817
|
+
Xo,
|
|
2819
2818
|
{
|
|
2820
2819
|
items: S,
|
|
2821
|
-
onCardClick: (e) =>
|
|
2822
|
-
onDrop: (e, t) =>
|
|
2820
|
+
onCardClick: (e) => Lt(e),
|
|
2821
|
+
onDrop: (e, t) => _a.mutate({ item: e, targetState: t }),
|
|
2823
2822
|
onClaim: (e) => Se.mutate(e),
|
|
2824
2823
|
onRelease: (e) => Me.mutate(e),
|
|
2825
2824
|
swimlaneBy: ze,
|
|
2826
|
-
stateLabels:
|
|
2825
|
+
stateLabels: gn,
|
|
2827
2826
|
laneLabel: ze === "collection" ? lt : void 0,
|
|
2828
2827
|
claimsEnabled: oe,
|
|
2829
2828
|
onDraggingChange: (e) => {
|
|
2830
|
-
|
|
2829
|
+
Pn.current = e;
|
|
2831
2830
|
}
|
|
2832
2831
|
}
|
|
2833
|
-
) : /* @__PURE__ */ r(
|
|
2834
|
-
|
|
2835
|
-
|
|
2832
|
+
) : /* @__PURE__ */ r(es, { queueId: l }) }),
|
|
2833
|
+
en && /* @__PURE__ */ d(
|
|
2834
|
+
Yo,
|
|
2836
2835
|
{
|
|
2837
2836
|
count: Fe.length,
|
|
2838
2837
|
claimsEnabled: oe,
|
|
2839
|
-
showClaim:
|
|
2840
|
-
showRelease:
|
|
2841
|
-
showTransition:
|
|
2842
|
-
states:
|
|
2838
|
+
showClaim: tn("claim"),
|
|
2839
|
+
showRelease: tn("release"),
|
|
2840
|
+
showTransition: tn("transition"),
|
|
2841
|
+
states: ur((c == null ? void 0 : c.available_values.state) ?? []).map((e) => ({
|
|
2843
2842
|
value: e,
|
|
2844
2843
|
label: Ce(e)
|
|
2845
2844
|
})),
|
|
2846
|
-
busy:
|
|
2847
|
-
onClaim: () =>
|
|
2845
|
+
busy: vr,
|
|
2846
|
+
onClaim: () => _n(
|
|
2848
2847
|
"Claim",
|
|
2849
2848
|
(e) => p.request(
|
|
2850
2849
|
ne(`/queues/${l}/claim`, {
|
|
@@ -2853,7 +2852,7 @@ function yi({
|
|
|
2853
2852
|
})
|
|
2854
2853
|
)
|
|
2855
2854
|
),
|
|
2856
|
-
onRelease: () =>
|
|
2855
|
+
onRelease: () => _n(
|
|
2857
2856
|
"Release",
|
|
2858
2857
|
(e) => p.request(
|
|
2859
2858
|
ne(`/queues/${l}/release`, {
|
|
@@ -2862,34 +2861,34 @@ function yi({
|
|
|
2862
2861
|
})
|
|
2863
2862
|
)
|
|
2864
2863
|
),
|
|
2865
|
-
onTransition: (e) =>
|
|
2866
|
-
onClear: () =>
|
|
2864
|
+
onTransition: (e) => _n("Transition", (t) => zn(t, e)),
|
|
2865
|
+
onClear: () => Qt([]),
|
|
2867
2866
|
children: [
|
|
2868
2867
|
Fe.length >= 2 && /* @__PURE__ */ r(
|
|
2869
2868
|
"button",
|
|
2870
2869
|
{
|
|
2871
2870
|
type: "button",
|
|
2872
2871
|
onClick: () => {
|
|
2873
|
-
const e =
|
|
2874
|
-
S.filter((t) => Fe.includes(D(t)) && t.collection !== "tasks").map((t) => W.urlFor(
|
|
2872
|
+
const e = lo(
|
|
2873
|
+
S.filter((t) => Fe.includes(D(t)) && t.collection !== "tasks").map((t) => W.urlFor(kn(t)))
|
|
2875
2874
|
);
|
|
2876
|
-
e.blocked > 0 || e.capped > 0 ? T.warning(
|
|
2875
|
+
e.blocked > 0 || e.capped > 0 ? T.warning(zr(e)) : T.success(zr(e));
|
|
2877
2876
|
},
|
|
2878
2877
|
"data-bulk-open-tabs": !0,
|
|
2879
|
-
title: `Open the selected records in new tabs (up to ${
|
|
2878
|
+
title: `Open the selected records in new tabs (up to ${ao})`,
|
|
2880
2879
|
className: "h-8 rounded-md border border-white/20 px-3 text-[12.5px] font-medium hover:bg-white/10 dark:border-border dark:hover:bg-muted",
|
|
2881
2880
|
children: "Open in tabs"
|
|
2882
2881
|
}
|
|
2883
2882
|
),
|
|
2884
2883
|
/* @__PURE__ */ r(
|
|
2885
|
-
|
|
2884
|
+
So,
|
|
2886
2885
|
{
|
|
2887
2886
|
targets: S.filter((e) => Fe.includes(D(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
|
|
2888
2887
|
enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
|
|
2889
2888
|
tone: "light",
|
|
2890
|
-
disabled:
|
|
2889
|
+
disabled: vr,
|
|
2891
2890
|
onDone: (e) => {
|
|
2892
|
-
e.failed === 0 &&
|
|
2891
|
+
e.failed === 0 && Qt([]), h.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
2893
2892
|
}
|
|
2894
2893
|
}
|
|
2895
2894
|
)
|
|
@@ -2897,7 +2896,7 @@ function yi({
|
|
|
2897
2896
|
}
|
|
2898
2897
|
),
|
|
2899
2898
|
X != null && X.length ? /* @__PURE__ */ r(
|
|
2900
|
-
|
|
2899
|
+
Qo,
|
|
2901
2900
|
{
|
|
2902
2901
|
collection: X[0].collection,
|
|
2903
2902
|
itemId: X[0].itemId,
|
|
@@ -2911,7 +2910,7 @@ function yi({
|
|
|
2911
2910
|
onClose: () => mt.back(X.length)
|
|
2912
2911
|
}
|
|
2913
2912
|
) : null,
|
|
2914
|
-
P &&
|
|
2913
|
+
P && Hr(
|
|
2915
2914
|
/* @__PURE__ */ d(
|
|
2916
2915
|
"div",
|
|
2917
2916
|
{
|
|
@@ -2926,14 +2925,14 @@ function yi({
|
|
|
2926
2925
|
"data-queue-row-menu": !0,
|
|
2927
2926
|
children: [
|
|
2928
2927
|
[
|
|
2929
|
-
{ label: "Open", run: () =>
|
|
2928
|
+
{ label: "Open", run: () => Lt(P.row) },
|
|
2930
2929
|
{
|
|
2931
2930
|
label: "Open full record",
|
|
2932
2931
|
run: () => ot(P.row)
|
|
2933
2932
|
},
|
|
2934
2933
|
{ label: "Peek", run: () => $e(P.row) },
|
|
2935
2934
|
...oe ? [
|
|
2936
|
-
((
|
|
2935
|
+
((Ir = P.row.claimed_by) == null ? void 0 : Ir.id) === v ? { label: "Release claim", run: () => Me.mutate(P.row) } : { label: "Claim", run: () => Se.mutate(P.row) }
|
|
2937
2936
|
] : [],
|
|
2938
2937
|
{
|
|
2939
2938
|
label: "Copy ID",
|
|
@@ -2947,14 +2946,14 @@ function yi({
|
|
|
2947
2946
|
run: () => {
|
|
2948
2947
|
var e;
|
|
2949
2948
|
return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
|
|
2950
|
-
`${window.location.origin}${W.urlFor(
|
|
2949
|
+
`${window.location.origin}${W.urlFor(kn(P.row))}`
|
|
2951
2950
|
));
|
|
2952
2951
|
}
|
|
2953
2952
|
},
|
|
2954
2953
|
// Custom actions (#125): the record's registered actions, right here.
|
|
2955
|
-
...
|
|
2954
|
+
...xa(P.row.collection).map((e) => ({
|
|
2956
2955
|
label: e.label,
|
|
2957
|
-
run: () =>
|
|
2956
|
+
run: () => ya(e, P.row)
|
|
2958
2957
|
}))
|
|
2959
2958
|
].map((e) => /* @__PURE__ */ r(
|
|
2960
2959
|
"button",
|
|
@@ -2970,14 +2969,14 @@ function yi({
|
|
|
2970
2969
|
)),
|
|
2971
2970
|
P.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
|
|
2972
2971
|
/* @__PURE__ */ r("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
|
|
2973
|
-
|
|
2972
|
+
ln.slice(0, 8).map((e) => {
|
|
2974
2973
|
const t = (P.row.labels ?? []).includes(e);
|
|
2975
2974
|
return /* @__PURE__ */ d(
|
|
2976
2975
|
"button",
|
|
2977
2976
|
{
|
|
2978
2977
|
type: "button",
|
|
2979
2978
|
onClick: () => {
|
|
2980
|
-
|
|
2979
|
+
Wn(P.row, e), st(null);
|
|
2981
2980
|
},
|
|
2982
2981
|
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",
|
|
2983
2982
|
children: [
|
|
@@ -3001,7 +3000,7 @@ function yi({
|
|
|
3001
3000
|
const n = e.target.elements.namedItem(
|
|
3002
3001
|
"newlabel"
|
|
3003
3002
|
).value.trim();
|
|
3004
|
-
n && (
|
|
3003
|
+
n && (Wn(P.row, n), st(null));
|
|
3005
3004
|
},
|
|
3006
3005
|
className: "px-3 py-1",
|
|
3007
3006
|
children: /* @__PURE__ */ r(
|
|
@@ -3022,52 +3021,52 @@ function yi({
|
|
|
3022
3021
|
),
|
|
3023
3022
|
document.body
|
|
3024
3023
|
),
|
|
3025
|
-
|
|
3024
|
+
Gn && Hr(
|
|
3026
3025
|
/* @__PURE__ */ r(
|
|
3027
|
-
|
|
3026
|
+
ds,
|
|
3028
3027
|
{
|
|
3029
3028
|
queueId: l,
|
|
3030
|
-
drill:
|
|
3031
|
-
onClose: () =>
|
|
3029
|
+
drill: Gn,
|
|
3030
|
+
onClose: () => rn(null),
|
|
3032
3031
|
onOpenRecord: (e, t) => {
|
|
3033
|
-
|
|
3032
|
+
rn(null), W.open({ collection: e, itemId: t, layoutSlug: null });
|
|
3034
3033
|
}
|
|
3035
3034
|
}
|
|
3036
3035
|
),
|
|
3037
3036
|
document.body
|
|
3038
3037
|
),
|
|
3039
3038
|
/* @__PURE__ */ r(
|
|
3040
|
-
|
|
3039
|
+
zo,
|
|
3041
3040
|
{
|
|
3042
3041
|
item: ge,
|
|
3043
|
-
stateLabels:
|
|
3042
|
+
stateLabels: gn,
|
|
3044
3043
|
collectionLabel: lt,
|
|
3045
3044
|
claimsEnabled: oe,
|
|
3046
|
-
columnFormats:
|
|
3045
|
+
columnFormats: Ha,
|
|
3047
3046
|
width: u == null ? void 0 : u.sheet_width,
|
|
3048
3047
|
itemLayout: u == null ? void 0 : u.item_layout,
|
|
3049
3048
|
onOpenChange: (e) => {
|
|
3050
|
-
e || ($e(null),
|
|
3049
|
+
e || ($e(null), yn(!1));
|
|
3051
3050
|
},
|
|
3052
3051
|
onClaim: (e) => Se.mutate(e),
|
|
3053
3052
|
onRelease: (e) => Me.mutate(e),
|
|
3054
|
-
workNextActive:
|
|
3055
|
-
onNext: () => ge &&
|
|
3053
|
+
workNextActive: Pa,
|
|
3054
|
+
onNext: () => ge && mr(ge),
|
|
3056
3055
|
refetchItems: () => h.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
3057
3056
|
}
|
|
3058
3057
|
)
|
|
3059
3058
|
] });
|
|
3060
3059
|
}
|
|
3061
|
-
function
|
|
3060
|
+
function ds({
|
|
3062
3061
|
queueId: l,
|
|
3063
3062
|
drill: f,
|
|
3064
3063
|
onClose: $,
|
|
3065
|
-
onOpenRecord:
|
|
3064
|
+
onOpenRecord: E
|
|
3066
3065
|
}) {
|
|
3067
|
-
const U =
|
|
3066
|
+
const U = ta(), { data: h, isLoading: p } = H({
|
|
3068
3067
|
queryKey: ["queue-agg-rows", l, f.row.collection, f.row.item_id, f.path],
|
|
3069
3068
|
queryFn: () => U.request(
|
|
3070
|
-
|
|
3069
|
+
O(`/queues/${l}/aggregate-rows`, {
|
|
3071
3070
|
collection: f.row.collection,
|
|
3072
3071
|
item_id: f.row.item_id,
|
|
3073
3072
|
path: f.path
|
|
@@ -3089,7 +3088,7 @@ function cs({
|
|
|
3089
3088
|
/* @__PURE__ */ d("div", { children: [
|
|
3090
3089
|
/* @__PURE__ */ r("p", { className: "text-[13px] font-semibold", children: f.row.label }),
|
|
3091
3090
|
/* @__PURE__ */ d("p", { className: "text-[11.5px] text-muted-foreground", children: [
|
|
3092
|
-
|
|
3091
|
+
kt(f.path),
|
|
3093
3092
|
" = ",
|
|
3094
3093
|
/* @__PURE__ */ r("span", { className: "tabular-nums", children: f.value }),
|
|
3095
3094
|
" ",
|
|
@@ -3111,7 +3110,7 @@ function cs({
|
|
|
3111
3110
|
"button",
|
|
3112
3111
|
{
|
|
3113
3112
|
type: "button",
|
|
3114
|
-
onClick: () => h.target &&
|
|
3113
|
+
onClick: () => h.target && E(h.target, String(v.id)),
|
|
3115
3114
|
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",
|
|
3116
3115
|
children: v.label
|
|
3117
3116
|
}
|
|
@@ -3125,5 +3124,5 @@ function cs({
|
|
|
3125
3124
|
);
|
|
3126
3125
|
}
|
|
3127
3126
|
export {
|
|
3128
|
-
|
|
3127
|
+
vi as QueueWorklist
|
|
3129
3128
|
};
|