@nivaro/react 0.3.65 → 0.3.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +13 -4
- package/dist/shared/components/CollectionBrowserView.js +2509 -2668
- package/dist/shared/components/ItemEditForm.js +3910 -3771
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +240 -238
- package/dist/shared/components/item-edit/GroupSection.js +555 -538
- package/dist/shared/components/item-edit/M2MCombobox.js +414 -349
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +211 -187
- package/dist/shared/components/item-edit/RelationCombobox.js +327 -311
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +23 -19
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +73 -47
- package/dist/shared/components/item-edit/picker-search.js +25 -21
- package/dist/shared/components/queue/QueueWorklist.js +799 -772
- package/dist/shared/lib/obligation-reason-text.js +1 -1
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsxs as d, Fragment as
|
|
1
|
+
import { jsxs as d, Fragment as Se, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useSensors as po, useSensor as bo, PointerSensor as ho, DndContext as fo, closestCenter as go } from "@dnd-kit/core";
|
|
3
3
|
import { SortableContext as xo, verticalListSortingStrategy as yo, arrayMove as ko, useSortable as vo } from "@dnd-kit/sortable";
|
|
4
4
|
import { CSS as wo } from "@dnd-kit/utilities";
|
|
5
5
|
import { useQueryClient as _o, useQuery as X, useMutation as Te, useQueries as je } from "@tanstack/react-query";
|
|
6
|
-
import { AlertTriangle as No, FileDiff as So, RefreshCw as Co, Rows3 as Fa, Flame as $o, Sparkles as qo, Download as Ro, BarChart3 as Fo, SlidersHorizontal as Lo, ListChecks as To, Rows4 as Ao, Rows2 as Eo, Play as Oo, Plus as
|
|
6
|
+
import { AlertTriangle as No, FileDiff as So, RefreshCw as Co, Rows3 as Fa, Flame as $o, Sparkles as qo, Download as Ro, BarChart3 as Fo, SlidersHorizontal as Lo, ListChecks as To, Rows4 as Ao, Rows2 as Eo, Play as Oo, Plus as on, ChevronDown as La, Star as Do, Pin as Ko, Loader2 as Po, Check as Mo, Save as Bo, Bell as Qo, Inbox as jo, GripVertical as Uo } from "lucide-react";
|
|
7
7
|
import { useState as w, useRef as Q, useEffect as P, useMemo as J } from "react";
|
|
8
8
|
import { createPortal as Ta } from "react-dom";
|
|
9
|
-
import { toast as
|
|
9
|
+
import { toast as E } from "sonner";
|
|
10
10
|
import { useNivaroClient as Qa, useItemEditAuth as Aa, useItemNavigation as Vo, useNavigation as Io, useOverlayState as Go } from "../../context.js";
|
|
11
11
|
import { useDebounced as Wo } from "../../hooks/useDebounced.js";
|
|
12
12
|
import { useElapsedLoading as Ho } from "../../hooks/useElapsedLoading.js";
|
|
13
13
|
import { useSlowReason as Jo } from "../../hooks/useSlowReason.js";
|
|
14
14
|
import { useBulkProgressFeed as Yo } from "../../lib/bulk-progress.js";
|
|
15
|
-
import { get as
|
|
15
|
+
import { get as O, post as ce, patch as Ea, del as zn, put as zo } from "../../lib/commands.js";
|
|
16
16
|
import { deepenForLightSurface as Xo } from "../../lib/display-prefs.js";
|
|
17
17
|
import { evaluateExpression as Zo } from "../../lib/expression.js";
|
|
18
18
|
import { clauseFromControlValue as es, filterSentence as ts } from "../../lib/filter-sentence.js";
|
|
@@ -22,7 +22,7 @@ import { createCursorBook as ls, pageRequest as os, noteNextCursor as ss } from
|
|
|
22
22
|
import { normalizeInlineEdit as is, inlineM2oTarget as cs, inlineChoices as ds, inlineEditFor as us, nextInlineKey as ms } from "../../lib/list-inline-edit.js";
|
|
23
23
|
import { sanitizeQueueLinkState as ps, readListLinkFromLocation as bs, dropListLinkParam as hs, encodeListLink as fs, replaceListLinkParam as gs } from "../../lib/list-link.js";
|
|
24
24
|
import { arrivedByListReturn as xs, historyKey as ys, ensureHistoryKey as ks } from "../../lib/list-page-memory.js";
|
|
25
|
-
import { expandCoalesced as vs, LIVE_ASPECTS as
|
|
25
|
+
import { expandCoalesced as vs, LIVE_ASPECTS as Et } from "../../lib/live.js";
|
|
26
26
|
import { useRowChanges as ws, useRowLocksByCollection as _s, lockLabel as Ns } from "../../lib/live-list.js";
|
|
27
27
|
import { OPEN_IN_TABS_CAP as Ss, openInTabs as Cs, openInTabsMessage as Oa } from "../../lib/open-in-tabs.js";
|
|
28
28
|
import { isOwnWrite as $s } from "../../lib/own-writes.js";
|
|
@@ -33,54 +33,56 @@ import { cascadeFilter as Ts, fetchCascadeRelations as As } from "../../lib/quic
|
|
|
33
33
|
import { useOptionalRealtime as Es } from "../../lib/realtime.js";
|
|
34
34
|
import { copyIdText as Da } from "../../lib/record-ref.js";
|
|
35
35
|
import { rowHighlightTextClass as Os, rowHighlightClass as Ds } from "../../lib/row-highlight.js";
|
|
36
|
-
import { userErrorMessage as
|
|
36
|
+
import { userErrorMessage as dt } from "../../lib/safe-error.js";
|
|
37
37
|
import { useMyScopes as Ks, matchScopeDimension as Ps } from "../../lib/use-my-scopes.js";
|
|
38
38
|
import { useNewItemLayouts as Ms } from "../../lib/use-new-item-layouts.js";
|
|
39
|
-
import { formatNumber as ee, cn as
|
|
39
|
+
import { formatNumber as ee, cn as L, titleCase as Xn, humanHours as Bs, formatRelative as Qs, formatDateTime as js, formatDate as Us } from "../../lib/utils.js";
|
|
40
40
|
import { usePublishAskContext as Vs, useAskRecordDrag as Is } from "../ai/ask-context.js";
|
|
41
41
|
import { useBuiltinGate as Gs, BulkActionButtons as Ws } from "../bulk/BulkActionButtons.js";
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
42
|
+
import { BulkCompareButton as Hs } from "../bulk/BulkCompareButton.js";
|
|
43
|
+
import { BulkFieldUpdateButton as Js } from "../bulk/BulkFieldUpdateButton.js";
|
|
44
|
+
import { BulkRowMark as Ys } from "../bulk/BulkRowMark.js";
|
|
45
|
+
import { BulkMessageButton as zs } from "../bulk/MessageStakeholders.js";
|
|
46
|
+
import { compareCell as Xs, RowActionsMenu as Zs, roleMayUpdate as ei } from "../CollectionBrowserView.js";
|
|
47
|
+
import { DataTable as ti } from "../DataTable.js";
|
|
48
|
+
import { EmptyState as ni } from "../EmptyState.js";
|
|
49
|
+
import { FocusModeToggle as ri } from "../FocusModeToggle.js";
|
|
50
|
+
import { FulfilmentPill as ai, FULFILMENT_FILTER_OPTIONS as li } from "../FulfilmentPill.js";
|
|
51
|
+
import { ImportFromFileButton as oi } from "../import/ImportFromFileButton.js";
|
|
52
|
+
import { IntegrationDots as si, INTEGRATIONS_FILTER_OPTIONS as ii } from "../integrations/IntegrationDots.js";
|
|
53
|
+
import { IntegrationsFilterPill as ci } from "../integrations/IntegrationsFilterPill.js";
|
|
54
|
+
import { readQueueReturn as di, queueReturnApplies as ui, writeQueueReturn as Ka } from "../item-edit/QueueReturnChip.js";
|
|
55
|
+
import { ListLoadError as mi } from "../ListLoadError.js";
|
|
56
|
+
import { LiveRowMark as pi } from "../LiveRowMark.js";
|
|
57
|
+
import { CopyListLinkButton as bi } from "../list/CopyListLinkButton.js";
|
|
58
|
+
import { useInlineEdit as hi, InlineEditCell as fi } from "../list/InlineEdit.js";
|
|
59
|
+
import { usePickerExcludedRows as gi, PICKER_EXCLUDED_ROW_CLASS as xi, PICKER_EXCLUDED_TITLE as yi } from "../PickerExcludedRows.js";
|
|
60
|
+
import { RealtimeStaleMark as ki } from "../RealtimeStatusBanner.js";
|
|
61
|
+
import { RecordDrilldownSheet as vi } from "../RecordDrilldownSheet.js";
|
|
62
|
+
import { RowHighlightLegend as wi } from "../RowHighlightLegend.js";
|
|
63
|
+
import { RowPresence as _i } from "../RowPresence.js";
|
|
62
64
|
import { TickerNumber as Zn } from "../TickerNumber.js";
|
|
63
|
-
import { UnseenDot as
|
|
64
|
-
import { Badge as
|
|
65
|
+
import { UnseenDot as Ni } from "../UnseenDot.js";
|
|
66
|
+
import { Badge as Si } from "../ui/badge.js";
|
|
65
67
|
import { Checkbox as er } from "../ui/checkbox.js";
|
|
66
|
-
import { Command as Pa, CommandInput as
|
|
67
|
-
import { Label as
|
|
68
|
-
import { Popover as
|
|
69
|
-
import { Skeleton as
|
|
70
|
-
import { dedupeChooserKeys as
|
|
71
|
-
import { groupSumPathsFor as
|
|
72
|
-
import { offscreenPill as
|
|
73
|
-
import { OwnerAvatars as
|
|
74
|
-
import { pathHeader as
|
|
75
|
-
import { QueueBulkBar as
|
|
76
|
-
import { QueueItemSheet as
|
|
77
|
-
import { QueueKanbanBoard as
|
|
78
|
-
import { QueueQuickFilters as
|
|
79
|
-
import { QueueWorkloadView as
|
|
80
|
-
import { useTransitionNote as
|
|
81
|
-
import { worklistCsv as
|
|
82
|
-
import { extraChoiceText as
|
|
83
|
-
function
|
|
68
|
+
import { Command as Pa, CommandInput as Ci, CommandList as Ma, CommandEmpty as $i, CommandItem as Ot } from "../ui/command.js";
|
|
69
|
+
import { Label as qi } from "../ui/label.js";
|
|
70
|
+
import { Popover as ut, PopoverTrigger as mt, PopoverContent as pt } from "../ui/popover.js";
|
|
71
|
+
import { Skeleton as Ri } from "../ui/skeleton.js";
|
|
72
|
+
import { dedupeChooserKeys as Fi } from "./column-chooser.js";
|
|
73
|
+
import { groupSumPathsFor as Li } from "./group-sums.js";
|
|
74
|
+
import { offscreenPill as Ti, statsOutrunRows as Ai, stateAspectEffect as Ei } from "./live-state-aspect.js";
|
|
75
|
+
import { OwnerAvatars as Oi } from "./OwnerAvatars.js";
|
|
76
|
+
import { pathHeader as Di } from "./path-label.js";
|
|
77
|
+
import { QueueBulkBar as Ki } from "./QueueBulkBar.js";
|
|
78
|
+
import { QueueItemSheet as Pi } from "./QueueItemSheet.js";
|
|
79
|
+
import { QueueKanbanBoard as Mi } from "./QueueKanbanBoard.js";
|
|
80
|
+
import { QueueQuickFilters as Bi } from "./QueueQuickFilters.js";
|
|
81
|
+
import { QueueWorkloadView as Qi } from "./QueueWorkloadView.js";
|
|
82
|
+
import { useTransitionNote as ji, needsTransitionNote as Ui } from "./transition-note.js";
|
|
83
|
+
import { worklistCsv as Vi, worklistCsvName as Ii } from "./worklist-csv.js";
|
|
84
|
+
import { extraChoiceText as Dt, atRiskBreakdown as Ba, worklistKeyTarget as Gi } from "./worklist-helpers.js";
|
|
85
|
+
function Wi({ summary: l }) {
|
|
84
86
|
if (!l || l.count === 0)
|
|
85
87
|
return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
|
|
86
88
|
const k = [l.last_from, l.last_to].filter(Boolean).join(" → "), D = [
|
|
@@ -107,20 +109,20 @@ function Vi({ summary: l }) {
|
|
|
107
109
|
}
|
|
108
110
|
);
|
|
109
111
|
}
|
|
110
|
-
const
|
|
112
|
+
const Hi = 50, sn = "nivaro_addendums", Ji = [
|
|
111
113
|
{ value: "mine", label: "My Items" },
|
|
112
114
|
{ value: "unowned", label: "No Owners" },
|
|
113
115
|
{ value: "claimed", label: "Claimed by me" },
|
|
114
116
|
{ value: "all", label: "All Items" }
|
|
115
117
|
];
|
|
116
|
-
function
|
|
118
|
+
function Yi({ summary: l }) {
|
|
117
119
|
if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
118
120
|
const k = l.active > 0, D = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", M = l.cost_impact, Z = M != null && M !== 0 ? `${M > 0 ? "+" : "−"}$${Math.abs(M).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
|
|
119
121
|
return /* @__PURE__ */ d(
|
|
120
122
|
"span",
|
|
121
123
|
{
|
|
122
124
|
title: l.latest_title ?? void 0,
|
|
123
|
-
className:
|
|
125
|
+
className: L(
|
|
124
126
|
"inline-flex max-w-[220px] items-center gap-1.5 truncate rounded-full border px-2 py-0.5 text-[11px] font-medium",
|
|
125
127
|
k ? "border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-500/50 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300"
|
|
126
128
|
),
|
|
@@ -129,7 +131,7 @@ function Wi({ summary: l }) {
|
|
|
129
131
|
"span",
|
|
130
132
|
{
|
|
131
133
|
"aria-hidden": !0,
|
|
132
|
-
className:
|
|
134
|
+
className: L(
|
|
133
135
|
"h-1.5 w-1.5 shrink-0 rounded-full",
|
|
134
136
|
k ? "bg-amber-500" : "bg-slate-400"
|
|
135
137
|
)
|
|
@@ -144,16 +146,16 @@ function Wi({ summary: l }) {
|
|
|
144
146
|
}
|
|
145
147
|
);
|
|
146
148
|
}
|
|
147
|
-
function
|
|
149
|
+
function zi(l) {
|
|
148
150
|
return Bs(l);
|
|
149
151
|
}
|
|
150
|
-
function
|
|
151
|
-
return l ? /* @__PURE__ */ a("span", { className:
|
|
152
|
+
function Xi({ status: l }) {
|
|
153
|
+
return l ? /* @__PURE__ */ a("span", { className: L("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
152
154
|
}
|
|
153
|
-
function
|
|
155
|
+
function Zi({ points: l, inline: k = !1 }) {
|
|
154
156
|
if (l.length < 2) return null;
|
|
155
157
|
const D = k ? 40 : 64, M = k ? 14 : 18, Z = Math.max(...l), f = Math.min(...l), h = Z - f || 1, S = D / (l.length - 1), Y = l.map(
|
|
156
|
-
(
|
|
158
|
+
(de, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(M - 2 - (de - f) / h * (M - 4)).toFixed(1)}`
|
|
157
159
|
).join(" ");
|
|
158
160
|
return /* @__PURE__ */ a(
|
|
159
161
|
"svg",
|
|
@@ -166,7 +168,7 @@ function Yi({ points: l, inline: k = !1 }) {
|
|
|
166
168
|
}
|
|
167
169
|
);
|
|
168
170
|
}
|
|
169
|
-
function
|
|
171
|
+
function Kt({
|
|
170
172
|
label: l,
|
|
171
173
|
count: k,
|
|
172
174
|
filteredCount: D,
|
|
@@ -176,7 +178,7 @@ function Ot({
|
|
|
176
178
|
trend: h,
|
|
177
179
|
delta: S,
|
|
178
180
|
deltaBadIsUp: Y,
|
|
179
|
-
breakdown:
|
|
181
|
+
breakdown: de,
|
|
180
182
|
onClick: g
|
|
181
183
|
}) {
|
|
182
184
|
return /* @__PURE__ */ a(
|
|
@@ -187,24 +189,24 @@ function Ot({
|
|
|
187
189
|
"aria-pressed": M,
|
|
188
190
|
"aria-label": [
|
|
189
191
|
D != null ? `${ee(D)} of ${ee(k)} ${l}` : `${ee(k)} ${l}`,
|
|
190
|
-
|
|
192
|
+
de || null,
|
|
191
193
|
S != null && S !== 0 ? `${S > 0 ? "up" : "down"} ${ee(Math.abs(S))} since the last daily count` : null
|
|
192
194
|
].filter(Boolean).join(", "),
|
|
193
|
-
className:
|
|
195
|
+
className: L(
|
|
194
196
|
"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",
|
|
195
197
|
// Grows to fill its row when the strip wraps on a narrow screen (army 9 b08 N-R9-7).
|
|
196
198
|
"grow justify-center sm:justify-start",
|
|
197
199
|
M && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10"
|
|
198
200
|
),
|
|
199
|
-
children: Z ? /* @__PURE__ */ a(
|
|
201
|
+
children: Z ? /* @__PURE__ */ a(Ri, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Se, { children: [
|
|
200
202
|
/* @__PURE__ */ a(
|
|
201
203
|
"span",
|
|
202
204
|
{
|
|
203
|
-
className:
|
|
205
|
+
className: L(
|
|
204
206
|
"flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums",
|
|
205
207
|
k === 0 && !M ? "text-slate-500 dark:text-slate-400" : "text-slate-900 dark:text-foreground"
|
|
206
208
|
),
|
|
207
|
-
children: D != null ? /* @__PURE__ */ d(
|
|
209
|
+
children: D != null ? /* @__PURE__ */ d(Se, { children: [
|
|
208
210
|
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Zn, { value: D, format: ee }) }),
|
|
209
211
|
/* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
210
212
|
"/ ",
|
|
@@ -216,25 +218,25 @@ function Ot({
|
|
|
216
218
|
/* @__PURE__ */ a(
|
|
217
219
|
"span",
|
|
218
220
|
{
|
|
219
|
-
className:
|
|
221
|
+
className: L(
|
|
220
222
|
"whitespace-nowrap text-[11px] font-medium leading-none",
|
|
221
223
|
f === "red" ? "text-red-700 dark:text-red-400" : f === "amber" ? "text-amber-800 dark:text-amber-400" : "text-slate-500 dark:text-muted-foreground"
|
|
222
224
|
),
|
|
223
225
|
children: l
|
|
224
226
|
}
|
|
225
227
|
),
|
|
226
|
-
|
|
228
|
+
de && /* @__PURE__ */ a(
|
|
227
229
|
"span",
|
|
228
230
|
{
|
|
229
231
|
"data-stat-breakdown": !0,
|
|
230
232
|
className: "whitespace-nowrap text-[11px] leading-none text-slate-600 dark:text-slate-300",
|
|
231
|
-
children:
|
|
233
|
+
children: de
|
|
232
234
|
}
|
|
233
235
|
),
|
|
234
236
|
S != null && S !== 0 && /* @__PURE__ */ d(
|
|
235
237
|
"span",
|
|
236
238
|
{
|
|
237
|
-
className:
|
|
239
|
+
className: L(
|
|
238
240
|
"text-[10px] font-medium leading-none",
|
|
239
241
|
Y ? S > 0 ? "text-red-700 dark:text-red-400" : "text-emerald-700 dark:text-emerald-400" : "text-slate-500 dark:text-slate-400"
|
|
240
242
|
),
|
|
@@ -244,12 +246,12 @@ function Ot({
|
|
|
244
246
|
]
|
|
245
247
|
}
|
|
246
248
|
),
|
|
247
|
-
h && k > 0 && /* @__PURE__ */ a(
|
|
249
|
+
h && k > 0 && /* @__PURE__ */ a(Zi, { points: h, inline: !0 })
|
|
248
250
|
] })
|
|
249
251
|
}
|
|
250
252
|
);
|
|
251
253
|
}
|
|
252
|
-
function
|
|
254
|
+
function ec({
|
|
253
255
|
label: l,
|
|
254
256
|
count: k,
|
|
255
257
|
filteredCount: D,
|
|
@@ -262,7 +264,7 @@ function zi({
|
|
|
262
264
|
{
|
|
263
265
|
type: "button",
|
|
264
266
|
onClick: f,
|
|
265
|
-
className:
|
|
267
|
+
className: L(
|
|
266
268
|
"flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px] font-medium transition-colors",
|
|
267
269
|
Z ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300"
|
|
268
270
|
),
|
|
@@ -275,7 +277,7 @@ function zi({
|
|
|
275
277
|
}
|
|
276
278
|
),
|
|
277
279
|
l,
|
|
278
|
-
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: D != null ? /* @__PURE__ */ d(
|
|
280
|
+
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: D != null ? /* @__PURE__ */ d(Se, { children: [
|
|
279
281
|
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ee(D) }),
|
|
280
282
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
281
283
|
" / ",
|
|
@@ -286,19 +288,19 @@ function zi({
|
|
|
286
288
|
}
|
|
287
289
|
);
|
|
288
290
|
}
|
|
289
|
-
const Ve =
|
|
290
|
-
function
|
|
291
|
+
const Ve = Di;
|
|
292
|
+
function tc({
|
|
291
293
|
id: l,
|
|
292
294
|
label: k,
|
|
293
295
|
checked: D,
|
|
294
296
|
onCheckedChange: M
|
|
295
297
|
}) {
|
|
296
|
-
const { attributes: Z, listeners: f, setNodeRef: h, transform: S, transition: Y, isDragging:
|
|
298
|
+
const { attributes: Z, listeners: f, setNodeRef: h, transform: S, transition: Y, isDragging: de } = vo({
|
|
297
299
|
id: l
|
|
298
300
|
}), g = {
|
|
299
301
|
transform: wo.Transform.toString(S),
|
|
300
302
|
transition: Y,
|
|
301
|
-
opacity:
|
|
303
|
+
opacity: de ? 0.4 : 1
|
|
302
304
|
}, te = `col-toggle-${l}`;
|
|
303
305
|
return /* @__PURE__ */ d("div", { ref: h, style: g, className: "flex items-center gap-2 text-[12px]", children: [
|
|
304
306
|
/* @__PURE__ */ a(
|
|
@@ -311,10 +313,10 @@ function Xi({
|
|
|
311
313
|
}
|
|
312
314
|
),
|
|
313
315
|
/* @__PURE__ */ a(er, { id: te, checked: D, onCheckedChange: M }),
|
|
314
|
-
/* @__PURE__ */ a(
|
|
316
|
+
/* @__PURE__ */ a(qi, { htmlFor: te, className: "cursor-pointer text-[12px] font-normal", children: k })
|
|
315
317
|
] });
|
|
316
318
|
}
|
|
317
|
-
function
|
|
319
|
+
function Dd({
|
|
318
320
|
queueId: l,
|
|
319
321
|
realtime: k,
|
|
320
322
|
renderError: D,
|
|
@@ -322,33 +324,33 @@ function Ld({
|
|
|
322
324
|
onAsk: Z
|
|
323
325
|
}) {
|
|
324
326
|
var pa, ba, ha, fa, ga, xa, ya, ka, va, wa, _a, Na, Sa, Ca, $a, qa, Ra;
|
|
325
|
-
const f = _o(), h = Qa(), { userId: S } = Aa(), Y = Vo(), { navigate:
|
|
327
|
+
const f = _o(), h = Qa(), { userId: S } = Aa(), Y = Vo(), { navigate: de } = Io(), [g, te] = w("all"), [ue, K] = w(1), tr = Q(ls()), [Pt, ja] = w(() => {
|
|
326
328
|
try {
|
|
327
329
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
328
330
|
} catch {
|
|
329
331
|
return "compact";
|
|
330
332
|
}
|
|
331
|
-
}), [C, Ie] = w("table"), [B, Ge] = w(""), [_, j] = w({}), [
|
|
332
|
-
|
|
333
|
-
const
|
|
333
|
+
}), [C, Ie] = w("table"), [B, Ge] = w(""), [_, j] = w({}), [Mt, nr] = w(() => /* @__PURE__ */ new Set()), [R, bt] = w(null), [Ce, cn] = w(/* @__PURE__ */ new Set()), [ht, dn] = w(null), [We, un] = w(null), [mn, Bt] = w(0), pn = Q(0), Ae = ws(), bn = Es(), hn = Q({}).current, rr = Q(/* @__PURE__ */ new Set()), [Ua, Va] = w(0), [ar, Ia] = w(0), be = Q(!1), Qt = Q([]), lr = Q(null), fn = Q(!1), gn = Q(0), xn = Q("table");
|
|
334
|
+
xn.current = C;
|
|
335
|
+
const yn = 25, { data: c, error: jt } = X({
|
|
334
336
|
queryKey: ["queue-meta", l],
|
|
335
|
-
queryFn: () => h.request(
|
|
337
|
+
queryFn: () => h.request(O(`/queues/${l}`)).then((e) => e.data),
|
|
336
338
|
enabled: !!l
|
|
337
|
-
}), { scopes:
|
|
339
|
+
}), { scopes: Ut, ready: or } = Ks(), sr = Q(!1), [ir, cr] = w(!1), [he, Ga] = w({}), fe = Q({});
|
|
338
340
|
P(() => {
|
|
339
341
|
if (sr.current || !or || !c) return;
|
|
340
342
|
sr.current = !0;
|
|
341
343
|
const e = (c.extra_field_meta ?? []).filter(
|
|
342
344
|
(t) => t.kind === "relation" && t.target_collection && t.display_field
|
|
343
345
|
);
|
|
344
|
-
if (e.length === 0 || !
|
|
346
|
+
if (e.length === 0 || !Ut) {
|
|
345
347
|
cr(!0);
|
|
346
348
|
return;
|
|
347
349
|
}
|
|
348
350
|
(async () => {
|
|
349
351
|
const t = {}, n = {}, r = async (o, s) => {
|
|
350
352
|
const u = await h.request(
|
|
351
|
-
|
|
353
|
+
O(`/items/${o.target_collection}`, {
|
|
352
354
|
filter: JSON.stringify({ id: { _in: s } }),
|
|
353
355
|
fields: `id,${o.display_field}`,
|
|
354
356
|
limit: "200"
|
|
@@ -361,11 +363,11 @@ function Ld({
|
|
|
361
363
|
];
|
|
362
364
|
};
|
|
363
365
|
for (const o of e) {
|
|
364
|
-
const s = Ps(
|
|
366
|
+
const s = Ps(Ut, { collection: o.target_collection });
|
|
365
367
|
if (!s) continue;
|
|
366
368
|
const u = `extra.${o.path}`;
|
|
367
369
|
try {
|
|
368
|
-
const m =
|
|
370
|
+
const m = Ut.restricted[s.name] ?? [];
|
|
369
371
|
if (m.length > 0) {
|
|
370
372
|
const y = await r(o, m);
|
|
371
373
|
y.length > 0 && (n[u.slice(6)] = y);
|
|
@@ -373,12 +375,12 @@ function Ld({
|
|
|
373
375
|
} catch {
|
|
374
376
|
}
|
|
375
377
|
}
|
|
376
|
-
Object.keys(n).length > 0 && Ga(n), Object.keys(t).length > 0 && (
|
|
378
|
+
Object.keys(n).length > 0 && Ga(n), Object.keys(t).length > 0 && (fe.current = t, j((o) => ({ ...o, ...t }))), cr(!0);
|
|
377
379
|
})();
|
|
378
|
-
}, [or,
|
|
380
|
+
}, [or, Ut, c]);
|
|
379
381
|
const He = ((ba = (pa = c == null ? void 0 : c.sources) == null ? void 0 : pa.find((e) => e.type === "collection")) == null ? void 0 : ba.collection) ?? null, { data: dr = [] } = X({
|
|
380
382
|
queryKey: ["queue-browser-quick-filters", He],
|
|
381
|
-
queryFn: () => h.request(
|
|
383
|
+
queryFn: () => h.request(O(`/collections/${He}`)).then((e) => {
|
|
382
384
|
var t, n;
|
|
383
385
|
return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
|
|
384
386
|
}).catch(() => []),
|
|
@@ -389,16 +391,16 @@ function Ld({
|
|
|
389
391
|
for (const n of (c == null ? void 0 : c.sources) ?? [])
|
|
390
392
|
n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
|
|
391
393
|
return t;
|
|
392
|
-
}, [c == null ? void 0 : c.sources]),
|
|
394
|
+
}, [c == null ? void 0 : c.sources]), Vt = Ms(
|
|
393
395
|
le.length === 1 ? le[0] : null
|
|
394
|
-
),
|
|
396
|
+
), kn = M === !0 || Array.isArray(M) && le.length > 0 && le.every((e) => M.includes(e)), ge = (c == null ? void 0 : c.claims_enabled) !== !1, p = c == null ? void 0 : c.display_config, Ee = (p == null ? void 0 : p.views) ?? ["table", "kanban", "workload"], Wa = (p == null ? void 0 : p.work_next) !== !1, It = (p == null ? void 0 : p.bulk_actions) !== !1, Je = Gs(
|
|
395
397
|
[
|
|
396
398
|
...new Set(
|
|
397
399
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
398
400
|
)
|
|
399
401
|
],
|
|
400
402
|
(p == null ? void 0 : p.bulk_action_keys) ?? null
|
|
401
|
-
),
|
|
403
|
+
), T = (e, t) => {
|
|
402
404
|
var n, r;
|
|
403
405
|
return ((r = (n = c == null ? void 0 : c.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
|
|
404
406
|
}, ur = Q(!1);
|
|
@@ -410,7 +412,7 @@ function Ld({
|
|
|
410
412
|
c != null && c.display_config && !Ee.includes(C) && Ie(Ee[0]);
|
|
411
413
|
}, [c, C, Ee]), P(() => {
|
|
412
414
|
if (!(c != null && c.sources)) return;
|
|
413
|
-
const e =
|
|
415
|
+
const e = bn ? (b, A) => bn.subscribeCollections(b, A) : k == null ? void 0 : k.subscribe;
|
|
414
416
|
if (!e) return;
|
|
415
417
|
const t = [
|
|
416
418
|
...new Set(
|
|
@@ -426,23 +428,23 @@ function Ld({
|
|
|
426
428
|
}, 1500));
|
|
427
429
|
}, m = () => {
|
|
428
430
|
o || (o = setTimeout(() => {
|
|
429
|
-
if (o = null,
|
|
430
|
-
|
|
431
|
+
if (o = null, gn.current > 0 || fn.current) {
|
|
432
|
+
Qt.current = [], Bt((b) => b + 1);
|
|
431
433
|
return;
|
|
432
434
|
}
|
|
433
|
-
|
|
435
|
+
be.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
|
|
434
436
|
}, 900));
|
|
435
437
|
}, y = (b) => {
|
|
436
|
-
let
|
|
437
|
-
const
|
|
438
|
-
(
|
|
438
|
+
let A = !1, v = 0, ae = !1;
|
|
439
|
+
const pe = b.flatMap(
|
|
440
|
+
(q) => q ? vs(q) : [q]
|
|
439
441
|
);
|
|
440
|
-
for (const
|
|
441
|
-
const V =
|
|
442
|
-
if (
|
|
443
|
-
if (V.includes(
|
|
444
|
-
const Le =
|
|
445
|
-
ae = !0, Le.refresh && (
|
|
442
|
+
for (const q of pe) {
|
|
443
|
+
const V = q == null ? void 0 : q.changed_fields, H = (q == null ? void 0 : q.collection) != null ? `${q.collection}:${String(q.item)}` : null, ln = H != null && rr.current.has(H);
|
|
444
|
+
if (q && !q.action && (V != null && V.length) && V.every((Le) => Le.startsWith("$"))) {
|
|
445
|
+
if (V.includes(Et.tasks) && n.add("queue-task-counts"), V.includes(Et.integrations) && n.add("queue-integrations-summary"), V.includes(Et.addendums) && n.add("queue-collection-addendums"), V.includes(Et.lock) && Va((Le) => Le + 1), V.includes(Et.state)) {
|
|
446
|
+
const Le = Ei(ln, xn.current === "kanban");
|
|
447
|
+
ae = !0, Le.refresh && (A = !0), v += Le.pill;
|
|
446
448
|
}
|
|
447
449
|
r || (r = setTimeout(() => {
|
|
448
450
|
r = null;
|
|
@@ -452,16 +454,16 @@ function Ld({
|
|
|
452
454
|
continue;
|
|
453
455
|
}
|
|
454
456
|
ae = !0;
|
|
455
|
-
const mo = (
|
|
456
|
-
H && (
|
|
457
|
+
const mo = (q == null ? void 0 : q.collection) != null && $s(q.collection, q.item);
|
|
458
|
+
H && (ln || (q == null ? void 0 : q.action) === "create" || xn.current === "kanban") ? (A = !0, mo || Qt.current.push({ key: H, by: null })) : v += 1;
|
|
457
459
|
}
|
|
458
|
-
v > 0 && (
|
|
459
|
-
}, N = e(t, (b) => ns(
|
|
460
|
+
v > 0 && (pn.current += v), A && m(), ae && u();
|
|
461
|
+
}, N = e(t, (b) => ns(hn, [b ?? {}], y));
|
|
460
462
|
return () => {
|
|
461
|
-
N(), rs(
|
|
463
|
+
N(), rs(hn), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
|
|
462
464
|
};
|
|
463
|
-
}, [
|
|
464
|
-
const Oe = Wo(_, 350), Ja = JSON.stringify(Oe) === JSON.stringify(_),
|
|
465
|
+
}, [bn, k, c == null ? void 0 : c.sources, f, l, S, hn]);
|
|
466
|
+
const Oe = Wo(_, 350), Ja = JSON.stringify(Oe) === JSON.stringify(_), vn = Q(!1), $e = C === "table" && !!R, mr = Li(c), xe = (() => {
|
|
465
467
|
const e = {};
|
|
466
468
|
for (const [t, n] of Object.entries(Oe))
|
|
467
469
|
if (n) {
|
|
@@ -478,7 +480,7 @@ function Ld({
|
|
|
478
480
|
}
|
|
479
481
|
return e;
|
|
480
482
|
})();
|
|
481
|
-
function
|
|
483
|
+
function Ye(e, t) {
|
|
482
484
|
j((n) => ({ ...n, [e]: n[e] === t ? "" : t })), K(1);
|
|
483
485
|
}
|
|
484
486
|
function Ya(e) {
|
|
@@ -489,9 +491,9 @@ function Ld({
|
|
|
489
491
|
}
|
|
490
492
|
const za = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Xa = (e) => !e || Array.isArray(e) && e.length === 0;
|
|
491
493
|
function Za() {
|
|
492
|
-
j({ ...
|
|
494
|
+
j({ ...fe.current }), te("all"), K(1);
|
|
493
495
|
}
|
|
494
|
-
const [
|
|
496
|
+
const [ft, el] = w(() => {
|
|
495
497
|
try {
|
|
496
498
|
return localStorage.getItem("nvr_queue_insights_open") === "1";
|
|
497
499
|
} catch {
|
|
@@ -500,39 +502,39 @@ function Ld({
|
|
|
500
502
|
});
|
|
501
503
|
P(() => {
|
|
502
504
|
try {
|
|
503
|
-
localStorage.setItem("nvr_queue_insights_open",
|
|
505
|
+
localStorage.setItem("nvr_queue_insights_open", ft ? "1" : "0");
|
|
504
506
|
} catch {
|
|
505
507
|
}
|
|
506
|
-
}, [
|
|
508
|
+
}, [ft]);
|
|
507
509
|
const { data: tl = [] } = X({
|
|
508
510
|
queryKey: ["queue-view-subs", l],
|
|
509
|
-
queryFn: () => h.request(
|
|
511
|
+
queryFn: () => h.request(O("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
|
|
510
512
|
staleTime: 3e4
|
|
511
|
-
}),
|
|
512
|
-
const t =
|
|
513
|
+
}), Gt = (e) => tl.find((t) => t.queue_view_id === e), nl = (e) => {
|
|
514
|
+
const t = Gt(e);
|
|
513
515
|
(t ? h.request(zn(`/notification-subscriptions/${t.id}`)) : h.request(
|
|
514
|
-
|
|
516
|
+
ce("/notification-subscriptions", {
|
|
515
517
|
queue_id: l,
|
|
516
518
|
queue_view_id: e,
|
|
517
519
|
digest_frequency: "instant"
|
|
518
520
|
})
|
|
519
521
|
)).then(() => {
|
|
520
|
-
|
|
522
|
+
E.success(
|
|
521
523
|
t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
|
|
522
524
|
), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
|
|
523
|
-
}).catch((r) =>
|
|
524
|
-
}, [pr,
|
|
525
|
+
}).catch((r) => E.error(dt(r, "Failed")));
|
|
526
|
+
}, [pr, wn] = w(null), _n = [
|
|
525
527
|
...new Set(
|
|
526
528
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
527
529
|
)
|
|
528
530
|
], { data: rl = {} } = X({
|
|
529
|
-
queryKey: ["queue-custom-actions", l,
|
|
531
|
+
queryKey: ["queue-custom-actions", l, _n.join(",")],
|
|
530
532
|
queryFn: async () => {
|
|
531
533
|
const e = {};
|
|
532
|
-
for (const t of
|
|
534
|
+
for (const t of _n.slice(0, 6))
|
|
533
535
|
try {
|
|
534
536
|
const n = await h.request(
|
|
535
|
-
|
|
537
|
+
O("/custom-actions", { collection: t })
|
|
536
538
|
);
|
|
537
539
|
e[t] = n.data ?? [];
|
|
538
540
|
} catch {
|
|
@@ -540,33 +542,33 @@ function Ld({
|
|
|
540
542
|
}
|
|
541
543
|
return e;
|
|
542
544
|
},
|
|
543
|
-
enabled:
|
|
545
|
+
enabled: _n.length > 0,
|
|
544
546
|
staleTime: 6e4
|
|
545
547
|
}), al = (e) => rl[e] ?? [], ll = (e, t) => {
|
|
546
|
-
h.request(
|
|
547
|
-
|
|
548
|
+
h.request(ce(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
|
|
549
|
+
E.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
548
550
|
}).catch((n) => {
|
|
549
551
|
const r = n.response;
|
|
550
|
-
|
|
552
|
+
E.error((r == null ? void 0 : r.error) ?? dt(n, `${e.label} failed`));
|
|
551
553
|
});
|
|
552
|
-
}, { data:
|
|
554
|
+
}, { data: Nn = [] } = X({
|
|
553
555
|
queryKey: ["queue-triage-labels", l],
|
|
554
|
-
queryFn: () => h.request(
|
|
556
|
+
queryFn: () => h.request(O(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
|
|
555
557
|
staleTime: 3e4
|
|
556
558
|
}), br = (e, t) => {
|
|
557
559
|
h.request(
|
|
558
|
-
|
|
560
|
+
ce(`/queues/${l}/triage-labels/toggle`, {
|
|
559
561
|
collection: e.collection,
|
|
560
562
|
item_id: e.item_id,
|
|
561
563
|
label: t
|
|
562
564
|
})
|
|
563
565
|
).then(() => {
|
|
564
566
|
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
|
|
565
|
-
}).catch((n) =>
|
|
567
|
+
}).catch((n) => E.error(dt(n, "Label failed")));
|
|
566
568
|
}, {
|
|
567
569
|
data: i,
|
|
568
570
|
isLoading: hr,
|
|
569
|
-
isFetching:
|
|
571
|
+
isFetching: gt,
|
|
570
572
|
isPlaceholderData: ol,
|
|
571
573
|
dataUpdatedAt: oe,
|
|
572
574
|
isError: fr,
|
|
@@ -579,26 +581,26 @@ function Ld({
|
|
|
579
581
|
g,
|
|
580
582
|
B,
|
|
581
583
|
Oe,
|
|
582
|
-
C === "table" && !
|
|
583
|
-
|
|
584
|
+
C === "table" && !R ? ue : "all",
|
|
585
|
+
R
|
|
584
586
|
],
|
|
585
587
|
queryFn: async () => {
|
|
586
|
-
const e =
|
|
587
|
-
|
|
588
|
+
const e = !$e && C === "table", t = JSON.stringify([l, g, B, xe, yn]), n = e ? os(tr.current, t, ue, "").after : void 0, r = await h.request(
|
|
589
|
+
O(`/queues/${l}/items`, {
|
|
588
590
|
scope: g,
|
|
589
591
|
// Last State Change is Aging read the other way round: the newest
|
|
590
592
|
// move is the least aged.
|
|
591
593
|
sort: B === "state_entered" ? "-aging_hours" : B === "-state_entered" ? "aging_hours" : B,
|
|
592
|
-
filters: JSON.stringify(
|
|
594
|
+
filters: JSON.stringify(xe),
|
|
593
595
|
// Table + group: headers only (rows load per group on expand, #741).
|
|
594
596
|
// Kanban renders the full matching set, grouped client-side.
|
|
595
|
-
|
|
596
|
-
group_by:
|
|
597
|
+
...$e ? {
|
|
598
|
+
group_by: R,
|
|
597
599
|
...mr.length ? { group_sums: mr.join(",") } : {}
|
|
598
|
-
} : C === "table" ? { page:
|
|
600
|
+
} : C === "table" ? { page: ue, limit: yn, ...n ? { after: n } : {} } : {}
|
|
599
601
|
})
|
|
600
602
|
);
|
|
601
|
-
return n && ss(tr.current, t,
|
|
603
|
+
return n && ss(tr.current, t, ue, r.next_cursor), r;
|
|
602
604
|
},
|
|
603
605
|
// Wait for display_config AND scope seeding so the first fetch uses the
|
|
604
606
|
// configured defaults and already carries the viewer's restricted filters.
|
|
@@ -607,36 +609,36 @@ function Ld({
|
|
|
607
609
|
// first fetch went out WITHOUT the seeded scope and refired ~350ms later
|
|
608
610
|
// with it (3.3s + 8.7s of work for one page). The first fetch now also
|
|
609
611
|
// waits for the debounced copy to settle; later typing still debounces.
|
|
610
|
-
enabled: !!l && z && ir && (
|
|
612
|
+
enabled: !!l && z && ir && (vn.current || Ja),
|
|
611
613
|
// Keep the previous page rendered while a sort/filter/page change refetches —
|
|
612
614
|
// swapping to skeletons collapsed the table height and jittered the page.
|
|
613
615
|
placeholderData: (e) => e
|
|
614
616
|
});
|
|
615
|
-
i && !
|
|
616
|
-
const
|
|
617
|
+
i && !vn.current && (vn.current = !0);
|
|
618
|
+
const ze = Object.entries(fe.current).filter(
|
|
617
619
|
([e, t]) => {
|
|
618
620
|
var n;
|
|
619
|
-
return !((n =
|
|
621
|
+
return !((n = he[e.slice(6)]) != null && n.length) && JSON.stringify(xe[e] ?? null) === JSON.stringify(t);
|
|
620
622
|
}
|
|
621
|
-
).map(([e]) => e), gr =
|
|
622
|
-
Object.entries(
|
|
623
|
+
).map(([e]) => e), gr = ze.length > 0 && Object.keys(xe).every((e) => ze.includes(e)), xr = Object.fromEntries(
|
|
624
|
+
Object.entries(xe).filter(([e]) => !ze.includes(e))
|
|
623
625
|
), { data: cl } = X({
|
|
624
626
|
queryKey: ["queue-default-hidden", l, g, xr],
|
|
625
|
-
enabled: !!l && !!i && !
|
|
627
|
+
enabled: !!l && !!i && !gt && i.total === 0 && ((ha = i.empty) == null ? void 0 : ha.reason) === "filters" && ze.length > 0 && !gr,
|
|
626
628
|
staleTime: 3e4,
|
|
627
629
|
retry: !1,
|
|
628
630
|
queryFn: () => h.request(
|
|
629
|
-
|
|
631
|
+
O(`/queues/${l}/items`, {
|
|
630
632
|
scope: g,
|
|
631
633
|
filters: JSON.stringify(xr),
|
|
632
634
|
page: 1,
|
|
633
635
|
limit: 1
|
|
634
636
|
})
|
|
635
637
|
).then((e) => Number(e.total ?? 0))
|
|
636
|
-
}),
|
|
638
|
+
}), ye = gr ? Math.max(0, (((fa = i == null ? void 0 : i.stats) == null ? void 0 : fa.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : cl ?? 0, yr = (e) => ze.map(e).join(" and "), kr = () => {
|
|
637
639
|
j((e) => {
|
|
638
640
|
const t = { ...e };
|
|
639
|
-
for (const n of
|
|
641
|
+
for (const n of ze) delete t[n];
|
|
640
642
|
return t;
|
|
641
643
|
}), K(1);
|
|
642
644
|
};
|
|
@@ -650,21 +652,21 @@ function Ld({
|
|
|
650
652
|
scope: g,
|
|
651
653
|
sort: B,
|
|
652
654
|
filters: JSON.stringify(Oe),
|
|
653
|
-
page:
|
|
655
|
+
page: ue
|
|
654
656
|
}, r = t.find((o) => o.queue === l);
|
|
655
657
|
t.push(n), t.length > 50 && t.shift(), r && r !== n && oe - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
|
|
656
658
|
}, [oe]);
|
|
657
|
-
const
|
|
658
|
-
() => (
|
|
659
|
-
[
|
|
660
|
-
), ul = Rs(dl),
|
|
661
|
-
pending:
|
|
659
|
+
const Xe = hr && !i || !z || !ir && !i, vr = (gt && !hr || ol && gt) && !be.current, dl = J(
|
|
660
|
+
() => ($e ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
661
|
+
[$e, i == null ? void 0 : i.data]
|
|
662
|
+
), ul = Rs(dl), Wt = ji(), wr = Ho(gt && !be.current), ml = Jo({
|
|
663
|
+
pending: gt && !be.current,
|
|
662
664
|
request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
|
|
663
665
|
noun: "items"
|
|
664
666
|
}), pl = qs();
|
|
665
667
|
async function _r(e, t) {
|
|
666
668
|
var m;
|
|
667
|
-
const r = (await h.request(
|
|
669
|
+
const r = (await h.request(O(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
|
|
668
670
|
if (!r || r.states.length === 0)
|
|
669
671
|
throw new Error("This item has no workflow instance");
|
|
670
672
|
const o = r.states.find((y) => y.key === t);
|
|
@@ -674,10 +676,10 @@ function Ld({
|
|
|
674
676
|
);
|
|
675
677
|
if (!s) throw new Error("No transition available to move this item here");
|
|
676
678
|
let u = null;
|
|
677
|
-
if (
|
|
679
|
+
if (Ui(s) && (u = await Wt.ask(((m = s.label) == null ? void 0 : m.trim()) || "Move"), !u))
|
|
678
680
|
throw new Error("Not moved — this move needs a note");
|
|
679
681
|
await h.request(
|
|
680
|
-
|
|
682
|
+
ce(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
|
|
681
683
|
transition_id: s.id,
|
|
682
684
|
...u ? { comment: u } : {}
|
|
683
685
|
})
|
|
@@ -691,38 +693,38 @@ function Ld({
|
|
|
691
693
|
f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
692
694
|
},
|
|
693
695
|
onError: (e) => {
|
|
694
|
-
|
|
696
|
+
E.error(dt(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
695
697
|
}
|
|
696
698
|
}), De = Te({
|
|
697
699
|
mutationFn: (e) => h.request(
|
|
698
|
-
|
|
700
|
+
ce(`/queues/${l}/claim`, {
|
|
699
701
|
source_collection: e.collection,
|
|
700
702
|
item_id: e.item_id
|
|
701
703
|
})
|
|
702
704
|
),
|
|
703
705
|
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
704
|
-
onError: () =>
|
|
705
|
-
}),
|
|
706
|
+
onError: () => E.error("Failed to claim item")
|
|
707
|
+
}), Ze = Te({
|
|
706
708
|
mutationFn: (e) => h.request(
|
|
707
|
-
|
|
709
|
+
ce(`/queues/${l}/release`, {
|
|
708
710
|
source_collection: e.collection,
|
|
709
711
|
item_id: e.item_id
|
|
710
712
|
})
|
|
711
713
|
),
|
|
712
714
|
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
713
|
-
onError: () =>
|
|
714
|
-
}), { data:
|
|
715
|
+
onError: () => E.error("Failed to release item")
|
|
716
|
+
}), { data: et } = X({
|
|
715
717
|
queryKey: ["queue-column-prefs", l],
|
|
716
|
-
queryFn: () => h.request(
|
|
718
|
+
queryFn: () => h.request(O(`/queues/${l}/column-prefs`)),
|
|
717
719
|
enabled: !!l
|
|
718
|
-
}), [
|
|
720
|
+
}), [xt, Ht] = w(null), [tt, Sn] = w(null);
|
|
719
721
|
P(() => {
|
|
720
|
-
|
|
721
|
-
}, [
|
|
722
|
-
const [hl, Nr] = w({}),
|
|
722
|
+
et && Sn(et.data.default_view_id);
|
|
723
|
+
}, [et]);
|
|
724
|
+
const [hl, Nr] = w({}), ke = $e ? (i == null ? void 0 : i.groups) ?? null : null, Jt = (ke ?? []).filter((e) => !Ce.has(e.key)).map((e) => e.key).flatMap(
|
|
723
725
|
(e) => Array.from({ length: hl[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
|
|
724
|
-
),
|
|
725
|
-
queries:
|
|
726
|
+
), Cn = je({
|
|
727
|
+
queries: Jt.map(({ key: e, page: t }) => ({
|
|
726
728
|
queryKey: [
|
|
727
729
|
"queue-items",
|
|
728
730
|
l,
|
|
@@ -730,51 +732,51 @@ function Ld({
|
|
|
730
732
|
g,
|
|
731
733
|
B,
|
|
732
734
|
Oe,
|
|
733
|
-
|
|
735
|
+
R,
|
|
734
736
|
e,
|
|
735
737
|
t
|
|
736
738
|
],
|
|
737
739
|
queryFn: () => h.request(
|
|
738
|
-
|
|
740
|
+
O(`/queues/${l}/items`, {
|
|
739
741
|
scope: g,
|
|
740
742
|
sort: B === "state_entered" ? "-aging_hours" : B === "-state_entered" ? "aging_hours" : B,
|
|
741
|
-
filters: JSON.stringify(
|
|
742
|
-
group_by:
|
|
743
|
+
filters: JSON.stringify(xe),
|
|
744
|
+
group_by: R,
|
|
743
745
|
group_key: e,
|
|
744
746
|
page: t,
|
|
745
|
-
limit:
|
|
747
|
+
limit: Hi
|
|
746
748
|
})
|
|
747
749
|
).then((n) => ({ key: e, rows: n.data })),
|
|
748
|
-
enabled: !!i &&
|
|
750
|
+
enabled: !!i && $e,
|
|
749
751
|
placeholderData: (n) => n
|
|
750
752
|
}))
|
|
751
|
-
}), fl =
|
|
753
|
+
}), fl = Cn.map((e) => e.dataUpdatedAt).join(","), $n = J(() => {
|
|
752
754
|
const e = /* @__PURE__ */ new Map();
|
|
753
|
-
return
|
|
755
|
+
return Cn.forEach((t, n) => {
|
|
754
756
|
if (!t.data) return;
|
|
755
|
-
const r =
|
|
757
|
+
const r = Jt[n].key;
|
|
756
758
|
e.set(r, [...e.get(r) ?? [], ...t.data.rows]);
|
|
757
759
|
}), e;
|
|
758
|
-
}, [fl,
|
|
759
|
-
|
|
760
|
-
),
|
|
760
|
+
}, [fl, Jt.map((e) => `${e.key}\0${e.page}`).join("")]), gl = new Set(
|
|
761
|
+
Cn.flatMap((e, t) => e.isFetching ? [Jt[t].key] : [])
|
|
762
|
+
), $ = ke ? [...$n.values()].flat() : (i == null ? void 0 : i.data) ?? [];
|
|
761
763
|
Vs(
|
|
762
764
|
l ? {
|
|
763
765
|
queue: {
|
|
764
766
|
id: l,
|
|
765
767
|
label: c == null ? void 0 : c.name,
|
|
766
768
|
scope: g,
|
|
767
|
-
filters: JSON.stringify(
|
|
768
|
-
items:
|
|
769
|
+
filters: JSON.stringify(xe),
|
|
770
|
+
items: $.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
|
|
769
771
|
}
|
|
770
772
|
} : null
|
|
771
773
|
);
|
|
772
|
-
const xl = Is(),
|
|
774
|
+
const xl = Is(), yt = $.some((e) => e.fulfilment !== void 0), kt = $.some((e) => e.send_backs !== void 0), { data: nt, dataUpdatedAt: Sr } = X({
|
|
773
775
|
queryKey: ["queue-live-stats", l, g, Oe, ar],
|
|
774
776
|
queryFn: () => h.request(
|
|
775
|
-
|
|
777
|
+
O(`/queues/${l}/items`, {
|
|
776
778
|
scope: g,
|
|
777
|
-
filters: JSON.stringify(
|
|
779
|
+
filters: JSON.stringify(xe),
|
|
778
780
|
page: 1,
|
|
779
781
|
limit: 1
|
|
780
782
|
})
|
|
@@ -783,43 +785,43 @@ function Ld({
|
|
|
783
785
|
staleTime: Number.POSITIVE_INFINITY,
|
|
784
786
|
placeholderData: (e) => e,
|
|
785
787
|
retry: !1
|
|
786
|
-
}),
|
|
788
|
+
}), Yt = !!nt && Sr > oe, x = Yt ? nt.stats : i == null ? void 0 : i.stats, I = Yt ? nt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, Cr = Yt ? nt.state_counts : i == null ? void 0 : i.state_counts;
|
|
787
789
|
P(() => {
|
|
788
|
-
if (!
|
|
789
|
-
const e =
|
|
790
|
-
pending:
|
|
791
|
-
liveTotal:
|
|
790
|
+
if (!Yt) return;
|
|
791
|
+
const e = gn.current > 0 || fn.current, t = Ti({
|
|
792
|
+
pending: pn.current,
|
|
793
|
+
liveTotal: nt.total,
|
|
792
794
|
rowsTotal: i == null ? void 0 : i.total,
|
|
793
795
|
// Only a table re-reads its rows quietly; the other views keep the pill.
|
|
794
796
|
busy: e || C !== "table"
|
|
795
797
|
});
|
|
796
|
-
|
|
797
|
-
liveTotal:
|
|
798
|
+
pn.current = 0, t > 0 && Bt((r) => r + t), Ai({
|
|
799
|
+
liveTotal: nt.total,
|
|
798
800
|
rowsTotal: i == null ? void 0 : i.total,
|
|
799
801
|
// Grouped tables too (army 8 b08-N6): their headers count the whole set, and
|
|
800
802
|
// nothing else re-read them — "37 of 38" with the strip at 38 for minutes.
|
|
801
803
|
table: C === "table",
|
|
802
804
|
busy: e
|
|
803
|
-
}) && (
|
|
804
|
-
queryKey:
|
|
805
|
+
}) && (be.current = !0, f.invalidateQueries({
|
|
806
|
+
queryKey: $e ? ["queue-items", l] : ["queue-items", l, g]
|
|
805
807
|
}).finally(() => {
|
|
806
|
-
|
|
808
|
+
be.current = !1;
|
|
807
809
|
}));
|
|
808
810
|
}, [Sr]);
|
|
809
|
-
const
|
|
810
|
-
!_.aging_hours &&
|
|
811
|
-
const
|
|
812
|
-
rr.current = new Set(
|
|
813
|
-
const
|
|
814
|
-
|
|
811
|
+
const qn = (ga = I ?? x) == null ? void 0 : ga.aging, $r = Q(void 0);
|
|
812
|
+
!_.aging_hours && qn && ($r.current = qn);
|
|
813
|
+
const vt = _.aging_hours ? $r.current ?? (x == null ? void 0 : x.aging) : qn ?? (x == null ? void 0 : x.aging);
|
|
814
|
+
rr.current = new Set($.map((e) => `${e.collection}:${e.item_id}`));
|
|
815
|
+
const wt = _s(
|
|
816
|
+
$.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
815
817
|
Ua
|
|
816
818
|
), qr = Q(oe), Rr = Q(0);
|
|
817
|
-
!
|
|
818
|
-
const e = new Set(
|
|
819
|
-
if (
|
|
820
|
-
|
|
821
|
-
const t =
|
|
822
|
-
|
|
819
|
+
!be.current && oe !== Rr.current && (qr.current = oe), P(() => {
|
|
820
|
+
const e = new Set($.map((t) => `${t.collection}:${t.item_id}`));
|
|
821
|
+
if (be.current) {
|
|
822
|
+
be.current = !1, Rr.current = oe;
|
|
823
|
+
const t = Qt.current;
|
|
824
|
+
Qt.current = [];
|
|
823
825
|
const n = lr.current, r = /* @__PURE__ */ new Set();
|
|
824
826
|
for (const o of t)
|
|
825
827
|
!e.has(o.key) || r.has(o.key) || (r.add(o.key), Ae.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
|
|
@@ -830,37 +832,37 @@ function Ld({
|
|
|
830
832
|
}
|
|
831
833
|
lr.current = e;
|
|
832
834
|
}, [oe]), P(() => {
|
|
833
|
-
|
|
835
|
+
Bt(0);
|
|
834
836
|
}, [oe]);
|
|
835
837
|
function yl() {
|
|
836
|
-
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }),
|
|
838
|
+
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Bt(0);
|
|
837
839
|
}
|
|
838
|
-
const { data:
|
|
840
|
+
const { data: ve } = X({
|
|
839
841
|
queryKey: ["queue-trends", l],
|
|
840
|
-
queryFn: () => h.request(
|
|
842
|
+
queryFn: () => h.request(O(`/queues/${l}/trends`, { days: 14 })),
|
|
841
843
|
enabled: !!l,
|
|
842
844
|
staleTime: 300 * 1e3
|
|
843
|
-
}), { data:
|
|
845
|
+
}), { data: we } = X({
|
|
844
846
|
queryKey: ["queue-trends", l, "mine"],
|
|
845
|
-
queryFn: () => h.request(
|
|
847
|
+
queryFn: () => h.request(O(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
|
|
846
848
|
enabled: !!l && g === "mine",
|
|
847
849
|
staleTime: 300 * 1e3
|
|
848
850
|
});
|
|
849
|
-
function
|
|
850
|
-
const n = (g === "all" ?
|
|
851
|
+
function _t(e) {
|
|
852
|
+
const n = (g === "all" ? ve == null ? void 0 : ve.data : g === "mine" ? we == null ? void 0 : we.data : void 0) ?? [];
|
|
851
853
|
if (n.length === 0) return {};
|
|
852
854
|
if (I) return {};
|
|
853
855
|
const r = n.map((s) => s[e]), o = n[n.length - 1];
|
|
854
856
|
return { trend: r, delta: ((x == null ? void 0 : x[e]) ?? 0) - o[e] };
|
|
855
857
|
}
|
|
856
|
-
const
|
|
857
|
-
const t = (g === "all" ?
|
|
858
|
+
const _e = J(() => {
|
|
859
|
+
const t = (g === "all" ? ve == null ? void 0 : ve.data : g === "mine" ? we == null ? void 0 : we.data : void 0) ?? [];
|
|
858
860
|
if (t.length < 3 || !x || I) return null;
|
|
859
861
|
const n = t.map(
|
|
860
862
|
(u) => g === "mine" ? u.owned ?? u.total : u.total
|
|
861
863
|
), r = n.slice(1).map((u, m) => u - n[m]), o = r.reduce((u, m) => u + m, 0) / r.length, s = x.total;
|
|
862
864
|
return Math.abs(o) < 0.05 ? { dir: "flat", pace: o, days: null } : o < 0 ? { dir: "down", pace: o, days: Math.max(1, Math.ceil(s / -o)) } : { dir: "up", pace: o, days: null };
|
|
863
|
-
}, [
|
|
865
|
+
}, [ve == null ? void 0 : ve.data, we == null ? void 0 : we.data, g, x, I]), Nt = J(
|
|
864
866
|
() => [
|
|
865
867
|
...new Set(
|
|
866
868
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -869,40 +871,40 @@ function Ld({
|
|
|
869
871
|
[c == null ? void 0 : c.sources]
|
|
870
872
|
), { data: kl } = X({
|
|
871
873
|
queryKey: ["collections"],
|
|
872
|
-
queryFn: () => h.request(
|
|
874
|
+
queryFn: () => h.request(O("/collections")).then((e) => e.data),
|
|
873
875
|
staleTime: 300 * 1e3
|
|
874
|
-
}),
|
|
875
|
-
queries:
|
|
876
|
+
}), rt = je({
|
|
877
|
+
queries: Nt.map((e) => ({
|
|
876
878
|
queryKey: ["queue-collection-addendums", e],
|
|
877
879
|
queryFn: () => h.request(
|
|
878
|
-
|
|
880
|
+
O(`/collections/${e}`)
|
|
879
881
|
).then((t) => {
|
|
880
882
|
var n;
|
|
881
883
|
return !!((n = t.data) != null && n.addendums_enabled);
|
|
882
884
|
}).catch(() => !1),
|
|
883
885
|
staleTime: 300 * 1e3
|
|
884
886
|
}))
|
|
885
|
-
}).some((e) => e.data === !0), { data:
|
|
887
|
+
}).some((e) => e.data === !0), { data: Rn = [] } = X({
|
|
886
888
|
queryKey: ["queue-integrations-collections"],
|
|
887
|
-
queryFn: () => h.request(
|
|
889
|
+
queryFn: () => h.request(O("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
|
|
888
890
|
staleTime: 300 * 1e3
|
|
889
|
-
}),
|
|
891
|
+
}), qe = Nt.some((e) => Rn.includes(e)), Fn = J(() => {
|
|
890
892
|
var t;
|
|
891
893
|
const e = {};
|
|
892
|
-
if (
|
|
893
|
-
for (const n of
|
|
894
|
-
if (!
|
|
894
|
+
if (!qe) return e;
|
|
895
|
+
for (const n of $) {
|
|
896
|
+
if (!Rn.includes(n.collection)) continue;
|
|
895
897
|
const r = e[t = n.collection] ?? (e[t] = []);
|
|
896
898
|
r.length < 500 && r.push(n.item_id);
|
|
897
899
|
}
|
|
898
900
|
return e;
|
|
899
|
-
}, [
|
|
901
|
+
}, [$, Rn, qe]), Fr = Object.keys(Fn), Lr = je({
|
|
900
902
|
queries: Fr.map((e) => ({
|
|
901
|
-
queryKey: ["queue-integrations-summary", e,
|
|
903
|
+
queryKey: ["queue-integrations-summary", e, Fn[e].join(",")],
|
|
902
904
|
queryFn: () => h.request(
|
|
903
|
-
|
|
905
|
+
ce("/integration-obligations/summary", {
|
|
904
906
|
collection: e,
|
|
905
|
-
ids:
|
|
907
|
+
ids: Fn[e]
|
|
906
908
|
})
|
|
907
909
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
908
910
|
staleTime: 3e4
|
|
@@ -914,35 +916,35 @@ function Ld({
|
|
|
914
916
|
const r = ((o = Lr[n]) == null ? void 0 : o.data) ?? {};
|
|
915
917
|
for (const [s, u] of Object.entries(r)) e[`${t}:${s}`] = u;
|
|
916
918
|
}), e;
|
|
917
|
-
}, [vl]),
|
|
919
|
+
}, [vl]), Ln = J(() => {
|
|
918
920
|
var t;
|
|
919
921
|
const e = {};
|
|
920
|
-
for (const n of
|
|
922
|
+
for (const n of $) {
|
|
921
923
|
if (!n.collection || n.collection === "tasks" || n.collection.startsWith("nivaro_"))
|
|
922
924
|
continue;
|
|
923
925
|
const r = e[t = n.collection] ?? (e[t] = []);
|
|
924
926
|
r.length < 500 && r.push(n.item_id);
|
|
925
927
|
}
|
|
926
928
|
return e;
|
|
927
|
-
}, [
|
|
928
|
-
queries:
|
|
929
|
-
queryKey: ["queue-task-counts", e,
|
|
929
|
+
}, [$]), Tn = Object.keys(Ln), Tr = je({
|
|
930
|
+
queries: Tn.map((e) => ({
|
|
931
|
+
queryKey: ["queue-task-counts", e, Ln[e].join(",")],
|
|
930
932
|
queryFn: () => h.request(
|
|
931
|
-
|
|
933
|
+
ce("/tasks/counts", { collection: e, ids: Ln[e] })
|
|
932
934
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
933
935
|
staleTime: 3e4
|
|
934
936
|
}))
|
|
935
937
|
}), _l = Tr.map((e) => e.dataUpdatedAt).join(","), Nl = J(() => {
|
|
936
938
|
const e = {};
|
|
937
|
-
return
|
|
939
|
+
return Tn.forEach((t, n) => {
|
|
938
940
|
var r;
|
|
939
941
|
for (const [o, s] of Object.entries(((r = Tr[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = s;
|
|
940
942
|
}), e;
|
|
941
|
-
}, [_l]), Ar =
|
|
942
|
-
queries:
|
|
943
|
+
}, [_l]), Ar = Tn.length > 0, Er = je({
|
|
944
|
+
queries: Nt.map((e) => ({
|
|
943
945
|
queryKey: ["queue-collection-risk-rules", e],
|
|
944
946
|
queryFn: () => h.request(
|
|
945
|
-
|
|
947
|
+
O("/at-risk/rules/active", { collection: e })
|
|
946
948
|
).then((t) => t.data ?? []).catch(() => []),
|
|
947
949
|
staleTime: 300 * 1e3
|
|
948
950
|
}))
|
|
@@ -958,14 +960,14 @@ function Ld({
|
|
|
958
960
|
}
|
|
959
961
|
return [...e.values()];
|
|
960
962
|
}, [Sl]), Dr = je({
|
|
961
|
-
queries:
|
|
963
|
+
queries: Nt.map((e) => ({
|
|
962
964
|
queryKey: ["queue-collection-states", e],
|
|
963
965
|
queryFn: () => h.request(
|
|
964
|
-
|
|
966
|
+
O(`/queues/collection-states/${e}`)
|
|
965
967
|
).then((t) => t.data),
|
|
966
968
|
staleTime: 300 * 1e3
|
|
967
969
|
}))
|
|
968
|
-
}), Kr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()),
|
|
970
|
+
}), Kr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), Re = J(() => {
|
|
969
971
|
const e = {};
|
|
970
972
|
for (const t of Dr)
|
|
971
973
|
(t.data ?? []).forEach((n, r) => {
|
|
@@ -975,47 +977,47 @@ function Ld({
|
|
|
975
977
|
}, [Dr.map((e) => e.data)]), Pr = x ? Object.entries(x.by_state).sort(
|
|
976
978
|
(e, t) => {
|
|
977
979
|
var n, r;
|
|
978
|
-
return (((n =
|
|
980
|
+
return (((n = Re[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = Re[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
979
981
|
}
|
|
980
982
|
) : [], Mr = (e) => [...e].sort(
|
|
981
983
|
(t, n) => {
|
|
982
984
|
var r, o;
|
|
983
|
-
return (((r =
|
|
985
|
+
return (((r = Re[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = Re[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
984
986
|
}
|
|
985
|
-
),
|
|
987
|
+
), An = J(() => {
|
|
986
988
|
const e = {};
|
|
987
|
-
for (const [t, n] of Object.entries(
|
|
989
|
+
for (const [t, n] of Object.entries(Re)) e[t] = n.label;
|
|
988
990
|
return e;
|
|
989
|
-
}, [
|
|
990
|
-
if (e ===
|
|
991
|
+
}, [Re]), Fe = (e) => e ? e === "none" ? "No State" : An[e] ?? Kr(e) : "—", at = (e) => {
|
|
992
|
+
if (e === sn) return "Addendums";
|
|
991
993
|
const t = (kl ?? []).find((n) => n.collection === e);
|
|
992
994
|
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Kr(e);
|
|
993
|
-
}, se = J(() =>
|
|
995
|
+
}, se = J(() => R ? ke ? ke.map((e) => ({
|
|
994
996
|
key: e.key,
|
|
995
|
-
rows:
|
|
997
|
+
rows: $n.get(e.key) ?? [],
|
|
996
998
|
breached: e.breached,
|
|
997
999
|
atRisk: e.at_risk,
|
|
998
1000
|
count: e.count,
|
|
999
1001
|
sums: e.sums ?? {}
|
|
1000
|
-
})) : Ls(R
|
|
1002
|
+
})) : Ls($, R).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [$, R, ke, $n]), En = Q(null);
|
|
1001
1003
|
P(() => {
|
|
1002
|
-
if (!
|
|
1003
|
-
|
|
1004
|
+
if (!R || !se) {
|
|
1005
|
+
En.current = null;
|
|
1004
1006
|
return;
|
|
1005
1007
|
}
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1008
|
+
if ($e && !ke || En.current === R) return;
|
|
1009
|
+
En.current = R;
|
|
1008
1010
|
const e = se.reduce((t, n) => t + n.count, 0);
|
|
1009
|
-
|
|
1010
|
-
}, [
|
|
1011
|
+
cn(e > 200 ? new Set(se.map((t) => t.key)) : /* @__PURE__ */ new Set()), Nr({});
|
|
1012
|
+
}, [R, ke]);
|
|
1011
1013
|
function Cl(e) {
|
|
1012
|
-
|
|
1014
|
+
cn((t) => {
|
|
1013
1015
|
const n = new Set(t);
|
|
1014
1016
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
1015
1017
|
});
|
|
1016
1018
|
}
|
|
1017
|
-
const
|
|
1018
|
-
if (e.collection ===
|
|
1019
|
+
const me = J(() => se ? se.filter((e) => !Ce.has(e.key)).flatMap((e) => e.rows) : $, [se, $, Ce]), F = (e) => `${e.collection}:${e.item_id}`, [Ke, Pe] = w(null), [$l, On] = w(!1), [St, zt] = w(null), Dn = (e) => {
|
|
1020
|
+
if (e.collection === sn && e.url) {
|
|
1019
1021
|
const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
|
|
1020
1022
|
if (t) {
|
|
1021
1023
|
const n = {};
|
|
@@ -1040,12 +1042,12 @@ function Ld({
|
|
|
1040
1042
|
name: c.name,
|
|
1041
1043
|
path: `${window.location.pathname}${window.location.search}`,
|
|
1042
1044
|
at: Date.now(),
|
|
1043
|
-
scroll: ((e =
|
|
1044
|
-
state: { scope: g, page:
|
|
1045
|
+
scroll: ((e = Zt.current) == null ? void 0 : e.scrollTop) ?? 0,
|
|
1046
|
+
state: { scope: g, page: ue, sort: B, filters: _, group_by: R, view: C },
|
|
1045
1047
|
entry: ks()
|
|
1046
1048
|
});
|
|
1047
|
-
},
|
|
1048
|
-
Br(), Y.open(
|
|
1049
|
+
}, lt = (e) => {
|
|
1050
|
+
Br(), Y.open(Dn(e));
|
|
1049
1051
|
}, ql = (e) => {
|
|
1050
1052
|
Br();
|
|
1051
1053
|
const t = W == null ? void 0 : W[0], n = !!t && t.collection === e.collection && String(t.itemId) === e.itemId;
|
|
@@ -1054,21 +1056,21 @@ function Ld({
|
|
|
1054
1056
|
itemId: e.itemId,
|
|
1055
1057
|
layoutSlug: n ? (p == null ? void 0 : p.item_layout) ?? null : null
|
|
1056
1058
|
});
|
|
1057
|
-
}, [U,
|
|
1059
|
+
}, [U, Ct] = w(
|
|
1058
1060
|
null
|
|
1059
1061
|
);
|
|
1060
1062
|
P(() => {
|
|
1061
1063
|
if (!U) return;
|
|
1062
|
-
const e = () =>
|
|
1064
|
+
const e = () => Ct(null);
|
|
1063
1065
|
return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
|
|
1064
1066
|
window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
|
|
1065
1067
|
};
|
|
1066
1068
|
}, [U]);
|
|
1067
|
-
const
|
|
1068
|
-
|
|
1069
|
+
const Kn = (e) => {
|
|
1070
|
+
zt(F(e));
|
|
1069
1071
|
const t = (p == null ? void 0 : p.row_click) ?? "preview";
|
|
1070
|
-
if (t === "full" || e.collection ===
|
|
1071
|
-
|
|
1072
|
+
if (t === "full" || e.collection === sn) {
|
|
1073
|
+
lt(e);
|
|
1072
1074
|
return;
|
|
1073
1075
|
}
|
|
1074
1076
|
if (t === "layout") {
|
|
@@ -1085,81 +1087,81 @@ function Ld({
|
|
|
1085
1087
|
};
|
|
1086
1088
|
P(() => {
|
|
1087
1089
|
if (!Ke) return;
|
|
1088
|
-
const e =
|
|
1090
|
+
const e = $.find((t) => F(t) === F(Ke));
|
|
1089
1091
|
e && e !== Ke && Pe(e);
|
|
1090
|
-
}, [
|
|
1092
|
+
}, [$]);
|
|
1091
1093
|
const Rl = (e) => !e.claimed_by || e.claimed_by.id === S;
|
|
1092
1094
|
function Qr(e) {
|
|
1093
|
-
const t = e ?
|
|
1095
|
+
const t = e ? me.findIndex((r) => F(r) === F(e)) + 1 : 0, n = me.slice(t).find(Rl);
|
|
1094
1096
|
if (!n) {
|
|
1095
|
-
|
|
1097
|
+
On(!1), Pe(null), E.info("Nothing left to work on — queue clear!");
|
|
1096
1098
|
return;
|
|
1097
1099
|
}
|
|
1098
|
-
if (
|
|
1099
|
-
|
|
1100
|
+
if (zt(F(n)), ge && !n.claimed_by && De.mutate(n), (p == null ? void 0 : p.row_click) === "full") {
|
|
1101
|
+
lt(n);
|
|
1100
1102
|
return;
|
|
1101
1103
|
}
|
|
1102
|
-
|
|
1104
|
+
On(!0), Pe(n);
|
|
1103
1105
|
}
|
|
1104
1106
|
P(() => {
|
|
1105
1107
|
if (C !== "table") return;
|
|
1106
1108
|
function e(t) {
|
|
1107
1109
|
var o;
|
|
1108
|
-
if (t.metaKey || t.ctrlKey || t.altKey || !
|
|
1109
|
-
const n =
|
|
1110
|
-
|
|
1111
|
-
const u =
|
|
1110
|
+
if (t.metaKey || t.ctrlKey || t.altKey || !Gi(t.target)) return;
|
|
1111
|
+
const n = St ? me.findIndex((s) => F(s) === St) : -1, r = (s) => {
|
|
1112
|
+
zt(F(s));
|
|
1113
|
+
const u = F(s), m = [...document.querySelectorAll("tr[data-row-key]")].find(
|
|
1112
1114
|
(y) => y.getAttribute("data-row-key") === u
|
|
1113
1115
|
);
|
|
1114
1116
|
m == null || m.focus();
|
|
1115
1117
|
};
|
|
1116
1118
|
if (t.key === "j" || t.key === "ArrowDown") {
|
|
1117
1119
|
t.preventDefault();
|
|
1118
|
-
const s =
|
|
1120
|
+
const s = me[Math.min(n + 1, me.length - 1)];
|
|
1119
1121
|
s && r(s);
|
|
1120
1122
|
} else if (t.key === "k" || t.key === "ArrowUp") {
|
|
1121
1123
|
t.preventDefault();
|
|
1122
|
-
const s =
|
|
1124
|
+
const s = me[Math.max(n - 1, 0)];
|
|
1123
1125
|
s && r(s);
|
|
1124
|
-
} else if (t.key === "c" && n >= 0 &&
|
|
1126
|
+
} else if (t.key === "c" && n >= 0 && ge) {
|
|
1125
1127
|
t.preventDefault();
|
|
1126
|
-
const s =
|
|
1127
|
-
((o = s.claimed_by) == null ? void 0 : o.id) === S ?
|
|
1128
|
-
} else t.key === "o" && n >= 0 && (t.preventDefault(),
|
|
1128
|
+
const s = me[n];
|
|
1129
|
+
((o = s.claimed_by) == null ? void 0 : o.id) === S ? Ze.mutate(s) : De.mutate(s);
|
|
1130
|
+
} else t.key === "o" && n >= 0 && (t.preventDefault(), lt(me[n]));
|
|
1129
1131
|
}
|
|
1130
1132
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1131
|
-
}, [C,
|
|
1133
|
+
}, [C, me, St, Ke, S, De, Ze, ge]);
|
|
1132
1134
|
const { data: G } = X({
|
|
1133
1135
|
queryKey: ["queue-views", l],
|
|
1134
|
-
queryFn: () => h.request(
|
|
1136
|
+
queryFn: () => h.request(O(`/queues/${l}/views`)),
|
|
1135
1137
|
enabled: !!l
|
|
1136
|
-
}), [
|
|
1137
|
-
function
|
|
1138
|
+
}), [ot, st] = w(null), [Fl, Pn] = w(!1), [Xt, jr] = w(""), [Ur, Vr] = w(!1), [$t, Ir] = w(!1);
|
|
1139
|
+
function qt(e) {
|
|
1138
1140
|
const t = e.state ?? {};
|
|
1139
|
-
te(t.scope ?? "all"), j({ ...
|
|
1141
|
+
te(t.scope ?? "all"), j({ ...fe.current, ...t.filters ?? {} }), Ge(t.sort ?? ""), bt(t.group_by ?? null), Ht(t.columns ?? null), un(t.pins ?? null), t.view && Ie(Ee.includes(t.view) ? t.view : Ee[0]), K(1), st(e.id);
|
|
1140
1142
|
}
|
|
1141
1143
|
function Ll() {
|
|
1142
1144
|
var t, n;
|
|
1143
1145
|
const e = G == null ? void 0 : G.data.find((r) => r.is_default);
|
|
1144
1146
|
if (e) {
|
|
1145
|
-
|
|
1147
|
+
qt(e);
|
|
1146
1148
|
return;
|
|
1147
1149
|
}
|
|
1148
|
-
te(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), j({ ...
|
|
1150
|
+
te(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), j({ ...fe.current }), Ge(""), bt(null), Ht(null), un(null), (n = c == null ? void 0 : c.display_config) != null && n.default_view && Ie(c.display_config.default_view), K(1), st(null);
|
|
1149
1151
|
}
|
|
1150
1152
|
P(() => {
|
|
1151
|
-
if (z || !(c != null && c.display_config) ||
|
|
1152
|
-
const e =
|
|
1153
|
-
t ?
|
|
1154
|
-
}, [c,
|
|
1155
|
-
const
|
|
1153
|
+
if (z || !(c != null && c.display_config) || et === void 0 || G === void 0) return;
|
|
1154
|
+
const e = et.data.default_view_id, t = e != null ? G.data.find((r) => r.id === e) : void 0, n = G.data.find((r) => r.is_default);
|
|
1155
|
+
t ? qt(t) : n ? qt(n) : (Ie(c.display_config.default_view), te(c.display_config.default_scope)), Ha(!0);
|
|
1156
|
+
}, [c, et, G, z]);
|
|
1157
|
+
const Zt = Q(null), en = Q(null);
|
|
1156
1158
|
P(() => {
|
|
1157
1159
|
if (!z) return;
|
|
1158
|
-
const e =
|
|
1159
|
-
if (!e || !
|
|
1160
|
+
const e = di();
|
|
1161
|
+
if (!e || !ui(e, l, ys(), xs())) return;
|
|
1160
1162
|
Ka({ ...e, restore: !1 });
|
|
1161
1163
|
const t = e.state ?? {};
|
|
1162
|
-
t.scope && te(t.scope), t.filters && j({ ...
|
|
1164
|
+
t.scope && te(t.scope), t.filters && j({ ...fe.current, ...t.filters }), t.sort != null && Ge(t.sort), bt(t.group_by ?? null), t.view && Ie(t.view), t.page && K(t.page), en.current = e.scroll ?? 0, W && W.length > 0 && ct.back(W.length);
|
|
1163
1165
|
}, [z, l]), P(() => {
|
|
1164
1166
|
var s;
|
|
1165
1167
|
if (!z || typeof window > "u") return;
|
|
@@ -1182,65 +1184,65 @@ function Ld({
|
|
|
1182
1184
|
window.history.state,
|
|
1183
1185
|
"",
|
|
1184
1186
|
`${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
|
|
1185
|
-
), te("all"), j((r) => ({ ...r, owners: [t] })),
|
|
1187
|
+
), te("all"), j((r) => ({ ...r, owners: [t] })), st(null), K(1);
|
|
1186
1188
|
}, [z]), P(() => {
|
|
1187
1189
|
if (!z) return;
|
|
1188
1190
|
const e = ps(bs(`queue:${l}`));
|
|
1189
|
-
e && (hs(),
|
|
1191
|
+
e && (hs(), qt({
|
|
1190
1192
|
id: -1,
|
|
1191
1193
|
// Saved views type filters loosely as strings; multi-selects ride as arrays there too.
|
|
1192
1194
|
state: e
|
|
1193
|
-
}),
|
|
1195
|
+
}), st(null), e.page && K(e.page));
|
|
1194
1196
|
}, [z]);
|
|
1195
1197
|
const Gr = () => ({
|
|
1196
1198
|
scope: g,
|
|
1197
1199
|
filters: _,
|
|
1198
1200
|
sort: B,
|
|
1199
|
-
group_by:
|
|
1201
|
+
group_by: R,
|
|
1200
1202
|
view: C,
|
|
1201
|
-
columns:
|
|
1203
|
+
columns: xt,
|
|
1202
1204
|
pins: We,
|
|
1203
|
-
...
|
|
1205
|
+
...ue > 1 ? { page: ue } : {}
|
|
1204
1206
|
});
|
|
1205
1207
|
P(() => {
|
|
1206
|
-
|
|
1207
|
-
}, [
|
|
1208
|
-
const { isAdmin: Me } = Aa(), Tl =
|
|
1209
|
-
() =>
|
|
1208
|
+
en.current == null || $.length === 0 || !Zt.current || (Zt.current.scrollTop = en.current, en.current = null);
|
|
1209
|
+
}, [$]);
|
|
1210
|
+
const { isAdmin: Me } = Aa(), Tl = $.map((e) => `${e.collection}|${e.item_id}`).join(","), Al = J(
|
|
1211
|
+
() => $.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
1210
1212
|
[Tl]
|
|
1211
|
-
), Wr =
|
|
1213
|
+
), Wr = gi(Al, Me), El = (e) => St === F(e) ? (
|
|
1212
1214
|
// Pinned sticky cells use bg-inherit — the highlight must be
|
|
1213
1215
|
// OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
|
|
1214
1216
|
// scrolled content bleeds through the pinned columns. Same
|
|
1215
1217
|
// pair DataTable uses for selected rows when pins are active.
|
|
1216
1218
|
"bg-[#f2fdff] dark:bg-[#20303a]"
|
|
1217
|
-
) : e.at_risk ? Ds(e.at_risk_color ?? "red") : void 0,
|
|
1219
|
+
) : e.at_risk ? Ds(e.at_risk_color ?? "red") : void 0, tn = Me || (c == null ? void 0 : c.owner) != null && c.owner === S, Ol = Te({
|
|
1218
1220
|
mutationFn: ({ viewId: e, on: t }) => h.request(Ea(`/queues/views/${e}`, { is_default: t })),
|
|
1219
1221
|
onSuccess: () => {
|
|
1220
|
-
f.invalidateQueries({ queryKey: ["queue-views", l] }),
|
|
1222
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), E.success("Queue default view updated");
|
|
1221
1223
|
},
|
|
1222
|
-
onError: () =>
|
|
1223
|
-
}),
|
|
1224
|
+
onError: () => E.error("Could not update the queue default view")
|
|
1225
|
+
}), nn = Te({
|
|
1224
1226
|
mutationFn: () => h.request(
|
|
1225
|
-
|
|
1226
|
-
name:
|
|
1227
|
-
is_shared:
|
|
1228
|
-
is_default:
|
|
1227
|
+
ce(`/queues/${l}/views`, {
|
|
1228
|
+
name: Xt.trim(),
|
|
1229
|
+
is_shared: tn && (Ur || $t),
|
|
1230
|
+
is_default: $t,
|
|
1229
1231
|
state: {
|
|
1230
1232
|
scope: g,
|
|
1231
1233
|
filters: _,
|
|
1232
1234
|
sort: B,
|
|
1233
|
-
group_by:
|
|
1235
|
+
group_by: R,
|
|
1234
1236
|
view: C,
|
|
1235
|
-
columns:
|
|
1237
|
+
columns: xt,
|
|
1236
1238
|
pins: We
|
|
1237
1239
|
}
|
|
1238
1240
|
})
|
|
1239
1241
|
),
|
|
1240
1242
|
onSuccess: (e) => {
|
|
1241
|
-
|
|
1243
|
+
Pn(!1), jr(""), Vr(!1), Ir(!1), st(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), E.success("View saved");
|
|
1242
1244
|
},
|
|
1243
|
-
onError: () =>
|
|
1245
|
+
onError: () => E.error("Failed to save view")
|
|
1244
1246
|
}), [Hr, Jr] = w(null), Be = Te({
|
|
1245
1247
|
mutationFn: (e) => h.request(
|
|
1246
1248
|
Ea(`/queues/views/${e.id}`, {
|
|
@@ -1248,56 +1250,56 @@ function Ld({
|
|
|
1248
1250
|
scope: g,
|
|
1249
1251
|
filters: _,
|
|
1250
1252
|
sort: B,
|
|
1251
|
-
group_by:
|
|
1253
|
+
group_by: R,
|
|
1252
1254
|
view: C,
|
|
1253
|
-
columns:
|
|
1255
|
+
columns: xt,
|
|
1254
1256
|
pins: We
|
|
1255
1257
|
}
|
|
1256
1258
|
})
|
|
1257
1259
|
),
|
|
1258
1260
|
onSuccess: (e, t) => {
|
|
1259
|
-
f.invalidateQueries({ queryKey: ["queue-views", l] }), Jr(t.id), setTimeout(() => Jr((n) => n === t.id ? null : n), 2e3),
|
|
1261
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), Jr(t.id), setTimeout(() => Jr((n) => n === t.id ? null : n), 2e3), E.success(`Saved "${t.name}" with the current filters, scope and sort`);
|
|
1260
1262
|
},
|
|
1261
|
-
onError: () =>
|
|
1262
|
-
}), [
|
|
1263
|
+
onError: () => E.error("Failed to update view")
|
|
1264
|
+
}), [Mn, rn] = w(null);
|
|
1263
1265
|
P(() => {
|
|
1264
|
-
if (
|
|
1265
|
-
const e = setTimeout(() =>
|
|
1266
|
+
if (Mn == null) return;
|
|
1267
|
+
const e = setTimeout(() => rn(null), 5e3);
|
|
1266
1268
|
return () => clearTimeout(e);
|
|
1267
|
-
}, [
|
|
1269
|
+
}, [Mn]);
|
|
1268
1270
|
const Yr = Te({
|
|
1269
1271
|
mutationFn: (e) => h.request(zn(`/queues/views/${e}`)),
|
|
1270
1272
|
onSuccess: (e, t) => {
|
|
1271
|
-
|
|
1273
|
+
rn(null), f.invalidateQueries({ queryKey: ["queue-views", l] }), st(null), tt === t && Sn(null);
|
|
1272
1274
|
},
|
|
1273
|
-
onError: () =>
|
|
1275
|
+
onError: () => E.error("Failed to delete view")
|
|
1274
1276
|
}), Dl = Te({
|
|
1275
1277
|
mutationFn: (e) => h.request(zo(`/queues/${l}/default-view`, { view_id: e })),
|
|
1276
|
-
onMutate: (e) =>
|
|
1278
|
+
onMutate: (e) => Sn(e),
|
|
1277
1279
|
onSuccess: (e, t) => {
|
|
1278
|
-
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }),
|
|
1280
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), E.success(
|
|
1279
1281
|
t === null ? "Reverted to the general default" : "Set as your default view"
|
|
1280
1282
|
);
|
|
1281
1283
|
},
|
|
1282
1284
|
onError: () => {
|
|
1283
|
-
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }),
|
|
1285
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), E.error("Failed to update default view");
|
|
1284
1286
|
}
|
|
1285
|
-
}), [
|
|
1286
|
-
ne &&
|
|
1287
|
+
}), [ie, it] = w([]), [ne, zr] = w(!1), Kl = () => {
|
|
1288
|
+
ne && it([]), zr(!ne);
|
|
1287
1289
|
};
|
|
1288
1290
|
P(() => {
|
|
1289
|
-
C !== "table" && ne && (zr(!1),
|
|
1290
|
-
}, [C, ne]), Yo(),
|
|
1291
|
-
const [
|
|
1291
|
+
C !== "table" && ne && (zr(!1), it([]));
|
|
1292
|
+
}, [C, ne]), Yo(), gn.current = ie.length;
|
|
1293
|
+
const [Rt, Xr] = w(!1);
|
|
1292
1294
|
async function Bn(e, t) {
|
|
1293
|
-
const n =
|
|
1294
|
-
Xr(!0),
|
|
1295
|
+
const n = $.filter((u) => ie.includes(F(u)));
|
|
1296
|
+
Xr(!0), Wt.beginBatch();
|
|
1295
1297
|
const r = await Promise.allSettled(n.map(t));
|
|
1296
|
-
|
|
1298
|
+
Wt.endBatch();
|
|
1297
1299
|
const o = r.filter((u) => u.status === "fulfilled").length, s = r.length - o;
|
|
1298
|
-
Xr(!1),
|
|
1300
|
+
Xr(!1), it([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? E.warning(`${e}: ${o} succeeded, ${s} failed`) : E.success(`${e}: ${o} succeeded`);
|
|
1299
1301
|
}
|
|
1300
|
-
const
|
|
1302
|
+
const Ne = (e) => {
|
|
1301
1303
|
var t;
|
|
1302
1304
|
for (const n of (c == null ? void 0 : c.sources) ?? []) {
|
|
1303
1305
|
const r = (t = n.column_formats) == null ? void 0 : t[e];
|
|
@@ -1305,11 +1307,11 @@ function Ld({
|
|
|
1305
1307
|
}
|
|
1306
1308
|
return null;
|
|
1307
1309
|
}, Pl = (e) => {
|
|
1308
|
-
if (
|
|
1309
|
-
if (
|
|
1310
|
-
if (
|
|
1311
|
-
const t =
|
|
1312
|
-
return n ? Ue(e, n) :
|
|
1310
|
+
if (R === "state") return e === "No state" ? e : Fe(e);
|
|
1311
|
+
if (R === "collection") return at(e);
|
|
1312
|
+
if (R != null && R.startsWith("extra.") && e !== "—") {
|
|
1313
|
+
const t = R.slice(6), n = Ne(t);
|
|
1314
|
+
return n ? Ue(e, n) : Dt(
|
|
1313
1315
|
((c == null ? void 0 : c.extra_field_meta) ?? []).find((r) => r.path === t),
|
|
1314
1316
|
e
|
|
1315
1317
|
);
|
|
@@ -1318,7 +1320,7 @@ function Ld({
|
|
|
1318
1320
|
}, Ml = se == null ? void 0 : se.map((e) => ({
|
|
1319
1321
|
key: e.key,
|
|
1320
1322
|
rows: e.rows,
|
|
1321
|
-
header: /* @__PURE__ */ d(
|
|
1323
|
+
header: /* @__PURE__ */ d(Se, { children: [
|
|
1322
1324
|
/* @__PURE__ */ a("span", { children: Pl(e.key) }),
|
|
1323
1325
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
1324
1326
|
"(",
|
|
@@ -1326,14 +1328,14 @@ function Ld({
|
|
|
1326
1328
|
")"
|
|
1327
1329
|
] }),
|
|
1328
1330
|
Object.entries(e.sums).map(([t, n]) => {
|
|
1329
|
-
const r =
|
|
1331
|
+
const r = Ne(t);
|
|
1330
1332
|
return /* @__PURE__ */ d(
|
|
1331
1333
|
"span",
|
|
1332
1334
|
{
|
|
1333
1335
|
className: "font-normal tabular-nums text-slate-500 dark:text-slate-400",
|
|
1334
1336
|
"data-queue-group-sum": t,
|
|
1335
1337
|
children: [
|
|
1336
|
-
|
|
1338
|
+
T(`extra.${t}`, Ve(t)),
|
|
1337
1339
|
":",
|
|
1338
1340
|
" ",
|
|
1339
1341
|
r ? Ue(String(n), r) : ee(n)
|
|
@@ -1342,8 +1344,8 @@ function Ld({
|
|
|
1342
1344
|
t
|
|
1343
1345
|
);
|
|
1344
1346
|
}),
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
+
ke && !Ce.has(e.key) && gl.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
|
|
1348
|
+
ke && !Ce.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
|
|
1347
1349
|
"button",
|
|
1348
1350
|
{
|
|
1349
1351
|
type: "button",
|
|
@@ -1370,18 +1372,18 @@ function Ld({
|
|
|
1370
1372
|
" at risk"
|
|
1371
1373
|
] })
|
|
1372
1374
|
] })
|
|
1373
|
-
})), Qn = (((xa = i == null ? void 0 : i.available_values.collection) == null ? void 0 : xa.length) ?? 0) > 1, Zr =
|
|
1375
|
+
})), Qn = (((xa = i == null ? void 0 : i.available_values.collection) == null ? void 0 : xa.length) ?? 0) > 1, Zr = $.some((e) => !!e.unseen) || wt.size > 0 || $.some((e) => Ae.isNew(F(e))), ea = [
|
|
1374
1376
|
...Qn ? [
|
|
1375
1377
|
{
|
|
1376
1378
|
key: "collection",
|
|
1377
|
-
header:
|
|
1379
|
+
header: T("collection", "Collection"),
|
|
1378
1380
|
sortable: !0,
|
|
1379
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1381
|
+
render: (e) => /* @__PURE__ */ a(Si, { variant: "outline", children: at(e.collection) })
|
|
1380
1382
|
}
|
|
1381
1383
|
] : [],
|
|
1382
1384
|
{
|
|
1383
1385
|
key: "label",
|
|
1384
|
-
header:
|
|
1386
|
+
header: T("label", "Item"),
|
|
1385
1387
|
sortable: !0,
|
|
1386
1388
|
// Room in the left padding for the hanging unseen mark (#643).
|
|
1387
1389
|
className: Zr ? "pl-[30px]" : void 0,
|
|
@@ -1391,15 +1393,15 @@ function Ld({
|
|
|
1391
1393
|
// a whole, but nothing on it said so — an underline is the one
|
|
1392
1394
|
// convention people already read as "this goes somewhere".
|
|
1393
1395
|
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
+
wt.get(F(e)) || Ae.isNew(F(e)) ? /* @__PURE__ */ a(
|
|
1397
|
+
pi,
|
|
1396
1398
|
{
|
|
1397
|
-
lock:
|
|
1398
|
-
isNew: Ae.isNew(
|
|
1399
|
+
lock: wt.get(F(e)),
|
|
1400
|
+
isNew: Ae.isNew(F(e)),
|
|
1399
1401
|
dataAttr: "data-queue-live-mark",
|
|
1400
1402
|
hang: !0
|
|
1401
1403
|
}
|
|
1402
|
-
) : /* @__PURE__ */ a(
|
|
1404
|
+
) : /* @__PURE__ */ a(Ni, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
|
|
1403
1405
|
/* @__PURE__ */ a(
|
|
1404
1406
|
"span",
|
|
1405
1407
|
{
|
|
@@ -1418,7 +1420,7 @@ function Ld({
|
|
|
1418
1420
|
t
|
|
1419
1421
|
)),
|
|
1420
1422
|
/* @__PURE__ */ a(
|
|
1421
|
-
|
|
1423
|
+
_i,
|
|
1422
1424
|
{
|
|
1423
1425
|
viewers: ul[Fs(e.collection, e.item_id)],
|
|
1424
1426
|
dataAttr: "data-queue-presence"
|
|
@@ -1429,12 +1431,12 @@ function Ld({
|
|
|
1429
1431
|
},
|
|
1430
1432
|
{
|
|
1431
1433
|
key: "state",
|
|
1432
|
-
header:
|
|
1434
|
+
header: T("state", "State"),
|
|
1433
1435
|
sortable: !0,
|
|
1434
1436
|
render: (e) => e.state ? /* @__PURE__ */ d(
|
|
1435
1437
|
"span",
|
|
1436
1438
|
{
|
|
1437
|
-
className:
|
|
1439
|
+
className: L(
|
|
1438
1440
|
"inline-block max-w-[190px] truncate whitespace-nowrap rounded px-1.5 py-0.5 align-middle text-[11px] font-medium",
|
|
1439
1441
|
e.state_color && "text-[color:var(--nvr-state-ink)] dark:text-[color:var(--nvr-state-ink-dark)]"
|
|
1440
1442
|
),
|
|
@@ -1443,9 +1445,9 @@ function Ld({
|
|
|
1443
1445
|
"--nvr-state-ink": Xo(e.state_color),
|
|
1444
1446
|
"--nvr-state-ink-dark": e.state_color
|
|
1445
1447
|
} : void 0,
|
|
1446
|
-
title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${
|
|
1448
|
+
title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Fe(e.state)}` : Fe(e.state),
|
|
1447
1449
|
children: [
|
|
1448
|
-
|
|
1450
|
+
Fe(e.state),
|
|
1449
1451
|
e.via_addendum && /* @__PURE__ */ a("span", { className: "ml-1 rounded-sm bg-amber-500/15 px-1 text-[9px] font-bold uppercase tracking-wide text-amber-700 dark:text-amber-300", children: "Addendum" })
|
|
1450
1452
|
]
|
|
1451
1453
|
}
|
|
@@ -1453,33 +1455,33 @@ function Ld({
|
|
|
1453
1455
|
},
|
|
1454
1456
|
{
|
|
1455
1457
|
key: "owners",
|
|
1456
|
-
header:
|
|
1458
|
+
header: T("owners", "Owners"),
|
|
1457
1459
|
sortable: !0,
|
|
1458
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1460
|
+
render: (e) => /* @__PURE__ */ a(Oi, { owners: e.owners })
|
|
1459
1461
|
},
|
|
1460
1462
|
{
|
|
1461
1463
|
key: "aging_hours",
|
|
1462
|
-
header:
|
|
1464
|
+
header: T("aging_hours", "Aging"),
|
|
1463
1465
|
sortable: !0,
|
|
1464
|
-
render: (e) =>
|
|
1466
|
+
render: (e) => zi(e.aging_hours)
|
|
1465
1467
|
},
|
|
1466
1468
|
{
|
|
1467
1469
|
// When the record entered its current state — the same moment Aging
|
|
1468
1470
|
// counts from (the pipeline history, not the legacy column).
|
|
1469
1471
|
key: "state_entered",
|
|
1470
|
-
header:
|
|
1472
|
+
header: T("state_entered", "Last State Change"),
|
|
1471
1473
|
sortable: !0,
|
|
1472
1474
|
render: (e) => e.state_entered_at ? as(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
|
|
1473
1475
|
},
|
|
1474
1476
|
{
|
|
1475
1477
|
key: "sla_status",
|
|
1476
|
-
header:
|
|
1478
|
+
header: T("sla_status", "SLA"),
|
|
1477
1479
|
sortable: !0,
|
|
1478
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1480
|
+
render: (e) => /* @__PURE__ */ a(Xi, { status: e.sla_status })
|
|
1479
1481
|
},
|
|
1480
1482
|
{
|
|
1481
1483
|
key: "at_risk",
|
|
1482
|
-
header:
|
|
1484
|
+
header: T("at_risk", "Risk"),
|
|
1483
1485
|
sortable: !0,
|
|
1484
1486
|
render: (e) => {
|
|
1485
1487
|
var t;
|
|
@@ -1489,21 +1491,21 @@ function Ld({
|
|
|
1489
1491
|
] }) : e.predicted_risk ? /* @__PURE__ */ a("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
|
|
1490
1492
|
}
|
|
1491
1493
|
},
|
|
1492
|
-
...
|
|
1494
|
+
...rt ? [
|
|
1493
1495
|
{
|
|
1494
1496
|
key: "addendums",
|
|
1495
|
-
header:
|
|
1497
|
+
header: T("addendums", "Addendums"),
|
|
1496
1498
|
sortable: !1,
|
|
1497
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1499
|
+
render: (e) => /* @__PURE__ */ a(Yi, { summary: e.addendums })
|
|
1498
1500
|
}
|
|
1499
1501
|
] : [],
|
|
1500
|
-
...
|
|
1502
|
+
...yt ? [
|
|
1501
1503
|
{
|
|
1502
1504
|
key: "fulfilment",
|
|
1503
|
-
header:
|
|
1505
|
+
header: T("fulfilment", "Shipped"),
|
|
1504
1506
|
sortable: !0,
|
|
1505
1507
|
render: (e) => /* @__PURE__ */ a(
|
|
1506
|
-
|
|
1508
|
+
ai,
|
|
1507
1509
|
{
|
|
1508
1510
|
collection: e.collection,
|
|
1509
1511
|
itemId: e.item_id,
|
|
@@ -1512,18 +1514,18 @@ function Ld({
|
|
|
1512
1514
|
)
|
|
1513
1515
|
}
|
|
1514
1516
|
] : [],
|
|
1515
|
-
|
|
1517
|
+
...qe ? [
|
|
1516
1518
|
{
|
|
1517
1519
|
key: "integrations",
|
|
1518
|
-
header:
|
|
1520
|
+
header: T("integrations", "Integrations"),
|
|
1519
1521
|
sortable: !1,
|
|
1520
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1522
|
+
render: (e) => /* @__PURE__ */ a(si, { rows: wl[`${e.collection}:${e.item_id}`] })
|
|
1521
1523
|
}
|
|
1522
1524
|
] : [],
|
|
1523
1525
|
...Ar ? [
|
|
1524
1526
|
{
|
|
1525
1527
|
key: "tasks",
|
|
1526
|
-
header:
|
|
1528
|
+
header: T("tasks", "Tasks"),
|
|
1527
1529
|
sortable: !1,
|
|
1528
1530
|
render: (e) => {
|
|
1529
1531
|
const t = Nl[`${e.collection}:${e.item_id}`];
|
|
@@ -1541,12 +1543,12 @@ function Ld({
|
|
|
1541
1543
|
}
|
|
1542
1544
|
}
|
|
1543
1545
|
] : [],
|
|
1544
|
-
...
|
|
1546
|
+
...kt ? [
|
|
1545
1547
|
{
|
|
1546
1548
|
key: "send_backs",
|
|
1547
|
-
header:
|
|
1549
|
+
header: T("send_backs", "Sent back"),
|
|
1548
1550
|
sortable: !0,
|
|
1549
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1551
|
+
render: (e) => /* @__PURE__ */ a(Wi, { summary: e.send_backs })
|
|
1550
1552
|
}
|
|
1551
1553
|
] : []
|
|
1552
1554
|
], Bl = {
|
|
@@ -1557,7 +1559,7 @@ function Ld({
|
|
|
1557
1559
|
{
|
|
1558
1560
|
type: "button",
|
|
1559
1561
|
onClick: (t) => {
|
|
1560
|
-
t.stopPropagation(),
|
|
1562
|
+
t.stopPropagation(), Ze.mutate(e);
|
|
1561
1563
|
},
|
|
1562
1564
|
className: "text-[11px] text-slate-400 underline hover:text-slate-600",
|
|
1563
1565
|
children: "Release"
|
|
@@ -1573,7 +1575,7 @@ function Ld({
|
|
|
1573
1575
|
children: "Claim"
|
|
1574
1576
|
}
|
|
1575
1577
|
)
|
|
1576
|
-
},
|
|
1578
|
+
}, Ft = (c == null ? void 0 : c.available_extra_fields) ?? [], ct = Go("drill.queue"), W = ct.value, ta = (e) => ct.push([e]), jn = Q(null);
|
|
1577
1579
|
P(() => {
|
|
1578
1580
|
var r;
|
|
1579
1581
|
if (!z || !l) return;
|
|
@@ -1589,11 +1591,11 @@ function Ld({
|
|
|
1589
1591
|
g,
|
|
1590
1592
|
_,
|
|
1591
1593
|
B,
|
|
1592
|
-
|
|
1594
|
+
R,
|
|
1593
1595
|
C,
|
|
1594
|
-
|
|
1596
|
+
xt,
|
|
1595
1597
|
We,
|
|
1596
|
-
|
|
1598
|
+
ue,
|
|
1597
1599
|
W
|
|
1598
1600
|
]);
|
|
1599
1601
|
const Ql = (e) => {
|
|
@@ -1634,7 +1636,7 @@ function Ld({
|
|
|
1634
1636
|
] : [], Gl = je({
|
|
1635
1637
|
queries: na.map((e) => ({
|
|
1636
1638
|
queryKey: ["cbv-collection-meta", e],
|
|
1637
|
-
queryFn: () => h.request(
|
|
1639
|
+
queryFn: () => h.request(O(`/collections/${e}`)).then((t) => t.data),
|
|
1638
1640
|
staleTime: 10 * 6e4,
|
|
1639
1641
|
retry: !1
|
|
1640
1642
|
}))
|
|
@@ -1649,27 +1651,27 @@ function Ld({
|
|
|
1649
1651
|
});
|
|
1650
1652
|
const { data: Wl } = X({
|
|
1651
1653
|
queryKey: ["my-permissions"],
|
|
1652
|
-
queryFn: () => h.request(
|
|
1654
|
+
queryFn: () => h.request(O("/security/my/permissions")).then((e) => e.data),
|
|
1653
1655
|
enabled: Un.enabled && !Me,
|
|
1654
1656
|
staleTime: 5 * 6e4
|
|
1655
|
-
}), ra =
|
|
1657
|
+
}), ra = hi(), aa = (e, t) => {
|
|
1656
1658
|
if (t.includes(".")) return null;
|
|
1657
1659
|
const n = Vn.get(e.collection);
|
|
1658
1660
|
if (!n) return null;
|
|
1659
|
-
const r =
|
|
1661
|
+
const r = wt.get(F(e));
|
|
1660
1662
|
return r && !r.is_mine ? null : us({
|
|
1661
1663
|
config: Un,
|
|
1662
1664
|
key: t,
|
|
1663
1665
|
field: n.fields.get(t),
|
|
1664
1666
|
collection: e.collection,
|
|
1665
1667
|
relations: n.relations,
|
|
1666
|
-
mayUpdate: Me ||
|
|
1668
|
+
mayUpdate: Me || ei(Wl, e.collection)
|
|
1667
1669
|
});
|
|
1668
1670
|
}, la = (e, t, n) => {
|
|
1669
1671
|
var r, o, s;
|
|
1670
1672
|
return n === "m2o" ? ((o = (r = e.extra_ids) == null ? void 0 : r[t]) == null ? void 0 : o[0]) ?? null : ((s = e.extra) == null ? void 0 : s[t]) ?? null;
|
|
1671
1673
|
}, Hl = (e, t, n, r, o) => {
|
|
1672
|
-
const s = (b) => `${
|
|
1674
|
+
const s = (b) => `${F(e)}|${b}`, u = [...re].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!aa(e, b)), m = o === 0 ? null : ms(u, t, o), y = (b) => b.collection === e.collection && b.item_id === e.item_id, N = (b) => y(b) ? n === "m2o" ? {
|
|
1673
1675
|
...b,
|
|
1674
1676
|
extra_ids: { ...b.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
|
|
1675
1677
|
} : { ...b, extra: { ...b.extra ?? {}, [t]: r } } : b;
|
|
@@ -1684,11 +1686,11 @@ function Ld({
|
|
|
1684
1686
|
next: m ? s(m) : null,
|
|
1685
1687
|
optimistic: () => {
|
|
1686
1688
|
const b = f.getQueriesData({ queryKey: ["queue-items", l] });
|
|
1687
|
-
return f.setQueriesData({ queryKey: ["queue-items", l] }, (
|
|
1688
|
-
const v =
|
|
1689
|
-
return Array.isArray(v == null ? void 0 : v.data) ? { ...v, data: v.data.map(N) } : Array.isArray(v == null ? void 0 : v.rows) ? { ...v, rows: v.rows.map(N) } :
|
|
1689
|
+
return f.setQueriesData({ queryKey: ["queue-items", l] }, (A) => {
|
|
1690
|
+
const v = A;
|
|
1691
|
+
return Array.isArray(v == null ? void 0 : v.data) ? { ...v, data: v.data.map(N) } : Array.isArray(v == null ? void 0 : v.rows) ? { ...v, rows: v.rows.map(N) } : A;
|
|
1690
1692
|
}), () => {
|
|
1691
|
-
for (const [
|
|
1693
|
+
for (const [A, v] of b) f.setQueryData(A, v);
|
|
1692
1694
|
};
|
|
1693
1695
|
},
|
|
1694
1696
|
// Labels, rollups and the row's place in the queue follow the server.
|
|
@@ -1699,22 +1701,22 @@ function Ld({
|
|
|
1699
1701
|
if (!r) return n;
|
|
1700
1702
|
const o = Vn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
|
|
1701
1703
|
return /* @__PURE__ */ a(
|
|
1702
|
-
|
|
1704
|
+
fi,
|
|
1703
1705
|
{
|
|
1704
1706
|
controller: ra,
|
|
1705
|
-
cellKey: `${
|
|
1707
|
+
cellKey: `${F(e)}|${t}`,
|
|
1706
1708
|
kind: r,
|
|
1707
1709
|
value: la(e, t, r),
|
|
1708
|
-
label:
|
|
1710
|
+
label: T(`extra.${t}`, Ve(t)),
|
|
1709
1711
|
choices: s ? ds(s) : void 0,
|
|
1710
1712
|
target: r === "m2o" && o ? cs(o.relations, e.collection, t) : null,
|
|
1711
1713
|
onCommit: (u, m) => Hl(e, t, r, u, m),
|
|
1712
1714
|
children: n
|
|
1713
1715
|
}
|
|
1714
1716
|
);
|
|
1715
|
-
}, Yl =
|
|
1717
|
+
}, Yl = Ft.map((e) => ({
|
|
1716
1718
|
key: `extra.${e}`,
|
|
1717
|
-
header:
|
|
1719
|
+
header: T(`extra.${e}`, Ve(e)),
|
|
1718
1720
|
sortable: !0,
|
|
1719
1721
|
render: (t) => Jl(t, e, zl(t, e))
|
|
1720
1722
|
}));
|
|
@@ -1723,8 +1725,8 @@ function Ld({
|
|
|
1723
1725
|
{
|
|
1724
1726
|
const o = (n = e.extra) == null ? void 0 : n[t];
|
|
1725
1727
|
if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
1726
|
-
const s =
|
|
1727
|
-
return (u == null ? void 0 : u.kind) === "relation" && u.target_collection && b.length > 0 &&
|
|
1728
|
+
const s = Ne(t), u = ((c == null ? void 0 : c.extra_field_meta) ?? []).find((v) => v.path === t), m = s ? Ue(String(o), s) : Dt(u, String(o)), { text: y, title: N } = Il(m), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], A = Ql(t);
|
|
1729
|
+
return (u == null ? void 0 : u.kind) === "relation" && u.target_collection && b.length > 0 && A.enabled && !u.aggregate ? /* @__PURE__ */ a(
|
|
1728
1730
|
"button",
|
|
1729
1731
|
{
|
|
1730
1732
|
type: "button",
|
|
@@ -1732,8 +1734,8 @@ function Ld({
|
|
|
1732
1734
|
v.stopPropagation(), ta({
|
|
1733
1735
|
collection: u.target_collection,
|
|
1734
1736
|
itemId: b[0],
|
|
1735
|
-
layoutId:
|
|
1736
|
-
width:
|
|
1737
|
+
layoutId: A.layout_id,
|
|
1738
|
+
width: A.width,
|
|
1737
1739
|
title: m
|
|
1738
1740
|
});
|
|
1739
1741
|
},
|
|
@@ -1746,7 +1748,7 @@ function Ld({
|
|
|
1746
1748
|
{
|
|
1747
1749
|
type: "button",
|
|
1748
1750
|
onClick: (v) => {
|
|
1749
|
-
v.stopPropagation(),
|
|
1751
|
+
v.stopPropagation(), wn({ row: e, path: t, value: m });
|
|
1750
1752
|
},
|
|
1751
1753
|
title: "Show the rows behind this number",
|
|
1752
1754
|
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",
|
|
@@ -1763,44 +1765,44 @@ function Ld({
|
|
|
1763
1765
|
"state_entered",
|
|
1764
1766
|
"sla_status",
|
|
1765
1767
|
"at_risk",
|
|
1766
|
-
...
|
|
1767
|
-
...
|
|
1768
|
-
|
|
1769
|
-
...
|
|
1768
|
+
...rt ? ["addendums"] : [],
|
|
1769
|
+
...yt ? ["fulfilment"] : [],
|
|
1770
|
+
...qe ? ["integrations"] : [],
|
|
1771
|
+
...kt ? ["send_backs"] : [],
|
|
1770
1772
|
...Ar ? ["tasks"] : [],
|
|
1771
|
-
...
|
|
1773
|
+
...Ft.map((e) => `extra.${e}`)
|
|
1772
1774
|
], Xl = [
|
|
1773
1775
|
...Qn ? ["collection"] : [],
|
|
1774
1776
|
"state",
|
|
1775
1777
|
"owners",
|
|
1776
|
-
...
|
|
1777
|
-
...
|
|
1778
|
-
|
|
1779
|
-
...
|
|
1778
|
+
...rt ? ["addendums"] : [],
|
|
1779
|
+
...yt ? ["fulfilment"] : [],
|
|
1780
|
+
...qe ? ["integrations"] : [],
|
|
1781
|
+
...kt ? ["send_backs"] : [],
|
|
1780
1782
|
"aging_hours",
|
|
1781
1783
|
"sla_status",
|
|
1782
1784
|
"at_risk",
|
|
1783
|
-
...
|
|
1784
|
-
], Zl = (p == null ? void 0 : p.default_columns) ?? null, In =
|
|
1785
|
-
|
|
1785
|
+
...Ft.slice(0, 2).map((e) => `extra.${e}`)
|
|
1786
|
+
], Zl = (p == null ? void 0 : p.default_columns) ?? null, In = xt ?? Zl, re = new Set(In ?? Xl);
|
|
1787
|
+
rt && !Mt.has("addendums") && re.add("addendums"), yt && !Mt.has("fulfilment") && re.add("fulfilment"), qe && !Mt.has("integrations") && re.add("integrations"), kt && !Mt.has("send_backs") && re.add("send_backs");
|
|
1786
1788
|
const eo = new Set(Me ? [] : (p == null ? void 0 : p.admin_only_columns) ?? []);
|
|
1787
1789
|
for (const e of eo) re.delete(e);
|
|
1788
|
-
const
|
|
1790
|
+
const Lt = [
|
|
1789
1791
|
...(In ?? []).filter((e) => oa.includes(e)),
|
|
1790
1792
|
...oa.filter((e) => !(In ?? []).includes(e))
|
|
1791
1793
|
], to = po(bo(ho, { activationConstraint: { distance: 4 } }));
|
|
1792
1794
|
function no(e) {
|
|
1793
1795
|
const { active: t, over: n } = e;
|
|
1794
1796
|
if (!n || t.id === n.id) return;
|
|
1795
|
-
const r =
|
|
1796
|
-
r === -1 || o === -1 ||
|
|
1797
|
-
ko(
|
|
1797
|
+
const r = Lt.indexOf(String(t.id)), o = Lt.indexOf(String(n.id));
|
|
1798
|
+
r === -1 || o === -1 || Ht(
|
|
1799
|
+
ko(Lt, r, o).filter((s) => re.has(s))
|
|
1798
1800
|
);
|
|
1799
1801
|
}
|
|
1800
1802
|
const sa = ea.find((e) => e.key === "label"), ro = {
|
|
1801
1803
|
...sa,
|
|
1802
1804
|
render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
1803
|
-
/* @__PURE__ */ a(
|
|
1805
|
+
/* @__PURE__ */ a(Ys, { rowId: e.item_id }),
|
|
1804
1806
|
sa.render(e, ...t)
|
|
1805
1807
|
] })
|
|
1806
1808
|
}, ao = ((p == null ? void 0 : p.formula_columns) ?? []).map(
|
|
@@ -1820,8 +1822,8 @@ function Ld({
|
|
|
1820
1822
|
return Number.isFinite(o) ? /* @__PURE__ */ a("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ a("span", { children: String(r) });
|
|
1821
1823
|
}
|
|
1822
1824
|
})
|
|
1823
|
-
), Gn = [...ea, ...Yl, ...ao], ia =
|
|
1824
|
-
|
|
1825
|
+
), Gn = [...ea, ...Yl, ...ao], ia = Fi(
|
|
1826
|
+
Lt,
|
|
1825
1827
|
(e) => {
|
|
1826
1828
|
var n;
|
|
1827
1829
|
const t = (n = Gn.find((r) => r.key === e)) == null ? void 0 : n.header;
|
|
@@ -1831,30 +1833,30 @@ function Ld({
|
|
|
1831
1833
|
), lo = {
|
|
1832
1834
|
key: "__actions__",
|
|
1833
1835
|
header: "",
|
|
1834
|
-
render: (e) => e.collection === "tasks" || e.collection ===
|
|
1835
|
-
|
|
1836
|
+
render: (e) => e.collection === "tasks" || e.collection === sn ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
|
|
1837
|
+
Zs,
|
|
1836
1838
|
{
|
|
1837
1839
|
collection: e.collection,
|
|
1838
1840
|
id: e.item_id,
|
|
1839
1841
|
label: e.label,
|
|
1840
1842
|
hasPipeline: e.state != null,
|
|
1841
|
-
onOpen: () =>
|
|
1843
|
+
onOpen: () => lt(e),
|
|
1842
1844
|
onPeek: () => Pe(e),
|
|
1843
1845
|
urlFor: Y.urlFor,
|
|
1844
1846
|
onDeleted: () => {
|
|
1845
1847
|
h.request(zn(`/items/${e.collection}/${e.item_id}`)).then(() => {
|
|
1846
|
-
|
|
1847
|
-
}).catch((t) =>
|
|
1848
|
+
E.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
1849
|
+
}).catch((t) => E.error(dt(t, "Delete failed")));
|
|
1848
1850
|
},
|
|
1849
1851
|
onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
1850
1852
|
bulkEnabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
|
|
1851
1853
|
disabled: ne
|
|
1852
1854
|
}
|
|
1853
1855
|
) })
|
|
1854
|
-
},
|
|
1856
|
+
}, Tt = [
|
|
1855
1857
|
ro,
|
|
1856
|
-
...
|
|
1857
|
-
...
|
|
1858
|
+
...Lt.filter((e) => re.has(e)).map((e) => Gn.find((t) => t.key === e)).filter((e) => e !== void 0),
|
|
1859
|
+
...ge ? [Bl] : [],
|
|
1858
1860
|
lo
|
|
1859
1861
|
], [Wn, ca] = w(!1);
|
|
1860
1862
|
async function oo() {
|
|
@@ -1864,40 +1866,40 @@ function Ld({
|
|
|
1864
1866
|
const t = [];
|
|
1865
1867
|
for (let m = 1; t.length < 1e4; m++) {
|
|
1866
1868
|
const y = await h.request(
|
|
1867
|
-
|
|
1869
|
+
O(`/queues/${l}/items`, {
|
|
1868
1870
|
scope: g,
|
|
1869
1871
|
sort: B === "state_entered" ? "-aging_hours" : B === "-state_entered" ? "aging_hours" : B,
|
|
1870
|
-
filters: JSON.stringify(
|
|
1872
|
+
filters: JSON.stringify(xe),
|
|
1871
1873
|
page: m,
|
|
1872
1874
|
limit: 100
|
|
1873
1875
|
})
|
|
1874
1876
|
), N = y.data ?? [];
|
|
1875
1877
|
if (t.push(...N), N.length < 100 || t.length >= (y.total ?? 0)) break;
|
|
1876
1878
|
}
|
|
1877
|
-
const n = (m) => (c.extra_field_meta ?? []).find((y) => y.path === m), r =
|
|
1879
|
+
const n = (m) => (c.extra_field_meta ?? []).find((y) => y.path === m), r = Vi(
|
|
1878
1880
|
t.slice(0, 1e4),
|
|
1879
|
-
|
|
1881
|
+
Tt.map((m) => ({
|
|
1880
1882
|
key: m.key,
|
|
1881
1883
|
header: typeof m.header == "string" ? m.header : m.key === "label" ? "Item" : ""
|
|
1882
1884
|
})),
|
|
1883
1885
|
{
|
|
1884
|
-
stateLabel:
|
|
1885
|
-
collectionLabel:
|
|
1886
|
+
stateLabel: Fe,
|
|
1887
|
+
collectionLabel: at,
|
|
1886
1888
|
extraText: (m, y) => {
|
|
1887
|
-
const N =
|
|
1888
|
-
return N && N.type !== "number" ? Ue(y, N) :
|
|
1889
|
+
const N = Ne(m);
|
|
1890
|
+
return N && N.type !== "number" ? Ue(y, N) : Dt(n(m), y);
|
|
1889
1891
|
},
|
|
1890
1892
|
extraIsNumber: (m) => {
|
|
1891
1893
|
var y;
|
|
1892
|
-
return ((y =
|
|
1894
|
+
return ((y = Ne(m)) == null ? void 0 : y.type) === "number";
|
|
1893
1895
|
}
|
|
1894
1896
|
}
|
|
1895
1897
|
), o = new Blob([r], { type: "text/csv;charset=utf-8" }), s = URL.createObjectURL(o), u = document.createElement("a");
|
|
1896
|
-
u.href = s, u.download =
|
|
1898
|
+
u.href = s, u.download = Ii(c.name), document.body.appendChild(u), u.click(), u.remove(), setTimeout(() => URL.revokeObjectURL(s), 1e3), E.success(
|
|
1897
1899
|
t.length >= 1e4 ? `Exported the first ${1e4.toLocaleString("en-US")} rows` : `Exported ${t.length.toLocaleString("en-US")} ${t.length === 1 ? "row" : "rows"}`
|
|
1898
1900
|
);
|
|
1899
1901
|
} catch (e) {
|
|
1900
|
-
|
|
1902
|
+
E.error(dt(e, "Could not export this worklist"));
|
|
1901
1903
|
} finally {
|
|
1902
1904
|
ca(!1);
|
|
1903
1905
|
}
|
|
@@ -1905,16 +1907,16 @@ function Ld({
|
|
|
1905
1907
|
}
|
|
1906
1908
|
const da = J(() => {
|
|
1907
1909
|
var r;
|
|
1908
|
-
const e = p == null ? void 0 : p.default_pins, t = We ?? (e && Object.keys(e).length > 0 ? e : { [((r =
|
|
1910
|
+
const e = p == null ? void 0 : p.default_pins, t = We ?? (e && Object.keys(e).length > 0 ? e : { [((r = Tt[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(Tt.map((o) => o.key));
|
|
1909
1911
|
return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
|
|
1910
|
-
}, [We, p == null ? void 0 : p.default_pins,
|
|
1912
|
+
}, [We, p == null ? void 0 : p.default_pins, Tt.map((e) => e.key).join("|")]), ua = [
|
|
1911
1913
|
{ value: "state", label: "State" },
|
|
1912
1914
|
{ value: "collection", label: "Collection" },
|
|
1913
1915
|
{ value: "sla_status", label: "SLA status" },
|
|
1914
1916
|
{ value: "at_risk", label: "At risk" },
|
|
1915
1917
|
{ value: "owners", label: "Owner" },
|
|
1916
1918
|
{ value: "aging", label: "Aging" },
|
|
1917
|
-
...
|
|
1919
|
+
...Ft.filter((e) => re.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: T(`extra.${e}`, Ve(e)) }))
|
|
1918
1920
|
], ma = (e) => async (t, n) => {
|
|
1919
1921
|
if (!e.target_collection || !e.display_field) return [];
|
|
1920
1922
|
const r = {
|
|
@@ -1923,10 +1925,10 @@ function Ld({
|
|
|
1923
1925
|
// Records hidden from pickers (a retired zone) are not offered.
|
|
1924
1926
|
picker: "1"
|
|
1925
1927
|
}, o = (n == null ? void 0 : n.narrowBy) ?? [], s = [];
|
|
1926
|
-
for (const [
|
|
1927
|
-
if (
|
|
1928
|
-
const H =
|
|
1929
|
-
!(H != null && H.target_collection) || !H.display_field || o.some((
|
|
1928
|
+
for (const [q, V] of Object.entries(he)) {
|
|
1929
|
+
if (q === e.path || V.length === 0) continue;
|
|
1930
|
+
const H = an.get(q);
|
|
1931
|
+
!(H != null && H.target_collection) || !H.display_field || o.some((ln) => ln.collection === H.target_collection) || s.push({ collection: H.target_collection, field: H.display_field, values: V });
|
|
1930
1932
|
}
|
|
1931
1933
|
const u = [...o, ...s], m = u.length ? Ts(
|
|
1932
1934
|
e.target_collection,
|
|
@@ -1938,39 +1940,39 @@ function Ld({
|
|
|
1938
1940
|
];
|
|
1939
1941
|
y.length > 0 && (r.filter = JSON.stringify(y.length === 1 ? y[0] : { _and: y }));
|
|
1940
1942
|
const b = (await h.request(
|
|
1941
|
-
|
|
1942
|
-
)).data ?? [],
|
|
1943
|
-
for (const
|
|
1944
|
-
const V =
|
|
1943
|
+
O(`/items/${e.target_collection}`, r)
|
|
1944
|
+
)).data ?? [], A = Ne(e.path), v = he[e.path] ? new Set(he[e.path]) : null, ae = /* @__PURE__ */ new Set(), pe = [];
|
|
1945
|
+
for (const q of b) {
|
|
1946
|
+
const V = q[e.display_field];
|
|
1945
1947
|
if (V == null || V === "") continue;
|
|
1946
1948
|
const H = String(V);
|
|
1947
|
-
ae.has(H) || v && !v.has(H) || (ae.add(H),
|
|
1949
|
+
ae.has(H) || v && !v.has(H) || (ae.add(H), pe.push({ label: A ? Ue(H, A) : H, value: H }));
|
|
1948
1950
|
}
|
|
1949
|
-
return
|
|
1950
|
-
},
|
|
1951
|
+
return pe;
|
|
1952
|
+
}, an = new Map(((c == null ? void 0 : c.extra_field_meta) ?? []).map((e) => [e.path, e])), Qe = [
|
|
1951
1953
|
{
|
|
1952
1954
|
key: "collection",
|
|
1953
|
-
placeholder:
|
|
1955
|
+
placeholder: T("collection", "Collection"),
|
|
1954
1956
|
type: "combobox",
|
|
1955
1957
|
multi: !0,
|
|
1956
1958
|
options: ((i == null ? void 0 : i.available_values.collection) ?? []).map((e) => ({
|
|
1957
|
-
label:
|
|
1959
|
+
label: at(e),
|
|
1958
1960
|
value: e
|
|
1959
1961
|
}))
|
|
1960
1962
|
},
|
|
1961
1963
|
{
|
|
1962
1964
|
key: "state",
|
|
1963
|
-
placeholder:
|
|
1965
|
+
placeholder: T("state", "State"),
|
|
1964
1966
|
type: "combobox",
|
|
1965
1967
|
multi: !0,
|
|
1966
1968
|
// Until the rows land, the pipeline's own states (no counts yet) rather
|
|
1967
1969
|
// than an empty list.
|
|
1968
1970
|
options: Mr(
|
|
1969
|
-
i ? i.available_values.state ?? [] : Object.keys(
|
|
1971
|
+
i ? i.available_values.state ?? [] : Object.keys(Re)
|
|
1970
1972
|
).map((e) => {
|
|
1971
1973
|
var t;
|
|
1972
1974
|
return {
|
|
1973
|
-
label:
|
|
1975
|
+
label: Fe(e),
|
|
1974
1976
|
value: e,
|
|
1975
1977
|
// How many rows sit in it under the other active filters (the State
|
|
1976
1978
|
// filter itself left out, or every other state would read 0).
|
|
@@ -2007,11 +2009,11 @@ function Ld({
|
|
|
2007
2009
|
] : [],
|
|
2008
2010
|
{
|
|
2009
2011
|
key: "aging_hours",
|
|
2010
|
-
placeholder:
|
|
2012
|
+
placeholder: T("aging_hours", "Aging (hours)"),
|
|
2011
2013
|
type: "range",
|
|
2012
2014
|
range_unit: "h"
|
|
2013
2015
|
},
|
|
2014
|
-
...
|
|
2016
|
+
...rt ? [
|
|
2015
2017
|
{
|
|
2016
2018
|
key: "addendums",
|
|
2017
2019
|
placeholder: "Addendums",
|
|
@@ -2024,23 +2026,23 @@ function Ld({
|
|
|
2024
2026
|
] : [],
|
|
2025
2027
|
// #630 — integration partners; the queue read model filters on it
|
|
2026
2028
|
// (live path in memory, materialized cache in SQL).
|
|
2027
|
-
|
|
2029
|
+
...qe ? [
|
|
2028
2030
|
{
|
|
2029
2031
|
key: "integrations",
|
|
2030
|
-
placeholder:
|
|
2032
|
+
placeholder: T("integrations", "Integrations"),
|
|
2031
2033
|
type: "select",
|
|
2032
|
-
options:
|
|
2034
|
+
options: ii.map((e) => ({ label: e.label, value: e.value }))
|
|
2033
2035
|
}
|
|
2034
2036
|
] : [],
|
|
2035
|
-
...
|
|
2037
|
+
...yt ? [
|
|
2036
2038
|
{
|
|
2037
2039
|
key: "fulfilment",
|
|
2038
2040
|
placeholder: "Shipped",
|
|
2039
2041
|
type: "select",
|
|
2040
|
-
options:
|
|
2042
|
+
options: li
|
|
2041
2043
|
}
|
|
2042
2044
|
] : [],
|
|
2043
|
-
...
|
|
2045
|
+
...kt ? [
|
|
2044
2046
|
{
|
|
2045
2047
|
key: "send_backs",
|
|
2046
2048
|
placeholder: "Sent back",
|
|
@@ -2052,27 +2054,27 @@ function Ld({
|
|
|
2052
2054
|
]
|
|
2053
2055
|
}
|
|
2054
2056
|
] : [],
|
|
2055
|
-
...
|
|
2057
|
+
...Nn.length > 0 ? [
|
|
2056
2058
|
{
|
|
2057
2059
|
key: "labels",
|
|
2058
2060
|
placeholder: "Triage label",
|
|
2059
2061
|
type: "combobox",
|
|
2060
2062
|
multi: !0,
|
|
2061
|
-
options:
|
|
2063
|
+
options: Nn.map((e) => ({ label: e, value: e }))
|
|
2062
2064
|
}
|
|
2063
2065
|
] : [],
|
|
2064
2066
|
{
|
|
2065
2067
|
key: "label",
|
|
2066
|
-
placeholder:
|
|
2068
|
+
placeholder: T("label", "Item"),
|
|
2067
2069
|
type: "combobox",
|
|
2068
2070
|
multi: !0,
|
|
2069
2071
|
loadOptions: async (e) => ((await h.request(
|
|
2070
|
-
|
|
2072
|
+
O(`/queues/${l}/label-suggest`, e.trim() ? { q: e.trim() } : {})
|
|
2071
2073
|
)).data ?? []).map((n) => ({ label: n, value: n }))
|
|
2072
2074
|
},
|
|
2073
2075
|
{
|
|
2074
2076
|
key: "owners",
|
|
2075
|
-
placeholder:
|
|
2077
|
+
placeholder: T("owners", "Owners"),
|
|
2076
2078
|
type: "combobox",
|
|
2077
2079
|
multi: !0,
|
|
2078
2080
|
options: ((i == null ? void 0 : i.available_values.owners) ?? []).map((e) => ({
|
|
@@ -2081,9 +2083,9 @@ function Ld({
|
|
|
2081
2083
|
value: e.id
|
|
2082
2084
|
}))
|
|
2083
2085
|
},
|
|
2084
|
-
...
|
|
2086
|
+
...Ft.map((e) => {
|
|
2085
2087
|
var u, m, y;
|
|
2086
|
-
const t =
|
|
2088
|
+
const t = an.get(e), n = T(`extra.${e}`, Ve(e)), r = { key: `extra.${e}`, placeholder: n }, o = Ne(e);
|
|
2087
2089
|
if ((o == null ? void 0 : o.type) === "datetime") return { ...r, type: "date" };
|
|
2088
2090
|
if ((o == null ? void 0 : o.type) === "number") return { ...r, type: "number" };
|
|
2089
2091
|
if ((o == null ? void 0 : o.type) === "boolean")
|
|
@@ -2102,16 +2104,16 @@ function Ld({
|
|
|
2102
2104
|
multi: !0,
|
|
2103
2105
|
// The "your access" mark follows the person's restriction on every tab,
|
|
2104
2106
|
// not only on an empty one (army 11 Q2-1).
|
|
2105
|
-
restricted: !!((m =
|
|
2107
|
+
restricted: !!((m = he[e]) != null && m.length),
|
|
2106
2108
|
options: s.map((N) => ({
|
|
2107
|
-
label: o ? Ue(N, o) :
|
|
2109
|
+
label: o ? Ue(N, o) : Dt(t, N),
|
|
2108
2110
|
value: N
|
|
2109
2111
|
}))
|
|
2110
2112
|
} : (t == null ? void 0 : t.kind) === "relation" ? {
|
|
2111
2113
|
...r,
|
|
2112
2114
|
type: "combobox",
|
|
2113
2115
|
multi: !0,
|
|
2114
|
-
restricted: !!((y =
|
|
2116
|
+
restricted: !!((y = he[e]) != null && y.length),
|
|
2115
2117
|
loadOptions: ma(t)
|
|
2116
2118
|
} : { ...r, placeholder: `Search ${n}…`, type: "text" };
|
|
2117
2119
|
})
|
|
@@ -2125,13 +2127,13 @@ function Ld({
|
|
|
2125
2127
|
const e = [];
|
|
2126
2128
|
for (const [o, s] of Object.entries(Oe)) {
|
|
2127
2129
|
if (!s || Array.isArray(s) && s.length === 0) continue;
|
|
2128
|
-
const u = Qe.find((b) => b.key === o), m = o.startsWith("extra.") ? o.slice(6) : null, y = m ?
|
|
2130
|
+
const u = Qe.find((b) => b.key === o), m = o.startsWith("extra.") ? o.slice(6) : null, y = m ? Ne(m) : null, N = es({
|
|
2129
2131
|
field: Jn(o),
|
|
2130
2132
|
type: (u == null ? void 0 : u.type) ?? "select",
|
|
2131
2133
|
value: s,
|
|
2132
2134
|
optionLabel: (b) => {
|
|
2133
|
-
var
|
|
2134
|
-
return (v = (
|
|
2135
|
+
var A, v;
|
|
2136
|
+
return (v = (A = u == null ? void 0 : u.options) == null ? void 0 : A.find((ae) => ae.value === b)) == null ? void 0 : v.label;
|
|
2135
2137
|
},
|
|
2136
2138
|
currency: (y == null ? void 0 : y.type) === "number" && y.prefix === "$",
|
|
2137
2139
|
rangeUnit: u == null ? void 0 : u.range_unit
|
|
@@ -2142,12 +2144,12 @@ function Ld({
|
|
|
2142
2144
|
return ts({
|
|
2143
2145
|
noun: "items",
|
|
2144
2146
|
scope: g === "mine" ? "you own" : g === "unowned" ? "with no owners" : g === "claimed" ? "you claimed" : null,
|
|
2145
|
-
viewName: ((r = (n = G == null ? void 0 : G.data) == null ? void 0 : n.find((o) => o.id ===
|
|
2147
|
+
viewName: ((r = (n = G == null ? void 0 : G.data) == null ? void 0 : n.find((o) => o.id === ot)) == null ? void 0 : r.name) ?? null,
|
|
2146
2148
|
clauses: e,
|
|
2147
2149
|
shown: typeof t == "number" ? t : null,
|
|
2148
2150
|
of: (x == null ? void 0 : x.total) ?? null
|
|
2149
2151
|
});
|
|
2150
|
-
})(),
|
|
2152
|
+
})(), At = new Set(Object.keys(fe.current)), so = ((e) => {
|
|
2151
2153
|
var n;
|
|
2152
2154
|
if (e.some((r) => r.key === "state")) return e;
|
|
2153
2155
|
const t = Qe.find((r) => r.key === "state");
|
|
@@ -2156,30 +2158,30 @@ function Ld({
|
|
|
2156
2158
|
(() => {
|
|
2157
2159
|
var o;
|
|
2158
2160
|
const e = (s) => {
|
|
2159
|
-
var ae,
|
|
2161
|
+
var ae, pe, q;
|
|
2160
2162
|
if (!s.key.startsWith("extra.")) return null;
|
|
2161
2163
|
if (s.type === "combobox") return s;
|
|
2162
|
-
const u = s.key.slice(6), m =
|
|
2164
|
+
const u = s.key.slice(6), m = an.get(u), y = At.has(s.key);
|
|
2163
2165
|
if ((m == null ? void 0 : m.kind) !== "relation" && !y) return null;
|
|
2164
|
-
const N =
|
|
2166
|
+
const N = Ne(u), b = (ae = i == null ? void 0 : i.available_values.extra) == null ? void 0 : ae[u], A = s.placeholder.replace(/^Search (.*)…$/, "$1"), v = (m == null ? void 0 : m.kind) === "relation" && m.target_collection && m.display_field ? { collection: m.target_collection, field: m.display_field } : void 0;
|
|
2165
2167
|
return b != null && b.length ? {
|
|
2166
2168
|
key: s.key,
|
|
2167
|
-
placeholder:
|
|
2169
|
+
placeholder: A,
|
|
2168
2170
|
type: "combobox",
|
|
2169
2171
|
multi: !0,
|
|
2170
2172
|
cascade: v,
|
|
2171
|
-
restricted: !!((
|
|
2173
|
+
restricted: !!((pe = he[u]) != null && pe.length),
|
|
2172
2174
|
options: b.map((V) => ({
|
|
2173
|
-
label: N && N.type !== "number" ? Ue(V, N) :
|
|
2175
|
+
label: N && N.type !== "number" ? Ue(V, N) : Dt(m, V),
|
|
2174
2176
|
value: V
|
|
2175
2177
|
}))
|
|
2176
2178
|
} : (m == null ? void 0 : m.kind) === "relation" ? {
|
|
2177
2179
|
key: s.key,
|
|
2178
|
-
placeholder:
|
|
2180
|
+
placeholder: A,
|
|
2179
2181
|
type: "combobox",
|
|
2180
2182
|
multi: !0,
|
|
2181
2183
|
cascade: v,
|
|
2182
|
-
restricted: !!((
|
|
2184
|
+
restricted: !!((q = he[u]) != null && q.length),
|
|
2183
2185
|
loadOptions: ma(m)
|
|
2184
2186
|
} : null;
|
|
2185
2187
|
};
|
|
@@ -2192,22 +2194,22 @@ function Ld({
|
|
|
2192
2194
|
N = Qe.find((b) => b.key === "state");
|
|
2193
2195
|
else {
|
|
2194
2196
|
const b = Qe.filter((v) => {
|
|
2195
|
-
var
|
|
2197
|
+
var pe;
|
|
2196
2198
|
if (!v.key.startsWith("extra.") || u.has(v.key)) return !1;
|
|
2197
2199
|
const ae = v.key.slice(6);
|
|
2198
|
-
return ((
|
|
2199
|
-
}),
|
|
2200
|
-
N =
|
|
2200
|
+
return ((pe = an.get(ae)) == null ? void 0 : pe.target_collection) === m.collection;
|
|
2201
|
+
}), A = b.find((v) => v.key.slice(6).startsWith(`${y}.`)) ?? b[0];
|
|
2202
|
+
N = A ? e(A) : null;
|
|
2201
2203
|
}
|
|
2202
2204
|
!N || u.has(N.key) || (u.add(N.key), s.push(m.label ? { ...N, placeholder: m.label } : N));
|
|
2203
2205
|
}
|
|
2204
2206
|
for (const m of Qe.map(e))
|
|
2205
|
-
m && !u.has(m.key) && (
|
|
2207
|
+
m && !u.has(m.key) && (At.has(m.key) || m.restricted) && s.push(m);
|
|
2206
2208
|
if (s.length > 0) return s;
|
|
2207
2209
|
}
|
|
2208
2210
|
const t = Hn.map(e).filter((s) => s !== null), r = [
|
|
2209
|
-
...t.filter((s) =>
|
|
2210
|
-
...t.filter((s) => !
|
|
2211
|
+
...t.filter((s) => At.has(s.key) || s.restricted),
|
|
2212
|
+
...t.filter((s) => !At.has(s.key) && !s.restricted)
|
|
2211
2213
|
].slice(0, 6);
|
|
2212
2214
|
return r.length > 0 ? r : Hn.filter((s) => s.key === "state" || s.key === "owners");
|
|
2213
2215
|
})()
|
|
@@ -2220,7 +2222,7 @@ function Ld({
|
|
|
2220
2222
|
label: "past SLA",
|
|
2221
2223
|
tone: "text-red-600 dark:text-red-400",
|
|
2222
2224
|
on: _.sla_status === "breached",
|
|
2223
|
-
toggle: () =>
|
|
2225
|
+
toggle: () => Ye("sla_status", "breached")
|
|
2224
2226
|
},
|
|
2225
2227
|
{
|
|
2226
2228
|
key: "warning",
|
|
@@ -2228,7 +2230,7 @@ function Ld({
|
|
|
2228
2230
|
label: "SLA soon",
|
|
2229
2231
|
tone: "text-amber-700 dark:text-amber-400",
|
|
2230
2232
|
on: _.sla_status === "warning",
|
|
2231
|
-
toggle: () =>
|
|
2233
|
+
toggle: () => Ye("sla_status", "warning")
|
|
2232
2234
|
},
|
|
2233
2235
|
{
|
|
2234
2236
|
key: "at_risk",
|
|
@@ -2236,7 +2238,7 @@ function Ld({
|
|
|
2236
2238
|
label: "at risk",
|
|
2237
2239
|
tone: "text-red-600 dark:text-red-400",
|
|
2238
2240
|
on: _.at_risk === "yes",
|
|
2239
|
-
toggle: () =>
|
|
2241
|
+
toggle: () => Ye("at_risk", "yes")
|
|
2240
2242
|
},
|
|
2241
2243
|
{
|
|
2242
2244
|
key: "unowned",
|
|
@@ -2261,13 +2263,13 @@ function Ld({
|
|
|
2261
2263
|
type: "button",
|
|
2262
2264
|
onClick: n.toggle,
|
|
2263
2265
|
"aria-pressed": n.on,
|
|
2264
|
-
className:
|
|
2266
|
+
className: L(
|
|
2265
2267
|
"rounded px-1 tabular-nums hover:bg-slate-100 dark:hover:bg-slate-800",
|
|
2266
2268
|
n.on && "bg-slate-100 dark:bg-slate-800"
|
|
2267
2269
|
),
|
|
2268
2270
|
"data-queue-summary-item": n.key,
|
|
2269
2271
|
children: [
|
|
2270
|
-
/* @__PURE__ */ a("span", { className:
|
|
2272
|
+
/* @__PURE__ */ a("span", { className: L("font-semibold", n.tone), children: n.n.toLocaleString() }),
|
|
2271
2273
|
" ",
|
|
2272
2274
|
n.label
|
|
2273
2275
|
]
|
|
@@ -2288,9 +2290,9 @@ function Ld({
|
|
|
2288
2290
|
t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && nr((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && nr((n) => {
|
|
2289
2291
|
const r = new Set(n);
|
|
2290
2292
|
return r.delete(e), r;
|
|
2291
|
-
})),
|
|
2293
|
+
})), Ht([...t]);
|
|
2292
2294
|
}
|
|
2293
|
-
return
|
|
2295
|
+
return jt ? (D == null ? void 0 : D((jt == null ? void 0 : jt.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
|
|
2294
2296
|
/* @__PURE__ */ d("div", { className: "shrink-0", children: [
|
|
2295
2297
|
(i == null ? void 0 : i.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
|
|
2296
2298
|
/* @__PURE__ */ a(No, { className: "h-4 w-4 shrink-0" }),
|
|
@@ -2302,7 +2304,7 @@ function Ld({
|
|
|
2302
2304
|
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",
|
|
2303
2305
|
"data-queue-toolbar": !0,
|
|
2304
2306
|
children: [
|
|
2305
|
-
z ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children:
|
|
2307
|
+
z ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: Ji.filter((e) => ge || e.value !== "claimed").map(
|
|
2306
2308
|
(e, t) => /* @__PURE__ */ a(
|
|
2307
2309
|
"button",
|
|
2308
2310
|
{
|
|
@@ -2310,7 +2312,7 @@ function Ld({
|
|
|
2310
2312
|
onClick: () => {
|
|
2311
2313
|
te(e.value), K(1);
|
|
2312
2314
|
},
|
|
2313
|
-
className:
|
|
2315
|
+
className: L(
|
|
2314
2316
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
2315
2317
|
t > 0 && "border-l border-slate-200 dark:border-border",
|
|
2316
2318
|
g === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
|
|
@@ -2331,7 +2333,7 @@ function Ld({
|
|
|
2331
2333
|
{
|
|
2332
2334
|
type: "button",
|
|
2333
2335
|
onClick: () => Ie(e.value),
|
|
2334
|
-
className:
|
|
2336
|
+
className: L(
|
|
2335
2337
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
2336
2338
|
t > 0 && "border-l border-slate-200 dark:border-border",
|
|
2337
2339
|
C === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
|
|
@@ -2359,7 +2361,7 @@ function Ld({
|
|
|
2359
2361
|
]
|
|
2360
2362
|
}
|
|
2361
2363
|
),
|
|
2362
|
-
|
|
2364
|
+
rt && /* @__PURE__ */ d(
|
|
2363
2365
|
"button",
|
|
2364
2366
|
{
|
|
2365
2367
|
type: "button",
|
|
@@ -2376,10 +2378,10 @@ function Ld({
|
|
|
2376
2378
|
]
|
|
2377
2379
|
}
|
|
2378
2380
|
),
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
+
qe && /* @__PURE__ */ a(
|
|
2382
|
+
ci,
|
|
2381
2383
|
{
|
|
2382
|
-
label:
|
|
2384
|
+
label: T("integrations", "Integrations"),
|
|
2383
2385
|
value: _.integrations,
|
|
2384
2386
|
onChange: (e) => j((t) => {
|
|
2385
2387
|
const n = { ...t };
|
|
@@ -2387,9 +2389,9 @@ function Ld({
|
|
|
2387
2389
|
})
|
|
2388
2390
|
}
|
|
2389
2391
|
),
|
|
2390
|
-
/* @__PURE__ */ a(
|
|
2391
|
-
/* @__PURE__ */ a(
|
|
2392
|
-
|
|
2392
|
+
/* @__PURE__ */ a(ki, { className: "h-8" }),
|
|
2393
|
+
/* @__PURE__ */ a(ri, {}),
|
|
2394
|
+
mn > 0 && /* @__PURE__ */ d(
|
|
2393
2395
|
"button",
|
|
2394
2396
|
{
|
|
2395
2397
|
type: "button",
|
|
@@ -2397,39 +2399,39 @@ function Ld({
|
|
|
2397
2399
|
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",
|
|
2398
2400
|
children: [
|
|
2399
2401
|
/* @__PURE__ */ a(Co, { className: "h-3 w-3" }),
|
|
2400
|
-
|
|
2402
|
+
mn,
|
|
2401
2403
|
" update",
|
|
2402
|
-
|
|
2404
|
+
mn === 1 ? "" : "s",
|
|
2403
2405
|
" · Refresh"
|
|
2404
2406
|
]
|
|
2405
2407
|
}
|
|
2406
2408
|
),
|
|
2407
2409
|
/* @__PURE__ */ d("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
|
|
2408
|
-
C === "table" && /* @__PURE__ */ d(
|
|
2409
|
-
/* @__PURE__ */ a(
|
|
2410
|
+
C === "table" && /* @__PURE__ */ d(ut, { children: [
|
|
2411
|
+
/* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2410
2412
|
"button",
|
|
2411
2413
|
{
|
|
2412
2414
|
type: "button",
|
|
2413
|
-
className:
|
|
2415
|
+
className: L(
|
|
2414
2416
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2415
|
-
|
|
2417
|
+
R ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2416
2418
|
),
|
|
2417
2419
|
children: [
|
|
2418
2420
|
/* @__PURE__ */ a(Fa, { className: "h-3.5 w-3.5" }),
|
|
2419
|
-
|
|
2421
|
+
R ? `Group: ${((ya = ua.find((e) => e.value === R)) == null ? void 0 : ya.label) ?? R}` : "Group"
|
|
2420
2422
|
]
|
|
2421
2423
|
}
|
|
2422
2424
|
) }),
|
|
2423
|
-
/* @__PURE__ */ a(
|
|
2424
|
-
/* @__PURE__ */ a(
|
|
2425
|
+
/* @__PURE__ */ a(pt, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Pa, { children: [
|
|
2426
|
+
/* @__PURE__ */ a(Ci, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
|
|
2425
2427
|
/* @__PURE__ */ d(Ma, { children: [
|
|
2426
|
-
/* @__PURE__ */ a(
|
|
2427
|
-
/* @__PURE__ */ a(
|
|
2428
|
+
/* @__PURE__ */ a($i, { children: "No attribute found." }),
|
|
2429
|
+
/* @__PURE__ */ a(Ot, { value: "__none__", onSelect: () => bt(null), children: "None" }),
|
|
2428
2430
|
ua.map((e) => /* @__PURE__ */ a(
|
|
2429
|
-
|
|
2431
|
+
Ot,
|
|
2430
2432
|
{
|
|
2431
2433
|
value: e.label,
|
|
2432
|
-
onSelect: () =>
|
|
2434
|
+
onSelect: () => bt(e.value),
|
|
2433
2435
|
children: e.label
|
|
2434
2436
|
},
|
|
2435
2437
|
e.value
|
|
@@ -2444,7 +2446,7 @@ function Ld({
|
|
|
2444
2446
|
onClick: () => {
|
|
2445
2447
|
Ge(B === "-priority" ? "" : "-priority"), K(1);
|
|
2446
2448
|
},
|
|
2447
|
-
className:
|
|
2449
|
+
className: L(
|
|
2448
2450
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2449
2451
|
B === "-priority" ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2450
2452
|
),
|
|
@@ -2454,36 +2456,36 @@ function Ld({
|
|
|
2454
2456
|
]
|
|
2455
2457
|
}
|
|
2456
2458
|
),
|
|
2457
|
-
C === "table" &&
|
|
2459
|
+
C === "table" && R && se && /* @__PURE__ */ a(
|
|
2458
2460
|
"button",
|
|
2459
2461
|
{
|
|
2460
2462
|
type: "button",
|
|
2461
|
-
onClick: () =>
|
|
2462
|
-
|
|
2463
|
+
onClick: () => cn(
|
|
2464
|
+
Ce.size > 0 ? /* @__PURE__ */ new Set() : new Set(se.map((e) => e.key))
|
|
2463
2465
|
),
|
|
2464
2466
|
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",
|
|
2465
|
-
children:
|
|
2467
|
+
children: Ce.size > 0 ? "Expand all" : "Collapse all"
|
|
2466
2468
|
}
|
|
2467
2469
|
),
|
|
2468
|
-
C === "kanban" && /* @__PURE__ */ d(
|
|
2469
|
-
/* @__PURE__ */ a(
|
|
2470
|
+
C === "kanban" && /* @__PURE__ */ d(ut, { children: [
|
|
2471
|
+
/* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2470
2472
|
"button",
|
|
2471
2473
|
{
|
|
2472
2474
|
type: "button",
|
|
2473
|
-
className:
|
|
2475
|
+
className: L(
|
|
2474
2476
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2475
|
-
|
|
2477
|
+
ht ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2476
2478
|
),
|
|
2477
2479
|
children: [
|
|
2478
2480
|
/* @__PURE__ */ a(Fa, { className: "h-3.5 w-3.5" }),
|
|
2479
|
-
|
|
2481
|
+
ht ? `Lanes: ${ht === "collection" ? "Collection" : "Owner"}` : "Lanes"
|
|
2480
2482
|
]
|
|
2481
2483
|
}
|
|
2482
2484
|
) }),
|
|
2483
|
-
/* @__PURE__ */ a(
|
|
2484
|
-
/* @__PURE__ */ a(
|
|
2485
|
-
/* @__PURE__ */ a(
|
|
2486
|
-
/* @__PURE__ */ a(
|
|
2485
|
+
/* @__PURE__ */ a(pt, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(Pa, { children: /* @__PURE__ */ d(Ma, { children: [
|
|
2486
|
+
/* @__PURE__ */ a(Ot, { value: "none", onSelect: () => dn(null), children: "None" }),
|
|
2487
|
+
/* @__PURE__ */ a(Ot, { value: "collection", onSelect: () => dn("collection"), children: "Collection" }),
|
|
2488
|
+
/* @__PURE__ */ a(Ot, { value: "owner", onSelect: () => dn("owners"), children: "Owner" })
|
|
2487
2489
|
] }) }) })
|
|
2488
2490
|
] }),
|
|
2489
2491
|
Z && c && /* @__PURE__ */ d(
|
|
@@ -2500,7 +2502,7 @@ function Ld({
|
|
|
2500
2502
|
]
|
|
2501
2503
|
}
|
|
2502
2504
|
),
|
|
2503
|
-
/* @__PURE__ */ a(
|
|
2505
|
+
/* @__PURE__ */ a(bi, { listKey: `queue:${l}`, getState: Gr }),
|
|
2504
2506
|
C === "table" && /* @__PURE__ */ d(
|
|
2505
2507
|
"button",
|
|
2506
2508
|
{
|
|
@@ -2522,11 +2524,11 @@ function Ld({
|
|
|
2522
2524
|
{
|
|
2523
2525
|
type: "button",
|
|
2524
2526
|
onClick: () => el((e) => !e),
|
|
2525
|
-
"aria-expanded":
|
|
2527
|
+
"aria-expanded": ft,
|
|
2526
2528
|
title: "Trends, aging, pace and states",
|
|
2527
|
-
className:
|
|
2529
|
+
className: L(
|
|
2528
2530
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2529
|
-
|
|
2531
|
+
ft ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2530
2532
|
),
|
|
2531
2533
|
"data-queue-insights-toggle": !0,
|
|
2532
2534
|
children: [
|
|
@@ -2535,8 +2537,8 @@ function Ld({
|
|
|
2535
2537
|
]
|
|
2536
2538
|
}
|
|
2537
2539
|
),
|
|
2538
|
-
C === "table" && /* @__PURE__ */ d(
|
|
2539
|
-
/* @__PURE__ */ a(
|
|
2540
|
+
C === "table" && /* @__PURE__ */ d(ut, { children: [
|
|
2541
|
+
/* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2540
2542
|
"button",
|
|
2541
2543
|
{
|
|
2542
2544
|
type: "button",
|
|
@@ -2547,7 +2549,7 @@ function Ld({
|
|
|
2547
2549
|
]
|
|
2548
2550
|
}
|
|
2549
2551
|
) }),
|
|
2550
|
-
/* @__PURE__ */ a(
|
|
2552
|
+
/* @__PURE__ */ a(pt, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ a(
|
|
2551
2553
|
fo,
|
|
2552
2554
|
{
|
|
2553
2555
|
sensors: to,
|
|
@@ -2556,7 +2558,7 @@ function Ld({
|
|
|
2556
2558
|
children: /* @__PURE__ */ a(xo, { items: ia, strategy: yo, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: ia.map((e) => {
|
|
2557
2559
|
const t = Gn.find((n) => n.key === e);
|
|
2558
2560
|
return /* @__PURE__ */ a(
|
|
2559
|
-
|
|
2561
|
+
tc,
|
|
2560
2562
|
{
|
|
2561
2563
|
id: e,
|
|
2562
2564
|
label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
|
|
@@ -2569,7 +2571,7 @@ function Ld({
|
|
|
2569
2571
|
}
|
|
2570
2572
|
) })
|
|
2571
2573
|
] }),
|
|
2572
|
-
C === "table" &&
|
|
2574
|
+
C === "table" && It && /* @__PURE__ */ d(
|
|
2573
2575
|
"button",
|
|
2574
2576
|
{
|
|
2575
2577
|
type: "button",
|
|
@@ -2589,7 +2591,7 @@ function Ld({
|
|
|
2589
2591
|
{
|
|
2590
2592
|
type: "button",
|
|
2591
2593
|
onClick: () => {
|
|
2592
|
-
const e =
|
|
2594
|
+
const e = Pt === "compact" ? "comfortable" : "compact";
|
|
2593
2595
|
ja(e);
|
|
2594
2596
|
try {
|
|
2595
2597
|
localStorage.setItem("nvr_table_density", e);
|
|
@@ -2597,12 +2599,12 @@ function Ld({
|
|
|
2597
2599
|
}
|
|
2598
2600
|
},
|
|
2599
2601
|
"aria-label": "Row density",
|
|
2600
|
-
title:
|
|
2602
|
+
title: Pt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
|
|
2601
2603
|
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",
|
|
2602
|
-
children:
|
|
2604
|
+
children: Pt === "compact" ? /* @__PURE__ */ a(Ao, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(Eo, { className: "h-3.5 w-3.5" })
|
|
2603
2605
|
}
|
|
2604
2606
|
),
|
|
2605
|
-
C === "table" && Wa &&
|
|
2607
|
+
C === "table" && Wa && me.length > 0 && /* @__PURE__ */ d(
|
|
2606
2608
|
"button",
|
|
2607
2609
|
{
|
|
2608
2610
|
type: "button",
|
|
@@ -2614,21 +2616,21 @@ function Ld({
|
|
|
2614
2616
|
]
|
|
2615
2617
|
}
|
|
2616
2618
|
),
|
|
2617
|
-
!
|
|
2618
|
-
/* @__PURE__ */ a(
|
|
2619
|
+
!kn && le.length === 1 && (Vt ? /* @__PURE__ */ d(ut, { children: [
|
|
2620
|
+
/* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2619
2621
|
"button",
|
|
2620
2622
|
{
|
|
2621
2623
|
type: "button",
|
|
2622
2624
|
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",
|
|
2623
2625
|
children: [
|
|
2624
|
-
/* @__PURE__ */ a(
|
|
2626
|
+
/* @__PURE__ */ a(on, { className: "h-3.5 w-3.5" }),
|
|
2625
2627
|
"New ",
|
|
2626
2628
|
Xn(le[0]),
|
|
2627
2629
|
/* @__PURE__ */ a(La, { className: "h-3 w-3 opacity-60" })
|
|
2628
2630
|
]
|
|
2629
2631
|
}
|
|
2630
2632
|
) }),
|
|
2631
|
-
/* @__PURE__ */ d(
|
|
2633
|
+
/* @__PURE__ */ d(pt, { align: "end", className: "w-60 p-1", children: [
|
|
2632
2634
|
/* @__PURE__ */ d(
|
|
2633
2635
|
"button",
|
|
2634
2636
|
{
|
|
@@ -2641,12 +2643,12 @@ function Ld({
|
|
|
2641
2643
|
}),
|
|
2642
2644
|
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",
|
|
2643
2645
|
children: [
|
|
2644
|
-
((ka =
|
|
2646
|
+
((ka = Vt.active) == null ? void 0 : ka.create_label) ?? ((va = Vt.active) == null ? void 0 : va.name) ?? "Default layout",
|
|
2645
2647
|
/* @__PURE__ */ a("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
|
|
2646
2648
|
]
|
|
2647
2649
|
}
|
|
2648
2650
|
),
|
|
2649
|
-
|
|
2651
|
+
Vt.options.map((e) => /* @__PURE__ */ a(
|
|
2650
2652
|
"button",
|
|
2651
2653
|
{
|
|
2652
2654
|
type: "button",
|
|
@@ -2674,26 +2676,26 @@ function Ld({
|
|
|
2674
2676
|
}),
|
|
2675
2677
|
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",
|
|
2676
2678
|
children: [
|
|
2677
|
-
/* @__PURE__ */ a(
|
|
2679
|
+
/* @__PURE__ */ a(on, { className: "h-3.5 w-3.5" }),
|
|
2678
2680
|
"New ",
|
|
2679
2681
|
Xn(le[0])
|
|
2680
2682
|
]
|
|
2681
2683
|
}
|
|
2682
2684
|
)),
|
|
2683
|
-
!
|
|
2684
|
-
/* @__PURE__ */ a(
|
|
2685
|
+
!kn && le.length > 1 && /* @__PURE__ */ d(ut, { children: [
|
|
2686
|
+
/* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2685
2687
|
"button",
|
|
2686
2688
|
{
|
|
2687
2689
|
type: "button",
|
|
2688
2690
|
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",
|
|
2689
2691
|
children: [
|
|
2690
|
-
/* @__PURE__ */ a(
|
|
2692
|
+
/* @__PURE__ */ a(on, { className: "h-3.5 w-3.5" }),
|
|
2691
2693
|
"New",
|
|
2692
2694
|
/* @__PURE__ */ a(La, { className: "h-3 w-3 opacity-60" })
|
|
2693
2695
|
]
|
|
2694
2696
|
}
|
|
2695
2697
|
) }),
|
|
2696
|
-
/* @__PURE__ */ a(
|
|
2698
|
+
/* @__PURE__ */ a(pt, { align: "end", className: "w-56 p-1", children: le.map((e) => /* @__PURE__ */ d(
|
|
2697
2699
|
"button",
|
|
2698
2700
|
{
|
|
2699
2701
|
type: "button",
|
|
@@ -2704,18 +2706,18 @@ function Ld({
|
|
|
2704
2706
|
}),
|
|
2705
2707
|
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",
|
|
2706
2708
|
children: [
|
|
2707
|
-
/* @__PURE__ */ a(
|
|
2709
|
+
/* @__PURE__ */ a(on, { className: "h-3 w-3 opacity-60" }),
|
|
2708
2710
|
Xn(e)
|
|
2709
2711
|
]
|
|
2710
2712
|
},
|
|
2711
2713
|
e
|
|
2712
2714
|
)) })
|
|
2713
2715
|
] }),
|
|
2714
|
-
!
|
|
2715
|
-
|
|
2716
|
+
!kn && He && de && /* @__PURE__ */ a(
|
|
2717
|
+
oi,
|
|
2716
2718
|
{
|
|
2717
2719
|
collection: He,
|
|
2718
|
-
onParsed: (e, t) =>
|
|
2720
|
+
onParsed: (e, t) => de(`/collections/${He}/new`, {
|
|
2719
2721
|
state: { importResult: e, importTemplateId: t.id }
|
|
2720
2722
|
})
|
|
2721
2723
|
}
|
|
@@ -2724,7 +2726,7 @@ function Ld({
|
|
|
2724
2726
|
]
|
|
2725
2727
|
}
|
|
2726
2728
|
),
|
|
2727
|
-
|
|
2729
|
+
ft && /* @__PURE__ */ d(
|
|
2728
2730
|
"div",
|
|
2729
2731
|
{
|
|
2730
2732
|
className: "flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-slate-100 bg-white px-4 py-2.5 dark:border-slate-800 dark:bg-slate-900",
|
|
@@ -2732,49 +2734,49 @@ function Ld({
|
|
|
2732
2734
|
children: [
|
|
2733
2735
|
/* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex max-w-full flex-wrap gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
|
|
2734
2736
|
/* @__PURE__ */ a(
|
|
2735
|
-
|
|
2737
|
+
Kt,
|
|
2736
2738
|
{
|
|
2737
2739
|
label: "Total",
|
|
2738
2740
|
count: (x == null ? void 0 : x.total) ?? 0,
|
|
2739
2741
|
filteredCount: I ? I.total : null,
|
|
2740
2742
|
active: Object.values(_).every(Xa) && g === "all",
|
|
2741
|
-
isLoading:
|
|
2742
|
-
...
|
|
2743
|
+
isLoading: Xe,
|
|
2744
|
+
..._t("total"),
|
|
2743
2745
|
onClick: Za
|
|
2744
2746
|
}
|
|
2745
2747
|
),
|
|
2746
|
-
io && /* @__PURE__ */ d(
|
|
2748
|
+
io && /* @__PURE__ */ d(Se, { children: [
|
|
2747
2749
|
/* @__PURE__ */ a(
|
|
2748
|
-
|
|
2750
|
+
Kt,
|
|
2749
2751
|
{
|
|
2750
2752
|
label: "Warning",
|
|
2751
2753
|
count: (x == null ? void 0 : x.sla_warning) ?? 0,
|
|
2752
2754
|
filteredCount: I ? I.sla_warning : null,
|
|
2753
2755
|
tone: "amber",
|
|
2754
2756
|
active: _.sla_status === "warning",
|
|
2755
|
-
isLoading:
|
|
2757
|
+
isLoading: Xe,
|
|
2756
2758
|
deltaBadIsUp: !0,
|
|
2757
|
-
...
|
|
2758
|
-
onClick: () =>
|
|
2759
|
+
..._t("sla_warning"),
|
|
2760
|
+
onClick: () => Ye("sla_status", "warning")
|
|
2759
2761
|
}
|
|
2760
2762
|
),
|
|
2761
2763
|
/* @__PURE__ */ a(
|
|
2762
|
-
|
|
2764
|
+
Kt,
|
|
2763
2765
|
{
|
|
2764
2766
|
label: "Breached",
|
|
2765
2767
|
count: (x == null ? void 0 : x.sla_breached) ?? 0,
|
|
2766
2768
|
filteredCount: I ? I.sla_breached : null,
|
|
2767
2769
|
tone: "red",
|
|
2768
2770
|
active: _.sla_status === "breached",
|
|
2769
|
-
isLoading:
|
|
2771
|
+
isLoading: Xe,
|
|
2770
2772
|
deltaBadIsUp: !0,
|
|
2771
|
-
...
|
|
2772
|
-
onClick: () =>
|
|
2773
|
+
..._t("sla_breached"),
|
|
2774
|
+
onClick: () => Ye("sla_status", "breached")
|
|
2773
2775
|
}
|
|
2774
2776
|
)
|
|
2775
2777
|
] }),
|
|
2776
2778
|
/* @__PURE__ */ a(
|
|
2777
|
-
|
|
2779
|
+
Kt,
|
|
2778
2780
|
{
|
|
2779
2781
|
label: "At Risk",
|
|
2780
2782
|
breakdown: I ? Ba(I.at_risk_by_rule) : Ba(x == null ? void 0 : x.at_risk_by_rule),
|
|
@@ -2782,33 +2784,33 @@ function Ld({
|
|
|
2782
2784
|
filteredCount: I ? I.at_risk : null,
|
|
2783
2785
|
tone: "red",
|
|
2784
2786
|
active: _.at_risk === "yes",
|
|
2785
|
-
isLoading:
|
|
2787
|
+
isLoading: Xe,
|
|
2786
2788
|
deltaBadIsUp: !0,
|
|
2787
|
-
...
|
|
2788
|
-
onClick: () =>
|
|
2789
|
+
..._t("at_risk"),
|
|
2790
|
+
onClick: () => Ye("at_risk", "yes")
|
|
2789
2791
|
}
|
|
2790
2792
|
),
|
|
2791
2793
|
/* @__PURE__ */ a(
|
|
2792
|
-
|
|
2794
|
+
Kt,
|
|
2793
2795
|
{
|
|
2794
2796
|
label: "Unowned",
|
|
2795
2797
|
count: (x == null ? void 0 : x.unowned) ?? 0,
|
|
2796
2798
|
filteredCount: I ? I.unowned : null,
|
|
2797
2799
|
active: g === "unowned",
|
|
2798
|
-
isLoading:
|
|
2800
|
+
isLoading: Xe,
|
|
2799
2801
|
deltaBadIsUp: !0,
|
|
2800
|
-
...
|
|
2802
|
+
..._t("unowned"),
|
|
2801
2803
|
onClick: () => {
|
|
2802
2804
|
te(g === "unowned" ? "all" : "unowned"), K(1);
|
|
2803
2805
|
}
|
|
2804
2806
|
}
|
|
2805
2807
|
)
|
|
2806
2808
|
] }),
|
|
2807
|
-
|
|
2808
|
-
["0-1d", "0:24",
|
|
2809
|
-
["1-3d", "24:72",
|
|
2810
|
-
["3-7d", "72:168",
|
|
2811
|
-
["7d+", "168:",
|
|
2809
|
+
vt && x && x.total > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
|
|
2810
|
+
["0-1d", "0:24", vt.d1],
|
|
2811
|
+
["1-3d", "24:72", vt.d3],
|
|
2812
|
+
["3-7d", "72:168", vt.d7],
|
|
2813
|
+
["7d+", "168:", vt.over]
|
|
2812
2814
|
].map(([e, t, n]) => /* @__PURE__ */ d(
|
|
2813
2815
|
"button",
|
|
2814
2816
|
{
|
|
@@ -2819,7 +2821,7 @@ function Ld({
|
|
|
2819
2821
|
aging_hours: r.aging_hours === t ? "" : t
|
|
2820
2822
|
})), K(1);
|
|
2821
2823
|
},
|
|
2822
|
-
className:
|
|
2824
|
+
className: L(
|
|
2823
2825
|
"rounded-md border px-2 py-1 tabular-nums transition-colors",
|
|
2824
2826
|
_.aging_hours === t ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-[#0e7490] dark:text-[#67e8f9]" : "border-slate-200 text-slate-500 hover:bg-muted dark:border-border dark:text-muted-foreground",
|
|
2825
2827
|
n === 0 && "opacity-45"
|
|
@@ -2832,36 +2834,36 @@ function Ld({
|
|
|
2832
2834
|
},
|
|
2833
2835
|
e
|
|
2834
2836
|
)) }),
|
|
2835
|
-
|
|
2837
|
+
_e && /* @__PURE__ */ a(
|
|
2836
2838
|
"span",
|
|
2837
2839
|
{
|
|
2838
2840
|
"data-queue-burndown": !0,
|
|
2839
|
-
className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${
|
|
2841
|
+
className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${_e.dir === "down" ? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400" : _e.dir === "up" ? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"}`,
|
|
2840
2842
|
"data-tip": "Average net change per day over the last 14 days of snapshots",
|
|
2841
|
-
children:
|
|
2843
|
+
children: _e.dir === "down" ? /* @__PURE__ */ d(Se, { children: [
|
|
2842
2844
|
"▼ ",
|
|
2843
|
-
Math.abs(
|
|
2845
|
+
Math.abs(_e.pace).toFixed(1),
|
|
2844
2846
|
"/day — clears in ~",
|
|
2845
|
-
|
|
2847
|
+
_e.days,
|
|
2846
2848
|
" day",
|
|
2847
|
-
|
|
2849
|
+
_e.days === 1 ? "" : "s",
|
|
2848
2850
|
" at this pace"
|
|
2849
|
-
] }) :
|
|
2851
|
+
] }) : _e.dir === "up" ? /* @__PURE__ */ d(Se, { children: [
|
|
2850
2852
|
"▲ Growing ",
|
|
2851
|
-
|
|
2853
|
+
_e.pace.toFixed(1),
|
|
2852
2854
|
"/day"
|
|
2853
|
-
] }) : /* @__PURE__ */ a(
|
|
2855
|
+
] }) : /* @__PURE__ */ a(Se, { children: "→ Holding steady" })
|
|
2854
2856
|
}
|
|
2855
2857
|
),
|
|
2856
2858
|
Pr.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Pr.map(([e, t]) => {
|
|
2857
2859
|
var n;
|
|
2858
2860
|
return /* @__PURE__ */ a(
|
|
2859
|
-
|
|
2861
|
+
ec,
|
|
2860
2862
|
{
|
|
2861
|
-
label:
|
|
2863
|
+
label: Fe(e),
|
|
2862
2864
|
count: t,
|
|
2863
2865
|
filteredCount: I ? I.by_state[e] ?? 0 : null,
|
|
2864
|
-
color: ((n =
|
|
2866
|
+
color: ((n = Re[e]) == null ? void 0 : n.color) ?? null,
|
|
2865
2867
|
active: za.includes(e),
|
|
2866
2868
|
onClick: () => Ya(e)
|
|
2867
2869
|
},
|
|
@@ -2872,16 +2874,16 @@ function Ld({
|
|
|
2872
2874
|
}
|
|
2873
2875
|
),
|
|
2874
2876
|
C !== "workload" && /* @__PURE__ */ a(
|
|
2875
|
-
|
|
2877
|
+
Bi,
|
|
2876
2878
|
{
|
|
2877
2879
|
defs: so,
|
|
2878
2880
|
values: _,
|
|
2879
|
-
seededKeys:
|
|
2881
|
+
seededKeys: At,
|
|
2880
2882
|
onApply: (e) => {
|
|
2881
2883
|
j((t) => ({ ...t, ...e })), K(1);
|
|
2882
2884
|
},
|
|
2883
2885
|
onClear: () => {
|
|
2884
|
-
j({ ...
|
|
2886
|
+
j({ ...fe.current }), K(1);
|
|
2885
2887
|
},
|
|
2886
2888
|
right: co
|
|
2887
2889
|
}
|
|
@@ -2892,19 +2894,19 @@ function Ld({
|
|
|
2892
2894
|
className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900",
|
|
2893
2895
|
"data-queue-saved-views": !0,
|
|
2894
2896
|
children: [
|
|
2895
|
-
((i == null ? void 0 : i.total) ?? 0) > 0 &&
|
|
2897
|
+
((i == null ? void 0 : i.total) ?? 0) > 0 && ye > 0 && /* @__PURE__ */ d(
|
|
2896
2898
|
"span",
|
|
2897
2899
|
{
|
|
2898
|
-
"data-queue-default-hiding":
|
|
2900
|
+
"data-queue-default-hiding": ye,
|
|
2899
2901
|
className: "inline-flex h-6 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.06] px-2.5 text-[12px] text-slate-700 dark:text-slate-200",
|
|
2900
2902
|
children: [
|
|
2901
2903
|
"Your default ",
|
|
2902
2904
|
yr(Jn),
|
|
2903
2905
|
" filter is hiding",
|
|
2904
2906
|
" ",
|
|
2905
|
-
|
|
2907
|
+
ye.toLocaleString("en-US"),
|
|
2906
2908
|
" item",
|
|
2907
|
-
|
|
2909
|
+
ye === 1 ? "" : "s",
|
|
2908
2910
|
" ·",
|
|
2909
2911
|
/* @__PURE__ */ a(
|
|
2910
2912
|
"button",
|
|
@@ -2959,9 +2961,9 @@ function Ld({
|
|
|
2959
2961
|
type: "button",
|
|
2960
2962
|
onClick: Ll,
|
|
2961
2963
|
title: "Revert to the queue default (filters, columns and sort cleared)",
|
|
2962
|
-
className:
|
|
2964
|
+
className: L(
|
|
2963
2965
|
"inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
|
|
2964
|
-
|
|
2966
|
+
ot == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
|
|
2965
2967
|
),
|
|
2966
2968
|
children: "Default"
|
|
2967
2969
|
}
|
|
@@ -2971,49 +2973,49 @@ function Ld({
|
|
|
2971
2973
|
return /* @__PURE__ */ d(
|
|
2972
2974
|
"span",
|
|
2973
2975
|
{
|
|
2974
|
-
className:
|
|
2976
|
+
className: L(
|
|
2975
2977
|
"group inline-flex h-6 items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors",
|
|
2976
|
-
|
|
2978
|
+
ot === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
|
|
2977
2979
|
),
|
|
2978
2980
|
children: [
|
|
2979
2981
|
/* @__PURE__ */ a(
|
|
2980
2982
|
"button",
|
|
2981
2983
|
{
|
|
2982
2984
|
type: "button",
|
|
2983
|
-
title:
|
|
2984
|
-
onClick: () => Dl.mutate(
|
|
2985
|
-
className:
|
|
2985
|
+
title: tt === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
|
|
2986
|
+
onClick: () => Dl.mutate(tt === e.id ? null : e.id),
|
|
2987
|
+
className: L(
|
|
2986
2988
|
"shrink-0",
|
|
2987
|
-
|
|
2989
|
+
tt === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
|
|
2988
2990
|
),
|
|
2989
2991
|
children: /* @__PURE__ */ a(
|
|
2990
2992
|
Do,
|
|
2991
2993
|
{
|
|
2992
|
-
className:
|
|
2993
|
-
"aria-label":
|
|
2994
|
+
className: L("h-3 w-3", tt === e.id && "fill-current"),
|
|
2995
|
+
"aria-label": tt === e.id ? "Default view" : "Set as default"
|
|
2994
2996
|
}
|
|
2995
2997
|
)
|
|
2996
2998
|
}
|
|
2997
2999
|
),
|
|
2998
|
-
/* @__PURE__ */ d("button", { type: "button", onClick: () =>
|
|
3000
|
+
/* @__PURE__ */ d("button", { type: "button", onClick: () => qt(e), children: [
|
|
2999
3001
|
e.name,
|
|
3000
3002
|
e.is_default ? /* @__PURE__ */ a("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ a("span", { className: "ml-1 text-slate-400", children: "· shared" })
|
|
3001
3003
|
] }),
|
|
3002
|
-
|
|
3004
|
+
tn && /* @__PURE__ */ a(
|
|
3003
3005
|
"button",
|
|
3004
3006
|
{
|
|
3005
3007
|
type: "button",
|
|
3006
3008
|
onClick: () => Ol.mutate({ viewId: e.id, on: !e.is_default }),
|
|
3007
3009
|
title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
|
|
3008
|
-
className:
|
|
3010
|
+
className: L(
|
|
3009
3011
|
"shrink-0",
|
|
3010
3012
|
e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
3011
3013
|
),
|
|
3012
3014
|
"aria-label": e.is_default ? "Unset queue default" : "Set queue default",
|
|
3013
|
-
children: /* @__PURE__ */ a(Ko, { className:
|
|
3015
|
+
children: /* @__PURE__ */ a(Ko, { className: L("h-3 w-3", e.is_default && "fill-current") })
|
|
3014
3016
|
}
|
|
3015
3017
|
),
|
|
3016
|
-
(e.user === S || Me) &&
|
|
3018
|
+
(e.user === S || Me) && ot === e.id && /* @__PURE__ */ a(
|
|
3017
3019
|
"button",
|
|
3018
3020
|
{
|
|
3019
3021
|
type: "button",
|
|
@@ -3032,21 +3034,21 @@ function Ld({
|
|
|
3032
3034
|
) : /* @__PURE__ */ a(Bo, { className: "h-3 w-3" })
|
|
3033
3035
|
}
|
|
3034
3036
|
),
|
|
3035
|
-
|
|
3037
|
+
ot === e.id && /* @__PURE__ */ a(
|
|
3036
3038
|
"button",
|
|
3037
3039
|
{
|
|
3038
3040
|
type: "button",
|
|
3039
3041
|
onClick: () => nl(e.id),
|
|
3040
|
-
title:
|
|
3041
|
-
className:
|
|
3042
|
+
title: Gt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
|
|
3043
|
+
className: L(
|
|
3042
3044
|
"shrink-0",
|
|
3043
|
-
|
|
3045
|
+
Gt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
3044
3046
|
),
|
|
3045
3047
|
"aria-label": `Subscribe to view ${e.name}`,
|
|
3046
|
-
children: /* @__PURE__ */ a(Qo, { className:
|
|
3048
|
+
children: /* @__PURE__ */ a(Qo, { className: L("h-3 w-3", Gt(e.id) && "fill-current") })
|
|
3047
3049
|
}
|
|
3048
3050
|
),
|
|
3049
|
-
e.user === S && (
|
|
3051
|
+
e.user === S && (Mn === e.id ? /* @__PURE__ */ d(
|
|
3050
3052
|
"span",
|
|
3051
3053
|
{
|
|
3052
3054
|
className: "flex shrink-0 items-center gap-1",
|
|
@@ -3068,7 +3070,7 @@ function Ld({
|
|
|
3068
3070
|
"button",
|
|
3069
3071
|
{
|
|
3070
3072
|
type: "button",
|
|
3071
|
-
onClick: () =>
|
|
3073
|
+
onClick: () => rn(null),
|
|
3072
3074
|
className: "text-slate-500 hover:underline dark:text-slate-400",
|
|
3073
3075
|
"aria-label": `Keep view ${e.name}`,
|
|
3074
3076
|
children: "No"
|
|
@@ -3080,7 +3082,7 @@ function Ld({
|
|
|
3080
3082
|
"button",
|
|
3081
3083
|
{
|
|
3082
3084
|
type: "button",
|
|
3083
|
-
onClick: () =>
|
|
3085
|
+
onClick: () => rn(e.id),
|
|
3084
3086
|
className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
|
|
3085
3087
|
"aria-label": `Delete view ${e.name}`,
|
|
3086
3088
|
children: "×"
|
|
@@ -3091,8 +3093,8 @@ function Ld({
|
|
|
3091
3093
|
e.id
|
|
3092
3094
|
);
|
|
3093
3095
|
}),
|
|
3094
|
-
/* @__PURE__ */ d(
|
|
3095
|
-
/* @__PURE__ */ a(
|
|
3096
|
+
/* @__PURE__ */ d(ut, { open: Fl, onOpenChange: Pn, children: [
|
|
3097
|
+
/* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ a(
|
|
3096
3098
|
"button",
|
|
3097
3099
|
{
|
|
3098
3100
|
type: "button",
|
|
@@ -3101,16 +3103,16 @@ function Ld({
|
|
|
3101
3103
|
children: "☆ Save view"
|
|
3102
3104
|
}
|
|
3103
3105
|
) }),
|
|
3104
|
-
/* @__PURE__ */ d(
|
|
3106
|
+
/* @__PURE__ */ d(pt, { className: "w-[240px] p-3", align: "end", children: [
|
|
3105
3107
|
(() => {
|
|
3106
|
-
const e = G == null ? void 0 : G.data.find((t) => t.id ===
|
|
3108
|
+
const e = G == null ? void 0 : G.data.find((t) => t.id === ot);
|
|
3107
3109
|
return !e || e.user !== S && !Me ? null : /* @__PURE__ */ d(
|
|
3108
3110
|
"button",
|
|
3109
3111
|
{
|
|
3110
3112
|
type: "button",
|
|
3111
3113
|
disabled: Be.isPending,
|
|
3112
3114
|
onClick: () => {
|
|
3113
|
-
Be.mutate(e),
|
|
3115
|
+
Be.mutate(e), Pn(!1);
|
|
3114
3116
|
},
|
|
3115
3117
|
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",
|
|
3116
3118
|
children: [
|
|
@@ -3124,32 +3126,32 @@ function Ld({
|
|
|
3124
3126
|
/* @__PURE__ */ a(
|
|
3125
3127
|
"input",
|
|
3126
3128
|
{
|
|
3127
|
-
value:
|
|
3129
|
+
value: Xt,
|
|
3128
3130
|
onChange: (e) => jr(e.target.value),
|
|
3129
3131
|
onKeyDown: (e) => {
|
|
3130
|
-
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(),
|
|
3132
|
+
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), Xt.trim() && !nn.isPending && nn.mutate());
|
|
3131
3133
|
},
|
|
3132
3134
|
placeholder: "View name",
|
|
3133
3135
|
"aria-label": "View name",
|
|
3134
3136
|
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"
|
|
3135
3137
|
}
|
|
3136
3138
|
),
|
|
3137
|
-
|
|
3139
|
+
tn && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
3138
3140
|
/* @__PURE__ */ a(
|
|
3139
3141
|
er,
|
|
3140
3142
|
{
|
|
3141
|
-
checked: Ur ||
|
|
3142
|
-
disabled:
|
|
3143
|
+
checked: Ur || $t,
|
|
3144
|
+
disabled: $t,
|
|
3143
3145
|
onCheckedChange: (e) => Vr(e === !0)
|
|
3144
3146
|
}
|
|
3145
3147
|
),
|
|
3146
3148
|
"Share with everyone"
|
|
3147
3149
|
] }),
|
|
3148
|
-
|
|
3150
|
+
tn && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
3149
3151
|
/* @__PURE__ */ a(
|
|
3150
3152
|
er,
|
|
3151
3153
|
{
|
|
3152
|
-
checked:
|
|
3154
|
+
checked: $t,
|
|
3153
3155
|
onCheckedChange: (e) => Ir(e === !0)
|
|
3154
3156
|
}
|
|
3155
3157
|
),
|
|
@@ -3159,8 +3161,8 @@ function Ld({
|
|
|
3159
3161
|
"button",
|
|
3160
3162
|
{
|
|
3161
3163
|
type: "button",
|
|
3162
|
-
disabled: !
|
|
3163
|
-
onClick: () =>
|
|
3164
|
+
disabled: !Xt.trim() || nn.isPending,
|
|
3165
|
+
onClick: () => nn.mutate(),
|
|
3164
3166
|
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",
|
|
3165
3167
|
children: "Save current view"
|
|
3166
3168
|
}
|
|
@@ -3171,8 +3173,8 @@ function Ld({
|
|
|
3171
3173
|
}
|
|
3172
3174
|
)
|
|
3173
3175
|
] }),
|
|
3174
|
-
/* @__PURE__ */ d("div", { ref:
|
|
3175
|
-
fr && /* @__PURE__ */ a(
|
|
3176
|
+
/* @__PURE__ */ d("div", { ref: Zt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
|
|
3177
|
+
fr && /* @__PURE__ */ a(mi, { error: sl, onRetry: () => void il(), className: "mb-3" }),
|
|
3176
3178
|
Yn && /* @__PURE__ */ a(
|
|
3177
3179
|
"p",
|
|
3178
3180
|
{
|
|
@@ -3183,11 +3185,11 @@ function Ld({
|
|
|
3183
3185
|
children: Yn
|
|
3184
3186
|
}
|
|
3185
3187
|
),
|
|
3186
|
-
C === "table" ? /* @__PURE__ */ a(
|
|
3188
|
+
C === "table" ? /* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
|
|
3187
3189
|
"div",
|
|
3188
3190
|
{
|
|
3189
3191
|
ref: Ae.rootRef,
|
|
3190
|
-
className:
|
|
3192
|
+
className: L(
|
|
3191
3193
|
"relative min-w-0 flex-1 transition-opacity duration-200",
|
|
3192
3194
|
vr && "pointer-events-none opacity-60"
|
|
3193
3195
|
),
|
|
@@ -3200,47 +3202,47 @@ function Ld({
|
|
|
3200
3202
|
"s"
|
|
3201
3203
|
] }),
|
|
3202
3204
|
/* @__PURE__ */ a(
|
|
3203
|
-
|
|
3205
|
+
ti,
|
|
3204
3206
|
{
|
|
3205
3207
|
fillHeight: !0,
|
|
3206
3208
|
enterKey: qr.current,
|
|
3207
|
-
density:
|
|
3209
|
+
density: Pt,
|
|
3208
3210
|
minBodyHeight: 360,
|
|
3209
|
-
columns:
|
|
3210
|
-
rows:
|
|
3211
|
+
columns: Tt,
|
|
3212
|
+
rows: $,
|
|
3211
3213
|
rowKey: (e) => `${e.collection}:${e.item_id}`,
|
|
3212
3214
|
total: (i == null ? void 0 : i.total) ?? 0,
|
|
3213
|
-
page:
|
|
3214
|
-
limit:
|
|
3215
|
-
isLoading:
|
|
3215
|
+
page: ue,
|
|
3216
|
+
limit: yn,
|
|
3217
|
+
isLoading: Xe,
|
|
3216
3218
|
onPageChange: K,
|
|
3217
|
-
onRowClick: (e) =>
|
|
3218
|
-
onRowFocus: (e) =>
|
|
3219
|
-
activeRowKey:
|
|
3219
|
+
onRowClick: (e) => Kn(e),
|
|
3220
|
+
onRowFocus: (e) => zt(F(e)),
|
|
3221
|
+
activeRowKey: St,
|
|
3220
3222
|
rowAriaLabel: (e) => e.label || void 0,
|
|
3221
3223
|
rowDragProps: (e) => ({
|
|
3222
3224
|
...xl({ collection: e.collection, id: e.item_id }),
|
|
3223
3225
|
...pl.record(e.collection, e.item_id)
|
|
3224
3226
|
}),
|
|
3225
3227
|
onRowContextMenu: (e, t) => {
|
|
3226
|
-
t.preventDefault(),
|
|
3228
|
+
t.preventDefault(), Ct({ x: t.clientX, y: t.clientY, row: e });
|
|
3227
3229
|
},
|
|
3228
3230
|
rowTitle: (e) => {
|
|
3229
|
-
const t =
|
|
3230
|
-
return Ae.titleFor(
|
|
3231
|
+
const t = wt.get(F(e));
|
|
3232
|
+
return Ae.titleFor(F(e)) ?? (t && !t.is_mine ? Ns(t) : void 0) ?? (Wr(e.collection, e.item_id) ? yi : void 0);
|
|
3231
3233
|
},
|
|
3232
|
-
rowClassName: (e) =>
|
|
3234
|
+
rowClassName: (e) => L(
|
|
3233
3235
|
El(e),
|
|
3234
|
-
Wr(e.collection, e.item_id) &&
|
|
3236
|
+
Wr(e.collection, e.item_id) && xi
|
|
3235
3237
|
),
|
|
3236
3238
|
emptyMessage: fr ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
|
|
3237
|
-
|
|
3239
|
+
ni,
|
|
3238
3240
|
{
|
|
3239
3241
|
icon: jo,
|
|
3240
3242
|
title: ((wa = i == null ? void 0 : i.empty) == null ? void 0 : wa.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((_a = i == null ? void 0 : i.empty) == null ? void 0 : _a.reason) === "scope_mine" ? "Nothing waiting on you" : ((Na = i == null ? void 0 : i.empty) == null ? void 0 : Na.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
|
|
3241
|
-
detail: ((Sa = i == null ? void 0 : i.empty) == null ? void 0 : Sa.reason) === "filters" &&
|
|
3243
|
+
detail: ((Sa = i == null ? void 0 : i.empty) == null ? void 0 : Sa.reason) === "filters" && ye > 0 ? `Your default ${yr(Jn)} filter is hiding ${ye.toLocaleString("en-US")} item${ye === 1 ? "" : "s"} here.` : ((Ca = i == null ? void 0 : i.empty) == null ? void 0 : Ca.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." : (($a = i == null ? void 0 : i.empty) == null ? void 0 : $a.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
|
|
3242
3244
|
action: ((qa = i == null ? void 0 : i.empty) == null ? void 0 : qa.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
|
|
3243
|
-
|
|
3245
|
+
ye > 0 && /* @__PURE__ */ d(
|
|
3244
3246
|
"button",
|
|
3245
3247
|
{
|
|
3246
3248
|
type: "button",
|
|
@@ -3249,7 +3251,7 @@ function Ld({
|
|
|
3249
3251
|
"data-queue-empty-defaults": !0,
|
|
3250
3252
|
children: [
|
|
3251
3253
|
"Show all ",
|
|
3252
|
-
|
|
3254
|
+
ye.toLocaleString("en-US")
|
|
3253
3255
|
]
|
|
3254
3256
|
}
|
|
3255
3257
|
),
|
|
@@ -3260,8 +3262,8 @@ function Ld({
|
|
|
3260
3262
|
onClick: () => {
|
|
3261
3263
|
var t;
|
|
3262
3264
|
const e = {};
|
|
3263
|
-
for (const [n, r] of Object.entries(
|
|
3264
|
-
(t =
|
|
3265
|
+
for (const [n, r] of Object.entries(fe.current))
|
|
3266
|
+
(t = he[n.slice(6)]) != null && t.length && (e[n] = r);
|
|
3265
3267
|
j(e), K(1);
|
|
3266
3268
|
},
|
|
3267
3269
|
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",
|
|
@@ -3294,15 +3296,15 @@ function Ld({
|
|
|
3294
3296
|
j((n) => ({ ...n, [e]: t })), K(1);
|
|
3295
3297
|
},
|
|
3296
3298
|
rowGroups: Ml ?? void 0,
|
|
3297
|
-
collapsedGroups:
|
|
3299
|
+
collapsedGroups: Ce,
|
|
3298
3300
|
onToggleGroup: Cl,
|
|
3299
|
-
selectedIds:
|
|
3300
|
-
onSelectionChange:
|
|
3301
|
+
selectedIds: It && ne ? ie : void 0,
|
|
3302
|
+
onSelectionChange: It && ne ? it : void 0,
|
|
3301
3303
|
hideFilterRow: !0,
|
|
3302
3304
|
nowrapCells: !0,
|
|
3303
3305
|
columnPins: da,
|
|
3304
3306
|
onColumnPinChange: (e, t) => {
|
|
3305
|
-
|
|
3307
|
+
un((n) => {
|
|
3306
3308
|
const r = { ...n ?? da };
|
|
3307
3309
|
return t ? r[e] = t : delete r[e], r;
|
|
3308
3310
|
});
|
|
@@ -3310,9 +3312,9 @@ function Ld({
|
|
|
3310
3312
|
columnFilterRow: !0,
|
|
3311
3313
|
hScrollProxy: !0,
|
|
3312
3314
|
footer: /* @__PURE__ */ a(
|
|
3313
|
-
|
|
3315
|
+
wi,
|
|
3314
3316
|
{
|
|
3315
|
-
collections:
|
|
3317
|
+
collections: Nt,
|
|
3316
3318
|
selectedIds: String(_.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
|
|
3317
3319
|
onToggle: (e) => {
|
|
3318
3320
|
const t = e.ids.join(",");
|
|
@@ -3329,40 +3331,40 @@ function Ld({
|
|
|
3329
3331
|
]
|
|
3330
3332
|
}
|
|
3331
3333
|
) }) }) : C === "kanban" ? /* @__PURE__ */ a(
|
|
3332
|
-
|
|
3334
|
+
Mi,
|
|
3333
3335
|
{
|
|
3334
|
-
items:
|
|
3335
|
-
onCardClick: (e) =>
|
|
3336
|
+
items: $,
|
|
3337
|
+
onCardClick: (e) => Kn(e),
|
|
3336
3338
|
onDrop: (e, t) => bl.mutate({ item: e, targetState: t }),
|
|
3337
3339
|
onClaim: (e) => De.mutate(e),
|
|
3338
|
-
onRelease: (e) =>
|
|
3339
|
-
swimlaneBy:
|
|
3340
|
-
stateLabels:
|
|
3341
|
-
laneLabel:
|
|
3342
|
-
claimsEnabled:
|
|
3340
|
+
onRelease: (e) => Ze.mutate(e),
|
|
3341
|
+
swimlaneBy: ht,
|
|
3342
|
+
stateLabels: An,
|
|
3343
|
+
laneLabel: ht === "collection" ? at : void 0,
|
|
3344
|
+
claimsEnabled: ge,
|
|
3343
3345
|
onDraggingChange: (e) => {
|
|
3344
|
-
|
|
3346
|
+
fn.current = e;
|
|
3345
3347
|
}
|
|
3346
3348
|
}
|
|
3347
|
-
) : /* @__PURE__ */ a(
|
|
3349
|
+
) : /* @__PURE__ */ a(Qi, { queueId: l })
|
|
3348
3350
|
] }),
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
+
It && ne && /* @__PURE__ */ d(
|
|
3352
|
+
Ki,
|
|
3351
3353
|
{
|
|
3352
|
-
count:
|
|
3353
|
-
claimsEnabled:
|
|
3354
|
-
showClaim:
|
|
3355
|
-
showRelease:
|
|
3356
|
-
showTransition:
|
|
3354
|
+
count: ie.length,
|
|
3355
|
+
claimsEnabled: ge,
|
|
3356
|
+
showClaim: Je("claim"),
|
|
3357
|
+
showRelease: Je("release"),
|
|
3358
|
+
showTransition: Je("transition"),
|
|
3357
3359
|
states: Mr((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
|
|
3358
3360
|
value: e,
|
|
3359
|
-
label:
|
|
3361
|
+
label: Fe(e)
|
|
3360
3362
|
})),
|
|
3361
|
-
busy:
|
|
3363
|
+
busy: Rt,
|
|
3362
3364
|
onClaim: () => Bn(
|
|
3363
3365
|
"Claim",
|
|
3364
3366
|
(e) => h.request(
|
|
3365
|
-
|
|
3367
|
+
ce(`/queues/${l}/claim`, {
|
|
3366
3368
|
source_collection: e.collection,
|
|
3367
3369
|
item_id: e.item_id
|
|
3368
3370
|
})
|
|
@@ -3371,24 +3373,24 @@ function Ld({
|
|
|
3371
3373
|
onRelease: () => Bn(
|
|
3372
3374
|
"Release",
|
|
3373
3375
|
(e) => h.request(
|
|
3374
|
-
|
|
3376
|
+
ce(`/queues/${l}/release`, {
|
|
3375
3377
|
source_collection: e.collection,
|
|
3376
3378
|
item_id: e.item_id
|
|
3377
3379
|
})
|
|
3378
3380
|
)
|
|
3379
3381
|
),
|
|
3380
3382
|
onTransition: (e) => Bn("Transition", (t) => _r(t, e)),
|
|
3381
|
-
onClear: () =>
|
|
3383
|
+
onClear: () => it([]),
|
|
3382
3384
|
children: [
|
|
3383
|
-
|
|
3385
|
+
ie.length >= 2 && /* @__PURE__ */ a(
|
|
3384
3386
|
"button",
|
|
3385
3387
|
{
|
|
3386
3388
|
type: "button",
|
|
3387
3389
|
onClick: () => {
|
|
3388
3390
|
const e = Cs(
|
|
3389
|
-
|
|
3391
|
+
$.filter((t) => ie.includes(F(t)) && t.collection !== "tasks").map((t) => Y.urlFor(Dn(t)))
|
|
3390
3392
|
);
|
|
3391
|
-
e.blocked > 0 || e.capped > 0 ?
|
|
3393
|
+
e.blocked > 0 || e.capped > 0 ? E.warning(Oa(e)) : E.success(Oa(e));
|
|
3392
3394
|
},
|
|
3393
3395
|
"data-bulk-open-tabs": !0,
|
|
3394
3396
|
title: `Open the selected records in new tabs (up to ${Ss})`,
|
|
@@ -3399,29 +3401,54 @@ function Ld({
|
|
|
3399
3401
|
/* @__PURE__ */ a(
|
|
3400
3402
|
Ws,
|
|
3401
3403
|
{
|
|
3402
|
-
targets:
|
|
3404
|
+
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
|
|
3403
3405
|
enabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
|
|
3404
3406
|
tone: "light",
|
|
3405
|
-
disabled:
|
|
3407
|
+
disabled: Rt,
|
|
3406
3408
|
onDone: (e) => {
|
|
3407
|
-
e.failed === 0 &&
|
|
3409
|
+
e.failed === 0 && it([]), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
3408
3410
|
}
|
|
3409
3411
|
}
|
|
3410
3412
|
),
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
+
Je("update-field") && /* @__PURE__ */ a(
|
|
3414
|
+
Js,
|
|
3413
3415
|
{
|
|
3414
|
-
targets:
|
|
3415
|
-
disabled:
|
|
3416
|
+
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3417
|
+
disabled: Rt,
|
|
3416
3418
|
onDone: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
3417
3419
|
className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
|
|
3418
3420
|
}
|
|
3421
|
+
),
|
|
3422
|
+
Je("compare") && /* @__PURE__ */ a(
|
|
3423
|
+
Hs,
|
|
3424
|
+
{
|
|
3425
|
+
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3426
|
+
renderValue: (e, t, n) => {
|
|
3427
|
+
var r;
|
|
3428
|
+
return Xs(
|
|
3429
|
+
((r = $.find((o) => ie.includes(F(o)))) == null ? void 0 : r.collection) ?? "",
|
|
3430
|
+
e,
|
|
3431
|
+
t,
|
|
3432
|
+
n
|
|
3433
|
+
);
|
|
3434
|
+
},
|
|
3435
|
+
disabled: Rt,
|
|
3436
|
+
className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
|
|
3437
|
+
}
|
|
3438
|
+
),
|
|
3439
|
+
Je("message") && /* @__PURE__ */ a(
|
|
3440
|
+
zs,
|
|
3441
|
+
{
|
|
3442
|
+
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3443
|
+
disabled: Rt,
|
|
3444
|
+
className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
|
|
3445
|
+
}
|
|
3419
3446
|
)
|
|
3420
3447
|
]
|
|
3421
3448
|
}
|
|
3422
3449
|
),
|
|
3423
3450
|
W != null && W.length ? /* @__PURE__ */ a(
|
|
3424
|
-
|
|
3451
|
+
vi,
|
|
3425
3452
|
{
|
|
3426
3453
|
collection: W[0].collection,
|
|
3427
3454
|
itemId: W[0].itemId,
|
|
@@ -3430,9 +3457,9 @@ function Ld({
|
|
|
3430
3457
|
width: W[0].width,
|
|
3431
3458
|
title: W[0].title,
|
|
3432
3459
|
stack: W,
|
|
3433
|
-
onPush: (e) =>
|
|
3434
|
-
onPop: () =>
|
|
3435
|
-
onClose: () =>
|
|
3460
|
+
onPush: (e) => ct.push([...W, e]),
|
|
3461
|
+
onPop: () => ct.back(),
|
|
3462
|
+
onClose: () => ct.back(W.length),
|
|
3436
3463
|
onOpenRecord: ql
|
|
3437
3464
|
}
|
|
3438
3465
|
) : null,
|
|
@@ -3451,14 +3478,14 @@ function Ld({
|
|
|
3451
3478
|
"data-queue-row-menu": !0,
|
|
3452
3479
|
children: [
|
|
3453
3480
|
[
|
|
3454
|
-
{ label: "Open", run: () =>
|
|
3481
|
+
{ label: "Open", run: () => Kn(U.row) },
|
|
3455
3482
|
{
|
|
3456
3483
|
label: "Open full record",
|
|
3457
|
-
run: () =>
|
|
3484
|
+
run: () => lt(U.row)
|
|
3458
3485
|
},
|
|
3459
3486
|
{ label: "Peek", run: () => Pe(U.row) },
|
|
3460
|
-
...
|
|
3461
|
-
((Ra = U.row.claimed_by) == null ? void 0 : Ra.id) === S ? { label: "Release claim", run: () =>
|
|
3487
|
+
...ge ? [
|
|
3488
|
+
((Ra = U.row.claimed_by) == null ? void 0 : Ra.id) === S ? { label: "Release claim", run: () => Ze.mutate(U.row) } : { label: "Claim", run: () => De.mutate(U.row) }
|
|
3462
3489
|
] : [],
|
|
3463
3490
|
// The friendly id (PW26-76166), never the row id (army 6 M52);
|
|
3464
3491
|
// a record with no number has nothing to copy.
|
|
@@ -3476,7 +3503,7 @@ function Ld({
|
|
|
3476
3503
|
run: () => {
|
|
3477
3504
|
var e;
|
|
3478
3505
|
return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
|
|
3479
|
-
`${window.location.origin}${Y.urlFor(
|
|
3506
|
+
`${window.location.origin}${Y.urlFor(Dn(U.row))}`
|
|
3480
3507
|
));
|
|
3481
3508
|
}
|
|
3482
3509
|
},
|
|
@@ -3490,7 +3517,7 @@ function Ld({
|
|
|
3490
3517
|
{
|
|
3491
3518
|
type: "button",
|
|
3492
3519
|
onClick: () => {
|
|
3493
|
-
e.run(),
|
|
3520
|
+
e.run(), Ct(null);
|
|
3494
3521
|
},
|
|
3495
3522
|
className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
3496
3523
|
children: e.label
|
|
@@ -3499,14 +3526,14 @@ function Ld({
|
|
|
3499
3526
|
)),
|
|
3500
3527
|
U.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
|
|
3501
3528
|
/* @__PURE__ */ a("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
|
|
3502
|
-
|
|
3529
|
+
Nn.slice(0, 8).map((e) => {
|
|
3503
3530
|
const t = (U.row.labels ?? []).includes(e);
|
|
3504
3531
|
return /* @__PURE__ */ d(
|
|
3505
3532
|
"button",
|
|
3506
3533
|
{
|
|
3507
3534
|
type: "button",
|
|
3508
3535
|
onClick: () => {
|
|
3509
|
-
br(U.row, e),
|
|
3536
|
+
br(U.row, e), Ct(null);
|
|
3510
3537
|
},
|
|
3511
3538
|
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",
|
|
3512
3539
|
children: [
|
|
@@ -3530,7 +3557,7 @@ function Ld({
|
|
|
3530
3557
|
const n = e.target.elements.namedItem(
|
|
3531
3558
|
"newlabel"
|
|
3532
3559
|
).value.trim();
|
|
3533
|
-
n && (br(U.row, n),
|
|
3560
|
+
n && (br(U.row, n), Ct(null));
|
|
3534
3561
|
},
|
|
3535
3562
|
className: "px-3 py-1",
|
|
3536
3563
|
children: /* @__PURE__ */ a(
|
|
@@ -3553,44 +3580,44 @@ function Ld({
|
|
|
3553
3580
|
),
|
|
3554
3581
|
pr && Ta(
|
|
3555
3582
|
/* @__PURE__ */ a(
|
|
3556
|
-
|
|
3583
|
+
nc,
|
|
3557
3584
|
{
|
|
3558
3585
|
queueId: l,
|
|
3559
3586
|
drill: pr,
|
|
3560
|
-
onClose: () =>
|
|
3587
|
+
onClose: () => wn(null),
|
|
3561
3588
|
onOpenRecord: (e, t) => {
|
|
3562
|
-
|
|
3589
|
+
wn(null), Y.open({ collection: e, itemId: t, layoutSlug: null });
|
|
3563
3590
|
}
|
|
3564
3591
|
}
|
|
3565
3592
|
),
|
|
3566
3593
|
document.body
|
|
3567
3594
|
),
|
|
3568
3595
|
/* @__PURE__ */ a(
|
|
3569
|
-
|
|
3596
|
+
Pi,
|
|
3570
3597
|
{
|
|
3571
3598
|
item: Ke,
|
|
3572
|
-
stateLabels:
|
|
3573
|
-
collectionLabel:
|
|
3574
|
-
claimsEnabled:
|
|
3599
|
+
stateLabels: An,
|
|
3600
|
+
collectionLabel: at,
|
|
3601
|
+
claimsEnabled: ge,
|
|
3575
3602
|
columnFormats: jl,
|
|
3576
|
-
fieldLabel: (e) =>
|
|
3603
|
+
fieldLabel: (e) => T(`extra.${e}`, Ve(e)),
|
|
3577
3604
|
width: p == null ? void 0 : p.sheet_width,
|
|
3578
3605
|
itemLayout: p == null ? void 0 : p.item_layout,
|
|
3579
|
-
onOpenRecord: (e) =>
|
|
3606
|
+
onOpenRecord: (e) => lt(e),
|
|
3580
3607
|
onOpenChange: (e) => {
|
|
3581
|
-
e || (Pe(null),
|
|
3608
|
+
e || (Pe(null), On(!1));
|
|
3582
3609
|
},
|
|
3583
3610
|
onClaim: (e) => De.mutate(e),
|
|
3584
|
-
onRelease: (e) =>
|
|
3611
|
+
onRelease: (e) => Ze.mutate(e),
|
|
3585
3612
|
workNextActive: $l,
|
|
3586
3613
|
onNext: () => Ke && Qr(Ke),
|
|
3587
3614
|
refetchItems: () => f.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
3588
3615
|
}
|
|
3589
3616
|
),
|
|
3590
|
-
|
|
3617
|
+
Wt.dialog
|
|
3591
3618
|
] });
|
|
3592
3619
|
}
|
|
3593
|
-
function
|
|
3620
|
+
function nc({
|
|
3594
3621
|
queueId: l,
|
|
3595
3622
|
drill: k,
|
|
3596
3623
|
onClose: D,
|
|
@@ -3599,7 +3626,7 @@ function Zi({
|
|
|
3599
3626
|
const Z = Qa(), { data: f, isLoading: h } = X({
|
|
3600
3627
|
queryKey: ["queue-agg-rows", l, k.row.collection, k.row.item_id, k.path],
|
|
3601
3628
|
queryFn: () => Z.request(
|
|
3602
|
-
|
|
3629
|
+
O(`/queues/${l}/aggregate-rows`, {
|
|
3603
3630
|
collection: k.row.collection,
|
|
3604
3631
|
item_id: k.row.item_id,
|
|
3605
3632
|
path: k.path
|
|
@@ -3657,5 +3684,5 @@ function Zi({
|
|
|
3657
3684
|
);
|
|
3658
3685
|
}
|
|
3659
3686
|
export {
|
|
3660
|
-
|
|
3687
|
+
Dd as QueueWorklist
|
|
3661
3688
|
};
|