@nivaro/react 0.3.128 → 0.3.129
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/slots/CommentsSlot.js +124 -95
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/ItemEditForm.js +2187 -2158
- package/dist/shared/components/ai/AiMarkdown.js +215 -196
- package/dist/shared/components/item-edit/HeaderTools.js +216 -210
- package/dist/shared/components/panels/CommentPanel.js +345 -327
- package/dist/shared/components/support/TicketDetailSheet.js +161 -139
- package/dist/shared/components/trackers/MirroredText.js +40 -0
- package/dist/shared/components/trackers/SourceTracker.js +168 -0
- package/dist/shared/components/trackers/TrackerChip.js +71 -0
- package/dist/shared/components/trackers/TrackerLinkPanel.js +1039 -0
- package/dist/shared/components/trackers/TrackerPickers.js +245 -0
- package/dist/shared/components/trackers/tracker-model.js +126 -0
- package/dist/shared/components/trackers/use-tracker-link.js +159 -0
- package/package.json +1 -1
|
@@ -1,157 +1,164 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Loader2 as
|
|
4
|
-
import { useState as v, useEffect as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as R, post as
|
|
7
|
-
import { useLiveFade as
|
|
8
|
-
import { useBackgroundArm as
|
|
9
|
-
import { useTopicPresence as
|
|
10
|
-
import { replayHref as
|
|
11
|
-
import { foldShareHistory as
|
|
12
|
-
import { TaskDoButton as
|
|
1
|
+
import { jsx as r, jsxs as n, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as X, useQuery as $, useMutation as k } from "@tanstack/react-query";
|
|
3
|
+
import { Loader2 as Y, PlayCircle as Z, Paperclip as I } from "lucide-react";
|
|
4
|
+
import { useState as v, useEffect as ee } from "react";
|
|
5
|
+
import { useNivaroClient as te, useApiFetchConfig as re, useItemNavigation as ae, useNavigation as ne } from "../../context.js";
|
|
6
|
+
import { get as R, post as F, patch as se } from "../../lib/commands.js";
|
|
7
|
+
import { useLiveFade as le } from "../../lib/live-screen.js";
|
|
8
|
+
import { useBackgroundArm as ie } from "../../lib/live-views.js";
|
|
9
|
+
import { useTopicPresence as oe, signalSentence as A } from "../../lib/presence-signals.js";
|
|
10
|
+
import { replayHref as de } from "../../lib/replay-capture.js";
|
|
11
|
+
import { foldShareHistory as ce, historyLine as ue } from "../../lib/screen-share.js";
|
|
12
|
+
import { TaskDoButton as me } from "../ai/TaskDo.js";
|
|
13
13
|
import { RelationCombobox as pe } from "../item-edit/RelationCombobox.js";
|
|
14
|
+
import { MirroredAuthor as xe, MirroredBody as he, GitlabSharedNotice as ge } from "../trackers/MirroredText.js";
|
|
15
|
+
import { TicketTrackerSection as fe } from "../trackers/SourceTracker.js";
|
|
16
|
+
import { TrackerChip as ye } from "../trackers/TrackerChip.js";
|
|
17
|
+
import { useSourceTracker as be } from "../trackers/use-tracker-link.js";
|
|
14
18
|
import { SimpleSelect as K } from "../ui/SimpleSelect.js";
|
|
15
|
-
import { Sheet as
|
|
16
|
-
import { ScreenSharePanel as
|
|
17
|
-
import { isSupportContextFile as
|
|
18
|
-
import { TicketSlowScreens as
|
|
19
|
-
import { TicketTraffic as
|
|
20
|
-
import { STATUS_TONE as
|
|
21
|
-
const
|
|
19
|
+
import { Sheet as ke, SheetContent as ve, SheetTitle as P, SheetDescription as D, SheetHeader as Ne } from "../ui/sheet.js";
|
|
20
|
+
import { ScreenSharePanel as we } from "./ScreenShare.js";
|
|
21
|
+
import { isSupportContextFile as N } from "./support-context.js";
|
|
22
|
+
import { TicketSlowScreens as Se } from "./TicketSlowScreens.js";
|
|
23
|
+
import { TicketTraffic as _e } from "./TicketTraffic.js";
|
|
24
|
+
import { STATUS_TONE as L } from "./types.js";
|
|
25
|
+
const U = [
|
|
22
26
|
{ value: "open", label: "Open" },
|
|
23
27
|
{ value: "in_progress", label: "In progress" },
|
|
24
28
|
{ value: "done", label: "Done" },
|
|
25
29
|
{ value: "cancelled", label: "Cancelled" }
|
|
26
30
|
];
|
|
27
|
-
function
|
|
28
|
-
return
|
|
31
|
+
function w(a) {
|
|
32
|
+
return a ? new Date(a).toLocaleString(void 0, {
|
|
29
33
|
month: "short",
|
|
30
34
|
day: "numeric",
|
|
31
35
|
hour: "numeric",
|
|
32
36
|
minute: "2-digit"
|
|
33
37
|
}) : "";
|
|
34
38
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
39
|
+
const O = "mt-1 h-9 w-full min-w-0 gap-2 rounded-md border-slate-200 bg-white px-3 text-[13px] font-normal text-slate-900 dark:border-border dark:bg-card dark:text-slate-100 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:truncate [&>span]:text-left [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0", qe = "mt-1 font-normal [&>div>button]:h-9 [&>div>button]:border-slate-200 [&>div>button]:bg-white [&>div>button]:text-[13px] [&>div>button]:text-slate-900 dark:[&>div>button]:border-border dark:[&>div>button]:bg-card dark:[&>div>button]:text-slate-100";
|
|
40
|
+
function Te({ status: a, label: o }) {
|
|
37
41
|
var l;
|
|
38
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ r(
|
|
39
43
|
"span",
|
|
40
44
|
{
|
|
41
|
-
"data-ticket-status":
|
|
42
|
-
className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${
|
|
43
|
-
children: o ?? ((l =
|
|
45
|
+
"data-ticket-status": a,
|
|
46
|
+
className: `inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${L[a] ?? L.open}`,
|
|
47
|
+
children: o ?? ((l = U.find((i) => i.value === a)) == null ? void 0 : l.label) ?? a
|
|
44
48
|
}
|
|
45
49
|
);
|
|
46
50
|
}
|
|
47
|
-
function
|
|
48
|
-
return o == null ? "" :
|
|
51
|
+
function Ce(a, o) {
|
|
52
|
+
return o == null ? "" : a[String(o)] ?? "";
|
|
49
53
|
}
|
|
50
|
-
function
|
|
51
|
-
if (o == null) return
|
|
54
|
+
function $e(a, o, l) {
|
|
55
|
+
if (o == null) return a;
|
|
52
56
|
const i = String(o);
|
|
53
57
|
if (!l) {
|
|
54
|
-
if (!(i in
|
|
55
|
-
const
|
|
56
|
-
return delete
|
|
58
|
+
if (!(i in a)) return a;
|
|
59
|
+
const m = { ...a };
|
|
60
|
+
return delete m[i], m;
|
|
57
61
|
}
|
|
58
|
-
return { ...
|
|
62
|
+
return { ...a, [i]: l };
|
|
59
63
|
}
|
|
60
|
-
function
|
|
61
|
-
ticketId:
|
|
64
|
+
function et({
|
|
65
|
+
ticketId: a,
|
|
62
66
|
onOpenChange: o
|
|
63
67
|
}) {
|
|
64
|
-
const l =
|
|
65
|
-
|
|
66
|
-
const [H, W] = v(!1), d =
|
|
67
|
-
|
|
68
|
-
), h =
|
|
68
|
+
const l = te(), i = X(), { apiBase: m } = re(), { urlFor: Q, open: j } = ae(), p = ne(), [E, B] = v({}), x = Ce(E, a), S = (t, s = a) => B((u) => $e(u, s, t)), [_, q] = v(null);
|
|
69
|
+
ee(() => q(null), [a]);
|
|
70
|
+
const [H, W] = v(!1), d = oe(
|
|
71
|
+
a != null && Number.isSafeInteger(a) && a > 0 ? `ticket:${a}` : null
|
|
72
|
+
), h = a != null && Number.isSafeInteger(a) && a > 0, {
|
|
69
73
|
data: e,
|
|
70
|
-
isLoading:
|
|
71
|
-
isError:
|
|
72
|
-
dataUpdatedAt:
|
|
73
|
-
} =
|
|
74
|
-
queryKey: ["support-ticket",
|
|
75
|
-
queryFn: () => l.request(R(`/support/tickets/${
|
|
74
|
+
isLoading: M,
|
|
75
|
+
isError: G,
|
|
76
|
+
dataUpdatedAt: z
|
|
77
|
+
} = $({
|
|
78
|
+
queryKey: ["support-ticket", a],
|
|
79
|
+
queryFn: () => l.request(R(`/support/tickets/${a}`)).then((t) => t.data),
|
|
76
80
|
enabled: h,
|
|
77
81
|
retry: (t, s) => {
|
|
78
82
|
const u = s == null ? void 0 : s.status;
|
|
79
83
|
return u !== 404 && u !== 403 && u !== 400 && t < 2;
|
|
80
84
|
}
|
|
81
|
-
}),
|
|
85
|
+
}), g = be(e ? { kind: "ticket", id: String(e.id) } : null, {
|
|
86
|
+
mayCreate: !!(e != null && e.can.work)
|
|
87
|
+
}), J = le(ie(z, String(a))), { data: V = [] } = $({
|
|
82
88
|
queryKey: ["support-categories", "all-for", (e == null ? void 0 : e.collection) ?? null],
|
|
83
89
|
queryFn: () => l.request(
|
|
84
90
|
R("/support/categories", e != null && e.collection ? { collection: e.collection } : void 0)
|
|
85
91
|
).then((t) => t.data ?? []),
|
|
86
92
|
enabled: !!(e != null && e.can.work)
|
|
87
|
-
}),
|
|
88
|
-
i.invalidateQueries({ queryKey: ["support-ticket",
|
|
89
|
-
},
|
|
90
|
-
mutationFn: () => l.request(
|
|
91
|
-
onSuccess:
|
|
92
|
-
onError:
|
|
93
|
-
}), c =
|
|
94
|
-
mutationFn: (t) => l.request(
|
|
95
|
-
onSuccess:
|
|
96
|
-
onError:
|
|
97
|
-
}),
|
|
98
|
-
mutationFn: (t) => l.request(
|
|
93
|
+
}), f = () => {
|
|
94
|
+
i.invalidateQueries({ queryKey: ["support-ticket", a] }), i.invalidateQueries({ queryKey: ["support-tickets"] }), i.invalidateQueries({ queryKey: ["support-summary"] }), i.invalidateQueries({ queryKey: ["my-work"] });
|
|
95
|
+
}, y = (t) => q(t.message || "That did not work"), T = k({
|
|
96
|
+
mutationFn: () => l.request(F(`/support/tickets/${a}/claim`)),
|
|
97
|
+
onSuccess: f,
|
|
98
|
+
onError: y
|
|
99
|
+
}), c = k({
|
|
100
|
+
mutationFn: (t) => l.request(se(`/support/tickets/${a}`, t)),
|
|
101
|
+
onSuccess: f,
|
|
102
|
+
onError: y
|
|
103
|
+
}), C = k({
|
|
104
|
+
mutationFn: (t) => l.request(F(`/support/tickets/${t.id}/comments`, { text: t.text })),
|
|
99
105
|
onSuccess: (t, s) => {
|
|
100
|
-
|
|
106
|
+
S("", s.id), d.signalReplying(!1), f();
|
|
101
107
|
},
|
|
102
|
-
onError:
|
|
108
|
+
onError: y
|
|
103
109
|
});
|
|
104
|
-
return /* @__PURE__ */
|
|
105
|
-
|
|
110
|
+
return /* @__PURE__ */ r(ke, { open: a != null, onOpenChange: o, children: /* @__PURE__ */ r(
|
|
111
|
+
ve,
|
|
106
112
|
{
|
|
107
113
|
side: "right",
|
|
108
|
-
ref:
|
|
114
|
+
ref: J,
|
|
109
115
|
className: `flex max-w-[96vw] flex-col gap-0 p-0 outline-none focus:outline-none transition-[width] duration-300 ease-out dark:bg-card ${H ? "w-[min(1280px,96vw)] sm:max-w-[min(1280px,96vw)]" : "w-[560px] sm:max-w-[560px]"}`,
|
|
110
|
-
"data-support-ticket":
|
|
116
|
+
"data-support-ticket": a ?? "",
|
|
111
117
|
onOpenAutoFocus: (t) => {
|
|
112
118
|
var s;
|
|
113
119
|
t.preventDefault(), (s = t.currentTarget) == null || s.focus({ preventScroll: !0 });
|
|
114
120
|
},
|
|
115
|
-
children: !h ||
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
] }) :
|
|
119
|
-
/* @__PURE__ */ n(
|
|
121
|
+
children: !h || G ? /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col items-center justify-center gap-1 px-6 text-center", children: [
|
|
122
|
+
/* @__PURE__ */ r(P, { className: "text-[14px] font-semibold text-slate-800 dark:text-slate-100", children: "Request not found" }),
|
|
123
|
+
/* @__PURE__ */ r(D, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: h ? `Request #${a} does not exist, or it is not one you can open.` : "This link does not point to a request." })
|
|
124
|
+
] }) : M || !e ? /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center text-slate-400", children: /* @__PURE__ */ r(Y, { className: "h-5 w-5 animate-spin" }) }) : /* @__PURE__ */ n(b, { children: [
|
|
125
|
+
/* @__PURE__ */ n(Ne, { className: "space-y-1.5 border-b border-slate-200 px-5 py-4 text-left dark:border-border", children: [
|
|
120
126
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 pr-6", children: [
|
|
121
127
|
/* @__PURE__ */ n("span", { className: "font-mono text-[11.5px] text-slate-400", children: [
|
|
122
128
|
"#",
|
|
123
129
|
e.id
|
|
124
130
|
] }),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
e.priority === "urgent" && /* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ r(Te, { status: e.status, label: e.status_label }),
|
|
132
|
+
e.priority === "urgent" && /* @__PURE__ */ r("span", { className: "rounded-full bg-red-500/10 px-2 py-0.5 text-[11px] font-medium text-red-600 dark:text-red-400", children: "Urgent" }),
|
|
133
|
+
g.shown.map((t) => /* @__PURE__ */ r(ye, { tracker: t }, `${t.web_url}:${t.iid}`))
|
|
127
134
|
] }),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */ n(
|
|
135
|
+
/* @__PURE__ */ r(P, { className: "text-left text-[16px] font-semibold leading-snug text-slate-900 dark:text-slate-100", children: e.title }),
|
|
136
|
+
/* @__PURE__ */ n(D, { className: "text-left text-[12px] text-slate-500 dark:text-muted-foreground", children: [
|
|
130
137
|
e.requester_name ?? "Someone",
|
|
131
138
|
" · ",
|
|
132
|
-
|
|
139
|
+
w(e.created_at),
|
|
133
140
|
e.category_name ? ` · ${e.category_name}` : ""
|
|
134
141
|
] }),
|
|
135
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ r("div", { className: "text-left text-[12px]", children: e.collection && e.item ? /* @__PURE__ */ r(
|
|
136
143
|
"a",
|
|
137
144
|
{
|
|
138
|
-
href:
|
|
145
|
+
href: Q({ collection: e.collection, itemId: e.item }),
|
|
139
146
|
onClick: (t) => {
|
|
140
|
-
t.metaKey || t.ctrlKey || t.shiftKey || t.button !== 0 || (t.preventDefault(),
|
|
147
|
+
t.metaKey || t.ctrlKey || t.shiftKey || t.button !== 0 || (t.preventDefault(), j({ collection: e.collection, itemId: e.item }));
|
|
141
148
|
},
|
|
142
149
|
"data-ticket-record": !0,
|
|
143
150
|
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",
|
|
144
151
|
children: e.record_label ?? e.item
|
|
145
152
|
}
|
|
146
|
-
) : /* @__PURE__ */
|
|
153
|
+
) : /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-muted-foreground", children: "General Support" }) }),
|
|
147
154
|
d.viewers.length > 0 && /* @__PURE__ */ n(
|
|
148
155
|
"p",
|
|
149
156
|
{
|
|
150
157
|
className: "mt-1 flex items-center gap-1.5 text-[11.5px] text-sky-700 dark:text-sky-300",
|
|
151
158
|
"data-ticket-viewing": !0,
|
|
152
159
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
160
|
+
/* @__PURE__ */ r("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-sky-400" }),
|
|
161
|
+
A(
|
|
155
162
|
d.viewers.map((t) => t.name),
|
|
156
163
|
"looking at this"
|
|
157
164
|
)
|
|
@@ -167,15 +174,15 @@ function We({
|
|
|
167
174
|
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.04]",
|
|
168
175
|
children: [
|
|
169
176
|
/* @__PURE__ */ n("div", { className: "col-span-2 flex items-center gap-2", children: [
|
|
170
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ r("span", { className: "mr-auto text-[12.5px] text-slate-600 dark:text-slate-300", children: e.assignee_name ? /* @__PURE__ */ n(b, { children: [
|
|
171
178
|
"Assigned to ",
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
] }) : /* @__PURE__ */ n(
|
|
179
|
+
/* @__PURE__ */ r("b", { className: "font-medium", children: e.assignee_name })
|
|
180
|
+
] }) : /* @__PURE__ */ n(b, { children: [
|
|
174
181
|
"Not picked up yet",
|
|
175
182
|
e.team_name ? ` · ${e.team_name}` : " · Administrators"
|
|
176
183
|
] }) }),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
184
|
+
/* @__PURE__ */ r(
|
|
185
|
+
me,
|
|
179
186
|
{
|
|
180
187
|
task: {
|
|
181
188
|
id: e.id,
|
|
@@ -185,16 +192,16 @@ function We({
|
|
|
185
192
|
category_id: e.category_id,
|
|
186
193
|
title: e.title
|
|
187
194
|
},
|
|
188
|
-
onTaskChanged: () => void i.invalidateQueries({ queryKey: ["support-ticket",
|
|
195
|
+
onTaskChanged: () => void i.invalidateQueries({ queryKey: ["support-ticket", a] })
|
|
189
196
|
}
|
|
190
197
|
),
|
|
191
|
-
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */
|
|
198
|
+
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ r(
|
|
192
199
|
"button",
|
|
193
200
|
{
|
|
194
201
|
type: "button",
|
|
195
202
|
"data-ticket-claim": !0,
|
|
196
|
-
disabled:
|
|
197
|
-
onClick: () =>
|
|
203
|
+
disabled: T.isPending,
|
|
204
|
+
onClick: () => T.mutate(),
|
|
198
205
|
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",
|
|
199
206
|
children: e.assignee ? "Take it over" : "Pick it up"
|
|
200
207
|
}
|
|
@@ -202,36 +209,36 @@ function We({
|
|
|
202
209
|
] }),
|
|
203
210
|
/* @__PURE__ */ n("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
204
211
|
"Status",
|
|
205
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ r(
|
|
206
213
|
K,
|
|
207
214
|
{
|
|
208
215
|
value: e.status,
|
|
209
216
|
onChange: (t) => c.mutate({ status: t }),
|
|
210
|
-
options:
|
|
217
|
+
options: U,
|
|
211
218
|
ariaLabel: "Status",
|
|
212
|
-
className:
|
|
219
|
+
className: O
|
|
213
220
|
}
|
|
214
221
|
)
|
|
215
222
|
] }),
|
|
216
223
|
/* @__PURE__ */ n("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
217
224
|
"Type",
|
|
218
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ r(
|
|
219
226
|
K,
|
|
220
227
|
{
|
|
221
228
|
value: e.category_id != null ? String(e.category_id) : "",
|
|
222
229
|
onChange: (t) => c.mutate({ category_id: t ? Number(t) : null }),
|
|
223
230
|
options: [
|
|
224
231
|
{ value: "", label: "No type" },
|
|
225
|
-
...
|
|
232
|
+
...V.map((t) => ({ value: String(t.id), label: t.name }))
|
|
226
233
|
],
|
|
227
234
|
ariaLabel: "Type",
|
|
228
|
-
className:
|
|
235
|
+
className: O
|
|
229
236
|
}
|
|
230
237
|
)
|
|
231
238
|
] }),
|
|
232
239
|
/* @__PURE__ */ n("div", { className: "col-span-2 text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
233
240
|
"Assignee",
|
|
234
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ r("div", { className: qe, children: /* @__PURE__ */ r(
|
|
235
242
|
pe,
|
|
236
243
|
{
|
|
237
244
|
collection: "nivaro_users",
|
|
@@ -244,12 +251,12 @@ function We({
|
|
|
244
251
|
]
|
|
245
252
|
}
|
|
246
253
|
),
|
|
247
|
-
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */
|
|
254
|
+
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ r(we, { ticketId: e.id, onWideChange: W }),
|
|
248
255
|
/* @__PURE__ */ n("section", { children: [
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ r("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Request" }),
|
|
257
|
+
/* @__PURE__ */ r("p", { className: "whitespace-pre-wrap text-[13px] leading-relaxed text-slate-800 dark:text-slate-200", children: e.description || /* @__PURE__ */ r("span", { className: "text-slate-400", children: "No details given." }) }),
|
|
251
258
|
e.replay && e.can.work && (() => {
|
|
252
|
-
const t =
|
|
259
|
+
const t = de(e.replay), s = p.consoleUrl ? p.consoleUrl(t) : t;
|
|
253
260
|
return s ? /* @__PURE__ */ n(
|
|
254
261
|
"a",
|
|
255
262
|
{
|
|
@@ -259,14 +266,14 @@ function We({
|
|
|
259
266
|
"data-ticket-replay": e.replay.recording_id,
|
|
260
267
|
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",
|
|
261
268
|
children: [
|
|
262
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ r(Z, { className: "h-3.5 w-3.5" }),
|
|
263
270
|
"Replay their screen"
|
|
264
271
|
]
|
|
265
272
|
}
|
|
266
273
|
) : null;
|
|
267
274
|
})(),
|
|
268
275
|
e.issue_id != null && e.can.work && (() => {
|
|
269
|
-
const t = `/issues/${e.issue_id}`, s =
|
|
276
|
+
const t = `/issues/${e.issue_id}`, s = p.consoleUrl ? p.consoleUrl(t) : t;
|
|
270
277
|
return s ? /* @__PURE__ */ n(
|
|
271
278
|
"a",
|
|
272
279
|
{
|
|
@@ -283,26 +290,27 @@ function We({
|
|
|
283
290
|
) : null;
|
|
284
291
|
})(),
|
|
285
292
|
(() => {
|
|
286
|
-
const t = e.files.filter((s) => e.can.work || !
|
|
287
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
|
293
|
+
const t = e.files.filter((s) => e.can.work || !N(s));
|
|
294
|
+
return t.length === 0 ? null : /* @__PURE__ */ r("ul", { className: "mt-2 flex flex-wrap gap-1.5", children: t.map((s) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ n(
|
|
288
295
|
"a",
|
|
289
296
|
{
|
|
290
|
-
href: `${
|
|
297
|
+
href: `${m}/files/${s.id}`,
|
|
291
298
|
target: "_blank",
|
|
292
299
|
rel: "noreferrer",
|
|
293
|
-
"data-tip":
|
|
300
|
+
"data-tip": N(s) ? "The page they were on, browser errors and their last 20 requests when they asked" : void 0,
|
|
294
301
|
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",
|
|
295
302
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
|
|
303
|
+
/* @__PURE__ */ r(I, { className: "h-3 w-3" }),
|
|
304
|
+
N(s) ? "Technical details" : s.title || s.filename_download || "File"
|
|
298
305
|
]
|
|
299
306
|
}
|
|
300
307
|
) }, s.id)) });
|
|
301
308
|
})()
|
|
302
309
|
] }),
|
|
303
|
-
e.can.work && /* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
|
|
310
|
+
e.can.work && /* @__PURE__ */ r(fe, { tracker: g, ticket: e }),
|
|
311
|
+
e.can.work && /* @__PURE__ */ r(_e, { ticketId: e.id }),
|
|
312
|
+
/* @__PURE__ */ r(
|
|
313
|
+
Se,
|
|
306
314
|
{
|
|
307
315
|
userId: e.created_by,
|
|
308
316
|
name: e.requester_name,
|
|
@@ -310,17 +318,30 @@ function We({
|
|
|
310
318
|
}
|
|
311
319
|
),
|
|
312
320
|
/* @__PURE__ */ n("section", { "data-ticket-thread": !0, children: [
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
e.thread.length === 0 ? /* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ r("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Conversation" }),
|
|
322
|
+
e.thread.length === 0 ? /* @__PURE__ */ r("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No replies yet." }) : /* @__PURE__ */ r("ul", { className: "space-y-2.5", children: e.thread.map((t) => /* @__PURE__ */ n(
|
|
315
323
|
"li",
|
|
316
324
|
{
|
|
317
|
-
|
|
325
|
+
"data-ticket-reply-gitlab": t.tracker ? "" : void 0,
|
|
326
|
+
className: t.from_requester || t.tracker ? "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",
|
|
318
327
|
children: [
|
|
319
328
|
/* @__PURE__ */ n("div", { className: "mb-0.5 flex items-baseline justify-between gap-2 text-[11.5px]", children: [
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
329
|
+
t.tracker ? /* @__PURE__ */ r(
|
|
330
|
+
xe,
|
|
331
|
+
{
|
|
332
|
+
from: t.tracker,
|
|
333
|
+
className: "font-medium text-slate-800 dark:text-slate-100"
|
|
334
|
+
}
|
|
335
|
+
) : /* @__PURE__ */ r("b", { className: "font-medium text-slate-800 dark:text-slate-100", children: t.user_name ?? "Someone" }),
|
|
336
|
+
/* @__PURE__ */ r("span", { className: "shrink-0 text-slate-500 dark:text-slate-400", children: w(t.created_at) })
|
|
322
337
|
] }),
|
|
323
|
-
/* @__PURE__ */
|
|
338
|
+
t.tracker ? /* @__PURE__ */ r(
|
|
339
|
+
he,
|
|
340
|
+
{
|
|
341
|
+
text: t.text,
|
|
342
|
+
className: "text-[12.5px] text-slate-700 dark:text-slate-200"
|
|
343
|
+
}
|
|
344
|
+
) : /* @__PURE__ */ r("p", { className: "whitespace-pre-wrap text-[12.5px] text-slate-700 dark:text-slate-200", children: t.text })
|
|
324
345
|
]
|
|
325
346
|
},
|
|
326
347
|
t.id
|
|
@@ -330,16 +351,17 @@ function We({
|
|
|
330
351
|
{
|
|
331
352
|
className: "mt-3",
|
|
332
353
|
onSubmit: (t) => {
|
|
333
|
-
t.preventDefault(), x.trim() &&
|
|
354
|
+
t.preventDefault(), x.trim() && C.mutate({ id: a, text: x.trim() });
|
|
334
355
|
},
|
|
335
356
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
357
|
+
g.shown.length > 0 && /* @__PURE__ */ r(ge, { className: "mb-1.5" }),
|
|
358
|
+
/* @__PURE__ */ r(
|
|
337
359
|
"textarea",
|
|
338
360
|
{
|
|
339
361
|
"data-ticket-reply": !0,
|
|
340
362
|
value: x,
|
|
341
363
|
onChange: (t) => {
|
|
342
|
-
|
|
364
|
+
S(t.target.value), d.signalReplying(!!t.target.value.trim());
|
|
343
365
|
},
|
|
344
366
|
rows: 3,
|
|
345
367
|
placeholder: "Write a reply",
|
|
@@ -352,14 +374,14 @@ function We({
|
|
|
352
374
|
className: "mt-1 flex items-center gap-1.5 text-[11.5px] italic text-slate-400",
|
|
353
375
|
"data-ticket-replying": !0,
|
|
354
376
|
children: [
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
|
|
377
|
+
/* @__PURE__ */ r("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
|
|
378
|
+
A(d.replying, "replying"),
|
|
357
379
|
"…"
|
|
358
380
|
]
|
|
359
381
|
}
|
|
360
382
|
),
|
|
361
383
|
/* @__PURE__ */ n("div", { className: "mt-2 flex items-center justify-end gap-2", children: [
|
|
362
|
-
e.can.cancel && !e.can.work && /* @__PURE__ */
|
|
384
|
+
e.can.cancel && !e.can.work && /* @__PURE__ */ r(
|
|
363
385
|
"button",
|
|
364
386
|
{
|
|
365
387
|
type: "button",
|
|
@@ -369,7 +391,7 @@ function We({
|
|
|
369
391
|
children: "Withdraw request"
|
|
370
392
|
}
|
|
371
393
|
),
|
|
372
|
-
e.can.reopen && /* @__PURE__ */
|
|
394
|
+
e.can.reopen && /* @__PURE__ */ r(
|
|
373
395
|
"button",
|
|
374
396
|
{
|
|
375
397
|
type: "button",
|
|
@@ -379,12 +401,12 @@ function We({
|
|
|
379
401
|
children: "Reopen"
|
|
380
402
|
}
|
|
381
403
|
),
|
|
382
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ r(
|
|
383
405
|
"button",
|
|
384
406
|
{
|
|
385
407
|
type: "submit",
|
|
386
408
|
"data-ticket-send": !0,
|
|
387
|
-
disabled: !x.trim() ||
|
|
409
|
+
disabled: !x.trim() || C.isPending,
|
|
388
410
|
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",
|
|
389
411
|
children: "Reply"
|
|
390
412
|
}
|
|
@@ -393,23 +415,23 @@ function We({
|
|
|
393
415
|
]
|
|
394
416
|
}
|
|
395
417
|
),
|
|
396
|
-
|
|
418
|
+
_ && /* @__PURE__ */ r("p", { className: "mt-1 text-[12px] text-red-600 dark:text-red-400", role: "alert", children: _ })
|
|
397
419
|
] }),
|
|
398
420
|
/* @__PURE__ */ n("section", { "data-ticket-history": !0, children: [
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
e.history.length === 0 ? /* @__PURE__ */
|
|
401
|
-
const s =
|
|
421
|
+
/* @__PURE__ */ r("h3", { className: "mb-2 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "History" }),
|
|
422
|
+
e.history.length === 0 ? /* @__PURE__ */ r("p", { className: "text-[12.5px] text-slate-500 dark:text-slate-400", children: "No history yet." }) : /* @__PURE__ */ r("ol", { className: "space-y-2 border-l border-slate-200 pl-3.5 dark:border-border", children: ce(e.history, { requester: e.created_by }).reverse().map((t) => {
|
|
423
|
+
const s = ue(t, {
|
|
402
424
|
isRequester: e.can.requester ?? !e.can.work,
|
|
403
425
|
requesterName: e.requester_name
|
|
404
426
|
});
|
|
405
427
|
return /* @__PURE__ */ n("li", { className: "text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
406
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-slate-100", children: s.text }),
|
|
407
429
|
/* @__PURE__ */ n("span", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
408
430
|
" ",
|
|
409
431
|
/* @__PURE__ */ n("span", { className: "whitespace-nowrap", children: [
|
|
410
432
|
"· ",
|
|
411
433
|
s.showAuthor ? `${t.user_name ?? "System"} · ` : "",
|
|
412
|
-
|
|
434
|
+
w(t.at)
|
|
413
435
|
] })
|
|
414
436
|
] })
|
|
415
437
|
] }, t.id);
|
|
@@ -421,8 +443,8 @@ function We({
|
|
|
421
443
|
) });
|
|
422
444
|
}
|
|
423
445
|
export {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
446
|
+
Te as StatusPill,
|
|
447
|
+
et as TicketDetailSheet,
|
|
448
|
+
Ce as draftFor,
|
|
449
|
+
$e as withTicketDraft
|
|
428
450
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as a } from "../../lib/utils.js";
|
|
3
|
+
import { AiMarkdown as n } from "../ai/AiMarkdown.js";
|
|
4
|
+
import { GitlabBadge as i } from "./TrackerChip.js";
|
|
5
|
+
function m(r) {
|
|
6
|
+
var t;
|
|
7
|
+
return ((t = r.author) == null ? void 0 : t.trim()) || "Someone on GitLab";
|
|
8
|
+
}
|
|
9
|
+
function l({ from: r, className: t }) {
|
|
10
|
+
return /* @__PURE__ */ o(
|
|
11
|
+
"span",
|
|
12
|
+
{
|
|
13
|
+
className: a("inline-flex min-w-0 items-center gap-1.5", t),
|
|
14
|
+
"data-comment-gitlab-author": !0,
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ e(i, {}),
|
|
17
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: m(r) })
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function h({ text: r, className: t }) {
|
|
23
|
+
return /* @__PURE__ */ e(n, { content: r, mirrored: !0, autolink: !1, className: a("break-words", t) });
|
|
24
|
+
}
|
|
25
|
+
function f({ className: r }) {
|
|
26
|
+
return /* @__PURE__ */ e(
|
|
27
|
+
"p",
|
|
28
|
+
{
|
|
29
|
+
className: a("text-[11.5px] text-slate-600 dark:text-muted-foreground", r),
|
|
30
|
+
"data-gitlab-shared": !0,
|
|
31
|
+
children: "Comments here are shared with GitLab."
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
f as GitlabSharedNotice,
|
|
37
|
+
l as MirroredAuthor,
|
|
38
|
+
h as MirroredBody,
|
|
39
|
+
m as mirroredAuthorName
|
|
40
|
+
};
|