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