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