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