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