@nivaro/react 0.3.127 → 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 +29 -3
- package/dist/index.js +150 -147
- package/dist/shared/components/CollectionBrowserView.js +3259 -3211
- package/dist/shared/components/DataTable.js +406 -401
- package/dist/shared/components/ItemEditForm.js +4485 -4409
- package/dist/shared/components/MatrixEditor.js +548 -490
- package/dist/shared/components/MyWorkView.js +284 -274
- package/dist/shared/components/NotificationBell.js +264 -218
- package/dist/shared/components/RecordGridEditor.js +582 -472
- package/dist/shared/components/ai/AiMarkdown.js +215 -196
- package/dist/shared/components/chat/chat-core.js +331 -346
- package/dist/shared/components/chat/chat-typing.js +25 -0
- package/dist/shared/components/command-center/CommandCenterView.js +1 -1
- package/dist/shared/components/command-center/PeekPanel.js +8 -1
- package/dist/shared/components/command-center/api.js +17 -9
- package/dist/shared/components/command-center/panels/AttentionPanel.js +4 -1
- package/dist/shared/components/command-center/panels/PartnersPanel.js +2 -1
- package/dist/shared/components/item-edit/GroupSection.js +1 -1
- package/dist/shared/components/item-edit/HeaderTools.js +216 -210
- package/dist/shared/components/item-edit/InlineTableField.js +432 -429
- package/dist/shared/components/item-edit/RecordLiveSync.js +115 -108
- package/dist/shared/components/item-edit/RecordViewersChip.js +17 -16
- package/dist/shared/components/item-edit/RowComments.js +33 -30
- package/dist/shared/components/item-edit/cascade-clear-notice.js +30 -28
- package/dist/shared/components/item-edit/live-related.js +29 -16
- package/dist/shared/components/item-edit/record-opened-live.js +86 -0
- package/dist/shared/components/panels/CommentPanel.js +345 -327
- package/dist/shared/components/panels/OwnerOpenedLine.js +24 -23
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/pipeline/TeamSuggestions.js +1 -1
- package/dist/shared/components/queue/QueueItemSheet.js +171 -130
- package/dist/shared/components/record-grid-guard.js +85 -0
- package/dist/shared/components/support/TicketDetailSheet.js +213 -174
- 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/dist/shared/lib/at-risk-fields.js +14 -0
- package/dist/shared/lib/live-queries.js +9 -8
- package/dist/shared/lib/live-screen.js +77 -76
- package/dist/shared/lib/presence-hooks.js +190 -127
- package/dist/shared/lib/user-sync.js +78 -65
- package/dist/shared/lib/waiting-count.js +40 -29
- package/package.json +1 -1
|
@@ -1,166 +1,188 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Loader2 as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get 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
|
|
13
|
-
import { RelationCombobox as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
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
|
+
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";
|
|
18
|
+
import { SimpleSelect as K } from "../ui/SimpleSelect.js";
|
|
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:
|
|
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
|
-
|
|
49
|
-
|
|
51
|
+
function Ce(a, o) {
|
|
52
|
+
return o == null ? "" : a[String(o)] ?? "";
|
|
53
|
+
}
|
|
54
|
+
function $e(a, o, l) {
|
|
55
|
+
if (o == null) return a;
|
|
56
|
+
const i = String(o);
|
|
57
|
+
if (!l) {
|
|
58
|
+
if (!(i in a)) return a;
|
|
59
|
+
const m = { ...a };
|
|
60
|
+
return delete m[i], m;
|
|
61
|
+
}
|
|
62
|
+
return { ...a, [i]: l };
|
|
63
|
+
}
|
|
64
|
+
function et({
|
|
65
|
+
ticketId: a,
|
|
66
|
+
onOpenChange: o
|
|
50
67
|
}) {
|
|
51
|
-
const l =
|
|
52
|
-
|
|
53
|
-
|
|
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, {
|
|
54
73
|
data: e,
|
|
55
|
-
isLoading:
|
|
56
|
-
isError:
|
|
57
|
-
dataUpdatedAt:
|
|
58
|
-
} =
|
|
59
|
-
queryKey: ["support-ticket",
|
|
60
|
-
queryFn: () => l.request(
|
|
61
|
-
enabled:
|
|
62
|
-
retry: (t,
|
|
63
|
-
const
|
|
64
|
-
return
|
|
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),
|
|
80
|
+
enabled: h,
|
|
81
|
+
retry: (t, s) => {
|
|
82
|
+
const u = s == null ? void 0 : s.status;
|
|
83
|
+
return u !== 404 && u !== 403 && u !== 400 && t < 2;
|
|
65
84
|
}
|
|
66
|
-
}),
|
|
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 = [] } = $({
|
|
67
88
|
queryKey: ["support-categories", "all-for", (e == null ? void 0 : e.collection) ?? null],
|
|
68
89
|
queryFn: () => l.request(
|
|
69
|
-
|
|
90
|
+
R("/support/categories", e != null && e.collection ? { collection: e.collection } : void 0)
|
|
70
91
|
).then((t) => t.data ?? []),
|
|
71
92
|
enabled: !!(e != null && e.can.work)
|
|
72
|
-
}),
|
|
73
|
-
i.invalidateQueries({ queryKey: ["support-ticket",
|
|
74
|
-
},
|
|
75
|
-
mutationFn: () => l.request(
|
|
76
|
-
onSuccess:
|
|
77
|
-
onError:
|
|
78
|
-
}),
|
|
79
|
-
mutationFn: (t) => l.request(
|
|
80
|
-
onSuccess:
|
|
81
|
-
onError:
|
|
82
|
-
}),
|
|
83
|
-
mutationFn: () => l.request(
|
|
84
|
-
onSuccess: () => {
|
|
85
|
-
|
|
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 })),
|
|
105
|
+
onSuccess: (t, s) => {
|
|
106
|
+
S("", s.id), d.signalReplying(!1), f();
|
|
86
107
|
},
|
|
87
|
-
onError:
|
|
108
|
+
onError: y
|
|
88
109
|
});
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
|
|
110
|
+
return /* @__PURE__ */ r(ke, { open: a != null, onOpenChange: o, children: /* @__PURE__ */ r(
|
|
111
|
+
ve,
|
|
91
112
|
{
|
|
92
113
|
side: "right",
|
|
93
|
-
ref:
|
|
94
|
-
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 ${
|
|
95
|
-
"data-support-ticket":
|
|
114
|
+
ref: J,
|
|
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]"}`,
|
|
116
|
+
"data-support-ticket": a ?? "",
|
|
96
117
|
onOpenAutoFocus: (t) => {
|
|
97
|
-
var
|
|
98
|
-
t.preventDefault(), (
|
|
118
|
+
var s;
|
|
119
|
+
t.preventDefault(), (s = t.currentTarget) == null || s.focus({ preventScroll: !0 });
|
|
99
120
|
},
|
|
100
|
-
children: !
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
] }) :
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
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: [
|
|
126
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 pr-6", children: [
|
|
127
|
+
/* @__PURE__ */ n("span", { className: "font-mono text-[11.5px] text-slate-400", children: [
|
|
107
128
|
"#",
|
|
108
129
|
e.id
|
|
109
130
|
] }),
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
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}`))
|
|
112
134
|
] }),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
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: [
|
|
115
137
|
e.requester_name ?? "Someone",
|
|
116
138
|
" · ",
|
|
117
|
-
|
|
139
|
+
w(e.created_at),
|
|
118
140
|
e.category_name ? ` · ${e.category_name}` : ""
|
|
119
141
|
] }),
|
|
120
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ r("div", { className: "text-left text-[12px]", children: e.collection && e.item ? /* @__PURE__ */ r(
|
|
121
143
|
"a",
|
|
122
144
|
{
|
|
123
|
-
href:
|
|
145
|
+
href: Q({ collection: e.collection, itemId: e.item }),
|
|
124
146
|
onClick: (t) => {
|
|
125
|
-
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 }));
|
|
126
148
|
},
|
|
127
149
|
"data-ticket-record": !0,
|
|
128
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",
|
|
129
151
|
children: e.record_label ?? e.item
|
|
130
152
|
}
|
|
131
|
-
) : /* @__PURE__ */
|
|
132
|
-
|
|
153
|
+
) : /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-muted-foreground", children: "General Support" }) }),
|
|
154
|
+
d.viewers.length > 0 && /* @__PURE__ */ n(
|
|
133
155
|
"p",
|
|
134
156
|
{
|
|
135
157
|
className: "mt-1 flex items-center gap-1.5 text-[11.5px] text-sky-700 dark:text-sky-300",
|
|
136
158
|
"data-ticket-viewing": !0,
|
|
137
159
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
|
|
140
|
-
|
|
160
|
+
/* @__PURE__ */ r("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-sky-400" }),
|
|
161
|
+
A(
|
|
162
|
+
d.viewers.map((t) => t.name),
|
|
141
163
|
"looking at this"
|
|
142
164
|
)
|
|
143
165
|
]
|
|
144
166
|
}
|
|
145
167
|
)
|
|
146
168
|
] }),
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
e.can.work && /* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ n("div", { "data-sheet-body": !0, className: "flex-1 space-y-6 overflow-y-auto px-5 py-5", children: [
|
|
170
|
+
e.can.work && /* @__PURE__ */ n(
|
|
149
171
|
"div",
|
|
150
172
|
{
|
|
151
173
|
"data-ticket-controls": !0,
|
|
152
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]",
|
|
153
175
|
children: [
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ n("div", { className: "col-span-2 flex items-center gap-2", children: [
|
|
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: [
|
|
156
178
|
"Assigned to ",
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
] }) : /* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ r("b", { className: "font-medium", children: e.assignee_name })
|
|
180
|
+
] }) : /* @__PURE__ */ n(b, { children: [
|
|
159
181
|
"Not picked up yet",
|
|
160
182
|
e.team_name ? ` · ${e.team_name}` : " · Administrators"
|
|
161
183
|
] }) }),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
|
|
184
|
+
/* @__PURE__ */ r(
|
|
185
|
+
me,
|
|
164
186
|
{
|
|
165
187
|
task: {
|
|
166
188
|
id: e.id,
|
|
@@ -170,58 +192,58 @@ function Ue({
|
|
|
170
192
|
category_id: e.category_id,
|
|
171
193
|
title: e.title
|
|
172
194
|
},
|
|
173
|
-
onTaskChanged: () => void i.invalidateQueries({ queryKey: ["support-ticket",
|
|
195
|
+
onTaskChanged: () => void i.invalidateQueries({ queryKey: ["support-ticket", a] })
|
|
174
196
|
}
|
|
175
197
|
),
|
|
176
|
-
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */
|
|
198
|
+
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ r(
|
|
177
199
|
"button",
|
|
178
200
|
{
|
|
179
201
|
type: "button",
|
|
180
202
|
"data-ticket-claim": !0,
|
|
181
|
-
disabled:
|
|
182
|
-
onClick: () =>
|
|
203
|
+
disabled: T.isPending,
|
|
204
|
+
onClick: () => T.mutate(),
|
|
183
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",
|
|
184
206
|
children: e.assignee ? "Take it over" : "Pick it up"
|
|
185
207
|
}
|
|
186
208
|
)
|
|
187
209
|
] }),
|
|
188
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ n("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
189
211
|
"Status",
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
212
|
+
/* @__PURE__ */ r(
|
|
213
|
+
K,
|
|
192
214
|
{
|
|
193
215
|
value: e.status,
|
|
194
|
-
onChange: (t) =>
|
|
195
|
-
options:
|
|
216
|
+
onChange: (t) => c.mutate({ status: t }),
|
|
217
|
+
options: U,
|
|
196
218
|
ariaLabel: "Status",
|
|
197
|
-
className:
|
|
219
|
+
className: O
|
|
198
220
|
}
|
|
199
221
|
)
|
|
200
222
|
] }),
|
|
201
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ n("div", { className: "block text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
202
224
|
"Type",
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
|
|
225
|
+
/* @__PURE__ */ r(
|
|
226
|
+
K,
|
|
205
227
|
{
|
|
206
228
|
value: e.category_id != null ? String(e.category_id) : "",
|
|
207
|
-
onChange: (t) =>
|
|
229
|
+
onChange: (t) => c.mutate({ category_id: t ? Number(t) : null }),
|
|
208
230
|
options: [
|
|
209
231
|
{ value: "", label: "No type" },
|
|
210
|
-
...
|
|
232
|
+
...V.map((t) => ({ value: String(t.id), label: t.name }))
|
|
211
233
|
],
|
|
212
234
|
ariaLabel: "Type",
|
|
213
|
-
className:
|
|
235
|
+
className: O
|
|
214
236
|
}
|
|
215
237
|
)
|
|
216
238
|
] }),
|
|
217
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ n("div", { className: "col-span-2 text-[11.5px] font-medium text-slate-500 dark:text-slate-400", children: [
|
|
218
240
|
"Assignee",
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
|
|
241
|
+
/* @__PURE__ */ r("div", { className: qe, children: /* @__PURE__ */ r(
|
|
242
|
+
pe,
|
|
221
243
|
{
|
|
222
244
|
collection: "nivaro_users",
|
|
223
245
|
value: e.assignee,
|
|
224
|
-
onChange: (t) =>
|
|
246
|
+
onChange: (t) => c.mutate({ assignee: t ? String(t) : null }),
|
|
225
247
|
placeholder: "Nobody yet"
|
|
226
248
|
}
|
|
227
249
|
) })
|
|
@@ -229,33 +251,33 @@ function Ue({
|
|
|
229
251
|
]
|
|
230
252
|
}
|
|
231
253
|
),
|
|
232
|
-
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
254
|
+
(e.status === "open" || e.status === "in_progress") && /* @__PURE__ */ r(we, { ticketId: e.id, onWideChange: W }),
|
|
255
|
+
/* @__PURE__ */ n("section", { children: [
|
|
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." }) }),
|
|
236
258
|
e.replay && e.can.work && (() => {
|
|
237
|
-
const t =
|
|
238
|
-
return
|
|
259
|
+
const t = de(e.replay), s = p.consoleUrl ? p.consoleUrl(t) : t;
|
|
260
|
+
return s ? /* @__PURE__ */ n(
|
|
239
261
|
"a",
|
|
240
262
|
{
|
|
241
|
-
href:
|
|
263
|
+
href: s,
|
|
242
264
|
target: "_blank",
|
|
243
265
|
rel: "noreferrer",
|
|
244
266
|
"data-ticket-replay": e.replay.recording_id,
|
|
245
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",
|
|
246
268
|
children: [
|
|
247
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ r(Z, { className: "h-3.5 w-3.5" }),
|
|
248
270
|
"Replay their screen"
|
|
249
271
|
]
|
|
250
272
|
}
|
|
251
273
|
) : null;
|
|
252
274
|
})(),
|
|
253
275
|
e.issue_id != null && e.can.work && (() => {
|
|
254
|
-
const t = `/issues/${e.issue_id}`,
|
|
255
|
-
return
|
|
276
|
+
const t = `/issues/${e.issue_id}`, s = p.consoleUrl ? p.consoleUrl(t) : t;
|
|
277
|
+
return s ? /* @__PURE__ */ n(
|
|
256
278
|
"a",
|
|
257
279
|
{
|
|
258
|
-
href:
|
|
280
|
+
href: s,
|
|
259
281
|
target: "_blank",
|
|
260
282
|
rel: "noreferrer",
|
|
261
283
|
"data-ticket-issue": e.issue_id,
|
|
@@ -268,108 +290,123 @@ function Ue({
|
|
|
268
290
|
) : null;
|
|
269
291
|
})(),
|
|
270
292
|
(() => {
|
|
271
|
-
const t = e.files.filter((
|
|
272
|
-
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(
|
|
273
295
|
"a",
|
|
274
296
|
{
|
|
275
|
-
href: `${
|
|
297
|
+
href: `${m}/files/${s.id}`,
|
|
276
298
|
target: "_blank",
|
|
277
299
|
rel: "noreferrer",
|
|
278
|
-
"data-tip":
|
|
300
|
+
"data-tip": N(s) ? "The page they were on, browser errors and their last 20 requests when they asked" : void 0,
|
|
279
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",
|
|
280
302
|
children: [
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
|
|
303
|
+
/* @__PURE__ */ r(I, { className: "h-3 w-3" }),
|
|
304
|
+
N(s) ? "Technical details" : s.title || s.filename_download || "File"
|
|
283
305
|
]
|
|
284
306
|
}
|
|
285
|
-
) },
|
|
307
|
+
) }, s.id)) });
|
|
286
308
|
})()
|
|
287
309
|
] }),
|
|
288
|
-
e.can.work && /* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
|
|
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,
|
|
291
314
|
{
|
|
292
315
|
userId: e.created_by,
|
|
293
316
|
name: e.requester_name,
|
|
294
317
|
text: `${e.title} ${e.description ?? ""}`
|
|
295
318
|
}
|
|
296
319
|
),
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
e.thread.length === 0 ? /* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ n("section", { "data-ticket-thread": !0, children: [
|
|
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(
|
|
300
323
|
"li",
|
|
301
324
|
{
|
|
302
|
-
|
|
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",
|
|
303
327
|
children: [
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
|
|
328
|
+
/* @__PURE__ */ n("div", { className: "mb-0.5 flex items-baseline justify-between gap-2 text-[11.5px]", children: [
|
|
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) })
|
|
307
337
|
] }),
|
|
308
|
-
/* @__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 })
|
|
309
345
|
]
|
|
310
346
|
},
|
|
311
347
|
t.id
|
|
312
348
|
)) }),
|
|
313
|
-
e.can.reply && /* @__PURE__ */
|
|
349
|
+
e.can.reply && /* @__PURE__ */ n(
|
|
314
350
|
"form",
|
|
315
351
|
{
|
|
316
352
|
className: "mt-3",
|
|
317
353
|
onSubmit: (t) => {
|
|
318
|
-
t.preventDefault(),
|
|
354
|
+
t.preventDefault(), x.trim() && C.mutate({ id: a, text: x.trim() });
|
|
319
355
|
},
|
|
320
356
|
children: [
|
|
321
|
-
/* @__PURE__ */
|
|
357
|
+
g.shown.length > 0 && /* @__PURE__ */ r(ge, { className: "mb-1.5" }),
|
|
358
|
+
/* @__PURE__ */ r(
|
|
322
359
|
"textarea",
|
|
323
360
|
{
|
|
324
361
|
"data-ticket-reply": !0,
|
|
325
|
-
value:
|
|
362
|
+
value: x,
|
|
326
363
|
onChange: (t) => {
|
|
327
|
-
|
|
364
|
+
S(t.target.value), d.signalReplying(!!t.target.value.trim());
|
|
328
365
|
},
|
|
329
366
|
rows: 3,
|
|
330
367
|
placeholder: "Write a reply",
|
|
331
368
|
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"
|
|
332
369
|
}
|
|
333
370
|
),
|
|
334
|
-
|
|
371
|
+
d.replying.length > 0 && /* @__PURE__ */ n(
|
|
335
372
|
"p",
|
|
336
373
|
{
|
|
337
374
|
className: "mt-1 flex items-center gap-1.5 text-[11.5px] italic text-slate-400",
|
|
338
375
|
"data-ticket-replying": !0,
|
|
339
376
|
children: [
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
|
|
377
|
+
/* @__PURE__ */ r("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
|
|
378
|
+
A(d.replying, "replying"),
|
|
342
379
|
"…"
|
|
343
380
|
]
|
|
344
381
|
}
|
|
345
382
|
),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
e.can.cancel && !e.can.work && /* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ n("div", { className: "mt-2 flex items-center justify-end gap-2", children: [
|
|
384
|
+
e.can.cancel && !e.can.work && /* @__PURE__ */ r(
|
|
348
385
|
"button",
|
|
349
386
|
{
|
|
350
387
|
type: "button",
|
|
351
388
|
"data-ticket-cancel": !0,
|
|
352
|
-
onClick: () =>
|
|
389
|
+
onClick: () => c.mutate({ status: "cancelled" }),
|
|
353
390
|
className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
|
|
354
391
|
children: "Withdraw request"
|
|
355
392
|
}
|
|
356
393
|
),
|
|
357
|
-
e.can.reopen && /* @__PURE__ */
|
|
394
|
+
e.can.reopen && /* @__PURE__ */ r(
|
|
358
395
|
"button",
|
|
359
396
|
{
|
|
360
397
|
type: "button",
|
|
361
398
|
"data-ticket-reopen": !0,
|
|
362
|
-
onClick: () =>
|
|
399
|
+
onClick: () => c.mutate({ status: "open" }),
|
|
363
400
|
className: "h-7 rounded-md px-2.5 text-[12px] text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
|
|
364
401
|
children: "Reopen"
|
|
365
402
|
}
|
|
366
403
|
),
|
|
367
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ r(
|
|
368
405
|
"button",
|
|
369
406
|
{
|
|
370
407
|
type: "submit",
|
|
371
408
|
"data-ticket-send": !0,
|
|
372
|
-
disabled: !
|
|
409
|
+
disabled: !x.trim() || C.isPending,
|
|
373
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",
|
|
374
411
|
children: "Reply"
|
|
375
412
|
}
|
|
@@ -378,23 +415,23 @@ function Ue({
|
|
|
378
415
|
]
|
|
379
416
|
}
|
|
380
417
|
),
|
|
381
|
-
|
|
418
|
+
_ && /* @__PURE__ */ r("p", { className: "mt-1 text-[12px] text-red-600 dark:text-red-400", role: "alert", children: _ })
|
|
382
419
|
] }),
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
e.history.length === 0 ? /* @__PURE__ */
|
|
386
|
-
const
|
|
420
|
+
/* @__PURE__ */ n("section", { "data-ticket-history": !0, children: [
|
|
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, {
|
|
387
424
|
isRequester: e.can.requester ?? !e.can.work,
|
|
388
425
|
requesterName: e.requester_name
|
|
389
426
|
});
|
|
390
|
-
return /* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
/* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ n("li", { className: "text-[12px] text-slate-600 dark:text-slate-300", children: [
|
|
428
|
+
/* @__PURE__ */ r("span", { className: "text-slate-800 dark:text-slate-100", children: s.text }),
|
|
429
|
+
/* @__PURE__ */ n("span", { className: "text-slate-500 dark:text-slate-400", children: [
|
|
393
430
|
" ",
|
|
394
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ n("span", { className: "whitespace-nowrap", children: [
|
|
395
432
|
"· ",
|
|
396
|
-
|
|
397
|
-
|
|
433
|
+
s.showAuthor ? `${t.user_name ?? "System"} · ` : "",
|
|
434
|
+
w(t.at)
|
|
398
435
|
] })
|
|
399
436
|
] })
|
|
400
437
|
] }, t.id);
|
|
@@ -406,6 +443,8 @@ function Ue({
|
|
|
406
443
|
) });
|
|
407
444
|
}
|
|
408
445
|
export {
|
|
409
|
-
|
|
410
|
-
|
|
446
|
+
Te as StatusPill,
|
|
447
|
+
et as TicketDetailSheet,
|
|
448
|
+
Ce as draftFor,
|
|
449
|
+
$e as withTicketDraft
|
|
411
450
|
};
|