@nivaro/react 0.3.113 → 0.3.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1727 -19
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +544 -504
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-link.js +56 -50
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -1,133 +1,154 @@
|
|
|
1
|
-
import { jsxs as o, jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Clock3 as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as o, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as L, useQueryClient as A, useMutation as q } from "@tanstack/react-query";
|
|
3
|
+
import { Clock3 as F } from "lucide-react";
|
|
4
|
+
import { useRef as D, useEffect as K, useState as k } from "react";
|
|
5
|
+
import { useNivaroClient as R } from "../../context.js";
|
|
6
|
+
import { get as Q, post as H, del as O } from "../../lib/commands.js";
|
|
7
|
+
import { useDeadlineNow as B, liveDeadlineStatus as z, dueInText as U } from "../../lib/deadline-ticker.js";
|
|
8
|
+
import { useLiveRecord as V, batchTouches as W, LIVE_ASPECTS as M } from "../../lib/live.js";
|
|
9
|
+
import { userErrorMessage as G } from "../../lib/safe-error.js";
|
|
10
|
+
import { humanHours as c, formatRelative as J } from "../../lib/utils.js";
|
|
11
|
+
import { invalidateRecordNotes as X } from "../item-edit/RecordInsights.js";
|
|
12
|
+
import { Popover as Y, PopoverTrigger as Z, PopoverContent as I } from "../ui/popover.js";
|
|
13
|
+
function ee(t, r, e) {
|
|
14
|
+
const s = A(), a = !!(e != null && e.due_at) && !!e.status && e.status !== "none", i = B(a), l = a && e ? z(e, i) : null, d = l ?? (e == null ? void 0 : e.status), m = D(null);
|
|
15
|
+
return K(() => {
|
|
16
|
+
if (!l || !(e != null && e.status) || !r) return;
|
|
17
|
+
if (l === e.status) {
|
|
18
|
+
m.current = null;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const h = `${e.due_at}|${l}`;
|
|
22
|
+
m.current !== h && (m.current = h, s.invalidateQueries({ queryKey: v(t, String(r)) }));
|
|
23
|
+
}, [l, e == null ? void 0 : e.status, e == null ? void 0 : e.due_at, s, t, r]), V(
|
|
24
|
+
t,
|
|
25
|
+
r,
|
|
26
|
+
(h) => {
|
|
27
|
+
W(h, M.sla, M.state) && s.invalidateQueries({ queryKey: v(t, String(r)) });
|
|
28
|
+
},
|
|
29
|
+
{ debounceMs: 800, includeOwn: !0, enabled: !!r }
|
|
30
|
+
), { status: d, dueText: a && e ? U(e, i) : null };
|
|
13
31
|
}
|
|
14
|
-
function
|
|
32
|
+
function P(t) {
|
|
33
|
+
return t ? G(t, "Could not load the deadline") : null;
|
|
34
|
+
}
|
|
35
|
+
function v(t, r) {
|
|
15
36
|
return ["sla-breach", t, r];
|
|
16
37
|
}
|
|
17
|
-
function
|
|
18
|
-
const e =
|
|
19
|
-
return
|
|
20
|
-
queryKey:
|
|
21
|
-
queryFn: () => e.request(
|
|
38
|
+
function te(t, r) {
|
|
39
|
+
const e = R();
|
|
40
|
+
return L({
|
|
41
|
+
queryKey: v(t, String(r ?? "")),
|
|
42
|
+
queryFn: () => e.request(Q(`/sla/status/${t}/${r}`)).then((s) => s).catch(() => null),
|
|
22
43
|
enabled: !!r,
|
|
23
44
|
staleTime: 6e4
|
|
24
45
|
});
|
|
25
46
|
}
|
|
26
|
-
function
|
|
27
|
-
if (!r) return
|
|
47
|
+
function $(t, r) {
|
|
48
|
+
if (!r) return c(t);
|
|
28
49
|
if (t == null || Number.isNaN(t)) return "—";
|
|
29
50
|
const e = Math.max(0, t);
|
|
30
51
|
if (e < 1) return `${Math.max(1, Math.round(e * 60))} working min`;
|
|
31
|
-
const
|
|
32
|
-
return `${
|
|
52
|
+
const s = Math.round(e);
|
|
53
|
+
return `${s} working hour${s === 1 ? "" : "s"}`;
|
|
33
54
|
}
|
|
34
|
-
function
|
|
55
|
+
function re(t) {
|
|
35
56
|
var i;
|
|
36
|
-
const r = !!((i = t.sla_rule) != null && i.business_hours_only), e = t.total_hours ?? 0,
|
|
37
|
-
return
|
|
57
|
+
const r = !!((i = t.sla_rule) != null && i.business_hours_only), e = t.total_hours ?? 0, s = e - (t.elapsed_hours ?? 0), a = r ? `${Math.round(e)} working-hour limit` : `${c(e)} limit`;
|
|
58
|
+
return s >= 0 ? `${$(s, r)} left of ${$(e, r)}` : `${$(-s, r)} past the ${a}`;
|
|
38
59
|
}
|
|
39
|
-
function
|
|
60
|
+
function be(t, r = Date.now()) {
|
|
40
61
|
if (!t) return null;
|
|
41
62
|
const e = new Date(t).getTime();
|
|
42
63
|
if (!Number.isFinite(e)) return null;
|
|
43
|
-
const
|
|
44
|
-
return
|
|
64
|
+
const s = Math.floor((r - e) / 864e5);
|
|
65
|
+
return s < 1 ? null : `${s} day${s === 1 ? "" : "s"} in this step`;
|
|
45
66
|
}
|
|
46
|
-
function
|
|
67
|
+
function se(t) {
|
|
47
68
|
const r = t.set_by_name ? ` by ${t.set_by_name}` : "";
|
|
48
|
-
return `Clock adjusted to ${
|
|
69
|
+
return `Clock adjusted to ${c(t.duration_hours)} (rule: ${c(t.rule_duration_hours)})${r}, ${J(t.set_at)}`;
|
|
49
70
|
}
|
|
50
|
-
function
|
|
71
|
+
function ne({
|
|
51
72
|
collection: t,
|
|
52
73
|
itemId: r,
|
|
53
74
|
data: e,
|
|
54
|
-
tone:
|
|
75
|
+
tone: s = "neutral"
|
|
55
76
|
}) {
|
|
56
|
-
var
|
|
57
|
-
const
|
|
58
|
-
i.invalidateQueries({ queryKey:
|
|
59
|
-
},
|
|
60
|
-
mutationFn: () =>
|
|
61
|
-
|
|
62
|
-
duration_hours: Number(
|
|
63
|
-
reason:
|
|
77
|
+
var j;
|
|
78
|
+
const a = R(), i = A(), [l, d] = k(!1), [m, h] = k(""), [x, g] = k(""), [w, f] = k(null), y = ((j = e.sla_rule) == null ? void 0 : j.duration_hours) ?? null, S = e.elapsed_hours ?? 0, C = () => {
|
|
79
|
+
i.invalidateQueries({ queryKey: v(t, r) }), X(i, t, r);
|
|
80
|
+
}, N = q({
|
|
81
|
+
mutationFn: () => a.request(
|
|
82
|
+
H(`/sla/override/${t}/${r}`, {
|
|
83
|
+
duration_hours: Number(m),
|
|
84
|
+
reason: x.trim()
|
|
64
85
|
})
|
|
65
86
|
),
|
|
66
87
|
onSuccess: () => {
|
|
67
|
-
|
|
88
|
+
d(!1), g(""), f(null), C();
|
|
68
89
|
},
|
|
69
|
-
onError: (
|
|
70
|
-
}),
|
|
71
|
-
mutationFn: () =>
|
|
72
|
-
|
|
73
|
-
`/sla/override/${t}/${r}${
|
|
90
|
+
onError: (u) => f(P(u) ?? "Could not adjust the clock")
|
|
91
|
+
}), _ = q({
|
|
92
|
+
mutationFn: () => a.request(
|
|
93
|
+
O(
|
|
94
|
+
`/sla/override/${t}/${r}${x.trim() ? `?reason=${encodeURIComponent(x.trim())}` : ""}`
|
|
74
95
|
)
|
|
75
96
|
),
|
|
76
97
|
onSuccess: () => {
|
|
77
|
-
|
|
98
|
+
d(!1), g(""), f(null), C();
|
|
78
99
|
},
|
|
79
|
-
onError: (
|
|
80
|
-
}),
|
|
100
|
+
onError: (u) => f(P(u) ?? "Could not reset the clock")
|
|
101
|
+
}), p = Number(m), E = Number.isFinite(p) && p > 0 && p <= 8760 && x.trim().length > 0, b = Number.isFinite(p) && p > 0 ? p - S : null;
|
|
81
102
|
return /* @__PURE__ */ o(
|
|
82
|
-
|
|
103
|
+
Y,
|
|
83
104
|
{
|
|
84
|
-
open:
|
|
85
|
-
onOpenChange: (
|
|
86
|
-
var
|
|
87
|
-
|
|
105
|
+
open: l,
|
|
106
|
+
onOpenChange: (u) => {
|
|
107
|
+
var T;
|
|
108
|
+
d(u), u && (h(String(((T = e.override) == null ? void 0 : T.duration_hours) ?? e.total_hours ?? y ?? "")), f(null));
|
|
88
109
|
},
|
|
89
110
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ n(Z, { asChild: !0, children: /* @__PURE__ */ n(
|
|
91
112
|
"button",
|
|
92
113
|
{
|
|
93
114
|
type: "button",
|
|
94
115
|
"data-sla-adjust": !0,
|
|
95
|
-
className:
|
|
116
|
+
className: s === "danger" ? "shrink-0 rounded-md border border-red-300 px-2.5 py-1 text-[12px] font-medium text-red-700 hover:bg-red-100 dark:border-red-500/40 dark:text-red-300 dark:hover:bg-red-500/15" : "shrink-0 rounded-md border border-slate-200 px-2.5 py-1 text-[12px] font-medium text-slate-700 hover:bg-muted dark:border-border dark:text-slate-200",
|
|
96
117
|
children: "Adjust clock"
|
|
97
118
|
}
|
|
98
119
|
) }),
|
|
99
|
-
/* @__PURE__ */ o(
|
|
120
|
+
/* @__PURE__ */ o(I, { align: "end", className: "w-[320px] space-y-3 p-3", "data-sla-adjust-panel": !0, children: [
|
|
100
121
|
/* @__PURE__ */ o("div", { children: [
|
|
101
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ n("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Adjust this record's SLA clock" }),
|
|
102
123
|
/* @__PURE__ */ o("p", { className: "mt-0.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
|
|
103
|
-
|
|
104
|
-
|
|
124
|
+
y != null ? `The rule allows ${c(y)}. ` : "",
|
|
125
|
+
c(S),
|
|
105
126
|
" used so far. Applies only while the record stays in this step."
|
|
106
127
|
] })
|
|
107
128
|
] }),
|
|
108
129
|
/* @__PURE__ */ o("label", { className: "block space-y-1", children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ n("span", { className: "text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:text-slate-400", children: "Allowed hours" }),
|
|
131
|
+
/* @__PURE__ */ n(
|
|
111
132
|
"input",
|
|
112
133
|
{
|
|
113
134
|
type: "number",
|
|
114
135
|
min: 0.5,
|
|
115
136
|
step: 0.5,
|
|
116
|
-
value:
|
|
117
|
-
onChange: (
|
|
137
|
+
value: m,
|
|
138
|
+
onChange: (u) => h(u.target.value),
|
|
118
139
|
"data-sla-adjust-hours": !0,
|
|
119
140
|
className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-[12.5px] text-slate-800 dark:border-border dark:bg-card dark:text-slate-100"
|
|
120
141
|
}
|
|
121
142
|
),
|
|
122
|
-
|
|
143
|
+
b != null && /* @__PURE__ */ n("span", { className: "block text-[11px] text-slate-500 dark:text-slate-400", children: b >= 0 ? `${c(b)} left after the change` : `Breached by ${c(-b)} after the change` })
|
|
123
144
|
] }),
|
|
124
145
|
/* @__PURE__ */ o("label", { className: "block space-y-1", children: [
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ n("span", { className: "text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:text-slate-400", children: "Reason" }),
|
|
147
|
+
/* @__PURE__ */ n(
|
|
127
148
|
"textarea",
|
|
128
149
|
{
|
|
129
|
-
value:
|
|
130
|
-
onChange: (
|
|
150
|
+
value: x,
|
|
151
|
+
onChange: (u) => g(u.target.value),
|
|
131
152
|
rows: 3,
|
|
132
153
|
maxLength: 1e3,
|
|
133
154
|
placeholder: "Why this record needs a different clock",
|
|
@@ -136,28 +157,28 @@ function V({
|
|
|
136
157
|
}
|
|
137
158
|
)
|
|
138
159
|
] }),
|
|
139
|
-
|
|
160
|
+
w && /* @__PURE__ */ n("p", { className: "text-[11.5px] text-red-600 dark:text-red-400", children: w }),
|
|
140
161
|
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
141
|
-
e.override && /* @__PURE__ */
|
|
162
|
+
e.override && /* @__PURE__ */ n(
|
|
142
163
|
"button",
|
|
143
164
|
{
|
|
144
165
|
type: "button",
|
|
145
|
-
disabled:
|
|
146
|
-
onClick: () =>
|
|
166
|
+
disabled: _.isPending,
|
|
167
|
+
onClick: () => _.mutate(),
|
|
147
168
|
"data-sla-adjust-reset": !0,
|
|
148
169
|
className: "rounded-md px-2 py-1 text-[12px] text-slate-600 hover:bg-muted disabled:opacity-50 dark:text-slate-300",
|
|
149
|
-
children:
|
|
170
|
+
children: _.isPending ? "Resetting…" : "Back to the rule"
|
|
150
171
|
}
|
|
151
172
|
),
|
|
152
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ n(
|
|
153
174
|
"button",
|
|
154
175
|
{
|
|
155
176
|
type: "button",
|
|
156
|
-
disabled: !
|
|
157
|
-
onClick: () =>
|
|
177
|
+
disabled: !E || N.isPending,
|
|
178
|
+
onClick: () => N.mutate(),
|
|
158
179
|
"data-sla-adjust-save": !0,
|
|
159
180
|
className: "ml-auto rounded-md bg-nvr-cyan px-3 py-1 text-[12px] font-medium text-white disabled:opacity-50",
|
|
160
|
-
children:
|
|
181
|
+
children: N.isPending ? "Saving…" : "Save"
|
|
161
182
|
}
|
|
162
183
|
)
|
|
163
184
|
] })
|
|
@@ -166,18 +187,27 @@ function V({
|
|
|
166
187
|
}
|
|
167
188
|
);
|
|
168
189
|
}
|
|
169
|
-
function
|
|
170
|
-
var d;
|
|
171
|
-
const { data: e } =
|
|
190
|
+
function ke({ collection: t, itemId: r }) {
|
|
191
|
+
var l, d;
|
|
192
|
+
const { data: e } = te(t, r), s = ee(t, r, e);
|
|
172
193
|
if (!(e != null && e.status) || e.status === "none" || e.total_hours == null) return null;
|
|
173
|
-
const a =
|
|
174
|
-
return /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-2", "data-sla-clock-line":
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */ o("p", { className: `min-w-0 flex-1 text-[12px] ${a}`, children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
(
|
|
179
|
-
" ·
|
|
180
|
-
|
|
194
|
+
const a = s.status ?? e.status;
|
|
195
|
+
return /* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-2", "data-sla-clock-line": a, children: [
|
|
196
|
+
/* @__PURE__ */ n(F, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
197
|
+
/* @__PURE__ */ o("p", { className: `min-w-0 flex-1 text-[12px] transition-colors duration-500 ${a === "breached" ? "text-red-700 dark:text-red-300" : a === "warning" ? "text-amber-700 dark:text-amber-300" : "text-slate-600 dark:text-slate-300"}`, children: [
|
|
198
|
+
/* @__PURE__ */ n("span", { className: "font-medium", children: "SLA" }),
|
|
199
|
+
(l = e.sla_rule) != null && l.name ? ` · ${e.sla_rule.name}` : "",
|
|
200
|
+
" ·",
|
|
201
|
+
" ",
|
|
202
|
+
s.dueText ? /* @__PURE__ */ o("span", { className: "tabular-nums", "data-sla-due-in": !0, children: [
|
|
203
|
+
s.dueText,
|
|
204
|
+
((d = e.sla_rule) == null ? void 0 : d.business_hours_only) && /* @__PURE__ */ o("span", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
205
|
+
" ",
|
|
206
|
+
"(",
|
|
207
|
+
Math.round(e.total_hours),
|
|
208
|
+
"-working-hour limit)"
|
|
209
|
+
] })
|
|
210
|
+
] }) : re(e),
|
|
181
211
|
e.override && /* @__PURE__ */ o(
|
|
182
212
|
"span",
|
|
183
213
|
{
|
|
@@ -186,21 +216,22 @@ function le({ collection: t, itemId: r }) {
|
|
|
186
216
|
"data-sla-override": !0,
|
|
187
217
|
children: [
|
|
188
218
|
"· ",
|
|
189
|
-
|
|
219
|
+
se(e.override)
|
|
190
220
|
]
|
|
191
221
|
}
|
|
192
222
|
)
|
|
193
223
|
] }),
|
|
194
|
-
e.can_adjust && /* @__PURE__ */
|
|
224
|
+
e.can_adjust && /* @__PURE__ */ n(ne, { collection: t, itemId: r, data: e })
|
|
195
225
|
] });
|
|
196
226
|
}
|
|
197
227
|
export {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
228
|
+
ne as AdjustClockPopover,
|
|
229
|
+
ke as SlaClockLine,
|
|
230
|
+
se as overrideSentence,
|
|
231
|
+
re as slaClockText,
|
|
232
|
+
$ as slaHours,
|
|
233
|
+
v as slaStatusKey,
|
|
234
|
+
be as stepAgeText,
|
|
235
|
+
ee as useLiveSlaStatus,
|
|
236
|
+
te as useSlaStatus
|
|
206
237
|
};
|