@nivaro/react 0.3.45 → 0.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +290 -23
- package/dist/index.js +679 -659
- package/dist/shared/components/BaseMap.js +149 -103
- package/dist/shared/components/CollectionBrowserView.js +813 -826
- package/dist/shared/components/ErrorNotice.js +169 -0
- package/dist/shared/components/ErrorSurface.js +23 -17
- package/dist/shared/components/ListLoadError.js +8 -29
- package/dist/shared/components/LoadErrorNote.js +38 -21
- package/dist/shared/components/QueryErrorState.js +8 -11
- package/dist/shared/components/ReportView.js +1320 -1291
- package/dist/shared/components/chat/ChannelArchive.js +60 -60
- package/dist/shared/components/chat/ChannelExtras.js +74 -74
- package/dist/shared/components/chat/ChatPanel.js +368 -367
- package/dist/shared/components/command-center/CommandCenterView.js +313 -69
- package/dist/shared/components/command-center/Customize.js +353 -0
- package/dist/shared/components/command-center/Header.js +279 -53
- package/dist/shared/components/command-center/KioskLinks.js +198 -0
- package/dist/shared/components/command-center/PeekPanel.js +144 -3
- package/dist/shared/components/command-center/announce.js +13 -0
- package/dist/shared/components/command-center/board-prefs.js +99 -0
- package/dist/shared/components/command-center/freshness.js +29 -0
- package/dist/shared/components/command-center/layout.js +56 -0
- package/dist/shared/components/command-center/panels/AttentionPanel.js +132 -3
- package/dist/shared/components/command-center/panels/Banner.js +75 -0
- package/dist/shared/components/command-center/panels/BoardSettings.js +224 -0
- package/dist/shared/components/command-center/panels/FeedPanel.js +145 -29
- package/dist/shared/components/command-center/panels/FlowPanel.js +154 -56
- package/dist/shared/components/command-center/panels/ForecastPanel.js +244 -3
- package/dist/shared/components/command-center/panels/MapLegend.js +266 -0
- package/dist/shared/components/command-center/panels/MapPanel.js +216 -66
- package/dist/shared/components/command-center/panels/PartnersPanel.js +49 -3
- package/dist/shared/components/command-center/panels/PeoplePanel.js +258 -40
- package/dist/shared/components/command-center/panels/RegionPicker.js +88 -3
- package/dist/shared/components/command-center/panels/SystemPanel.js +158 -38
- package/dist/shared/components/command-center/panels/ThroughputPanel.js +307 -3
- package/dist/shared/components/command-center/panels/TimeBar.js +227 -6
- package/dist/shared/components/command-center/panels/TrafficPanel.js +12 -8
- package/dist/shared/components/command-center/panels/WorkloadPanel.js +82 -3
- package/dist/shared/components/command-center/panels/attention-actions.js +267 -0
- package/dist/shared/components/command-center/panels/map-shared.js +95 -0
- package/dist/shared/components/command-center/panels/registry.js +87 -19
- package/dist/shared/components/command-center/shell-hooks.js +118 -0
- package/dist/shared/components/command-center/shortcuts.js +37 -0
- package/dist/shared/components/command-center/theme.js +39 -21
- package/dist/shared/components/command-center/time.js +52 -0
- package/dist/shared/components/command-center/url-state.js +54 -0
- package/dist/shared/components/command-center/work-links.js +32 -0
- package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
- package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
- package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
- package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
- package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
- package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
- package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
- package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
- package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
- package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
- package/dist/shared/components/import/ImportFromFileButton.js +61 -60
- package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
- package/dist/shared/components/imports/NewImportDialog.js +29 -28
- package/dist/shared/components/imports/RunDetailSheet.js +63 -63
- package/dist/shared/components/item-edit/FieldRow.js +329 -329
- package/dist/shared/components/item-edit/InlineTableField.js +898 -898
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
- package/dist/shared/components/item-edit/PlanGrid.js +220 -221
- package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
- package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
- package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
- package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
- package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
- package/dist/shared/components/monitoring/TrafficMiniMap.js +111 -70
- package/dist/shared/components/panels/SlaClock.js +35 -36
- package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
- package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
- package/dist/shared/components/profile/AgentsPanel.js +73 -72
- package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
- package/dist/shared/components/support/SupportRequestDialog.js +85 -81
- package/dist/shared/components/support/SupportView.js +94 -87
- package/dist/shared/lib/autofill-poll.js +21 -18
- package/dist/shared/lib/error-actions.js +85 -0
- package/dist/shared/lib/error-message.js +223 -82
- package/dist/shared/lib/error-toast.js +71 -13
- package/dist/shared/lib/safe-error.js +136 -38
- package/package.json +1 -1
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
import { jsxs as n, jsx as t, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Plus as
|
|
4
|
-
import { useState as c, useRef as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as P } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as R, useQuery as v, useMutation as _ } from "@tanstack/react-query";
|
|
3
|
+
import { Plus as I, Search as U, LifeBuoy as W } from "lucide-react";
|
|
4
|
+
import { useState as c, useRef as Y, useEffect as $ } from "react";
|
|
5
|
+
import { useNivaroClient as Q, useItemEditAuth as z } from "../../context.js";
|
|
6
|
+
import { get as k, patch as H, post as J, del as X } from "../../lib/commands.js";
|
|
7
|
+
import { takeSupportDraft as Z } from "../../lib/error-actions.js";
|
|
8
|
+
import { useLiveOps as ee } from "../../lib/live-ops.js";
|
|
9
|
+
import { RelationCombobox as te } from "../item-edit/RelationCombobox.js";
|
|
10
|
+
import { SimpleSelect as ae } from "../ui/SimpleSelect.js";
|
|
11
|
+
import { SupportAnalytics as re } from "./SupportAnalytics.js";
|
|
12
|
+
import { SupportRequestDialog as se } from "./SupportRequestDialog.js";
|
|
13
|
+
import { StatusPill as ne, TicketDetailSheet as le } from "./TicketDetailSheet.js";
|
|
14
|
+
function oe(l) {
|
|
14
15
|
if (!l) return "";
|
|
15
16
|
const i = Math.round((Date.now() - new Date(l).getTime()) / 6e4);
|
|
16
17
|
if (i < 60) return `${Math.max(i, 1)}m ago`;
|
|
17
18
|
const d = Math.round(i / 60);
|
|
18
19
|
return d < 48 ? `${d}h ago` : `${Math.round(d / 24)}d ago`;
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function Ne({
|
|
21
22
|
initialTicketId: l,
|
|
22
23
|
onTicketChange: i,
|
|
23
24
|
className: d
|
|
24
25
|
}) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
}, [r,
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const m = Q(), h = R(), x = z(), b = !!(x != null && x.isAdmin), [s, g] = c("mine"), f = Y(!1), a = (e) => {
|
|
27
|
+
f.current = !0, g(e);
|
|
28
|
+
}, [r, C] = c(l ?? null), [p, O] = c(
|
|
29
|
+
() => typeof window < "u" && /[?&]new=1\b/.test(window.location.search) ? Z() : null
|
|
30
|
+
), [T, A] = c(!!p), [N, D] = c("open"), [y, j] = c("unassigned"), [w, B] = c("");
|
|
31
|
+
$(() => {
|
|
32
|
+
l != null && C(l);
|
|
30
33
|
}, [l]);
|
|
31
|
-
const { data: o } =
|
|
34
|
+
const { data: o } = v({
|
|
32
35
|
queryKey: ["support-summary"],
|
|
33
|
-
queryFn: () =>
|
|
36
|
+
queryFn: () => m.request(k("/support/summary")).then((e) => e.data)
|
|
34
37
|
}), F = !!(o != null && o.desk);
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
ee("support", () => {
|
|
39
|
+
h.invalidateQueries({ queryKey: ["support-tickets"] }), h.invalidateQueries({ queryKey: ["support-summary"] }), h.invalidateQueries({ queryKey: ["support-ticket"] });
|
|
37
40
|
});
|
|
38
|
-
const [
|
|
39
|
-
|
|
40
|
-
!
|
|
41
|
-
}, [o,
|
|
42
|
-
const
|
|
41
|
+
const [K, E] = c(!1);
|
|
42
|
+
$(() => {
|
|
43
|
+
!K && o && (o.desk && !f.current && g("desk"), E(!0));
|
|
44
|
+
}, [o, K]);
|
|
45
|
+
const q = s === "desk" ? {
|
|
43
46
|
scope: "desk",
|
|
44
|
-
status:
|
|
45
|
-
...
|
|
46
|
-
...
|
|
47
|
-
} : { scope: "mine", status:
|
|
48
|
-
|
|
49
|
-
const { data: u, isLoading:
|
|
50
|
-
queryKey: ["support-tickets",
|
|
51
|
-
queryFn: () =>
|
|
47
|
+
status: y === "closed" ? "closed" : "open",
|
|
48
|
+
...y === "unassigned" ? { assignee: "unassigned" } : {},
|
|
49
|
+
...y === "me" ? { assignee: "me" } : {}
|
|
50
|
+
} : { scope: "mine", status: N };
|
|
51
|
+
w.trim() && (q.q = w.trim());
|
|
52
|
+
const { data: u, isLoading: G } = v({
|
|
53
|
+
queryKey: ["support-tickets", q],
|
|
54
|
+
queryFn: () => m.request(k("/support/tickets", q)),
|
|
52
55
|
enabled: s !== "types" && s !== "analytics"
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
+
}), S = (e) => {
|
|
57
|
+
C(e), i == null || i(e);
|
|
58
|
+
}, L = [
|
|
56
59
|
{ key: "mine", label: "My requests", count: o == null ? void 0 : o.mine_open },
|
|
57
60
|
...F ? [{ key: "desk", label: "Desk", count: o == null ? void 0 : o.unassigned }] : [],
|
|
58
61
|
...F ? [{ key: "analytics", label: "Analytics" }] : [],
|
|
59
|
-
...
|
|
62
|
+
...b ? [{ key: "types", label: "Request types" }] : []
|
|
60
63
|
];
|
|
61
64
|
return /* @__PURE__ */ n("div", { className: d, "data-support-view": !0, children: [
|
|
62
65
|
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
63
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", role: "tablist", children:
|
|
66
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", role: "tablist", children: L.map((e) => /* @__PURE__ */ n(
|
|
64
67
|
"button",
|
|
65
68
|
{
|
|
66
69
|
type: "button",
|
|
@@ -81,16 +84,16 @@ function ye({
|
|
|
81
84
|
{
|
|
82
85
|
type: "button",
|
|
83
86
|
"data-support-new": !0,
|
|
84
|
-
onClick: () =>
|
|
87
|
+
onClick: () => A(!0),
|
|
85
88
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy hover:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
86
89
|
children: [
|
|
87
|
-
/* @__PURE__ */ t(
|
|
90
|
+
/* @__PURE__ */ t(I, { className: "h-3.5 w-3.5" }),
|
|
88
91
|
" Get help"
|
|
89
92
|
]
|
|
90
93
|
}
|
|
91
94
|
)
|
|
92
95
|
] }),
|
|
93
|
-
s === "types" ? /* @__PURE__ */ t(
|
|
96
|
+
s === "types" ? /* @__PURE__ */ t(de, {}) : s === "analytics" ? /* @__PURE__ */ t(re, {}) : /* @__PURE__ */ n(P, { children: [
|
|
94
97
|
/* @__PURE__ */ n("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
95
98
|
(s === "desk" ? [
|
|
96
99
|
["unassigned", "Not picked up"],
|
|
@@ -100,28 +103,28 @@ function ye({
|
|
|
100
103
|
] : [
|
|
101
104
|
["open", "Open"],
|
|
102
105
|
["closed", "Closed"]
|
|
103
|
-
]).map(([e,
|
|
104
|
-
const
|
|
106
|
+
]).map(([e, V]) => {
|
|
107
|
+
const M = s === "desk" ? y === e : N === e;
|
|
105
108
|
return /* @__PURE__ */ t(
|
|
106
109
|
"button",
|
|
107
110
|
{
|
|
108
111
|
type: "button",
|
|
109
112
|
"data-support-filter": e,
|
|
110
|
-
"aria-pressed":
|
|
111
|
-
onClick: () => s === "desk" ?
|
|
112
|
-
className:
|
|
113
|
-
children:
|
|
113
|
+
"aria-pressed": M,
|
|
114
|
+
onClick: () => s === "desk" ? j(e) : D(e),
|
|
115
|
+
className: M ? "h-7 rounded-full border border-nvr-cyan/60 bg-nvr-cyan/10 px-2.5 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan" : "h-7 rounded-full border border-slate-200 px-2.5 text-[12px] text-slate-600 hover:border-slate-300 dark:border-border dark:text-slate-300",
|
|
116
|
+
children: V
|
|
114
117
|
},
|
|
115
118
|
e
|
|
116
119
|
);
|
|
117
120
|
}),
|
|
118
121
|
/* @__PURE__ */ n("label", { className: "ml-auto flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2 dark:border-border dark:bg-background", children: [
|
|
119
|
-
/* @__PURE__ */ t(
|
|
122
|
+
/* @__PURE__ */ t(U, { className: "h-3.5 w-3.5 text-slate-400" }),
|
|
120
123
|
/* @__PURE__ */ t(
|
|
121
124
|
"input",
|
|
122
125
|
{
|
|
123
|
-
value:
|
|
124
|
-
onChange: (e) =>
|
|
126
|
+
value: w,
|
|
127
|
+
onChange: (e) => B(e.target.value),
|
|
125
128
|
placeholder: "Search requests",
|
|
126
129
|
"aria-label": "Search requests",
|
|
127
130
|
className: "w-48 bg-transparent text-[12.5px] text-slate-900 outline-none dark:text-slate-100"
|
|
@@ -129,7 +132,7 @@ function ye({
|
|
|
129
132
|
)
|
|
130
133
|
] })
|
|
131
134
|
] }),
|
|
132
|
-
/* @__PURE__ */ t("div", { className: "mt-3 overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children:
|
|
135
|
+
/* @__PURE__ */ t("div", { className: "mt-3 overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: G ? /* @__PURE__ */ t("div", { className: "space-y-2 p-4", children: [0, 1, 2].map((e) => /* @__PURE__ */ t(
|
|
133
136
|
"div",
|
|
134
137
|
{
|
|
135
138
|
className: "h-10 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]"
|
|
@@ -140,7 +143,7 @@ function ye({
|
|
|
140
143
|
{
|
|
141
144
|
type: "button",
|
|
142
145
|
"data-support-row": e.id,
|
|
143
|
-
onClick: () =>
|
|
146
|
+
onClick: () => S(e.id),
|
|
144
147
|
className: "grid w-full grid-cols-[1fr_auto] items-start gap-3 px-4 py-2.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",
|
|
145
148
|
children: [
|
|
146
149
|
/* @__PURE__ */ n("span", { className: "min-w-0", children: [
|
|
@@ -161,14 +164,14 @@ function ye({
|
|
|
161
164
|
].filter(Boolean).join(" · ") })
|
|
162
165
|
] }),
|
|
163
166
|
/* @__PURE__ */ n("span", { className: "flex flex-col items-end gap-1", children: [
|
|
164
|
-
/* @__PURE__ */ t(
|
|
165
|
-
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children:
|
|
167
|
+
/* @__PURE__ */ t(ne, { status: e.status, label: e.status_label }),
|
|
168
|
+
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: oe(e.updated_at ?? e.created_at) })
|
|
166
169
|
] })
|
|
167
170
|
]
|
|
168
171
|
}
|
|
169
172
|
) }, e.id)) }) : /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-2 px-6 py-12 text-center", children: [
|
|
170
|
-
/* @__PURE__ */ t(
|
|
171
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: s === "desk" ?
|
|
173
|
+
/* @__PURE__ */ t(W, { className: "h-6 w-6 text-slate-300" }),
|
|
174
|
+
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: s === "desk" ? y === "unassigned" ? "Every request has been picked up." : "Nothing here." : N === "open" ? "You have no open requests." : "No closed requests yet." }),
|
|
172
175
|
s === "mine" && /* @__PURE__ */ t("p", { className: "max-w-sm text-[12px] text-slate-500 dark:text-muted-foreground", children: "Use Get help for anything general, or Request a change from a record's ⋯ menu to ask for a change to that record." })
|
|
173
176
|
] }) }),
|
|
174
177
|
u && u.total > u.data.length && /* @__PURE__ */ n("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
@@ -180,36 +183,40 @@ function ye({
|
|
|
180
183
|
] })
|
|
181
184
|
] }),
|
|
182
185
|
/* @__PURE__ */ t(
|
|
183
|
-
|
|
186
|
+
se,
|
|
184
187
|
{
|
|
185
|
-
open:
|
|
186
|
-
onOpenChange:
|
|
188
|
+
open: T,
|
|
189
|
+
onOpenChange: (e) => {
|
|
190
|
+
A(e), e || O(null);
|
|
191
|
+
},
|
|
192
|
+
initialTitle: p == null ? void 0 : p.title,
|
|
193
|
+
initialDescription: p == null ? void 0 : p.description,
|
|
187
194
|
onCreated: (e) => {
|
|
188
|
-
a("mine"),
|
|
195
|
+
a("mine"), D("open"), S(e.id);
|
|
189
196
|
}
|
|
190
197
|
}
|
|
191
198
|
),
|
|
192
|
-
/* @__PURE__ */ t(
|
|
199
|
+
/* @__PURE__ */ t(le, { ticketId: r, onOpenChange: (e) => !e && S(null) })
|
|
193
200
|
] });
|
|
194
201
|
}
|
|
195
|
-
function
|
|
196
|
-
const l =
|
|
202
|
+
function de() {
|
|
203
|
+
const l = Q(), i = R(), [d, m] = c(""), { data: h = [] } = v({
|
|
197
204
|
queryKey: ["support-categories", "all"],
|
|
198
|
-
queryFn: () => l.request(
|
|
199
|
-
}), { data:
|
|
205
|
+
queryFn: () => l.request(k("/support/categories", { all: "1" })).then((a) => a.data ?? [])
|
|
206
|
+
}), { data: x = [] } = v({
|
|
200
207
|
queryKey: ["support-teams"],
|
|
201
|
-
queryFn: () => l.request(
|
|
202
|
-
}),
|
|
203
|
-
mutationFn: ({ id: a, body: r }) => l.request(
|
|
204
|
-
onSuccess:
|
|
205
|
-
}),
|
|
206
|
-
mutationFn: () => l.request(
|
|
208
|
+
queryFn: () => l.request(k("/user-groups")).then((a) => a.data ?? []).catch(() => [])
|
|
209
|
+
}), b = () => void i.invalidateQueries({ queryKey: ["support-categories"] }), s = _({
|
|
210
|
+
mutationFn: ({ id: a, body: r }) => l.request(H(`/support/categories/${a}`, r)),
|
|
211
|
+
onSuccess: b
|
|
212
|
+
}), g = _({
|
|
213
|
+
mutationFn: () => l.request(J("/support/categories", { name: d.trim() })),
|
|
207
214
|
onSuccess: () => {
|
|
208
|
-
|
|
215
|
+
m(""), b();
|
|
209
216
|
}
|
|
210
|
-
}),
|
|
211
|
-
mutationFn: (a) => l.request(
|
|
212
|
-
onSuccess:
|
|
217
|
+
}), f = _({
|
|
218
|
+
mutationFn: (a) => l.request(X(`/support/categories/${a}`)),
|
|
219
|
+
onSuccess: b
|
|
213
220
|
});
|
|
214
221
|
return /* @__PURE__ */ n("div", { className: "mt-4 space-y-3", "data-support-types-editor": !0, children: [
|
|
215
222
|
/* @__PURE__ */ t("p", { className: "max-w-2xl text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "The kinds of request people pick from. A type tied to a collection is offered on those records only; without one it is offered everywhere, including General Support. With no team a request goes to every administrator; a default assignee skips the desk entirely." }),
|
|
@@ -222,7 +229,7 @@ function ne() {
|
|
|
222
229
|
/* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "Active" }),
|
|
223
230
|
/* @__PURE__ */ t("th", { className: "px-3 py-2" })
|
|
224
231
|
] }) }),
|
|
225
|
-
/* @__PURE__ */ t("tbody", { className: "divide-y divide-slate-100 dark:divide-border/60", children:
|
|
232
|
+
/* @__PURE__ */ t("tbody", { className: "divide-y divide-slate-100 dark:divide-border/60", children: h.map((a) => /* @__PURE__ */ n("tr", { "data-support-type-row": a.id, children: [
|
|
226
233
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
227
234
|
"input",
|
|
228
235
|
{
|
|
@@ -243,19 +250,19 @@ function ne() {
|
|
|
243
250
|
}
|
|
244
251
|
) }),
|
|
245
252
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
246
|
-
|
|
253
|
+
ae,
|
|
247
254
|
{
|
|
248
255
|
value: a.team_id != null ? String(a.team_id) : "",
|
|
249
256
|
onChange: (r) => s.mutate({ id: a.id, body: { team_id: r ? Number(r) : null } }),
|
|
250
257
|
options: [
|
|
251
258
|
{ value: "", label: "Administrators" },
|
|
252
|
-
...
|
|
259
|
+
...x.map((r) => ({ value: String(r.id), label: r.name }))
|
|
253
260
|
],
|
|
254
261
|
ariaLabel: "Team"
|
|
255
262
|
}
|
|
256
263
|
) }),
|
|
257
264
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
258
|
-
|
|
265
|
+
te,
|
|
259
266
|
{
|
|
260
267
|
collection: "nivaro_users",
|
|
261
268
|
value: a.default_assignee,
|
|
@@ -276,7 +283,7 @@ function ne() {
|
|
|
276
283
|
"button",
|
|
277
284
|
{
|
|
278
285
|
type: "button",
|
|
279
|
-
onClick: () =>
|
|
286
|
+
onClick: () => f.mutate(a.id),
|
|
280
287
|
className: "text-[11.5px] text-slate-400 hover:text-red-600",
|
|
281
288
|
children: "Remove"
|
|
282
289
|
}
|
|
@@ -288,14 +295,14 @@ function ne() {
|
|
|
288
295
|
{
|
|
289
296
|
className: "flex items-center gap-2",
|
|
290
297
|
onSubmit: (a) => {
|
|
291
|
-
a.preventDefault(), d.trim() &&
|
|
298
|
+
a.preventDefault(), d.trim() && g.mutate();
|
|
292
299
|
},
|
|
293
300
|
children: [
|
|
294
301
|
/* @__PURE__ */ t(
|
|
295
302
|
"input",
|
|
296
303
|
{
|
|
297
304
|
value: d,
|
|
298
|
-
onChange: (a) =>
|
|
305
|
+
onChange: (a) => m(a.target.value),
|
|
299
306
|
placeholder: "New type, e.g. Vendor change",
|
|
300
307
|
"aria-label": "New type name",
|
|
301
308
|
className: "h-8 w-72 rounded-md border border-slate-200 bg-white px-3 text-[12.5px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100"
|
|
@@ -305,7 +312,7 @@ function ne() {
|
|
|
305
312
|
"button",
|
|
306
313
|
{
|
|
307
314
|
type: "submit",
|
|
308
|
-
disabled: !d.trim() ||
|
|
315
|
+
disabled: !d.trim() || g.isPending,
|
|
309
316
|
className: "h-8 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy disabled:opacity-50 dark:text-nvr-cyan",
|
|
310
317
|
children: "Add type"
|
|
311
318
|
}
|
|
@@ -316,5 +323,5 @@ function ne() {
|
|
|
316
323
|
] });
|
|
317
324
|
}
|
|
318
325
|
export {
|
|
319
|
-
|
|
326
|
+
Ne as SupportView
|
|
320
327
|
};
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { statusTitle as d } from "./safe-error.js";
|
|
2
|
+
function g(e) {
|
|
3
|
+
let n = !1, a = null;
|
|
4
|
+
const m = e.intervalMs ?? 2e3, i = async () => {
|
|
5
|
+
var o, l, u, c, f;
|
|
6
|
+
let r;
|
|
6
7
|
try {
|
|
7
|
-
|
|
8
|
-
} catch (
|
|
9
|
-
if (
|
|
10
|
-
e.onError(
|
|
8
|
+
r = await e.fetchResult();
|
|
9
|
+
} catch (t) {
|
|
10
|
+
if (n) return;
|
|
11
|
+
e.onError(t.message), e.onSettled();
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
|
-
if (!
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
(u = e.onRunning) == null || u.call(e,
|
|
14
|
+
if (!n) {
|
|
15
|
+
if (r.status === 202) {
|
|
16
|
+
const t = (l = (o = r.json) == null ? void 0 : o.data) == null ? void 0 : l.document_name;
|
|
17
|
+
(u = e.onRunning) == null || u.call(e, t ? String(t) : void 0), a = setTimeout(i, m);
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
|
-
if (!
|
|
20
|
-
e.onError(
|
|
20
|
+
if (!r.ok) {
|
|
21
|
+
e.onError(
|
|
22
|
+
((c = r.json) == null ? void 0 : c.error) || `Document autofill failed. ${d(r.status) ?? "Try again."}`.trim()
|
|
23
|
+
), e.onSettled();
|
|
21
24
|
return;
|
|
22
25
|
}
|
|
23
|
-
e.onDone((
|
|
26
|
+
e.onDone((f = r.json) == null ? void 0 : f.data), e.onSettled();
|
|
24
27
|
}
|
|
25
28
|
};
|
|
26
29
|
return i(), () => {
|
|
27
|
-
|
|
30
|
+
n = !0, a && clearTimeout(a);
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
export {
|
|
31
|
-
|
|
34
|
+
g as pollProposal
|
|
32
35
|
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { errorDetailsText as c } from "./error-message.js";
|
|
2
|
+
let o = {};
|
|
3
|
+
function g(n) {
|
|
4
|
+
o = { ...o, ...n };
|
|
5
|
+
}
|
|
6
|
+
const i = "nvr:support-draft", s = 15 * 6e4;
|
|
7
|
+
function f(n, e = Date.now()) {
|
|
8
|
+
try {
|
|
9
|
+
localStorage.setItem(i, JSON.stringify({ ...n, at: e }));
|
|
10
|
+
} catch {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function y(n = Date.now()) {
|
|
14
|
+
try {
|
|
15
|
+
const e = localStorage.getItem(i);
|
|
16
|
+
if (!e) return null;
|
|
17
|
+
localStorage.removeItem(i);
|
|
18
|
+
const t = JSON.parse(e);
|
|
19
|
+
return typeof t.at != "number" || n - t.at > s || typeof t.title != "string" || typeof t.description != "string" ? null : { title: t.title.slice(0, 200), description: t.description.slice(0, 4e3) };
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function l(n, e = {}) {
|
|
25
|
+
const t = n.kind === "forbidden" ? "I need access to do this." : "I ran into a problem and could not finish what I was doing.";
|
|
26
|
+
return {
|
|
27
|
+
title: (n.kind === "forbidden" ? `Access: ${n.title}` : n.title).slice(0, 200),
|
|
28
|
+
description: `${t}
|
|
29
|
+
|
|
30
|
+
${c(n, e)}`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function a(n) {
|
|
34
|
+
o.navigate ? o.navigate(n) : typeof window < "u" && window.location.assign(n);
|
|
35
|
+
}
|
|
36
|
+
function d(n, e = {}) {
|
|
37
|
+
f(l(n, e));
|
|
38
|
+
const t = `${o.supportPath ?? "/support"}?new=1`;
|
|
39
|
+
if (typeof window > "u") return;
|
|
40
|
+
const r = window.open(t, "_blank");
|
|
41
|
+
r ? r.opener = null : a(t);
|
|
42
|
+
}
|
|
43
|
+
function u() {
|
|
44
|
+
if (o.signIn) {
|
|
45
|
+
o.signIn();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (typeof window > "u") return;
|
|
49
|
+
const n = `${window.location.pathname}${window.location.search}`, e = o.signInPath ?? "/login";
|
|
50
|
+
window.location.assign(
|
|
51
|
+
n && !n.startsWith(e) ? `${e}?redirect=${encodeURIComponent(n)}` : e
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function w() {
|
|
55
|
+
typeof window > "u" || (window.history.length > 1 ? window.history.back() : a("/"));
|
|
56
|
+
}
|
|
57
|
+
function h(n, e, t = {}) {
|
|
58
|
+
switch (n) {
|
|
59
|
+
case "retry":
|
|
60
|
+
t.retry ? t.retry() : typeof window < "u" && window.location.reload();
|
|
61
|
+
return;
|
|
62
|
+
case "reload":
|
|
63
|
+
typeof window < "u" && window.location.reload();
|
|
64
|
+
return;
|
|
65
|
+
case "sign-in":
|
|
66
|
+
u();
|
|
67
|
+
return;
|
|
68
|
+
case "go-back":
|
|
69
|
+
w();
|
|
70
|
+
return;
|
|
71
|
+
case "contact":
|
|
72
|
+
d(e, { action: t.action });
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
w as goBack,
|
|
78
|
+
u as goToSignIn,
|
|
79
|
+
d as openSupportForError,
|
|
80
|
+
h as runErrorAction,
|
|
81
|
+
f as saveSupportDraft,
|
|
82
|
+
g as setErrorActionHost,
|
|
83
|
+
l as supportDraftFor,
|
|
84
|
+
y as takeSupportDraft
|
|
85
|
+
};
|