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