@nivaro/react 0.3.139 → 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/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 +251 -229
- 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,75 +1,75 @@
|
|
|
1
|
-
import { jsxs as n, jsx as t, Fragment as
|
|
2
|
-
import { useMutation as
|
|
3
|
-
import { Bell as
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation as de, useQuery as L, useQueryClient as ce } from "@tanstack/react-query";
|
|
3
|
+
import { Bell as ue, Loader2 as V, Send as me, Download as pe, ClipboardList as he, Users as xe, ScanSearch as ge, ListFilter as E } from "lucide-react";
|
|
4
4
|
import { useState as g } from "react";
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { post as
|
|
8
|
-
import { useLiveOps as
|
|
9
|
-
import { stuckText as
|
|
10
|
-
import { titleCase as
|
|
11
|
-
import { Popover as
|
|
12
|
-
import { SimpleSelectXs as
|
|
13
|
-
import { SectionCard as
|
|
14
|
-
import { errorText as
|
|
15
|
-
const
|
|
5
|
+
import { toast as H } from "sonner";
|
|
6
|
+
import { useNivaroClient as O, useNavigation as X, useItemNavigation as be } from "../../context.js";
|
|
7
|
+
import { post as fe, get as q } from "../../lib/commands.js";
|
|
8
|
+
import { useLiveOps as ve } from "../../lib/live-ops.js";
|
|
9
|
+
import { stuckText as we } from "../../lib/presence-state.js";
|
|
10
|
+
import { formatNumber as C, titleCase as B, cn as _, humanHours as z } from "../../lib/utils.js";
|
|
11
|
+
import { Popover as J, PopoverTrigger as Y, PopoverContent as Z } from "../ui/popover.js";
|
|
12
|
+
import { SimpleSelectXs as P, SimpleSelect as ye } from "../ui/SimpleSelect.js";
|
|
13
|
+
import { SectionCard as K, EmptyLine as Q, PersonChip as ke, Pill as Ne } from "./primitives.js";
|
|
14
|
+
import { errorText as ee } from "./types.js";
|
|
15
|
+
const T = {
|
|
16
16
|
breached: "bg-red-50 text-red-700 dark:bg-red-500/10 dark:text-red-400",
|
|
17
17
|
warning: "bg-amber-50 text-amber-700 dark:bg-amber-500/10 dark:text-amber-400"
|
|
18
|
-
},
|
|
19
|
-
function
|
|
18
|
+
}, G = 500, _e = 30;
|
|
19
|
+
function Ce(s) {
|
|
20
20
|
const p = s == null ? "" : String(s);
|
|
21
21
|
return /[",\n]/.test(p) ? `"${p.replace(/"/g, '""')}"` : p;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const p =
|
|
25
|
-
queryKey: ["nvr-person-working-on", s.id,
|
|
23
|
+
function De({ profile: s }) {
|
|
24
|
+
const p = O(), b = X(), { urlFor: h } = be(), { data: i, isLoading: l } = L({
|
|
25
|
+
queryKey: ["nvr-person-working-on", s.id, G],
|
|
26
26
|
queryFn: () => p.request(
|
|
27
|
-
|
|
27
|
+
q(`/users/${s.id}/working-on?limit=${G}`)
|
|
28
28
|
).then((e) => e.data),
|
|
29
29
|
staleTime: 6e4
|
|
30
|
-
}), [d, o] = g(""), [c, u] = g(""), [v, N] = g(!1), [w, a] = g("urgent"), [r, f] = g(!1), x = (i == null ? void 0 : i.items) ?? [],
|
|
30
|
+
}), [d, o] = g(""), [c, u] = g(""), [v, N] = g(!1), [w, a] = g("urgent"), [r, f] = g(!1), x = (i == null ? void 0 : i.items) ?? [], R = [...new Set(x.map((e) => e.collection))].sort(), U = [
|
|
31
31
|
...new Map(
|
|
32
32
|
x.filter((e) => !d || e.collection === d).filter((e) => e.state).map((e) => [e.state, e.state_label ?? e.state])
|
|
33
33
|
)
|
|
34
|
-
].sort((e, m) => e[1].localeCompare(m[1])),
|
|
34
|
+
].sort((e, m) => e[1].localeCompare(m[1])), W = x.filter((e) => !d || e.collection === d).filter((e) => !c || e.state === c).filter((e) => !v || e.sla_status === "breached"), I = (e) => e === "breached" ? 0 : e === "warning" ? 1 : 2, y = [...W].sort((e, m) => w === "name" ? e.label.localeCompare(m.label) : w === "oldest" ? (m.aging_hours ?? 0) - (e.aging_hours ?? 0) : w === "newest" ? (e.aging_hours ?? 0) - (m.aging_hours ?? 0) : I(e.sla_status) - I(m.sla_status) || (m.aging_hours ?? 0) - (e.aging_hours ?? 0)), M = r ? y : y.slice(0, _e), te = !!d || !!c || v, j = s.first_name ?? s.name, F = x.filter((e) => e.sla_status === "breached").length, S = (i == null ? void 0 : i.total) ?? 0, ae = S > x.length, { data: ne } = L({
|
|
35
35
|
queryKey: ["nvr-person-working-on-queues"],
|
|
36
36
|
queryFn: () => p.request(
|
|
37
|
-
|
|
37
|
+
q("/queues")
|
|
38
38
|
).then((e) => e.data ?? []).catch(() => []),
|
|
39
39
|
enabled: x.length > 0,
|
|
40
40
|
staleTime: 5 * 6e4
|
|
41
|
-
}),
|
|
42
|
-
(e) => (e.source_collections ?? []).some((m) =>
|
|
41
|
+
}), oe = new Set(W.map((e) => e.collection)), D = (ne ?? []).filter(
|
|
42
|
+
(e) => (e.source_collections ?? []).some((m) => oe.has(m))
|
|
43
43
|
);
|
|
44
|
-
function
|
|
44
|
+
function se(e) {
|
|
45
45
|
const m = `/queues/${e}?owner=${encodeURIComponent(s.id)}`;
|
|
46
46
|
return b.consoleUrl ? b.consoleUrl(m) : m;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
const e = ["Collection", "Record", "State", "SLA", "Hours in state", "Link"], m = typeof window < "u" ? window.location.origin : "",
|
|
48
|
+
function le() {
|
|
49
|
+
const e = ["Collection", "Record", "State", "SLA", "Hours in state", "Link"], m = typeof window < "u" ? window.location.origin : "", $ = y.map(
|
|
50
50
|
(k) => [
|
|
51
|
-
|
|
51
|
+
B(k.collection),
|
|
52
52
|
k.label,
|
|
53
53
|
k.state_label ?? k.state ?? "",
|
|
54
54
|
k.sla_status === "breached" ? "Past SLA" : k.sla_status === "warning" ? "SLA soon" : "",
|
|
55
55
|
k.aging_hours ?? "",
|
|
56
56
|
`${m}${h({ collection: k.collection, itemId: k.item_id })}`
|
|
57
|
-
].map(
|
|
58
|
-
),
|
|
59
|
-
`)], { type: "text/csv" }),
|
|
60
|
-
|
|
57
|
+
].map(Ce).join(",")
|
|
58
|
+
), re = new Blob([[e.join(","), ...$].join(`
|
|
59
|
+
`)], { type: "text/csv" }), A = document.createElement("a");
|
|
60
|
+
A.href = URL.createObjectURL(re), A.download = `${j.replace(/[^\w-]+/g, "-").toLowerCase()}-working-on.csv`, A.click(), URL.revokeObjectURL(A.href);
|
|
61
61
|
}
|
|
62
62
|
return /* @__PURE__ */ t(
|
|
63
|
-
|
|
63
|
+
K,
|
|
64
64
|
{
|
|
65
|
-
icon: /* @__PURE__ */ t(
|
|
65
|
+
icon: /* @__PURE__ */ t(he, { className: "h-4 w-4" }),
|
|
66
66
|
title: "Working on",
|
|
67
|
-
hint:
|
|
67
|
+
hint: S > 0 ? `${S} open record${S === 1 ? "" : "s"} waiting on ${j}${F ? ` · ${F} past SLA` : ""}` : void 0,
|
|
68
68
|
testId: "working-on",
|
|
69
|
-
children: l ? /* @__PURE__ */ t("div", { className: "space-y-2", "aria-busy": !0, children: [0, 1, 2].map((e) => /* @__PURE__ */ t("div", { className: "h-5 animate-pulse rounded bg-slate-100 dark:bg-muted" }, e)) }) : !i || x.length === 0 ? /* @__PURE__ */ t(
|
|
69
|
+
children: l ? /* @__PURE__ */ t("div", { className: "space-y-2", "aria-busy": !0, children: [0, 1, 2].map((e) => /* @__PURE__ */ t("div", { className: "h-5 animate-pulse rounded bg-slate-100 dark:bg-muted" }, e)) }) : !i || x.length === 0 ? /* @__PURE__ */ t(Q, { children: i && i.hidden > 0 ? `Nothing you can see — ${C(i.hidden)} record${i.hidden === 1 ? "" : "s"} sit in collections your role cannot read.` : `Nothing waits on ${j} right now.` }) : /* @__PURE__ */ n(ie, { children: [
|
|
70
70
|
/* @__PURE__ */ n("div", { className: "mb-2 flex flex-wrap items-center gap-1.5", "data-person-working-on-tools": !0, children: [
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
R.length > 1 && /* @__PURE__ */ t(
|
|
72
|
+
P,
|
|
73
73
|
{
|
|
74
74
|
ariaLabel: "Collection",
|
|
75
75
|
value: d,
|
|
@@ -78,23 +78,23 @@ function Me({ profile: s }) {
|
|
|
78
78
|
},
|
|
79
79
|
options: [
|
|
80
80
|
{ value: "", label: "All collections" },
|
|
81
|
-
...
|
|
81
|
+
...R.map((e) => ({ value: e, label: B(e) }))
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
U.length > 1 && /* @__PURE__ */ t(
|
|
86
|
+
P,
|
|
87
87
|
{
|
|
88
88
|
ariaLabel: "State",
|
|
89
89
|
value: c,
|
|
90
90
|
onChange: u,
|
|
91
91
|
options: [
|
|
92
92
|
{ value: "", label: "Any state" },
|
|
93
|
-
...
|
|
93
|
+
...U.map(([e, m]) => ({ value: e, label: m }))
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
|
|
97
|
+
F > 0 && /* @__PURE__ */ t(
|
|
98
98
|
"button",
|
|
99
99
|
{
|
|
100
100
|
type: "button",
|
|
@@ -109,7 +109,7 @@ function Me({ profile: s }) {
|
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
111
|
/* @__PURE__ */ t(
|
|
112
|
-
|
|
112
|
+
P,
|
|
113
113
|
{
|
|
114
114
|
ariaLabel: "Sort",
|
|
115
115
|
value: w,
|
|
@@ -128,18 +128,18 @@ function Me({ profile: s }) {
|
|
|
128
128
|
{
|
|
129
129
|
type: "button",
|
|
130
130
|
"data-person-working-on-csv": !0,
|
|
131
|
-
onClick:
|
|
131
|
+
onClick: le,
|
|
132
132
|
disabled: y.length === 0,
|
|
133
133
|
className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11.5px] font-medium text-slate-600 hover:bg-muted disabled:opacity-50 dark:text-slate-300",
|
|
134
134
|
children: [
|
|
135
|
-
/* @__PURE__ */ t(
|
|
135
|
+
/* @__PURE__ */ t(pe, { className: "h-3.5 w-3.5" }),
|
|
136
136
|
" CSV"
|
|
137
137
|
]
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
|
-
|
|
140
|
+
D.length > 0 && /* @__PURE__ */ t(Se, { choices: D, hrefFor: se })
|
|
141
141
|
] }),
|
|
142
|
-
y.length === 0 ? /* @__PURE__ */ t(
|
|
142
|
+
y.length === 0 ? /* @__PURE__ */ t(Q, { children: "Nothing matches these filters." }) : /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", "data-person-working-on": !0, children: M.map((e) => {
|
|
143
143
|
const m = h({ collection: e.collection, itemId: e.item_id });
|
|
144
144
|
return /* @__PURE__ */ n(
|
|
145
145
|
"li",
|
|
@@ -150,8 +150,8 @@ function Me({ profile: s }) {
|
|
|
150
150
|
"a",
|
|
151
151
|
{
|
|
152
152
|
href: m,
|
|
153
|
-
onClick: (
|
|
154
|
-
|
|
153
|
+
onClick: ($) => {
|
|
154
|
+
$.metaKey || $.ctrlKey || ($.preventDefault(), b.navigate(m));
|
|
155
155
|
},
|
|
156
156
|
className: "min-w-0 flex-1 truncate text-[12.5px] font-medium text-slate-700 hover:text-nvr-navy hover:underline dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
157
157
|
children: e.label
|
|
@@ -173,19 +173,19 @@ function Me({ profile: s }) {
|
|
|
173
173
|
{
|
|
174
174
|
className: _(
|
|
175
175
|
"shrink-0 rounded-full px-1.5 py-px text-[10.5px] font-semibold",
|
|
176
|
-
|
|
176
|
+
T[e.sla_status]
|
|
177
177
|
),
|
|
178
178
|
children: e.sla_status === "breached" ? "past SLA" : "SLA soon"
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
e.aging_hours != null && /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] tabular-nums text-slate-400", children:
|
|
181
|
+
e.aging_hours != null && /* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] tabular-nums text-slate-400", children: z(e.aging_hours) })
|
|
182
182
|
]
|
|
183
183
|
},
|
|
184
184
|
`${e.collection}:${e.item_id}`
|
|
185
185
|
);
|
|
186
186
|
}) }),
|
|
187
187
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-x-3 pt-2 text-[11.5px] text-slate-400", children: [
|
|
188
|
-
y.length >
|
|
188
|
+
y.length > M.length && /* @__PURE__ */ n(
|
|
189
189
|
"button",
|
|
190
190
|
{
|
|
191
191
|
type: "button",
|
|
@@ -198,28 +198,28 @@ function Me({ profile: s }) {
|
|
|
198
198
|
]
|
|
199
199
|
}
|
|
200
200
|
),
|
|
201
|
-
|
|
201
|
+
te && y.length > 0 && /* @__PURE__ */ n("span", { children: [
|
|
202
202
|
y.length,
|
|
203
203
|
" of ",
|
|
204
204
|
x.length,
|
|
205
205
|
" match"
|
|
206
206
|
] }),
|
|
207
|
-
|
|
207
|
+
ae && /* @__PURE__ */ n("span", { children: [
|
|
208
208
|
"Showing the ",
|
|
209
|
-
x.length,
|
|
209
|
+
C(x.length),
|
|
210
210
|
" most urgent of ",
|
|
211
|
-
C
|
|
211
|
+
C(S)
|
|
212
212
|
] })
|
|
213
213
|
] })
|
|
214
214
|
] })
|
|
215
215
|
}
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function Se({
|
|
219
219
|
choices: s,
|
|
220
220
|
hrefFor: p
|
|
221
221
|
}) {
|
|
222
|
-
const b =
|
|
222
|
+
const b = X(), [h, i] = g(!1), l = (o) => {
|
|
223
223
|
const c = p(o);
|
|
224
224
|
c && (i(!1), /^https?:/.test(c) ? window.open(c, "_blank", "noopener") : b.navigate(c));
|
|
225
225
|
}, d = s.filter((o) => p(o.id) != null);
|
|
@@ -231,25 +231,25 @@ function Ce({
|
|
|
231
231
|
onClick: () => l(d[0].id),
|
|
232
232
|
className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11.5px] font-medium text-nvr-navy hover:bg-muted dark:text-nvr-cyan",
|
|
233
233
|
children: [
|
|
234
|
-
/* @__PURE__ */ t(
|
|
234
|
+
/* @__PURE__ */ t(E, { className: "h-3.5 w-3.5" }),
|
|
235
235
|
" Open in ",
|
|
236
236
|
d[0].name
|
|
237
237
|
]
|
|
238
238
|
}
|
|
239
|
-
) : /* @__PURE__ */ n(
|
|
240
|
-
/* @__PURE__ */ t(
|
|
239
|
+
) : /* @__PURE__ */ n(J, { open: h, onOpenChange: i, children: [
|
|
240
|
+
/* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ n(
|
|
241
241
|
"button",
|
|
242
242
|
{
|
|
243
243
|
type: "button",
|
|
244
244
|
"data-person-working-on-queue-menu": !0,
|
|
245
245
|
className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11.5px] font-medium text-nvr-navy hover:bg-muted dark:text-nvr-cyan",
|
|
246
246
|
children: [
|
|
247
|
-
/* @__PURE__ */ t(
|
|
247
|
+
/* @__PURE__ */ t(E, { className: "h-3.5 w-3.5" }),
|
|
248
248
|
" Open in queue"
|
|
249
249
|
]
|
|
250
250
|
}
|
|
251
251
|
) }),
|
|
252
|
-
/* @__PURE__ */ t(
|
|
252
|
+
/* @__PURE__ */ t(Z, { align: "end", className: "w-60 p-1", children: d.map((o) => /* @__PURE__ */ t(
|
|
253
253
|
"button",
|
|
254
254
|
{
|
|
255
255
|
type: "button",
|
|
@@ -262,29 +262,29 @@ function Ce({
|
|
|
262
262
|
)) })
|
|
263
263
|
] });
|
|
264
264
|
}
|
|
265
|
-
const
|
|
266
|
-
function
|
|
265
|
+
const $e = (s) => s ? new Date(s).toLocaleDateString("en-US", { month: "short", day: "numeric" }) : null;
|
|
266
|
+
function Ee({
|
|
267
267
|
userId: s,
|
|
268
268
|
firstName: p,
|
|
269
269
|
expectedRows: b = 3
|
|
270
270
|
}) {
|
|
271
|
-
const h =
|
|
272
|
-
|
|
271
|
+
const h = O(), i = ce();
|
|
272
|
+
ve(
|
|
273
273
|
"team",
|
|
274
274
|
() => void i.invalidateQueries({ queryKey: ["nvr-person-team-load", s] }),
|
|
275
275
|
{ debounceMs: 2e3 }
|
|
276
276
|
);
|
|
277
|
-
const { data: l, isLoading: d, isError: o } =
|
|
277
|
+
const { data: l, isLoading: d, isError: o } = L({
|
|
278
278
|
queryKey: ["nvr-person-team-load", s],
|
|
279
|
-
queryFn: () => h.request(
|
|
279
|
+
queryFn: () => h.request(q(`/users/${s}/team-load`)).then((a) => a.data),
|
|
280
280
|
staleTime: 6e4
|
|
281
281
|
});
|
|
282
282
|
if (!d && (o || !l || l.total_reports === 0)) return null;
|
|
283
283
|
const c = (l == null ? void 0 : l.reports) ?? [], u = c.reduce((a, r) => a + r.open, 0), v = c.reduce((a, r) => a + r.breached, 0), N = c.filter((a) => a.uncovered).length, w = s === "me" ? "your" : p ? `${p}'s` : "their";
|
|
284
284
|
return /* @__PURE__ */ t(
|
|
285
|
-
|
|
285
|
+
K,
|
|
286
286
|
{
|
|
287
|
-
icon: /* @__PURE__ */ t(
|
|
287
|
+
icon: /* @__PURE__ */ t(xe, { className: "h-4 w-4" }),
|
|
288
288
|
title: "Team load",
|
|
289
289
|
hint: l ? [
|
|
290
290
|
`${l.total_reports} direct report${l.total_reports === 1 ? "" : "s"}`,
|
|
@@ -312,7 +312,7 @@ function De({
|
|
|
312
312
|
"data-team-load-uncovered": a.uncovered ? "true" : void 0,
|
|
313
313
|
children: [
|
|
314
314
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
315
|
-
/* @__PURE__ */ t(
|
|
315
|
+
/* @__PURE__ */ t(ke, { person: { id: a.id, name: a.name, email: a.email }, meta: a.title }),
|
|
316
316
|
r && /* @__PURE__ */ n(
|
|
317
317
|
"p",
|
|
318
318
|
{
|
|
@@ -322,7 +322,7 @@ function De({
|
|
|
322
322
|
),
|
|
323
323
|
"data-team-load-ooo": !0,
|
|
324
324
|
children: [
|
|
325
|
-
a.status === "suspended" ? "Suspended" : `Out${a.ooo_end ? ` until ${
|
|
325
|
+
a.status === "suspended" ? "Suspended" : `Out${a.ooo_end ? ` until ${$e(a.ooo_end)}` : ""}`,
|
|
326
326
|
a.delegate ? ` · ${a.delegate.name} covers` : a.open > 0 ? " · nobody covers their records" : ""
|
|
327
327
|
]
|
|
328
328
|
}
|
|
@@ -335,7 +335,7 @@ function De({
|
|
|
335
335
|
className: "rounded-full bg-orange-500/10 px-1.5 py-px text-[10.5px] font-semibold text-orange-700 dark:text-orange-400",
|
|
336
336
|
"data-team-load-stuck": a.stuck_now.minutes,
|
|
337
337
|
title: "At the keyboard, on the same page, nothing saved for ten minutes",
|
|
338
|
-
children:
|
|
338
|
+
children: we(a.stuck_now)
|
|
339
339
|
}
|
|
340
340
|
),
|
|
341
341
|
a.breached > 0 && /* @__PURE__ */ n(
|
|
@@ -343,7 +343,7 @@ function De({
|
|
|
343
343
|
{
|
|
344
344
|
className: _(
|
|
345
345
|
"rounded-full px-1.5 py-px text-[10.5px] font-semibold",
|
|
346
|
-
|
|
346
|
+
T.breached
|
|
347
347
|
),
|
|
348
348
|
"data-team-load-breached": a.breached,
|
|
349
349
|
children: [
|
|
@@ -357,7 +357,7 @@ function De({
|
|
|
357
357
|
{
|
|
358
358
|
className: _(
|
|
359
359
|
"rounded-full px-1.5 py-px text-[10.5px] font-semibold",
|
|
360
|
-
|
|
360
|
+
T.warning
|
|
361
361
|
),
|
|
362
362
|
children: [
|
|
363
363
|
a.warning,
|
|
@@ -373,7 +373,7 @@ function De({
|
|
|
373
373
|
a.open > 0 ? "font-semibold text-slate-700 dark:text-slate-200" : "text-slate-400"
|
|
374
374
|
),
|
|
375
375
|
"data-team-load-open": a.open,
|
|
376
|
-
title: a.hidden > 0 ? `${a.hidden} more in collections your role cannot read` : void 0,
|
|
376
|
+
title: a.hidden > 0 ? `${C(a.hidden)} more in collections your role cannot read` : void 0,
|
|
377
377
|
children: [
|
|
378
378
|
a.open,
|
|
379
379
|
" open"
|
|
@@ -385,7 +385,7 @@ function De({
|
|
|
385
385
|
{
|
|
386
386
|
className: "w-14 text-right text-[11px] tabular-nums text-slate-400",
|
|
387
387
|
title: "Longest a record of theirs has sat in its current state",
|
|
388
|
-
children: a.oldest_hours != null ?
|
|
388
|
+
children: a.oldest_hours != null ? z(a.oldest_hours) : ""
|
|
389
389
|
}
|
|
390
390
|
)
|
|
391
391
|
] })
|
|
@@ -396,29 +396,29 @@ function De({
|
|
|
396
396
|
}),
|
|
397
397
|
(l == null ? void 0 : l.truncated) && /* @__PURE__ */ n("li", { className: "pt-2 text-[11.5px] text-slate-400", children: [
|
|
398
398
|
"Showing the first ",
|
|
399
|
-
c.length,
|
|
399
|
+
C(c.length),
|
|
400
400
|
" of ",
|
|
401
|
-
l.total_reports,
|
|
401
|
+
C(l.total_reports),
|
|
402
402
|
"."
|
|
403
403
|
] })
|
|
404
404
|
] })
|
|
405
405
|
}
|
|
406
406
|
);
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function He({ profile: s }) {
|
|
409
409
|
var a;
|
|
410
|
-
const p =
|
|
410
|
+
const p = O(), { data: b = [] } = L({
|
|
411
411
|
queryKey: ["nvr-collections-brief"],
|
|
412
412
|
queryFn: () => p.request(
|
|
413
|
-
|
|
413
|
+
q("/collections")
|
|
414
414
|
).then(
|
|
415
415
|
(r) => r.data.filter((f) => !f.collection.startsWith("nivaro_")).map((f) => ({ collection: f.collection, name: f.display_name || f.collection })).sort((f, x) => f.name.localeCompare(x.name))
|
|
416
416
|
),
|
|
417
417
|
staleTime: 5 * 6e4
|
|
418
|
-
}), [h, i] = g(""), [l, d] = g(""), [o, c] = g(null), { data: u, isFetching: v, error: N } =
|
|
418
|
+
}), [h, i] = g(""), [l, d] = g(""), [o, c] = g(null), { data: u, isFetching: v, error: N } = L({
|
|
419
419
|
queryKey: ["nvr-person-why", s.id, o == null ? void 0 : o.collection, o == null ? void 0 : o.id],
|
|
420
420
|
queryFn: () => p.request(
|
|
421
|
-
|
|
421
|
+
q(`/access-explain/${o.collection}/${encodeURIComponent(o.id)}`, {
|
|
422
422
|
user_id: s.id,
|
|
423
423
|
act: "1"
|
|
424
424
|
})
|
|
@@ -426,9 +426,9 @@ function Ee({ profile: s }) {
|
|
|
426
426
|
enabled: !!o
|
|
427
427
|
}), w = s.first_name ?? s.name;
|
|
428
428
|
return /* @__PURE__ */ n(
|
|
429
|
-
|
|
429
|
+
K,
|
|
430
430
|
{
|
|
431
|
-
icon: /* @__PURE__ */ t(
|
|
431
|
+
icon: /* @__PURE__ */ t(ge, { className: "h-4 w-4" }),
|
|
432
432
|
title: "Why do they see this?",
|
|
433
433
|
hint: `Ask any record as ${w} — the gate that decided it answers`,
|
|
434
434
|
testId: "why",
|
|
@@ -444,7 +444,7 @@ function Ee({ profile: s }) {
|
|
|
444
444
|
/* @__PURE__ */ n("div", { className: "min-w-[180px] flex-1", children: [
|
|
445
445
|
/* @__PURE__ */ t("span", { className: "mb-1 block text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:text-slate-400", children: "Collection" }),
|
|
446
446
|
/* @__PURE__ */ t(
|
|
447
|
-
|
|
447
|
+
ye,
|
|
448
448
|
{
|
|
449
449
|
ariaLabel: "Collection",
|
|
450
450
|
value: h,
|
|
@@ -477,7 +477,7 @@ function Ee({ profile: s }) {
|
|
|
477
477
|
"data-person-why-ask": !0,
|
|
478
478
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
|
|
479
479
|
children: [
|
|
480
|
-
v ? /* @__PURE__ */ t(
|
|
480
|
+
v ? /* @__PURE__ */ t(V, { className: "h-3.5 w-3.5 animate-spin" }) : null,
|
|
481
481
|
" Explain"
|
|
482
482
|
]
|
|
483
483
|
}
|
|
@@ -485,7 +485,7 @@ function Ee({ profile: s }) {
|
|
|
485
485
|
]
|
|
486
486
|
}
|
|
487
487
|
),
|
|
488
|
-
N && /* @__PURE__ */ t("p", { className: "mt-3 text-[12px] text-red-600 dark:text-red-400", children:
|
|
488
|
+
N && /* @__PURE__ */ t("p", { className: "mt-3 text-[12px] text-red-600 dark:text-red-400", children: ee(N, "Could not explain") }),
|
|
489
489
|
u && o && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", "data-person-why-result": u.access ? "yes" : "no", children: [
|
|
490
490
|
/* @__PURE__ */ n(
|
|
491
491
|
"p",
|
|
@@ -507,7 +507,7 @@ function Ee({ profile: s }) {
|
|
|
507
507
|
{
|
|
508
508
|
className: "text-[12px] text-slate-600 dark:text-slate-300",
|
|
509
509
|
children: [
|
|
510
|
-
/* @__PURE__ */ t(
|
|
510
|
+
/* @__PURE__ */ t(Ne, { tone: "neutral", children: r.type.replace(/_/g, " ") }),
|
|
511
511
|
" ",
|
|
512
512
|
r.message,
|
|
513
513
|
r.dimension_label && r.allowed_values && /* @__PURE__ */ n("span", { className: "block pl-1 text-[11.5px] text-slate-400", children: [
|
|
@@ -526,10 +526,10 @@ function Ee({ profile: s }) {
|
|
|
526
526
|
}
|
|
527
527
|
);
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
const p =
|
|
529
|
+
function Be({ profile: s }) {
|
|
530
|
+
const p = O(), [b, h] = g(!1), [i, l] = g(""), [d, o] = g(""), c = de({
|
|
531
531
|
mutationFn: () => p.request(
|
|
532
|
-
|
|
532
|
+
fe("/notifications", {
|
|
533
533
|
recipient: s.id,
|
|
534
534
|
subject: i.trim(),
|
|
535
535
|
message: d.trim() || void 0,
|
|
@@ -537,24 +537,24 @@ function He({ profile: s }) {
|
|
|
537
537
|
})
|
|
538
538
|
),
|
|
539
539
|
onSuccess: () => {
|
|
540
|
-
|
|
540
|
+
H.success(`Sent to ${s.first_name ?? s.name}`), h(!1), l(""), o("");
|
|
541
541
|
},
|
|
542
|
-
onError: (u) =>
|
|
542
|
+
onError: (u) => H.error(ee(u, "Could not send"))
|
|
543
543
|
});
|
|
544
|
-
return /* @__PURE__ */ n(
|
|
545
|
-
/* @__PURE__ */ t(
|
|
544
|
+
return /* @__PURE__ */ n(J, { open: b, onOpenChange: h, children: [
|
|
545
|
+
/* @__PURE__ */ t(Y, { asChild: !0, children: /* @__PURE__ */ n(
|
|
546
546
|
"button",
|
|
547
547
|
{
|
|
548
548
|
type: "button",
|
|
549
549
|
"data-person-notify": !0,
|
|
550
550
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-slate-200 px-3 text-[12px] font-medium text-slate-600 transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:border-border dark:text-slate-300 dark:hover:bg-muted",
|
|
551
551
|
children: [
|
|
552
|
-
/* @__PURE__ */ t(
|
|
552
|
+
/* @__PURE__ */ t(ue, { className: "h-3.5 w-3.5" }),
|
|
553
553
|
" Notify"
|
|
554
554
|
]
|
|
555
555
|
}
|
|
556
556
|
) }),
|
|
557
|
-
/* @__PURE__ */ t(
|
|
557
|
+
/* @__PURE__ */ t(Z, { align: "end", className: "w-[340px] p-3", children: /* @__PURE__ */ n(
|
|
558
558
|
"form",
|
|
559
559
|
{
|
|
560
560
|
className: "space-y-2",
|
|
@@ -605,7 +605,7 @@ function He({ profile: s }) {
|
|
|
605
605
|
disabled: !i.trim() || c.isPending,
|
|
606
606
|
className: "inline-flex h-7 items-center gap-1 rounded-md bg-nvr-cyan px-2.5 text-[11.5px] font-semibold text-white disabled:opacity-50",
|
|
607
607
|
children: [
|
|
608
|
-
c.isPending ? /* @__PURE__ */ t(
|
|
608
|
+
c.isPending ? /* @__PURE__ */ t(V, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(me, { className: "h-3 w-3" }),
|
|
609
609
|
" ",
|
|
610
610
|
"Send"
|
|
611
611
|
]
|
|
@@ -618,8 +618,8 @@ function He({ profile: s }) {
|
|
|
618
618
|
] });
|
|
619
619
|
}
|
|
620
620
|
export {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
621
|
+
Be as NotifyButton,
|
|
622
|
+
Ee as TeamLoadCard,
|
|
623
|
+
He as WhyCard,
|
|
624
|
+
De as WorkingOnCard
|
|
625
625
|
};
|
|
@@ -4,9 +4,9 @@ import { Loader2 as y, Sparkles as k, CalendarRange as g } from "lucide-react";
|
|
|
4
4
|
import { useState as b } from "react";
|
|
5
5
|
import { useNivaroClient as N, useItemNavigation as v } from "../../context.js";
|
|
6
6
|
import { get as w } from "../../lib/commands.js";
|
|
7
|
-
import {
|
|
8
|
-
import { SectionCard as
|
|
9
|
-
function
|
|
7
|
+
import { formatNumber as $, cn as j, formatRelative as C } from "../../lib/utils.js";
|
|
8
|
+
import { SectionCard as _, EmptyLine as I } from "./primitives.js";
|
|
9
|
+
function A({ profile: i }) {
|
|
10
10
|
const m = N(), { urlFor: c } = v(), [n, p] = b(!1), { data: s, isLoading: u, isError: x, isFetching: d } = f({
|
|
11
11
|
queryKey: ["nvr-person-week", i.id, n],
|
|
12
12
|
queryFn: () => m.request(
|
|
@@ -30,7 +30,7 @@ function W({ profile: i }) {
|
|
|
30
30
|
[t.imports, t.imports === 1 ? "import" : "imports"]
|
|
31
31
|
].filter(([e]) => e > 0) : [];
|
|
32
32
|
return /* @__PURE__ */ a(
|
|
33
|
-
|
|
33
|
+
_,
|
|
34
34
|
{
|
|
35
35
|
icon: /* @__PURE__ */ a(g, { className: "h-4 w-4" }),
|
|
36
36
|
title: "This week",
|
|
@@ -50,7 +50,7 @@ function W({ profile: i }) {
|
|
|
50
50
|
]
|
|
51
51
|
}
|
|
52
52
|
),
|
|
53
|
-
children: u ? /* @__PURE__ */ a("div", { className: "space-y-2", "aria-busy": !0, children: [0, 1, 2].map((e) => /* @__PURE__ */ a("div", { className: "h-5 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }, e)) }) : !s || l.length === 0 && (t == null ? void 0 : t.updated) === 0 ? /* @__PURE__ */ r(
|
|
53
|
+
children: u ? /* @__PURE__ */ a("div", { className: "space-y-2", "aria-busy": !0, children: [0, 1, 2].map((e) => /* @__PURE__ */ a("div", { className: "h-5 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }, e)) }) : !s || l.length === 0 && (t == null ? void 0 : t.updated) === 0 ? /* @__PURE__ */ r(I, { children: [
|
|
54
54
|
"Nothing you can see from ",
|
|
55
55
|
o,
|
|
56
56
|
" in the last 7 days."
|
|
@@ -65,7 +65,7 @@ function W({ profile: i }) {
|
|
|
65
65
|
),
|
|
66
66
|
/* @__PURE__ */ r("p", { className: "text-slate-700 dark:text-slate-200", "data-person-week-facts": !0, children: [
|
|
67
67
|
l.length > 0 ? l.map(([e, h]) => `${e} ${h}`).join(" · ") : "No records created or moved",
|
|
68
|
-
t && t.updated > 0 ? ` · edited ${t.updated} record${t.updated === 1 ? "" : "s"}` : ""
|
|
68
|
+
t && t.updated > 0 ? ` · edited ${$(t.updated)} record${t.updated === 1 ? "" : "s"}` : ""
|
|
69
69
|
] }),
|
|
70
70
|
s.by_collection.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1.5", children: s.by_collection.map((e) => /* @__PURE__ */ r(
|
|
71
71
|
"span",
|
|
@@ -83,7 +83,7 @@ function W({ profile: i }) {
|
|
|
83
83
|
/* @__PURE__ */ a(
|
|
84
84
|
"span",
|
|
85
85
|
{
|
|
86
|
-
className:
|
|
86
|
+
className: j(
|
|
87
87
|
"shrink-0 text-[11px] font-medium",
|
|
88
88
|
e.what === "completed" || e.what === "approved" ? "text-emerald-700 dark:text-emerald-300" : e.what === "sent back" || e.what === "rejected" ? "text-amber-700 dark:text-amber-300" : "text-slate-500 dark:text-slate-400"
|
|
89
89
|
),
|
|
@@ -102,12 +102,12 @@ function W({ profile: i }) {
|
|
|
102
102
|
"→ ",
|
|
103
103
|
e.state
|
|
104
104
|
] }),
|
|
105
|
-
/* @__PURE__ */ a("span", { className: "ml-auto shrink-0 text-[11px] text-slate-400", children:
|
|
105
|
+
/* @__PURE__ */ a("span", { className: "ml-auto shrink-0 text-[11px] text-slate-400", children: C(e.at) })
|
|
106
106
|
] }, `${e.collection}:${e.item_id}`)) })
|
|
107
107
|
] })
|
|
108
108
|
}
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
A as PersonWeekCard
|
|
113
113
|
};
|