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