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