@dragonmastery/dragoncore-vue 0.0.7 → 0.0.9
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/package.json +3 -4
- package/dist/AppLink-CHMMrSFI.js +0 -54
- package/dist/AppLink-CHMMrSFI.js.map +0 -1
- package/dist/Appearance-BfPdKMXw.js +0 -70
- package/dist/Appearance-BfPdKMXw.js.map +0 -1
- package/dist/Appearance-C3WguxT-.js +0 -3
- package/dist/ChangePasswordPage-DCews8GU.js +0 -86
- package/dist/ChangePasswordPage-DCews8GU.js.map +0 -1
- package/dist/ChangePasswordPage-Dm5vW0nl.js +0 -6
- package/dist/CreateTeamForm-Cg4sD65k.js +0 -27
- package/dist/CreateTeamMemberForm-CiG-fCJD.js +0 -27
- package/dist/CreateUserPage-B8qeBZij.js +0 -76
- package/dist/CreateUserPage-B8qeBZij.js.map +0 -1
- package/dist/CreateUserPage-WjYDkwpb.js +0 -6
- package/dist/CreditBalanceDashboard-BUdKWieE.js +0 -27
- package/dist/CreditManagement-BcyUY_J0.js +0 -27
- package/dist/CustomerCreateSupportTicketForm-BplS0xSi.js +0 -27
- package/dist/CustomerSupportTicketDetailPage-DZQCplSM.js +0 -717
- package/dist/CustomerSupportTicketDetailPage-DZQCplSM.js.map +0 -1
- package/dist/CustomerSupportTicketList-DGwy4Wje.js +0 -27
- package/dist/CustomerSupportTicketParent-BnmTFigo.js +0 -7
- package/dist/CustomerSupportTicketParent-BzY4pmBk.js +0 -66
- package/dist/CustomerSupportTicketParent-BzY4pmBk.js.map +0 -1
- package/dist/CustomerSupportTicketSuccess-DC1jJG1E.js +0 -27
- package/dist/EditTeamForm-BnPwhv5B.js +0 -27
- package/dist/EditTeamMemberForm-B8-pI6Xm.js +0 -6
- package/dist/EditTeamMemberForm-CKbKomrL.js +0 -191
- package/dist/EditTeamMemberForm-CKbKomrL.js.map +0 -1
- package/dist/EditUserPage-BG-Fkx_c.js +0 -7
- package/dist/EditUserPage-XqF25iwz.js +0 -112
- package/dist/EditUserPage-XqF25iwz.js.map +0 -1
- package/dist/ForgotPassword-CjWv2V7p.js +0 -7
- package/dist/ForgotPassword-D3bjL48L.js +0 -73
- package/dist/ForgotPassword-D3bjL48L.js.map +0 -1
- package/dist/LoginForm--br4Il85.js +0 -7
- package/dist/LoginForm-C85U2E2r.js +0 -116
- package/dist/LoginForm-C85U2E2r.js.map +0 -1
- package/dist/Logout-DHT-5Qz3.js +0 -6
- package/dist/Logout-DZuWLh0O.js +0 -38
- package/dist/Logout-DZuWLh0O.js.map +0 -1
- package/dist/ResetPassword-M6mvTS24.js +0 -27
- package/dist/SavedFiltersPage-D3vJrfzt.js +0 -419
- package/dist/SavedFiltersPage-D3vJrfzt.js.map +0 -1
- package/dist/Signup-VZa7U-Ur.js +0 -7
- package/dist/Signup-hpV8J5cM.js +0 -106
- package/dist/Signup-hpV8J5cM.js.map +0 -1
- package/dist/StaffCreateSupportTicketForm-Bc7UnK0Q.js +0 -27
- package/dist/StaffSupportTicketDetailPage-DY07Ez0R.js +0 -1928
- package/dist/StaffSupportTicketDetailPage-DY07Ez0R.js.map +0 -1
- package/dist/StaffSupportTicketList-ChJP_67k.js +0 -27
- package/dist/StaffSupportTicketParent-CWWhaM37.js +0 -66
- package/dist/StaffSupportTicketParent-CWWhaM37.js.map +0 -1
- package/dist/StaffSupportTicketParent-Dp1G85wc.js +0 -7
- package/dist/StaffSupportTicketSuccess-B6X_dP4f.js +0 -27
- package/dist/SupportStaffPage-nd0HowtH.js +0 -156
- package/dist/SupportStaffPage-nd0HowtH.js.map +0 -1
- package/dist/SupportTicketDevLifecycleBadge-Ba-Rm6QW.js +0 -116
- package/dist/SupportTicketDevLifecycleBadge-Ba-Rm6QW.js.map +0 -1
- package/dist/SupportTicketMaintenancePage-rcJ7EfDj.js +0 -56
- package/dist/SupportTicketMaintenancePage-rcJ7EfDj.js.map +0 -1
- package/dist/TeamAttachmentsTab-Dk_Bnk-1.js +0 -27
- package/dist/TeamHistoryTab-CNelXR3Q.js +0 -232
- package/dist/TeamHistoryTab-CNelXR3Q.js.map +0 -1
- package/dist/TeamHistoryTab-siesF93u.js +0 -4
- package/dist/TeamList-BtLzbjls.js +0 -27
- package/dist/TeamMemberList-EoDXIr0w.js +0 -27
- package/dist/TeamMemberParent-DZ5YVyi6.js +0 -27
- package/dist/TeamMembersTab-4gmnP9sD.js +0 -21
- package/dist/TeamMembersTab-4gmnP9sD.js.map +0 -1
- package/dist/TeamMembersTab-DTJxmb-M.js +0 -3
- package/dist/TeamNotesTab-BhVRLG8h.js +0 -458
- package/dist/TeamNotesTab-BhVRLG8h.js.map +0 -1
- package/dist/TeamNotesTab-Crp-afAe.js +0 -7
- package/dist/TeamParent-CbrXXzAr.js +0 -27
- package/dist/TimelineNoteInput-BVqF4MtZ.js +0 -513
- package/dist/TimelineNoteInput-BVqF4MtZ.js.map +0 -1
- package/dist/TimelineSystemEvent-D58zN850.js +0 -1897
- package/dist/TimelineSystemEvent-D58zN850.js.map +0 -1
- package/dist/UserListPage-D68AjrjM.js +0 -4
- package/dist/UserListPage-OGYOLwlw.js +0 -153
- package/dist/UserListPage-OGYOLwlw.js.map +0 -1
- package/dist/UserProfilePage-Q68NAGQQ.js +0 -7
- package/dist/UserProfilePage-uAIfC_NW.js +0 -125
- package/dist/UserProfilePage-uAIfC_NW.js.map +0 -1
- package/dist/ViewTeam-DpE_NfRq.js +0 -27
- package/dist/ViewTeamMember-BdBwkuXC.js +0 -27
- package/dist/convertToLocalDateTime-DOSGtMn8.js +0 -121
- package/dist/convertToLocalDateTime-DOSGtMn8.js.map +0 -1
- package/dist/displayIdFormatter-B1ZKgofu.js +0 -13
- package/dist/displayIdFormatter-B1ZKgofu.js.map +0 -1
- package/dist/extractRpcErrorMessage-C_UbKgHL.js +0 -20
- package/dist/extractRpcErrorMessage-C_UbKgHL.js.map +0 -1
- package/dist/index.d.ts +0 -6366
- package/dist/index.js +0 -30
- package/dist/src-CEBiyg_f.css +0 -13
- package/dist/src-CEBiyg_f.css.map +0 -1
- package/dist/src-CHw8DdkR.js +0 -9200
- package/dist/src-CHw8DdkR.js.map +0 -1
- package/dist/useBreadcrumbs-DmgSucoe.js +0 -41
- package/dist/useBreadcrumbs-DmgSucoe.js.map +0 -1
- package/dist/useMutation-B4_S4Xoa.js +0 -50
- package/dist/useMutation-B4_S4Xoa.js.map +0 -1
- package/dist/useQuery-B7ndu5_P.js +0 -107
- package/dist/useQuery-B7ndu5_P.js.map +0 -1
- package/dist/useQueryCache-DqcDMsxb.js +0 -254
- package/dist/useQueryCache-DqcDMsxb.js.map +0 -1
- package/dist/useRpcAuth-Dp2sec-X.js +0 -731
- package/dist/useRpcAuth-Dp2sec-X.js.map +0 -1
|
@@ -1,717 +0,0 @@
|
|
|
1
|
-
import { t as BATCH_MODE } from "./useRpcAuth-Dp2sec-X.js";
|
|
2
|
-
import "./useQueryCache-DqcDMsxb.js";
|
|
3
|
-
import { t as useMutation } from "./useMutation-B4_S4Xoa.js";
|
|
4
|
-
import { t as useQuery } from "./useQuery-B7ndu5_P.js";
|
|
5
|
-
import { a as SupportTicketTypeBadge_default, c as formatCustomerCreditValue, i as SupportTicketApprovalBadge_default, n as TimelineItem_default, o as SupportTicketPriorityBadge_default, r as formatTicketDate, t as TimelineSystemEvent_default } from "./TimelineSystemEvent-D58zN850.js";
|
|
6
|
-
import { t as extractRpcErrorMessage } from "./extractRpcErrorMessage-C_UbKgHL.js";
|
|
7
|
-
import { t as formatTicketDisplayId } from "./displayIdFormatter-B1ZKgofu.js";
|
|
8
|
-
import { a as SupportTicketAttachmentsCollapsible_default, i as parseRecordVersions, n as MetadataField_default, r as ActionBannerAlert_default, t as TimelineNoteInput_default } from "./TimelineNoteInput-BVqF4MtZ.js";
|
|
9
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, nextTick, normalizeClass, openBlock, ref, renderList, resolveComponent, toDisplayString, unref, watch, withCtx } from "vue";
|
|
10
|
-
import { useRoute, useRouter } from "vue-router";
|
|
11
|
-
import { CustomerSupportTicketUpdateSchema, OPERATORS, RecordConst, SUPPORT_TICKET_PRIORITY_NUMBER_TO_LABEL, supportTicketPriorityToNumber } from "@dragonmastery/dragoncore-shared";
|
|
12
|
-
import { useForm, withMetadata } from "@dragonmastery/zinia-forms-core";
|
|
13
|
-
import { toast } from "vue3-toastify";
|
|
14
|
-
|
|
15
|
-
//#region src/slices/support_ticket/customer/components/CustomerActionBanner.vue
|
|
16
|
-
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
17
|
-
__name: "CustomerActionBanner",
|
|
18
|
-
props: { ticket: {} },
|
|
19
|
-
setup(__props) {
|
|
20
|
-
const props = __props;
|
|
21
|
-
const isArchived = computed(() => !!props.ticket.archived_at);
|
|
22
|
-
const isApproved = computed(() => {
|
|
23
|
-
const t = props.ticket;
|
|
24
|
-
return !!t.is_locked && !!t.locked_approval_at && t.status !== "CANCELLED";
|
|
25
|
-
});
|
|
26
|
-
const isRejected = computed(() => {
|
|
27
|
-
const t = props.ticket;
|
|
28
|
-
return !!t.is_locked && !!t.locked_approval_at && t.status === "CANCELLED";
|
|
29
|
-
});
|
|
30
|
-
const lockedDateFormatted = computed(() => {
|
|
31
|
-
const at = props.ticket.locked_approval_at;
|
|
32
|
-
if (!at) return "";
|
|
33
|
-
return formatTicketDate(at).formatted;
|
|
34
|
-
});
|
|
35
|
-
return (_ctx, _cache) => {
|
|
36
|
-
return isArchived.value ? (openBlock(), createBlock(ActionBannerAlert_default, {
|
|
37
|
-
key: 0,
|
|
38
|
-
variant: "neutral",
|
|
39
|
-
icon: "archive"
|
|
40
|
-
}, {
|
|
41
|
-
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" This ticket is archived. Comments, edits, and attachments are locked for both customer and staff. ", -1)])]),
|
|
42
|
-
_: 1
|
|
43
|
-
})) : isApproved.value ? (openBlock(), createBlock(ActionBannerAlert_default, {
|
|
44
|
-
key: 1,
|
|
45
|
-
variant: "success",
|
|
46
|
-
icon: "lock"
|
|
47
|
-
}, {
|
|
48
|
-
default: withCtx(() => [createTextVNode(" This ticket was approved on " + toDisplayString(lockedDateFormatted.value) + ". ", 1)]),
|
|
49
|
-
_: 1
|
|
50
|
-
})) : isRejected.value ? (openBlock(), createBlock(ActionBannerAlert_default, {
|
|
51
|
-
key: 2,
|
|
52
|
-
variant: "error",
|
|
53
|
-
icon: "lock"
|
|
54
|
-
}, {
|
|
55
|
-
default: withCtx(() => [createTextVNode(" This ticket was rejected on " + toDisplayString(lockedDateFormatted.value) + ". ", 1)]),
|
|
56
|
-
_: 1
|
|
57
|
-
})) : createCommentVNode("v-if", true);
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
var CustomerActionBanner_default = _sfc_main$5;
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region src/slices/support_ticket/customer/components/CustomerMetadataCard.vue
|
|
65
|
-
const _hoisted_1$4 = { class: "border border-base-200 rounded-lg p-4 md:p-6" };
|
|
66
|
-
const _hoisted_2$4 = { class: "grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-3" };
|
|
67
|
-
const _hoisted_3$3 = { class: "md:col-span-2" };
|
|
68
|
-
const _hoisted_4$3 = {
|
|
69
|
-
key: 0,
|
|
70
|
-
class: "whitespace-pre-wrap text-sm"
|
|
71
|
-
};
|
|
72
|
-
const _hoisted_5$3 = {
|
|
73
|
-
key: 0,
|
|
74
|
-
class: "text-base-content/50"
|
|
75
|
-
};
|
|
76
|
-
const _hoisted_6$3 = { class: "text-base-content/50" };
|
|
77
|
-
const _hoisted_7$3 = { class: "text-base-content/50" };
|
|
78
|
-
const _hoisted_8$2 = {
|
|
79
|
-
key: 0,
|
|
80
|
-
class: "flex justify-end gap-2 mt-4"
|
|
81
|
-
};
|
|
82
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
83
|
-
__name: "CustomerMetadataCard",
|
|
84
|
-
props: { ticket: {} },
|
|
85
|
-
emits: ["edit"],
|
|
86
|
-
setup(__props) {
|
|
87
|
-
const props = __props;
|
|
88
|
-
const canEdit = computed(() => !props.ticket.is_locked && !props.ticket.archived_at);
|
|
89
|
-
const displayApprovalStatus = computed(() => {
|
|
90
|
-
const s = props.ticket.status;
|
|
91
|
-
if (s === "PENDING") return "PENDING";
|
|
92
|
-
if (s === "CANCELLED") return "REJECTED";
|
|
93
|
-
return "APPROVED";
|
|
94
|
-
});
|
|
95
|
-
const ticketDisplayId = computed(() => formatTicketDisplayId(props.ticket.display_id, props.ticket.display_id_prefix, props.ticket.id));
|
|
96
|
-
const createdFormatted = computed(() => {
|
|
97
|
-
const at = props.ticket.created_at;
|
|
98
|
-
return at ? formatTicketDate(at).formatted : "";
|
|
99
|
-
});
|
|
100
|
-
const createdRelative = computed(() => {
|
|
101
|
-
const at = props.ticket.created_at;
|
|
102
|
-
return at ? formatTicketDate(at).relative : "";
|
|
103
|
-
});
|
|
104
|
-
const showCredits = computed(() => {
|
|
105
|
-
return !!props.ticket.is_locked && !!props.ticket.locked_approval_at;
|
|
106
|
-
});
|
|
107
|
-
const creditDisplay = computed(() => formatCustomerCreditValue(props.ticket.credit_value));
|
|
108
|
-
const targetFormatted = computed(() => props.ticket.target_at ? formatTicketDate(props.ticket.target_at).formatted : "");
|
|
109
|
-
const targetRelative = computed(() => props.ticket.target_at ? formatTicketDate(props.ticket.target_at).relative : "");
|
|
110
|
-
const completedFormatted = computed(() => props.ticket.completed_at ? formatTicketDate(props.ticket.completed_at).formatted : "");
|
|
111
|
-
const completedRelative = computed(() => props.ticket.completed_at ? formatTicketDate(props.ticket.completed_at).relative : "");
|
|
112
|
-
return (_ctx, _cache) => {
|
|
113
|
-
return openBlock(), createElementBlock("div", _hoisted_1$4, [createElementVNode("div", _hoisted_2$4, [
|
|
114
|
-
createVNode(MetadataField_default, { label: "Status" }, {
|
|
115
|
-
default: withCtx(() => [createVNode(SupportTicketApprovalBadge_default, {
|
|
116
|
-
"approval-status": displayApprovalStatus.value,
|
|
117
|
-
size: "sm"
|
|
118
|
-
}, null, 8, ["approval-status"])]),
|
|
119
|
-
_: 1
|
|
120
|
-
}),
|
|
121
|
-
createVNode(MetadataField_default, { label: "Type" }, {
|
|
122
|
-
default: withCtx(() => [createVNode(SupportTicketTypeBadge_default, {
|
|
123
|
-
type: __props.ticket.type,
|
|
124
|
-
size: "sm"
|
|
125
|
-
}, null, 8, ["type"])]),
|
|
126
|
-
_: 1
|
|
127
|
-
}),
|
|
128
|
-
createVNode(MetadataField_default, { label: "Priority" }, {
|
|
129
|
-
default: withCtx(() => [createVNode(SupportTicketPriorityBadge_default, {
|
|
130
|
-
priority: __props.ticket.priority,
|
|
131
|
-
size: "sm"
|
|
132
|
-
}, null, 8, ["priority"])]),
|
|
133
|
-
_: 1
|
|
134
|
-
}),
|
|
135
|
-
createVNode(MetadataField_default, { label: "Requester" }, {
|
|
136
|
-
default: withCtx(() => [createTextVNode(toDisplayString(__props.ticket.created_by_display_name), 1)]),
|
|
137
|
-
_: 1
|
|
138
|
-
}),
|
|
139
|
-
createElementVNode("div", _hoisted_3$3, [createVNode(MetadataField_default, { label: "Description" }, {
|
|
140
|
-
empty: withCtx(() => [..._cache[1] || (_cache[1] = [createElementVNode("span", { class: "text-base-content/50 italic text-sm" }, "No description provided", -1)])]),
|
|
141
|
-
default: withCtx(() => [__props.ticket.description?.trim() ? (openBlock(), createElementBlock("p", _hoisted_4$3, toDisplayString(__props.ticket.description), 1)) : createCommentVNode("v-if", true)]),
|
|
142
|
-
_: 1
|
|
143
|
-
})]),
|
|
144
|
-
createVNode(MetadataField_default, {
|
|
145
|
-
label: "Ticket ID",
|
|
146
|
-
copyable: true
|
|
147
|
-
}, {
|
|
148
|
-
default: withCtx(() => [createTextVNode(toDisplayString(ticketDisplayId.value), 1)]),
|
|
149
|
-
_: 1
|
|
150
|
-
}),
|
|
151
|
-
createVNode(MetadataField_default, { label: "Created" }, {
|
|
152
|
-
default: withCtx(() => [createTextVNode(toDisplayString(createdFormatted.value) + " ", 1), createdRelative.value ? (openBlock(), createElementBlock("span", _hoisted_5$3, "· " + toDisplayString(createdRelative.value), 1)) : createCommentVNode("v-if", true)]),
|
|
153
|
-
_: 1
|
|
154
|
-
}),
|
|
155
|
-
showCredits.value ? (openBlock(), createBlock(MetadataField_default, {
|
|
156
|
-
key: 0,
|
|
157
|
-
label: "Credits"
|
|
158
|
-
}, {
|
|
159
|
-
default: withCtx(() => [createTextVNode(toDisplayString(creditDisplay.value), 1)]),
|
|
160
|
-
_: 1
|
|
161
|
-
})) : createCommentVNode("v-if", true),
|
|
162
|
-
__props.ticket.target_at ? (openBlock(), createBlock(MetadataField_default, {
|
|
163
|
-
key: 1,
|
|
164
|
-
label: "Target"
|
|
165
|
-
}, {
|
|
166
|
-
default: withCtx(() => [createTextVNode(toDisplayString(targetFormatted.value) + " ", 1), createElementVNode("span", _hoisted_6$3, "· " + toDisplayString(targetRelative.value), 1)]),
|
|
167
|
-
_: 1
|
|
168
|
-
})) : createCommentVNode("v-if", true),
|
|
169
|
-
__props.ticket.completed_at ? (openBlock(), createBlock(MetadataField_default, {
|
|
170
|
-
key: 2,
|
|
171
|
-
label: "Completed"
|
|
172
|
-
}, {
|
|
173
|
-
default: withCtx(() => [createTextVNode(toDisplayString(completedFormatted.value) + " ", 1), createElementVNode("span", _hoisted_7$3, "· " + toDisplayString(completedRelative.value), 1)]),
|
|
174
|
-
_: 1
|
|
175
|
-
})) : createCommentVNode("v-if", true)
|
|
176
|
-
]), canEdit.value ? (openBlock(), createElementBlock("div", _hoisted_8$2, [createElementVNode("button", {
|
|
177
|
-
type: "button",
|
|
178
|
-
class: "btn btn-sm",
|
|
179
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit"))
|
|
180
|
-
}, [..._cache[2] || (_cache[2] = [createElementVNode("svg", {
|
|
181
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
182
|
-
fill: "none",
|
|
183
|
-
viewBox: "0 0 24 24",
|
|
184
|
-
"stroke-width": "1.5",
|
|
185
|
-
stroke: "currentColor",
|
|
186
|
-
class: "w-4 h-4 mr-2"
|
|
187
|
-
}, [createElementVNode("path", {
|
|
188
|
-
"stroke-linecap": "round",
|
|
189
|
-
"stroke-linejoin": "round",
|
|
190
|
-
d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
|
|
191
|
-
})], -1), createTextVNode(" Edit ", -1)])])])) : createCommentVNode("v-if", true)]);
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
var CustomerMetadataCard_default = _sfc_main$4;
|
|
196
|
-
|
|
197
|
-
//#endregion
|
|
198
|
-
//#region src/slices/support_ticket/customer/components/CustomerSupportTicketSubscribeControl.vue
|
|
199
|
-
const _hoisted_1$3 = {
|
|
200
|
-
key: 0,
|
|
201
|
-
class: "flex flex-wrap items-center justify-between gap-3 rounded-lg border border-base-200 bg-base-200/30 px-4 py-3"
|
|
202
|
-
};
|
|
203
|
-
const _hoisted_2$3 = { class: "flex items-center gap-3 min-w-0" };
|
|
204
|
-
const _hoisted_3$2 = {
|
|
205
|
-
key: 0,
|
|
206
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
207
|
-
class: "h-5 w-5",
|
|
208
|
-
fill: "none",
|
|
209
|
-
viewBox: "0 0 24 24",
|
|
210
|
-
stroke: "currentColor",
|
|
211
|
-
"stroke-width": "2"
|
|
212
|
-
};
|
|
213
|
-
const _hoisted_4$2 = { class: "text-sm text-base-content/80 min-w-0" };
|
|
214
|
-
const _hoisted_5$2 = ["disabled"];
|
|
215
|
-
const _hoisted_6$2 = {
|
|
216
|
-
key: 0,
|
|
217
|
-
class: "loading loading-spinner loading-xs"
|
|
218
|
-
};
|
|
219
|
-
const _hoisted_7$2 = { key: 1 };
|
|
220
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
221
|
-
__name: "CustomerSupportTicketSubscribeControl",
|
|
222
|
-
props: { ticket: {} },
|
|
223
|
-
setup(__props) {
|
|
224
|
-
const props = __props;
|
|
225
|
-
const isToggling = ref(false);
|
|
226
|
-
const subscriptionOverride = ref(null);
|
|
227
|
-
watch(() => props.ticket.id, () => {
|
|
228
|
-
subscriptionOverride.value = null;
|
|
229
|
-
});
|
|
230
|
-
const isSubscribed = computed(() => subscriptionOverride.value ?? props.ticket.my_subscription != null);
|
|
231
|
-
const { mutate: toggleSubscription } = useMutation((api, id) => api.supportTickets.toggleSubscription(id), { invalidate: /^support-tickets?:/ });
|
|
232
|
-
async function handleToggle() {
|
|
233
|
-
try {
|
|
234
|
-
isToggling.value = true;
|
|
235
|
-
const result = await toggleSubscription(props.ticket.id);
|
|
236
|
-
subscriptionOverride.value = result.subscribed;
|
|
237
|
-
toast.success(result.subscribed ? "You are now subscribed to this ticket" : "You have unsubscribed from this ticket");
|
|
238
|
-
} catch (e) {
|
|
239
|
-
toast.error(extractRpcErrorMessage(e, "Failed to update subscription"));
|
|
240
|
-
} finally {
|
|
241
|
-
isToggling.value = false;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return (_ctx, _cache) => {
|
|
245
|
-
return __props.ticket ? (openBlock(), createElementBlock("div", _hoisted_1$3, [createElementVNode("div", _hoisted_2$3, [
|
|
246
|
-
createElementVNode("div", { class: normalizeClass(["flex h-9 w-9 shrink-0 items-center justify-center rounded-lg", isSubscribed.value ? "bg-info/20 text-info" : "bg-base-300 text-base-content/60"]) }, [createCommentVNode(" Bell (subscribed) "), isSubscribed.value ? (openBlock(), createElementBlock("svg", _hoisted_3$2, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
247
|
-
"stroke-linecap": "round",
|
|
248
|
-
"stroke-linejoin": "round",
|
|
249
|
-
d: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
|
|
250
|
-
}, null, -1)])])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Bell with slash (unsubscribed) "), _cache[1] || (_cache[1] = createElementVNode("svg", {
|
|
251
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
252
|
-
class: "h-5 w-5",
|
|
253
|
-
fill: "none",
|
|
254
|
-
viewBox: "0 0 24 24",
|
|
255
|
-
stroke: "currentColor",
|
|
256
|
-
"stroke-width": "2"
|
|
257
|
-
}, [createElementVNode("path", {
|
|
258
|
-
"stroke-linecap": "round",
|
|
259
|
-
"stroke-linejoin": "round",
|
|
260
|
-
d: "M9.143 17.082a24.248 24.248 0 0 0 3.844.148m-3.844-.148a23.856 23.856 0 0 1-5.455-1.31 8.964 8.964 0 0 0 2.3-5.542m3.155 6.852a3 3 0 0 0 5.667 1.97m1.965-2.277L21 21m-4.225-4.225a23.81 23.81 0 0 0 3.536-1.003A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6.53 6.53m10.245 10.245L6.53 6.53M3 3l3.53 3.53"
|
|
261
|
-
})], -1))], 2112))], 2),
|
|
262
|
-
createElementVNode("p", _hoisted_4$2, toDisplayString(isSubscribed.value ? "You will receive notifications for updates." : "Get notified when there are updates or new comments."), 1),
|
|
263
|
-
createElementVNode("button", {
|
|
264
|
-
type: "button",
|
|
265
|
-
class: normalizeClass(["btn btn-sm shrink-0 font-medium", isSubscribed.value ? "btn-outline" : "btn-info"]),
|
|
266
|
-
disabled: isToggling.value,
|
|
267
|
-
onClick: handleToggle
|
|
268
|
-
}, [isToggling.value ? (openBlock(), createElementBlock("span", _hoisted_6$2)) : (openBlock(), createElementBlock("span", _hoisted_7$2, toDisplayString(isSubscribed.value ? "Unsubscribe" : "Subscribe"), 1))], 10, _hoisted_5$2)
|
|
269
|
-
])])) : createCommentVNode("v-if", true);
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
});
|
|
273
|
-
var CustomerSupportTicketSubscribeControl_default = _sfc_main$3;
|
|
274
|
-
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region src/slices/support_ticket/customer/customerMetadataCardEditFormMetadata.ts
|
|
277
|
-
const customerMetadataCardEditFormMetadata = withMetadata(CustomerSupportTicketUpdateSchema, "customerMetadataCardEditForm", {
|
|
278
|
-
title: {
|
|
279
|
-
label: "Title",
|
|
280
|
-
placeholder: "Enter ticket title"
|
|
281
|
-
},
|
|
282
|
-
description: {
|
|
283
|
-
label: "Description",
|
|
284
|
-
inputType: "textarea",
|
|
285
|
-
placeholder: "Describe the ticket in detail"
|
|
286
|
-
},
|
|
287
|
-
type: { label: "Type" },
|
|
288
|
-
priority: {
|
|
289
|
-
label: "Priority",
|
|
290
|
-
inputType: "select",
|
|
291
|
-
valueToLabel: SUPPORT_TICKET_PRIORITY_NUMBER_TO_LABEL,
|
|
292
|
-
valueType: "number"
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
//#endregion
|
|
297
|
-
//#region src/slices/support_ticket/customer/components/CustomerMetadataCardEdit.vue
|
|
298
|
-
const _hoisted_1$2 = { class: "border border-base-200 rounded-lg p-4 md:p-6" };
|
|
299
|
-
const _hoisted_2$2 = { class: "grid grid-cols-1 md:grid-cols-2 gap-4" };
|
|
300
|
-
const _hoisted_3$1 = { class: "form-control md:col-span-2" };
|
|
301
|
-
const _hoisted_4$1 = { class: "form-control md:col-span-2" };
|
|
302
|
-
const _hoisted_5$1 = { class: "form-control" };
|
|
303
|
-
const _hoisted_6$1 = { class: "form-control" };
|
|
304
|
-
const _hoisted_7$1 = {
|
|
305
|
-
key: 0,
|
|
306
|
-
class: "alert alert-error py-2 mt-4"
|
|
307
|
-
};
|
|
308
|
-
const _hoisted_8$1 = { class: "text-sm" };
|
|
309
|
-
const _hoisted_9$1 = { class: "flex justify-end gap-2 mt-4" };
|
|
310
|
-
const _hoisted_10$1 = ["disabled"];
|
|
311
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
312
|
-
__name: "CustomerMetadataCardEdit",
|
|
313
|
-
props: {
|
|
314
|
-
ticket: {},
|
|
315
|
-
saving: { type: Boolean }
|
|
316
|
-
},
|
|
317
|
-
emits: ["success", "cancel"],
|
|
318
|
-
setup(__props, { emit: __emit }) {
|
|
319
|
-
const props = __props;
|
|
320
|
-
const emit = __emit;
|
|
321
|
-
const { mutate: updateTicket, loading: isSaving } = useMutation((api, input) => api.supportTickets.updateTicket(input), { invalidate: /^support-tickets?:/ });
|
|
322
|
-
const saving = computed(() => props.saving ?? isSaving.value);
|
|
323
|
-
const { form, zinia, ZiniaForm, ZiniaSubmitButton, ZiniaFormErrorsSummary } = useForm(customerMetadataCardEditFormMetadata, {
|
|
324
|
-
storeName: `customer-metadata-card-edit-${props.ticket.id}`,
|
|
325
|
-
persistToLocalStorage: false,
|
|
326
|
-
renderStyle: "daisy_ui",
|
|
327
|
-
fetchData: async () => {
|
|
328
|
-
const t = props.ticket;
|
|
329
|
-
return {
|
|
330
|
-
id: t.id,
|
|
331
|
-
title: t.title || "",
|
|
332
|
-
description: t.description ?? "",
|
|
333
|
-
type: t.type,
|
|
334
|
-
priority: supportTicketPriorityToNumber(t.priority)
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
function buildPayload(formData) {
|
|
339
|
-
return {
|
|
340
|
-
id: props.ticket.id,
|
|
341
|
-
title: String(formData.title ?? "").trim(),
|
|
342
|
-
description: formData.description || "",
|
|
343
|
-
type: formData.type,
|
|
344
|
-
priority: formData.priority
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
async function handleSubmit(formData) {
|
|
348
|
-
await updateTicket(buildPayload(formData));
|
|
349
|
-
}
|
|
350
|
-
function handleSuccess() {
|
|
351
|
-
emit("success");
|
|
352
|
-
}
|
|
353
|
-
function handleError(error) {
|
|
354
|
-
const message = extractRpcErrorMessage(error, "Failed to update ticket");
|
|
355
|
-
form.setSubmitError(message);
|
|
356
|
-
}
|
|
357
|
-
function handleCancel() {
|
|
358
|
-
emit("cancel");
|
|
359
|
-
}
|
|
360
|
-
return (_ctx, _cache) => {
|
|
361
|
-
return openBlock(), createElementBlock("div", _hoisted_1$2, [createVNode(unref(ZiniaForm), {
|
|
362
|
-
onHandleSubmit: handleSubmit,
|
|
363
|
-
onSuccess: handleSuccess,
|
|
364
|
-
onError: handleError,
|
|
365
|
-
title: "",
|
|
366
|
-
subtitle: ""
|
|
367
|
-
}, {
|
|
368
|
-
default: withCtx(() => [
|
|
369
|
-
createElementVNode("div", _hoisted_2$2, [
|
|
370
|
-
createCommentVNode(" Title - full width "),
|
|
371
|
-
createElementVNode("div", _hoisted_3$1, [createVNode(unref(zinia).TitleField, { placeholder: "Enter ticket title" })]),
|
|
372
|
-
createCommentVNode(" Description - full width "),
|
|
373
|
-
createElementVNode("div", _hoisted_4$1, [createVNode(unref(zinia).DescriptionField, {
|
|
374
|
-
class: "w-full",
|
|
375
|
-
placeholder: "Describe the ticket in detail"
|
|
376
|
-
})]),
|
|
377
|
-
createCommentVNode(" Type "),
|
|
378
|
-
createElementVNode("div", _hoisted_5$1, [createVNode(unref(zinia).TypeField)]),
|
|
379
|
-
createCommentVNode(" Priority "),
|
|
380
|
-
createElementVNode("div", _hoisted_6$1, [createVNode(unref(zinia).PriorityField)])
|
|
381
|
-
]),
|
|
382
|
-
unref(form).submitError ? (openBlock(), createElementBlock("div", _hoisted_7$1, [createElementVNode("span", _hoisted_8$1, toDisplayString(unref(form).submitError), 1)])) : createCommentVNode("v-if", true),
|
|
383
|
-
createVNode(unref(ZiniaFormErrorsSummary), { title: "Please fix the following errors:" }),
|
|
384
|
-
createCommentVNode(" Action Buttons "),
|
|
385
|
-
createElementVNode("div", _hoisted_9$1, [createElementVNode("button", {
|
|
386
|
-
type: "button",
|
|
387
|
-
class: "btn btn-ghost",
|
|
388
|
-
onClick: handleCancel,
|
|
389
|
-
disabled: saving.value
|
|
390
|
-
}, " Cancel ", 8, _hoisted_10$1), createVNode(unref(ZiniaSubmitButton), {
|
|
391
|
-
submitText: "Save",
|
|
392
|
-
submittingText: "Saving..."
|
|
393
|
-
})])
|
|
394
|
-
]),
|
|
395
|
-
_: 1
|
|
396
|
-
})]);
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
});
|
|
400
|
-
var CustomerMetadataCardEdit_default = _sfc_main$2;
|
|
401
|
-
|
|
402
|
-
//#endregion
|
|
403
|
-
//#region src/slices/support_ticket/customer/components/CustomerTimeline.vue
|
|
404
|
-
const _hoisted_1$1 = { class: "flex flex-col gap-4 w-full" };
|
|
405
|
-
const _hoisted_2$1 = {
|
|
406
|
-
key: 0,
|
|
407
|
-
class: "text-base-content/50 text-sm text-center py-8"
|
|
408
|
-
};
|
|
409
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
410
|
-
__name: "CustomerTimeline",
|
|
411
|
-
props: {
|
|
412
|
-
ticket: {},
|
|
413
|
-
notes: {},
|
|
414
|
-
systemEvents: {},
|
|
415
|
-
commentsLocked: { type: Boolean },
|
|
416
|
-
onAddNote: { type: Function }
|
|
417
|
-
},
|
|
418
|
-
setup(__props, { expose: __expose }) {
|
|
419
|
-
const props = __props;
|
|
420
|
-
const noteInputRef = ref(null);
|
|
421
|
-
const mergedTimelineItems = computed(() => {
|
|
422
|
-
const items = [];
|
|
423
|
-
for (const note of props.notes ?? []) items.push({
|
|
424
|
-
type: "customer-note",
|
|
425
|
-
timestamp: note.createdAt,
|
|
426
|
-
id: `note-${note.createdAt}-${note.authorName}`,
|
|
427
|
-
data: note
|
|
428
|
-
});
|
|
429
|
-
for (const event of props.systemEvents ?? []) items.push({
|
|
430
|
-
type: "system-event",
|
|
431
|
-
timestamp: event.timestamp,
|
|
432
|
-
id: event.id,
|
|
433
|
-
data: event
|
|
434
|
-
});
|
|
435
|
-
items.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
|
|
436
|
-
return items;
|
|
437
|
-
});
|
|
438
|
-
function resetInput() {
|
|
439
|
-
noteInputRef.value?.reset();
|
|
440
|
-
}
|
|
441
|
-
__expose({ resetInput });
|
|
442
|
-
return (_ctx, _cache) => {
|
|
443
|
-
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
444
|
-
createVNode(TimelineNoteInput_default, {
|
|
445
|
-
ref_key: "noteInputRef",
|
|
446
|
-
ref: noteInputRef,
|
|
447
|
-
"show-type-toggle": false,
|
|
448
|
-
disabled: __props.commentsLocked ?? false,
|
|
449
|
-
"on-submit": __props.onAddNote
|
|
450
|
-
}, null, 8, ["disabled", "on-submit"]),
|
|
451
|
-
mergedTimelineItems.value.length === 0 ? (openBlock(), createElementBlock("p", _hoisted_2$1, " No activity yet. ")) : createCommentVNode("v-if", true),
|
|
452
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(mergedTimelineItems.value, (item) => {
|
|
453
|
-
return openBlock(), createElementBlock(Fragment, { key: item.id }, [item.type === "customer-note" ? (openBlock(), createBlock(TimelineItem_default, {
|
|
454
|
-
key: 0,
|
|
455
|
-
"author-name": item.data.authorName,
|
|
456
|
-
"created-at": item.data.createdAt,
|
|
457
|
-
variant: "customer"
|
|
458
|
-
}, {
|
|
459
|
-
default: withCtx(() => [createTextVNode(toDisplayString(item.data.body ?? ""), 1)]),
|
|
460
|
-
_: 2
|
|
461
|
-
}, 1032, ["author-name", "created-at"])) : item.type === "system-event" ? (openBlock(), createBlock(TimelineSystemEvent_default, {
|
|
462
|
-
key: 1,
|
|
463
|
-
author: item.data.author,
|
|
464
|
-
message: item.data.message,
|
|
465
|
-
timestamp: item.data.timestamp,
|
|
466
|
-
action: item.data.action,
|
|
467
|
-
type: item.data.type,
|
|
468
|
-
details: item.data.details,
|
|
469
|
-
"old-value": item.data.oldValue,
|
|
470
|
-
"new-value": item.data.newValue,
|
|
471
|
-
changes: item.data.changes
|
|
472
|
-
}, null, 8, [
|
|
473
|
-
"author",
|
|
474
|
-
"message",
|
|
475
|
-
"timestamp",
|
|
476
|
-
"action",
|
|
477
|
-
"type",
|
|
478
|
-
"details",
|
|
479
|
-
"old-value",
|
|
480
|
-
"new-value",
|
|
481
|
-
"changes"
|
|
482
|
-
])) : createCommentVNode("v-if", true)], 64);
|
|
483
|
-
}), 128))
|
|
484
|
-
]);
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
});
|
|
488
|
-
var CustomerTimeline_default = _sfc_main$1;
|
|
489
|
-
|
|
490
|
-
//#endregion
|
|
491
|
-
//#region src/slices/support_ticket/customer/CustomerSupportTicketDetailPage.vue
|
|
492
|
-
const _hoisted_1 = {
|
|
493
|
-
key: 0,
|
|
494
|
-
class: "flex justify-center items-center p-8"
|
|
495
|
-
};
|
|
496
|
-
const _hoisted_2 = { class: "alert alert-error mb-4 max-w-4xl mx-auto px-4" };
|
|
497
|
-
const _hoisted_3 = { class: "flex-1" };
|
|
498
|
-
const _hoisted_4 = { class: "mt-2" };
|
|
499
|
-
const _hoisted_5 = { class: "px-4 py-6 max-w-4xl mx-auto" };
|
|
500
|
-
const _hoisted_6 = { class: "mb-6" };
|
|
501
|
-
const _hoisted_7 = { class: "text-2xl font-bold text-base-content break-words leading-tight mt-2" };
|
|
502
|
-
const _hoisted_8 = { class: "mb-6" };
|
|
503
|
-
const _hoisted_9 = { class: "mb-6" };
|
|
504
|
-
const _hoisted_10 = { class: "mb-8" };
|
|
505
|
-
const _hoisted_11 = { class: "mb-8" };
|
|
506
|
-
const _hoisted_12 = {
|
|
507
|
-
key: 1,
|
|
508
|
-
class: "alert alert-error mb-4"
|
|
509
|
-
};
|
|
510
|
-
const _hoisted_13 = {
|
|
511
|
-
key: 2,
|
|
512
|
-
class: "flex justify-center items-center py-8"
|
|
513
|
-
};
|
|
514
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
515
|
-
__name: "CustomerSupportTicketDetailPage",
|
|
516
|
-
props: {
|
|
517
|
-
ticket: {},
|
|
518
|
-
isLoading: { type: Boolean },
|
|
519
|
-
error: {}
|
|
520
|
-
},
|
|
521
|
-
setup(__props) {
|
|
522
|
-
const props = __props;
|
|
523
|
-
const route = useRoute();
|
|
524
|
-
const router = useRouter();
|
|
525
|
-
const support_ticket_id = route.params.id;
|
|
526
|
-
const isEditMode = computed(() => route.query.mode === "edit");
|
|
527
|
-
const refreshTicket = inject("refreshTicket");
|
|
528
|
-
const isCommentsLocked = computed(() => {
|
|
529
|
-
if (!props.ticket) return false;
|
|
530
|
-
return !!props.ticket.archived_at;
|
|
531
|
-
});
|
|
532
|
-
const { data: timelineData, error: timelineError, refetch: refetchTimeline } = useQuery(async (api) => {
|
|
533
|
-
const [customerNotes, recordVersions] = await Promise.all([api.notes.getNotes({
|
|
534
|
-
record_id: {
|
|
535
|
-
operator: OPERATORS.EQUALS,
|
|
536
|
-
value: support_ticket_id
|
|
537
|
-
},
|
|
538
|
-
record_type: {
|
|
539
|
-
operator: OPERATORS.EQUALS,
|
|
540
|
-
value: "support_ticket"
|
|
541
|
-
},
|
|
542
|
-
is_internal: {
|
|
543
|
-
operator: OPERATORS.EQUALS,
|
|
544
|
-
value: false
|
|
545
|
-
},
|
|
546
|
-
first: 100,
|
|
547
|
-
sortBy: "created_at",
|
|
548
|
-
sortDirection: "asc"
|
|
549
|
-
}), api.recordVersions.listRecordVersionsCustomer(support_ticket_id, RecordConst.SUPPORT_TICKET, {
|
|
550
|
-
record_types: [RecordConst.SUPPORT_TICKET, RecordConst.SUPPORT_TICKET_ACTIVITY],
|
|
551
|
-
first: 100,
|
|
552
|
-
sortBy: "recorded_at",
|
|
553
|
-
sortDirection: "asc"
|
|
554
|
-
})]);
|
|
555
|
-
return {
|
|
556
|
-
customerNotes,
|
|
557
|
-
recordVersions
|
|
558
|
-
};
|
|
559
|
-
}, {
|
|
560
|
-
enabled: !!support_ticket_id && !!props.ticket,
|
|
561
|
-
batchMode: BATCH_MODE.batch,
|
|
562
|
-
trackedSegment: "customer-support-ticket-timeline"
|
|
563
|
-
});
|
|
564
|
-
const customerNotesForTimeline = computed(() => {
|
|
565
|
-
return (timelineData.value?.customerNotes?.items ?? []).map((n) => ({
|
|
566
|
-
authorName: n.created_by_display_name ?? n.created_by ?? "(unknown)",
|
|
567
|
-
createdAt: n.created_at,
|
|
568
|
-
body: n.body ?? ""
|
|
569
|
-
})).sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
570
|
-
});
|
|
571
|
-
const allSystemEvents = computed(() => {
|
|
572
|
-
const data = timelineData.value?.recordVersions;
|
|
573
|
-
const versions = data?.items ?? [];
|
|
574
|
-
const userDisplayMap = data?.user_display_map;
|
|
575
|
-
return parseRecordVersions(versions, userDisplayMap ? new Map(Object.entries(userDisplayMap)) : void 0);
|
|
576
|
-
});
|
|
577
|
-
const filteredSystemEvents = computed(() => {
|
|
578
|
-
if (!props.ticket) return [];
|
|
579
|
-
const events = allSystemEvents.value;
|
|
580
|
-
const isPending = props.ticket.status === "PENDING" || !props.ticket.is_locked;
|
|
581
|
-
const STAFF_ONLY_FIELDS = new Set([
|
|
582
|
-
"dev_lifecycle",
|
|
583
|
-
"delivered_value",
|
|
584
|
-
"start_at"
|
|
585
|
-
]);
|
|
586
|
-
return events.filter((event) => {
|
|
587
|
-
if (event.fieldName) {
|
|
588
|
-
if (STAFF_ONLY_FIELDS.has(event.fieldName)) return false;
|
|
589
|
-
if (isPending && event.fieldName === "credit_value") return false;
|
|
590
|
-
return true;
|
|
591
|
-
}
|
|
592
|
-
const message = event.message.toLowerCase();
|
|
593
|
-
if (message.includes("dev lifecycle") || message.includes("moved") || message.includes("delivered value") || message.includes("start date")) return false;
|
|
594
|
-
if (isPending && (message.includes("credits") || message.includes("credit"))) return false;
|
|
595
|
-
return true;
|
|
596
|
-
});
|
|
597
|
-
});
|
|
598
|
-
const { mutate: createNote } = useMutation((api, input) => api.notes.createNote(input), { invalidate: /^notes?:/ });
|
|
599
|
-
async function handleAddNote(payload) {
|
|
600
|
-
try {
|
|
601
|
-
await createNote({
|
|
602
|
-
record_id: support_ticket_id,
|
|
603
|
-
record_type: "support_ticket",
|
|
604
|
-
body: payload.content,
|
|
605
|
-
tag: null,
|
|
606
|
-
is_internal: false
|
|
607
|
-
});
|
|
608
|
-
await refetchTimeline();
|
|
609
|
-
toast.success("Comment added");
|
|
610
|
-
} catch {
|
|
611
|
-
toast.error("Failed to add comment");
|
|
612
|
-
throw new Error("Failed to add comment");
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
function enterEditMode() {
|
|
616
|
-
router.push({
|
|
617
|
-
name: route.name || "CustomerViewSupportTicket",
|
|
618
|
-
params: route.params,
|
|
619
|
-
query: {
|
|
620
|
-
...route.query,
|
|
621
|
-
mode: "edit"
|
|
622
|
-
}
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
async function exitEditMode() {
|
|
626
|
-
await router.push({
|
|
627
|
-
name: route.name || "CustomerViewSupportTicket",
|
|
628
|
-
params: route.params,
|
|
629
|
-
query: {
|
|
630
|
-
...route.query,
|
|
631
|
-
mode: void 0
|
|
632
|
-
}
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
async function handleMetadataSaveSuccess() {
|
|
636
|
-
await exitEditMode();
|
|
637
|
-
await nextTick();
|
|
638
|
-
toast.success("Ticket updated successfully");
|
|
639
|
-
if (refreshTicket) await refreshTicket();
|
|
640
|
-
await refetchTimeline();
|
|
641
|
-
}
|
|
642
|
-
return (_ctx, _cache) => {
|
|
643
|
-
const _component_router_link = resolveComponent("router-link");
|
|
644
|
-
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" Loading State (only on initial load; refetch keeps content visible) "), __props.isLoading && !__props.ticket ? (openBlock(), createElementBlock("div", _hoisted_1, [..._cache[1] || (_cache[1] = [createElementVNode("span", { class: "loading loading-spinner loading-lg" }, null, -1)])])) : __props.error ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Error State "), createElementVNode("div", _hoisted_2, [_cache[3] || (_cache[3] = createElementVNode("svg", {
|
|
645
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
646
|
-
class: "stroke-current shrink-0 h-6 w-6",
|
|
647
|
-
fill: "none",
|
|
648
|
-
viewBox: "0 0 24 24"
|
|
649
|
-
}, [createElementVNode("path", {
|
|
650
|
-
"stroke-linecap": "round",
|
|
651
|
-
"stroke-linejoin": "round",
|
|
652
|
-
"stroke-width": "2",
|
|
653
|
-
d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
654
|
-
})], -1)), createElementVNode("div", _hoisted_3, [createElementVNode("span", null, toDisplayString(__props.error.message || "An error occurred"), 1), createElementVNode("div", _hoisted_4, [createVNode(_component_router_link, {
|
|
655
|
-
to: { name: "CustomerSupportTicketList" },
|
|
656
|
-
class: "link link-primary"
|
|
657
|
-
}, {
|
|
658
|
-
default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Go back to ticket list ", -1)])]),
|
|
659
|
-
_: 1
|
|
660
|
-
})])])])], 2112)) : __props.ticket ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" Main Content "), createElementVNode("div", _hoisted_5, [
|
|
661
|
-
createCommentVNode(" Header "),
|
|
662
|
-
createElementVNode("div", _hoisted_6, [createElementVNode("h1", _hoisted_7, toDisplayString(__props.ticket.title), 1)]),
|
|
663
|
-
createCommentVNode(" Action Banner "),
|
|
664
|
-
createElementVNode("div", _hoisted_8, [createVNode(CustomerActionBanner_default, { ticket: __props.ticket }, null, 8, ["ticket"])]),
|
|
665
|
-
createCommentVNode(" Subscribe / Unsubscribe "),
|
|
666
|
-
createElementVNode("div", _hoisted_9, [createVNode(CustomerSupportTicketSubscribeControl_default, { ticket: __props.ticket }, null, 8, ["ticket"])]),
|
|
667
|
-
createCommentVNode(" Metadata Card (Display or Edit) "),
|
|
668
|
-
createElementVNode("div", _hoisted_10, [!isEditMode.value ? (openBlock(), createBlock(CustomerMetadataCard_default, {
|
|
669
|
-
key: 0,
|
|
670
|
-
ticket: __props.ticket,
|
|
671
|
-
onEdit: enterEditMode
|
|
672
|
-
}, null, 8, ["ticket"])) : (openBlock(), createBlock(CustomerMetadataCardEdit_default, {
|
|
673
|
-
key: 1,
|
|
674
|
-
ticket: __props.ticket,
|
|
675
|
-
onSuccess: handleMetadataSaveSuccess,
|
|
676
|
-
onCancel: exitEditMode
|
|
677
|
-
}, null, 8, ["ticket"]))]),
|
|
678
|
-
createCommentVNode(" Attachments (separate from timeline so adding a comment doesn't cause refetch) "),
|
|
679
|
-
createElementVNode("div", _hoisted_11, [createVNode(SupportTicketAttachmentsCollapsible_default, {
|
|
680
|
-
"record-id": __props.ticket.id,
|
|
681
|
-
locked: isCommentsLocked.value,
|
|
682
|
-
editable: !isCommentsLocked.value,
|
|
683
|
-
onUploaded: unref(refetchTimeline),
|
|
684
|
-
onDeleted: unref(refetchTimeline)
|
|
685
|
-
}, null, 8, [
|
|
686
|
-
"record-id",
|
|
687
|
-
"locked",
|
|
688
|
-
"editable",
|
|
689
|
-
"onUploaded",
|
|
690
|
-
"onDeleted"
|
|
691
|
-
])]),
|
|
692
|
-
createCommentVNode(" Timeline: stay mounted once we have data so adding a comment doesn't unmount/remount "),
|
|
693
|
-
createElementVNode("div", null, [unref(timelineData) != null ? (openBlock(), createBlock(CustomerTimeline_default, {
|
|
694
|
-
key: 0,
|
|
695
|
-
ticket: __props.ticket,
|
|
696
|
-
notes: customerNotesForTimeline.value,
|
|
697
|
-
"system-events": filteredSystemEvents.value,
|
|
698
|
-
"comments-locked": isCommentsLocked.value,
|
|
699
|
-
"on-add-note": handleAddNote
|
|
700
|
-
}, null, 8, [
|
|
701
|
-
"ticket",
|
|
702
|
-
"notes",
|
|
703
|
-
"system-events",
|
|
704
|
-
"comments-locked"
|
|
705
|
-
])) : unref(timelineError) ? (openBlock(), createElementBlock("div", _hoisted_12, [createElementVNode("span", null, toDisplayString(unref(timelineError)?.message ?? "Failed to load timeline"), 1), createElementVNode("button", {
|
|
706
|
-
class: "btn btn-sm btn-outline mt-2",
|
|
707
|
-
onClick: _cache[0] || (_cache[0] = (...args) => unref(refetchTimeline) && unref(refetchTimeline)(...args))
|
|
708
|
-
}, " Retry ")])) : (openBlock(), createElementBlock("div", _hoisted_13, [..._cache[4] || (_cache[4] = [createElementVNode("span", { class: "loading loading-spinner loading-lg" }, null, -1)])]))])
|
|
709
|
-
])], 2112)) : createCommentVNode("v-if", true)], 2112);
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
var CustomerSupportTicketDetailPage_default = _sfc_main;
|
|
714
|
-
|
|
715
|
-
//#endregion
|
|
716
|
-
export { CustomerSupportTicketDetailPage_default as default };
|
|
717
|
-
//# sourceMappingURL=CustomerSupportTicketDetailPage-DZQCplSM.js.map
|