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