@nivaro/react 0.3.66 → 0.3.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +584 -585
- package/dist/shared/components/ItemEditForm.js +1758 -1758
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +209 -209
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +499 -498
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -1,91 +1,91 @@
|
|
|
1
1
|
import { jsxs as d, Fragment as Se, jsx as a } from "react/jsx-runtime";
|
|
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 Q, useEffect as
|
|
2
|
+
import { useSensors as bo, useSensor as ho, PointerSensor as fo, DndContext as go, closestCenter as xo } from "@dnd-kit/core";
|
|
3
|
+
import { SortableContext as yo, verticalListSortingStrategy as ko, arrayMove as vo, useSortable as wo } from "@dnd-kit/sortable";
|
|
4
|
+
import { CSS as _o } from "@dnd-kit/utilities";
|
|
5
|
+
import { useQueryClient as No, useQuery as X, useMutation as Te, useQueries as je } from "@tanstack/react-query";
|
|
6
|
+
import { AlertTriangle as So, FileDiff as Co, RefreshCw as $o, Rows3 as Fa, Flame as qo, Sparkles as Ro, Download as Fo, BarChart3 as Lo, SlidersHorizontal as To, ListChecks as Eo, Rows4 as Ao, Rows2 as Oo, Play as Ko, Plus as on, ChevronDown as La, Star as Po, Pin as Do, Loader2 as Mo, Check as Bo, Save as Qo, Bell as jo, Inbox as Uo, GripVertical as Vo } from "lucide-react";
|
|
7
|
+
import { useState as w, useRef as Q, useEffect as D, useMemo as J } from "react";
|
|
8
8
|
import { createPortal as Ta } from "react-dom";
|
|
9
|
-
import { toast as
|
|
10
|
-
import { useNivaroClient as
|
|
11
|
-
import { useDebounced as
|
|
12
|
-
import { useElapsedLoading as
|
|
13
|
-
import { useSlowReason as
|
|
14
|
-
import { useBulkProgressFeed as
|
|
15
|
-
import { get as O, post as ce, patch as
|
|
16
|
-
import { deepenForLightSurface as
|
|
17
|
-
import { evaluateExpression as
|
|
18
|
-
import { clauseFromControlValue as
|
|
19
|
-
import { deliverLive as
|
|
20
|
-
import { formatMultiValue as Ue
|
|
9
|
+
import { toast as A } from "sonner";
|
|
10
|
+
import { useNivaroClient as ja, useItemEditAuth as Ea, useItemNavigation as Io, useNavigation as Go, useOverlayState as Wo } from "../../context.js";
|
|
11
|
+
import { useDebounced as Ho } from "../../hooks/useDebounced.js";
|
|
12
|
+
import { useElapsedLoading as Jo } from "../../hooks/useElapsedLoading.js";
|
|
13
|
+
import { useSlowReason as Yo } from "../../hooks/useSlowReason.js";
|
|
14
|
+
import { useBulkProgressFeed as zo } from "../../lib/bulk-progress.js";
|
|
15
|
+
import { get as O, post as ce, patch as Aa, del as zn, put as Xo } from "../../lib/commands.js";
|
|
16
|
+
import { deepenForLightSurface as Zo } from "../../lib/display-prefs.js";
|
|
17
|
+
import { evaluateExpression as es } from "../../lib/expression.js";
|
|
18
|
+
import { clauseFromControlValue as ts, filterSentence as ns } from "../../lib/filter-sentence.js";
|
|
19
|
+
import { deliverLive as rs, releaseLiveOwner as as } from "../../lib/focus-mode.js";
|
|
20
|
+
import { formatMultiValue as Ue } from "../../lib/format-value.js";
|
|
21
21
|
import { createCursorBook as ls, pageRequest as os, noteNextCursor as ss } from "../../lib/keyset-pager.js";
|
|
22
22
|
import { normalizeInlineEdit as is, inlineM2oTarget as cs, inlineChoices as ds, inlineEditFor as us, nextInlineKey as ms } from "../../lib/list-inline-edit.js";
|
|
23
23
|
import { sanitizeQueueLinkState as ps, readListLinkFromLocation as bs, dropListLinkParam as hs, encodeListLink as fs, replaceListLinkParam as gs } from "../../lib/list-link.js";
|
|
24
24
|
import { arrivedByListReturn as xs, historyKey as ys, ensureHistoryKey as ks } from "../../lib/list-page-memory.js";
|
|
25
|
-
import { expandCoalesced as vs, LIVE_ASPECTS as
|
|
25
|
+
import { expandCoalesced as vs, LIVE_ASPECTS as At } from "../../lib/live.js";
|
|
26
26
|
import { useRowChanges as ws, useRowLocksByCollection as _s, lockLabel as Ns } from "../../lib/live-list.js";
|
|
27
27
|
import { OPEN_IN_TABS_CAP as Ss, openInTabs as Cs, openInTabsMessage as Oa } from "../../lib/open-in-tabs.js";
|
|
28
28
|
import { isOwnWrite as $s } from "../../lib/own-writes.js";
|
|
29
29
|
import { usePrefetchIntent as qs } from "../../lib/prefetch.js";
|
|
30
30
|
import { useRowPresence as Rs, rowPresenceKey as Fs } from "../../lib/presence-hooks.js";
|
|
31
31
|
import { buildGroups as Ls } from "../../lib/queue-grouping.js";
|
|
32
|
-
import { cascadeFilter as Ts, fetchCascadeRelations as
|
|
33
|
-
import { useOptionalRealtime as
|
|
34
|
-
import { copyIdText as
|
|
35
|
-
import { rowHighlightTextClass as Os, rowHighlightClass as
|
|
32
|
+
import { cascadeFilter as Ts, fetchCascadeRelations as Es } from "../../lib/quick-filter-cascade.js";
|
|
33
|
+
import { useOptionalRealtime as As } from "../../lib/realtime.js";
|
|
34
|
+
import { copyIdText as Ka } from "../../lib/record-ref.js";
|
|
35
|
+
import { rowHighlightTextClass as Os, rowHighlightClass as Ks } from "../../lib/row-highlight.js";
|
|
36
36
|
import { userErrorMessage as dt } from "../../lib/safe-error.js";
|
|
37
|
-
import { useMyScopes as
|
|
37
|
+
import { useMyScopes as Ps, matchScopeDimension as Ds } from "../../lib/use-my-scopes.js";
|
|
38
38
|
import { useNewItemLayouts as Ms } from "../../lib/use-new-item-layouts.js";
|
|
39
|
-
import { formatNumber as ee, cn as L, titleCase as Xn, humanHours as Bs, formatRelative as Qs,
|
|
40
|
-
import { usePublishAskContext as
|
|
41
|
-
import { useBuiltinGate as
|
|
42
|
-
import { BulkCompareButton as
|
|
43
|
-
import { BulkFieldUpdateButton as
|
|
44
|
-
import { BulkRowMark as
|
|
45
|
-
import { BulkMessageButton as
|
|
46
|
-
import { compareCell as
|
|
47
|
-
import { DataTable as
|
|
48
|
-
import { EmptyState as
|
|
49
|
-
import { FocusModeToggle as
|
|
50
|
-
import { FulfilmentPill as
|
|
51
|
-
import { ImportFromFileButton as
|
|
52
|
-
import { IntegrationDots as
|
|
53
|
-
import { IntegrationsFilterPill as
|
|
54
|
-
import { readQueueReturn as
|
|
55
|
-
import { ListLoadError as
|
|
56
|
-
import { LiveRowMark as
|
|
57
|
-
import { CopyListLinkButton as
|
|
58
|
-
import { useInlineEdit as
|
|
59
|
-
import { usePickerExcludedRows as
|
|
60
|
-
import { RealtimeStaleMark as
|
|
61
|
-
import { RecordDrilldownSheet as
|
|
62
|
-
import { RowHighlightLegend as
|
|
63
|
-
import { RowPresence as
|
|
39
|
+
import { formatNumber as ee, cn as L, formatDateTime as Pa, titleCase as Xn, humanHours as Bs, formatRelative as Qs, formatDate as js } from "../../lib/utils.js";
|
|
40
|
+
import { usePublishAskContext as Us, useAskRecordDrag as Vs } from "../ai/ask-context.js";
|
|
41
|
+
import { useBuiltinGate as Is, BulkActionButtons as Gs } from "../bulk/BulkActionButtons.js";
|
|
42
|
+
import { BulkCompareButton as Ws } from "../bulk/BulkCompareButton.js";
|
|
43
|
+
import { BulkFieldUpdateButton as Hs } from "../bulk/BulkFieldUpdateButton.js";
|
|
44
|
+
import { BulkRowMark as Js } from "../bulk/BulkRowMark.js";
|
|
45
|
+
import { BulkMessageButton as Ys } from "../bulk/MessageStakeholders.js";
|
|
46
|
+
import { compareCell as zs, RowActionsMenu as Xs, roleMayUpdate as Zs } from "../CollectionBrowserView.js";
|
|
47
|
+
import { DataTable as ei } from "../DataTable.js";
|
|
48
|
+
import { EmptyState as ti } from "../EmptyState.js";
|
|
49
|
+
import { FocusModeToggle as ni } from "../FocusModeToggle.js";
|
|
50
|
+
import { FulfilmentPill as ri, FULFILMENT_FILTER_OPTIONS as ai } from "../FulfilmentPill.js";
|
|
51
|
+
import { ImportFromFileButton as li } from "../import/ImportFromFileButton.js";
|
|
52
|
+
import { IntegrationDots as oi, INTEGRATIONS_FILTER_OPTIONS as si } from "../integrations/IntegrationDots.js";
|
|
53
|
+
import { IntegrationsFilterPill as ii } from "../integrations/IntegrationsFilterPill.js";
|
|
54
|
+
import { readQueueReturn as ci, queueReturnApplies as di, writeQueueReturn as Da } from "../item-edit/QueueReturnChip.js";
|
|
55
|
+
import { ListLoadError as ui } from "../ListLoadError.js";
|
|
56
|
+
import { LiveRowMark as mi } from "../LiveRowMark.js";
|
|
57
|
+
import { CopyListLinkButton as pi } from "../list/CopyListLinkButton.js";
|
|
58
|
+
import { useInlineEdit as bi, InlineEditCell as hi } from "../list/InlineEdit.js";
|
|
59
|
+
import { usePickerExcludedRows as fi, PICKER_EXCLUDED_ROW_CLASS as gi, PICKER_EXCLUDED_TITLE as xi } from "../PickerExcludedRows.js";
|
|
60
|
+
import { RealtimeStaleMark as yi } from "../RealtimeStatusBanner.js";
|
|
61
|
+
import { RecordDrilldownSheet as ki } from "../RecordDrilldownSheet.js";
|
|
62
|
+
import { RowHighlightLegend as vi } from "../RowHighlightLegend.js";
|
|
63
|
+
import { RowPresence as wi } from "../RowPresence.js";
|
|
64
64
|
import { TickerNumber as Zn } from "../TickerNumber.js";
|
|
65
|
-
import { UnseenDot as
|
|
66
|
-
import { Badge as
|
|
65
|
+
import { UnseenDot as _i } from "../UnseenDot.js";
|
|
66
|
+
import { Badge as Ni } from "../ui/badge.js";
|
|
67
67
|
import { Checkbox as er } from "../ui/checkbox.js";
|
|
68
|
-
import { Command as
|
|
69
|
-
import { Label as
|
|
68
|
+
import { Command as Ma, CommandInput as Si, CommandList as Ba, CommandEmpty as Ci, CommandItem as Ot } from "../ui/command.js";
|
|
69
|
+
import { Label as $i } from "../ui/label.js";
|
|
70
70
|
import { Popover as ut, PopoverTrigger as mt, PopoverContent as pt } from "../ui/popover.js";
|
|
71
|
-
import { Skeleton as
|
|
72
|
-
import { dedupeChooserKeys as
|
|
73
|
-
import { groupSumPathsFor as
|
|
74
|
-
import { offscreenPill as
|
|
75
|
-
import { OwnerAvatars as
|
|
76
|
-
import { pathHeader as
|
|
71
|
+
import { Skeleton as qi } from "../ui/skeleton.js";
|
|
72
|
+
import { dedupeChooserKeys as Ri } from "./column-chooser.js";
|
|
73
|
+
import { groupSumPathsFor as Fi } from "./group-sums.js";
|
|
74
|
+
import { offscreenPill as Li, statsOutrunRows as Ti, stateAspectEffect as Ei } from "./live-state-aspect.js";
|
|
75
|
+
import { OwnerAvatars as Ai } from "./OwnerAvatars.js";
|
|
76
|
+
import { pathHeader as Oi } from "./path-label.js";
|
|
77
77
|
import { QueueBulkBar as Ki } from "./QueueBulkBar.js";
|
|
78
78
|
import { QueueItemSheet as Pi } from "./QueueItemSheet.js";
|
|
79
|
-
import { QueueKanbanBoard as
|
|
80
|
-
import { QueueQuickFilters as
|
|
81
|
-
import { QueueWorkloadView as
|
|
82
|
-
import { useTransitionNote as
|
|
83
|
-
import { worklistCsv as
|
|
84
|
-
import { extraChoiceText as
|
|
85
|
-
function
|
|
79
|
+
import { QueueKanbanBoard as Di } from "./QueueKanbanBoard.js";
|
|
80
|
+
import { QueueQuickFilters as Mi } from "./QueueQuickFilters.js";
|
|
81
|
+
import { QueueWorkloadView as Bi } from "./QueueWorkloadView.js";
|
|
82
|
+
import { useTransitionNote as Qi, needsTransitionNote as ji } from "./transition-note.js";
|
|
83
|
+
import { worklistCsv as Ui, worklistCsvName as Vi } from "./worklist-csv.js";
|
|
84
|
+
import { extraChoiceText as Kt, atRiskBreakdown as Qa, worklistKeyTarget as Ii } from "./worklist-helpers.js";
|
|
85
|
+
function Gi({ summary: l }) {
|
|
86
86
|
if (!l || l.count === 0)
|
|
87
87
|
return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
|
|
88
|
-
const k = [l.last_from, l.last_to].filter(Boolean).join(" → "),
|
|
88
|
+
const k = [l.last_from, l.last_to].filter(Boolean).join(" → "), K = [
|
|
89
89
|
k ? `Last: ${k}` : null,
|
|
90
90
|
l.last_at ? Qs(l.last_at) : null,
|
|
91
91
|
l.last_reason ? `“${l.last_reason}”` : "no reason given"
|
|
@@ -94,7 +94,7 @@ function Wi({ summary: l }) {
|
|
|
94
94
|
"span",
|
|
95
95
|
{
|
|
96
96
|
className: "inline-flex max-w-[260px] items-center gap-1.5 truncate rounded-full border border-rose-200 bg-rose-50 px-2 py-0.5 text-[11px] font-medium text-rose-700 dark:border-rose-900/40 dark:bg-rose-900/10 dark:text-rose-300",
|
|
97
|
-
"data-tip":
|
|
97
|
+
"data-tip": K,
|
|
98
98
|
"data-send-backs": l.count,
|
|
99
99
|
children: [
|
|
100
100
|
/* @__PURE__ */ d("span", { className: "tabular-nums", children: [
|
|
@@ -109,15 +109,15 @@ function Wi({ summary: l }) {
|
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
|
-
const
|
|
112
|
+
const Wi = 50, sn = "nivaro_addendums", Hi = [
|
|
113
113
|
{ value: "mine", label: "My Items" },
|
|
114
114
|
{ value: "unowned", label: "No Owners" },
|
|
115
115
|
{ value: "claimed", label: "Claimed by me" },
|
|
116
116
|
{ value: "all", label: "All Items" }
|
|
117
117
|
];
|
|
118
|
-
function
|
|
118
|
+
function Ji({ summary: l }) {
|
|
119
119
|
if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
120
|
-
const k = l.active > 0,
|
|
120
|
+
const k = l.active > 0, K = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", M = l.cost_impact, Z = M != null && M !== 0 ? `${M > 0 ? "+" : "−"}$${Math.abs(M).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
|
|
121
121
|
return /* @__PURE__ */ d(
|
|
122
122
|
"span",
|
|
123
123
|
{
|
|
@@ -137,7 +137,7 @@ function Yi({ summary: l }) {
|
|
|
137
137
|
)
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
|
-
k ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${
|
|
140
|
+
k ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${K}` : `${l.total} ${K}`,
|
|
141
141
|
Z && /* @__PURE__ */ d("span", { className: "tabular-nums opacity-80", children: [
|
|
142
142
|
"· ",
|
|
143
143
|
Z
|
|
@@ -146,21 +146,21 @@ function Yi({ summary: l }) {
|
|
|
146
146
|
}
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function Yi(l) {
|
|
150
150
|
return Bs(l);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function zi({ status: l }) {
|
|
153
153
|
return l ? /* @__PURE__ */ a("span", { className: L("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Xi({ points: l, inline: k = !1 }) {
|
|
156
156
|
if (l.length < 2) return null;
|
|
157
|
-
const
|
|
157
|
+
const K = k ? 40 : 64, M = k ? 14 : 18, Z = Math.max(...l), f = Math.min(...l), h = Z - f || 1, S = K / (l.length - 1), Y = l.map(
|
|
158
158
|
(de, g) => `${g === 0 ? "M" : "L"}${(g * S).toFixed(1)},${(M - 2 - (de - f) / h * (M - 4)).toFixed(1)}`
|
|
159
159
|
).join(" ");
|
|
160
160
|
return /* @__PURE__ */ a(
|
|
161
161
|
"svg",
|
|
162
162
|
{
|
|
163
|
-
width:
|
|
163
|
+
width: K,
|
|
164
164
|
height: M,
|
|
165
165
|
className: k ? "opacity-40" : "mt-1.5 opacity-40",
|
|
166
166
|
"aria-hidden": "true",
|
|
@@ -168,10 +168,10 @@ function Zi({ points: l, inline: k = !1 }) {
|
|
|
168
168
|
}
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Pt({
|
|
172
172
|
label: l,
|
|
173
173
|
count: k,
|
|
174
|
-
filteredCount:
|
|
174
|
+
filteredCount: K,
|
|
175
175
|
active: M,
|
|
176
176
|
isLoading: Z,
|
|
177
177
|
tone: f,
|
|
@@ -188,7 +188,7 @@ function Kt({
|
|
|
188
188
|
onClick: g,
|
|
189
189
|
"aria-pressed": M,
|
|
190
190
|
"aria-label": [
|
|
191
|
-
|
|
191
|
+
K != null ? `${ee(K)} of ${ee(k)} ${l}` : `${ee(k)} ${l}`,
|
|
192
192
|
de || null,
|
|
193
193
|
S != null && S !== 0 ? `${S > 0 ? "up" : "down"} ${ee(Math.abs(S))} since the last daily count` : null
|
|
194
194
|
].filter(Boolean).join(", "),
|
|
@@ -198,7 +198,7 @@ function Kt({
|
|
|
198
198
|
"grow justify-center sm:justify-start",
|
|
199
199
|
M && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10"
|
|
200
200
|
),
|
|
201
|
-
children: Z ? /* @__PURE__ */ a(
|
|
201
|
+
children: Z ? /* @__PURE__ */ a(qi, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(Se, { children: [
|
|
202
202
|
/* @__PURE__ */ a(
|
|
203
203
|
"span",
|
|
204
204
|
{
|
|
@@ -206,8 +206,8 @@ function Kt({
|
|
|
206
206
|
"flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums",
|
|
207
207
|
k === 0 && !M ? "text-slate-500 dark:text-slate-400" : "text-slate-900 dark:text-foreground"
|
|
208
208
|
),
|
|
209
|
-
children:
|
|
210
|
-
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Zn, { value:
|
|
209
|
+
children: K != null ? /* @__PURE__ */ d(Se, { children: [
|
|
210
|
+
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Zn, { value: K, format: ee }) }),
|
|
211
211
|
/* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
212
212
|
"/ ",
|
|
213
213
|
/* @__PURE__ */ a(Zn, { value: k, format: ee })
|
|
@@ -246,15 +246,15 @@ function Kt({
|
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
248
|
),
|
|
249
|
-
h && k > 0 && /* @__PURE__ */ a(
|
|
249
|
+
h && k > 0 && /* @__PURE__ */ a(Xi, { points: h, inline: !0 })
|
|
250
250
|
] })
|
|
251
251
|
}
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Zi({
|
|
255
255
|
label: l,
|
|
256
256
|
count: k,
|
|
257
|
-
filteredCount:
|
|
257
|
+
filteredCount: K,
|
|
258
258
|
color: M,
|
|
259
259
|
active: Z,
|
|
260
260
|
onClick: f
|
|
@@ -277,8 +277,8 @@ function ec({
|
|
|
277
277
|
}
|
|
278
278
|
),
|
|
279
279
|
l,
|
|
280
|
-
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
281
|
-
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ee(
|
|
280
|
+
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: K != null ? /* @__PURE__ */ d(Se, { children: [
|
|
281
|
+
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ee(K) }),
|
|
282
282
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
283
283
|
" / ",
|
|
284
284
|
ee(k)
|
|
@@ -288,17 +288,17 @@ function ec({
|
|
|
288
288
|
}
|
|
289
289
|
);
|
|
290
290
|
}
|
|
291
|
-
const Ve =
|
|
292
|
-
function
|
|
291
|
+
const Ve = Oi;
|
|
292
|
+
function ec({
|
|
293
293
|
id: l,
|
|
294
294
|
label: k,
|
|
295
|
-
checked:
|
|
295
|
+
checked: K,
|
|
296
296
|
onCheckedChange: M
|
|
297
297
|
}) {
|
|
298
|
-
const { attributes: Z, listeners: f, setNodeRef: h, transform: S, transition: Y, isDragging: de } =
|
|
298
|
+
const { attributes: Z, listeners: f, setNodeRef: h, transform: S, transition: Y, isDragging: de } = wo({
|
|
299
299
|
id: l
|
|
300
300
|
}), g = {
|
|
301
|
-
transform:
|
|
301
|
+
transform: _o.Transform.toString(S),
|
|
302
302
|
transition: Y,
|
|
303
303
|
opacity: de ? 0.4 : 1
|
|
304
304
|
}, te = `col-toggle-${l}`;
|
|
@@ -309,35 +309,35 @@ function tc({
|
|
|
309
309
|
...Z,
|
|
310
310
|
...f,
|
|
311
311
|
className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
|
|
312
|
-
children: /* @__PURE__ */ a(
|
|
312
|
+
children: /* @__PURE__ */ a(Vo, { className: "h-3.5 w-3.5" })
|
|
313
313
|
}
|
|
314
314
|
),
|
|
315
|
-
/* @__PURE__ */ a(er, { id: te, checked:
|
|
316
|
-
/* @__PURE__ */ a(
|
|
315
|
+
/* @__PURE__ */ a(er, { id: te, checked: K, onCheckedChange: M }),
|
|
316
|
+
/* @__PURE__ */ a($i, { htmlFor: te, className: "cursor-pointer text-[12px] font-normal", children: k })
|
|
317
317
|
] });
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Od({
|
|
320
320
|
queueId: l,
|
|
321
321
|
realtime: k,
|
|
322
|
-
renderError:
|
|
322
|
+
renderError: K,
|
|
323
323
|
hideCreateActions: M = !1,
|
|
324
324
|
onAsk: Z
|
|
325
325
|
}) {
|
|
326
326
|
var pa, ba, ha, fa, ga, xa, ya, ka, va, wa, _a, Na, Sa, Ca, $a, qa, Ra;
|
|
327
|
-
const f =
|
|
327
|
+
const f = No(), h = ja(), { userId: S } = Ea(), Y = Io(), { navigate: de } = Go(), [g, te] = w("all"), [ue, P] = w(1), tr = Q(ls()), [Dt, Ua] = w(() => {
|
|
328
328
|
try {
|
|
329
329
|
return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
|
|
330
330
|
} catch {
|
|
331
331
|
return "compact";
|
|
332
332
|
}
|
|
333
|
-
}), [C, Ie] = w("table"), [B, Ge] = w(""), [_, j] = w({}), [Mt, nr] = w(() => /* @__PURE__ */ new Set()), [R, bt] = w(null), [Ce, cn] = w(/* @__PURE__ */ new Set()), [ht, dn] = w(null), [We, un] = w(null), [mn, Bt] = w(0), pn = Q(0),
|
|
333
|
+
}), [C, Ie] = w("table"), [B, Ge] = w(""), [_, j] = w({}), [Mt, nr] = w(() => /* @__PURE__ */ new Set()), [R, bt] = w(null), [Ce, cn] = w(/* @__PURE__ */ new Set()), [ht, dn] = w(null), [We, un] = w(null), [mn, Bt] = w(0), pn = Q(0), Ee = ws(), bn = As(), hn = Q({}).current, rr = Q(/* @__PURE__ */ new Set()), [Va, Ia] = w(0), [ar, Ga] = w(0), be = Q(!1), Qt = Q([]), lr = Q(null), fn = Q(!1), gn = Q(0), xn = Q("table");
|
|
334
334
|
xn.current = C;
|
|
335
335
|
const yn = 25, { data: c, error: jt } = X({
|
|
336
336
|
queryKey: ["queue-meta", l],
|
|
337
337
|
queryFn: () => h.request(O(`/queues/${l}`)).then((e) => e.data),
|
|
338
338
|
enabled: !!l
|
|
339
|
-
}), { scopes: Ut, ready: or } =
|
|
340
|
-
|
|
339
|
+
}), { scopes: Ut, ready: or } = Ps(), sr = Q(!1), [ir, cr] = w(!1), [he, Wa] = w({}), fe = Q({});
|
|
340
|
+
D(() => {
|
|
341
341
|
if (sr.current || !or || !c) return;
|
|
342
342
|
sr.current = !0;
|
|
343
343
|
const e = (c.extra_field_meta ?? []).filter(
|
|
@@ -363,7 +363,7 @@ function Dd({
|
|
|
363
363
|
];
|
|
364
364
|
};
|
|
365
365
|
for (const o of e) {
|
|
366
|
-
const s =
|
|
366
|
+
const s = Ds(Ut, { collection: o.target_collection });
|
|
367
367
|
if (!s) continue;
|
|
368
368
|
const u = `extra.${o.path}`;
|
|
369
369
|
try {
|
|
@@ -375,7 +375,7 @@ function Dd({
|
|
|
375
375
|
} catch {
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
Object.keys(n).length > 0 &&
|
|
378
|
+
Object.keys(n).length > 0 && Wa(n), Object.keys(t).length > 0 && (fe.current = t, j((o) => ({ ...o, ...t }))), cr(!0);
|
|
379
379
|
})();
|
|
380
380
|
}, [or, Ut, c]);
|
|
381
381
|
const He = ((ba = (pa = c == null ? void 0 : c.sources) == null ? void 0 : pa.find((e) => e.type === "collection")) == null ? void 0 : ba.collection) ?? null, { data: dr = [] } = X({
|
|
@@ -393,7 +393,7 @@ function Dd({
|
|
|
393
393
|
return t;
|
|
394
394
|
}, [c == null ? void 0 : c.sources]), Vt = Ms(
|
|
395
395
|
le.length === 1 ? le[0] : null
|
|
396
|
-
), kn = M === !0 || Array.isArray(M) && le.length > 0 && le.every((e) => M.includes(e)), ge = (c == null ? void 0 : c.claims_enabled) !== !1, p = c == null ? void 0 : c.display_config,
|
|
396
|
+
), kn = M === !0 || Array.isArray(M) && le.length > 0 && le.every((e) => M.includes(e)), ge = (c == null ? void 0 : c.claims_enabled) !== !1, p = c == null ? void 0 : c.display_config, Ae = (p == null ? void 0 : p.views) ?? ["table", "kanban", "workload"], Ha = (p == null ? void 0 : p.work_next) !== !1, It = (p == null ? void 0 : p.bulk_actions) !== !1, Je = Is(
|
|
397
397
|
[
|
|
398
398
|
...new Set(
|
|
399
399
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -404,15 +404,15 @@ function Dd({
|
|
|
404
404
|
var n, r;
|
|
405
405
|
return ((r = (n = c == null ? void 0 : c.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
|
|
406
406
|
}, ur = Q(!1);
|
|
407
|
-
|
|
407
|
+
D(() => {
|
|
408
408
|
!c || ur.current || (ur.current = !0, Ge("-priority"));
|
|
409
409
|
}, [c]);
|
|
410
|
-
const [z,
|
|
411
|
-
|
|
412
|
-
c != null && c.display_config && !
|
|
413
|
-
}, [c, C,
|
|
410
|
+
const [z, Ja] = w(!1);
|
|
411
|
+
D(() => {
|
|
412
|
+
c != null && c.display_config && !Ae.includes(C) && Ie(Ae[0]);
|
|
413
|
+
}, [c, C, Ae]), D(() => {
|
|
414
414
|
if (!(c != null && c.sources)) return;
|
|
415
|
-
const e = bn ? (b,
|
|
415
|
+
const e = bn ? (b, E) => bn.subscribeCollections(b, E) : k == null ? void 0 : k.subscribe;
|
|
416
416
|
if (!e) return;
|
|
417
417
|
const t = [
|
|
418
418
|
...new Set(
|
|
@@ -424,7 +424,7 @@ function Dd({
|
|
|
424
424
|
let r = null, o = null, s = null;
|
|
425
425
|
const u = () => {
|
|
426
426
|
s || (s = setTimeout(() => {
|
|
427
|
-
s = null,
|
|
427
|
+
s = null, Ga((b) => b + 1);
|
|
428
428
|
}, 1500));
|
|
429
429
|
}, m = () => {
|
|
430
430
|
o || (o = setTimeout(() => {
|
|
@@ -435,16 +435,16 @@ function Dd({
|
|
|
435
435
|
be.current = !0, f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] });
|
|
436
436
|
}, 900));
|
|
437
437
|
}, y = (b) => {
|
|
438
|
-
let
|
|
438
|
+
let E = !1, v = 0, ae = !1;
|
|
439
439
|
const pe = b.flatMap(
|
|
440
440
|
(q) => q ? vs(q) : [q]
|
|
441
441
|
);
|
|
442
442
|
for (const q of pe) {
|
|
443
443
|
const V = q == null ? void 0 : q.changed_fields, H = (q == null ? void 0 : q.collection) != null ? `${q.collection}:${String(q.item)}` : null, ln = H != null && rr.current.has(H);
|
|
444
444
|
if (q && !q.action && (V != null && V.length) && V.every((Le) => Le.startsWith("$"))) {
|
|
445
|
-
if (V.includes(
|
|
445
|
+
if (V.includes(At.tasks) && n.add("queue-task-counts"), V.includes(At.integrations) && n.add("queue-integrations-summary"), V.includes(At.addendums) && n.add("queue-collection-addendums"), V.includes(At.lock) && Ia((Le) => Le + 1), V.includes(At.state)) {
|
|
446
446
|
const Le = Ei(ln, xn.current === "kanban");
|
|
447
|
-
ae = !0, Le.refresh && (
|
|
447
|
+
ae = !0, Le.refresh && (E = !0), v += Le.pill;
|
|
448
448
|
}
|
|
449
449
|
r || (r = setTimeout(() => {
|
|
450
450
|
r = null;
|
|
@@ -454,16 +454,16 @@ function Dd({
|
|
|
454
454
|
continue;
|
|
455
455
|
}
|
|
456
456
|
ae = !0;
|
|
457
|
-
const
|
|
458
|
-
H && (ln || (q == null ? void 0 : q.action) === "create" || xn.current === "kanban") ? (
|
|
457
|
+
const po = (q == null ? void 0 : q.collection) != null && $s(q.collection, q.item);
|
|
458
|
+
H && (ln || (q == null ? void 0 : q.action) === "create" || xn.current === "kanban") ? (E = !0, po || Qt.current.push({ key: H, by: null })) : v += 1;
|
|
459
459
|
}
|
|
460
|
-
v > 0 && (pn.current += v),
|
|
461
|
-
}, N = e(t, (b) =>
|
|
460
|
+
v > 0 && (pn.current += v), E && m(), ae && u();
|
|
461
|
+
}, N = e(t, (b) => rs(hn, [b ?? {}], y));
|
|
462
462
|
return () => {
|
|
463
|
-
N(),
|
|
463
|
+
N(), as(hn), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
|
|
464
464
|
};
|
|
465
465
|
}, [bn, k, c == null ? void 0 : c.sources, f, l, S, hn]);
|
|
466
|
-
const Oe =
|
|
466
|
+
const Oe = Ho(_, 350), Ya = JSON.stringify(Oe) === JSON.stringify(_), vn = Q(!1), $e = C === "table" && !!R, mr = Fi(c), xe = (() => {
|
|
467
467
|
const e = {};
|
|
468
468
|
for (const [t, n] of Object.entries(Oe))
|
|
469
469
|
if (n) {
|
|
@@ -481,36 +481,36 @@ function Dd({
|
|
|
481
481
|
return e;
|
|
482
482
|
})();
|
|
483
483
|
function Ye(e, t) {
|
|
484
|
-
j((n) => ({ ...n, [e]: n[e] === t ? "" : t })),
|
|
484
|
+
j((n) => ({ ...n, [e]: n[e] === t ? "" : t })), P(1);
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function za(e) {
|
|
487
487
|
j((t) => {
|
|
488
488
|
const n = t.state, r = Array.isArray(n) ? n : n ? [n] : [], o = r.includes(e) ? r.filter((s) => s !== e) : [...r, e];
|
|
489
489
|
return { ...t, state: o };
|
|
490
|
-
}),
|
|
490
|
+
}), P(1);
|
|
491
491
|
}
|
|
492
|
-
const
|
|
493
|
-
function
|
|
494
|
-
j({ ...fe.current }), te("all"),
|
|
492
|
+
const Xa = Array.isArray(_.state) ? _.state : _.state ? [_.state] : [], Za = (e) => !e || Array.isArray(e) && e.length === 0;
|
|
493
|
+
function el() {
|
|
494
|
+
j({ ...fe.current }), te("all"), P(1);
|
|
495
495
|
}
|
|
496
|
-
const [ft,
|
|
496
|
+
const [ft, tl] = w(() => {
|
|
497
497
|
try {
|
|
498
498
|
return localStorage.getItem("nvr_queue_insights_open") === "1";
|
|
499
499
|
} catch {
|
|
500
500
|
return !1;
|
|
501
501
|
}
|
|
502
502
|
});
|
|
503
|
-
|
|
503
|
+
D(() => {
|
|
504
504
|
try {
|
|
505
505
|
localStorage.setItem("nvr_queue_insights_open", ft ? "1" : "0");
|
|
506
506
|
} catch {
|
|
507
507
|
}
|
|
508
508
|
}, [ft]);
|
|
509
|
-
const { data:
|
|
509
|
+
const { data: nl = [] } = X({
|
|
510
510
|
queryKey: ["queue-view-subs", l],
|
|
511
511
|
queryFn: () => h.request(O("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
|
|
512
512
|
staleTime: 3e4
|
|
513
|
-
}), Gt = (e) =>
|
|
513
|
+
}), Gt = (e) => nl.find((t) => t.queue_view_id === e), rl = (e) => {
|
|
514
514
|
const t = Gt(e);
|
|
515
515
|
(t ? h.request(zn(`/notification-subscriptions/${t.id}`)) : h.request(
|
|
516
516
|
ce("/notification-subscriptions", {
|
|
@@ -519,15 +519,15 @@ function Dd({
|
|
|
519
519
|
digest_frequency: "instant"
|
|
520
520
|
})
|
|
521
521
|
)).then(() => {
|
|
522
|
-
|
|
522
|
+
A.success(
|
|
523
523
|
t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
|
|
524
524
|
), f.invalidateQueries({ queryKey: ["queue-view-subs", l] });
|
|
525
|
-
}).catch((r) =>
|
|
525
|
+
}).catch((r) => A.error(dt(r, "Failed")));
|
|
526
526
|
}, [pr, wn] = w(null), _n = [
|
|
527
527
|
...new Set(
|
|
528
528
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
529
529
|
)
|
|
530
|
-
], { data:
|
|
530
|
+
], { data: al = {} } = X({
|
|
531
531
|
queryKey: ["queue-custom-actions", l, _n.join(",")],
|
|
532
532
|
queryFn: async () => {
|
|
533
533
|
const e = {};
|
|
@@ -544,12 +544,12 @@ function Dd({
|
|
|
544
544
|
},
|
|
545
545
|
enabled: _n.length > 0,
|
|
546
546
|
staleTime: 6e4
|
|
547
|
-
}),
|
|
547
|
+
}), ll = (e) => al[e] ?? [], ol = (e, t) => {
|
|
548
548
|
h.request(ce(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
|
|
549
|
-
|
|
549
|
+
A.success(`${e.label} ran`), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
550
550
|
}).catch((n) => {
|
|
551
551
|
const r = n.response;
|
|
552
|
-
|
|
552
|
+
A.error((r == null ? void 0 : r.error) ?? dt(n, `${e.label} failed`));
|
|
553
553
|
});
|
|
554
554
|
}, { data: Nn = [] } = X({
|
|
555
555
|
queryKey: ["queue-triage-labels", l],
|
|
@@ -564,16 +564,16 @@ function Dd({
|
|
|
564
564
|
})
|
|
565
565
|
).then(() => {
|
|
566
566
|
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
|
|
567
|
-
}).catch((n) =>
|
|
567
|
+
}).catch((n) => A.error(dt(n, "Label failed")));
|
|
568
568
|
}, {
|
|
569
569
|
data: i,
|
|
570
570
|
isLoading: hr,
|
|
571
571
|
isFetching: gt,
|
|
572
|
-
isPlaceholderData:
|
|
572
|
+
isPlaceholderData: sl,
|
|
573
573
|
dataUpdatedAt: oe,
|
|
574
574
|
isError: fr,
|
|
575
|
-
error:
|
|
576
|
-
refetch:
|
|
575
|
+
error: il,
|
|
576
|
+
refetch: cl
|
|
577
577
|
} = X({
|
|
578
578
|
queryKey: [
|
|
579
579
|
"queue-items",
|
|
@@ -609,7 +609,7 @@ function Dd({
|
|
|
609
609
|
// first fetch went out WITHOUT the seeded scope and refired ~350ms later
|
|
610
610
|
// with it (3.3s + 8.7s of work for one page). The first fetch now also
|
|
611
611
|
// waits for the debounced copy to settle; later typing still debounces.
|
|
612
|
-
enabled: !!l && z && ir && (vn.current ||
|
|
612
|
+
enabled: !!l && z && ir && (vn.current || Ya),
|
|
613
613
|
// Keep the previous page rendered while a sort/filter/page change refetches —
|
|
614
614
|
// swapping to skeletons collapsed the table height and jittered the page.
|
|
615
615
|
placeholderData: (e) => e
|
|
@@ -622,7 +622,7 @@ function Dd({
|
|
|
622
622
|
}
|
|
623
623
|
).map(([e]) => e), gr = ze.length > 0 && Object.keys(xe).every((e) => ze.includes(e)), xr = Object.fromEntries(
|
|
624
624
|
Object.entries(xe).filter(([e]) => !ze.includes(e))
|
|
625
|
-
), { data:
|
|
625
|
+
), { data: dl } = X({
|
|
626
626
|
queryKey: ["queue-default-hidden", l, g, xr],
|
|
627
627
|
enabled: !!l && !!i && !gt && i.total === 0 && ((ha = i.empty) == null ? void 0 : ha.reason) === "filters" && ze.length > 0 && !gr,
|
|
628
628
|
staleTime: 3e4,
|
|
@@ -635,14 +635,14 @@ function Dd({
|
|
|
635
635
|
limit: 1
|
|
636
636
|
})
|
|
637
637
|
).then((e) => Number(e.total ?? 0))
|
|
638
|
-
}), ye = gr ? Math.max(0, (((fa = i == null ? void 0 : i.stats) == null ? void 0 : fa.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) :
|
|
638
|
+
}), ye = gr ? Math.max(0, (((fa = i == null ? void 0 : i.stats) == null ? void 0 : fa.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : dl ?? 0, yr = (e) => ze.map(e).join(" and "), kr = () => {
|
|
639
639
|
j((e) => {
|
|
640
640
|
const t = { ...e };
|
|
641
641
|
for (const n of ze) delete t[n];
|
|
642
642
|
return t;
|
|
643
|
-
}),
|
|
643
|
+
}), P(1);
|
|
644
644
|
};
|
|
645
|
-
|
|
645
|
+
D(() => {
|
|
646
646
|
if (typeof window > "u" || !oe) return;
|
|
647
647
|
const e = window;
|
|
648
648
|
e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
|
|
@@ -656,14 +656,14 @@ function Dd({
|
|
|
656
656
|
}, r = t.find((o) => o.queue === l);
|
|
657
657
|
t.push(n), t.length > 50 && t.shift(), r && r !== n && oe - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
|
|
658
658
|
}, [oe]);
|
|
659
|
-
const Xe = hr && !i || !z || !ir && !i, vr = (gt && !hr ||
|
|
659
|
+
const Xe = hr && !i || !z || !ir && !i, vr = (gt && !hr || sl && gt) && !be.current, ul = J(
|
|
660
660
|
() => ($e ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
661
661
|
[$e, i == null ? void 0 : i.data]
|
|
662
|
-
),
|
|
662
|
+
), ml = Rs(ul), Wt = Qi(), wr = Jo(gt && !be.current), pl = Yo({
|
|
663
663
|
pending: gt && !be.current,
|
|
664
664
|
request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
|
|
665
665
|
noun: "items"
|
|
666
|
-
}),
|
|
666
|
+
}), bl = qs();
|
|
667
667
|
async function _r(e, t) {
|
|
668
668
|
var m;
|
|
669
669
|
const r = (await h.request(O(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
|
|
@@ -676,7 +676,7 @@ function Dd({
|
|
|
676
676
|
);
|
|
677
677
|
if (!s) throw new Error("No transition available to move this item here");
|
|
678
678
|
let u = null;
|
|
679
|
-
if (
|
|
679
|
+
if (ji(s) && (u = await Wt.ask(((m = s.label) == null ? void 0 : m.trim()) || "Move"), !u))
|
|
680
680
|
throw new Error("Not moved — this move needs a note");
|
|
681
681
|
await h.request(
|
|
682
682
|
ce(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
|
|
@@ -685,7 +685,7 @@ function Dd({
|
|
|
685
685
|
})
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
|
-
const
|
|
688
|
+
const hl = Te({
|
|
689
689
|
mutationFn: async ({ item: e, targetState: t }) => {
|
|
690
690
|
await _r(e, t);
|
|
691
691
|
},
|
|
@@ -693,9 +693,9 @@ function Dd({
|
|
|
693
693
|
f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
694
694
|
},
|
|
695
695
|
onError: (e) => {
|
|
696
|
-
|
|
696
|
+
A.error(dt(e, "Failed to move item")), f.invalidateQueries({ queryKey: ["queue-items", l, g] });
|
|
697
697
|
}
|
|
698
|
-
}),
|
|
698
|
+
}), Ke = Te({
|
|
699
699
|
mutationFn: (e) => h.request(
|
|
700
700
|
ce(`/queues/${l}/claim`, {
|
|
701
701
|
source_collection: e.collection,
|
|
@@ -703,7 +703,7 @@ function Dd({
|
|
|
703
703
|
})
|
|
704
704
|
),
|
|
705
705
|
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
706
|
-
onError: () =>
|
|
706
|
+
onError: () => A.error("Failed to claim item")
|
|
707
707
|
}), Ze = Te({
|
|
708
708
|
mutationFn: (e) => h.request(
|
|
709
709
|
ce(`/queues/${l}/release`, {
|
|
@@ -712,17 +712,17 @@ function Dd({
|
|
|
712
712
|
})
|
|
713
713
|
),
|
|
714
714
|
onSuccess: () => f.invalidateQueries({ queryKey: ["queue-items", l, g] }),
|
|
715
|
-
onError: () =>
|
|
715
|
+
onError: () => A.error("Failed to release item")
|
|
716
716
|
}), { data: et } = X({
|
|
717
717
|
queryKey: ["queue-column-prefs", l],
|
|
718
718
|
queryFn: () => h.request(O(`/queues/${l}/column-prefs`)),
|
|
719
719
|
enabled: !!l
|
|
720
720
|
}), [xt, Ht] = w(null), [tt, Sn] = w(null);
|
|
721
|
-
|
|
721
|
+
D(() => {
|
|
722
722
|
et && Sn(et.data.default_view_id);
|
|
723
723
|
}, [et]);
|
|
724
|
-
const [
|
|
725
|
-
(e) => Array.from({ length:
|
|
724
|
+
const [fl, Nr] = w({}), ke = $e ? (i == null ? void 0 : i.groups) ?? null : null, Jt = (ke ?? []).filter((e) => !Ce.has(e.key)).map((e) => e.key).flatMap(
|
|
725
|
+
(e) => Array.from({ length: fl[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
|
|
726
726
|
), Cn = je({
|
|
727
727
|
queries: Jt.map(({ key: e, page: t }) => ({
|
|
728
728
|
queryKey: [
|
|
@@ -744,23 +744,23 @@ function Dd({
|
|
|
744
744
|
group_by: R,
|
|
745
745
|
group_key: e,
|
|
746
746
|
page: t,
|
|
747
|
-
limit:
|
|
747
|
+
limit: Wi
|
|
748
748
|
})
|
|
749
749
|
).then((n) => ({ key: e, rows: n.data })),
|
|
750
750
|
enabled: !!i && $e,
|
|
751
751
|
placeholderData: (n) => n
|
|
752
752
|
}))
|
|
753
|
-
}),
|
|
753
|
+
}), gl = Cn.map((e) => e.dataUpdatedAt).join(","), $n = J(() => {
|
|
754
754
|
const e = /* @__PURE__ */ new Map();
|
|
755
755
|
return Cn.forEach((t, n) => {
|
|
756
756
|
if (!t.data) return;
|
|
757
757
|
const r = Jt[n].key;
|
|
758
758
|
e.set(r, [...e.get(r) ?? [], ...t.data.rows]);
|
|
759
759
|
}), e;
|
|
760
|
-
}, [
|
|
760
|
+
}, [gl, Jt.map((e) => `${e.key}\0${e.page}`).join("")]), xl = new Set(
|
|
761
761
|
Cn.flatMap((e, t) => e.isFetching ? [Jt[t].key] : [])
|
|
762
762
|
), $ = ke ? [...$n.values()].flat() : (i == null ? void 0 : i.data) ?? [];
|
|
763
|
-
|
|
763
|
+
Us(
|
|
764
764
|
l ? {
|
|
765
765
|
queue: {
|
|
766
766
|
id: l,
|
|
@@ -771,7 +771,7 @@ function Dd({
|
|
|
771
771
|
}
|
|
772
772
|
} : null
|
|
773
773
|
);
|
|
774
|
-
const
|
|
774
|
+
const yl = Vs(), yt = $.some((e) => e.fulfilment !== void 0), kt = $.some((e) => e.send_backs !== void 0), { data: nt, dataUpdatedAt: Sr } = X({
|
|
775
775
|
queryKey: ["queue-live-stats", l, g, Oe, ar],
|
|
776
776
|
queryFn: () => h.request(
|
|
777
777
|
O(`/queues/${l}/items`, {
|
|
@@ -786,16 +786,16 @@ function Dd({
|
|
|
786
786
|
placeholderData: (e) => e,
|
|
787
787
|
retry: !1
|
|
788
788
|
}), Yt = !!nt && Sr > oe, x = Yt ? nt.stats : i == null ? void 0 : i.stats, I = Yt ? nt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, Cr = Yt ? nt.state_counts : i == null ? void 0 : i.state_counts;
|
|
789
|
-
|
|
789
|
+
D(() => {
|
|
790
790
|
if (!Yt) return;
|
|
791
|
-
const e = gn.current > 0 || fn.current, t =
|
|
791
|
+
const e = gn.current > 0 || fn.current, t = Li({
|
|
792
792
|
pending: pn.current,
|
|
793
793
|
liveTotal: nt.total,
|
|
794
794
|
rowsTotal: i == null ? void 0 : i.total,
|
|
795
795
|
// Only a table re-reads its rows quietly; the other views keep the pill.
|
|
796
796
|
busy: e || C !== "table"
|
|
797
797
|
});
|
|
798
|
-
pn.current = 0, t > 0 && Bt((r) => r + t),
|
|
798
|
+
pn.current = 0, t > 0 && Bt((r) => r + t), Ti({
|
|
799
799
|
liveTotal: nt.total,
|
|
800
800
|
rowsTotal: i == null ? void 0 : i.total,
|
|
801
801
|
// Grouped tables too (army 8 b08-N6): their headers count the whole set, and
|
|
@@ -814,9 +814,9 @@ function Dd({
|
|
|
814
814
|
rr.current = new Set($.map((e) => `${e.collection}:${e.item_id}`));
|
|
815
815
|
const wt = _s(
|
|
816
816
|
$.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
817
|
-
|
|
817
|
+
Va
|
|
818
818
|
), qr = Q(oe), Rr = Q(0);
|
|
819
|
-
!be.current && oe !== Rr.current && (qr.current = oe),
|
|
819
|
+
!be.current && oe !== Rr.current && (qr.current = oe), D(() => {
|
|
820
820
|
const e = new Set($.map((t) => `${t.collection}:${t.item_id}`));
|
|
821
821
|
if (be.current) {
|
|
822
822
|
be.current = !1, Rr.current = oe;
|
|
@@ -824,17 +824,17 @@ function Dd({
|
|
|
824
824
|
Qt.current = [];
|
|
825
825
|
const n = lr.current, r = /* @__PURE__ */ new Set();
|
|
826
826
|
for (const o of t)
|
|
827
|
-
!e.has(o.key) || r.has(o.key) || (r.add(o.key),
|
|
827
|
+
!e.has(o.key) || r.has(o.key) || (r.add(o.key), Ee.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
|
|
828
828
|
if (n) {
|
|
829
829
|
const o = [...e].filter((s) => !n.has(s) && !r.has(s));
|
|
830
|
-
o.length > 0 && o.length <= 20 &&
|
|
830
|
+
o.length > 0 && o.length <= 20 && Ee.note(o, null, "create");
|
|
831
831
|
}
|
|
832
832
|
}
|
|
833
833
|
lr.current = e;
|
|
834
|
-
}, [oe]),
|
|
834
|
+
}, [oe]), D(() => {
|
|
835
835
|
Bt(0);
|
|
836
836
|
}, [oe]);
|
|
837
|
-
function
|
|
837
|
+
function kl() {
|
|
838
838
|
f.invalidateQueries({ queryKey: ["queue-items", l] }), f.invalidateQueries({ queryKey: ["queue-workload", l] }), Bt(0);
|
|
839
839
|
}
|
|
840
840
|
const { data: ve } = X({
|
|
@@ -869,7 +869,7 @@ function Dd({
|
|
|
869
869
|
)
|
|
870
870
|
],
|
|
871
871
|
[c == null ? void 0 : c.sources]
|
|
872
|
-
), { data:
|
|
872
|
+
), { data: vl } = X({
|
|
873
873
|
queryKey: ["collections"],
|
|
874
874
|
queryFn: () => h.request(O("/collections")).then((e) => e.data),
|
|
875
875
|
staleTime: 300 * 1e3
|
|
@@ -909,14 +909,14 @@ function Dd({
|
|
|
909
909
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
910
910
|
staleTime: 3e4
|
|
911
911
|
}))
|
|
912
|
-
}),
|
|
912
|
+
}), wl = Lr.map((e) => e.dataUpdatedAt).join(","), _l = J(() => {
|
|
913
913
|
const e = {};
|
|
914
914
|
return Fr.forEach((t, n) => {
|
|
915
915
|
var o;
|
|
916
916
|
const r = ((o = Lr[n]) == null ? void 0 : o.data) ?? {};
|
|
917
917
|
for (const [s, u] of Object.entries(r)) e[`${t}:${s}`] = u;
|
|
918
918
|
}), e;
|
|
919
|
-
}, [
|
|
919
|
+
}, [wl]), Ln = J(() => {
|
|
920
920
|
var t;
|
|
921
921
|
const e = {};
|
|
922
922
|
for (const n of $) {
|
|
@@ -934,13 +934,13 @@ function Dd({
|
|
|
934
934
|
).then((t) => t.data ?? {}).catch(() => ({})),
|
|
935
935
|
staleTime: 3e4
|
|
936
936
|
}))
|
|
937
|
-
}),
|
|
937
|
+
}), Nl = Tr.map((e) => e.dataUpdatedAt).join(","), Sl = J(() => {
|
|
938
938
|
const e = {};
|
|
939
939
|
return Tn.forEach((t, n) => {
|
|
940
940
|
var r;
|
|
941
941
|
for (const [o, s] of Object.entries(((r = Tr[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = s;
|
|
942
942
|
}), e;
|
|
943
|
-
}, [
|
|
943
|
+
}, [Nl]), Er = Tn.length > 0, Ar = je({
|
|
944
944
|
queries: Nt.map((e) => ({
|
|
945
945
|
queryKey: ["queue-collection-risk-rules", e],
|
|
946
946
|
queryFn: () => h.request(
|
|
@@ -948,9 +948,9 @@ function Dd({
|
|
|
948
948
|
).then((t) => t.data ?? []).catch(() => []),
|
|
949
949
|
staleTime: 300 * 1e3
|
|
950
950
|
}))
|
|
951
|
-
}),
|
|
951
|
+
}), Cl = Ar.map((e) => e.dataUpdatedAt).join(","), Or = J(() => {
|
|
952
952
|
const e = /* @__PURE__ */ new Map();
|
|
953
|
-
for (const t of
|
|
953
|
+
for (const t of Ar)
|
|
954
954
|
for (const n of t.data ?? []) {
|
|
955
955
|
const r = e.get(n.name);
|
|
956
956
|
e.set(n.name, {
|
|
@@ -959,7 +959,7 @@ function Dd({
|
|
|
959
959
|
});
|
|
960
960
|
}
|
|
961
961
|
return [...e.values()];
|
|
962
|
-
}, [
|
|
962
|
+
}, [Cl]), Kr = je({
|
|
963
963
|
queries: Nt.map((e) => ({
|
|
964
964
|
queryKey: ["queue-collection-states", e],
|
|
965
965
|
queryFn: () => h.request(
|
|
@@ -967,14 +967,14 @@ function Dd({
|
|
|
967
967
|
).then((t) => t.data),
|
|
968
968
|
staleTime: 300 * 1e3
|
|
969
969
|
}))
|
|
970
|
-
}),
|
|
970
|
+
}), Pr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), Re = J(() => {
|
|
971
971
|
const e = {};
|
|
972
|
-
for (const t of
|
|
972
|
+
for (const t of Kr)
|
|
973
973
|
(t.data ?? []).forEach((n, r) => {
|
|
974
974
|
e[n.key] = { label: n.label, color: n.color, sort: r };
|
|
975
975
|
});
|
|
976
976
|
return e;
|
|
977
|
-
}, [
|
|
977
|
+
}, [Kr.map((e) => e.data)]), Dr = x ? Object.entries(x.by_state).sort(
|
|
978
978
|
(e, t) => {
|
|
979
979
|
var n, r;
|
|
980
980
|
return (((n = Re[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = Re[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
@@ -984,14 +984,14 @@ function Dd({
|
|
|
984
984
|
var r, o;
|
|
985
985
|
return (((r = Re[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = Re[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
|
|
986
986
|
}
|
|
987
|
-
),
|
|
987
|
+
), En = J(() => {
|
|
988
988
|
const e = {};
|
|
989
989
|
for (const [t, n] of Object.entries(Re)) e[t] = n.label;
|
|
990
990
|
return e;
|
|
991
|
-
}, [Re]), Fe = (e) => e ? e === "none" ? "No State" :
|
|
991
|
+
}, [Re]), Fe = (e) => e ? e === "none" ? "No State" : En[e] ?? Pr(e) : "—", at = (e) => {
|
|
992
992
|
if (e === sn) return "Addendums";
|
|
993
|
-
const t = (
|
|
994
|
-
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) ||
|
|
993
|
+
const t = (vl ?? []).find((n) => n.collection === e);
|
|
994
|
+
return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Pr(e);
|
|
995
995
|
}, se = J(() => R ? ke ? ke.map((e) => ({
|
|
996
996
|
key: e.key,
|
|
997
997
|
rows: $n.get(e.key) ?? [],
|
|
@@ -999,24 +999,24 @@ function Dd({
|
|
|
999
999
|
atRisk: e.at_risk,
|
|
1000
1000
|
count: e.count,
|
|
1001
1001
|
sums: e.sums ?? {}
|
|
1002
|
-
})) : Ls($, R).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [$, R, ke, $n]),
|
|
1003
|
-
|
|
1002
|
+
})) : Ls($, R).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [$, R, ke, $n]), An = Q(null);
|
|
1003
|
+
D(() => {
|
|
1004
1004
|
if (!R || !se) {
|
|
1005
|
-
|
|
1005
|
+
An.current = null;
|
|
1006
1006
|
return;
|
|
1007
1007
|
}
|
|
1008
|
-
if ($e && !ke ||
|
|
1009
|
-
|
|
1008
|
+
if ($e && !ke || An.current === R) return;
|
|
1009
|
+
An.current = R;
|
|
1010
1010
|
const e = se.reduce((t, n) => t + n.count, 0);
|
|
1011
1011
|
cn(e > 200 ? new Set(se.map((t) => t.key)) : /* @__PURE__ */ new Set()), Nr({});
|
|
1012
1012
|
}, [R, ke]);
|
|
1013
|
-
function
|
|
1013
|
+
function $l(e) {
|
|
1014
1014
|
cn((t) => {
|
|
1015
1015
|
const n = new Set(t);
|
|
1016
1016
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
|
-
const me = J(() => se ? se.filter((e) => !Ce.has(e.key)).flatMap((e) => e.rows) : $, [se, $, Ce]), F = (e) => `${e.collection}:${e.item_id}`, [
|
|
1019
|
+
const me = J(() => se ? se.filter((e) => !Ce.has(e.key)).flatMap((e) => e.rows) : $, [se, $, Ce]), F = (e) => `${e.collection}:${e.item_id}`, [Pe, De] = w(null), [ql, On] = w(!1), [St, zt] = w(null), Kn = (e) => {
|
|
1020
1020
|
if (e.collection === sn && e.url) {
|
|
1021
1021
|
const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
|
|
1022
1022
|
if (t) {
|
|
@@ -1037,7 +1037,7 @@ function Dd({
|
|
|
1037
1037
|
};
|
|
1038
1038
|
}, Br = () => {
|
|
1039
1039
|
var e;
|
|
1040
|
-
c &&
|
|
1040
|
+
c && Da({
|
|
1041
1041
|
queue_id: l,
|
|
1042
1042
|
name: c.name,
|
|
1043
1043
|
path: `${window.location.pathname}${window.location.search}`,
|
|
@@ -1047,8 +1047,8 @@ function Dd({
|
|
|
1047
1047
|
entry: ks()
|
|
1048
1048
|
});
|
|
1049
1049
|
}, lt = (e) => {
|
|
1050
|
-
Br(), Y.open(
|
|
1051
|
-
},
|
|
1050
|
+
Br(), Y.open(Kn(e));
|
|
1051
|
+
}, Rl = (e) => {
|
|
1052
1052
|
Br();
|
|
1053
1053
|
const t = W == null ? void 0 : W[0], n = !!t && t.collection === e.collection && String(t.itemId) === e.itemId;
|
|
1054
1054
|
Y.open({
|
|
@@ -1059,14 +1059,14 @@ function Dd({
|
|
|
1059
1059
|
}, [U, Ct] = w(
|
|
1060
1060
|
null
|
|
1061
1061
|
);
|
|
1062
|
-
|
|
1062
|
+
D(() => {
|
|
1063
1063
|
if (!U) return;
|
|
1064
1064
|
const e = () => Ct(null);
|
|
1065
1065
|
return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
|
|
1066
1066
|
window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
|
|
1067
1067
|
};
|
|
1068
1068
|
}, [U]);
|
|
1069
|
-
const
|
|
1069
|
+
const Pn = (e) => {
|
|
1070
1070
|
zt(F(e));
|
|
1071
1071
|
const t = (p == null ? void 0 : p.row_click) ?? "preview";
|
|
1072
1072
|
if (t === "full" || e.collection === sn) {
|
|
@@ -1083,31 +1083,31 @@ function Dd({
|
|
|
1083
1083
|
});
|
|
1084
1084
|
return;
|
|
1085
1085
|
}
|
|
1086
|
-
|
|
1086
|
+
De(e);
|
|
1087
1087
|
};
|
|
1088
|
-
|
|
1089
|
-
if (!
|
|
1090
|
-
const e = $.find((t) => F(t) === F(
|
|
1091
|
-
e && e !==
|
|
1088
|
+
D(() => {
|
|
1089
|
+
if (!Pe) return;
|
|
1090
|
+
const e = $.find((t) => F(t) === F(Pe));
|
|
1091
|
+
e && e !== Pe && De(e);
|
|
1092
1092
|
}, [$]);
|
|
1093
|
-
const
|
|
1093
|
+
const Fl = (e) => !e.claimed_by || e.claimed_by.id === S;
|
|
1094
1094
|
function Qr(e) {
|
|
1095
|
-
const t = e ? me.findIndex((r) => F(r) === F(e)) + 1 : 0, n = me.slice(t).find(
|
|
1095
|
+
const t = e ? me.findIndex((r) => F(r) === F(e)) + 1 : 0, n = me.slice(t).find(Fl);
|
|
1096
1096
|
if (!n) {
|
|
1097
|
-
On(!1),
|
|
1097
|
+
On(!1), De(null), A.info("Nothing left to work on — queue clear!");
|
|
1098
1098
|
return;
|
|
1099
1099
|
}
|
|
1100
|
-
if (zt(F(n)), ge && !n.claimed_by &&
|
|
1100
|
+
if (zt(F(n)), ge && !n.claimed_by && Ke.mutate(n), (p == null ? void 0 : p.row_click) === "full") {
|
|
1101
1101
|
lt(n);
|
|
1102
1102
|
return;
|
|
1103
1103
|
}
|
|
1104
|
-
On(!0),
|
|
1104
|
+
On(!0), De(n);
|
|
1105
1105
|
}
|
|
1106
|
-
|
|
1106
|
+
D(() => {
|
|
1107
1107
|
if (C !== "table") return;
|
|
1108
1108
|
function e(t) {
|
|
1109
1109
|
var o;
|
|
1110
|
-
if (t.metaKey || t.ctrlKey || t.altKey || !
|
|
1110
|
+
if (t.metaKey || t.ctrlKey || t.altKey || !Ii(t.target)) return;
|
|
1111
1111
|
const n = St ? me.findIndex((s) => F(s) === St) : -1, r = (s) => {
|
|
1112
1112
|
zt(F(s));
|
|
1113
1113
|
const u = F(s), m = [...document.querySelectorAll("tr[data-row-key]")].find(
|
|
@@ -1126,43 +1126,43 @@ function Dd({
|
|
|
1126
1126
|
} else if (t.key === "c" && n >= 0 && ge) {
|
|
1127
1127
|
t.preventDefault();
|
|
1128
1128
|
const s = me[n];
|
|
1129
|
-
((o = s.claimed_by) == null ? void 0 : o.id) === S ? Ze.mutate(s) :
|
|
1129
|
+
((o = s.claimed_by) == null ? void 0 : o.id) === S ? Ze.mutate(s) : Ke.mutate(s);
|
|
1130
1130
|
} else t.key === "o" && n >= 0 && (t.preventDefault(), lt(me[n]));
|
|
1131
1131
|
}
|
|
1132
1132
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1133
|
-
}, [C, me, St,
|
|
1133
|
+
}, [C, me, St, Pe, S, Ke, Ze, ge]);
|
|
1134
1134
|
const { data: G } = X({
|
|
1135
1135
|
queryKey: ["queue-views", l],
|
|
1136
1136
|
queryFn: () => h.request(O(`/queues/${l}/views`)),
|
|
1137
1137
|
enabled: !!l
|
|
1138
|
-
}), [ot, st] = w(null), [
|
|
1138
|
+
}), [ot, st] = w(null), [Ll, Dn] = w(!1), [Xt, jr] = w(""), [Ur, Vr] = w(!1), [$t, Ir] = w(!1);
|
|
1139
1139
|
function qt(e) {
|
|
1140
1140
|
const t = e.state ?? {};
|
|
1141
|
-
te(t.scope ?? "all"), j({ ...fe.current, ...t.filters ?? {} }), Ge(t.sort ?? ""), bt(t.group_by ?? null), Ht(t.columns ?? null), un(t.pins ?? null), t.view && Ie(
|
|
1141
|
+
te(t.scope ?? "all"), j({ ...fe.current, ...t.filters ?? {} }), Ge(t.sort ?? ""), bt(t.group_by ?? null), Ht(t.columns ?? null), un(t.pins ?? null), t.view && Ie(Ae.includes(t.view) ? t.view : Ae[0]), P(1), st(e.id);
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function Tl() {
|
|
1144
1144
|
var t, n;
|
|
1145
1145
|
const e = G == null ? void 0 : G.data.find((r) => r.is_default);
|
|
1146
1146
|
if (e) {
|
|
1147
1147
|
qt(e);
|
|
1148
1148
|
return;
|
|
1149
1149
|
}
|
|
1150
|
-
te(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), j({ ...fe.current }), Ge(""), bt(null), Ht(null), un(null), (n = c == null ? void 0 : c.display_config) != null && n.default_view && Ie(c.display_config.default_view),
|
|
1150
|
+
te(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), j({ ...fe.current }), Ge(""), bt(null), Ht(null), un(null), (n = c == null ? void 0 : c.display_config) != null && n.default_view && Ie(c.display_config.default_view), P(1), st(null);
|
|
1151
1151
|
}
|
|
1152
|
-
|
|
1152
|
+
D(() => {
|
|
1153
1153
|
if (z || !(c != null && c.display_config) || et === void 0 || G === void 0) return;
|
|
1154
1154
|
const e = et.data.default_view_id, t = e != null ? G.data.find((r) => r.id === e) : void 0, n = G.data.find((r) => r.is_default);
|
|
1155
|
-
t ? qt(t) : n ? qt(n) : (Ie(c.display_config.default_view), te(c.display_config.default_scope)),
|
|
1155
|
+
t ? qt(t) : n ? qt(n) : (Ie(c.display_config.default_view), te(c.display_config.default_scope)), Ja(!0);
|
|
1156
1156
|
}, [c, et, G, z]);
|
|
1157
1157
|
const Zt = Q(null), en = Q(null);
|
|
1158
|
-
|
|
1158
|
+
D(() => {
|
|
1159
1159
|
if (!z) return;
|
|
1160
|
-
const e =
|
|
1161
|
-
if (!e || !
|
|
1162
|
-
|
|
1160
|
+
const e = ci();
|
|
1161
|
+
if (!e || !di(e, l, ys(), xs())) return;
|
|
1162
|
+
Da({ ...e, restore: !1 });
|
|
1163
1163
|
const t = e.state ?? {};
|
|
1164
|
-
t.scope && te(t.scope), t.filters && j({ ...fe.current, ...t.filters }), t.sort != null && Ge(t.sort), bt(t.group_by ?? null), t.view && Ie(t.view), t.page &&
|
|
1165
|
-
}, [z, l]),
|
|
1164
|
+
t.scope && te(t.scope), t.filters && j({ ...fe.current, ...t.filters }), t.sort != null && Ge(t.sort), bt(t.group_by ?? null), t.view && Ie(t.view), t.page && P(t.page), en.current = e.scroll ?? 0, W && W.length > 0 && ct.back(W.length);
|
|
1165
|
+
}, [z, l]), D(() => {
|
|
1166
1166
|
var s;
|
|
1167
1167
|
if (!z || typeof window > "u") return;
|
|
1168
1168
|
const e = new URLSearchParams(window.location.search), t = e.get("scope"), n = ((s = e.get("state")) == null ? void 0 : s.trim()) || null, r = t === "all" || t === "mine";
|
|
@@ -1173,8 +1173,8 @@ function Dd({
|
|
|
1173
1173
|
window.history.state,
|
|
1174
1174
|
"",
|
|
1175
1175
|
`${window.location.pathname}${o ? `?${o}` : ""}${window.location.hash}`
|
|
1176
|
-
), r && te(t), n && j((u) => ({ ...u, state: [n] })),
|
|
1177
|
-
}, [z]),
|
|
1176
|
+
), r && te(t), n && j((u) => ({ ...u, state: [n] })), P(1);
|
|
1177
|
+
}, [z]), D(() => {
|
|
1178
1178
|
if (!z || typeof window > "u") return;
|
|
1179
1179
|
const e = new URLSearchParams(window.location.search), t = e.get("owner");
|
|
1180
1180
|
if (!t) return;
|
|
@@ -1184,15 +1184,15 @@ function Dd({
|
|
|
1184
1184
|
window.history.state,
|
|
1185
1185
|
"",
|
|
1186
1186
|
`${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
|
|
1187
|
-
), te("all"), j((r) => ({ ...r, owners: [t] })), st(null),
|
|
1188
|
-
}, [z]),
|
|
1187
|
+
), te("all"), j((r) => ({ ...r, owners: [t] })), st(null), P(1);
|
|
1188
|
+
}, [z]), D(() => {
|
|
1189
1189
|
if (!z) return;
|
|
1190
1190
|
const e = ps(bs(`queue:${l}`));
|
|
1191
1191
|
e && (hs(), qt({
|
|
1192
1192
|
id: -1,
|
|
1193
1193
|
// Saved views type filters loosely as strings; multi-selects ride as arrays there too.
|
|
1194
1194
|
state: e
|
|
1195
|
-
}), st(null), e.page &&
|
|
1195
|
+
}), st(null), e.page && P(e.page));
|
|
1196
1196
|
}, [z]);
|
|
1197
1197
|
const Gr = () => ({
|
|
1198
1198
|
scope: g,
|
|
@@ -1204,24 +1204,24 @@ function Dd({
|
|
|
1204
1204
|
pins: We,
|
|
1205
1205
|
...ue > 1 ? { page: ue } : {}
|
|
1206
1206
|
});
|
|
1207
|
-
|
|
1207
|
+
D(() => {
|
|
1208
1208
|
en.current == null || $.length === 0 || !Zt.current || (Zt.current.scrollTop = en.current, en.current = null);
|
|
1209
1209
|
}, [$]);
|
|
1210
|
-
const { isAdmin: Me } =
|
|
1210
|
+
const { isAdmin: Me } = Ea(), El = $.map((e) => `${e.collection}|${e.item_id}`).join(","), Al = J(
|
|
1211
1211
|
() => $.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
1212
|
-
[
|
|
1213
|
-
), Wr =
|
|
1212
|
+
[El]
|
|
1213
|
+
), Wr = fi(Al, Me), Ol = (e) => St === F(e) ? (
|
|
1214
1214
|
// Pinned sticky cells use bg-inherit — the highlight must be
|
|
1215
1215
|
// OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
|
|
1216
1216
|
// scrolled content bleeds through the pinned columns. Same
|
|
1217
1217
|
// pair DataTable uses for selected rows when pins are active.
|
|
1218
1218
|
"bg-[#f2fdff] dark:bg-[#20303a]"
|
|
1219
|
-
) : e.at_risk ?
|
|
1220
|
-
mutationFn: ({ viewId: e, on: t }) => h.request(
|
|
1219
|
+
) : e.at_risk ? Ks(e.at_risk_color ?? "red") : void 0, tn = Me || (c == null ? void 0 : c.owner) != null && c.owner === S, Kl = Te({
|
|
1220
|
+
mutationFn: ({ viewId: e, on: t }) => h.request(Aa(`/queues/views/${e}`, { is_default: t })),
|
|
1221
1221
|
onSuccess: () => {
|
|
1222
|
-
f.invalidateQueries({ queryKey: ["queue-views", l] }),
|
|
1222
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("Queue default view updated");
|
|
1223
1223
|
},
|
|
1224
|
-
onError: () =>
|
|
1224
|
+
onError: () => A.error("Could not update the queue default view")
|
|
1225
1225
|
}), nn = Te({
|
|
1226
1226
|
mutationFn: () => h.request(
|
|
1227
1227
|
ce(`/queues/${l}/views`, {
|
|
@@ -1240,12 +1240,12 @@ function Dd({
|
|
|
1240
1240
|
})
|
|
1241
1241
|
),
|
|
1242
1242
|
onSuccess: (e) => {
|
|
1243
|
-
|
|
1243
|
+
Dn(!1), jr(""), Vr(!1), Ir(!1), st(e.data.id), f.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("View saved");
|
|
1244
1244
|
},
|
|
1245
|
-
onError: () =>
|
|
1245
|
+
onError: () => A.error("Failed to save view")
|
|
1246
1246
|
}), [Hr, Jr] = w(null), Be = Te({
|
|
1247
1247
|
mutationFn: (e) => h.request(
|
|
1248
|
-
|
|
1248
|
+
Aa(`/queues/views/${e.id}`, {
|
|
1249
1249
|
state: {
|
|
1250
1250
|
scope: g,
|
|
1251
1251
|
filters: _,
|
|
@@ -1258,11 +1258,11 @@ function Dd({
|
|
|
1258
1258
|
})
|
|
1259
1259
|
),
|
|
1260
1260
|
onSuccess: (e, t) => {
|
|
1261
|
-
f.invalidateQueries({ queryKey: ["queue-views", l] }), Jr(t.id), setTimeout(() => Jr((n) => n === t.id ? null : n), 2e3),
|
|
1261
|
+
f.invalidateQueries({ queryKey: ["queue-views", l] }), Jr(t.id), setTimeout(() => Jr((n) => n === t.id ? null : n), 2e3), A.success(`Saved "${t.name}" with the current filters, scope and sort`);
|
|
1262
1262
|
},
|
|
1263
|
-
onError: () =>
|
|
1263
|
+
onError: () => A.error("Failed to update view")
|
|
1264
1264
|
}), [Mn, rn] = w(null);
|
|
1265
|
-
|
|
1265
|
+
D(() => {
|
|
1266
1266
|
if (Mn == null) return;
|
|
1267
1267
|
const e = setTimeout(() => rn(null), 5e3);
|
|
1268
1268
|
return () => clearTimeout(e);
|
|
@@ -1272,24 +1272,24 @@ function Dd({
|
|
|
1272
1272
|
onSuccess: (e, t) => {
|
|
1273
1273
|
rn(null), f.invalidateQueries({ queryKey: ["queue-views", l] }), st(null), tt === t && Sn(null);
|
|
1274
1274
|
},
|
|
1275
|
-
onError: () =>
|
|
1276
|
-
}),
|
|
1277
|
-
mutationFn: (e) => h.request(
|
|
1275
|
+
onError: () => A.error("Failed to delete view")
|
|
1276
|
+
}), Pl = Te({
|
|
1277
|
+
mutationFn: (e) => h.request(Xo(`/queues/${l}/default-view`, { view_id: e })),
|
|
1278
1278
|
onMutate: (e) => Sn(e),
|
|
1279
1279
|
onSuccess: (e, t) => {
|
|
1280
|
-
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }),
|
|
1280
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.success(
|
|
1281
1281
|
t === null ? "Reverted to the general default" : "Set as your default view"
|
|
1282
1282
|
);
|
|
1283
1283
|
},
|
|
1284
1284
|
onError: () => {
|
|
1285
|
-
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }),
|
|
1285
|
+
f.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.error("Failed to update default view");
|
|
1286
1286
|
}
|
|
1287
|
-
}), [ie, it] = w([]), [ne, zr] = w(!1),
|
|
1287
|
+
}), [ie, it] = w([]), [ne, zr] = w(!1), Dl = () => {
|
|
1288
1288
|
ne && it([]), zr(!ne);
|
|
1289
1289
|
};
|
|
1290
|
-
|
|
1290
|
+
D(() => {
|
|
1291
1291
|
C !== "table" && ne && (zr(!1), it([]));
|
|
1292
|
-
}, [C, ne]),
|
|
1292
|
+
}, [C, ne]), zo(), gn.current = ie.length;
|
|
1293
1293
|
const [Rt, Xr] = w(!1);
|
|
1294
1294
|
async function Bn(e, t) {
|
|
1295
1295
|
const n = $.filter((u) => ie.includes(F(u)));
|
|
@@ -1297,7 +1297,7 @@ function Dd({
|
|
|
1297
1297
|
const r = await Promise.allSettled(n.map(t));
|
|
1298
1298
|
Wt.endBatch();
|
|
1299
1299
|
const o = r.filter((u) => u.status === "fulfilled").length, s = r.length - o;
|
|
1300
|
-
Xr(!1), it([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ?
|
|
1300
|
+
Xr(!1), it([]), f.invalidateQueries({ queryKey: ["queue-items", l] }), s ? A.warning(`${e}: ${o} succeeded, ${s} failed`) : A.success(`${e}: ${o} succeeded`);
|
|
1301
1301
|
}
|
|
1302
1302
|
const Ne = (e) => {
|
|
1303
1303
|
var t;
|
|
@@ -1306,22 +1306,22 @@ function Dd({
|
|
|
1306
1306
|
if (r) return r;
|
|
1307
1307
|
}
|
|
1308
1308
|
return null;
|
|
1309
|
-
},
|
|
1309
|
+
}, Ml = (e) => {
|
|
1310
1310
|
if (R === "state") return e === "No state" ? e : Fe(e);
|
|
1311
1311
|
if (R === "collection") return at(e);
|
|
1312
1312
|
if (R != null && R.startsWith("extra.") && e !== "—") {
|
|
1313
1313
|
const t = R.slice(6), n = Ne(t);
|
|
1314
|
-
return n ? Ue(e, n) :
|
|
1314
|
+
return n ? Ue(e, n) : Kt(
|
|
1315
1315
|
((c == null ? void 0 : c.extra_field_meta) ?? []).find((r) => r.path === t),
|
|
1316
1316
|
e
|
|
1317
1317
|
);
|
|
1318
1318
|
}
|
|
1319
1319
|
return e;
|
|
1320
|
-
},
|
|
1320
|
+
}, Bl = se == null ? void 0 : se.map((e) => ({
|
|
1321
1321
|
key: e.key,
|
|
1322
1322
|
rows: e.rows,
|
|
1323
1323
|
header: /* @__PURE__ */ d(Se, { children: [
|
|
1324
|
-
/* @__PURE__ */ a("span", { children:
|
|
1324
|
+
/* @__PURE__ */ a("span", { children: Ml(e.key) }),
|
|
1325
1325
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
1326
1326
|
"(",
|
|
1327
1327
|
ee(e.count),
|
|
@@ -1344,7 +1344,7 @@ function Dd({
|
|
|
1344
1344
|
t
|
|
1345
1345
|
);
|
|
1346
1346
|
}),
|
|
1347
|
-
ke && !Ce.has(e.key) &&
|
|
1347
|
+
ke && !Ce.has(e.key) && xl.has(e.key) && /* @__PURE__ */ a("span", { className: "font-normal text-slate-400", children: "loading…" }),
|
|
1348
1348
|
ke && !Ce.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
|
|
1349
1349
|
"button",
|
|
1350
1350
|
{
|
|
@@ -1372,13 +1372,13 @@ function Dd({
|
|
|
1372
1372
|
" at risk"
|
|
1373
1373
|
] })
|
|
1374
1374
|
] })
|
|
1375
|
-
})), Qn = (((xa = i == null ? void 0 : i.available_values.collection) == null ? void 0 : xa.length) ?? 0) > 1, Zr = $.some((e) => !!e.unseen) || wt.size > 0 || $.some((e) =>
|
|
1375
|
+
})), Qn = (((xa = i == null ? void 0 : i.available_values.collection) == null ? void 0 : xa.length) ?? 0) > 1, Zr = $.some((e) => !!e.unseen) || wt.size > 0 || $.some((e) => Ee.isNew(F(e))), ea = [
|
|
1376
1376
|
...Qn ? [
|
|
1377
1377
|
{
|
|
1378
1378
|
key: "collection",
|
|
1379
1379
|
header: T("collection", "Collection"),
|
|
1380
1380
|
sortable: !0,
|
|
1381
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1381
|
+
render: (e) => /* @__PURE__ */ a(Ni, { variant: "outline", children: at(e.collection) })
|
|
1382
1382
|
}
|
|
1383
1383
|
] : [],
|
|
1384
1384
|
{
|
|
@@ -1393,15 +1393,15 @@ function Dd({
|
|
|
1393
1393
|
// a whole, but nothing on it said so — an underline is the one
|
|
1394
1394
|
// convention people already read as "this goes somewhere".
|
|
1395
1395
|
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
1396
|
-
wt.get(F(e)) ||
|
|
1397
|
-
|
|
1396
|
+
wt.get(F(e)) || Ee.isNew(F(e)) ? /* @__PURE__ */ a(
|
|
1397
|
+
mi,
|
|
1398
1398
|
{
|
|
1399
1399
|
lock: wt.get(F(e)),
|
|
1400
|
-
isNew:
|
|
1400
|
+
isNew: Ee.isNew(F(e)),
|
|
1401
1401
|
dataAttr: "data-queue-live-mark",
|
|
1402
1402
|
hang: !0
|
|
1403
1403
|
}
|
|
1404
|
-
) : /* @__PURE__ */ a(
|
|
1404
|
+
) : /* @__PURE__ */ a(_i, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
|
|
1405
1405
|
/* @__PURE__ */ a(
|
|
1406
1406
|
"span",
|
|
1407
1407
|
{
|
|
@@ -1420,9 +1420,9 @@ function Dd({
|
|
|
1420
1420
|
t
|
|
1421
1421
|
)),
|
|
1422
1422
|
/* @__PURE__ */ a(
|
|
1423
|
-
|
|
1423
|
+
wi,
|
|
1424
1424
|
{
|
|
1425
|
-
viewers:
|
|
1425
|
+
viewers: ml[Fs(e.collection, e.item_id)],
|
|
1426
1426
|
dataAttr: "data-queue-presence"
|
|
1427
1427
|
}
|
|
1428
1428
|
)
|
|
@@ -1442,7 +1442,7 @@ function Dd({
|
|
|
1442
1442
|
),
|
|
1443
1443
|
style: e.state_color ? {
|
|
1444
1444
|
backgroundColor: `${e.state_color}1a`,
|
|
1445
|
-
"--nvr-state-ink":
|
|
1445
|
+
"--nvr-state-ink": Zo(e.state_color),
|
|
1446
1446
|
"--nvr-state-ink-dark": e.state_color
|
|
1447
1447
|
} : void 0,
|
|
1448
1448
|
title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Fe(e.state)}` : Fe(e.state),
|
|
@@ -1457,13 +1457,13 @@ function Dd({
|
|
|
1457
1457
|
key: "owners",
|
|
1458
1458
|
header: T("owners", "Owners"),
|
|
1459
1459
|
sortable: !0,
|
|
1460
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1460
|
+
render: (e) => /* @__PURE__ */ a(Ai, { owners: e.owners })
|
|
1461
1461
|
},
|
|
1462
1462
|
{
|
|
1463
1463
|
key: "aging_hours",
|
|
1464
1464
|
header: T("aging_hours", "Aging"),
|
|
1465
1465
|
sortable: !0,
|
|
1466
|
-
render: (e) =>
|
|
1466
|
+
render: (e) => Yi(e.aging_hours)
|
|
1467
1467
|
},
|
|
1468
1468
|
{
|
|
1469
1469
|
// When the record entered its current state — the same moment Aging
|
|
@@ -1471,13 +1471,13 @@ function Dd({
|
|
|
1471
1471
|
key: "state_entered",
|
|
1472
1472
|
header: T("state_entered", "Last State Change"),
|
|
1473
1473
|
sortable: !0,
|
|
1474
|
-
render: (e) => e.state_entered_at ?
|
|
1474
|
+
render: (e) => e.state_entered_at ? Pa(e.state_entered_at) : /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
|
|
1475
1475
|
},
|
|
1476
1476
|
{
|
|
1477
1477
|
key: "sla_status",
|
|
1478
1478
|
header: T("sla_status", "SLA"),
|
|
1479
1479
|
sortable: !0,
|
|
1480
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1480
|
+
render: (e) => /* @__PURE__ */ a(zi, { status: e.sla_status })
|
|
1481
1481
|
},
|
|
1482
1482
|
{
|
|
1483
1483
|
key: "at_risk",
|
|
@@ -1496,7 +1496,7 @@ function Dd({
|
|
|
1496
1496
|
key: "addendums",
|
|
1497
1497
|
header: T("addendums", "Addendums"),
|
|
1498
1498
|
sortable: !1,
|
|
1499
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1499
|
+
render: (e) => /* @__PURE__ */ a(Ji, { summary: e.addendums })
|
|
1500
1500
|
}
|
|
1501
1501
|
] : [],
|
|
1502
1502
|
...yt ? [
|
|
@@ -1505,7 +1505,7 @@ function Dd({
|
|
|
1505
1505
|
header: T("fulfilment", "Shipped"),
|
|
1506
1506
|
sortable: !0,
|
|
1507
1507
|
render: (e) => /* @__PURE__ */ a(
|
|
1508
|
-
|
|
1508
|
+
ri,
|
|
1509
1509
|
{
|
|
1510
1510
|
collection: e.collection,
|
|
1511
1511
|
itemId: e.item_id,
|
|
@@ -1519,16 +1519,16 @@ function Dd({
|
|
|
1519
1519
|
key: "integrations",
|
|
1520
1520
|
header: T("integrations", "Integrations"),
|
|
1521
1521
|
sortable: !1,
|
|
1522
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1522
|
+
render: (e) => /* @__PURE__ */ a(oi, { rows: _l[`${e.collection}:${e.item_id}`] })
|
|
1523
1523
|
}
|
|
1524
1524
|
] : [],
|
|
1525
|
-
...
|
|
1525
|
+
...Er ? [
|
|
1526
1526
|
{
|
|
1527
1527
|
key: "tasks",
|
|
1528
1528
|
header: T("tasks", "Tasks"),
|
|
1529
1529
|
sortable: !1,
|
|
1530
1530
|
render: (e) => {
|
|
1531
|
-
const t =
|
|
1531
|
+
const t = Sl[`${e.collection}:${e.item_id}`];
|
|
1532
1532
|
return !t || t.open === 0 ? /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", children: "—" }) : /* @__PURE__ */ d(
|
|
1533
1533
|
"span",
|
|
1534
1534
|
{
|
|
@@ -1548,10 +1548,10 @@ function Dd({
|
|
|
1548
1548
|
key: "send_backs",
|
|
1549
1549
|
header: T("send_backs", "Sent back"),
|
|
1550
1550
|
sortable: !0,
|
|
1551
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1551
|
+
render: (e) => /* @__PURE__ */ a(Gi, { summary: e.send_backs })
|
|
1552
1552
|
}
|
|
1553
1553
|
] : []
|
|
1554
|
-
],
|
|
1554
|
+
], Ql = {
|
|
1555
1555
|
key: "claim",
|
|
1556
1556
|
header: "",
|
|
1557
1557
|
render: (e) => e.claimed_by ? /* @__PURE__ */ a(
|
|
@@ -1569,14 +1569,14 @@ function Dd({
|
|
|
1569
1569
|
{
|
|
1570
1570
|
type: "button",
|
|
1571
1571
|
onClick: (t) => {
|
|
1572
|
-
t.stopPropagation(),
|
|
1572
|
+
t.stopPropagation(), Ke.mutate(e);
|
|
1573
1573
|
},
|
|
1574
1574
|
className: "text-[11px] font-medium text-nvr-navy underline dark:text-nvr-cyan",
|
|
1575
1575
|
children: "Claim"
|
|
1576
1576
|
}
|
|
1577
1577
|
)
|
|
1578
|
-
}, Ft = (c == null ? void 0 : c.available_extra_fields) ?? [], ct =
|
|
1579
|
-
|
|
1578
|
+
}, Ft = (c == null ? void 0 : c.available_extra_fields) ?? [], ct = Wo("drill.queue"), W = ct.value, ta = (e) => ct.push([e]), jn = Q(null);
|
|
1579
|
+
D(() => {
|
|
1580
1580
|
var r;
|
|
1581
1581
|
if (!z || !l) return;
|
|
1582
1582
|
const e = `queue:${l}`, t = Gr(), n = fs(e, t);
|
|
@@ -1598,7 +1598,7 @@ function Dd({
|
|
|
1598
1598
|
ue,
|
|
1599
1599
|
W
|
|
1600
1600
|
]);
|
|
1601
|
-
const
|
|
1601
|
+
const jl = (e) => {
|
|
1602
1602
|
var t;
|
|
1603
1603
|
for (const n of (c == null ? void 0 : c.sources) ?? []) {
|
|
1604
1604
|
const r = (t = n.drilldown) == null ? void 0 : t[e];
|
|
@@ -1610,21 +1610,21 @@ function Dd({
|
|
|
1610
1610
|
};
|
|
1611
1611
|
}
|
|
1612
1612
|
return { enabled: !0, layout_id: null, width: null };
|
|
1613
|
-
},
|
|
1613
|
+
}, Ul = J(() => {
|
|
1614
1614
|
const e = {};
|
|
1615
1615
|
for (const t of (c == null ? void 0 : c.sources) ?? [])
|
|
1616
1616
|
for (const [n, r] of Object.entries(t.column_formats ?? {}))
|
|
1617
1617
|
n in e || (e[n] = r);
|
|
1618
1618
|
return e;
|
|
1619
|
-
}, [c == null ? void 0 : c.sources]),
|
|
1620
|
-
function
|
|
1621
|
-
if (
|
|
1622
|
-
if (
|
|
1619
|
+
}, [c == null ? void 0 : c.sources]), Vl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Il = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
|
|
1620
|
+
function Gl(e) {
|
|
1621
|
+
if (Vl.test(e)) return { text: e.split("@")[0], title: e };
|
|
1622
|
+
if (Il.test(e)) {
|
|
1623
1623
|
const t = new Date(e);
|
|
1624
1624
|
if (!Number.isNaN(t.getTime()))
|
|
1625
1625
|
return {
|
|
1626
|
-
text:
|
|
1627
|
-
title:
|
|
1626
|
+
text: js(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
|
|
1627
|
+
title: Pa(t)
|
|
1628
1628
|
};
|
|
1629
1629
|
}
|
|
1630
1630
|
return { text: e, title: e };
|
|
@@ -1633,7 +1633,7 @@ function Dd({
|
|
|
1633
1633
|
...new Set(
|
|
1634
1634
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
1635
1635
|
)
|
|
1636
|
-
] : [],
|
|
1636
|
+
] : [], Wl = je({
|
|
1637
1637
|
queries: na.map((e) => ({
|
|
1638
1638
|
queryKey: ["cbv-collection-meta", e],
|
|
1639
1639
|
queryFn: () => h.request(O(`/collections/${e}`)).then((t) => t.data),
|
|
@@ -1643,18 +1643,18 @@ function Dd({
|
|
|
1643
1643
|
}), Vn = /* @__PURE__ */ new Map();
|
|
1644
1644
|
na.forEach((e, t) => {
|
|
1645
1645
|
var r;
|
|
1646
|
-
const n = (r =
|
|
1646
|
+
const n = (r = Wl[t]) == null ? void 0 : r.data;
|
|
1647
1647
|
n && Vn.set(e, {
|
|
1648
1648
|
fields: new Map((n.fields ?? []).map((o) => [o.field, o])),
|
|
1649
1649
|
relations: n.relations ?? []
|
|
1650
1650
|
});
|
|
1651
1651
|
});
|
|
1652
|
-
const { data:
|
|
1652
|
+
const { data: Hl } = X({
|
|
1653
1653
|
queryKey: ["my-permissions"],
|
|
1654
1654
|
queryFn: () => h.request(O("/security/my/permissions")).then((e) => e.data),
|
|
1655
1655
|
enabled: Un.enabled && !Me,
|
|
1656
1656
|
staleTime: 5 * 6e4
|
|
1657
|
-
}), ra =
|
|
1657
|
+
}), ra = bi(), aa = (e, t) => {
|
|
1658
1658
|
if (t.includes(".")) return null;
|
|
1659
1659
|
const n = Vn.get(e.collection);
|
|
1660
1660
|
if (!n) return null;
|
|
@@ -1665,12 +1665,12 @@ function Dd({
|
|
|
1665
1665
|
field: n.fields.get(t),
|
|
1666
1666
|
collection: e.collection,
|
|
1667
1667
|
relations: n.relations,
|
|
1668
|
-
mayUpdate: Me ||
|
|
1668
|
+
mayUpdate: Me || Zs(Hl, e.collection)
|
|
1669
1669
|
});
|
|
1670
1670
|
}, la = (e, t, n) => {
|
|
1671
1671
|
var r, o, s;
|
|
1672
1672
|
return n === "m2o" ? ((o = (r = e.extra_ids) == null ? void 0 : r[t]) == null ? void 0 : o[0]) ?? null : ((s = e.extra) == null ? void 0 : s[t]) ?? null;
|
|
1673
|
-
},
|
|
1673
|
+
}, Jl = (e, t, n, r, o) => {
|
|
1674
1674
|
const s = (b) => `${F(e)}|${b}`, u = [...re].filter((b) => b.startsWith("extra.")).map((b) => b.slice(6)).filter((b) => !!aa(e, b)), m = o === 0 ? null : ms(u, t, o), y = (b) => b.collection === e.collection && b.item_id === e.item_id, N = (b) => y(b) ? n === "m2o" ? {
|
|
1675
1675
|
...b,
|
|
1676
1676
|
extra_ids: { ...b.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
|
|
@@ -1686,22 +1686,22 @@ function Dd({
|
|
|
1686
1686
|
next: m ? s(m) : null,
|
|
1687
1687
|
optimistic: () => {
|
|
1688
1688
|
const b = f.getQueriesData({ queryKey: ["queue-items", l] });
|
|
1689
|
-
return f.setQueriesData({ queryKey: ["queue-items", l] }, (
|
|
1690
|
-
const v =
|
|
1691
|
-
return Array.isArray(v == null ? void 0 : v.data) ? { ...v, data: v.data.map(N) } : Array.isArray(v == null ? void 0 : v.rows) ? { ...v, rows: v.rows.map(N) } :
|
|
1689
|
+
return f.setQueriesData({ queryKey: ["queue-items", l] }, (E) => {
|
|
1690
|
+
const v = E;
|
|
1691
|
+
return Array.isArray(v == null ? void 0 : v.data) ? { ...v, data: v.data.map(N) } : Array.isArray(v == null ? void 0 : v.rows) ? { ...v, rows: v.rows.map(N) } : E;
|
|
1692
1692
|
}), () => {
|
|
1693
|
-
for (const [
|
|
1693
|
+
for (const [E, v] of b) f.setQueryData(E, v);
|
|
1694
1694
|
};
|
|
1695
1695
|
},
|
|
1696
1696
|
// Labels, rollups and the row's place in the queue follow the server.
|
|
1697
1697
|
onSaved: () => void f.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
1698
1698
|
});
|
|
1699
|
-
},
|
|
1699
|
+
}, Yl = (e, t, n) => {
|
|
1700
1700
|
const r = aa(e, t);
|
|
1701
1701
|
if (!r) return n;
|
|
1702
1702
|
const o = Vn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
|
|
1703
1703
|
return /* @__PURE__ */ a(
|
|
1704
|
-
|
|
1704
|
+
hi,
|
|
1705
1705
|
{
|
|
1706
1706
|
controller: ra,
|
|
1707
1707
|
cellKey: `${F(e)}|${t}`,
|
|
@@ -1710,23 +1710,23 @@ function Dd({
|
|
|
1710
1710
|
label: T(`extra.${t}`, Ve(t)),
|
|
1711
1711
|
choices: s ? ds(s) : void 0,
|
|
1712
1712
|
target: r === "m2o" && o ? cs(o.relations, e.collection, t) : null,
|
|
1713
|
-
onCommit: (u, m) =>
|
|
1713
|
+
onCommit: (u, m) => Jl(e, t, r, u, m),
|
|
1714
1714
|
children: n
|
|
1715
1715
|
}
|
|
1716
1716
|
);
|
|
1717
|
-
},
|
|
1717
|
+
}, zl = Ft.map((e) => ({
|
|
1718
1718
|
key: `extra.${e}`,
|
|
1719
1719
|
header: T(`extra.${e}`, Ve(e)),
|
|
1720
1720
|
sortable: !0,
|
|
1721
|
-
render: (t) =>
|
|
1721
|
+
render: (t) => Yl(t, e, Xl(t, e))
|
|
1722
1722
|
}));
|
|
1723
|
-
function
|
|
1723
|
+
function Xl(e, t) {
|
|
1724
1724
|
var n, r;
|
|
1725
1725
|
{
|
|
1726
1726
|
const o = (n = e.extra) == null ? void 0 : n[t];
|
|
1727
1727
|
if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
1728
|
-
const s = Ne(t), u = ((c == null ? void 0 : c.extra_field_meta) ?? []).find((v) => v.path === t), m = s ? Ue(String(o), s) :
|
|
1729
|
-
return (u == null ? void 0 : u.kind) === "relation" && u.target_collection && b.length > 0 &&
|
|
1728
|
+
const s = Ne(t), u = ((c == null ? void 0 : c.extra_field_meta) ?? []).find((v) => v.path === t), m = s ? Ue(String(o), s) : Kt(u, String(o)), { text: y, title: N } = Gl(m), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], E = jl(t);
|
|
1729
|
+
return (u == null ? void 0 : u.kind) === "relation" && u.target_collection && b.length > 0 && E.enabled && !u.aggregate ? /* @__PURE__ */ a(
|
|
1730
1730
|
"button",
|
|
1731
1731
|
{
|
|
1732
1732
|
type: "button",
|
|
@@ -1734,8 +1734,8 @@ function Dd({
|
|
|
1734
1734
|
v.stopPropagation(), ta({
|
|
1735
1735
|
collection: u.target_collection,
|
|
1736
1736
|
itemId: b[0],
|
|
1737
|
-
layoutId:
|
|
1738
|
-
width:
|
|
1737
|
+
layoutId: E.layout_id,
|
|
1738
|
+
width: E.width,
|
|
1739
1739
|
title: m
|
|
1740
1740
|
});
|
|
1741
1741
|
},
|
|
@@ -1769,9 +1769,9 @@ function Dd({
|
|
|
1769
1769
|
...yt ? ["fulfilment"] : [],
|
|
1770
1770
|
...qe ? ["integrations"] : [],
|
|
1771
1771
|
...kt ? ["send_backs"] : [],
|
|
1772
|
-
...
|
|
1772
|
+
...Er ? ["tasks"] : [],
|
|
1773
1773
|
...Ft.map((e) => `extra.${e}`)
|
|
1774
|
-
],
|
|
1774
|
+
], Zl = [
|
|
1775
1775
|
...Qn ? ["collection"] : [],
|
|
1776
1776
|
"state",
|
|
1777
1777
|
"owners",
|
|
@@ -1783,29 +1783,29 @@ function Dd({
|
|
|
1783
1783
|
"sla_status",
|
|
1784
1784
|
"at_risk",
|
|
1785
1785
|
...Ft.slice(0, 2).map((e) => `extra.${e}`)
|
|
1786
|
-
],
|
|
1786
|
+
], eo = (p == null ? void 0 : p.default_columns) ?? null, In = xt ?? eo, re = new Set(In ?? Zl);
|
|
1787
1787
|
rt && !Mt.has("addendums") && re.add("addendums"), yt && !Mt.has("fulfilment") && re.add("fulfilment"), qe && !Mt.has("integrations") && re.add("integrations"), kt && !Mt.has("send_backs") && re.add("send_backs");
|
|
1788
|
-
const
|
|
1789
|
-
for (const e of
|
|
1788
|
+
const to = new Set(Me ? [] : (p == null ? void 0 : p.admin_only_columns) ?? []);
|
|
1789
|
+
for (const e of to) re.delete(e);
|
|
1790
1790
|
const Lt = [
|
|
1791
1791
|
...(In ?? []).filter((e) => oa.includes(e)),
|
|
1792
1792
|
...oa.filter((e) => !(In ?? []).includes(e))
|
|
1793
|
-
],
|
|
1794
|
-
function
|
|
1793
|
+
], no = bo(ho(fo, { activationConstraint: { distance: 4 } }));
|
|
1794
|
+
function ro(e) {
|
|
1795
1795
|
const { active: t, over: n } = e;
|
|
1796
1796
|
if (!n || t.id === n.id) return;
|
|
1797
1797
|
const r = Lt.indexOf(String(t.id)), o = Lt.indexOf(String(n.id));
|
|
1798
1798
|
r === -1 || o === -1 || Ht(
|
|
1799
|
-
|
|
1799
|
+
vo(Lt, r, o).filter((s) => re.has(s))
|
|
1800
1800
|
);
|
|
1801
1801
|
}
|
|
1802
|
-
const sa = ea.find((e) => e.key === "label"),
|
|
1802
|
+
const sa = ea.find((e) => e.key === "label"), ao = {
|
|
1803
1803
|
...sa,
|
|
1804
1804
|
render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
1805
|
-
/* @__PURE__ */ a(
|
|
1805
|
+
/* @__PURE__ */ a(Js, { rowId: e.item_id }),
|
|
1806
1806
|
sa.render(e, ...t)
|
|
1807
1807
|
] })
|
|
1808
|
-
},
|
|
1808
|
+
}, lo = ((p == null ? void 0 : p.formula_columns) ?? []).map(
|
|
1809
1809
|
(e) => ({
|
|
1810
1810
|
key: `formula.${e.key}`,
|
|
1811
1811
|
header: e.label,
|
|
@@ -1813,7 +1813,7 @@ function Dd({
|
|
|
1813
1813
|
const n = {
|
|
1814
1814
|
...t,
|
|
1815
1815
|
...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([s, u]) => [`extra.${s}`, u])) : {}
|
|
1816
|
-
}, r =
|
|
1816
|
+
}, r = es(e.formula, (s) => {
|
|
1817
1817
|
const u = n[s] ?? (t.extra ? t.extra[s] : void 0), m = Number(u);
|
|
1818
1818
|
return Number.isFinite(m) ? m : u ?? null;
|
|
1819
1819
|
});
|
|
@@ -1822,7 +1822,7 @@ function Dd({
|
|
|
1822
1822
|
return Number.isFinite(o) ? /* @__PURE__ */ a("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ a("span", { children: String(r) });
|
|
1823
1823
|
}
|
|
1824
1824
|
})
|
|
1825
|
-
), Gn = [...ea, ...
|
|
1825
|
+
), Gn = [...ea, ...zl, ...lo], ia = Ri(
|
|
1826
1826
|
Lt,
|
|
1827
1827
|
(e) => {
|
|
1828
1828
|
var n;
|
|
@@ -1830,23 +1830,23 @@ function Dd({
|
|
|
1830
1830
|
return typeof t == "string" ? t : e;
|
|
1831
1831
|
},
|
|
1832
1832
|
re
|
|
1833
|
-
),
|
|
1833
|
+
), oo = {
|
|
1834
1834
|
key: "__actions__",
|
|
1835
1835
|
header: "",
|
|
1836
1836
|
render: (e) => e.collection === "tasks" || e.collection === sn ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
|
|
1837
|
-
|
|
1837
|
+
Xs,
|
|
1838
1838
|
{
|
|
1839
1839
|
collection: e.collection,
|
|
1840
1840
|
id: e.item_id,
|
|
1841
1841
|
label: e.label,
|
|
1842
1842
|
hasPipeline: e.state != null,
|
|
1843
1843
|
onOpen: () => lt(e),
|
|
1844
|
-
onPeek: () =>
|
|
1844
|
+
onPeek: () => De(e),
|
|
1845
1845
|
urlFor: Y.urlFor,
|
|
1846
1846
|
onDeleted: () => {
|
|
1847
1847
|
h.request(zn(`/items/${e.collection}/${e.item_id}`)).then(() => {
|
|
1848
|
-
|
|
1849
|
-
}).catch((t) =>
|
|
1848
|
+
A.success("Moved to trash"), f.invalidateQueries({ queryKey: ["queue-items", l] });
|
|
1849
|
+
}).catch((t) => A.error(dt(t, "Delete failed")));
|
|
1850
1850
|
},
|
|
1851
1851
|
onAfterTransition: () => void f.invalidateQueries({ queryKey: ["queue-items", l] }),
|
|
1852
1852
|
bulkEnabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
|
|
@@ -1854,12 +1854,12 @@ function Dd({
|
|
|
1854
1854
|
}
|
|
1855
1855
|
) })
|
|
1856
1856
|
}, Tt = [
|
|
1857
|
-
|
|
1857
|
+
ao,
|
|
1858
1858
|
...Lt.filter((e) => re.has(e)).map((e) => Gn.find((t) => t.key === e)).filter((e) => e !== void 0),
|
|
1859
|
-
...ge ? [
|
|
1860
|
-
|
|
1859
|
+
...ge ? [Ql] : [],
|
|
1860
|
+
oo
|
|
1861
1861
|
], [Wn, ca] = w(!1);
|
|
1862
|
-
async function
|
|
1862
|
+
async function so() {
|
|
1863
1863
|
if (!(!c || Wn)) {
|
|
1864
1864
|
ca(!0);
|
|
1865
1865
|
try {
|
|
@@ -1876,7 +1876,7 @@ function Dd({
|
|
|
1876
1876
|
), N = y.data ?? [];
|
|
1877
1877
|
if (t.push(...N), N.length < 100 || t.length >= (y.total ?? 0)) break;
|
|
1878
1878
|
}
|
|
1879
|
-
const n = (m) => (c.extra_field_meta ?? []).find((y) => y.path === m), r =
|
|
1879
|
+
const n = (m) => (c.extra_field_meta ?? []).find((y) => y.path === m), r = Ui(
|
|
1880
1880
|
t.slice(0, 1e4),
|
|
1881
1881
|
Tt.map((m) => ({
|
|
1882
1882
|
key: m.key,
|
|
@@ -1887,7 +1887,7 @@ function Dd({
|
|
|
1887
1887
|
collectionLabel: at,
|
|
1888
1888
|
extraText: (m, y) => {
|
|
1889
1889
|
const N = Ne(m);
|
|
1890
|
-
return N && N.type !== "number" ? Ue(y, N) :
|
|
1890
|
+
return N && N.type !== "number" ? Ue(y, N) : Kt(n(m), y);
|
|
1891
1891
|
},
|
|
1892
1892
|
extraIsNumber: (m) => {
|
|
1893
1893
|
var y;
|
|
@@ -1895,11 +1895,11 @@ function Dd({
|
|
|
1895
1895
|
}
|
|
1896
1896
|
}
|
|
1897
1897
|
), o = new Blob([r], { type: "text/csv;charset=utf-8" }), s = URL.createObjectURL(o), u = document.createElement("a");
|
|
1898
|
-
u.href = s, u.download =
|
|
1898
|
+
u.href = s, u.download = Vi(c.name), document.body.appendChild(u), u.click(), u.remove(), setTimeout(() => URL.revokeObjectURL(s), 1e3), A.success(
|
|
1899
1899
|
t.length >= 1e4 ? `Exported the first ${1e4.toLocaleString("en-US")} rows` : `Exported ${t.length.toLocaleString("en-US")} ${t.length === 1 ? "row" : "rows"}`
|
|
1900
1900
|
);
|
|
1901
1901
|
} catch (e) {
|
|
1902
|
-
|
|
1902
|
+
A.error(dt(e, "Could not export this worklist"));
|
|
1903
1903
|
} finally {
|
|
1904
1904
|
ca(!1);
|
|
1905
1905
|
}
|
|
@@ -1932,7 +1932,7 @@ function Dd({
|
|
|
1932
1932
|
}
|
|
1933
1933
|
const u = [...o, ...s], m = u.length ? Ts(
|
|
1934
1934
|
e.target_collection,
|
|
1935
|
-
await
|
|
1935
|
+
await Es(h, f, e.target_collection),
|
|
1936
1936
|
u
|
|
1937
1937
|
) : null, y = [
|
|
1938
1938
|
...t.trim() ? [{ [e.display_field]: { _contains: t.trim() } }] : [],
|
|
@@ -1941,12 +1941,12 @@ function Dd({
|
|
|
1941
1941
|
y.length > 0 && (r.filter = JSON.stringify(y.length === 1 ? y[0] : { _and: y }));
|
|
1942
1942
|
const b = (await h.request(
|
|
1943
1943
|
O(`/items/${e.target_collection}`, r)
|
|
1944
|
-
)).data ?? [],
|
|
1944
|
+
)).data ?? [], E = Ne(e.path), v = he[e.path] ? new Set(he[e.path]) : null, ae = /* @__PURE__ */ new Set(), pe = [];
|
|
1945
1945
|
for (const q of b) {
|
|
1946
1946
|
const V = q[e.display_field];
|
|
1947
1947
|
if (V == null || V === "") continue;
|
|
1948
1948
|
const H = String(V);
|
|
1949
|
-
ae.has(H) || v && !v.has(H) || (ae.add(H), pe.push({ label:
|
|
1949
|
+
ae.has(H) || v && !v.has(H) || (ae.add(H), pe.push({ label: E ? Ue(H, E) : H, value: H }));
|
|
1950
1950
|
}
|
|
1951
1951
|
return pe;
|
|
1952
1952
|
}, an = new Map(((c == null ? void 0 : c.extra_field_meta) ?? []).map((e) => [e.path, e])), Qe = [
|
|
@@ -2031,7 +2031,7 @@ function Dd({
|
|
|
2031
2031
|
key: "integrations",
|
|
2032
2032
|
placeholder: T("integrations", "Integrations"),
|
|
2033
2033
|
type: "select",
|
|
2034
|
-
options:
|
|
2034
|
+
options: si.map((e) => ({ label: e.label, value: e.value }))
|
|
2035
2035
|
}
|
|
2036
2036
|
] : [],
|
|
2037
2037
|
...yt ? [
|
|
@@ -2039,7 +2039,7 @@ function Dd({
|
|
|
2039
2039
|
key: "fulfilment",
|
|
2040
2040
|
placeholder: "Shipped",
|
|
2041
2041
|
type: "select",
|
|
2042
|
-
options:
|
|
2042
|
+
options: ai
|
|
2043
2043
|
}
|
|
2044
2044
|
] : [],
|
|
2045
2045
|
...kt ? [
|
|
@@ -2106,7 +2106,7 @@ function Dd({
|
|
|
2106
2106
|
// not only on an empty one (army 11 Q2-1).
|
|
2107
2107
|
restricted: !!((m = he[e]) != null && m.length),
|
|
2108
2108
|
options: s.map((N) => ({
|
|
2109
|
-
label: o ? Ue(N, o) :
|
|
2109
|
+
label: o ? Ue(N, o) : Kt(t, N),
|
|
2110
2110
|
value: N
|
|
2111
2111
|
}))
|
|
2112
2112
|
} : (t == null ? void 0 : t.kind) === "relation" ? {
|
|
@@ -2127,13 +2127,13 @@ function Dd({
|
|
|
2127
2127
|
const e = [];
|
|
2128
2128
|
for (const [o, s] of Object.entries(Oe)) {
|
|
2129
2129
|
if (!s || Array.isArray(s) && s.length === 0) continue;
|
|
2130
|
-
const u = Qe.find((b) => b.key === o), m = o.startsWith("extra.") ? o.slice(6) : null, y = m ? Ne(m) : null, N =
|
|
2130
|
+
const u = Qe.find((b) => b.key === o), m = o.startsWith("extra.") ? o.slice(6) : null, y = m ? Ne(m) : null, N = ts({
|
|
2131
2131
|
field: Jn(o),
|
|
2132
2132
|
type: (u == null ? void 0 : u.type) ?? "select",
|
|
2133
2133
|
value: s,
|
|
2134
2134
|
optionLabel: (b) => {
|
|
2135
|
-
var
|
|
2136
|
-
return (v = (
|
|
2135
|
+
var E, v;
|
|
2136
|
+
return (v = (E = u == null ? void 0 : u.options) == null ? void 0 : E.find((ae) => ae.value === b)) == null ? void 0 : v.label;
|
|
2137
2137
|
},
|
|
2138
2138
|
currency: (y == null ? void 0 : y.type) === "number" && y.prefix === "$",
|
|
2139
2139
|
rangeUnit: u == null ? void 0 : u.range_unit
|
|
@@ -2141,7 +2141,7 @@ function Dd({
|
|
|
2141
2141
|
N && e.push(N);
|
|
2142
2142
|
}
|
|
2143
2143
|
const t = i == null ? void 0 : i.total;
|
|
2144
|
-
return
|
|
2144
|
+
return ns({
|
|
2145
2145
|
noun: "items",
|
|
2146
2146
|
scope: g === "mine" ? "you own" : g === "unowned" ? "with no owners" : g === "claimed" ? "you claimed" : null,
|
|
2147
2147
|
viewName: ((r = (n = G == null ? void 0 : G.data) == null ? void 0 : n.find((o) => o.id === ot)) == null ? void 0 : r.name) ?? null,
|
|
@@ -2149,7 +2149,7 @@ function Dd({
|
|
|
2149
2149
|
shown: typeof t == "number" ? t : null,
|
|
2150
2150
|
of: (x == null ? void 0 : x.total) ?? null
|
|
2151
2151
|
});
|
|
2152
|
-
})(),
|
|
2152
|
+
})(), Et = new Set(Object.keys(fe.current)), io = ((e) => {
|
|
2153
2153
|
var n;
|
|
2154
2154
|
if (e.some((r) => r.key === "state")) return e;
|
|
2155
2155
|
const t = Qe.find((r) => r.key === "state");
|
|
@@ -2161,23 +2161,23 @@ function Dd({
|
|
|
2161
2161
|
var ae, pe, q;
|
|
2162
2162
|
if (!s.key.startsWith("extra.")) return null;
|
|
2163
2163
|
if (s.type === "combobox") return s;
|
|
2164
|
-
const u = s.key.slice(6), m = an.get(u), y =
|
|
2164
|
+
const u = s.key.slice(6), m = an.get(u), y = Et.has(s.key);
|
|
2165
2165
|
if ((m == null ? void 0 : m.kind) !== "relation" && !y) return null;
|
|
2166
|
-
const N = Ne(u), b = (ae = i == null ? void 0 : i.available_values.extra) == null ? void 0 : ae[u],
|
|
2166
|
+
const N = Ne(u), b = (ae = i == null ? void 0 : i.available_values.extra) == null ? void 0 : ae[u], E = s.placeholder.replace(/^Search (.*)…$/, "$1"), v = (m == null ? void 0 : m.kind) === "relation" && m.target_collection && m.display_field ? { collection: m.target_collection, field: m.display_field } : void 0;
|
|
2167
2167
|
return b != null && b.length ? {
|
|
2168
2168
|
key: s.key,
|
|
2169
|
-
placeholder:
|
|
2169
|
+
placeholder: E,
|
|
2170
2170
|
type: "combobox",
|
|
2171
2171
|
multi: !0,
|
|
2172
2172
|
cascade: v,
|
|
2173
2173
|
restricted: !!((pe = he[u]) != null && pe.length),
|
|
2174
2174
|
options: b.map((V) => ({
|
|
2175
|
-
label: N && N.type !== "number" ? Ue(V, N) :
|
|
2175
|
+
label: N && N.type !== "number" ? Ue(V, N) : Kt(m, V),
|
|
2176
2176
|
value: V
|
|
2177
2177
|
}))
|
|
2178
2178
|
} : (m == null ? void 0 : m.kind) === "relation" ? {
|
|
2179
2179
|
key: s.key,
|
|
2180
|
-
placeholder:
|
|
2180
|
+
placeholder: E,
|
|
2181
2181
|
type: "combobox",
|
|
2182
2182
|
multi: !0,
|
|
2183
2183
|
cascade: v,
|
|
@@ -2198,22 +2198,22 @@ function Dd({
|
|
|
2198
2198
|
if (!v.key.startsWith("extra.") || u.has(v.key)) return !1;
|
|
2199
2199
|
const ae = v.key.slice(6);
|
|
2200
2200
|
return ((pe = an.get(ae)) == null ? void 0 : pe.target_collection) === m.collection;
|
|
2201
|
-
}),
|
|
2202
|
-
N =
|
|
2201
|
+
}), E = b.find((v) => v.key.slice(6).startsWith(`${y}.`)) ?? b[0];
|
|
2202
|
+
N = E ? e(E) : null;
|
|
2203
2203
|
}
|
|
2204
2204
|
!N || u.has(N.key) || (u.add(N.key), s.push(m.label ? { ...N, placeholder: m.label } : N));
|
|
2205
2205
|
}
|
|
2206
2206
|
for (const m of Qe.map(e))
|
|
2207
|
-
m && !u.has(m.key) && (
|
|
2207
|
+
m && !u.has(m.key) && (Et.has(m.key) || m.restricted) && s.push(m);
|
|
2208
2208
|
if (s.length > 0) return s;
|
|
2209
2209
|
}
|
|
2210
2210
|
const t = Hn.map(e).filter((s) => s !== null), r = [
|
|
2211
|
-
...t.filter((s) =>
|
|
2212
|
-
...t.filter((s) => !
|
|
2211
|
+
...t.filter((s) => Et.has(s.key) || s.restricted),
|
|
2212
|
+
...t.filter((s) => !Et.has(s.key) && !s.restricted)
|
|
2213
2213
|
].slice(0, 6);
|
|
2214
2214
|
return r.length > 0 ? r : Hn.filter((s) => s.key === "state" || s.key === "owners");
|
|
2215
2215
|
})()
|
|
2216
|
-
),
|
|
2216
|
+
), co = (x == null ? void 0 : x.sla_tracked) !== 0 || _.sla_status === "warning" || _.sla_status === "breached", uo = (() => {
|
|
2217
2217
|
if (!x) return null;
|
|
2218
2218
|
const e = I ?? x, t = [
|
|
2219
2219
|
{
|
|
@@ -2247,7 +2247,7 @@ function Dd({
|
|
|
2247
2247
|
tone: "text-slate-600 dark:text-slate-300",
|
|
2248
2248
|
on: g === "unowned",
|
|
2249
2249
|
toggle: () => {
|
|
2250
|
-
te(g === "unowned" ? "all" : "unowned"),
|
|
2250
|
+
te(g === "unowned" ? "all" : "unowned"), P(1);
|
|
2251
2251
|
}
|
|
2252
2252
|
}
|
|
2253
2253
|
].filter((n) => n.n > 0 || n.on);
|
|
@@ -2285,17 +2285,17 @@ function Dd({
|
|
|
2285
2285
|
}
|
|
2286
2286
|
);
|
|
2287
2287
|
})();
|
|
2288
|
-
function
|
|
2288
|
+
function mo(e) {
|
|
2289
2289
|
const t = new Set(re);
|
|
2290
2290
|
t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && nr((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && nr((n) => {
|
|
2291
2291
|
const r = new Set(n);
|
|
2292
2292
|
return r.delete(e), r;
|
|
2293
2293
|
})), Ht([...t]);
|
|
2294
2294
|
}
|
|
2295
|
-
return jt ? (
|
|
2295
|
+
return jt ? (K == null ? void 0 : K((jt == null ? void 0 : jt.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
|
|
2296
2296
|
/* @__PURE__ */ d("div", { className: "shrink-0", children: [
|
|
2297
2297
|
(i == null ? void 0 : i.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
|
|
2298
|
-
/* @__PURE__ */ a(
|
|
2298
|
+
/* @__PURE__ */ a(So, { className: "h-4 w-4 shrink-0" }),
|
|
2299
2299
|
/* @__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." })
|
|
2300
2300
|
] }),
|
|
2301
2301
|
/* @__PURE__ */ d(
|
|
@@ -2304,13 +2304,13 @@ function Dd({
|
|
|
2304
2304
|
className: "flex flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-4 py-2.5 dark:border-slate-700 dark:bg-slate-900",
|
|
2305
2305
|
"data-queue-toolbar": !0,
|
|
2306
2306
|
children: [
|
|
2307
|
-
z ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children:
|
|
2307
|
+
z ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: Hi.filter((e) => ge || e.value !== "claimed").map(
|
|
2308
2308
|
(e, t) => /* @__PURE__ */ a(
|
|
2309
2309
|
"button",
|
|
2310
2310
|
{
|
|
2311
2311
|
type: "button",
|
|
2312
2312
|
onClick: () => {
|
|
2313
|
-
te(e.value),
|
|
2313
|
+
te(e.value), P(1);
|
|
2314
2314
|
},
|
|
2315
2315
|
className: L(
|
|
2316
2316
|
"flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
|
|
@@ -2322,13 +2322,13 @@ function Dd({
|
|
|
2322
2322
|
e.value
|
|
2323
2323
|
)
|
|
2324
2324
|
) }) : /* @__PURE__ */ a("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
2325
|
-
z ?
|
|
2325
|
+
z ? Ae.length <= 1 ? null : (
|
|
2326
2326
|
// One allowed view means nothing to switch to — no button.
|
|
2327
2327
|
/* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
|
|
2328
2328
|
{ value: "table", label: "Table" },
|
|
2329
2329
|
{ value: "kanban", label: "Kanban" },
|
|
2330
2330
|
{ value: "workload", label: "Workload" }
|
|
2331
|
-
].filter((e) =>
|
|
2331
|
+
].filter((e) => Ae.includes(e.value)).map((e, t) => /* @__PURE__ */ a(
|
|
2332
2332
|
"button",
|
|
2333
2333
|
{
|
|
2334
2334
|
type: "button",
|
|
@@ -2373,13 +2373,13 @@ function Dd({
|
|
|
2373
2373
|
}),
|
|
2374
2374
|
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"}`,
|
|
2375
2375
|
children: [
|
|
2376
|
-
/* @__PURE__ */ a(
|
|
2376
|
+
/* @__PURE__ */ a(Co, { className: "h-3.5 w-3.5" }),
|
|
2377
2377
|
"Active addendums"
|
|
2378
2378
|
]
|
|
2379
2379
|
}
|
|
2380
2380
|
),
|
|
2381
2381
|
qe && /* @__PURE__ */ a(
|
|
2382
|
-
|
|
2382
|
+
ii,
|
|
2383
2383
|
{
|
|
2384
2384
|
label: T("integrations", "Integrations"),
|
|
2385
2385
|
value: _.integrations,
|
|
@@ -2389,16 +2389,16 @@ function Dd({
|
|
|
2389
2389
|
})
|
|
2390
2390
|
}
|
|
2391
2391
|
),
|
|
2392
|
-
/* @__PURE__ */ a(
|
|
2393
|
-
/* @__PURE__ */ a(
|
|
2392
|
+
/* @__PURE__ */ a(yi, { className: "h-8" }),
|
|
2393
|
+
/* @__PURE__ */ a(ni, {}),
|
|
2394
2394
|
mn > 0 && /* @__PURE__ */ d(
|
|
2395
2395
|
"button",
|
|
2396
2396
|
{
|
|
2397
2397
|
type: "button",
|
|
2398
|
-
onClick:
|
|
2398
|
+
onClick: kl,
|
|
2399
2399
|
className: "nvr-pop-in flex h-8 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-2.5 text-[12px] font-medium transition-colors text-nvr-navy hover:bg-nvr-cyan/20 dark:text-nvr-cyan",
|
|
2400
2400
|
children: [
|
|
2401
|
-
/* @__PURE__ */ a(
|
|
2401
|
+
/* @__PURE__ */ a($o, { className: "h-3 w-3" }),
|
|
2402
2402
|
mn,
|
|
2403
2403
|
" update",
|
|
2404
2404
|
mn === 1 ? "" : "s",
|
|
@@ -2422,10 +2422,10 @@ function Dd({
|
|
|
2422
2422
|
]
|
|
2423
2423
|
}
|
|
2424
2424
|
) }),
|
|
2425
|
-
/* @__PURE__ */ a(pt, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(
|
|
2426
|
-
/* @__PURE__ */ a(
|
|
2427
|
-
/* @__PURE__ */ d(
|
|
2428
|
-
/* @__PURE__ */ a(
|
|
2425
|
+
/* @__PURE__ */ a(pt, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Ma, { children: [
|
|
2426
|
+
/* @__PURE__ */ a(Si, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
|
|
2427
|
+
/* @__PURE__ */ d(Ba, { children: [
|
|
2428
|
+
/* @__PURE__ */ a(Ci, { children: "No attribute found." }),
|
|
2429
2429
|
/* @__PURE__ */ a(Ot, { value: "__none__", onSelect: () => bt(null), children: "None" }),
|
|
2430
2430
|
ua.map((e) => /* @__PURE__ */ a(
|
|
2431
2431
|
Ot,
|
|
@@ -2444,14 +2444,14 @@ function Dd({
|
|
|
2444
2444
|
{
|
|
2445
2445
|
type: "button",
|
|
2446
2446
|
onClick: () => {
|
|
2447
|
-
Ge(B === "-priority" ? "" : "-priority"),
|
|
2447
|
+
Ge(B === "-priority" ? "" : "-priority"), P(1);
|
|
2448
2448
|
},
|
|
2449
2449
|
className: L(
|
|
2450
2450
|
"flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
|
|
2451
2451
|
B === "-priority" ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
|
|
2452
2452
|
),
|
|
2453
2453
|
children: [
|
|
2454
|
-
/* @__PURE__ */ a(
|
|
2454
|
+
/* @__PURE__ */ a(qo, { className: "h-3.5 w-3.5" }),
|
|
2455
2455
|
"Priority"
|
|
2456
2456
|
]
|
|
2457
2457
|
}
|
|
@@ -2482,7 +2482,7 @@ function Dd({
|
|
|
2482
2482
|
]
|
|
2483
2483
|
}
|
|
2484
2484
|
) }),
|
|
2485
|
-
/* @__PURE__ */ a(pt, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(
|
|
2485
|
+
/* @__PURE__ */ a(pt, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(Ma, { children: /* @__PURE__ */ d(Ba, { children: [
|
|
2486
2486
|
/* @__PURE__ */ a(Ot, { value: "none", onSelect: () => dn(null), children: "None" }),
|
|
2487
2487
|
/* @__PURE__ */ a(Ot, { value: "collection", onSelect: () => dn("collection"), children: "Collection" }),
|
|
2488
2488
|
/* @__PURE__ */ a(Ot, { value: "owner", onSelect: () => dn("owners"), children: "Owner" })
|
|
@@ -2497,24 +2497,24 @@ function Dd({
|
|
|
2497
2497
|
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",
|
|
2498
2498
|
"data-queue-ask": !0,
|
|
2499
2499
|
children: [
|
|
2500
|
-
/* @__PURE__ */ a(
|
|
2500
|
+
/* @__PURE__ */ a(Ro, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
|
|
2501
2501
|
"Ask about this queue"
|
|
2502
2502
|
]
|
|
2503
2503
|
}
|
|
2504
2504
|
),
|
|
2505
|
-
/* @__PURE__ */ a(
|
|
2505
|
+
/* @__PURE__ */ a(pi, { listKey: `queue:${l}`, getState: Gr }),
|
|
2506
2506
|
C === "table" && /* @__PURE__ */ d(
|
|
2507
2507
|
"button",
|
|
2508
2508
|
{
|
|
2509
2509
|
type: "button",
|
|
2510
|
-
onClick: () => void
|
|
2510
|
+
onClick: () => void so(),
|
|
2511
2511
|
disabled: Wn || !i || (i.total ?? 0) === 0,
|
|
2512
2512
|
"data-tip": "Download the rows on this tab, with these filters and columns, as a spreadsheet (CSV)",
|
|
2513
2513
|
"aria-label": "Export to CSV",
|
|
2514
2514
|
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 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
|
|
2515
2515
|
"data-queue-export": !0,
|
|
2516
2516
|
children: [
|
|
2517
|
-
/* @__PURE__ */ a(
|
|
2517
|
+
/* @__PURE__ */ a(Fo, { className: "h-3.5 w-3.5" }),
|
|
2518
2518
|
Wn ? "Exporting…" : "Export"
|
|
2519
2519
|
]
|
|
2520
2520
|
}
|
|
@@ -2523,7 +2523,7 @@ function Dd({
|
|
|
2523
2523
|
"button",
|
|
2524
2524
|
{
|
|
2525
2525
|
type: "button",
|
|
2526
|
-
onClick: () =>
|
|
2526
|
+
onClick: () => tl((e) => !e),
|
|
2527
2527
|
"aria-expanded": ft,
|
|
2528
2528
|
title: "Trends, aging, pace and states",
|
|
2529
2529
|
className: L(
|
|
@@ -2532,7 +2532,7 @@ function Dd({
|
|
|
2532
2532
|
),
|
|
2533
2533
|
"data-queue-insights-toggle": !0,
|
|
2534
2534
|
children: [
|
|
2535
|
-
/* @__PURE__ */ a(
|
|
2535
|
+
/* @__PURE__ */ a(Lo, { className: "h-3.5 w-3.5" }),
|
|
2536
2536
|
"Insights"
|
|
2537
2537
|
]
|
|
2538
2538
|
}
|
|
@@ -2544,26 +2544,26 @@ function Dd({
|
|
|
2544
2544
|
type: "button",
|
|
2545
2545
|
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",
|
|
2546
2546
|
children: [
|
|
2547
|
-
/* @__PURE__ */ a(
|
|
2547
|
+
/* @__PURE__ */ a(To, { className: "h-3.5 w-3.5" }),
|
|
2548
2548
|
"Columns"
|
|
2549
2549
|
]
|
|
2550
2550
|
}
|
|
2551
2551
|
) }),
|
|
2552
2552
|
/* @__PURE__ */ a(pt, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ a(
|
|
2553
|
-
|
|
2553
|
+
go,
|
|
2554
2554
|
{
|
|
2555
|
-
sensors:
|
|
2556
|
-
collisionDetection:
|
|
2557
|
-
onDragEnd:
|
|
2558
|
-
children: /* @__PURE__ */ a(
|
|
2555
|
+
sensors: no,
|
|
2556
|
+
collisionDetection: xo,
|
|
2557
|
+
onDragEnd: ro,
|
|
2558
|
+
children: /* @__PURE__ */ a(yo, { items: ia, strategy: ko, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: ia.map((e) => {
|
|
2559
2559
|
const t = Gn.find((n) => n.key === e);
|
|
2560
2560
|
return /* @__PURE__ */ a(
|
|
2561
|
-
|
|
2561
|
+
ec,
|
|
2562
2562
|
{
|
|
2563
2563
|
id: e,
|
|
2564
2564
|
label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
|
|
2565
2565
|
checked: re.has(e),
|
|
2566
|
-
onCheckedChange: () =>
|
|
2566
|
+
onCheckedChange: () => mo(e)
|
|
2567
2567
|
},
|
|
2568
2568
|
e
|
|
2569
2569
|
);
|
|
@@ -2575,13 +2575,13 @@ function Dd({
|
|
|
2575
2575
|
"button",
|
|
2576
2576
|
{
|
|
2577
2577
|
type: "button",
|
|
2578
|
-
onClick:
|
|
2578
|
+
onClick: Dl,
|
|
2579
2579
|
"aria-pressed": ne,
|
|
2580
2580
|
"data-queue-bulk-mode": ne ? "on" : "off",
|
|
2581
2581
|
"data-tip": ne ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
|
|
2582
2582
|
className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${ne ? "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"}`,
|
|
2583
2583
|
children: [
|
|
2584
|
-
/* @__PURE__ */ a(
|
|
2584
|
+
/* @__PURE__ */ a(Eo, { className: "h-3.5 w-3.5" }),
|
|
2585
2585
|
ne ? "Done" : "Bulk select"
|
|
2586
2586
|
]
|
|
2587
2587
|
}
|
|
@@ -2591,27 +2591,27 @@ function Dd({
|
|
|
2591
2591
|
{
|
|
2592
2592
|
type: "button",
|
|
2593
2593
|
onClick: () => {
|
|
2594
|
-
const e =
|
|
2595
|
-
|
|
2594
|
+
const e = Dt === "compact" ? "comfortable" : "compact";
|
|
2595
|
+
Ua(e);
|
|
2596
2596
|
try {
|
|
2597
2597
|
localStorage.setItem("nvr_table_density", e);
|
|
2598
2598
|
} catch {
|
|
2599
2599
|
}
|
|
2600
2600
|
},
|
|
2601
2601
|
"aria-label": "Row density",
|
|
2602
|
-
title:
|
|
2602
|
+
title: Dt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
|
|
2603
2603
|
className: "flex h-8 w-8 items-center justify-center rounded-md border border-slate-200 bg-white text-slate-500 shadow-sm hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted",
|
|
2604
|
-
children:
|
|
2604
|
+
children: Dt === "compact" ? /* @__PURE__ */ a(Ao, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(Oo, { className: "h-3.5 w-3.5" })
|
|
2605
2605
|
}
|
|
2606
2606
|
),
|
|
2607
|
-
C === "table" &&
|
|
2607
|
+
C === "table" && Ha && me.length > 0 && /* @__PURE__ */ d(
|
|
2608
2608
|
"button",
|
|
2609
2609
|
{
|
|
2610
2610
|
type: "button",
|
|
2611
2611
|
onClick: () => Qr(),
|
|
2612
2612
|
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",
|
|
2613
2613
|
children: [
|
|
2614
|
-
/* @__PURE__ */ a(
|
|
2614
|
+
/* @__PURE__ */ a(Ko, { className: "h-3 w-3 fill-current" }),
|
|
2615
2615
|
"Work Next"
|
|
2616
2616
|
]
|
|
2617
2617
|
}
|
|
@@ -2714,7 +2714,7 @@ function Dd({
|
|
|
2714
2714
|
)) })
|
|
2715
2715
|
] }),
|
|
2716
2716
|
!kn && He && de && /* @__PURE__ */ a(
|
|
2717
|
-
|
|
2717
|
+
li,
|
|
2718
2718
|
{
|
|
2719
2719
|
collection: He,
|
|
2720
2720
|
onParsed: (e, t) => de(`/collections/${He}/new`, {
|
|
@@ -2734,20 +2734,20 @@ function Dd({
|
|
|
2734
2734
|
children: [
|
|
2735
2735
|
/* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex max-w-full flex-wrap gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
|
|
2736
2736
|
/* @__PURE__ */ a(
|
|
2737
|
-
|
|
2737
|
+
Pt,
|
|
2738
2738
|
{
|
|
2739
2739
|
label: "Total",
|
|
2740
2740
|
count: (x == null ? void 0 : x.total) ?? 0,
|
|
2741
2741
|
filteredCount: I ? I.total : null,
|
|
2742
|
-
active: Object.values(_).every(
|
|
2742
|
+
active: Object.values(_).every(Za) && g === "all",
|
|
2743
2743
|
isLoading: Xe,
|
|
2744
2744
|
..._t("total"),
|
|
2745
|
-
onClick:
|
|
2745
|
+
onClick: el
|
|
2746
2746
|
}
|
|
2747
2747
|
),
|
|
2748
|
-
|
|
2748
|
+
co && /* @__PURE__ */ d(Se, { children: [
|
|
2749
2749
|
/* @__PURE__ */ a(
|
|
2750
|
-
|
|
2750
|
+
Pt,
|
|
2751
2751
|
{
|
|
2752
2752
|
label: "Warning",
|
|
2753
2753
|
count: (x == null ? void 0 : x.sla_warning) ?? 0,
|
|
@@ -2761,7 +2761,7 @@ function Dd({
|
|
|
2761
2761
|
}
|
|
2762
2762
|
),
|
|
2763
2763
|
/* @__PURE__ */ a(
|
|
2764
|
-
|
|
2764
|
+
Pt,
|
|
2765
2765
|
{
|
|
2766
2766
|
label: "Breached",
|
|
2767
2767
|
count: (x == null ? void 0 : x.sla_breached) ?? 0,
|
|
@@ -2776,10 +2776,10 @@ function Dd({
|
|
|
2776
2776
|
)
|
|
2777
2777
|
] }),
|
|
2778
2778
|
/* @__PURE__ */ a(
|
|
2779
|
-
|
|
2779
|
+
Pt,
|
|
2780
2780
|
{
|
|
2781
2781
|
label: "At Risk",
|
|
2782
|
-
breakdown: I ?
|
|
2782
|
+
breakdown: I ? Qa(I.at_risk_by_rule) : Qa(x == null ? void 0 : x.at_risk_by_rule),
|
|
2783
2783
|
count: (x == null ? void 0 : x.at_risk) ?? 0,
|
|
2784
2784
|
filteredCount: I ? I.at_risk : null,
|
|
2785
2785
|
tone: "red",
|
|
@@ -2791,7 +2791,7 @@ function Dd({
|
|
|
2791
2791
|
}
|
|
2792
2792
|
),
|
|
2793
2793
|
/* @__PURE__ */ a(
|
|
2794
|
-
|
|
2794
|
+
Pt,
|
|
2795
2795
|
{
|
|
2796
2796
|
label: "Unowned",
|
|
2797
2797
|
count: (x == null ? void 0 : x.unowned) ?? 0,
|
|
@@ -2801,7 +2801,7 @@ function Dd({
|
|
|
2801
2801
|
deltaBadIsUp: !0,
|
|
2802
2802
|
..._t("unowned"),
|
|
2803
2803
|
onClick: () => {
|
|
2804
|
-
te(g === "unowned" ? "all" : "unowned"),
|
|
2804
|
+
te(g === "unowned" ? "all" : "unowned"), P(1);
|
|
2805
2805
|
}
|
|
2806
2806
|
}
|
|
2807
2807
|
)
|
|
@@ -2819,7 +2819,7 @@ function Dd({
|
|
|
2819
2819
|
j((r) => ({
|
|
2820
2820
|
...r,
|
|
2821
2821
|
aging_hours: r.aging_hours === t ? "" : t
|
|
2822
|
-
})),
|
|
2822
|
+
})), P(1);
|
|
2823
2823
|
},
|
|
2824
2824
|
className: L(
|
|
2825
2825
|
"rounded-md border px-2 py-1 tabular-nums transition-colors",
|
|
@@ -2855,17 +2855,17 @@ function Dd({
|
|
|
2855
2855
|
] }) : /* @__PURE__ */ a(Se, { children: "→ Holding steady" })
|
|
2856
2856
|
}
|
|
2857
2857
|
),
|
|
2858
|
-
|
|
2858
|
+
Dr.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Dr.map(([e, t]) => {
|
|
2859
2859
|
var n;
|
|
2860
2860
|
return /* @__PURE__ */ a(
|
|
2861
|
-
|
|
2861
|
+
Zi,
|
|
2862
2862
|
{
|
|
2863
2863
|
label: Fe(e),
|
|
2864
2864
|
count: t,
|
|
2865
2865
|
filteredCount: I ? I.by_state[e] ?? 0 : null,
|
|
2866
2866
|
color: ((n = Re[e]) == null ? void 0 : n.color) ?? null,
|
|
2867
|
-
active:
|
|
2868
|
-
onClick: () =>
|
|
2867
|
+
active: Xa.includes(e),
|
|
2868
|
+
onClick: () => za(e)
|
|
2869
2869
|
},
|
|
2870
2870
|
e
|
|
2871
2871
|
);
|
|
@@ -2874,18 +2874,18 @@ function Dd({
|
|
|
2874
2874
|
}
|
|
2875
2875
|
),
|
|
2876
2876
|
C !== "workload" && /* @__PURE__ */ a(
|
|
2877
|
-
|
|
2877
|
+
Mi,
|
|
2878
2878
|
{
|
|
2879
|
-
defs:
|
|
2879
|
+
defs: io,
|
|
2880
2880
|
values: _,
|
|
2881
|
-
seededKeys:
|
|
2881
|
+
seededKeys: Et,
|
|
2882
2882
|
onApply: (e) => {
|
|
2883
|
-
j((t) => ({ ...t, ...e })),
|
|
2883
|
+
j((t) => ({ ...t, ...e })), P(1);
|
|
2884
2884
|
},
|
|
2885
2885
|
onClear: () => {
|
|
2886
|
-
j({ ...fe.current }),
|
|
2886
|
+
j({ ...fe.current }), P(1);
|
|
2887
2887
|
},
|
|
2888
|
-
right:
|
|
2888
|
+
right: uo
|
|
2889
2889
|
}
|
|
2890
2890
|
),
|
|
2891
2891
|
/* @__PURE__ */ d(
|
|
@@ -2946,7 +2946,7 @@ function Dd({
|
|
|
2946
2946
|
j((e) => {
|
|
2947
2947
|
const { owners: t, ...n } = e;
|
|
2948
2948
|
return n;
|
|
2949
|
-
}),
|
|
2949
|
+
}), P(1);
|
|
2950
2950
|
},
|
|
2951
2951
|
className: "flex h-4 w-4 items-center justify-center rounded-full text-[10px] hover:bg-black/10 dark:hover:bg-white/10",
|
|
2952
2952
|
children: "✕"
|
|
@@ -2959,7 +2959,7 @@ function Dd({
|
|
|
2959
2959
|
"button",
|
|
2960
2960
|
{
|
|
2961
2961
|
type: "button",
|
|
2962
|
-
onClick:
|
|
2962
|
+
onClick: Tl,
|
|
2963
2963
|
title: "Revert to the queue default (filters, columns and sort cleared)",
|
|
2964
2964
|
className: L(
|
|
2965
2965
|
"inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
|
|
@@ -2983,13 +2983,13 @@ function Dd({
|
|
|
2983
2983
|
{
|
|
2984
2984
|
type: "button",
|
|
2985
2985
|
title: tt === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
|
|
2986
|
-
onClick: () =>
|
|
2986
|
+
onClick: () => Pl.mutate(tt === e.id ? null : e.id),
|
|
2987
2987
|
className: L(
|
|
2988
2988
|
"shrink-0",
|
|
2989
2989
|
tt === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
|
|
2990
2990
|
),
|
|
2991
2991
|
children: /* @__PURE__ */ a(
|
|
2992
|
-
|
|
2992
|
+
Po,
|
|
2993
2993
|
{
|
|
2994
2994
|
className: L("h-3 w-3", tt === e.id && "fill-current"),
|
|
2995
2995
|
"aria-label": tt === e.id ? "Default view" : "Set as default"
|
|
@@ -3005,14 +3005,14 @@ function Dd({
|
|
|
3005
3005
|
"button",
|
|
3006
3006
|
{
|
|
3007
3007
|
type: "button",
|
|
3008
|
-
onClick: () =>
|
|
3008
|
+
onClick: () => Kl.mutate({ viewId: e.id, on: !e.is_default }),
|
|
3009
3009
|
title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
|
|
3010
3010
|
className: L(
|
|
3011
3011
|
"shrink-0",
|
|
3012
3012
|
e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
3013
3013
|
),
|
|
3014
3014
|
"aria-label": e.is_default ? "Unset queue default" : "Set queue default",
|
|
3015
|
-
children: /* @__PURE__ */ a(
|
|
3015
|
+
children: /* @__PURE__ */ a(Do, { className: L("h-3 w-3", e.is_default && "fill-current") })
|
|
3016
3016
|
}
|
|
3017
3017
|
),
|
|
3018
3018
|
(e.user === S || Me) && ot === e.id && /* @__PURE__ */ a(
|
|
@@ -3025,27 +3025,27 @@ function Dd({
|
|
|
3025
3025
|
className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
|
|
3026
3026
|
"aria-label": `Update view ${e.name}`,
|
|
3027
3027
|
"data-view-update-state": Be.isPending ? "saving" : Hr === e.id ? "saved" : "idle",
|
|
3028
|
-
children: Be.isPending && ((t = Be.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a(
|
|
3029
|
-
|
|
3028
|
+
children: Be.isPending && ((t = Be.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a(Mo, { className: "h-3 w-3 animate-spin" }) : Hr === e.id ? /* @__PURE__ */ a(
|
|
3029
|
+
Bo,
|
|
3030
3030
|
{
|
|
3031
3031
|
className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
|
|
3032
3032
|
strokeWidth: 3
|
|
3033
3033
|
}
|
|
3034
|
-
) : /* @__PURE__ */ a(
|
|
3034
|
+
) : /* @__PURE__ */ a(Qo, { className: "h-3 w-3" })
|
|
3035
3035
|
}
|
|
3036
3036
|
),
|
|
3037
3037
|
ot === e.id && /* @__PURE__ */ a(
|
|
3038
3038
|
"button",
|
|
3039
3039
|
{
|
|
3040
3040
|
type: "button",
|
|
3041
|
-
onClick: () =>
|
|
3041
|
+
onClick: () => rl(e.id),
|
|
3042
3042
|
title: Gt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
|
|
3043
3043
|
className: L(
|
|
3044
3044
|
"shrink-0",
|
|
3045
3045
|
Gt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
|
|
3046
3046
|
),
|
|
3047
3047
|
"aria-label": `Subscribe to view ${e.name}`,
|
|
3048
|
-
children: /* @__PURE__ */ a(
|
|
3048
|
+
children: /* @__PURE__ */ a(jo, { className: L("h-3 w-3", Gt(e.id) && "fill-current") })
|
|
3049
3049
|
}
|
|
3050
3050
|
),
|
|
3051
3051
|
e.user === S && (Mn === e.id ? /* @__PURE__ */ d(
|
|
@@ -3093,7 +3093,7 @@ function Dd({
|
|
|
3093
3093
|
e.id
|
|
3094
3094
|
);
|
|
3095
3095
|
}),
|
|
3096
|
-
/* @__PURE__ */ d(ut, { open:
|
|
3096
|
+
/* @__PURE__ */ d(ut, { open: Ll, onOpenChange: Dn, children: [
|
|
3097
3097
|
/* @__PURE__ */ a(mt, { asChild: !0, children: /* @__PURE__ */ a(
|
|
3098
3098
|
"button",
|
|
3099
3099
|
{
|
|
@@ -3112,7 +3112,7 @@ function Dd({
|
|
|
3112
3112
|
type: "button",
|
|
3113
3113
|
disabled: Be.isPending,
|
|
3114
3114
|
onClick: () => {
|
|
3115
|
-
Be.mutate(e),
|
|
3115
|
+
Be.mutate(e), Dn(!1);
|
|
3116
3116
|
},
|
|
3117
3117
|
className: "mb-2 w-full rounded-md border border-nvr-cyan/40 bg-nvr-cyan/5 px-2 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 disabled:opacity-50 dark:text-nvr-cyan",
|
|
3118
3118
|
children: [
|
|
@@ -3174,7 +3174,7 @@ function Dd({
|
|
|
3174
3174
|
)
|
|
3175
3175
|
] }),
|
|
3176
3176
|
/* @__PURE__ */ d("div", { ref: Zt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
|
|
3177
|
-
fr && /* @__PURE__ */ a(
|
|
3177
|
+
fr && /* @__PURE__ */ a(ui, { error: il, onRetry: () => void cl(), className: "mb-3" }),
|
|
3178
3178
|
Yn && /* @__PURE__ */ a(
|
|
3179
3179
|
"p",
|
|
3180
3180
|
{
|
|
@@ -3188,7 +3188,7 @@ function Dd({
|
|
|
3188
3188
|
C === "table" ? /* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
|
|
3189
3189
|
"div",
|
|
3190
3190
|
{
|
|
3191
|
-
ref:
|
|
3191
|
+
ref: Ee.rootRef,
|
|
3192
3192
|
className: L(
|
|
3193
3193
|
"relative min-w-0 flex-1 transition-opacity duration-200",
|
|
3194
3194
|
vr && "pointer-events-none opacity-60"
|
|
@@ -3196,17 +3196,17 @@ function Dd({
|
|
|
3196
3196
|
"aria-busy": vr || void 0,
|
|
3197
3197
|
children: [
|
|
3198
3198
|
wr != 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: [
|
|
3199
|
-
|
|
3199
|
+
pl.text ?? "Still working",
|
|
3200
3200
|
" — ",
|
|
3201
3201
|
wr,
|
|
3202
3202
|
"s"
|
|
3203
3203
|
] }),
|
|
3204
3204
|
/* @__PURE__ */ a(
|
|
3205
|
-
|
|
3205
|
+
ei,
|
|
3206
3206
|
{
|
|
3207
3207
|
fillHeight: !0,
|
|
3208
3208
|
enterKey: qr.current,
|
|
3209
|
-
density:
|
|
3209
|
+
density: Dt,
|
|
3210
3210
|
minBodyHeight: 360,
|
|
3211
3211
|
columns: Tt,
|
|
3212
3212
|
rows: $,
|
|
@@ -3215,30 +3215,30 @@ function Dd({
|
|
|
3215
3215
|
page: ue,
|
|
3216
3216
|
limit: yn,
|
|
3217
3217
|
isLoading: Xe,
|
|
3218
|
-
onPageChange:
|
|
3219
|
-
onRowClick: (e) =>
|
|
3218
|
+
onPageChange: P,
|
|
3219
|
+
onRowClick: (e) => Pn(e),
|
|
3220
3220
|
onRowFocus: (e) => zt(F(e)),
|
|
3221
3221
|
activeRowKey: St,
|
|
3222
3222
|
rowAriaLabel: (e) => e.label || void 0,
|
|
3223
3223
|
rowDragProps: (e) => ({
|
|
3224
|
-
...
|
|
3225
|
-
...
|
|
3224
|
+
...yl({ collection: e.collection, id: e.item_id }),
|
|
3225
|
+
...bl.record(e.collection, e.item_id)
|
|
3226
3226
|
}),
|
|
3227
3227
|
onRowContextMenu: (e, t) => {
|
|
3228
3228
|
t.preventDefault(), Ct({ x: t.clientX, y: t.clientY, row: e });
|
|
3229
3229
|
},
|
|
3230
3230
|
rowTitle: (e) => {
|
|
3231
3231
|
const t = wt.get(F(e));
|
|
3232
|
-
return
|
|
3232
|
+
return Ee.titleFor(F(e)) ?? (t && !t.is_mine ? Ns(t) : void 0) ?? (Wr(e.collection, e.item_id) ? xi : void 0);
|
|
3233
3233
|
},
|
|
3234
3234
|
rowClassName: (e) => L(
|
|
3235
|
-
|
|
3236
|
-
Wr(e.collection, e.item_id) &&
|
|
3235
|
+
Ol(e),
|
|
3236
|
+
Wr(e.collection, e.item_id) && gi
|
|
3237
3237
|
),
|
|
3238
3238
|
emptyMessage: fr ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
|
|
3239
|
-
|
|
3239
|
+
ti,
|
|
3240
3240
|
{
|
|
3241
|
-
icon:
|
|
3241
|
+
icon: Uo,
|
|
3242
3242
|
title: ((wa = i == null ? void 0 : i.empty) == null ? void 0 : wa.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((_a = i == null ? void 0 : i.empty) == null ? void 0 : _a.reason) === "scope_mine" ? "Nothing waiting on you" : ((Na = i == null ? void 0 : i.empty) == null ? void 0 : Na.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
|
|
3243
3243
|
detail: ((Sa = i == null ? void 0 : i.empty) == null ? void 0 : Sa.reason) === "filters" && ye > 0 ? `Your default ${yr(Jn)} filter is hiding ${ye.toLocaleString("en-US")} item${ye === 1 ? "" : "s"} here.` : ((Ca = i == null ? void 0 : i.empty) == null ? void 0 : Ca.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : (($a = i == null ? void 0 : i.empty) == null ? void 0 : $a.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
|
|
3244
3244
|
action: ((qa = i == null ? void 0 : i.empty) == null ? void 0 : qa.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
|
|
@@ -3264,7 +3264,7 @@ function Dd({
|
|
|
3264
3264
|
const e = {};
|
|
3265
3265
|
for (const [n, r] of Object.entries(fe.current))
|
|
3266
3266
|
(t = he[n.slice(6)]) != null && t.length && (e[n] = r);
|
|
3267
|
-
j(e),
|
|
3267
|
+
j(e), P(1);
|
|
3268
3268
|
},
|
|
3269
3269
|
className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
|
|
3270
3270
|
"data-queue-empty-clear": !0,
|
|
@@ -3276,7 +3276,7 @@ function Dd({
|
|
|
3276
3276
|
{
|
|
3277
3277
|
type: "button",
|
|
3278
3278
|
onClick: () => {
|
|
3279
|
-
te("all"),
|
|
3279
|
+
te("all"), P(1);
|
|
3280
3280
|
},
|
|
3281
3281
|
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",
|
|
3282
3282
|
"data-queue-empty-all": !0,
|
|
@@ -3288,16 +3288,16 @@ function Dd({
|
|
|
3288
3288
|
),
|
|
3289
3289
|
sort: B,
|
|
3290
3290
|
onSortChange: (e) => {
|
|
3291
|
-
Ge(e),
|
|
3291
|
+
Ge(e), P(1);
|
|
3292
3292
|
},
|
|
3293
3293
|
filterDefs: Hn,
|
|
3294
3294
|
filterValues: _,
|
|
3295
3295
|
onFilterChange: (e, t) => {
|
|
3296
|
-
j((n) => ({ ...n, [e]: t })),
|
|
3296
|
+
j((n) => ({ ...n, [e]: t })), P(1);
|
|
3297
3297
|
},
|
|
3298
|
-
rowGroups:
|
|
3298
|
+
rowGroups: Bl ?? void 0,
|
|
3299
3299
|
collapsedGroups: Ce,
|
|
3300
|
-
onToggleGroup:
|
|
3300
|
+
onToggleGroup: $l,
|
|
3301
3301
|
selectedIds: It && ne ? ie : void 0,
|
|
3302
3302
|
onSelectionChange: It && ne ? it : void 0,
|
|
3303
3303
|
hideFilterRow: !0,
|
|
@@ -3312,7 +3312,7 @@ function Dd({
|
|
|
3312
3312
|
columnFilterRow: !0,
|
|
3313
3313
|
hScrollProxy: !0,
|
|
3314
3314
|
footer: /* @__PURE__ */ a(
|
|
3315
|
-
|
|
3315
|
+
vi,
|
|
3316
3316
|
{
|
|
3317
3317
|
collections: Nt,
|
|
3318
3318
|
selectedIds: String(_.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
|
|
@@ -3321,7 +3321,7 @@ function Dd({
|
|
|
3321
3321
|
j((n) => ({
|
|
3322
3322
|
...n,
|
|
3323
3323
|
at_risk_rule: n.at_risk_rule === t ? "" : t
|
|
3324
|
-
})),
|
|
3324
|
+
})), P(1);
|
|
3325
3325
|
},
|
|
3326
3326
|
className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
|
|
3327
3327
|
}
|
|
@@ -3331,22 +3331,22 @@ function Dd({
|
|
|
3331
3331
|
]
|
|
3332
3332
|
}
|
|
3333
3333
|
) }) }) : C === "kanban" ? /* @__PURE__ */ a(
|
|
3334
|
-
|
|
3334
|
+
Di,
|
|
3335
3335
|
{
|
|
3336
3336
|
items: $,
|
|
3337
|
-
onCardClick: (e) =>
|
|
3338
|
-
onDrop: (e, t) =>
|
|
3339
|
-
onClaim: (e) =>
|
|
3337
|
+
onCardClick: (e) => Pn(e),
|
|
3338
|
+
onDrop: (e, t) => hl.mutate({ item: e, targetState: t }),
|
|
3339
|
+
onClaim: (e) => Ke.mutate(e),
|
|
3340
3340
|
onRelease: (e) => Ze.mutate(e),
|
|
3341
3341
|
swimlaneBy: ht,
|
|
3342
|
-
stateLabels:
|
|
3342
|
+
stateLabels: En,
|
|
3343
3343
|
laneLabel: ht === "collection" ? at : void 0,
|
|
3344
3344
|
claimsEnabled: ge,
|
|
3345
3345
|
onDraggingChange: (e) => {
|
|
3346
3346
|
fn.current = e;
|
|
3347
3347
|
}
|
|
3348
3348
|
}
|
|
3349
|
-
) : /* @__PURE__ */ a(
|
|
3349
|
+
) : /* @__PURE__ */ a(Bi, { queueId: l })
|
|
3350
3350
|
] }),
|
|
3351
3351
|
It && ne && /* @__PURE__ */ d(
|
|
3352
3352
|
Ki,
|
|
@@ -3388,9 +3388,9 @@ function Dd({
|
|
|
3388
3388
|
type: "button",
|
|
3389
3389
|
onClick: () => {
|
|
3390
3390
|
const e = Cs(
|
|
3391
|
-
$.filter((t) => ie.includes(F(t)) && t.collection !== "tasks").map((t) => Y.urlFor(
|
|
3391
|
+
$.filter((t) => ie.includes(F(t)) && t.collection !== "tasks").map((t) => Y.urlFor(Kn(t)))
|
|
3392
3392
|
);
|
|
3393
|
-
e.blocked > 0 || e.capped > 0 ?
|
|
3393
|
+
e.blocked > 0 || e.capped > 0 ? A.warning(Oa(e)) : A.success(Oa(e));
|
|
3394
3394
|
},
|
|
3395
3395
|
"data-bulk-open-tabs": !0,
|
|
3396
3396
|
title: `Open the selected records in new tabs (up to ${Ss})`,
|
|
@@ -3399,7 +3399,7 @@ function Dd({
|
|
|
3399
3399
|
}
|
|
3400
3400
|
),
|
|
3401
3401
|
/* @__PURE__ */ a(
|
|
3402
|
-
|
|
3402
|
+
Gs,
|
|
3403
3403
|
{
|
|
3404
3404
|
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
|
|
3405
3405
|
enabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
|
|
@@ -3411,7 +3411,7 @@ function Dd({
|
|
|
3411
3411
|
}
|
|
3412
3412
|
),
|
|
3413
3413
|
Je("update-field") && /* @__PURE__ */ a(
|
|
3414
|
-
|
|
3414
|
+
Hs,
|
|
3415
3415
|
{
|
|
3416
3416
|
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3417
3417
|
disabled: Rt,
|
|
@@ -3420,16 +3420,17 @@ function Dd({
|
|
|
3420
3420
|
}
|
|
3421
3421
|
),
|
|
3422
3422
|
Je("compare") && /* @__PURE__ */ a(
|
|
3423
|
-
|
|
3423
|
+
Ws,
|
|
3424
3424
|
{
|
|
3425
3425
|
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3426
|
-
renderValue: (e, t, n) => {
|
|
3427
|
-
var
|
|
3428
|
-
return
|
|
3429
|
-
((
|
|
3426
|
+
renderValue: (e, t, n, r) => {
|
|
3427
|
+
var o;
|
|
3428
|
+
return zs(
|
|
3429
|
+
((o = $.find((s) => ie.includes(F(s)))) == null ? void 0 : o.collection) ?? "",
|
|
3430
3430
|
e,
|
|
3431
3431
|
t,
|
|
3432
|
-
n
|
|
3432
|
+
n,
|
|
3433
|
+
r
|
|
3433
3434
|
);
|
|
3434
3435
|
},
|
|
3435
3436
|
disabled: Rt,
|
|
@@ -3437,7 +3438,7 @@ function Dd({
|
|
|
3437
3438
|
}
|
|
3438
3439
|
),
|
|
3439
3440
|
Je("message") && /* @__PURE__ */ a(
|
|
3440
|
-
|
|
3441
|
+
Ys,
|
|
3441
3442
|
{
|
|
3442
3443
|
targets: $.filter((e) => ie.includes(F(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
3443
3444
|
disabled: Rt,
|
|
@@ -3448,7 +3449,7 @@ function Dd({
|
|
|
3448
3449
|
}
|
|
3449
3450
|
),
|
|
3450
3451
|
W != null && W.length ? /* @__PURE__ */ a(
|
|
3451
|
-
|
|
3452
|
+
ki,
|
|
3452
3453
|
{
|
|
3453
3454
|
collection: W[0].collection,
|
|
3454
3455
|
itemId: W[0].itemId,
|
|
@@ -3460,7 +3461,7 @@ function Dd({
|
|
|
3460
3461
|
onPush: (e) => ct.push([...W, e]),
|
|
3461
3462
|
onPop: () => ct.back(),
|
|
3462
3463
|
onClose: () => ct.back(W.length),
|
|
3463
|
-
onOpenRecord:
|
|
3464
|
+
onOpenRecord: Rl
|
|
3464
3465
|
}
|
|
3465
3466
|
) : null,
|
|
3466
3467
|
U && Ta(
|
|
@@ -3478,23 +3479,23 @@ function Dd({
|
|
|
3478
3479
|
"data-queue-row-menu": !0,
|
|
3479
3480
|
children: [
|
|
3480
3481
|
[
|
|
3481
|
-
{ label: "Open", run: () =>
|
|
3482
|
+
{ label: "Open", run: () => Pn(U.row) },
|
|
3482
3483
|
{
|
|
3483
3484
|
label: "Open full record",
|
|
3484
3485
|
run: () => lt(U.row)
|
|
3485
3486
|
},
|
|
3486
|
-
{ label: "Peek", run: () =>
|
|
3487
|
+
{ label: "Peek", run: () => De(U.row) },
|
|
3487
3488
|
...ge ? [
|
|
3488
|
-
((Ra = U.row.claimed_by) == null ? void 0 : Ra.id) === S ? { label: "Release claim", run: () => Ze.mutate(U.row) } : { label: "Claim", run: () =>
|
|
3489
|
+
((Ra = U.row.claimed_by) == null ? void 0 : Ra.id) === S ? { label: "Release claim", run: () => Ze.mutate(U.row) } : { label: "Claim", run: () => Ke.mutate(U.row) }
|
|
3489
3490
|
] : [],
|
|
3490
3491
|
// The friendly id (PW26-76166), never the row id (army 6 M52);
|
|
3491
3492
|
// a record with no number has nothing to copy.
|
|
3492
|
-
...
|
|
3493
|
+
...Ka(U.row) ? [
|
|
3493
3494
|
{
|
|
3494
3495
|
label: "Copy ID",
|
|
3495
3496
|
run: () => {
|
|
3496
3497
|
var e;
|
|
3497
|
-
return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
|
|
3498
|
+
return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(Ka(U.row) ?? ""));
|
|
3498
3499
|
}
|
|
3499
3500
|
}
|
|
3500
3501
|
] : [],
|
|
@@ -3503,14 +3504,14 @@ function Dd({
|
|
|
3503
3504
|
run: () => {
|
|
3504
3505
|
var e;
|
|
3505
3506
|
return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
|
|
3506
|
-
`${window.location.origin}${Y.urlFor(
|
|
3507
|
+
`${window.location.origin}${Y.urlFor(Kn(U.row))}`
|
|
3507
3508
|
));
|
|
3508
3509
|
}
|
|
3509
3510
|
},
|
|
3510
3511
|
// Custom actions (#125): the record's registered actions, right here.
|
|
3511
|
-
...
|
|
3512
|
+
...ll(U.row.collection).map((e) => ({
|
|
3512
3513
|
label: e.label,
|
|
3513
|
-
run: () =>
|
|
3514
|
+
run: () => ol(e, U.row)
|
|
3514
3515
|
}))
|
|
3515
3516
|
].map((e) => /* @__PURE__ */ a(
|
|
3516
3517
|
"button",
|
|
@@ -3580,7 +3581,7 @@ function Dd({
|
|
|
3580
3581
|
),
|
|
3581
3582
|
pr && Ta(
|
|
3582
3583
|
/* @__PURE__ */ a(
|
|
3583
|
-
|
|
3584
|
+
tc,
|
|
3584
3585
|
{
|
|
3585
3586
|
queueId: l,
|
|
3586
3587
|
drill: pr,
|
|
@@ -3595,35 +3596,35 @@ function Dd({
|
|
|
3595
3596
|
/* @__PURE__ */ a(
|
|
3596
3597
|
Pi,
|
|
3597
3598
|
{
|
|
3598
|
-
item:
|
|
3599
|
-
stateLabels:
|
|
3599
|
+
item: Pe,
|
|
3600
|
+
stateLabels: En,
|
|
3600
3601
|
collectionLabel: at,
|
|
3601
3602
|
claimsEnabled: ge,
|
|
3602
|
-
columnFormats:
|
|
3603
|
+
columnFormats: Ul,
|
|
3603
3604
|
fieldLabel: (e) => T(`extra.${e}`, Ve(e)),
|
|
3604
3605
|
width: p == null ? void 0 : p.sheet_width,
|
|
3605
3606
|
itemLayout: p == null ? void 0 : p.item_layout,
|
|
3606
3607
|
onOpenRecord: (e) => lt(e),
|
|
3607
3608
|
onOpenChange: (e) => {
|
|
3608
|
-
e || (
|
|
3609
|
+
e || (De(null), On(!1));
|
|
3609
3610
|
},
|
|
3610
|
-
onClaim: (e) =>
|
|
3611
|
+
onClaim: (e) => Ke.mutate(e),
|
|
3611
3612
|
onRelease: (e) => Ze.mutate(e),
|
|
3612
|
-
workNextActive:
|
|
3613
|
-
onNext: () =>
|
|
3613
|
+
workNextActive: ql,
|
|
3614
|
+
onNext: () => Pe && Qr(Pe),
|
|
3614
3615
|
refetchItems: () => f.invalidateQueries({ queryKey: ["queue-items", l] })
|
|
3615
3616
|
}
|
|
3616
3617
|
),
|
|
3617
3618
|
Wt.dialog
|
|
3618
3619
|
] });
|
|
3619
3620
|
}
|
|
3620
|
-
function
|
|
3621
|
+
function tc({
|
|
3621
3622
|
queueId: l,
|
|
3622
3623
|
drill: k,
|
|
3623
|
-
onClose:
|
|
3624
|
+
onClose: K,
|
|
3624
3625
|
onOpenRecord: M
|
|
3625
3626
|
}) {
|
|
3626
|
-
const Z =
|
|
3627
|
+
const Z = ja(), { data: f, isLoading: h } = X({
|
|
3627
3628
|
queryKey: ["queue-agg-rows", l, k.row.collection, k.row.item_id, k.path],
|
|
3628
3629
|
queryFn: () => Z.request(
|
|
3629
3630
|
O(`/queues/${l}/aggregate-rows`, {
|
|
@@ -3637,7 +3638,7 @@ function nc({
|
|
|
3637
3638
|
"div",
|
|
3638
3639
|
{
|
|
3639
3640
|
className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/30 p-6",
|
|
3640
|
-
onClick:
|
|
3641
|
+
onClick: K,
|
|
3641
3642
|
children: /* @__PURE__ */ d(
|
|
3642
3643
|
"div",
|
|
3643
3644
|
{
|
|
@@ -3659,7 +3660,7 @@ function nc({
|
|
|
3659
3660
|
"button",
|
|
3660
3661
|
{
|
|
3661
3662
|
type: "button",
|
|
3662
|
-
onClick:
|
|
3663
|
+
onClick: K,
|
|
3663
3664
|
className: "rounded-md px-2 py-1 text-[12px] text-slate-400 hover:bg-muted",
|
|
3664
3665
|
children: "✕"
|
|
3665
3666
|
}
|
|
@@ -3684,5 +3685,5 @@ function nc({
|
|
|
3684
3685
|
);
|
|
3685
3686
|
}
|
|
3686
3687
|
export {
|
|
3687
|
-
|
|
3688
|
+
Od as QueueWorklist
|
|
3688
3689
|
};
|