@nivaro/react 0.3.117 → 0.3.119
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 +136 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3757 -3695
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4451 -4385
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +135 -94
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +88 -85
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +245 -141
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +15 -16
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/addendum-view.js +6 -0
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,258 +1,152 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Plus as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { takeSupportDraft as
|
|
8
|
-
import { useLiveRefresh as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { SupportAnalytics as
|
|
15
|
-
import { SupportRequestDialog as
|
|
16
|
-
import {
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const d = Math.round(i / 60);
|
|
22
|
-
return d < 48 ? `${d}h ago` : `${Math.round(d / 24)}d ago`;
|
|
23
|
-
}
|
|
24
|
-
function Ke({
|
|
25
|
-
initialTicketId: l,
|
|
26
|
-
onTicketChange: i,
|
|
27
|
-
className: d
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as C, useQueryClient as O, useMutation as A } from "@tanstack/react-query";
|
|
3
|
+
import { Plus as j } from "lucide-react";
|
|
4
|
+
import { useState as u, useRef as E, useEffect as w, useCallback as I } from "react";
|
|
5
|
+
import { useNivaroClient as F, useItemEditAuth as Q } from "../../context.js";
|
|
6
|
+
import { get as R, patch as z, post as B, del as G } from "../../lib/commands.js";
|
|
7
|
+
import { takeSupportDraft as P } from "../../lib/error-actions.js";
|
|
8
|
+
import { useLiveRefresh as H } from "../../lib/live-counts.js";
|
|
9
|
+
import { RelationCombobox as J } from "../item-edit/RelationCombobox.js";
|
|
10
|
+
import { LiveCount as U } from "../LiveCount.js";
|
|
11
|
+
import { SimpleSelect as X } from "../ui/SimpleSelect.js";
|
|
12
|
+
import { AssignRulesView as Y } from "./AssignRules.js";
|
|
13
|
+
import { RequestList as Z } from "./RequestList.js";
|
|
14
|
+
import { SupportAnalytics as ee } from "./SupportAnalytics.js";
|
|
15
|
+
import { SupportRequestDialog as te } from "./SupportRequestDialog.js";
|
|
16
|
+
import { TicketDetailSheet as re } from "./TicketDetailSheet.js";
|
|
17
|
+
function ve({
|
|
18
|
+
initialTicketId: o,
|
|
19
|
+
onTicketChange: m,
|
|
20
|
+
className: c
|
|
28
21
|
}) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
() => typeof window < "u" && /[?&]new=1\b/.test(window.location.search) ?
|
|
33
|
-
), [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
const { data:
|
|
22
|
+
const y = F(), h = Q(), x = !!(h != null && h.isAdmin), [n, i] = u("mine"), f = E(!1), g = (e) => {
|
|
23
|
+
f.current = !0, i(e);
|
|
24
|
+
}, [r, a] = u(o ?? null), [d, M] = u(
|
|
25
|
+
() => typeof window < "u" && /[?&]new=1\b/.test(window.location.search) ? P() : null
|
|
26
|
+
), [T, D] = u(!!d);
|
|
27
|
+
w(() => {
|
|
28
|
+
o != null && a(o);
|
|
29
|
+
}, [o]);
|
|
30
|
+
const { data: s } = C({
|
|
38
31
|
queryKey: ["support-summary"],
|
|
39
|
-
queryFn: () =>
|
|
40
|
-
}),
|
|
41
|
-
|
|
32
|
+
queryFn: () => y.request(R("/support/summary")).then((e) => e.data)
|
|
33
|
+
}), L = !!(s != null && s.desk);
|
|
34
|
+
H({
|
|
42
35
|
topic: "support",
|
|
43
|
-
keys: [["support-tickets"], ["support-summary"], ["support-ticket"]]
|
|
36
|
+
keys: [["support-tickets"], ["support-summary"], ["support-ticket"], ["support-workload"]]
|
|
44
37
|
});
|
|
45
|
-
const [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
...
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
...F ? [{ key: "analytics", label: "Analytics" }] : [],
|
|
78
|
-
...q ? [{ key: "types", label: "Request types" }] : []
|
|
79
|
-
];
|
|
80
|
-
return /* @__PURE__ */ n("div", { className: d, "data-support-view": !0, children: [
|
|
81
|
-
/* @__PURE__ */ n("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
82
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-1", role: "tablist", children: I.map((e) => /* @__PURE__ */ n(
|
|
83
|
-
"button",
|
|
38
|
+
const [_, V] = u(!1);
|
|
39
|
+
w(() => {
|
|
40
|
+
!_ && s && (s.desk && !f.current && i("desk"), V(!0));
|
|
41
|
+
}, [s, _]);
|
|
42
|
+
const N = (e) => {
|
|
43
|
+
a(e), m == null || m(e);
|
|
44
|
+
}, W = [
|
|
45
|
+
{ key: "mine", label: "My requests", count: s == null ? void 0 : s.mine_open },
|
|
46
|
+
...L ? [{ key: "desk", label: "Desk", count: s == null ? void 0 : s.unassigned }] : [],
|
|
47
|
+
...L ? [{ key: "analytics", label: "Analytics" }] : [],
|
|
48
|
+
...x ? [{ key: "types", label: "Request types" }] : [],
|
|
49
|
+
...x ? [{ key: "rules", label: "Assignment rules" }] : []
|
|
50
|
+
], S = E(null), [v, $] = u({ left: !1, right: !1 }), b = I(() => {
|
|
51
|
+
const e = S.current;
|
|
52
|
+
if (!e) return;
|
|
53
|
+
const p = e.scrollLeft > 2, k = e.scrollLeft + e.clientWidth < e.scrollWidth - 2;
|
|
54
|
+
$((q) => q.left === p && q.right === k ? q : { left: p, right: k });
|
|
55
|
+
}, []);
|
|
56
|
+
w(() => (b(), window.addEventListener("resize", b), () => window.removeEventListener("resize", b)), [b, W.length]), w(() => {
|
|
57
|
+
const e = S.current, p = e == null ? void 0 : e.querySelector(`[data-support-tab="${n}"]`);
|
|
58
|
+
if (!e || !p || e.scrollWidth <= e.clientWidth) return;
|
|
59
|
+
const k = p.offsetLeft - (e.clientWidth - p.offsetWidth) / 2;
|
|
60
|
+
e.scrollTo({ left: Math.max(0, k), behavior: "smooth" });
|
|
61
|
+
}, [n]);
|
|
62
|
+
const K = v.left || v.right ? (() => {
|
|
63
|
+
const e = `linear-gradient(to right, ${v.left ? "transparent" : "black"}, black 20px, black calc(100% - 28px), ${v.right ? "transparent" : "black"})`;
|
|
64
|
+
return { maskImage: e, WebkitMaskImage: e };
|
|
65
|
+
})() : void 0;
|
|
66
|
+
return /* @__PURE__ */ l("div", { className: c, "data-support-view": !0, children: [
|
|
67
|
+
/* @__PURE__ */ l("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
68
|
+
/* @__PURE__ */ t(
|
|
69
|
+
"div",
|
|
84
70
|
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
71
|
+
ref: S,
|
|
72
|
+
onScroll: b,
|
|
73
|
+
className: "relative -mx-1 flex min-w-0 max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none]",
|
|
74
|
+
style: K,
|
|
75
|
+
role: "tablist",
|
|
76
|
+
children: W.map((e) => /* @__PURE__ */ l(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
type: "button",
|
|
80
|
+
role: "tab",
|
|
81
|
+
"aria-selected": n === e.key,
|
|
82
|
+
"data-support-tab": e.key,
|
|
83
|
+
onClick: () => g(e.key),
|
|
84
|
+
className: n === e.key ? "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy dark:text-nvr-cyan" : "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-3 text-[12.5px] text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-white/5",
|
|
85
|
+
children: [
|
|
86
|
+
e.label,
|
|
87
|
+
e.count ? /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-200 px-1.5 text-[10.5px] font-semibold tabular-nums text-slate-700 dark:bg-white/10 dark:text-slate-200", children: /* @__PURE__ */ t(U, { value: e.count }) }) : null
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
e.key
|
|
91
|
+
))
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ l(
|
|
99
95
|
"button",
|
|
100
96
|
{
|
|
101
97
|
type: "button",
|
|
102
98
|
"data-support-new": !0,
|
|
103
|
-
onClick: () =>
|
|
99
|
+
onClick: () => D(!0),
|
|
104
100
|
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",
|
|
105
101
|
children: [
|
|
106
|
-
/* @__PURE__ */ t(
|
|
102
|
+
/* @__PURE__ */ t(j, { className: "h-3.5 w-3.5" }),
|
|
107
103
|
" Get help"
|
|
108
104
|
]
|
|
109
105
|
}
|
|
110
106
|
)
|
|
111
107
|
] }),
|
|
112
|
-
|
|
113
|
-
/* @__PURE__ */ n("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
114
|
-
(s === "desk" ? [
|
|
115
|
-
["unassigned", "Not picked up"],
|
|
116
|
-
["me", "Mine"],
|
|
117
|
-
["open", "All open"],
|
|
118
|
-
["closed", "Closed"]
|
|
119
|
-
] : [
|
|
120
|
-
["open", "Open"],
|
|
121
|
-
["closed", "Closed"]
|
|
122
|
-
]).map(([e, N]) => {
|
|
123
|
-
const L = s === "desk" ? h === e : y === e;
|
|
124
|
-
return /* @__PURE__ */ t(
|
|
125
|
-
"button",
|
|
126
|
-
{
|
|
127
|
-
type: "button",
|
|
128
|
-
"data-support-filter": e,
|
|
129
|
-
"aria-pressed": L,
|
|
130
|
-
onClick: () => s === "desk" ? G(e) : D(e),
|
|
131
|
-
className: L ? "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",
|
|
132
|
-
children: N
|
|
133
|
-
},
|
|
134
|
-
e
|
|
135
|
-
);
|
|
136
|
-
}),
|
|
137
|
-
/* @__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: [
|
|
138
|
-
/* @__PURE__ */ t(H, { className: "h-3.5 w-3.5 text-slate-400" }),
|
|
139
|
-
/* @__PURE__ */ t(
|
|
140
|
-
"input",
|
|
141
|
-
{
|
|
142
|
-
value: v,
|
|
143
|
-
onChange: (e) => O(e.target.value),
|
|
144
|
-
placeholder: "Search requests",
|
|
145
|
-
"aria-label": "Search requests",
|
|
146
|
-
className: "w-48 bg-transparent text-[12.5px] text-slate-900 outline-none dark:text-slate-100"
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
] })
|
|
150
|
-
] }),
|
|
151
|
-
/* @__PURE__ */ t(
|
|
152
|
-
"div",
|
|
153
|
-
{
|
|
154
|
-
ref: U,
|
|
155
|
-
className: "mt-3 overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
156
|
-
children: P ? /* @__PURE__ */ t("div", { className: "space-y-2 p-4", children: [0, 1, 2].map((e) => /* @__PURE__ */ t(
|
|
157
|
-
"div",
|
|
158
|
-
{
|
|
159
|
-
className: "h-10 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]"
|
|
160
|
-
},
|
|
161
|
-
e
|
|
162
|
-
)) }) : k.rows.length ? /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", "data-support-list": !0, children: k.rows.map(({ row: e, state: N }) => /* @__PURE__ */ t(
|
|
163
|
-
"li",
|
|
164
|
-
{
|
|
165
|
-
"data-departed": N === "departed" || void 0,
|
|
166
|
-
className: N === "departed" ? "opacity-50" : void 0,
|
|
167
|
-
children: /* @__PURE__ */ n(
|
|
168
|
-
"button",
|
|
169
|
-
{
|
|
170
|
-
type: "button",
|
|
171
|
-
"data-support-row": e.id,
|
|
172
|
-
onClick: () => C(e.id),
|
|
173
|
-
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",
|
|
174
|
-
children: [
|
|
175
|
-
/* @__PURE__ */ n("span", { className: "min-w-0", children: [
|
|
176
|
-
/* @__PURE__ */ n("span", { className: "flex items-center gap-2", children: [
|
|
177
|
-
/* @__PURE__ */ n("span", { className: "font-mono text-[11px] text-slate-400", children: [
|
|
178
|
-
"#",
|
|
179
|
-
e.id
|
|
180
|
-
] }),
|
|
181
|
-
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: e.title }),
|
|
182
|
-
e.priority === "urgent" && /* @__PURE__ */ t("span", { className: "rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" })
|
|
183
|
-
] }),
|
|
184
|
-
/* @__PURE__ */ t("span", { className: "mt-0.5 block truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
185
|
-
e.record_label ?? "General Support",
|
|
186
|
-
e.category_name,
|
|
187
|
-
s === "desk" ? e.requester_name : null,
|
|
188
|
-
e.assignee_name ? `with ${e.assignee_name}` : null,
|
|
189
|
-
e.replies ? `${e.replies} repl${e.replies === 1 ? "y" : "ies"}` : null
|
|
190
|
-
].filter(Boolean).join(" · ") })
|
|
191
|
-
] }),
|
|
192
|
-
/* @__PURE__ */ n("span", { className: "flex flex-col items-end gap-1", children: [
|
|
193
|
-
/* @__PURE__ */ t(he, { status: e.status, label: e.status_label }),
|
|
194
|
-
/* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: be(e.updated_at ?? e.created_at) })
|
|
195
|
-
] })
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
)
|
|
199
|
-
},
|
|
200
|
-
e.id
|
|
201
|
-
)) }) : /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-2 px-6 py-12 text-center", children: [
|
|
202
|
-
/* @__PURE__ */ t(J, { className: "h-6 w-6 text-slate-300" }),
|
|
203
|
-
/* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: s === "desk" ? h === "unassigned" ? "Every request has been picked up." : "Nothing here." : y === "open" ? "You have no open requests." : "No closed requests yet." }),
|
|
204
|
-
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 help on a record (beside Save) to ask for a change to that record." })
|
|
205
|
-
] })
|
|
206
|
-
}
|
|
207
|
-
),
|
|
208
|
-
u && u.total > u.data.length && /* @__PURE__ */ n("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
209
|
-
"Showing ",
|
|
210
|
-
u.data.length,
|
|
211
|
-
" of ",
|
|
212
|
-
u.total,
|
|
213
|
-
". Search to narrow the list."
|
|
214
|
-
] })
|
|
215
|
-
] }),
|
|
108
|
+
n === "types" ? /* @__PURE__ */ t(ae, {}) : n === "rules" ? /* @__PURE__ */ t(Y, {}) : n === "analytics" ? /* @__PURE__ */ t(ee, {}) : /* @__PURE__ */ t(Z, { tab: n, openId: r, onOpen: (e) => N(e) }, n),
|
|
216
109
|
/* @__PURE__ */ t(
|
|
217
|
-
|
|
110
|
+
te,
|
|
218
111
|
{
|
|
219
|
-
open:
|
|
112
|
+
open: T,
|
|
220
113
|
onOpenChange: (e) => {
|
|
221
|
-
|
|
114
|
+
D(e), e || M(null);
|
|
222
115
|
},
|
|
223
|
-
initialTitle:
|
|
224
|
-
initialDescription:
|
|
116
|
+
initialTitle: d == null ? void 0 : d.title,
|
|
117
|
+
initialDescription: d == null ? void 0 : d.description,
|
|
118
|
+
source: d ? "error" : void 0,
|
|
225
119
|
onCreated: (e) => {
|
|
226
|
-
|
|
120
|
+
g("mine"), N(e.id);
|
|
227
121
|
}
|
|
228
122
|
}
|
|
229
123
|
),
|
|
230
|
-
/* @__PURE__ */ t(
|
|
124
|
+
/* @__PURE__ */ t(re, { ticketId: r, onOpenChange: (e) => !e && N(null) })
|
|
231
125
|
] });
|
|
232
126
|
}
|
|
233
|
-
function
|
|
234
|
-
const
|
|
127
|
+
function ae() {
|
|
128
|
+
const o = F(), m = O(), [c, y] = u(""), { data: h = [] } = C({
|
|
235
129
|
queryKey: ["support-categories", "all"],
|
|
236
|
-
queryFn: () =>
|
|
237
|
-
}), { data:
|
|
130
|
+
queryFn: () => o.request(R("/support/categories", { all: "1" })).then((r) => r.data ?? [])
|
|
131
|
+
}), { data: x = [] } = C({
|
|
238
132
|
queryKey: ["support-teams"],
|
|
239
|
-
queryFn: () =>
|
|
240
|
-
}),
|
|
241
|
-
mutationFn: ({ id:
|
|
242
|
-
onSuccess:
|
|
243
|
-
}),
|
|
244
|
-
mutationFn: () =>
|
|
133
|
+
queryFn: () => o.request(R("/user-groups")).then((r) => r.data ?? []).catch(() => [])
|
|
134
|
+
}), n = () => void m.invalidateQueries({ queryKey: ["support-categories"] }), i = A({
|
|
135
|
+
mutationFn: ({ id: r, body: a }) => o.request(z(`/support/categories/${r}`, a)),
|
|
136
|
+
onSuccess: n
|
|
137
|
+
}), f = A({
|
|
138
|
+
mutationFn: () => o.request(B("/support/categories", { name: c.trim() })),
|
|
245
139
|
onSuccess: () => {
|
|
246
|
-
|
|
140
|
+
y(""), n();
|
|
247
141
|
}
|
|
248
|
-
}),
|
|
249
|
-
mutationFn: (
|
|
250
|
-
onSuccess:
|
|
142
|
+
}), g = A({
|
|
143
|
+
mutationFn: (r) => o.request(G(`/support/categories/${r}`)),
|
|
144
|
+
onSuccess: n
|
|
251
145
|
});
|
|
252
|
-
return /* @__PURE__ */
|
|
146
|
+
return /* @__PURE__ */ l("div", { className: "mt-4 space-y-3", "data-support-types-editor": !0, children: [
|
|
253
147
|
/* @__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." }),
|
|
254
|
-
/* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */
|
|
255
|
-
/* @__PURE__ */ t("thead", { className: "bg-slate-50 text-left text-[11px] uppercase tracking-wide text-slate-500 dark:bg-white/5 dark:text-muted-foreground", children: /* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ l("table", { className: "w-full text-[12.5px]", children: [
|
|
149
|
+
/* @__PURE__ */ t("thead", { className: "bg-slate-50 text-left text-[11px] uppercase tracking-wide text-slate-500 dark:bg-white/5 dark:text-muted-foreground", children: /* @__PURE__ */ l("tr", { children: [
|
|
256
150
|
/* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "Type" }),
|
|
257
151
|
/* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "For records in" }),
|
|
258
152
|
/* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "Team" }),
|
|
@@ -260,12 +154,12 @@ function ge() {
|
|
|
260
154
|
/* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "Active" }),
|
|
261
155
|
/* @__PURE__ */ t("th", { className: "px-3 py-2" })
|
|
262
156
|
] }) }),
|
|
263
|
-
/* @__PURE__ */ t("tbody", { className: "divide-y divide-slate-100 dark:divide-border/60", children:
|
|
157
|
+
/* @__PURE__ */ t("tbody", { className: "divide-y divide-slate-100 dark:divide-border/60", children: h.map((r) => /* @__PURE__ */ l("tr", { "data-support-type-row": r.id, children: [
|
|
264
158
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
265
159
|
"input",
|
|
266
160
|
{
|
|
267
|
-
defaultValue:
|
|
268
|
-
onBlur: (
|
|
161
|
+
defaultValue: r.name,
|
|
162
|
+
onBlur: (a) => a.target.value.trim() && a.target.value !== r.name && i.mutate({ id: r.id, body: { name: a.target.value } }),
|
|
269
163
|
"aria-label": "Type name",
|
|
270
164
|
className: "w-full bg-transparent font-medium text-slate-900 outline-none focus:underline dark:text-slate-100"
|
|
271
165
|
}
|
|
@@ -273,31 +167,31 @@ function ge() {
|
|
|
273
167
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
274
168
|
"input",
|
|
275
169
|
{
|
|
276
|
-
defaultValue:
|
|
170
|
+
defaultValue: r.collection ?? "",
|
|
277
171
|
placeholder: "Anywhere",
|
|
278
|
-
onBlur: (
|
|
172
|
+
onBlur: (a) => (a.target.value || null) !== r.collection && i.mutate({ id: r.id, body: { collection: a.target.value || null } }),
|
|
279
173
|
"aria-label": "Collection",
|
|
280
174
|
className: "w-full bg-transparent font-mono text-[12px] text-slate-700 outline-none dark:text-slate-300"
|
|
281
175
|
}
|
|
282
176
|
) }),
|
|
283
177
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
284
|
-
|
|
178
|
+
X,
|
|
285
179
|
{
|
|
286
|
-
value:
|
|
287
|
-
onChange: (
|
|
180
|
+
value: r.team_id != null ? String(r.team_id) : "",
|
|
181
|
+
onChange: (a) => i.mutate({ id: r.id, body: { team_id: a ? Number(a) : null } }),
|
|
288
182
|
options: [
|
|
289
183
|
{ value: "", label: "Administrators" },
|
|
290
|
-
...
|
|
184
|
+
...x.map((a) => ({ value: String(a.id), label: a.name }))
|
|
291
185
|
],
|
|
292
186
|
ariaLabel: "Team"
|
|
293
187
|
}
|
|
294
188
|
) }),
|
|
295
189
|
/* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
|
|
296
|
-
|
|
190
|
+
J,
|
|
297
191
|
{
|
|
298
192
|
collection: "nivaro_users",
|
|
299
|
-
value:
|
|
300
|
-
onChange: (
|
|
193
|
+
value: r.default_assignee,
|
|
194
|
+
onChange: (a) => i.mutate({ id: r.id, body: { default_assignee: a ? String(a) : null } }),
|
|
301
195
|
placeholder: "Nobody"
|
|
302
196
|
}
|
|
303
197
|
) }),
|
|
@@ -305,8 +199,8 @@ function ge() {
|
|
|
305
199
|
"input",
|
|
306
200
|
{
|
|
307
201
|
type: "checkbox",
|
|
308
|
-
checked:
|
|
309
|
-
onChange: (
|
|
202
|
+
checked: r.is_active,
|
|
203
|
+
onChange: (a) => i.mutate({ id: r.id, body: { is_active: a.target.checked } }),
|
|
310
204
|
"aria-label": "Active"
|
|
311
205
|
}
|
|
312
206
|
) }),
|
|
@@ -314,26 +208,26 @@ function ge() {
|
|
|
314
208
|
"button",
|
|
315
209
|
{
|
|
316
210
|
type: "button",
|
|
317
|
-
onClick: () =>
|
|
211
|
+
onClick: () => g.mutate(r.id),
|
|
318
212
|
className: "text-[11.5px] text-slate-400 hover:text-red-600",
|
|
319
213
|
children: "Remove"
|
|
320
214
|
}
|
|
321
215
|
) })
|
|
322
|
-
] },
|
|
216
|
+
] }, r.id)) })
|
|
323
217
|
] }) }),
|
|
324
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ l(
|
|
325
219
|
"form",
|
|
326
220
|
{
|
|
327
221
|
className: "flex items-center gap-2",
|
|
328
|
-
onSubmit: (
|
|
329
|
-
|
|
222
|
+
onSubmit: (r) => {
|
|
223
|
+
r.preventDefault(), c.trim() && f.mutate();
|
|
330
224
|
},
|
|
331
225
|
children: [
|
|
332
226
|
/* @__PURE__ */ t(
|
|
333
227
|
"input",
|
|
334
228
|
{
|
|
335
|
-
value:
|
|
336
|
-
onChange: (
|
|
229
|
+
value: c,
|
|
230
|
+
onChange: (r) => y(r.target.value),
|
|
337
231
|
placeholder: "New type, e.g. Vendor change",
|
|
338
232
|
"aria-label": "New type name",
|
|
339
233
|
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"
|
|
@@ -343,7 +237,7 @@ function ge() {
|
|
|
343
237
|
"button",
|
|
344
238
|
{
|
|
345
239
|
type: "submit",
|
|
346
|
-
disabled: !
|
|
240
|
+
disabled: !c.trim() || f.isPending,
|
|
347
241
|
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",
|
|
348
242
|
children: "Add type"
|
|
349
243
|
}
|
|
@@ -354,5 +248,5 @@ function ge() {
|
|
|
354
248
|
] });
|
|
355
249
|
}
|
|
356
250
|
export {
|
|
357
|
-
|
|
251
|
+
ve as SupportView
|
|
358
252
|
};
|