@nivaro/react 0.3.94 → 0.3.95
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/shared/components/NotificationBell.js +1 -1
- package/dist/shared/components/item-edit/FieldAffordances.js +285 -278
- package/dist/shared/components/item-edit/FieldRow.js +53 -52
- package/dist/shared/components/item-edit/InlineTableField.js +1 -0
- package/dist/shared/components/item-edit/RuleProvenancePopover.js +61 -53
- package/dist/shared/components/item-edit/useRecordLabels.js +44 -0
- package/dist/shared/components/notifications/NotificationDetailBits.js +55 -55
- package/dist/shared/components/panels/PipelinePanel.js +361 -330
- package/dist/shared/components/support/ReportProblem.js +10 -10
- package/dist/shared/components/support/SupportRequestDialog.js +11 -11
- package/dist/shared/components/support/TicketDetailSheet.js +114 -109
- package/dist/shared/components/support/support-context.js +14 -9
- package/package.json +1 -1
|
@@ -29,11 +29,11 @@ function xe({
|
|
|
29
29
|
children: s,
|
|
30
30
|
onReported: p
|
|
31
31
|
}) {
|
|
32
|
-
const g = H(), y = K(), [A, c] = o(!1), [k, w] = o(!1), [d, v] = o(""), [u, N] = o(null), [m, C] = o(!0), [S, q] = o(!0), [h, D] = o(null), [
|
|
32
|
+
const g = H(), y = K(), [A, c] = o(!1), [k, w] = o(!1), [d, v] = o(""), [u, N] = o(null), [m, C] = o(!0), [S, q] = o(!0), [h, D] = o(null), [T, x] = o(null), b = Y(null);
|
|
33
33
|
z(() => {
|
|
34
34
|
U();
|
|
35
35
|
}, []);
|
|
36
|
-
async function
|
|
36
|
+
async function j() {
|
|
37
37
|
b.current = {
|
|
38
38
|
clip: J("support"),
|
|
39
39
|
route: window.location.pathname + window.location.search
|
|
@@ -44,21 +44,21 @@ function xe({
|
|
|
44
44
|
}
|
|
45
45
|
const i = L({
|
|
46
46
|
mutationFn: async () => {
|
|
47
|
-
const e = b.current, R = (e == null ? void 0 : e.route) ?? window.location.pathname,
|
|
47
|
+
const e = b.current, R = (e == null ? void 0 : e.route) ?? window.location.pathname, E = S ? await te({
|
|
48
48
|
clip: (e == null ? void 0 : e.clip) ?? null,
|
|
49
49
|
route: R,
|
|
50
|
-
upload: (
|
|
50
|
+
upload: (W) => g.upload(W, { title: "Technical details" }),
|
|
51
51
|
userAgent: navigator.userAgent
|
|
52
|
-
}) : null,
|
|
52
|
+
}) : null, Q = re({
|
|
53
53
|
sentence: d,
|
|
54
54
|
route: R,
|
|
55
55
|
app: a,
|
|
56
56
|
screenshot: u,
|
|
57
57
|
includeShot: m,
|
|
58
|
-
context:
|
|
58
|
+
context: E
|
|
59
59
|
});
|
|
60
60
|
return g.request(
|
|
61
|
-
G("/support/report-problem",
|
|
61
|
+
G("/support/report-problem", Q)
|
|
62
62
|
);
|
|
63
63
|
},
|
|
64
64
|
onSuccess: (e) => {
|
|
@@ -71,7 +71,7 @@ function xe({
|
|
|
71
71
|
type: "button",
|
|
72
72
|
"data-report-problem": !0,
|
|
73
73
|
"data-nvr-recording-hide": !0,
|
|
74
|
-
onClick: () => void
|
|
74
|
+
onClick: () => void j(),
|
|
75
75
|
title: "Report a problem",
|
|
76
76
|
"aria-label": "Report a problem",
|
|
77
77
|
className: l ?? "fixed bottom-4 right-4 z-40 flex h-9 w-9 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 shadow-sm transition-colors hover:border-amber-300 hover:text-amber-600 dark:border-border dark:bg-card",
|
|
@@ -82,7 +82,7 @@ function xe({
|
|
|
82
82
|
{
|
|
83
83
|
type: "button",
|
|
84
84
|
"data-report-problem": !0,
|
|
85
|
-
onClick: () => void
|
|
85
|
+
onClick: () => void j(),
|
|
86
86
|
className: l,
|
|
87
87
|
children: k ? /* @__PURE__ */ t(f, { className: "h-4 w-4 animate-spin" }) : s ?? "Report a problem"
|
|
88
88
|
}
|
|
@@ -180,7 +180,7 @@ function xe({
|
|
|
180
180
|
/* @__PURE__ */ t("span", { className: "block text-[11px] text-slate-400", children: "The page, recent errors and requests, and (when replay is on) the last minute of this screen with every typed value hidden." })
|
|
181
181
|
] })
|
|
182
182
|
] }),
|
|
183
|
-
|
|
183
|
+
T && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-600 dark:text-red-400", role: "alert", children: T }),
|
|
184
184
|
/* @__PURE__ */ r("div", { className: "flex justify-end gap-2 pt-1", children: [
|
|
185
185
|
/* @__PURE__ */ t(
|
|
186
186
|
"button",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { useQueryClient as _, useQuery as z, useMutation as G } from "@tanstack/react-query";
|
|
3
|
-
import { Loader2 as
|
|
4
|
-
import { useState as l, useRef as
|
|
3
|
+
import { Loader2 as U, Paperclip as H, X } from "lucide-react";
|
|
4
|
+
import { useState as l, useRef as W, useEffect as I } from "react";
|
|
5
5
|
import { useNivaroClient as B } from "../../context.js";
|
|
6
6
|
import { get as J, post as V } from "../../lib/commands.js";
|
|
7
7
|
import { invalidateRecordTasks as Z } from "../../lib/record-tasks.js";
|
|
@@ -19,7 +19,7 @@ function ye({
|
|
|
19
19
|
initialDescription: g,
|
|
20
20
|
onCreated: y
|
|
21
21
|
}) {
|
|
22
|
-
const m = B(), i = _(), n = !!d && p != null && p !== "", [u, Q] = l(null), [b, v] = l(""), [
|
|
22
|
+
const m = B(), i = _(), n = !!d && p != null && p !== "", [u, Q] = l(null), [b, v] = l(""), [T, k] = l(""), [w, N] = l([]), [E, K] = l(!1), [F, x] = l(null), [M, P] = l(!0), q = W(null), C = W(!1);
|
|
23
23
|
I(() => {
|
|
24
24
|
ee();
|
|
25
25
|
}, []), I(() => {
|
|
@@ -49,7 +49,7 @@ function ye({
|
|
|
49
49
|
return se({
|
|
50
50
|
clip: (e == null ? void 0 : e.clip) ?? null,
|
|
51
51
|
route: (e == null ? void 0 : e.route) ?? (typeof window < "u" ? window.location.pathname : ""),
|
|
52
|
-
upload: (r) => m.upload(r, { title: "
|
|
52
|
+
upload: (r) => m.upload(r, { title: "Technical details" }),
|
|
53
53
|
userAgent: typeof navigator < "u" ? navigator.userAgent : null
|
|
54
54
|
});
|
|
55
55
|
}
|
|
@@ -59,7 +59,7 @@ function ye({
|
|
|
59
59
|
return m.request(
|
|
60
60
|
V("/support/tickets", {
|
|
61
61
|
title: b.trim(),
|
|
62
|
-
description:
|
|
62
|
+
description: T.trim() || null,
|
|
63
63
|
category_id: u,
|
|
64
64
|
collection: n ? d : null,
|
|
65
65
|
item: n ? String(p) : null,
|
|
@@ -99,7 +99,7 @@ function ye({
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
const h = S.find((e) => e.id === u) ?? null,
|
|
102
|
+
const h = S.find((e) => e.id === u) ?? null, j = b.trim().length > 0 && !D.isPending && !E;
|
|
103
103
|
return /* @__PURE__ */ t(
|
|
104
104
|
te,
|
|
105
105
|
{
|
|
@@ -117,7 +117,7 @@ function ye({
|
|
|
117
117
|
{
|
|
118
118
|
className: "space-y-4 px-6 pb-5 pt-3",
|
|
119
119
|
onSubmit: (e) => {
|
|
120
|
-
e.preventDefault(), !(!
|
|
120
|
+
e.preventDefault(), !(!j || C.current) && (C.current = !0, D.mutate());
|
|
121
121
|
},
|
|
122
122
|
children: [
|
|
123
123
|
S.length > 0 && /* @__PURE__ */ a("fieldset", { children: [
|
|
@@ -156,7 +156,7 @@ function ye({
|
|
|
156
156
|
"textarea",
|
|
157
157
|
{
|
|
158
158
|
"data-support-description": !0,
|
|
159
|
-
value:
|
|
159
|
+
value: T,
|
|
160
160
|
onChange: (e) => k(e.target.value),
|
|
161
161
|
rows: 5,
|
|
162
162
|
placeholder: "What should change, and why",
|
|
@@ -166,7 +166,7 @@ function ye({
|
|
|
166
166
|
] }),
|
|
167
167
|
/* @__PURE__ */ a("div", { children: [
|
|
168
168
|
/* @__PURE__ */ a("label", { className: "inline-flex cursor-pointer items-center gap-1.5 text-[12px] font-medium text-slate-600 hover:text-slate-900 dark:text-slate-300 dark:hover:text-slate-100", children: [
|
|
169
|
-
|
|
169
|
+
E ? /* @__PURE__ */ t(U, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ t(H, { className: "h-3.5 w-3.5" }),
|
|
170
170
|
"Attach files",
|
|
171
171
|
/* @__PURE__ */ t(
|
|
172
172
|
"input",
|
|
@@ -240,10 +240,10 @@ function ye({
|
|
|
240
240
|
{
|
|
241
241
|
type: "submit",
|
|
242
242
|
"data-support-send": !0,
|
|
243
|
-
disabled: !
|
|
243
|
+
disabled: !j,
|
|
244
244
|
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 disabled:opacity-50 dark:text-nvr-cyan",
|
|
245
245
|
children: [
|
|
246
|
-
D.isPending && /* @__PURE__ */ t(
|
|
246
|
+
D.isPending && /* @__PURE__ */ t(U, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
247
247
|
"Send request"
|
|
248
248
|
]
|
|
249
249
|
}
|
|
@@ -1,94 +1,95 @@
|
|
|
1
1
|
import { jsx as a, jsxs as r, Fragment as y } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Loader2 as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as G, useApiFetchConfig as M, useItemNavigation as
|
|
6
|
-
import { get as
|
|
7
|
-
import { useTopicPresence as
|
|
8
|
-
import { replayHref as
|
|
9
|
-
import { TaskDoButton as
|
|
10
|
-
import { RelationCombobox as
|
|
11
|
-
import { SimpleSelect as
|
|
12
|
-
import { Sheet as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
2
|
+
import { useQueryClient as H, useQuery as _, useMutation as f } from "@tanstack/react-query";
|
|
3
|
+
import { Loader2 as B, PlayCircle as W, Paperclip as z } from "lucide-react";
|
|
4
|
+
import { useState as q } from "react";
|
|
5
|
+
import { useNivaroClient as G, useApiFetchConfig as M, useItemNavigation as J, useNavigation as V } from "../../context.js";
|
|
6
|
+
import { get as T, post as C, patch as X } from "../../lib/commands.js";
|
|
7
|
+
import { useTopicPresence as Y, signalSentence as $ } from "../../lib/presence-signals.js";
|
|
8
|
+
import { replayHref as Z } from "../../lib/replay-capture.js";
|
|
9
|
+
import { TaskDoButton as I } from "../ai/TaskDo.js";
|
|
10
|
+
import { RelationCombobox as ee } from "../item-edit/RelationCombobox.js";
|
|
11
|
+
import { SimpleSelect as F } from "../ui/SimpleSelect.js";
|
|
12
|
+
import { Sheet as te, SheetContent as ae, SheetTitle as K, SheetDescription as R, SheetHeader as re } from "../ui/sheet.js";
|
|
13
|
+
import { isSupportContextFile as b } from "./support-context.js";
|
|
14
|
+
import { TicketTraffic as se } from "./TicketTraffic.js";
|
|
15
|
+
import { STATUS_TONE as P } from "./types.js";
|
|
16
|
+
const D = [
|
|
16
17
|
{ value: "open", label: "Open" },
|
|
17
18
|
{ value: "in_progress", label: "In progress" },
|
|
18
19
|
{ value: "done", label: "Done" },
|
|
19
20
|
{ value: "cancelled", label: "Cancelled" }
|
|
20
21
|
];
|
|
21
|
-
function
|
|
22
|
-
return
|
|
22
|
+
function k(s) {
|
|
23
|
+
return s ? new Date(s).toLocaleString(void 0, {
|
|
23
24
|
month: "short",
|
|
24
25
|
day: "numeric",
|
|
25
26
|
hour: "numeric",
|
|
26
27
|
minute: "2-digit"
|
|
27
28
|
}) : "";
|
|
28
29
|
}
|
|
29
|
-
function ne({ status:
|
|
30
|
+
function ne({ status: s, label: c }) {
|
|
30
31
|
var l;
|
|
31
32
|
return /* @__PURE__ */ a(
|
|
32
33
|
"span",
|
|
33
34
|
{
|
|
34
|
-
"data-ticket-status":
|
|
35
|
-
className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${
|
|
36
|
-
children: c ?? ((l =
|
|
35
|
+
"data-ticket-status": s,
|
|
36
|
+
className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${P[s] ?? P.open}`,
|
|
37
|
+
children: c ?? ((l = D.find((i) => i.value === s)) == null ? void 0 : l.label) ?? s
|
|
37
38
|
}
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
ticketId:
|
|
41
|
+
function ve({
|
|
42
|
+
ticketId: s,
|
|
42
43
|
onOpenChange: c
|
|
43
44
|
}) {
|
|
44
|
-
const l = G(), i =
|
|
45
|
-
|
|
46
|
-
),
|
|
45
|
+
const l = G(), i = H(), { apiBase: Q } = M(), { urlFor: j, open: A } = J(), p = V(), [m, v] = q(""), [N, U] = q(null), o = Y(
|
|
46
|
+
s != null && Number.isSafeInteger(s) && s > 0 ? `ticket:${s}` : null
|
|
47
|
+
), u = s != null && Number.isSafeInteger(s) && s > 0, {
|
|
47
48
|
data: e,
|
|
48
|
-
isLoading:
|
|
49
|
-
isError:
|
|
49
|
+
isLoading: L,
|
|
50
|
+
isError: E
|
|
50
51
|
} = _({
|
|
51
|
-
queryKey: ["support-ticket",
|
|
52
|
-
queryFn: () => l.request(
|
|
53
|
-
enabled:
|
|
54
|
-
retry: (t,
|
|
55
|
-
const g =
|
|
52
|
+
queryKey: ["support-ticket", s],
|
|
53
|
+
queryFn: () => l.request(T(`/support/tickets/${s}`)).then((t) => t.data),
|
|
54
|
+
enabled: u,
|
|
55
|
+
retry: (t, n) => {
|
|
56
|
+
const g = n == null ? void 0 : n.status;
|
|
56
57
|
return g !== 404 && g !== 403 && g !== 400 && t < 2;
|
|
57
58
|
}
|
|
58
|
-
}), { data:
|
|
59
|
+
}), { data: O = [] } = _({
|
|
59
60
|
queryKey: ["support-categories", "all-for", (e == null ? void 0 : e.collection) ?? null],
|
|
60
61
|
queryFn: () => l.request(
|
|
61
|
-
|
|
62
|
+
T("/support/categories", e != null && e.collection ? { collection: e.collection } : void 0)
|
|
62
63
|
).then((t) => t.data ?? []),
|
|
63
64
|
enabled: !!(e != null && e.can.work)
|
|
64
65
|
}), x = () => {
|
|
65
|
-
i.invalidateQueries({ queryKey: ["support-ticket",
|
|
66
|
-
}, h = (t) =>
|
|
67
|
-
mutationFn: () => l.request(
|
|
66
|
+
i.invalidateQueries({ queryKey: ["support-ticket", s] }), i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }), i.invalidateQueries({ queryKey: ["my-work"] });
|
|
67
|
+
}, h = (t) => U(t.message || "That did not work"), w = f({
|
|
68
|
+
mutationFn: () => l.request(C(`/support/tickets/${s}/claim`)),
|
|
68
69
|
onSuccess: x,
|
|
69
70
|
onError: h
|
|
70
71
|
}), d = f({
|
|
71
|
-
mutationFn: (t) => l.request(
|
|
72
|
+
mutationFn: (t) => l.request(X(`/support/tickets/${s}`, t)),
|
|
72
73
|
onSuccess: x,
|
|
73
74
|
onError: h
|
|
74
|
-
}),
|
|
75
|
-
mutationFn: () => l.request(
|
|
75
|
+
}), S = f({
|
|
76
|
+
mutationFn: () => l.request(C(`/support/tickets/${s}/comments`, { text: m.trim() })),
|
|
76
77
|
onSuccess: () => {
|
|
77
78
|
v(""), o.signalReplying(!1), x();
|
|
78
79
|
},
|
|
79
80
|
onError: h
|
|
80
81
|
});
|
|
81
|
-
return /* @__PURE__ */ a(
|
|
82
|
-
|
|
82
|
+
return /* @__PURE__ */ a(te, { open: s != null, onOpenChange: c, children: /* @__PURE__ */ a(
|
|
83
|
+
ae,
|
|
83
84
|
{
|
|
84
85
|
side: "right",
|
|
85
86
|
className: "flex w-[560px] max-w-[96vw] flex-col gap-0 p-0 sm:max-w-[560px] dark:bg-card",
|
|
86
|
-
"data-support-ticket":
|
|
87
|
-
children: !
|
|
87
|
+
"data-support-ticket": s ?? "",
|
|
88
|
+
children: !u || E ? /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col items-center justify-center gap-1 px-6 text-center", children: [
|
|
88
89
|
/* @__PURE__ */ a(K, { className: "text-[14px] font-semibold text-slate-800 dark:text-slate-100", children: "Request not found" }),
|
|
89
|
-
/* @__PURE__ */ a(
|
|
90
|
-
] }) :
|
|
91
|
-
/* @__PURE__ */ r(
|
|
90
|
+
/* @__PURE__ */ a(R, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: u ? `Request #${s} does not exist, or it is not one you can open.` : "This link does not point to a request." })
|
|
91
|
+
] }) : L || !e ? /* @__PURE__ */ a("div", { className: "flex flex-1 items-center justify-center text-slate-400", children: /* @__PURE__ */ a(B, { className: "h-5 w-5 animate-spin" }) }) : /* @__PURE__ */ r(y, { children: [
|
|
92
|
+
/* @__PURE__ */ r(re, { className: "space-y-1.5 border-b border-slate-200 px-5 py-4 text-left dark:border-border", children: [
|
|
92
93
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 pr-6", children: [
|
|
93
94
|
/* @__PURE__ */ r("span", { className: "font-mono text-[11.5px] text-slate-400", children: [
|
|
94
95
|
"#",
|
|
@@ -97,22 +98,22 @@ function be({
|
|
|
97
98
|
/* @__PURE__ */ a(ne, { status: e.status, label: e.status_label }),
|
|
98
99
|
e.priority === "urgent" && /* @__PURE__ */ a("span", { className: "rounded bg-red-500/10 px-1.5 py-px text-[10px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" })
|
|
99
100
|
] }),
|
|
100
|
-
/* @__PURE__ */ a(K, { className: "
|
|
101
|
-
/* @__PURE__ */ r(
|
|
101
|
+
/* @__PURE__ */ a(K, { className: "text-left text-[16px] font-semibold leading-snug text-slate-900 dark:text-slate-100", children: e.title }),
|
|
102
|
+
/* @__PURE__ */ r(R, { className: "text-left text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
102
103
|
e.requester_name ?? "Someone",
|
|
103
104
|
" · ",
|
|
104
|
-
|
|
105
|
+
k(e.created_at),
|
|
105
106
|
e.category_name ? ` · ${e.category_name}` : ""
|
|
106
107
|
] }),
|
|
107
|
-
/* @__PURE__ */ a("div", { className: "
|
|
108
|
+
/* @__PURE__ */ a("div", { className: "text-left text-[12px]", children: e.collection && e.item ? /* @__PURE__ */ a(
|
|
108
109
|
"a",
|
|
109
110
|
{
|
|
110
|
-
href:
|
|
111
|
+
href: j({ collection: e.collection, itemId: e.item }),
|
|
111
112
|
onClick: (t) => {
|
|
112
|
-
t.metaKey || t.ctrlKey || t.shiftKey || t.button !== 0 || (t.preventDefault(),
|
|
113
|
+
t.metaKey || t.ctrlKey || t.shiftKey || t.button !== 0 || (t.preventDefault(), A({ collection: e.collection, itemId: e.item }));
|
|
113
114
|
},
|
|
114
115
|
"data-ticket-record": !0,
|
|
115
|
-
className: "font-medium text-[#00789a] hover:
|
|
116
|
+
className: "inline-flex items-center gap-1 rounded-md bg-slate-100 px-2 py-0.5 font-medium text-[#00789a] hover:bg-slate-200/70 dark:bg-white/[0.06] dark:text-nvr-cyan dark:hover:bg-white/10",
|
|
116
117
|
children: e.record_label ?? e.item
|
|
117
118
|
}
|
|
118
119
|
) : /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-muted-foreground", children: "General Support" }) }),
|
|
@@ -123,7 +124,7 @@ function be({
|
|
|
123
124
|
"data-ticket-viewing": !0,
|
|
124
125
|
children: [
|
|
125
126
|
/* @__PURE__ */ a("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-sky-400" }),
|
|
126
|
-
|
|
127
|
+
$(
|
|
127
128
|
o.viewers.map((t) => t.name),
|
|
128
129
|
"looking at this"
|
|
129
130
|
)
|
|
@@ -131,15 +132,15 @@ function be({
|
|
|
131
132
|
}
|
|
132
133
|
)
|
|
133
134
|
] }),
|
|
134
|
-
/* @__PURE__ */ r("div", { className: "flex-1 space-y-
|
|
135
|
+
/* @__PURE__ */ r("div", { className: "flex-1 space-y-6 overflow-y-auto px-5 py-5", children: [
|
|
135
136
|
e.can.work && /* @__PURE__ */ r(
|
|
136
137
|
"div",
|
|
137
138
|
{
|
|
138
139
|
"data-ticket-controls": !0,
|
|
139
|
-
className: "grid grid-cols-2 gap-3 rounded-lg border border-slate-200 p-
|
|
140
|
+
className: "grid grid-cols-2 gap-x-3 gap-y-3.5 rounded-lg border border-slate-200/80 bg-slate-50/70 p-4 dark:border-border dark:bg-white/[0.03]",
|
|
140
141
|
children: [
|
|
141
|
-
/* @__PURE__ */ r("div", { className: "col-span-2 flex items-center
|
|
142
|
-
/* @__PURE__ */ a("span", { className: "text-[
|
|
142
|
+
/* @__PURE__ */ r("div", { className: "col-span-2 flex items-center gap-2", children: [
|
|
143
|
+
/* @__PURE__ */ a("span", { className: "mr-auto text-[12.5px] text-slate-600 dark:text-slate-300", children: e.assignee_name ? /* @__PURE__ */ r(y, { children: [
|
|
143
144
|
"Assigned to ",
|
|
144
145
|
/* @__PURE__ */ a("b", { className: "font-medium", children: e.assignee_name })
|
|
145
146
|
] }) : /* @__PURE__ */ r(y, { children: [
|
|
@@ -147,7 +148,7 @@ function be({
|
|
|
147
148
|
e.team_name ? ` · ${e.team_name}` : " · Administrators"
|
|
148
149
|
] }) }),
|
|
149
150
|
/* @__PURE__ */ a(
|
|
150
|
-
|
|
151
|
+
I,
|
|
151
152
|
{
|
|
152
153
|
task: {
|
|
153
154
|
id: e.id,
|
|
@@ -157,7 +158,7 @@ function be({
|
|
|
157
158
|
category_id: e.category_id,
|
|
158
159
|
title: e.title
|
|
159
160
|
},
|
|
160
|
-
onTaskChanged: () => void i.invalidateQueries({ queryKey: ["support-ticket",
|
|
161
|
+
onTaskChanged: () => void i.invalidateQueries({ queryKey: ["support-ticket", s] })
|
|
161
162
|
}
|
|
162
163
|
),
|
|
163
164
|
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ a(
|
|
@@ -165,46 +166,46 @@ function be({
|
|
|
165
166
|
{
|
|
166
167
|
type: "button",
|
|
167
168
|
"data-ticket-claim": !0,
|
|
168
|
-
disabled:
|
|
169
|
-
onClick: () =>
|
|
169
|
+
disabled: w.isPending,
|
|
170
|
+
onClick: () => w.mutate(),
|
|
170
171
|
className: "h-7 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-2.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/15 disabled:opacity-50 dark:text-nvr-cyan",
|
|
171
172
|
children: e.assignee ? "Take it over" : "Pick it up"
|
|
172
173
|
}
|
|
173
174
|
)
|
|
174
175
|
] }),
|
|
175
|
-
/* @__PURE__ */ r("div", { className: "block text-[
|
|
176
|
+
/* @__PURE__ */ r("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
176
177
|
"Status",
|
|
177
178
|
/* @__PURE__ */ a(
|
|
178
|
-
|
|
179
|
+
F,
|
|
179
180
|
{
|
|
180
181
|
value: e.status,
|
|
181
182
|
onChange: (t) => d.mutate({ status: t }),
|
|
182
|
-
options:
|
|
183
|
+
options: D,
|
|
183
184
|
ariaLabel: "Status",
|
|
184
185
|
className: "mt-1"
|
|
185
186
|
}
|
|
186
187
|
)
|
|
187
188
|
] }),
|
|
188
|
-
/* @__PURE__ */ r("div", { className: "block text-[
|
|
189
|
+
/* @__PURE__ */ r("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
189
190
|
"Type",
|
|
190
191
|
/* @__PURE__ */ a(
|
|
191
|
-
|
|
192
|
+
F,
|
|
192
193
|
{
|
|
193
194
|
value: e.category_id != null ? String(e.category_id) : "",
|
|
194
195
|
onChange: (t) => d.mutate({ category_id: t ? Number(t) : null }),
|
|
195
196
|
options: [
|
|
196
197
|
{ value: "", label: "No type" },
|
|
197
|
-
...
|
|
198
|
+
...O.map((t) => ({ value: String(t.id), label: t.name }))
|
|
198
199
|
],
|
|
199
200
|
ariaLabel: "Type",
|
|
200
201
|
className: "mt-1"
|
|
201
202
|
}
|
|
202
203
|
)
|
|
203
204
|
] }),
|
|
204
|
-
/* @__PURE__ */ r("div", { className: "col-span-2 text-[
|
|
205
|
+
/* @__PURE__ */ r("div", { className: "col-span-2 text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
205
206
|
"Assignee",
|
|
206
207
|
/* @__PURE__ */ a("div", { className: "mt-1", children: /* @__PURE__ */ a(
|
|
207
|
-
|
|
208
|
+
ee,
|
|
208
209
|
{
|
|
209
210
|
collection: "nivaro_users",
|
|
210
211
|
value: e.assignee,
|
|
@@ -217,31 +218,31 @@ function be({
|
|
|
217
218
|
}
|
|
218
219
|
),
|
|
219
220
|
/* @__PURE__ */ r("section", { children: [
|
|
220
|
-
/* @__PURE__ */ a("h3", { className: "mb-
|
|
221
|
+
/* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Request" }),
|
|
221
222
|
/* @__PURE__ */ a("p", { className: "whitespace-pre-wrap text-[13px] leading-relaxed text-slate-800 dark:text-slate-200", children: e.description || /* @__PURE__ */ a("span", { className: "text-slate-400", children: "No details given." }) }),
|
|
222
223
|
e.replay && e.can.work && (() => {
|
|
223
|
-
const t =
|
|
224
|
-
return
|
|
224
|
+
const t = Z(e.replay), n = p.consoleUrl ? p.consoleUrl(t) : t;
|
|
225
|
+
return n ? /* @__PURE__ */ r(
|
|
225
226
|
"a",
|
|
226
227
|
{
|
|
227
|
-
href:
|
|
228
|
+
href: n,
|
|
228
229
|
target: "_blank",
|
|
229
230
|
rel: "noreferrer",
|
|
230
231
|
"data-ticket-replay": e.replay.recording_id,
|
|
231
232
|
className: "mt-2 inline-flex items-center gap-1.5 rounded-md border border-nvr-cyan/50 bg-nvr-cyan/10 px-2 py-1 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
232
233
|
children: [
|
|
233
234
|
/* @__PURE__ */ a(W, { className: "h-3.5 w-3.5" }),
|
|
234
|
-
"
|
|
235
|
+
"Replay their screen"
|
|
235
236
|
]
|
|
236
237
|
}
|
|
237
238
|
) : null;
|
|
238
239
|
})(),
|
|
239
240
|
e.issue_id != null && e.can.work && (() => {
|
|
240
|
-
const t = `/issues/${e.issue_id}`,
|
|
241
|
-
return
|
|
241
|
+
const t = `/issues/${e.issue_id}`, n = p.consoleUrl ? p.consoleUrl(t) : t;
|
|
242
|
+
return n ? /* @__PURE__ */ r(
|
|
242
243
|
"a",
|
|
243
244
|
{
|
|
244
|
-
href:
|
|
245
|
+
href: n,
|
|
245
246
|
target: "_blank",
|
|
246
247
|
rel: "noreferrer",
|
|
247
248
|
"data-ticket-issue": e.issue_id,
|
|
@@ -253,31 +254,35 @@ function be({
|
|
|
253
254
|
}
|
|
254
255
|
) : null;
|
|
255
256
|
})(),
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
{
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
257
|
+
(() => {
|
|
258
|
+
const t = e.files.filter((n) => e.can.work || !b(n));
|
|
259
|
+
return t.length === 0 ? null : /* @__PURE__ */ a("ul", { className: "mt-2 flex flex-wrap gap-1.5", children: t.map((n) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ r(
|
|
260
|
+
"a",
|
|
261
|
+
{
|
|
262
|
+
href: `${Q}/files/${n.id}`,
|
|
263
|
+
target: "_blank",
|
|
264
|
+
rel: "noreferrer",
|
|
265
|
+
"data-tip": b(n) ? "The page they were on, browser errors and their last 20 requests when they asked" : void 0,
|
|
266
|
+
className: "inline-flex items-center gap-1 rounded bg-slate-100 px-2 py-0.5 text-[11.5px] text-slate-700 hover:underline dark:bg-white/10 dark:text-slate-200",
|
|
267
|
+
children: [
|
|
268
|
+
/* @__PURE__ */ a(z, { className: "h-3 w-3" }),
|
|
269
|
+
b(n) ? "Technical details" : n.title || n.filename_download || "File"
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
) }, n.id)) });
|
|
273
|
+
})()
|
|
269
274
|
] }),
|
|
270
|
-
e.can.work && /* @__PURE__ */ a(
|
|
275
|
+
e.can.work && /* @__PURE__ */ a(se, { ticketId: e.id }),
|
|
271
276
|
/* @__PURE__ */ r("section", { "data-ticket-thread": !0, children: [
|
|
272
|
-
/* @__PURE__ */ a("h3", { className: "mb-2 text-[
|
|
273
|
-
e.thread.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[
|
|
277
|
+
/* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Conversation" }),
|
|
278
|
+
e.thread.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No replies yet." }) : /* @__PURE__ */ a("ul", { className: "space-y-2.5", children: e.thread.map((t) => /* @__PURE__ */ r(
|
|
274
279
|
"li",
|
|
275
280
|
{
|
|
276
281
|
className: t.from_requester ? "rounded-lg bg-slate-50 px-3 py-2 dark:bg-white/5" : "rounded-lg border border-nvr-cyan/30 bg-nvr-cyan/5 px-3 py-2",
|
|
277
282
|
children: [
|
|
278
283
|
/* @__PURE__ */ r("div", { className: "mb-0.5 flex items-baseline justify-between gap-2 text-[11.5px]", children: [
|
|
279
284
|
/* @__PURE__ */ a("b", { className: "font-medium text-slate-800 dark:text-slate-100", children: t.user_name ?? "Someone" }),
|
|
280
|
-
/* @__PURE__ */ a("span", { className: "text-slate-400", children:
|
|
285
|
+
/* @__PURE__ */ a("span", { className: "text-slate-400", children: k(t.created_at) })
|
|
281
286
|
] }),
|
|
282
287
|
/* @__PURE__ */ a("p", { className: "whitespace-pre-wrap text-[12.5px] text-slate-700 dark:text-slate-200", children: t.text })
|
|
283
288
|
]
|
|
@@ -289,20 +294,20 @@ function be({
|
|
|
289
294
|
{
|
|
290
295
|
className: "mt-3",
|
|
291
296
|
onSubmit: (t) => {
|
|
292
|
-
t.preventDefault(),
|
|
297
|
+
t.preventDefault(), m.trim() && S.mutate();
|
|
293
298
|
},
|
|
294
299
|
children: [
|
|
295
300
|
/* @__PURE__ */ a(
|
|
296
301
|
"textarea",
|
|
297
302
|
{
|
|
298
303
|
"data-ticket-reply": !0,
|
|
299
|
-
value:
|
|
304
|
+
value: m,
|
|
300
305
|
onChange: (t) => {
|
|
301
306
|
v(t.target.value), o.signalReplying(!!t.target.value.trim());
|
|
302
307
|
},
|
|
303
308
|
rows: 3,
|
|
304
309
|
placeholder: "Write a reply",
|
|
305
|
-
className: "w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-[12.5px] text-slate-900 outline-none focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100"
|
|
310
|
+
className: "min-h-[76px] w-full resize-y rounded-md border border-slate-200 bg-white px-3 py-2 text-[12.5px] text-slate-900 outline-none placeholder:text-slate-400 focus:border-nvr-cyan focus:ring-2 focus:ring-nvr-cyan/20 dark:border-border dark:bg-background dark:text-slate-100"
|
|
306
311
|
}
|
|
307
312
|
),
|
|
308
313
|
o.replying.length > 0 && /* @__PURE__ */ r(
|
|
@@ -312,12 +317,12 @@ function be({
|
|
|
312
317
|
"data-ticket-replying": !0,
|
|
313
318
|
children: [
|
|
314
319
|
/* @__PURE__ */ a("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
|
|
315
|
-
|
|
320
|
+
$(o.replying, "replying"),
|
|
316
321
|
"…"
|
|
317
322
|
]
|
|
318
323
|
}
|
|
319
324
|
),
|
|
320
|
-
/* @__PURE__ */ r("div", { className: "mt-
|
|
325
|
+
/* @__PURE__ */ r("div", { className: "mt-2 flex items-center justify-end gap-2", children: [
|
|
321
326
|
e.can.cancel && !e.can.work && /* @__PURE__ */ a(
|
|
322
327
|
"button",
|
|
323
328
|
{
|
|
@@ -343,8 +348,8 @@ function be({
|
|
|
343
348
|
{
|
|
344
349
|
type: "submit",
|
|
345
350
|
"data-ticket-send": !0,
|
|
346
|
-
disabled: !
|
|
347
|
-
className: "h-
|
|
351
|
+
disabled: !m.trim() || S.isPending,
|
|
352
|
+
className: "h-8 rounded-md bg-nvr-cyan px-3.5 text-[12.5px] font-medium text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",
|
|
348
353
|
children: "Reply"
|
|
349
354
|
}
|
|
350
355
|
)
|
|
@@ -352,18 +357,18 @@ function be({
|
|
|
352
357
|
]
|
|
353
358
|
}
|
|
354
359
|
),
|
|
355
|
-
|
|
360
|
+
N && /* @__PURE__ */ a("p", { className: "mt-1 text-[12px] text-red-600 dark:text-red-400", role: "alert", children: N })
|
|
356
361
|
] }),
|
|
357
362
|
/* @__PURE__ */ r("section", { "data-ticket-history": !0, children: [
|
|
358
|
-
/* @__PURE__ */ a("h3", { className: "mb-2 text-[
|
|
359
|
-
/* @__PURE__ */ a("ol", { className: "space-y-
|
|
363
|
+
/* @__PURE__ */ a("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "History" }),
|
|
364
|
+
/* @__PURE__ */ a("ol", { className: "space-y-2 border-l border-slate-200 pl-3.5 dark:border-border", children: e.history.map((t) => /* @__PURE__ */ r("li", { className: "text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
360
365
|
/* @__PURE__ */ a("span", { className: "text-slate-800 dark:text-slate-100", children: t.text }),
|
|
361
|
-
/* @__PURE__ */ r("span", { className: "text-slate-400", children: [
|
|
366
|
+
/* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
362
367
|
" ",
|
|
363
368
|
"· ",
|
|
364
369
|
t.user_name ?? "System",
|
|
365
370
|
" · ",
|
|
366
|
-
|
|
371
|
+
k(t.at)
|
|
367
372
|
] })
|
|
368
373
|
] }, t.id)) })
|
|
369
374
|
] })
|
|
@@ -374,5 +379,5 @@ function be({
|
|
|
374
379
|
}
|
|
375
380
|
export {
|
|
376
381
|
ne as StatusPill,
|
|
377
|
-
|
|
382
|
+
ve as TicketDetailSheet
|
|
378
383
|
};
|