@nivaro/react 0.3.60 → 0.3.62
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/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/CollectionBrowserView.js +259 -259
- package/dist/shared/components/ItemEditForm.js +4236 -4213
- package/dist/shared/components/import/reimportDiff.js +67 -46
- package/dist/shared/components/item-edit/QueueReturnChip.js +17 -13
- package/dist/shared/components/item-edit/RecordHeaderActions.js +8 -8
- package/dist/shared/components/item-edit/staged-links.js +21 -21
- package/dist/shared/components/panels/AddendumPanel.js +464 -466
- package/dist/shared/components/panels/PipelinePanel.js +391 -364
- package/dist/shared/components/panels/landing-state.js +32 -19
- package/dist/shared/components/queue/QueueWorklist.js +224 -222
- package/dist/shared/lib/list-page-memory.js +40 -32
- package/dist/shared/lib/request-gate.js +159 -144
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ import { SortableContext as co, verticalListSortingStrategy as uo, arrayMove as
|
|
|
4
4
|
import { CSS as bo } from "@dnd-kit/utilities";
|
|
5
5
|
import { useQueryClient as fo, useQuery as G, useMutation as qe, useQueries as Be } from "@tanstack/react-query";
|
|
6
6
|
import { AlertTriangle as ho, FileDiff as go, RefreshCw as xo, Rows3 as Na, Flame as yo, Sparkles as ko, BarChart3 as vo, SlidersHorizontal as wo, ListChecks as _o, Rows4 as No, Rows2 as So, Play as Co, Plus as nn, ChevronDown as Sa, Star as $o, Pin as qo, Loader2 as Fo, Check as To, Save as Ro, Bell as Eo, Inbox as Lo, GripVertical as Ao } from "lucide-react";
|
|
7
|
-
import { useState as v, useRef as j, useEffect as
|
|
7
|
+
import { useState as v, useRef as j, useEffect as P, useMemo as V } from "react";
|
|
8
8
|
import { createPortal as Ca } from "react-dom";
|
|
9
9
|
import { toast as O } from "sonner";
|
|
10
|
-
import { useNivaroClient as Aa, useItemEditAuth as $a, useItemNavigation as Oo, useNavigation as Do, useOverlayState as
|
|
11
|
-
import { useDebounced as
|
|
10
|
+
import { useNivaroClient as Aa, useItemEditAuth as $a, useItemNavigation as Oo, useNavigation as Do, useOverlayState as Ko } from "../../context.js";
|
|
11
|
+
import { useDebounced as Po } from "../../hooks/useDebounced.js";
|
|
12
12
|
import { useElapsedLoading as Mo } from "../../hooks/useElapsedLoading.js";
|
|
13
13
|
import { useSlowReason as Qo } from "../../hooks/useSlowReason.js";
|
|
14
14
|
import { useBulkProgressFeed as Bo } from "../../lib/bulk-progress.js";
|
|
@@ -23,72 +23,73 @@ import { normalizeInlineEdit as Zo, inlineM2oTarget as es, inlineChoices as ts,
|
|
|
23
23
|
import { sanitizeQueueLinkState as as, readListLinkFromLocation as ls, dropListLinkParam as os } from "../../lib/list-link.js";
|
|
24
24
|
import { expandCoalesced as ss, LIVE_ASPECTS as $t } from "../../lib/live.js";
|
|
25
25
|
import { useRowChanges as is, useRowLocksByCollection as cs, lockLabel as ds } from "../../lib/live-list.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
26
|
+
import { arrivedByListReturn as us, historyKey as ms, ensureHistoryKey as ps } from "../../lib/list-page-memory.js";
|
|
27
|
+
import { OPEN_IN_TABS_CAP as bs, openInTabs as fs, openInTabsMessage as Fa } from "../../lib/open-in-tabs.js";
|
|
28
|
+
import { isOwnWrite as hs } from "../../lib/own-writes.js";
|
|
29
|
+
import { usePrefetchIntent as gs } from "../../lib/prefetch.js";
|
|
30
|
+
import { useRowPresence as xs, rowPresenceKey as ys } from "../../lib/presence-hooks.js";
|
|
31
|
+
import { buildGroups as ks } from "../../lib/queue-grouping.js";
|
|
32
|
+
import { cascadeFilter as vs, fetchCascadeRelations as ws } from "../../lib/quick-filter-cascade.js";
|
|
33
|
+
import { useOptionalRealtime as _s } from "../../lib/realtime.js";
|
|
33
34
|
import { copyIdText as Ta } from "../../lib/record-ref.js";
|
|
34
|
-
import { rowHighlightTextClass as
|
|
35
|
+
import { rowHighlightTextClass as Ns, rowHighlightClass as Ss } from "../../lib/row-highlight.js";
|
|
35
36
|
import { userErrorMessage as qt } from "../../lib/safe-error.js";
|
|
36
|
-
import { useMyScopes as
|
|
37
|
-
import { useNewItemLayouts as
|
|
38
|
-
import { formatNumber as ce, cn as q, titleCase as Wn, humanHours as
|
|
39
|
-
import { usePublishAskContext as
|
|
40
|
-
import { useBuiltinGate as
|
|
41
|
-
import { BulkRowMark as
|
|
42
|
-
import { RowActionsMenu as
|
|
43
|
-
import { DataTable as
|
|
44
|
-
import { EmptyState as
|
|
45
|
-
import { FocusModeToggle as
|
|
46
|
-
import { FulfilmentPill as
|
|
47
|
-
import { ImportFromFileButton as
|
|
48
|
-
import { IntegrationDots as
|
|
49
|
-
import { IntegrationsFilterPill as
|
|
50
|
-
import { readQueueReturn as
|
|
51
|
-
import { ListLoadError as
|
|
52
|
-
import { LiveRowMark as
|
|
53
|
-
import { CopyListLinkButton as
|
|
54
|
-
import { useInlineEdit as
|
|
55
|
-
import { usePickerExcludedRows as
|
|
56
|
-
import { RealtimeStaleMark as
|
|
57
|
-
import { RecordDrilldownSheet as
|
|
58
|
-
import { RowHighlightLegend as
|
|
59
|
-
import { RowPresence as
|
|
37
|
+
import { useMyScopes as Cs, matchScopeDimension as $s } from "../../lib/use-my-scopes.js";
|
|
38
|
+
import { useNewItemLayouts as qs } from "../../lib/use-new-item-layouts.js";
|
|
39
|
+
import { formatNumber as ce, cn as q, titleCase as Wn, humanHours as Fs, formatRelative as Ts, formatDateTime as Rs, formatDate as Es } from "../../lib/utils.js";
|
|
40
|
+
import { usePublishAskContext as Ls, useAskRecordDrag as As } from "../ai/ask-context.js";
|
|
41
|
+
import { useBuiltinGate as Os, BulkActionButtons as Ds } from "../bulk/BulkActionButtons.js";
|
|
42
|
+
import { BulkRowMark as Ks } from "../bulk/BulkRowMark.js";
|
|
43
|
+
import { RowActionsMenu as Ps, roleMayUpdate as Ms } from "../CollectionBrowserView.js";
|
|
44
|
+
import { DataTable as Qs } from "../DataTable.js";
|
|
45
|
+
import { EmptyState as Bs } from "../EmptyState.js";
|
|
46
|
+
import { FocusModeToggle as js } from "../FocusModeToggle.js";
|
|
47
|
+
import { FulfilmentPill as Us, FULFILMENT_FILTER_OPTIONS as Is } from "../FulfilmentPill.js";
|
|
48
|
+
import { ImportFromFileButton as Vs } from "../import/ImportFromFileButton.js";
|
|
49
|
+
import { IntegrationDots as Gs, INTEGRATIONS_FILTER_OPTIONS as Ws } from "../integrations/IntegrationDots.js";
|
|
50
|
+
import { IntegrationsFilterPill as Hs } from "../integrations/IntegrationsFilterPill.js";
|
|
51
|
+
import { readQueueReturn as Ys, queueReturnApplies as Js, writeQueueReturn as Ra } from "../item-edit/QueueReturnChip.js";
|
|
52
|
+
import { ListLoadError as zs } from "../ListLoadError.js";
|
|
53
|
+
import { LiveRowMark as Xs } from "../LiveRowMark.js";
|
|
54
|
+
import { CopyListLinkButton as Zs } from "../list/CopyListLinkButton.js";
|
|
55
|
+
import { useInlineEdit as ei, InlineEditCell as ti } from "../list/InlineEdit.js";
|
|
56
|
+
import { usePickerExcludedRows as ni, PICKER_EXCLUDED_ROW_CLASS as ri, PICKER_EXCLUDED_TITLE as ai } from "../PickerExcludedRows.js";
|
|
57
|
+
import { RealtimeStaleMark as li } from "../RealtimeStatusBanner.js";
|
|
58
|
+
import { RecordDrilldownSheet as oi } from "../RecordDrilldownSheet.js";
|
|
59
|
+
import { RowHighlightLegend as si } from "../RowHighlightLegend.js";
|
|
60
|
+
import { RowPresence as ii } from "../RowPresence.js";
|
|
60
61
|
import { TickerNumber as Hn } from "../TickerNumber.js";
|
|
61
|
-
import { UnseenDot as
|
|
62
|
-
import { Badge as
|
|
62
|
+
import { UnseenDot as ci } from "../UnseenDot.js";
|
|
63
|
+
import { Badge as di } from "../ui/badge.js";
|
|
63
64
|
import { Checkbox as Yn } from "../ui/checkbox.js";
|
|
64
|
-
import { Command as Ea, CommandInput as
|
|
65
|
-
import { Label as
|
|
65
|
+
import { Command as Ea, CommandInput as ui, CommandList as La, CommandEmpty as mi, CommandItem as Ft } from "../ui/command.js";
|
|
66
|
+
import { Label as pi } from "../ui/label.js";
|
|
66
67
|
import { Popover as at, PopoverTrigger as lt, PopoverContent as ot } from "../ui/popover.js";
|
|
67
|
-
import { Skeleton as
|
|
68
|
-
import { dedupeChooserKeys as
|
|
69
|
-
import { groupSumPathsFor as
|
|
70
|
-
import { offscreenPill as
|
|
71
|
-
import { OwnerAvatars as
|
|
72
|
-
import { pathHeader as
|
|
73
|
-
import { QueueBulkBar as
|
|
74
|
-
import { QueueItemSheet as
|
|
75
|
-
import { QueueKanbanBoard as
|
|
76
|
-
import { QueueQuickFilters as
|
|
77
|
-
import { QueueWorkloadView as
|
|
78
|
-
import { useTransitionNote as
|
|
79
|
-
function
|
|
68
|
+
import { Skeleton as bi } from "../ui/skeleton.js";
|
|
69
|
+
import { dedupeChooserKeys as fi } from "./column-chooser.js";
|
|
70
|
+
import { groupSumPathsFor as hi } from "./group-sums.js";
|
|
71
|
+
import { offscreenPill as gi, statsOutrunRows as xi, stateAspectEffect as yi } from "./live-state-aspect.js";
|
|
72
|
+
import { OwnerAvatars as ki } from "./OwnerAvatars.js";
|
|
73
|
+
import { pathHeader as vi } from "./path-label.js";
|
|
74
|
+
import { QueueBulkBar as wi } from "./QueueBulkBar.js";
|
|
75
|
+
import { QueueItemSheet as _i } from "./QueueItemSheet.js";
|
|
76
|
+
import { QueueKanbanBoard as Ni } from "./QueueKanbanBoard.js";
|
|
77
|
+
import { QueueQuickFilters as Si } from "./QueueQuickFilters.js";
|
|
78
|
+
import { QueueWorkloadView as Ci } from "./QueueWorkloadView.js";
|
|
79
|
+
import { useTransitionNote as $i, needsTransitionNote as qi } from "./transition-note.js";
|
|
80
|
+
function Fi({ summary: l }) {
|
|
80
81
|
if (!l || l.count === 0)
|
|
81
82
|
return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
|
|
82
|
-
const k = [l.last_from, l.last_to].filter(Boolean).join(" → "),
|
|
83
|
+
const k = [l.last_from, l.last_to].filter(Boolean).join(" → "), K = [
|
|
83
84
|
k ? `Last: ${k}` : null,
|
|
84
|
-
l.last_at ?
|
|
85
|
+
l.last_at ? Ts(l.last_at) : null,
|
|
85
86
|
l.last_reason ? `“${l.last_reason}”` : "no reason given"
|
|
86
87
|
].filter(Boolean).join(" · ");
|
|
87
88
|
return /* @__PURE__ */ d(
|
|
88
89
|
"span",
|
|
89
90
|
{
|
|
90
91
|
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",
|
|
91
|
-
"data-tip":
|
|
92
|
+
"data-tip": K,
|
|
92
93
|
"data-send-backs": l.count,
|
|
93
94
|
children: [
|
|
94
95
|
/* @__PURE__ */ d("span", { className: "tabular-nums", children: [
|
|
@@ -103,15 +104,15 @@ function Si({ summary: l }) {
|
|
|
103
104
|
}
|
|
104
105
|
);
|
|
105
106
|
}
|
|
106
|
-
const
|
|
107
|
+
const Ti = 50, rn = "nivaro_addendums", Ri = [
|
|
107
108
|
{ value: "mine", label: "My Items" },
|
|
108
109
|
{ value: "unowned", label: "No Owners" },
|
|
109
110
|
{ value: "claimed", label: "Claimed by me" },
|
|
110
111
|
{ value: "all", label: "All Items" }
|
|
111
112
|
];
|
|
112
|
-
function
|
|
113
|
+
function Ei({ summary: l }) {
|
|
113
114
|
if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
114
|
-
const k = l.active > 0,
|
|
115
|
+
const k = l.active > 0, K = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", M = l.cost_impact, W = M != null && M !== 0 ? `${M > 0 ? "+" : "−"}$${Math.abs(M).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
|
|
115
116
|
return /* @__PURE__ */ d(
|
|
116
117
|
"span",
|
|
117
118
|
{
|
|
@@ -131,7 +132,7 @@ function qi({ summary: l }) {
|
|
|
131
132
|
)
|
|
132
133
|
}
|
|
133
134
|
),
|
|
134
|
-
k ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${
|
|
135
|
+
k ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${K}` : `${l.total} ${K}`,
|
|
135
136
|
W && /* @__PURE__ */ d("span", { className: "tabular-nums opacity-80", children: [
|
|
136
137
|
"· ",
|
|
137
138
|
W
|
|
@@ -140,21 +141,21 @@ function qi({ summary: l }) {
|
|
|
140
141
|
}
|
|
141
142
|
);
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
144
|
+
function Li(l) {
|
|
145
|
+
return Fs(l);
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function Ai({ status: l }) {
|
|
147
148
|
return l ? /* @__PURE__ */ a("span", { className: q("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: "—" });
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
+
function Oi({ points: l, inline: k = !1 }) {
|
|
150
151
|
if (l.length < 2) return null;
|
|
151
|
-
const
|
|
152
|
+
const K = k ? 40 : 64, M = k ? 14 : 18, W = Math.max(...l), h = Math.min(...l), f = W - h || 1, N = K / (l.length - 1), H = l.map(
|
|
152
153
|
(ke, g) => `${g === 0 ? "M" : "L"}${(g * N).toFixed(1)},${(M - 2 - (ke - h) / f * (M - 4)).toFixed(1)}`
|
|
153
154
|
).join(" ");
|
|
154
155
|
return /* @__PURE__ */ a(
|
|
155
156
|
"svg",
|
|
156
157
|
{
|
|
157
|
-
width:
|
|
158
|
+
width: K,
|
|
158
159
|
height: M,
|
|
159
160
|
className: k ? "opacity-40" : "mt-1.5 opacity-40",
|
|
160
161
|
"aria-hidden": "true",
|
|
@@ -165,7 +166,7 @@ function Ri({ points: l, inline: k = !1 }) {
|
|
|
165
166
|
function Tt({
|
|
166
167
|
label: l,
|
|
167
168
|
count: k,
|
|
168
|
-
filteredCount:
|
|
169
|
+
filteredCount: K,
|
|
169
170
|
active: M,
|
|
170
171
|
isLoading: W,
|
|
171
172
|
tone: h,
|
|
@@ -185,7 +186,7 @@ function Tt({
|
|
|
185
186
|
"grow justify-center sm:justify-start",
|
|
186
187
|
M && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10"
|
|
187
188
|
),
|
|
188
|
-
children: W ? /* @__PURE__ */ a(
|
|
189
|
+
children: W ? /* @__PURE__ */ a(bi, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(ye, { children: [
|
|
189
190
|
/* @__PURE__ */ a(
|
|
190
191
|
"span",
|
|
191
192
|
{
|
|
@@ -193,8 +194,8 @@ function Tt({
|
|
|
193
194
|
"flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums",
|
|
194
195
|
k === 0 && !M ? "text-slate-500 dark:text-slate-400" : "text-slate-900 dark:text-foreground"
|
|
195
196
|
),
|
|
196
|
-
children:
|
|
197
|
-
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Hn, { value:
|
|
197
|
+
children: K != null ? /* @__PURE__ */ d(ye, { children: [
|
|
198
|
+
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Hn, { value: K, format: ce }) }),
|
|
198
199
|
/* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
199
200
|
"/ ",
|
|
200
201
|
/* @__PURE__ */ a(Hn, { value: k, format: ce })
|
|
@@ -225,15 +226,15 @@ function Tt({
|
|
|
225
226
|
]
|
|
226
227
|
}
|
|
227
228
|
),
|
|
228
|
-
f && k > 0 && /* @__PURE__ */ a(
|
|
229
|
+
f && k > 0 && /* @__PURE__ */ a(Oi, { points: f, inline: !0 })
|
|
229
230
|
] })
|
|
230
231
|
}
|
|
231
232
|
);
|
|
232
233
|
}
|
|
233
|
-
function
|
|
234
|
+
function Di({
|
|
234
235
|
label: l,
|
|
235
236
|
count: k,
|
|
236
|
-
filteredCount:
|
|
237
|
+
filteredCount: K,
|
|
237
238
|
color: M,
|
|
238
239
|
active: W,
|
|
239
240
|
onClick: h
|
|
@@ -256,8 +257,8 @@ function Ei({
|
|
|
256
257
|
}
|
|
257
258
|
),
|
|
258
259
|
l,
|
|
259
|
-
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children:
|
|
260
|
-
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ce(
|
|
260
|
+
/* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: K != null ? /* @__PURE__ */ d(ye, { children: [
|
|
261
|
+
/* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ce(K) }),
|
|
261
262
|
/* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
|
|
262
263
|
" / ",
|
|
263
264
|
ce(k)
|
|
@@ -267,11 +268,11 @@ function Ei({
|
|
|
267
268
|
}
|
|
268
269
|
);
|
|
269
270
|
}
|
|
270
|
-
const je =
|
|
271
|
-
function
|
|
271
|
+
const je = vi;
|
|
272
|
+
function Ki({
|
|
272
273
|
id: l,
|
|
273
274
|
label: k,
|
|
274
|
-
checked:
|
|
275
|
+
checked: K,
|
|
275
276
|
onCheckedChange: M
|
|
276
277
|
}) {
|
|
277
278
|
const { attributes: W, listeners: h, setNodeRef: f, transform: N, transition: H, isDragging: ke } = po({
|
|
@@ -291,14 +292,14 @@ function Li({
|
|
|
291
292
|
children: /* @__PURE__ */ a(Ao, { className: "h-3.5 w-3.5" })
|
|
292
293
|
}
|
|
293
294
|
),
|
|
294
|
-
/* @__PURE__ */ a(Yn, { id: Y, checked:
|
|
295
|
-
/* @__PURE__ */ a(
|
|
295
|
+
/* @__PURE__ */ a(Yn, { id: Y, checked: K, onCheckedChange: M }),
|
|
296
|
+
/* @__PURE__ */ a(pi, { htmlFor: Y, className: "cursor-pointer text-[12px] font-normal", children: k })
|
|
296
297
|
] });
|
|
297
298
|
}
|
|
298
|
-
function
|
|
299
|
+
function pd({
|
|
299
300
|
queueId: l,
|
|
300
301
|
realtime: k,
|
|
301
|
-
renderError:
|
|
302
|
+
renderError: K,
|
|
302
303
|
hideCreateActions: M = !1,
|
|
303
304
|
onAsk: W
|
|
304
305
|
}) {
|
|
@@ -309,14 +310,14 @@ function id({
|
|
|
309
310
|
} catch {
|
|
310
311
|
return "compact";
|
|
311
312
|
}
|
|
312
|
-
}), [S, Ue] = v("table"), [I, Ie] = v(""), [w, Q] = v({}), [Et, zn] = v(() => /* @__PURE__ */ new Set()), [$, st] = v(null), [ve, an] = v(/* @__PURE__ */ new Set()), [it, ln] = v(null), [ct, on] = v(null), [sn, Lt] = v(0), cn = j(0), Fe = is(), dn =
|
|
313
|
+
}), [S, Ue] = v("table"), [I, Ie] = v(""), [w, Q] = v({}), [Et, zn] = v(() => /* @__PURE__ */ new Set()), [$, st] = v(null), [ve, an] = v(/* @__PURE__ */ new Set()), [it, ln] = v(null), [ct, on] = v(null), [sn, Lt] = v(0), cn = j(0), Fe = is(), dn = _s(), un = j({}).current, Xn = j(/* @__PURE__ */ new Set()), [Da, Ka] = v(0), [Zn, Pa] = v(0), ue = j(!1), At = j([]), er = j(null), mn = j(!1), pn = j(0), bn = j("table");
|
|
313
314
|
bn.current = S;
|
|
314
315
|
const fn = 25, { data: c, error: Ot } = G({
|
|
315
316
|
queryKey: ["queue-meta", l],
|
|
316
317
|
queryFn: () => f.request(L(`/queues/${l}`)).then((e) => e.data),
|
|
317
318
|
enabled: !!l
|
|
318
|
-
}), { scopes: Dt, ready: tr } =
|
|
319
|
-
|
|
319
|
+
}), { scopes: Dt, ready: tr } = Cs(), nr = j(!1), [rr, ar] = v(!1), [Te, Ma] = v({}), me = j({});
|
|
320
|
+
P(() => {
|
|
320
321
|
if (nr.current || !tr || !c) return;
|
|
321
322
|
nr.current = !0;
|
|
322
323
|
const e = (c.extra_field_meta ?? []).filter(
|
|
@@ -342,7 +343,7 @@ function id({
|
|
|
342
343
|
];
|
|
343
344
|
};
|
|
344
345
|
for (const o of e) {
|
|
345
|
-
const s =
|
|
346
|
+
const s = $s(Dt, { collection: o.target_collection });
|
|
346
347
|
if (!s) continue;
|
|
347
348
|
const m = `extra.${o.path}`;
|
|
348
349
|
try {
|
|
@@ -370,9 +371,9 @@ function id({
|
|
|
370
371
|
for (const n of (c == null ? void 0 : c.sources) ?? [])
|
|
371
372
|
n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
|
|
372
373
|
return t;
|
|
373
|
-
}, [c == null ? void 0 : c.sources]),
|
|
374
|
+
}, [c == null ? void 0 : c.sources]), Kt = qs(
|
|
374
375
|
re.length === 1 ? re[0] : null
|
|
375
|
-
), hn = M === !0 || Array.isArray(M) && re.length > 0 && re.every((e) => M.includes(e)), pe = (c == null ? void 0 : c.claims_enabled) !== !1, u = c == null ? void 0 : c.display_config, Re = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Qa = (u == null ? void 0 : u.work_next) !== !1,
|
|
376
|
+
), hn = M === !0 || Array.isArray(M) && re.length > 0 && re.every((e) => M.includes(e)), pe = (c == null ? void 0 : c.claims_enabled) !== !1, u = c == null ? void 0 : c.display_config, Re = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], Qa = (u == null ? void 0 : u.work_next) !== !1, Pt = (u == null ? void 0 : u.bulk_actions) !== !1, gn = Os(
|
|
376
377
|
[
|
|
377
378
|
...new Set(
|
|
378
379
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
@@ -383,13 +384,13 @@ function id({
|
|
|
383
384
|
var n, r;
|
|
384
385
|
return ((r = (n = c == null ? void 0 : c.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
|
|
385
386
|
}, or = j(!1);
|
|
386
|
-
|
|
387
|
+
P(() => {
|
|
387
388
|
!c || or.current || (or.current = !0, Ie("-priority"));
|
|
388
389
|
}, [c]);
|
|
389
390
|
const [J, Ba] = v(!1);
|
|
390
|
-
|
|
391
|
+
P(() => {
|
|
391
392
|
c != null && c.display_config && !Re.includes(S) && Ue(Re[0]);
|
|
392
|
-
}, [c, S, Re]),
|
|
393
|
+
}, [c, S, Re]), P(() => {
|
|
393
394
|
if (!(c != null && c.sources)) return;
|
|
394
395
|
const e = dn ? (b, R) => dn.subscribeCollections(b, R) : k == null ? void 0 : k.subscribe;
|
|
395
396
|
if (!e) return;
|
|
@@ -403,7 +404,7 @@ function id({
|
|
|
403
404
|
let r = null, o = null, s = null;
|
|
404
405
|
const m = () => {
|
|
405
406
|
s || (s = setTimeout(() => {
|
|
406
|
-
s = null,
|
|
407
|
+
s = null, Pa((b) => b + 1);
|
|
407
408
|
}, 1500));
|
|
408
409
|
}, p = () => {
|
|
409
410
|
o || (o = setTimeout(() => {
|
|
@@ -421,8 +422,8 @@ function id({
|
|
|
421
422
|
for (const E of Z) {
|
|
422
423
|
const ne = E == null ? void 0 : E.changed_fields, tn = (E == null ? void 0 : E.collection) != null ? `${E.collection}:${String(E.item)}` : null, _a = tn != null && Xn.current.has(tn);
|
|
423
424
|
if (E && !E.action && (ne != null && ne.length) && ne.every(($e) => $e.startsWith("$"))) {
|
|
424
|
-
if (ne.includes($t.tasks) && n.add("queue-task-counts"), ne.includes($t.integrations) && n.add("queue-integrations-summary"), ne.includes($t.addendums) && n.add("queue-collection-addendums"), ne.includes($t.lock) &&
|
|
425
|
-
const $e =
|
|
425
|
+
if (ne.includes($t.tasks) && n.add("queue-task-counts"), ne.includes($t.integrations) && n.add("queue-integrations-summary"), ne.includes($t.addendums) && n.add("queue-collection-addendums"), ne.includes($t.lock) && Ka(($e) => $e + 1), ne.includes($t.state)) {
|
|
426
|
+
const $e = yi(_a, bn.current === "kanban");
|
|
426
427
|
X = !0, $e.refresh && (R = !0), y += $e.pill;
|
|
427
428
|
}
|
|
428
429
|
r || (r = setTimeout(() => {
|
|
@@ -433,7 +434,7 @@ function id({
|
|
|
433
434
|
continue;
|
|
434
435
|
}
|
|
435
436
|
X = !0;
|
|
436
|
-
const ro = (E == null ? void 0 : E.collection) != null &&
|
|
437
|
+
const ro = (E == null ? void 0 : E.collection) != null && hs(E.collection, E.item);
|
|
437
438
|
tn && (_a || (E == null ? void 0 : E.action) === "create" || bn.current === "kanban") ? (R = !0, ro || At.current.push({ key: tn, by: null })) : y += 1;
|
|
438
439
|
}
|
|
439
440
|
y > 0 && (cn.current += y), R && p(), X && m();
|
|
@@ -442,7 +443,7 @@ function id({
|
|
|
442
443
|
_(), Ho(un), r && clearTimeout(r), o && clearTimeout(o), s && clearTimeout(s);
|
|
443
444
|
};
|
|
444
445
|
}, [dn, k, c == null ? void 0 : c.sources, h, l, N, un]);
|
|
445
|
-
const Ee =
|
|
446
|
+
const Ee = Po(w, 350), ja = JSON.stringify(Ee) === JSON.stringify(w), xn = j(!1), we = S === "table" && !!$, sr = hi(c), _e = (() => {
|
|
446
447
|
const e = {};
|
|
447
448
|
for (const [t, n] of Object.entries(Ee))
|
|
448
449
|
if (n) {
|
|
@@ -479,7 +480,7 @@ function id({
|
|
|
479
480
|
return !1;
|
|
480
481
|
}
|
|
481
482
|
});
|
|
482
|
-
|
|
483
|
+
P(() => {
|
|
483
484
|
try {
|
|
484
485
|
localStorage.setItem("nvr_queue_insights_open", dt ? "1" : "0");
|
|
485
486
|
} catch {
|
|
@@ -621,7 +622,7 @@ function id({
|
|
|
621
622
|
return t;
|
|
622
623
|
}), A(1);
|
|
623
624
|
};
|
|
624
|
-
|
|
625
|
+
P(() => {
|
|
625
626
|
if (typeof window > "u" || !le) return;
|
|
626
627
|
const e = window;
|
|
627
628
|
e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
|
|
@@ -638,11 +639,11 @@ function id({
|
|
|
638
639
|
const He = dr && !i || !J || !rr && !i, hr = (ut && !dr || Za && ut) && !ue.current, rl = V(
|
|
639
640
|
() => (we ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
|
|
640
641
|
[we, i == null ? void 0 : i.data]
|
|
641
|
-
), al =
|
|
642
|
+
), al = xs(rl), Qt = $i(), gr = Mo(ut && !ue.current), ll = Qo({
|
|
642
643
|
pending: ut && !ue.current,
|
|
643
644
|
request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
|
|
644
645
|
noun: "items"
|
|
645
|
-
}), ol =
|
|
646
|
+
}), ol = gs();
|
|
646
647
|
async function xr(e, t) {
|
|
647
648
|
var p;
|
|
648
649
|
const r = (await f.request(L(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
|
|
@@ -655,7 +656,7 @@ function id({
|
|
|
655
656
|
);
|
|
656
657
|
if (!s) throw new Error("No transition available to move this item here");
|
|
657
658
|
let m = null;
|
|
658
|
-
if (
|
|
659
|
+
if (qi(s) && (m = await Qt.ask(((p = s.label) == null ? void 0 : p.trim()) || "Move"), !m))
|
|
659
660
|
throw new Error("Not moved — this move needs a note");
|
|
660
661
|
await f.request(
|
|
661
662
|
ie(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
|
|
@@ -697,7 +698,7 @@ function id({
|
|
|
697
698
|
queryFn: () => f.request(L(`/queues/${l}/column-prefs`)),
|
|
698
699
|
enabled: !!l
|
|
699
700
|
}), [Bt, jt] = v(null), [ze, wn] = v(null);
|
|
700
|
-
|
|
701
|
+
P(() => {
|
|
701
702
|
Je && wn(Je.data.default_view_id);
|
|
702
703
|
}, [Je]);
|
|
703
704
|
const [il, yr] = v({}), fe = we ? (i == null ? void 0 : i.groups) ?? null : null, Ut = (fe ?? []).filter((e) => !ve.has(e.key)).map((e) => e.key).flatMap(
|
|
@@ -723,7 +724,7 @@ function id({
|
|
|
723
724
|
group_by: $,
|
|
724
725
|
group_key: e,
|
|
725
726
|
page: t,
|
|
726
|
-
limit:
|
|
727
|
+
limit: Ti
|
|
727
728
|
})
|
|
728
729
|
).then((n) => ({ key: e, rows: n.data })),
|
|
729
730
|
enabled: !!i && we,
|
|
@@ -739,7 +740,7 @@ function id({
|
|
|
739
740
|
}, [cl, Ut.map((e) => `${e.key}\0${e.page}`).join("")]), dl = new Set(
|
|
740
741
|
_n.flatMap((e, t) => e.isFetching ? [Ut[t].key] : [])
|
|
741
742
|
), F = fe ? [...Nn.values()].flat() : (i == null ? void 0 : i.data) ?? [];
|
|
742
|
-
|
|
743
|
+
Ls(
|
|
743
744
|
l ? {
|
|
744
745
|
queue: {
|
|
745
746
|
id: l,
|
|
@@ -750,7 +751,7 @@ function id({
|
|
|
750
751
|
}
|
|
751
752
|
} : null
|
|
752
753
|
);
|
|
753
|
-
const ul =
|
|
754
|
+
const ul = As(), mt = F.some((e) => e.fulfilment !== void 0), pt = F.some((e) => e.send_backs !== void 0), { data: Xe, dataUpdatedAt: kr } = G({
|
|
754
755
|
queryKey: ["queue-live-stats", l, g, Ee, Zn],
|
|
755
756
|
queryFn: () => f.request(
|
|
756
757
|
L(`/queues/${l}/items`, {
|
|
@@ -765,16 +766,16 @@ function id({
|
|
|
765
766
|
placeholderData: (e) => e,
|
|
766
767
|
retry: !1
|
|
767
768
|
}), It = !!Xe && kr > le, x = It ? Xe.stats : i == null ? void 0 : i.stats, z = It ? Xe.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, vr = It ? Xe.state_counts : i == null ? void 0 : i.state_counts;
|
|
768
|
-
|
|
769
|
+
P(() => {
|
|
769
770
|
if (!It) return;
|
|
770
|
-
const e = pn.current > 0 || mn.current, t =
|
|
771
|
+
const e = pn.current > 0 || mn.current, t = gi({
|
|
771
772
|
pending: cn.current,
|
|
772
773
|
liveTotal: Xe.total,
|
|
773
774
|
rowsTotal: i == null ? void 0 : i.total,
|
|
774
775
|
// Only a table re-reads its rows quietly; the other views keep the pill.
|
|
775
776
|
busy: e || S !== "table"
|
|
776
777
|
});
|
|
777
|
-
cn.current = 0, t > 0 && Lt((r) => r + t),
|
|
778
|
+
cn.current = 0, t > 0 && Lt((r) => r + t), xi({
|
|
778
779
|
liveTotal: Xe.total,
|
|
779
780
|
rowsTotal: i == null ? void 0 : i.total,
|
|
780
781
|
// Grouped tables too (army 8 b08-N6): their headers count the whole set, and
|
|
@@ -795,7 +796,7 @@ function id({
|
|
|
795
796
|
F.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
796
797
|
Da
|
|
797
798
|
), _r = j(le), Nr = j(0);
|
|
798
|
-
!ue.current && le !== Nr.current && (_r.current = le),
|
|
799
|
+
!ue.current && le !== Nr.current && (_r.current = le), P(() => {
|
|
799
800
|
const e = new Set(F.map((t) => `${t.collection}:${t.item_id}`));
|
|
800
801
|
if (ue.current) {
|
|
801
802
|
ue.current = !1, Nr.current = le;
|
|
@@ -810,7 +811,7 @@ function id({
|
|
|
810
811
|
}
|
|
811
812
|
}
|
|
812
813
|
er.current = e;
|
|
813
|
-
}, [le]),
|
|
814
|
+
}, [le]), P(() => {
|
|
814
815
|
Lt(0);
|
|
815
816
|
}, [le]);
|
|
816
817
|
function ml() {
|
|
@@ -977,8 +978,8 @@ function id({
|
|
|
977
978
|
atRisk: e.at_risk,
|
|
978
979
|
count: e.count,
|
|
979
980
|
sums: e.sums ?? {}
|
|
980
|
-
})) :
|
|
981
|
-
|
|
981
|
+
})) : ks(F, $).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [F, $, fe, Nn]), Rn = j(null);
|
|
982
|
+
P(() => {
|
|
982
983
|
if (!$ || !oe) {
|
|
983
984
|
Rn.current = null;
|
|
984
985
|
return;
|
|
@@ -1021,12 +1022,13 @@ function id({
|
|
|
1021
1022
|
path: `${window.location.pathname}${window.location.search}`,
|
|
1022
1023
|
at: Date.now(),
|
|
1023
1024
|
scroll: ((t = Yt.current) == null ? void 0 : t.scrollTop) ?? 0,
|
|
1024
|
-
state: { scope: g, page: de, sort: I, filters: w, group_by: $, view: S }
|
|
1025
|
+
state: { scope: g, page: de, sort: I, filters: w, group_by: $, view: S },
|
|
1026
|
+
entry: ps()
|
|
1025
1027
|
}), H.open(Ln(e));
|
|
1026
1028
|
}, [B, kt] = v(
|
|
1027
1029
|
null
|
|
1028
1030
|
);
|
|
1029
|
-
|
|
1031
|
+
P(() => {
|
|
1030
1032
|
if (!B) return;
|
|
1031
1033
|
const e = () => kt(null);
|
|
1032
1034
|
return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
|
|
@@ -1052,7 +1054,7 @@ function id({
|
|
|
1052
1054
|
}
|
|
1053
1055
|
Oe(e);
|
|
1054
1056
|
};
|
|
1055
|
-
|
|
1057
|
+
P(() => {
|
|
1056
1058
|
if (!Ce) return;
|
|
1057
1059
|
const e = F.find((t) => D(t) === D(Ce));
|
|
1058
1060
|
e && e !== Ce && Oe(e);
|
|
@@ -1070,7 +1072,7 @@ function id({
|
|
|
1070
1072
|
}
|
|
1071
1073
|
En(!0), Oe(n);
|
|
1072
1074
|
}
|
|
1073
|
-
|
|
1075
|
+
P(() => {
|
|
1074
1076
|
if (S !== "table") return;
|
|
1075
1077
|
function e(t) {
|
|
1076
1078
|
var o;
|
|
@@ -1100,7 +1102,7 @@ function id({
|
|
|
1100
1102
|
queryKey: ["queue-views", l],
|
|
1101
1103
|
queryFn: () => f.request(L(`/queues/${l}/views`)),
|
|
1102
1104
|
enabled: !!l
|
|
1103
|
-
}), [et, tt] = v(null), [wl, An] = v(!1), [Ht, Dr] = v(""), [
|
|
1105
|
+
}), [et, tt] = v(null), [wl, An] = v(!1), [Ht, Dr] = v(""), [Kr, Pr] = v(!1), [vt, Mr] = v(!1);
|
|
1104
1106
|
function wt(e) {
|
|
1105
1107
|
const t = e.state ?? {};
|
|
1106
1108
|
Y(t.scope ?? "all"), Q({ ...me.current, ...t.filters ?? {} }), Ie(t.sort ?? ""), st(t.group_by ?? null), jt(t.columns ?? null), on(t.pins ?? null), t.view && Ue(Re.includes(t.view) ? t.view : Re[0]), A(1), tt(e.id);
|
|
@@ -1114,20 +1116,20 @@ function id({
|
|
|
1114
1116
|
}
|
|
1115
1117
|
Y(((t = c == null ? void 0 : c.display_config) == null ? void 0 : t.default_scope) ?? "all"), Q({ ...me.current }), Ie(""), st(null), jt(null), on(null), (n = c == null ? void 0 : c.display_config) != null && n.default_view && Ue(c.display_config.default_view), A(1), tt(null);
|
|
1116
1118
|
}
|
|
1117
|
-
|
|
1119
|
+
P(() => {
|
|
1118
1120
|
if (J || !(c != null && c.display_config) || Je === void 0 || U === void 0) return;
|
|
1119
1121
|
const e = Je.data.default_view_id, t = e != null ? U.data.find((r) => r.id === e) : void 0, n = U.data.find((r) => r.is_default);
|
|
1120
1122
|
t ? wt(t) : n ? wt(n) : (Ue(c.display_config.default_view), Y(c.display_config.default_scope)), Ba(!0);
|
|
1121
1123
|
}, [c, Je, U, J]);
|
|
1122
1124
|
const Yt = j(null), Jt = j(null);
|
|
1123
|
-
|
|
1125
|
+
P(() => {
|
|
1124
1126
|
if (!J) return;
|
|
1125
|
-
const e =
|
|
1126
|
-
if (!
|
|
1127
|
+
const e = Ys();
|
|
1128
|
+
if (!e || !Js(e, l, ms(), us())) return;
|
|
1127
1129
|
Ra({ ...e, restore: !1 });
|
|
1128
1130
|
const t = e.state ?? {};
|
|
1129
1131
|
t.scope && Y(t.scope), t.filters && Q({ ...me.current, ...t.filters }), t.sort != null && Ie(t.sort), st(t.group_by ?? null), t.view && Ue(t.view), t.page && A(t.page), Jt.current = e.scroll ?? 0;
|
|
1130
|
-
}, [J, l]),
|
|
1132
|
+
}, [J, l]), P(() => {
|
|
1131
1133
|
var s;
|
|
1132
1134
|
if (!J || typeof window > "u") return;
|
|
1133
1135
|
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";
|
|
@@ -1139,7 +1141,7 @@ function id({
|
|
|
1139
1141
|
"",
|
|
1140
1142
|
`${window.location.pathname}${o ? `?${o}` : ""}${window.location.hash}`
|
|
1141
1143
|
), r && Y(t), n && Q((m) => ({ ...m, state: [n] })), A(1);
|
|
1142
|
-
}, [J]),
|
|
1144
|
+
}, [J]), P(() => {
|
|
1143
1145
|
if (!J || typeof window > "u") return;
|
|
1144
1146
|
const e = new URLSearchParams(window.location.search), t = e.get("owner");
|
|
1145
1147
|
if (!t) return;
|
|
@@ -1150,7 +1152,7 @@ function id({
|
|
|
1150
1152
|
"",
|
|
1151
1153
|
`${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
|
|
1152
1154
|
), Y("all"), Q((r) => ({ ...r, owners: [t] })), tt(null), A(1);
|
|
1153
|
-
}, [J]),
|
|
1155
|
+
}, [J]), P(() => {
|
|
1154
1156
|
if (!J) return;
|
|
1155
1157
|
const e = as(ls(`queue:${l}`));
|
|
1156
1158
|
e && (os(), wt({
|
|
@@ -1169,19 +1171,19 @@ function id({
|
|
|
1169
1171
|
pins: ct,
|
|
1170
1172
|
...de > 1 ? { page: de } : {}
|
|
1171
1173
|
});
|
|
1172
|
-
|
|
1174
|
+
P(() => {
|
|
1173
1175
|
Jt.current == null || F.length === 0 || !Yt.current || (Yt.current.scrollTop = Jt.current, Jt.current = null);
|
|
1174
1176
|
}, [F]);
|
|
1175
1177
|
const { isAdmin: De } = $a(), Sl = F.map((e) => `${e.collection}|${e.item_id}`).join(","), Cl = V(
|
|
1176
1178
|
() => F.map((e) => ({ collection: e.collection, id: e.item_id })),
|
|
1177
1179
|
[Sl]
|
|
1178
|
-
), Qr =
|
|
1180
|
+
), Qr = ni(Cl, De), $l = (e) => Vt === D(e) ? (
|
|
1179
1181
|
// Pinned sticky cells use bg-inherit — the highlight must be
|
|
1180
1182
|
// OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
|
|
1181
1183
|
// scrolled content bleeds through the pinned columns. Same
|
|
1182
1184
|
// pair DataTable uses for selected rows when pins are active.
|
|
1183
1185
|
"bg-[#f2fdff] dark:bg-[#20303a]"
|
|
1184
|
-
) : e.at_risk ?
|
|
1186
|
+
) : e.at_risk ? Ss(e.at_risk_color ?? "red") : void 0, zt = De || (c == null ? void 0 : c.owner) != null && c.owner === N, ql = qe({
|
|
1185
1187
|
mutationFn: ({ viewId: e, on: t }) => f.request(qa(`/queues/views/${e}`, { is_default: t })),
|
|
1186
1188
|
onSuccess: () => {
|
|
1187
1189
|
h.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("Queue default view updated");
|
|
@@ -1191,7 +1193,7 @@ function id({
|
|
|
1191
1193
|
mutationFn: () => f.request(
|
|
1192
1194
|
ie(`/queues/${l}/views`, {
|
|
1193
1195
|
name: Ht.trim(),
|
|
1194
|
-
is_shared: zt && (
|
|
1196
|
+
is_shared: zt && (Kr || vt),
|
|
1195
1197
|
is_default: vt,
|
|
1196
1198
|
state: {
|
|
1197
1199
|
scope: g,
|
|
@@ -1205,10 +1207,10 @@ function id({
|
|
|
1205
1207
|
})
|
|
1206
1208
|
),
|
|
1207
1209
|
onSuccess: (e) => {
|
|
1208
|
-
An(!1), Dr(""),
|
|
1210
|
+
An(!1), Dr(""), Pr(!1), Mr(!1), tt(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), O.success("View saved");
|
|
1209
1211
|
},
|
|
1210
1212
|
onError: () => O.error("Failed to save view")
|
|
1211
|
-
}), [Br, jr] = v(null),
|
|
1213
|
+
}), [Br, jr] = v(null), Ke = qe({
|
|
1212
1214
|
mutationFn: (e) => f.request(
|
|
1213
1215
|
qa(`/queues/views/${e.id}`, {
|
|
1214
1216
|
state: {
|
|
@@ -1227,7 +1229,7 @@ function id({
|
|
|
1227
1229
|
},
|
|
1228
1230
|
onError: () => O.error("Failed to update view")
|
|
1229
1231
|
}), [On, Zt] = v(null);
|
|
1230
|
-
|
|
1232
|
+
P(() => {
|
|
1231
1233
|
if (On == null) return;
|
|
1232
1234
|
const e = setTimeout(() => Zt(null), 5e3);
|
|
1233
1235
|
return () => clearTimeout(e);
|
|
@@ -1249,15 +1251,15 @@ function id({
|
|
|
1249
1251
|
onError: () => {
|
|
1250
1252
|
h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), O.error("Failed to update default view");
|
|
1251
1253
|
}
|
|
1252
|
-
}), [
|
|
1254
|
+
}), [Pe, nt] = v([]), [ee, Ir] = v(!1), Tl = () => {
|
|
1253
1255
|
ee && nt([]), Ir(!ee);
|
|
1254
1256
|
};
|
|
1255
|
-
|
|
1257
|
+
P(() => {
|
|
1256
1258
|
S !== "table" && ee && (Ir(!1), nt([]));
|
|
1257
|
-
}, [S, ee]), Bo(), pn.current =
|
|
1259
|
+
}, [S, ee]), Bo(), pn.current = Pe.length;
|
|
1258
1260
|
const [Vr, Gr] = v(!1);
|
|
1259
1261
|
async function Dn(e, t) {
|
|
1260
|
-
const n = F.filter((m) =>
|
|
1262
|
+
const n = F.filter((m) => Pe.includes(D(m)));
|
|
1261
1263
|
Gr(!0), Qt.beginBatch();
|
|
1262
1264
|
const r = await Promise.allSettled(n.map(t));
|
|
1263
1265
|
Qt.endBatch();
|
|
@@ -1334,13 +1336,13 @@ function id({
|
|
|
1334
1336
|
" at risk"
|
|
1335
1337
|
] })
|
|
1336
1338
|
] })
|
|
1337
|
-
})),
|
|
1338
|
-
...
|
|
1339
|
+
})), Kn = (((ua = i == null ? void 0 : i.available_values.collection) == null ? void 0 : ua.length) ?? 0) > 1, Wr = F.some((e) => !!e.unseen) || ft.size > 0 || F.some((e) => Fe.isNew(D(e))), Hr = [
|
|
1340
|
+
...Kn ? [
|
|
1339
1341
|
{
|
|
1340
1342
|
key: "collection",
|
|
1341
1343
|
header: T("collection", "Collection"),
|
|
1342
1344
|
sortable: !0,
|
|
1343
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1345
|
+
render: (e) => /* @__PURE__ */ a(di, { variant: "outline", children: xt(e.collection) })
|
|
1344
1346
|
}
|
|
1345
1347
|
] : [],
|
|
1346
1348
|
{
|
|
@@ -1356,14 +1358,14 @@ function id({
|
|
|
1356
1358
|
// convention people already read as "this goes somewhere".
|
|
1357
1359
|
/* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
|
|
1358
1360
|
ft.get(D(e)) || Fe.isNew(D(e)) ? /* @__PURE__ */ a(
|
|
1359
|
-
|
|
1361
|
+
Xs,
|
|
1360
1362
|
{
|
|
1361
1363
|
lock: ft.get(D(e)),
|
|
1362
1364
|
isNew: Fe.isNew(D(e)),
|
|
1363
1365
|
dataAttr: "data-queue-live-mark",
|
|
1364
1366
|
hang: !0
|
|
1365
1367
|
}
|
|
1366
|
-
) : /* @__PURE__ */ a(
|
|
1368
|
+
) : /* @__PURE__ */ a(ci, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
|
|
1367
1369
|
/* @__PURE__ */ a(
|
|
1368
1370
|
"span",
|
|
1369
1371
|
{
|
|
@@ -1382,9 +1384,9 @@ function id({
|
|
|
1382
1384
|
t
|
|
1383
1385
|
)),
|
|
1384
1386
|
/* @__PURE__ */ a(
|
|
1385
|
-
|
|
1387
|
+
ii,
|
|
1386
1388
|
{
|
|
1387
|
-
viewers: al[
|
|
1389
|
+
viewers: al[ys(e.collection, e.item_id)],
|
|
1388
1390
|
dataAttr: "data-queue-presence"
|
|
1389
1391
|
}
|
|
1390
1392
|
)
|
|
@@ -1419,13 +1421,13 @@ function id({
|
|
|
1419
1421
|
key: "owners",
|
|
1420
1422
|
header: T("owners", "Owners"),
|
|
1421
1423
|
sortable: !0,
|
|
1422
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1424
|
+
render: (e) => /* @__PURE__ */ a(ki, { owners: e.owners })
|
|
1423
1425
|
},
|
|
1424
1426
|
{
|
|
1425
1427
|
key: "aging_hours",
|
|
1426
1428
|
header: T("aging_hours", "Aging"),
|
|
1427
1429
|
sortable: !0,
|
|
1428
|
-
render: (e) =>
|
|
1430
|
+
render: (e) => Li(e.aging_hours)
|
|
1429
1431
|
},
|
|
1430
1432
|
{
|
|
1431
1433
|
// When the record entered its current state — the same moment Aging
|
|
@@ -1439,7 +1441,7 @@ function id({
|
|
|
1439
1441
|
key: "sla_status",
|
|
1440
1442
|
header: T("sla_status", "SLA"),
|
|
1441
1443
|
sortable: !0,
|
|
1442
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1444
|
+
render: (e) => /* @__PURE__ */ a(Ai, { status: e.sla_status })
|
|
1443
1445
|
},
|
|
1444
1446
|
{
|
|
1445
1447
|
key: "at_risk",
|
|
@@ -1447,7 +1449,7 @@ function id({
|
|
|
1447
1449
|
sortable: !0,
|
|
1448
1450
|
render: (e) => {
|
|
1449
1451
|
var t;
|
|
1450
|
-
return e.at_risk ? /* @__PURE__ */ d("span", { className:
|
|
1452
|
+
return e.at_risk ? /* @__PURE__ */ d("span", { className: Ns(e.at_risk_color ?? "red"), children: [
|
|
1451
1453
|
"⚑ ",
|
|
1452
1454
|
((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
|
|
1453
1455
|
] }) : e.predicted_risk ? /* @__PURE__ */ a("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
|
|
@@ -1458,7 +1460,7 @@ function id({
|
|
|
1458
1460
|
key: "addendums",
|
|
1459
1461
|
header: T("addendums", "Addendums"),
|
|
1460
1462
|
sortable: !1,
|
|
1461
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1463
|
+
render: (e) => /* @__PURE__ */ a(Ei, { summary: e.addendums })
|
|
1462
1464
|
}
|
|
1463
1465
|
] : [],
|
|
1464
1466
|
...mt ? [
|
|
@@ -1467,7 +1469,7 @@ function id({
|
|
|
1467
1469
|
header: T("fulfilment", "Shipped"),
|
|
1468
1470
|
sortable: !0,
|
|
1469
1471
|
render: (e) => /* @__PURE__ */ a(
|
|
1470
|
-
|
|
1472
|
+
Us,
|
|
1471
1473
|
{
|
|
1472
1474
|
collection: e.collection,
|
|
1473
1475
|
itemId: e.item_id,
|
|
@@ -1481,7 +1483,7 @@ function id({
|
|
|
1481
1483
|
key: "integrations",
|
|
1482
1484
|
header: T("integrations", "Integrations"),
|
|
1483
1485
|
sortable: !1,
|
|
1484
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1486
|
+
render: (e) => /* @__PURE__ */ a(Gs, { rows: fl[`${e.collection}:${e.item_id}`] })
|
|
1485
1487
|
}
|
|
1486
1488
|
] : [],
|
|
1487
1489
|
...qr ? [
|
|
@@ -1510,7 +1512,7 @@ function id({
|
|
|
1510
1512
|
key: "send_backs",
|
|
1511
1513
|
header: T("send_backs", "Sent back"),
|
|
1512
1514
|
sortable: !0,
|
|
1513
|
-
render: (e) => /* @__PURE__ */ a(
|
|
1515
|
+
render: (e) => /* @__PURE__ */ a(Fi, { summary: e.send_backs })
|
|
1514
1516
|
}
|
|
1515
1517
|
] : []
|
|
1516
1518
|
], Ll = {
|
|
@@ -1537,7 +1539,7 @@ function id({
|
|
|
1537
1539
|
children: "Claim"
|
|
1538
1540
|
}
|
|
1539
1541
|
)
|
|
1540
|
-
}, _t = (c == null ? void 0 : c.available_extra_fields) ?? [], Nt =
|
|
1542
|
+
}, _t = (c == null ? void 0 : c.available_extra_fields) ?? [], Nt = Ko("drill.queue"), ae = Nt.value, Yr = (e) => Nt.push([e]), Al = (e) => {
|
|
1541
1543
|
var t;
|
|
1542
1544
|
for (const n of (c == null ? void 0 : c.sources) ?? []) {
|
|
1543
1545
|
const r = (t = n.drilldown) == null ? void 0 : t[e];
|
|
@@ -1555,20 +1557,20 @@ function id({
|
|
|
1555
1557
|
for (const [n, r] of Object.entries(t.column_formats ?? {}))
|
|
1556
1558
|
n in e || (e[n] = r);
|
|
1557
1559
|
return e;
|
|
1558
|
-
}, [c == null ? void 0 : c.sources]), Dl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
|
|
1559
|
-
function
|
|
1560
|
+
}, [c == null ? void 0 : c.sources]), Dl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Kl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
|
|
1561
|
+
function Pl(e) {
|
|
1560
1562
|
if (Dl.test(e)) return { text: e.split("@")[0], title: e };
|
|
1561
|
-
if (
|
|
1563
|
+
if (Kl.test(e)) {
|
|
1562
1564
|
const t = new Date(e);
|
|
1563
1565
|
if (!Number.isNaN(t.getTime()))
|
|
1564
1566
|
return {
|
|
1565
|
-
text:
|
|
1566
|
-
title:
|
|
1567
|
+
text: Es(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
|
|
1568
|
+
title: Rs(t)
|
|
1567
1569
|
};
|
|
1568
1570
|
}
|
|
1569
1571
|
return { text: e, title: e };
|
|
1570
1572
|
}
|
|
1571
|
-
const
|
|
1573
|
+
const Pn = Zo(u == null ? void 0 : u.inline_edit), Jr = Pn.enabled ? [
|
|
1572
1574
|
...new Set(
|
|
1573
1575
|
((c == null ? void 0 : c.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
|
|
1574
1576
|
)
|
|
@@ -1591,20 +1593,20 @@ function id({
|
|
|
1591
1593
|
const { data: Ql } = G({
|
|
1592
1594
|
queryKey: ["my-permissions"],
|
|
1593
1595
|
queryFn: () => f.request(L("/security/my/permissions")).then((e) => e.data),
|
|
1594
|
-
enabled:
|
|
1596
|
+
enabled: Pn.enabled && !De,
|
|
1595
1597
|
staleTime: 5 * 6e4
|
|
1596
|
-
}), zr =
|
|
1598
|
+
}), zr = ei(), Xr = (e, t) => {
|
|
1597
1599
|
if (t.includes(".")) return null;
|
|
1598
1600
|
const n = Mn.get(e.collection);
|
|
1599
1601
|
if (!n) return null;
|
|
1600
1602
|
const r = ft.get(D(e));
|
|
1601
1603
|
return r && !r.is_mine ? null : ns({
|
|
1602
|
-
config:
|
|
1604
|
+
config: Pn,
|
|
1603
1605
|
key: t,
|
|
1604
1606
|
field: n.fields.get(t),
|
|
1605
1607
|
collection: e.collection,
|
|
1606
1608
|
relations: n.relations,
|
|
1607
|
-
mayUpdate: De ||
|
|
1609
|
+
mayUpdate: De || Ms(Ql, e.collection)
|
|
1608
1610
|
});
|
|
1609
1611
|
}, Zr = (e, t, n) => {
|
|
1610
1612
|
var r, o, s;
|
|
@@ -1640,7 +1642,7 @@ function id({
|
|
|
1640
1642
|
if (!r) return n;
|
|
1641
1643
|
const o = Mn.get(e.collection), s = o == null ? void 0 : o.fields.get(t);
|
|
1642
1644
|
return /* @__PURE__ */ a(
|
|
1643
|
-
|
|
1645
|
+
ti,
|
|
1644
1646
|
{
|
|
1645
1647
|
controller: zr,
|
|
1646
1648
|
cellKey: `${D(e)}|${t}`,
|
|
@@ -1664,7 +1666,7 @@ function id({
|
|
|
1664
1666
|
{
|
|
1665
1667
|
const o = (n = e.extra) == null ? void 0 : n[t];
|
|
1666
1668
|
if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
|
|
1667
|
-
const s = Me(t), m = s ? rt(String(o), s) : String(o), { text: p, title: C } =
|
|
1669
|
+
const s = Me(t), m = s ? rt(String(o), s) : String(o), { text: p, title: C } = Pl(m), _ = ((c == null ? void 0 : c.extra_field_meta) ?? []).find((y) => y.path === t), b = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], R = Al(t);
|
|
1668
1670
|
return (_ == null ? void 0 : _.kind) === "relation" && _.target_collection && b.length > 0 && R.enabled && !_.aggregate ? /* @__PURE__ */ a(
|
|
1669
1671
|
"button",
|
|
1670
1672
|
{
|
|
@@ -1697,7 +1699,7 @@ function id({
|
|
|
1697
1699
|
}
|
|
1698
1700
|
}
|
|
1699
1701
|
const ea = [
|
|
1700
|
-
...
|
|
1702
|
+
...Kn ? ["collection"] : [],
|
|
1701
1703
|
"state",
|
|
1702
1704
|
"owners",
|
|
1703
1705
|
"aging_hours",
|
|
@@ -1711,7 +1713,7 @@ function id({
|
|
|
1711
1713
|
...qr ? ["tasks"] : [],
|
|
1712
1714
|
..._t.map((e) => `extra.${e}`)
|
|
1713
1715
|
], Vl = [
|
|
1714
|
-
...
|
|
1716
|
+
...Kn ? ["collection"] : [],
|
|
1715
1717
|
"state",
|
|
1716
1718
|
"owners",
|
|
1717
1719
|
...Ze ? ["addendums"] : [],
|
|
@@ -1741,7 +1743,7 @@ function id({
|
|
|
1741
1743
|
const ta = Hr.find((e) => e.key === "label"), Jl = {
|
|
1742
1744
|
...ta,
|
|
1743
1745
|
render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
|
|
1744
|
-
/* @__PURE__ */ a(
|
|
1746
|
+
/* @__PURE__ */ a(Ks, { rowId: e.item_id }),
|
|
1745
1747
|
ta.render(e, ...t)
|
|
1746
1748
|
] })
|
|
1747
1749
|
}, zl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
|
|
@@ -1761,7 +1763,7 @@ function id({
|
|
|
1761
1763
|
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) });
|
|
1762
1764
|
}
|
|
1763
1765
|
})
|
|
1764
|
-
), Bn = [...Hr, ...Ul, ...zl], na =
|
|
1766
|
+
), Bn = [...Hr, ...Ul, ...zl], na = fi(
|
|
1765
1767
|
St,
|
|
1766
1768
|
(e) => {
|
|
1767
1769
|
var n;
|
|
@@ -1773,7 +1775,7 @@ function id({
|
|
|
1773
1775
|
key: "__actions__",
|
|
1774
1776
|
header: "",
|
|
1775
1777
|
render: (e) => e.collection === "tasks" || e.collection === rn ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
|
|
1776
|
-
|
|
1778
|
+
Ps,
|
|
1777
1779
|
{
|
|
1778
1780
|
collection: e.collection,
|
|
1779
1781
|
id: e.item_id,
|
|
@@ -1816,9 +1818,9 @@ function id({
|
|
|
1816
1818
|
sort: e.display_field,
|
|
1817
1819
|
// Records hidden from pickers (a retired zone) are not offered.
|
|
1818
1820
|
picker: "1"
|
|
1819
|
-
}, o = n != null && n.narrowBy.length ?
|
|
1821
|
+
}, o = n != null && n.narrowBy.length ? vs(
|
|
1820
1822
|
e.target_collection,
|
|
1821
|
-
await
|
|
1823
|
+
await ws(f, h, e.target_collection),
|
|
1822
1824
|
n.narrowBy
|
|
1823
1825
|
) : null, s = [
|
|
1824
1826
|
...t.trim() ? [{ [e.display_field]: { _contains: t.trim() } }] : [],
|
|
@@ -1917,7 +1919,7 @@ function id({
|
|
|
1917
1919
|
key: "integrations",
|
|
1918
1920
|
placeholder: T("integrations", "Integrations"),
|
|
1919
1921
|
type: "select",
|
|
1920
|
-
options:
|
|
1922
|
+
options: Ws.map((e) => ({ label: e.label, value: e.value }))
|
|
1921
1923
|
}
|
|
1922
1924
|
] : [],
|
|
1923
1925
|
...mt ? [
|
|
@@ -1925,7 +1927,7 @@ function id({
|
|
|
1925
1927
|
key: "fulfilment",
|
|
1926
1928
|
placeholder: "Shipped",
|
|
1927
1929
|
type: "select",
|
|
1928
|
-
options:
|
|
1930
|
+
options: Is
|
|
1929
1931
|
}
|
|
1930
1932
|
] : [],
|
|
1931
1933
|
...pt ? [
|
|
@@ -2171,7 +2173,7 @@ function id({
|
|
|
2171
2173
|
return r.delete(e), r;
|
|
2172
2174
|
})), jt([...t]);
|
|
2173
2175
|
}
|
|
2174
|
-
return Ot ? (
|
|
2176
|
+
return Ot ? (K == null ? void 0 : K((Ot == null ? void 0 : Ot.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
|
|
2175
2177
|
/* @__PURE__ */ d("div", { className: "shrink-0", children: [
|
|
2176
2178
|
(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: [
|
|
2177
2179
|
/* @__PURE__ */ a(ho, { className: "h-4 w-4 shrink-0" }),
|
|
@@ -2183,7 +2185,7 @@ function id({
|
|
|
2183
2185
|
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",
|
|
2184
2186
|
"data-queue-toolbar": !0,
|
|
2185
2187
|
children: [
|
|
2186
|
-
J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children:
|
|
2188
|
+
J ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: Ri.filter((e) => pe || e.value !== "claimed").map(
|
|
2187
2189
|
(e, t) => /* @__PURE__ */ a(
|
|
2188
2190
|
"button",
|
|
2189
2191
|
{
|
|
@@ -2258,7 +2260,7 @@ function id({
|
|
|
2258
2260
|
}
|
|
2259
2261
|
),
|
|
2260
2262
|
Ne && /* @__PURE__ */ a(
|
|
2261
|
-
|
|
2263
|
+
Hs,
|
|
2262
2264
|
{
|
|
2263
2265
|
label: T("integrations", "Integrations"),
|
|
2264
2266
|
value: w.integrations,
|
|
@@ -2268,8 +2270,8 @@ function id({
|
|
|
2268
2270
|
})
|
|
2269
2271
|
}
|
|
2270
2272
|
),
|
|
2271
|
-
/* @__PURE__ */ a(
|
|
2272
|
-
/* @__PURE__ */ a(
|
|
2273
|
+
/* @__PURE__ */ a(li, { className: "h-8" }),
|
|
2274
|
+
/* @__PURE__ */ a(js, {}),
|
|
2273
2275
|
sn > 0 && /* @__PURE__ */ d(
|
|
2274
2276
|
"button",
|
|
2275
2277
|
{
|
|
@@ -2302,9 +2304,9 @@ function id({
|
|
|
2302
2304
|
}
|
|
2303
2305
|
) }),
|
|
2304
2306
|
/* @__PURE__ */ a(ot, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(Ea, { children: [
|
|
2305
|
-
/* @__PURE__ */ a(
|
|
2307
|
+
/* @__PURE__ */ a(ui, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
|
|
2306
2308
|
/* @__PURE__ */ d(La, { children: [
|
|
2307
|
-
/* @__PURE__ */ a(
|
|
2309
|
+
/* @__PURE__ */ a(mi, { children: "No attribute found." }),
|
|
2308
2310
|
/* @__PURE__ */ a(Ft, { value: "__none__", onSelect: () => st(null), children: "None" }),
|
|
2309
2311
|
aa.map((e) => /* @__PURE__ */ a(
|
|
2310
2312
|
Ft,
|
|
@@ -2381,7 +2383,7 @@ function id({
|
|
|
2381
2383
|
]
|
|
2382
2384
|
}
|
|
2383
2385
|
),
|
|
2384
|
-
/* @__PURE__ */ a(
|
|
2386
|
+
/* @__PURE__ */ a(Zs, { listKey: `queue:${l}`, getState: Nl }),
|
|
2385
2387
|
/* @__PURE__ */ d(
|
|
2386
2388
|
"button",
|
|
2387
2389
|
{
|
|
@@ -2421,7 +2423,7 @@ function id({
|
|
|
2421
2423
|
children: /* @__PURE__ */ a(co, { items: na, strategy: uo, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: na.map((e) => {
|
|
2422
2424
|
const t = Bn.find((n) => n.key === e);
|
|
2423
2425
|
return /* @__PURE__ */ a(
|
|
2424
|
-
|
|
2426
|
+
Ki,
|
|
2425
2427
|
{
|
|
2426
2428
|
id: e,
|
|
2427
2429
|
label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
|
|
@@ -2434,7 +2436,7 @@ function id({
|
|
|
2434
2436
|
}
|
|
2435
2437
|
) })
|
|
2436
2438
|
] }),
|
|
2437
|
-
S === "table" &&
|
|
2439
|
+
S === "table" && Pt && /* @__PURE__ */ d(
|
|
2438
2440
|
"button",
|
|
2439
2441
|
{
|
|
2440
2442
|
type: "button",
|
|
@@ -2479,7 +2481,7 @@ function id({
|
|
|
2479
2481
|
]
|
|
2480
2482
|
}
|
|
2481
2483
|
),
|
|
2482
|
-
!hn && re.length === 1 && (
|
|
2484
|
+
!hn && re.length === 1 && (Kt ? /* @__PURE__ */ d(at, { children: [
|
|
2483
2485
|
/* @__PURE__ */ a(lt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
2484
2486
|
"button",
|
|
2485
2487
|
{
|
|
@@ -2506,12 +2508,12 @@ function id({
|
|
|
2506
2508
|
}),
|
|
2507
2509
|
className: "flex w-full items-center rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
|
|
2508
2510
|
children: [
|
|
2509
|
-
((pa =
|
|
2511
|
+
((pa = Kt.active) == null ? void 0 : pa.create_label) ?? ((ba = Kt.active) == null ? void 0 : ba.name) ?? "Default layout",
|
|
2510
2512
|
/* @__PURE__ */ a("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
|
|
2511
2513
|
]
|
|
2512
2514
|
}
|
|
2513
2515
|
),
|
|
2514
|
-
|
|
2516
|
+
Kt.options.map((e) => /* @__PURE__ */ a(
|
|
2515
2517
|
"button",
|
|
2516
2518
|
{
|
|
2517
2519
|
type: "button",
|
|
@@ -2577,7 +2579,7 @@ function id({
|
|
|
2577
2579
|
)) })
|
|
2578
2580
|
] }),
|
|
2579
2581
|
!hn && Ve && ke && /* @__PURE__ */ a(
|
|
2580
|
-
|
|
2582
|
+
Vs,
|
|
2581
2583
|
{
|
|
2582
2584
|
collection: Ve,
|
|
2583
2585
|
onParsed: (e, t) => ke(`/collections/${Ve}/new`, {
|
|
@@ -2720,7 +2722,7 @@ function id({
|
|
|
2720
2722
|
Lr.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Lr.map(([e, t]) => {
|
|
2721
2723
|
var n;
|
|
2722
2724
|
return /* @__PURE__ */ a(
|
|
2723
|
-
|
|
2725
|
+
Di,
|
|
2724
2726
|
{
|
|
2725
2727
|
label: Ae(e),
|
|
2726
2728
|
count: t,
|
|
@@ -2736,7 +2738,7 @@ function id({
|
|
|
2736
2738
|
}
|
|
2737
2739
|
),
|
|
2738
2740
|
S !== "workload" && /* @__PURE__ */ a(
|
|
2739
|
-
|
|
2741
|
+
Si,
|
|
2740
2742
|
{
|
|
2741
2743
|
defs: Zl,
|
|
2742
2744
|
values: w,
|
|
@@ -2881,13 +2883,13 @@ function id({
|
|
|
2881
2883
|
"button",
|
|
2882
2884
|
{
|
|
2883
2885
|
type: "button",
|
|
2884
|
-
onClick: () =>
|
|
2885
|
-
disabled:
|
|
2886
|
+
onClick: () => Ke.mutate(e),
|
|
2887
|
+
disabled: Ke.isPending,
|
|
2886
2888
|
title: "Update this view with the current filters, scope and sort",
|
|
2887
2889
|
className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
|
|
2888
2890
|
"aria-label": `Update view ${e.name}`,
|
|
2889
|
-
"data-view-update-state":
|
|
2890
|
-
children:
|
|
2891
|
+
"data-view-update-state": Ke.isPending ? "saving" : Br === e.id ? "saved" : "idle",
|
|
2892
|
+
children: Ke.isPending && ((t = Ke.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ a(Fo, { className: "h-3 w-3 animate-spin" }) : Br === e.id ? /* @__PURE__ */ a(
|
|
2891
2893
|
To,
|
|
2892
2894
|
{
|
|
2893
2895
|
className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
|
|
@@ -2972,9 +2974,9 @@ function id({
|
|
|
2972
2974
|
"button",
|
|
2973
2975
|
{
|
|
2974
2976
|
type: "button",
|
|
2975
|
-
disabled:
|
|
2977
|
+
disabled: Ke.isPending,
|
|
2976
2978
|
onClick: () => {
|
|
2977
|
-
|
|
2979
|
+
Ke.mutate(e), An(!1);
|
|
2978
2980
|
},
|
|
2979
2981
|
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",
|
|
2980
2982
|
children: [
|
|
@@ -3002,9 +3004,9 @@ function id({
|
|
|
3002
3004
|
/* @__PURE__ */ a(
|
|
3003
3005
|
Yn,
|
|
3004
3006
|
{
|
|
3005
|
-
checked:
|
|
3007
|
+
checked: Kr || vt,
|
|
3006
3008
|
disabled: vt,
|
|
3007
|
-
onCheckedChange: (e) =>
|
|
3009
|
+
onCheckedChange: (e) => Pr(e === !0)
|
|
3008
3010
|
}
|
|
3009
3011
|
),
|
|
3010
3012
|
"Share with everyone"
|
|
@@ -3036,7 +3038,7 @@ function id({
|
|
|
3036
3038
|
)
|
|
3037
3039
|
] }),
|
|
3038
3040
|
/* @__PURE__ */ d("div", { ref: Yt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
|
|
3039
|
-
ur && /* @__PURE__ */ a(
|
|
3041
|
+
ur && /* @__PURE__ */ a(zs, { error: el, onRetry: () => void tl(), className: "mb-3" }),
|
|
3040
3042
|
Vn && /* @__PURE__ */ a(
|
|
3041
3043
|
"p",
|
|
3042
3044
|
{
|
|
@@ -3064,7 +3066,7 @@ function id({
|
|
|
3064
3066
|
"s"
|
|
3065
3067
|
] }),
|
|
3066
3068
|
/* @__PURE__ */ a(
|
|
3067
|
-
|
|
3069
|
+
Qs,
|
|
3068
3070
|
{
|
|
3069
3071
|
fillHeight: !0,
|
|
3070
3072
|
enterKey: _r.current,
|
|
@@ -3088,14 +3090,14 @@ function id({
|
|
|
3088
3090
|
},
|
|
3089
3091
|
rowTitle: (e) => {
|
|
3090
3092
|
const t = ft.get(D(e));
|
|
3091
|
-
return Fe.titleFor(D(e)) ?? (t && !t.is_mine ? ds(t) : void 0) ?? (Qr(e.collection, e.item_id) ?
|
|
3093
|
+
return Fe.titleFor(D(e)) ?? (t && !t.is_mine ? ds(t) : void 0) ?? (Qr(e.collection, e.item_id) ? ai : void 0);
|
|
3092
3094
|
},
|
|
3093
3095
|
rowClassName: (e) => q(
|
|
3094
3096
|
$l(e),
|
|
3095
|
-
Qr(e.collection, e.item_id) &&
|
|
3097
|
+
Qr(e.collection, e.item_id) && ri
|
|
3096
3098
|
),
|
|
3097
3099
|
emptyMessage: ur ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
|
|
3098
|
-
|
|
3100
|
+
Bs,
|
|
3099
3101
|
{
|
|
3100
3102
|
icon: Lo,
|
|
3101
3103
|
title: ((fa = i == null ? void 0 : i.empty) == null ? void 0 : fa.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((ha = i == null ? void 0 : i.empty) == null ? void 0 : ha.reason) === "scope_mine" ? "Nothing waiting on you" : ((ga = i == null ? void 0 : i.empty) == null ? void 0 : ga.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
|
|
@@ -3157,8 +3159,8 @@ function id({
|
|
|
3157
3159
|
rowGroups: El ?? void 0,
|
|
3158
3160
|
collapsedGroups: ve,
|
|
3159
3161
|
onToggleGroup: yl,
|
|
3160
|
-
selectedIds:
|
|
3161
|
-
onSelectionChange:
|
|
3162
|
+
selectedIds: Pt && ee ? Pe : void 0,
|
|
3163
|
+
onSelectionChange: Pt && ee ? nt : void 0,
|
|
3162
3164
|
hideFilterRow: !0,
|
|
3163
3165
|
nowrapCells: !0,
|
|
3164
3166
|
columnPins: ra,
|
|
@@ -3171,7 +3173,7 @@ function id({
|
|
|
3171
3173
|
columnFilterRow: !0,
|
|
3172
3174
|
hScrollProxy: !0,
|
|
3173
3175
|
footer: /* @__PURE__ */ a(
|
|
3174
|
-
|
|
3176
|
+
si,
|
|
3175
3177
|
{
|
|
3176
3178
|
collections: gt,
|
|
3177
3179
|
selectedIds: String(w.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
|
|
@@ -3190,7 +3192,7 @@ function id({
|
|
|
3190
3192
|
]
|
|
3191
3193
|
}
|
|
3192
3194
|
) }) }) : S === "kanban" ? /* @__PURE__ */ a(
|
|
3193
|
-
|
|
3195
|
+
Ni,
|
|
3194
3196
|
{
|
|
3195
3197
|
items: F,
|
|
3196
3198
|
onCardClick: (e) => Wt(e),
|
|
@@ -3205,12 +3207,12 @@ function id({
|
|
|
3205
3207
|
mn.current = e;
|
|
3206
3208
|
}
|
|
3207
3209
|
}
|
|
3208
|
-
) : /* @__PURE__ */ a(
|
|
3210
|
+
) : /* @__PURE__ */ a(Ci, { queueId: l })
|
|
3209
3211
|
] }),
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
+
Pt && ee && /* @__PURE__ */ d(
|
|
3213
|
+
wi,
|
|
3212
3214
|
{
|
|
3213
|
-
count:
|
|
3215
|
+
count: Pe.length,
|
|
3214
3216
|
claimsEnabled: pe,
|
|
3215
3217
|
showClaim: gn("claim"),
|
|
3216
3218
|
showRelease: gn("release"),
|
|
@@ -3241,26 +3243,26 @@ function id({
|
|
|
3241
3243
|
onTransition: (e) => Dn("Transition", (t) => xr(t, e)),
|
|
3242
3244
|
onClear: () => nt([]),
|
|
3243
3245
|
children: [
|
|
3244
|
-
|
|
3246
|
+
Pe.length >= 2 && /* @__PURE__ */ a(
|
|
3245
3247
|
"button",
|
|
3246
3248
|
{
|
|
3247
3249
|
type: "button",
|
|
3248
3250
|
onClick: () => {
|
|
3249
|
-
const e =
|
|
3250
|
-
F.filter((t) =>
|
|
3251
|
+
const e = fs(
|
|
3252
|
+
F.filter((t) => Pe.includes(D(t)) && t.collection !== "tasks").map((t) => H.urlFor(Ln(t)))
|
|
3251
3253
|
);
|
|
3252
3254
|
e.blocked > 0 || e.capped > 0 ? O.warning(Fa(e)) : O.success(Fa(e));
|
|
3253
3255
|
},
|
|
3254
3256
|
"data-bulk-open-tabs": !0,
|
|
3255
|
-
title: `Open the selected records in new tabs (up to ${
|
|
3257
|
+
title: `Open the selected records in new tabs (up to ${bs})`,
|
|
3256
3258
|
className: "h-8 rounded-md border border-white/20 px-3 text-[12.5px] font-medium hover:bg-white/10 dark:border-border dark:hover:bg-muted",
|
|
3257
3259
|
children: "Open in tabs"
|
|
3258
3260
|
}
|
|
3259
3261
|
),
|
|
3260
3262
|
/* @__PURE__ */ a(
|
|
3261
|
-
|
|
3263
|
+
Ds,
|
|
3262
3264
|
{
|
|
3263
|
-
targets: F.filter((e) =>
|
|
3265
|
+
targets: F.filter((e) => Pe.includes(D(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
|
|
3264
3266
|
enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
|
|
3265
3267
|
tone: "light",
|
|
3266
3268
|
disabled: Vr,
|
|
@@ -3273,7 +3275,7 @@ function id({
|
|
|
3273
3275
|
}
|
|
3274
3276
|
),
|
|
3275
3277
|
ae != null && ae.length ? /* @__PURE__ */ a(
|
|
3276
|
-
|
|
3278
|
+
oi,
|
|
3277
3279
|
{
|
|
3278
3280
|
collection: ae[0].collection,
|
|
3279
3281
|
itemId: ae[0].itemId,
|
|
@@ -3404,7 +3406,7 @@ function id({
|
|
|
3404
3406
|
),
|
|
3405
3407
|
ir && Ca(
|
|
3406
3408
|
/* @__PURE__ */ a(
|
|
3407
|
-
|
|
3409
|
+
Pi,
|
|
3408
3410
|
{
|
|
3409
3411
|
queueId: l,
|
|
3410
3412
|
drill: ir,
|
|
@@ -3417,7 +3419,7 @@ function id({
|
|
|
3417
3419
|
document.body
|
|
3418
3420
|
),
|
|
3419
3421
|
/* @__PURE__ */ a(
|
|
3420
|
-
|
|
3422
|
+
_i,
|
|
3421
3423
|
{
|
|
3422
3424
|
item: Ce,
|
|
3423
3425
|
stateLabels: Tn,
|
|
@@ -3440,10 +3442,10 @@ function id({
|
|
|
3440
3442
|
Qt.dialog
|
|
3441
3443
|
] });
|
|
3442
3444
|
}
|
|
3443
|
-
function
|
|
3445
|
+
function Pi({
|
|
3444
3446
|
queueId: l,
|
|
3445
3447
|
drill: k,
|
|
3446
|
-
onClose:
|
|
3448
|
+
onClose: K,
|
|
3447
3449
|
onOpenRecord: M
|
|
3448
3450
|
}) {
|
|
3449
3451
|
const W = Aa(), { data: h, isLoading: f } = G({
|
|
@@ -3460,7 +3462,7 @@ function Ai({
|
|
|
3460
3462
|
"div",
|
|
3461
3463
|
{
|
|
3462
3464
|
className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/30 p-6",
|
|
3463
|
-
onClick:
|
|
3465
|
+
onClick: K,
|
|
3464
3466
|
children: /* @__PURE__ */ d(
|
|
3465
3467
|
"div",
|
|
3466
3468
|
{
|
|
@@ -3482,7 +3484,7 @@ function Ai({
|
|
|
3482
3484
|
"button",
|
|
3483
3485
|
{
|
|
3484
3486
|
type: "button",
|
|
3485
|
-
onClick:
|
|
3487
|
+
onClick: K,
|
|
3486
3488
|
className: "rounded-md px-2 py-1 text-[12px] text-slate-400 hover:bg-muted",
|
|
3487
3489
|
children: "✕"
|
|
3488
3490
|
}
|
|
@@ -3507,5 +3509,5 @@ function Ai({
|
|
|
3507
3509
|
);
|
|
3508
3510
|
}
|
|
3509
3511
|
export {
|
|
3510
|
-
|
|
3512
|
+
pd as QueueWorklist
|
|
3511
3513
|
};
|