@catandbox/schrodinger-web-adapter 0.1.10 → 0.1.12
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.
|
@@ -108,7 +108,8 @@ export function renderNewTicketForm(container, client, categories, emitter) {
|
|
|
108
108
|
const ticket = await client.createTicket({
|
|
109
109
|
title,
|
|
110
110
|
body,
|
|
111
|
-
categoryId: categoryId || null
|
|
111
|
+
categoryId: categoryId || null,
|
|
112
|
+
clientMessageId: crypto.randomUUID()
|
|
112
113
|
});
|
|
113
114
|
emitter.emit("ticket:created", ticket.id);
|
|
114
115
|
}
|
package/dist/client/portal.js
CHANGED
|
@@ -17,18 +17,31 @@ export async function renderSupportPortal(container, options = {}) {
|
|
|
17
17
|
if (categories.length > 0)
|
|
18
18
|
return;
|
|
19
19
|
try {
|
|
20
|
-
const
|
|
21
|
-
categories =
|
|
20
|
+
const config = await client.getPortalConfig();
|
|
21
|
+
categories = config.categories;
|
|
22
22
|
}
|
|
23
23
|
catch {
|
|
24
24
|
categories = [];
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
function showLoading() {
|
|
28
|
+
container.innerHTML = `
|
|
29
|
+
<s-card>
|
|
30
|
+
<s-box padding="large">
|
|
31
|
+
<div style="display:flex; justify-content:center; padding:32px 0;">
|
|
32
|
+
<s-spinner size="small"></s-spinner>
|
|
33
|
+
</div>
|
|
34
|
+
</s-box>
|
|
35
|
+
</s-card>
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
27
38
|
async function navigate(view, ticketId) {
|
|
28
39
|
currentView = view;
|
|
29
40
|
if (ticketId !== undefined) {
|
|
30
41
|
selectedTicketId = ticketId;
|
|
31
42
|
}
|
|
43
|
+
// Show loading spinner immediately for instant feedback
|
|
44
|
+
showLoading();
|
|
32
45
|
switch (currentView) {
|
|
33
46
|
case "list":
|
|
34
47
|
await renderTicketList(container, client, emitter);
|
|
@@ -118,7 +118,7 @@ export async function renderTicketDetail(container, client, ticketId, emitter) {
|
|
|
118
118
|
if (btn)
|
|
119
119
|
btn.setAttribute("disabled", "true");
|
|
120
120
|
try {
|
|
121
|
-
await client.createReply(ticketId, { body });
|
|
121
|
+
await client.createReply(ticketId, { body, clientMessageId: crypto.randomUUID() });
|
|
122
122
|
await renderTicketDetail(container, client, ticketId, emitter);
|
|
123
123
|
}
|
|
124
124
|
catch (error) {
|