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