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