@nivaro/react 0.3.138 → 0.3.140
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/InlineGridField.js +95 -92
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +316 -278
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Plus as ne, Clock as
|
|
4
|
-
import { useMemo as H, useState as
|
|
2
|
+
import { useQueryClient as ke, useQuery as j, useQueries as Ce, useMutation as Q } from "@tanstack/react-query";
|
|
3
|
+
import { Plus as ne, Clock as Se, Bell as $e, ArrowUpRight as Fe, Eye as Ae, Pencil as qe, Trash2 as Le, ChevronsUpDown as me, Check as ae } from "lucide-react";
|
|
4
|
+
import { useMemo as H, useState as N } from "react";
|
|
5
5
|
import { toast as E } from "sonner";
|
|
6
|
-
import { useNivaroClient as X, useItemNavigation as
|
|
7
|
-
import { get as I, post as he, patch as se, del as
|
|
8
|
-
import { titleCase as le, cn as M, toLocalDateString as
|
|
6
|
+
import { useNivaroClient as X, useItemNavigation as Pe } from "../context.js";
|
|
7
|
+
import { get as I, post as he, patch as se, del as Te } from "../lib/commands.js";
|
|
8
|
+
import { titleCase as le, cn as M, formatNumber as ue, toLocalDateString as Ue } from "../lib/utils.js";
|
|
9
9
|
import { Badge as z } from "./ui/badge.js";
|
|
10
10
|
import { Button as P } from "./ui/button.js";
|
|
11
|
-
import { Command as
|
|
12
|
-
import { Dialog as Z, DialogContent as J, DialogHeader as Y, DialogTitle as ee, DialogBody as te, DialogFooter as
|
|
11
|
+
import { Command as pe, CommandInput as fe, CommandList as xe, CommandEmpty as ge, CommandGroup as be, CommandItem as G } from "./ui/command.js";
|
|
12
|
+
import { Dialog as Z, DialogContent as J, DialogHeader as Y, DialogTitle as ee, DialogBody as te, DialogFooter as we } from "./ui/dialog.js";
|
|
13
13
|
import { Input as V } from "./ui/input.js";
|
|
14
14
|
import { Label as K } from "./ui/label.js";
|
|
15
|
-
import { Popover as
|
|
16
|
-
import { SimpleSelectXs as
|
|
17
|
-
import { Select as
|
|
15
|
+
import { Popover as ye, PopoverTrigger as Ne, PopoverContent as _e } from "./ui/popover.js";
|
|
16
|
+
import { SimpleSelectXs as De } from "./ui/SimpleSelect.js";
|
|
17
|
+
import { Select as Re, SelectTrigger as Ee, SelectValue as Me, SelectContent as Ie, SelectItem as Oe } from "./ui/select.js";
|
|
18
18
|
import { Switch as B } from "./ui/switch.js";
|
|
19
|
-
const
|
|
19
|
+
const je = {
|
|
20
20
|
workflow_template: "",
|
|
21
21
|
state_keys: [],
|
|
22
22
|
name: "",
|
|
@@ -32,7 +32,7 @@ const Oe = {
|
|
|
32
32
|
function O(i) {
|
|
33
33
|
return [i.first_name, i.last_name].filter(Boolean).join(" ") || i.email;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function We(i) {
|
|
36
36
|
var p;
|
|
37
37
|
return `${((p = i.split("/").pop()) == null ? void 0 : p.replace(/_/g, " ")) ?? i} clock`;
|
|
38
38
|
}
|
|
@@ -41,15 +41,15 @@ function W(i) {
|
|
|
41
41
|
const u = Math.round(i * 10) / 10;
|
|
42
42
|
return u >= 48 && u % 24 === 0 ? `${u / 24}d` : `${u}h`;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ve({
|
|
45
45
|
durationHours: i,
|
|
46
46
|
warningPct: u,
|
|
47
47
|
compact: p
|
|
48
48
|
}) {
|
|
49
|
-
const
|
|
49
|
+
const _ = Math.min(99, Math.max(1, u)), c = i * _ / 100;
|
|
50
50
|
return /* @__PURE__ */ a("div", { className: M("min-w-0", p ? "w-full" : ""), children: [
|
|
51
51
|
/* @__PURE__ */ a("div", { className: "flex h-2 w-full overflow-hidden rounded-full", children: [
|
|
52
|
-
/* @__PURE__ */ e("div", { className: "bg-emerald-400/80 dark:bg-emerald-500/70", style: { width: `${
|
|
52
|
+
/* @__PURE__ */ e("div", { className: "bg-emerald-400/80 dark:bg-emerald-500/70", style: { width: `${_}%` } }),
|
|
53
53
|
/* @__PURE__ */ e("div", { className: "flex-1 bg-amber-400/90 dark:bg-amber-500/80" }),
|
|
54
54
|
/* @__PURE__ */ e("div", { className: "w-1.5 shrink-0 bg-red-500" })
|
|
55
55
|
] }),
|
|
@@ -73,7 +73,7 @@ function ie({
|
|
|
73
73
|
id: i,
|
|
74
74
|
value: u,
|
|
75
75
|
onChange: p,
|
|
76
|
-
users:
|
|
76
|
+
users: _,
|
|
77
77
|
roleNames: c,
|
|
78
78
|
placeholder: L,
|
|
79
79
|
specials: T = [],
|
|
@@ -81,7 +81,7 @@ function ie({
|
|
|
81
81
|
userValue: A = (q) => q.id,
|
|
82
82
|
compact: s
|
|
83
83
|
}) {
|
|
84
|
-
const q = X(), [v, k] =
|
|
84
|
+
const q = X(), [v, k] = N(!1), [g, S] = N(""), [x, U] = N(null), f = u ? T.find((d) => d.value === u) : null, $ = u && !f ? _.find((d) => A(d).toUpperCase() === u.toUpperCase()) ?? (x && A(x).toUpperCase() === u.toUpperCase() ? x : null) : null, { data: C } = j({
|
|
85
85
|
queryKey: ["sla-user-search", g],
|
|
86
86
|
enabled: v && g.trim().length > 0,
|
|
87
87
|
staleTime: 6e4,
|
|
@@ -90,9 +90,9 @@ function ie({
|
|
|
90
90
|
`/users?search=${encodeURIComponent(g.trim())}&limit=30&sort=first_name`
|
|
91
91
|
)
|
|
92
92
|
)).data
|
|
93
|
-
}), D = H(() => [...g.trim() && C ? C :
|
|
94
|
-
return /* @__PURE__ */ a(
|
|
95
|
-
/* @__PURE__ */ e(
|
|
93
|
+
}), D = H(() => [...g.trim() && C ? C : _].sort((r, h) => O(r).localeCompare(O(h))), [_, C, g]), F = (d) => c[String(d.role ?? "").toUpperCase()];
|
|
94
|
+
return /* @__PURE__ */ a(ye, { modal: !0, open: v, onOpenChange: k, children: [
|
|
95
|
+
/* @__PURE__ */ e(Ne, { asChild: !0, children: /* @__PURE__ */ a(
|
|
96
96
|
"button",
|
|
97
97
|
{
|
|
98
98
|
id: i,
|
|
@@ -110,11 +110,11 @@ function ie({
|
|
|
110
110
|
]
|
|
111
111
|
}
|
|
112
112
|
) }),
|
|
113
|
-
/* @__PURE__ */ e(_e, { className: "w-[--radix-popover-trigger-width] min-w-[440px] p-0", align: "start", children: /* @__PURE__ */ a(
|
|
114
|
-
/* @__PURE__ */ e(
|
|
115
|
-
/* @__PURE__ */ a(
|
|
116
|
-
/* @__PURE__ */ e(
|
|
117
|
-
/* @__PURE__ */ a(
|
|
113
|
+
/* @__PURE__ */ e(_e, { className: "w-[--radix-popover-trigger-width] min-w-[440px] p-0", align: "start", children: /* @__PURE__ */ a(pe, { shouldFilter: !1, children: [
|
|
114
|
+
/* @__PURE__ */ e(fe, { placeholder: "Search people…", value: g, onValueChange: S }),
|
|
115
|
+
/* @__PURE__ */ a(xe, { children: [
|
|
116
|
+
/* @__PURE__ */ e(ge, { children: g.trim() ? "No matches." : "Type to search…" }),
|
|
117
|
+
/* @__PURE__ */ a(be, { children: [
|
|
118
118
|
b && u && /* @__PURE__ */ e(
|
|
119
119
|
G,
|
|
120
120
|
{
|
|
@@ -182,11 +182,11 @@ function ie({
|
|
|
182
182
|
] }) })
|
|
183
183
|
] });
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Ke(i, u) {
|
|
186
186
|
if (i.notify === "owner") return "owners again";
|
|
187
187
|
if (i.notify === "manager") return "managers";
|
|
188
188
|
if (i.notify.startsWith("user:")) {
|
|
189
|
-
const p = u.find((
|
|
189
|
+
const p = u.find((_) => _.id.toUpperCase() === i.notify.slice(5).toUpperCase());
|
|
190
190
|
return p ? O(p) : "a specific person";
|
|
191
191
|
}
|
|
192
192
|
return i.notify;
|
|
@@ -195,13 +195,13 @@ function de({
|
|
|
195
195
|
initial: i,
|
|
196
196
|
templates: u,
|
|
197
197
|
users: p,
|
|
198
|
-
roleNames:
|
|
198
|
+
roleNames: _,
|
|
199
199
|
multiState: c,
|
|
200
200
|
onSave: L,
|
|
201
201
|
onCancel: T,
|
|
202
202
|
saving: b
|
|
203
203
|
}) {
|
|
204
|
-
const A = X(), [s, q] =
|
|
204
|
+
const A = X(), [s, q] = N(i ?? je), [v, k] = N(!1), [g, S] = N(!1), [x, U] = N(null);
|
|
205
205
|
function f(r, h) {
|
|
206
206
|
q((w) => ({ ...w, [r]: h }));
|
|
207
207
|
}
|
|
@@ -240,21 +240,21 @@ function de({
|
|
|
240
240
|
/* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
241
241
|
/* @__PURE__ */ e(K, { htmlFor: "sla-template", children: "Workflow" }),
|
|
242
242
|
/* @__PURE__ */ a(
|
|
243
|
-
|
|
243
|
+
Re,
|
|
244
244
|
{
|
|
245
245
|
value: s.workflow_template,
|
|
246
246
|
onValueChange: (r) => q((h) => ({ ...h, workflow_template: r, state_keys: [] })),
|
|
247
247
|
children: [
|
|
248
|
-
/* @__PURE__ */ e(
|
|
249
|
-
/* @__PURE__ */ e(
|
|
248
|
+
/* @__PURE__ */ e(Ee, { id: "sla-template", children: /* @__PURE__ */ e(Me, { placeholder: "Select a workflow…" }) }),
|
|
249
|
+
/* @__PURE__ */ e(Ie, { children: u.map((r) => /* @__PURE__ */ e(Oe, { value: r.id, children: r.name }, r.id)) })
|
|
250
250
|
]
|
|
251
251
|
}
|
|
252
252
|
)
|
|
253
253
|
] }),
|
|
254
254
|
/* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
255
255
|
/* @__PURE__ */ e(K, { htmlFor: "sla-state-key", children: c ? "States it applies to" : "State" }),
|
|
256
|
-
/* @__PURE__ */ a(
|
|
257
|
-
/* @__PURE__ */ e(
|
|
256
|
+
/* @__PURE__ */ a(ye, { modal: !0, open: v, onOpenChange: k, children: [
|
|
257
|
+
/* @__PURE__ */ e(Ne, { asChild: !0, children: /* @__PURE__ */ a(
|
|
258
258
|
"button",
|
|
259
259
|
{
|
|
260
260
|
id: "sla-state-key",
|
|
@@ -267,11 +267,11 @@ function de({
|
|
|
267
267
|
]
|
|
268
268
|
}
|
|
269
269
|
) }),
|
|
270
|
-
/* @__PURE__ */ e(_e, { className: "w-[--radix-popover-trigger-width] p-0", align: "start", children: /* @__PURE__ */ a(
|
|
271
|
-
/* @__PURE__ */ e(
|
|
272
|
-
/* @__PURE__ */ a(
|
|
273
|
-
/* @__PURE__ */ e(
|
|
274
|
-
/* @__PURE__ */ e(
|
|
270
|
+
/* @__PURE__ */ e(_e, { className: "w-[--radix-popover-trigger-width] p-0", align: "start", children: /* @__PURE__ */ a(pe, { children: [
|
|
271
|
+
/* @__PURE__ */ e(fe, { placeholder: "Search states…" }),
|
|
272
|
+
/* @__PURE__ */ a(xe, { children: [
|
|
273
|
+
/* @__PURE__ */ e(ge, { children: "No states found." }),
|
|
274
|
+
/* @__PURE__ */ e(be, { children: $.map((r) => /* @__PURE__ */ a(
|
|
275
275
|
G,
|
|
276
276
|
{
|
|
277
277
|
value: `${r.label} ${r.key}`,
|
|
@@ -311,7 +311,7 @@ function de({
|
|
|
311
311
|
onChange: (r) => f("duration_hours", Number(r.target.value))
|
|
312
312
|
}
|
|
313
313
|
),
|
|
314
|
-
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 pt-1", "data-sla-presets": !0, children:
|
|
314
|
+
/* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1 pt-1", "data-sla-presets": !0, children: Be.map((r) => {
|
|
315
315
|
const h = s.duration_hours === r.hours && s.business_hours_only === r.business;
|
|
316
316
|
return /* @__PURE__ */ e(
|
|
317
317
|
"button",
|
|
@@ -356,7 +356,7 @@ function de({
|
|
|
356
356
|
") it turns amber, so owners get a heads-up while there is still time to act."
|
|
357
357
|
] }),
|
|
358
358
|
/* @__PURE__ */ e(
|
|
359
|
-
|
|
359
|
+
ve,
|
|
360
360
|
{
|
|
361
361
|
durationHours: s.duration_hours,
|
|
362
362
|
warningPct: s.warning_threshold_pct
|
|
@@ -415,7 +415,7 @@ function de({
|
|
|
415
415
|
value: s.escalation_user,
|
|
416
416
|
onChange: (r) => f("escalation_user", r),
|
|
417
417
|
users: p,
|
|
418
|
-
roleNames:
|
|
418
|
+
roleNames: _,
|
|
419
419
|
placeholder: "No one"
|
|
420
420
|
}
|
|
421
421
|
),
|
|
@@ -462,7 +462,7 @@ function de({
|
|
|
462
462
|
)
|
|
463
463
|
),
|
|
464
464
|
users: p,
|
|
465
|
-
roleNames:
|
|
465
|
+
roleNames: _,
|
|
466
466
|
placeholder: "Who to notify",
|
|
467
467
|
specials: [
|
|
468
468
|
{ value: "owner", label: "Record owners (again)" },
|
|
@@ -518,9 +518,8 @@ function de({
|
|
|
518
518
|
] }),
|
|
519
519
|
x && /* @__PURE__ */ a("div", { className: "mt-4 rounded-md border border-slate-200 bg-slate-50 px-3 py-2 text-[12px] dark:border-border dark:bg-muted/40", children: [
|
|
520
520
|
/* @__PURE__ */ a("p", { children: [
|
|
521
|
-
/* @__PURE__ */ e("b", { children: x.total }),
|
|
522
|
-
" open record(s) in this state right now. Under the proposed rule:",
|
|
523
|
-
" ",
|
|
521
|
+
/* @__PURE__ */ e("b", { children: ue(x.total) }),
|
|
522
|
+
" open record(s) in this state right now. Under the proposed rule: ",
|
|
524
523
|
/* @__PURE__ */ a("span", { className: "text-emerald-600", children: [
|
|
525
524
|
x.proposed.ok,
|
|
526
525
|
" ok"
|
|
@@ -545,7 +544,7 @@ function de({
|
|
|
545
544
|
x.flips.slice(0, 3).map((r) => `${r.collection}/${r.item} (${r.from}→${r.to})`).join(", ")
|
|
546
545
|
] })
|
|
547
546
|
] }),
|
|
548
|
-
/* @__PURE__ */ a(
|
|
547
|
+
/* @__PURE__ */ a(we, { className: "mt-5", children: [
|
|
549
548
|
/* @__PURE__ */ e(
|
|
550
549
|
P,
|
|
551
550
|
{
|
|
@@ -570,16 +569,16 @@ function de({
|
|
|
570
569
|
] })
|
|
571
570
|
] });
|
|
572
571
|
}
|
|
573
|
-
function
|
|
572
|
+
function ze({ rule: i }) {
|
|
574
573
|
var w, n, o;
|
|
575
|
-
const u = X(), { urlFor: p, open:
|
|
574
|
+
const u = X(), { urlFor: p, open: _ } = Pe(), { data: c, isLoading: L } = j({
|
|
576
575
|
queryKey: ["sla-rule-records", i.id],
|
|
577
576
|
queryFn: async () => (await u.request(I(`/sla/rules/${i.id}/records`))).data
|
|
578
577
|
}), T = {
|
|
579
578
|
ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",
|
|
580
579
|
warning: "bg-amber-500/10 text-amber-700 dark:text-amber-400",
|
|
581
580
|
breached: "bg-red-500/10 text-red-700 dark:text-red-400"
|
|
582
|
-
}, [b, A] =
|
|
581
|
+
}, [b, A] = N(null), [s, q] = N(""), [v, k] = N(""), [g, S] = N({ op: "gte", v: "" }), [x, U] = N({ op: "lte", v: "" }), [f, $] = N(""), C = (t) => A(
|
|
583
582
|
(l) => (l == null ? void 0 : l.key) === t ? l.dir === "asc" ? { key: t, dir: "desc" } : null : { key: t, dir: "asc" }
|
|
584
583
|
), D = { breached: 0, warning: 1, ok: 2 }, F = H(() => {
|
|
585
584
|
let t = (c == null ? void 0 : c.records) ?? [];
|
|
@@ -632,7 +631,7 @@ function Ke({ rule: i }) {
|
|
|
632
631
|
] });
|
|
633
632
|
return /* @__PURE__ */ e("div", { className: "border-t border-slate-100 bg-slate-50/60 px-4 py-3 dark:border-border dark:bg-muted/20", children: L ? /* @__PURE__ */ e("div", { className: "space-y-2", children: [1, 2, 3].map((t) => /* @__PURE__ */ e("div", { className: "h-7 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }, t)) }) : !c || c.total === 0 ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No open records are in this state right now." }) : /* @__PURE__ */ a(ce, { children: [
|
|
634
633
|
/* @__PURE__ */ a("p", { className: "mb-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
635
|
-
c.total,
|
|
634
|
+
ue(c.total),
|
|
636
635
|
" open record",
|
|
637
636
|
c.total === 1 ? "" : "s",
|
|
638
637
|
" in this state —",
|
|
@@ -729,7 +728,7 @@ function Ke({ rule: i }) {
|
|
|
729
728
|
}
|
|
730
729
|
) }),
|
|
731
730
|
/* @__PURE__ */ e("th", { className: "px-3 py-1.5 font-normal", children: /* @__PURE__ */ e(
|
|
732
|
-
|
|
731
|
+
De,
|
|
733
732
|
{
|
|
734
733
|
value: v,
|
|
735
734
|
onChange: k,
|
|
@@ -764,7 +763,7 @@ function Ke({ rule: i }) {
|
|
|
764
763
|
{
|
|
765
764
|
href: p({ collection: t.collection, itemId: t.item }),
|
|
766
765
|
onClick: (l) => {
|
|
767
|
-
l.preventDefault(),
|
|
766
|
+
l.preventDefault(), _({ collection: t.collection, itemId: t.item });
|
|
768
767
|
},
|
|
769
768
|
className: "text-nvr-cyan underline decoration-slate-300 decoration-1 underline-offset-2 hover:text-[#009abe]",
|
|
770
769
|
children: t.label
|
|
@@ -786,7 +785,7 @@ function Ke({ rule: i }) {
|
|
|
786
785
|
{
|
|
787
786
|
className: "ml-1.5 rounded-full bg-slate-500/10 px-1.5 py-px text-[10px] font-medium text-slate-500 dark:text-slate-400",
|
|
788
787
|
"data-tip": `Regional clock: business hours count in ${t.timezone}`,
|
|
789
|
-
children:
|
|
788
|
+
children: We(t.timezone)
|
|
790
789
|
}
|
|
791
790
|
)
|
|
792
791
|
] }),
|
|
@@ -801,14 +800,14 @@ function Ke({ rule: i }) {
|
|
|
801
800
|
children: t.remaining_hours < 0 ? `${W(Math.abs(t.remaining_hours))} over` : W(t.remaining_hours)
|
|
802
801
|
}
|
|
803
802
|
),
|
|
804
|
-
/* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-right text-slate-400", children:
|
|
803
|
+
/* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-right text-slate-400", children: Ue(t.entered_at) })
|
|
805
804
|
] }, `${t.collection}:${t.item}`)),
|
|
806
805
|
F.length === 0 && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 5, className: "px-3 py-4 text-center text-[12px] text-slate-400", children: "No records match the filters." }) })
|
|
807
806
|
] })
|
|
808
807
|
] }) })
|
|
809
808
|
] }) });
|
|
810
809
|
}
|
|
811
|
-
const
|
|
810
|
+
const Be = [
|
|
812
811
|
{ label: "4 business hours", hours: 4, business: !0 },
|
|
813
812
|
{ label: "1 business day", hours: 8, business: !0 },
|
|
814
813
|
{ label: "2 business days", hours: 16, business: !0 },
|
|
@@ -817,8 +816,8 @@ const ze = [
|
|
|
817
816
|
{ label: "24 hours", hours: 24, business: !1 },
|
|
818
817
|
{ label: "72 hours", hours: 72, business: !1 }
|
|
819
818
|
];
|
|
820
|
-
function
|
|
821
|
-
const i = X(), u =
|
|
819
|
+
function ct() {
|
|
820
|
+
const i = X(), u = ke(), { data: p = [], isLoading: _ } = j({
|
|
822
821
|
queryKey: ["sla-rules"],
|
|
823
822
|
queryFn: async () => (await i.request(I("/sla/rules"))).data
|
|
824
823
|
}), { data: c = [] } = j({
|
|
@@ -837,7 +836,7 @@ function dt() {
|
|
|
837
836
|
for (const t of n.data ?? []) o[String(t.id).toUpperCase()] = t.name;
|
|
838
837
|
return o;
|
|
839
838
|
}
|
|
840
|
-
}), b = H(() => [...new Set(p.map((n) => n.workflow_template))], [p]), A =
|
|
839
|
+
}), b = H(() => [...new Set(p.map((n) => n.workflow_template))], [p]), A = Ce({
|
|
841
840
|
queries: b.map((n) => ({
|
|
842
841
|
queryKey: ["sla-template-states", n],
|
|
843
842
|
staleTime: 3e5,
|
|
@@ -855,7 +854,7 @@ function dt() {
|
|
|
855
854
|
t && t.states.forEach((l, m) => n.set(`${t.tid}:${l.key}`, { ...l, sort: m }));
|
|
856
855
|
}
|
|
857
856
|
return n;
|
|
858
|
-
}, [A.map((n) => n.data ? "1" : "0").join("")]), [q, v] =
|
|
857
|
+
}, [A.map((n) => n.data ? "1" : "0").join("")]), [q, v] = N(!1), [k, g] = N(null), [S, x] = N(null), [U, f] = N(null), $ = () => void u.invalidateQueries({ queryKey: ["sla-rules"] }), C = Q({
|
|
859
858
|
// One rule per selected state; with several states the state label is
|
|
860
859
|
// appended so the resulting rows stay distinguishable.
|
|
861
860
|
mutationFn: async (n) => {
|
|
@@ -890,7 +889,7 @@ function dt() {
|
|
|
890
889
|
onSuccess: $,
|
|
891
890
|
onError: () => E.error("Could not update the rule")
|
|
892
891
|
}), d = Q({
|
|
893
|
-
mutationFn: (n) => i.request(
|
|
892
|
+
mutationFn: (n) => i.request(Te(`/sla/rules/${n}`)),
|
|
894
893
|
onSuccess: () => {
|
|
895
894
|
$(), x(null), E.success("SLA rule deleted");
|
|
896
895
|
},
|
|
@@ -945,8 +944,8 @@ function dt() {
|
|
|
945
944
|
] })
|
|
946
945
|
] })
|
|
947
946
|
] }),
|
|
948
|
-
|
|
949
|
-
/* @__PURE__ */ e(
|
|
947
|
+
_ ? /* @__PURE__ */ e("div", { className: "space-y-3", children: [1, 2, 3].map((n) => /* @__PURE__ */ e("div", { className: "h-16 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }, n)) }) : p.length === 0 ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center rounded-lg border border-dashed border-slate-300 py-20 text-center dark:border-border", children: [
|
|
948
|
+
/* @__PURE__ */ e(Se, { className: "mb-3 h-10 w-10 text-muted-foreground" }),
|
|
950
949
|
/* @__PURE__ */ e("p", { className: "mb-1 text-sm font-medium", children: "No SLA rules yet" }),
|
|
951
950
|
/* @__PURE__ */ e("p", { className: "mb-4 max-w-[46ch] text-xs text-muted-foreground", children: `Pick a workflow state and say how long a record may wait there — e.g. "Finance review within 2 business days". Owners get warned before it's late.` }),
|
|
952
951
|
/* @__PURE__ */ a(P, { size: "sm", onClick: () => v(!0), children: [
|
|
@@ -994,7 +993,7 @@ function dt() {
|
|
|
994
993
|
/* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-slate-400", children: t.name })
|
|
995
994
|
] }),
|
|
996
995
|
/* @__PURE__ */ e("div", { className: "w-[240px] shrink-0", children: /* @__PURE__ */ e(
|
|
997
|
-
|
|
996
|
+
ve,
|
|
998
997
|
{
|
|
999
998
|
durationHours: t.duration_hours,
|
|
1000
999
|
warningPct: t.warning_threshold_pct,
|
|
@@ -1016,7 +1015,7 @@ function dt() {
|
|
|
1016
1015
|
variant: "outline",
|
|
1017
1016
|
className: "gap-1 whitespace-nowrap text-[10.5px] font-normal",
|
|
1018
1017
|
children: [
|
|
1019
|
-
/* @__PURE__ */ e(
|
|
1018
|
+
/* @__PURE__ */ e($e, { className: "h-2.5 w-2.5" }),
|
|
1020
1019
|
t.notify_on_warning && t.notify_on_breach ? "Warn + breach" : t.notify_on_warning ? "Warn only" : "Breach only"
|
|
1021
1020
|
]
|
|
1022
1021
|
}
|
|
@@ -1027,7 +1026,7 @@ function dt() {
|
|
|
1027
1026
|
variant: "outline",
|
|
1028
1027
|
className: "gap-1 whitespace-nowrap text-[10.5px] font-normal",
|
|
1029
1028
|
children: [
|
|
1030
|
-
/* @__PURE__ */ e(
|
|
1029
|
+
/* @__PURE__ */ e(Fe, { className: "h-2.5 w-2.5" }),
|
|
1031
1030
|
O(y)
|
|
1032
1031
|
]
|
|
1033
1032
|
}
|
|
@@ -1037,7 +1036,7 @@ function dt() {
|
|
|
1037
1036
|
{
|
|
1038
1037
|
variant: "outline",
|
|
1039
1038
|
className: "whitespace-nowrap text-[10.5px] font-normal",
|
|
1040
|
-
title: m.map((R) => `+${R.after_hours}h → ${
|
|
1039
|
+
title: m.map((R) => `+${R.after_hours}h → ${Ke(R, L)}`).join(" · "),
|
|
1041
1040
|
children: [
|
|
1042
1041
|
m.length,
|
|
1043
1042
|
"-tier ladder"
|
|
@@ -1057,7 +1056,7 @@ function dt() {
|
|
|
1057
1056
|
),
|
|
1058
1057
|
onClick: () => f(U === t.id ? null : t.id),
|
|
1059
1058
|
children: [
|
|
1060
|
-
/* @__PURE__ */ e(
|
|
1059
|
+
/* @__PURE__ */ e(Ae, { className: "h-3.5 w-3.5" }),
|
|
1061
1060
|
"Preview"
|
|
1062
1061
|
]
|
|
1063
1062
|
}
|
|
@@ -1077,7 +1076,7 @@ function dt() {
|
|
|
1077
1076
|
size: "icon",
|
|
1078
1077
|
className: "h-7 w-7 opacity-0 transition-opacity group-hover:opacity-100",
|
|
1079
1078
|
onClick: () => g(t),
|
|
1080
|
-
children: /* @__PURE__ */ e(
|
|
1079
|
+
children: /* @__PURE__ */ e(qe, { className: "h-3.5 w-3.5" })
|
|
1081
1080
|
}
|
|
1082
1081
|
),
|
|
1083
1082
|
/* @__PURE__ */ e(
|
|
@@ -1087,14 +1086,14 @@ function dt() {
|
|
|
1087
1086
|
size: "icon",
|
|
1088
1087
|
className: "h-7 w-7 text-destructive opacity-0 transition-opacity hover:text-destructive group-hover:opacity-100",
|
|
1089
1088
|
onClick: () => x(t),
|
|
1090
|
-
children: /* @__PURE__ */ e(
|
|
1089
|
+
children: /* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" })
|
|
1091
1090
|
}
|
|
1092
1091
|
)
|
|
1093
1092
|
] })
|
|
1094
1093
|
]
|
|
1095
1094
|
}
|
|
1096
1095
|
),
|
|
1097
|
-
U === t.id && /* @__PURE__ */ e(
|
|
1096
|
+
U === t.id && /* @__PURE__ */ e(ze, { rule: t })
|
|
1098
1097
|
] }, t.id);
|
|
1099
1098
|
}) })
|
|
1100
1099
|
]
|
|
@@ -1153,7 +1152,7 @@ function dt() {
|
|
|
1153
1152
|
/* @__PURE__ */ e("span", { className: "font-medium text-foreground", children: S == null ? void 0 : S.name }),
|
|
1154
1153
|
"? Records in this state stop being tracked. This cannot be undone."
|
|
1155
1154
|
] }) }),
|
|
1156
|
-
/* @__PURE__ */ a(
|
|
1155
|
+
/* @__PURE__ */ a(we, { className: "px-6 pb-6", children: [
|
|
1157
1156
|
/* @__PURE__ */ e(
|
|
1158
1157
|
P,
|
|
1159
1158
|
{
|
|
@@ -1177,5 +1176,5 @@ function dt() {
|
|
|
1177
1176
|
] });
|
|
1178
1177
|
}
|
|
1179
1178
|
export {
|
|
1180
|
-
|
|
1179
|
+
ct as SlaRulesView
|
|
1181
1180
|
};
|