@dragonmastery/dragoncore-vue 0.0.1
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/LICENSE +75 -0
- package/dist/AppLink-CHMMrSFI.js +54 -0
- package/dist/AppLink-CHMMrSFI.js.map +1 -0
- package/dist/Appearance-BfPdKMXw.js +70 -0
- package/dist/Appearance-BfPdKMXw.js.map +1 -0
- package/dist/Appearance-C3WguxT-.js +3 -0
- package/dist/ChangePasswordPage-Btu5lf-r.js +86 -0
- package/dist/ChangePasswordPage-Btu5lf-r.js.map +1 -0
- package/dist/ChangePasswordPage-mBBuQMkT.js +6 -0
- package/dist/CreateTeamForm-n2ut93vM.js +43 -0
- package/dist/CreateTeamMemberForm-CcH3AxNL.js +43 -0
- package/dist/CreateUserPage-CDrGuW9B.js +6 -0
- package/dist/CreateUserPage-Cmx8xjjv.js +76 -0
- package/dist/CreateUserPage-Cmx8xjjv.js.map +1 -0
- package/dist/CreditBalanceDashboard-DLz0ioP3.js +43 -0
- package/dist/CreditManagement-D3q5S-qc.js +43 -0
- package/dist/CustomerCreateSupportTicketForm-Ci7QYkG-.js +43 -0
- package/dist/CustomerEditSupportTicketForm-Dd5ZB74k.js +159 -0
- package/dist/CustomerEditSupportTicketForm-Dd5ZB74k.js.map +1 -0
- package/dist/CustomerEditSupportTicketForm-lLchVjnw.js +9 -0
- package/dist/CustomerSupportTicketAttachmentsTab-gBrVO97t.js +43 -0
- package/dist/CustomerSupportTicketCustomerNotesTab-D0jhzbOY.js +8 -0
- package/dist/CustomerSupportTicketCustomerNotesTab-D1aa9It7.js +23 -0
- package/dist/CustomerSupportTicketCustomerNotesTab-D1aa9It7.js.map +1 -0
- package/dist/CustomerSupportTicketHistoryTab-BNTf8EZq.js +6 -0
- package/dist/CustomerSupportTicketHistoryTab-CFYN_Sa4.js +17 -0
- package/dist/CustomerSupportTicketHistoryTab-CFYN_Sa4.js.map +1 -0
- package/dist/CustomerSupportTicketList-BkOzFxMP.js +6 -0
- package/dist/CustomerSupportTicketList-C2nUPawb.js +166 -0
- package/dist/CustomerSupportTicketList-C2nUPawb.js.map +1 -0
- package/dist/CustomerSupportTicketParent-2mONd9kL.js +66 -0
- package/dist/CustomerSupportTicketParent-2mONd9kL.js.map +1 -0
- package/dist/CustomerSupportTicketParent-N8ko1yFE.js +7 -0
- package/dist/CustomerSupportTicketSuccess-w_-9NXT4.js +43 -0
- package/dist/CustomerViewSupportTicket-CVwNH0lS.js +11 -0
- package/dist/CustomerViewSupportTicket-tZkxragu.js +363 -0
- package/dist/CustomerViewSupportTicket-tZkxragu.js.map +1 -0
- package/dist/EditTeamForm-BioqiTWE.js +43 -0
- package/dist/EditTeamMemberForm-DCq0Gsn_.js +7 -0
- package/dist/EditTeamMemberForm-ru4WgLz-.js +169 -0
- package/dist/EditTeamMemberForm-ru4WgLz-.js.map +1 -0
- package/dist/EditUserPage-BxJ5QvIM.js +112 -0
- package/dist/EditUserPage-BxJ5QvIM.js.map +1 -0
- package/dist/EditUserPage-XOBuxUxd.js +7 -0
- package/dist/FieldsetSection-CsHN38_o.js +27 -0
- package/dist/FieldsetSection-CsHN38_o.js.map +1 -0
- package/dist/ForgotPassword-CpqvcSFg.js +7 -0
- package/dist/ForgotPassword-CqhenzUG.js +73 -0
- package/dist/ForgotPassword-CqhenzUG.js.map +1 -0
- package/dist/InlineAttachments-I39rOvip.js +1351 -0
- package/dist/InlineAttachments-I39rOvip.js.map +1 -0
- package/dist/LoginForm-AM0qkfbU.js +7 -0
- package/dist/LoginForm-_PZ51Uwe.js +116 -0
- package/dist/LoginForm-_PZ51Uwe.js.map +1 -0
- package/dist/Logout-BMjiqHnS.js +38 -0
- package/dist/Logout-BMjiqHnS.js.map +1 -0
- package/dist/Logout-BfiBjlaH.js +6 -0
- package/dist/NoteList-C0hRPNMO.js +497 -0
- package/dist/NoteList-C0hRPNMO.js.map +1 -0
- package/dist/NotificationEmailsPage-BjRqtW95.js +141 -0
- package/dist/NotificationEmailsPage-BjRqtW95.js.map +1 -0
- package/dist/NotificationEmailsPage-bx-9rg3x.js +7 -0
- package/dist/ResetPassword-BQLkR9TZ.js +43 -0
- package/dist/Signup-CnCcQlB8.js +7 -0
- package/dist/Signup-c2-_yMOM.js +106 -0
- package/dist/Signup-c2-_yMOM.js.map +1 -0
- package/dist/StaffCreateSupportTicketForm-ChVFDJdA.js +43 -0
- package/dist/StaffEditSupportTicketForm-DY1Zkf5k.js +9 -0
- package/dist/StaffEditSupportTicketForm-DuUKuIGg.js +263 -0
- package/dist/StaffEditSupportTicketForm-DuUKuIGg.js.map +1 -0
- package/dist/StaffSupportTicketAttachmentsTab-DpDXsHXP.js +43 -0
- package/dist/StaffSupportTicketCustomerNotesTab-CusqQV2-.js +23 -0
- package/dist/StaffSupportTicketCustomerNotesTab-CusqQV2-.js.map +1 -0
- package/dist/StaffSupportTicketCustomerNotesTab-rbJHJ0_V.js +8 -0
- package/dist/StaffSupportTicketHistoryTab-D24myEm3.js +17 -0
- package/dist/StaffSupportTicketHistoryTab-D24myEm3.js.map +1 -0
- package/dist/StaffSupportTicketHistoryTab-nmVma5vp.js +6 -0
- package/dist/StaffSupportTicketInternalNotesTab-D8HM--dp.js +23 -0
- package/dist/StaffSupportTicketInternalNotesTab-D8HM--dp.js.map +1 -0
- package/dist/StaffSupportTicketInternalNotesTab-DihYd5XI.js +8 -0
- package/dist/StaffSupportTicketList-DelptSmK.js +43 -0
- package/dist/StaffSupportTicketParent-BCrj3ckV.js +7 -0
- package/dist/StaffSupportTicketParent-Cx1buQZw.js +66 -0
- package/dist/StaffSupportTicketParent-Cx1buQZw.js.map +1 -0
- package/dist/StaffSupportTicketSuccess-BYxtY5wZ.js +43 -0
- package/dist/StaffSupportTicketWorkflowTab-BrDDBeK9.js +9 -0
- package/dist/StaffSupportTicketWorkflowTab-DmVTPzxS.js +1234 -0
- package/dist/StaffSupportTicketWorkflowTab-DmVTPzxS.js.map +1 -0
- package/dist/SupportTicketHistoryTab-CLMopA7a.js +220 -0
- package/dist/SupportTicketHistoryTab-CLMopA7a.js.map +1 -0
- package/dist/SupportTicketStatusBadge-YdZzjvkh.js +163 -0
- package/dist/SupportTicketStatusBadge-YdZzjvkh.js.map +1 -0
- package/dist/TeamAttachmentsTab-BxUpTWYh.js +43 -0
- package/dist/TeamHistoryTab-CUCT9MRG.js +5 -0
- package/dist/TeamHistoryTab-gB3H2KZv.js +219 -0
- package/dist/TeamHistoryTab-gB3H2KZv.js.map +1 -0
- package/dist/TeamList-By6pzWm5.js +43 -0
- package/dist/TeamMemberList-CYV9fWEb.js +43 -0
- package/dist/TeamMemberParent-CVvGqpxD.js +43 -0
- package/dist/TeamMembersTab-4gmnP9sD.js +21 -0
- package/dist/TeamMembersTab-4gmnP9sD.js.map +1 -0
- package/dist/TeamMembersTab-CpE9BaCi.js +3 -0
- package/dist/TeamNotesTab-pfXTDhg6.js +23 -0
- package/dist/TeamNotesTab-pfXTDhg6.js.map +1 -0
- package/dist/TeamNotesTab-u4cDC67X.js +8 -0
- package/dist/TeamParent-BxT1KubK.js +43 -0
- package/dist/UserListPage-DsQdH2Sm.js +4 -0
- package/dist/UserListPage-WU56KiWj.js +153 -0
- package/dist/UserListPage-WU56KiWj.js.map +1 -0
- package/dist/UserProfilePage-B73JhjUu.js +7 -0
- package/dist/UserProfilePage-BtLUY1kt.js +125 -0
- package/dist/UserProfilePage-BtLUY1kt.js.map +1 -0
- package/dist/ViewTeam-DzX-obEl.js +43 -0
- package/dist/ViewTeamMember-PF6S_4Pb.js +43 -0
- package/dist/ZiniaContainer-C7c7Vwkh.js +18 -0
- package/dist/ZiniaContainer-C7c7Vwkh.js.map +1 -0
- package/dist/convertToLocalDateTime-D4IoNvRj.js +111 -0
- package/dist/convertToLocalDateTime-D4IoNvRj.js.map +1 -0
- package/dist/creditValueFormatter-DftEzu8d.js +128 -0
- package/dist/creditValueFormatter-DftEzu8d.js.map +1 -0
- package/dist/displayIdFormatter-Dz900Awr.js +13 -0
- package/dist/displayIdFormatter-Dz900Awr.js.map +1 -0
- package/dist/index.d.ts +6068 -0
- package/dist/index.js +45 -0
- package/dist/src-o5fMIo5_.js +6649 -0
- package/dist/src-o5fMIo5_.js.map +1 -0
- package/dist/useBreadcrumbs-DmgSucoe.js +41 -0
- package/dist/useBreadcrumbs-DmgSucoe.js.map +1 -0
- package/dist/useMutation-CFwe7H9j.js +50 -0
- package/dist/useMutation-CFwe7H9j.js.map +1 -0
- package/dist/useQuery-p7oJO7OD.js +107 -0
- package/dist/useQuery-p7oJO7OD.js.map +1 -0
- package/dist/useQueryCache-ByayvZgZ.js +254 -0
- package/dist/useQueryCache-ByayvZgZ.js.map +1 -0
- package/dist/useRpcAuth-BLlRSHy8.js +722 -0
- package/dist/useRpcAuth-BLlRSHy8.js.map +1 -0
- package/package.json +62 -0
- package/src/daisyui.css +63 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamMembersTab-4gmnP9sD.js","names":[],"sources":["../src/slices/team/TeamMembersTab.vue"],"sourcesContent":["<template>\n <RouterView />\n</template>\n"],"mappings":";;;;;;;;;;;;;;qBACE,YAAc,sBAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { t as NoteList_default } from "./NoteList-C0hRPNMO.js";
|
|
2
|
+
import { createBlock, defineComponent, openBlock, unref } from "vue";
|
|
3
|
+
import { useRoute } from "vue-router";
|
|
4
|
+
|
|
5
|
+
//#region src/slices/team/TeamNotesTab.vue
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "TeamNotesTab",
|
|
8
|
+
setup(__props) {
|
|
9
|
+
const team_id = useRoute().params.id;
|
|
10
|
+
return (_ctx, _cache) => {
|
|
11
|
+
return openBlock(), createBlock(NoteList_default, {
|
|
12
|
+
recordId: unref(team_id),
|
|
13
|
+
recordType: "team",
|
|
14
|
+
mode: "customer"
|
|
15
|
+
}, null, 8, ["recordId"]);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var TeamNotesTab_default = _sfc_main;
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { TeamNotesTab_default as t };
|
|
23
|
+
//# sourceMappingURL=TeamNotesTab-pfXTDhg6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamNotesTab-pfXTDhg6.js","names":[],"sources":["../src/slices/team/TeamNotesTab.vue"],"sourcesContent":["<template>\n <NoteList :recordId=\"team_id\" recordType=\"team\" mode=\"customer\" />\n</template>\n\n<script setup lang=\"ts\">\nimport NoteList from '../note/components/NoteList.vue';\nimport { useRoute } from 'vue-router';\n\nconst route = useRoute();\nconst team_id = route.params.id as string;\n</script>\n"],"mappings":";;;;;;;;EASA,MAAM,UADQ,UAAU,CACF,OAAO;;uBAR3B,YAAkE,kBAAA;IAAvD,UAAU,MAAA,QAAO;IAAE,YAAW;IAAO,MAAK"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./useRpcAuth-BLlRSHy8.js";
|
|
2
|
+
import "./useQueryCache-ByayvZgZ.js";
|
|
3
|
+
import "./useMutation-CFwe7H9j.js";
|
|
4
|
+
import "./useQuery-p7oJO7OD.js";
|
|
5
|
+
import "./NoteList-C0hRPNMO.js";
|
|
6
|
+
import { t as TeamNotesTab_default } from "./TeamNotesTab-pfXTDhg6.js";
|
|
7
|
+
|
|
8
|
+
export { TeamNotesTab_default as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "./useRpcAuth-BLlRSHy8.js";
|
|
2
|
+
import "./useQueryCache-ByayvZgZ.js";
|
|
3
|
+
import "./useMutation-CFwe7H9j.js";
|
|
4
|
+
import "./useQuery-p7oJO7OD.js";
|
|
5
|
+
import { W as TeamParent_default } from "./src-o5fMIo5_.js";
|
|
6
|
+
import "./AppLink-CHMMrSFI.js";
|
|
7
|
+
import "./InlineAttachments-I39rOvip.js";
|
|
8
|
+
import "./TeamMembersTab-4gmnP9sD.js";
|
|
9
|
+
import "./Appearance-BfPdKMXw.js";
|
|
10
|
+
import "./useBreadcrumbs-DmgSucoe.js";
|
|
11
|
+
import "./FieldsetSection-CsHN38_o.js";
|
|
12
|
+
import "./ZiniaContainer-C7c7Vwkh.js";
|
|
13
|
+
import "./NoteList-C0hRPNMO.js";
|
|
14
|
+
import "./UserProfilePage-BtLUY1kt.js";
|
|
15
|
+
import "./ChangePasswordPage-Btu5lf-r.js";
|
|
16
|
+
import "./TeamHistoryTab-gB3H2KZv.js";
|
|
17
|
+
import "./TeamNotesTab-pfXTDhg6.js";
|
|
18
|
+
import "./EditTeamMemberForm-ru4WgLz-.js";
|
|
19
|
+
import "./SupportTicketStatusBadge-YdZzjvkh.js";
|
|
20
|
+
import "./creditValueFormatter-DftEzu8d.js";
|
|
21
|
+
import "./CustomerSupportTicketList-C2nUPawb.js";
|
|
22
|
+
import "./CustomerEditSupportTicketForm-Dd5ZB74k.js";
|
|
23
|
+
import "./CustomerViewSupportTicket-tZkxragu.js";
|
|
24
|
+
import "./CustomerSupportTicketParent-2mONd9kL.js";
|
|
25
|
+
import "./CustomerSupportTicketCustomerNotesTab-D1aa9It7.js";
|
|
26
|
+
import "./SupportTicketHistoryTab-CLMopA7a.js";
|
|
27
|
+
import "./CustomerSupportTicketHistoryTab-CFYN_Sa4.js";
|
|
28
|
+
import "./StaffSupportTicketWorkflowTab-DmVTPzxS.js";
|
|
29
|
+
import "./StaffEditSupportTicketForm-DuUKuIGg.js";
|
|
30
|
+
import "./StaffSupportTicketParent-Cx1buQZw.js";
|
|
31
|
+
import "./StaffSupportTicketCustomerNotesTab-CusqQV2-.js";
|
|
32
|
+
import "./StaffSupportTicketInternalNotesTab-D8HM--dp.js";
|
|
33
|
+
import "./StaffSupportTicketHistoryTab-D24myEm3.js";
|
|
34
|
+
import "./LoginForm-_PZ51Uwe.js";
|
|
35
|
+
import "./Signup-c2-_yMOM.js";
|
|
36
|
+
import "./ForgotPassword-CqhenzUG.js";
|
|
37
|
+
import "./Logout-BMjiqHnS.js";
|
|
38
|
+
import "./UserListPage-WU56KiWj.js";
|
|
39
|
+
import "./CreateUserPage-Cmx8xjjv.js";
|
|
40
|
+
import "./NotificationEmailsPage-BjRqtW95.js";
|
|
41
|
+
import "./EditUserPage-BxJ5QvIM.js";
|
|
42
|
+
|
|
43
|
+
export { TeamParent_default as default };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { r as executeWithAuth, s as getRefreshTokenHandler } from "./useRpcAuth-BLlRSHy8.js";
|
|
2
|
+
import { t as formatSystemTimestamp } from "./convertToLocalDateTime-D4IoNvRj.js";
|
|
3
|
+
import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, resolveComponent, toDisplayString, unref, withCtx } from "vue";
|
|
4
|
+
import { UserReadSchema } from "@dragonmastery/dragoncore-shared";
|
|
5
|
+
import { useCursorDataTable, withMetadata } from "@dragonmastery/zinia-forms-core";
|
|
6
|
+
|
|
7
|
+
//#region src/slices/admin/components/UserTypeBadge.vue
|
|
8
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "UserTypeBadge",
|
|
10
|
+
props: {
|
|
11
|
+
userType: {},
|
|
12
|
+
size: { default: "sm" }
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const typeConfig = {
|
|
17
|
+
consumer: {
|
|
18
|
+
label: "Consumer",
|
|
19
|
+
variant: "neutral"
|
|
20
|
+
},
|
|
21
|
+
lead: {
|
|
22
|
+
label: "Lead",
|
|
23
|
+
variant: "info"
|
|
24
|
+
},
|
|
25
|
+
staff: {
|
|
26
|
+
label: "Staff",
|
|
27
|
+
variant: "warning"
|
|
28
|
+
},
|
|
29
|
+
super_admin: {
|
|
30
|
+
label: "Admin",
|
|
31
|
+
variant: "error"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const typeLabel = computed(() => {
|
|
35
|
+
return typeConfig[props.userType]?.label || props.userType;
|
|
36
|
+
});
|
|
37
|
+
const badgeClasses = computed(() => {
|
|
38
|
+
const config = typeConfig[props.userType];
|
|
39
|
+
const baseClasses = `badge-${props.size}`;
|
|
40
|
+
if (!config) return `${baseClasses} badge-neutral`;
|
|
41
|
+
return `${baseClasses} badge-${config.variant}`;
|
|
42
|
+
});
|
|
43
|
+
return (_ctx, _cache) => {
|
|
44
|
+
return openBlock(), createElementBlock("span", { class: normalizeClass(["badge badge-sm", badgeClasses.value]) }, toDisplayString(typeLabel.value), 3);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
var UserTypeBadge_default = _sfc_main$1;
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/slices/admin/features/user_management/userRowSchema.ts
|
|
52
|
+
const userRowSchemaWithMetadata = withMetadata(UserReadSchema, "userRowSchema", {
|
|
53
|
+
username: { label: "Username" },
|
|
54
|
+
email: { label: "Email" },
|
|
55
|
+
user_type: { label: "Role" },
|
|
56
|
+
email_verified: { label: "Verified" },
|
|
57
|
+
created_at: { label: "Created" }
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/slices/admin/features/user_management/UserListPage.vue
|
|
62
|
+
const _hoisted_1 = { class: "mt-2" };
|
|
63
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
64
|
+
__name: "UserListPage",
|
|
65
|
+
setup(__props) {
|
|
66
|
+
const { ZiniaDataTable } = useCursorDataTable(userRowSchemaWithMetadata, {
|
|
67
|
+
fetchData: async () => {
|
|
68
|
+
return {
|
|
69
|
+
data: (await executeWithAuth(async (api) => {
|
|
70
|
+
return await api.users.listUsers();
|
|
71
|
+
}, { refreshTokenHandler: getRefreshTokenHandler() })).map((user) => ({
|
|
72
|
+
id: user.id,
|
|
73
|
+
username: user.username,
|
|
74
|
+
email: user.email,
|
|
75
|
+
email_verified: user.email_verified,
|
|
76
|
+
user_type: user.user_type,
|
|
77
|
+
created_at: user.created_at,
|
|
78
|
+
updated_at: user.updated_at ?? null
|
|
79
|
+
})),
|
|
80
|
+
hasNextPage: false,
|
|
81
|
+
hasPreviousPage: false,
|
|
82
|
+
prevPageCursor: void 0,
|
|
83
|
+
nextPageCursor: void 0
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
columns: {
|
|
87
|
+
username: {
|
|
88
|
+
label: "Username",
|
|
89
|
+
field: "username",
|
|
90
|
+
sortable: true
|
|
91
|
+
},
|
|
92
|
+
email: {
|
|
93
|
+
label: "Email",
|
|
94
|
+
field: "email",
|
|
95
|
+
sortable: true
|
|
96
|
+
},
|
|
97
|
+
user_type: {
|
|
98
|
+
label: "Role",
|
|
99
|
+
field: "user_type",
|
|
100
|
+
sortable: true
|
|
101
|
+
},
|
|
102
|
+
email_verified: {
|
|
103
|
+
label: "Verified",
|
|
104
|
+
field: "email_verified",
|
|
105
|
+
sortable: true
|
|
106
|
+
},
|
|
107
|
+
created_at: {
|
|
108
|
+
label: "Created",
|
|
109
|
+
field: "created_at",
|
|
110
|
+
sortable: true
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
actions: { items: [{
|
|
114
|
+
key: "edit",
|
|
115
|
+
icon: "edit",
|
|
116
|
+
size: "xs",
|
|
117
|
+
variant: "primary",
|
|
118
|
+
type: "link",
|
|
119
|
+
href: (row) => `/admin/users/${row.id}/edit`
|
|
120
|
+
}] },
|
|
121
|
+
pagination: { pageSize: 100 }
|
|
122
|
+
});
|
|
123
|
+
return (_ctx, _cache) => {
|
|
124
|
+
const _component_router_link = resolveComponent("router-link");
|
|
125
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
126
|
+
createCommentVNode(" Header with title and actions "),
|
|
127
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "flex justify-between items-center mb-4" }, [createElementVNode("h1", { class: "text-2xl font-bold" }, "User Management")], -1)),
|
|
128
|
+
createCommentVNode(" Zinia Data Table "),
|
|
129
|
+
createVNode(unref(ZiniaDataTable), null, {
|
|
130
|
+
"cell-user_type": withCtx(({ row }) => [createVNode(UserTypeBadge_default, { "user-type": row.user_type }, null, 8, ["user-type"])]),
|
|
131
|
+
"cell-email_verified": withCtx(({ row }) => [createElementVNode("span", { class: normalizeClass(["badge badge-sm", row.email_verified ? "badge-success" : "badge-error"]) }, toDisplayString(row.email_verified ? "Verified" : "Not Verified"), 3)]),
|
|
132
|
+
"cell-created_at": withCtx(({ row }) => [createTextVNode(toDisplayString(unref(formatSystemTimestamp)(row.created_at)), 1)]),
|
|
133
|
+
"cell-actions": withCtx(({ row }) => [createVNode(_component_router_link, {
|
|
134
|
+
to: {
|
|
135
|
+
name: "EditUser",
|
|
136
|
+
params: { id: row.id }
|
|
137
|
+
},
|
|
138
|
+
class: "btn btn-sm btn-primary"
|
|
139
|
+
}, {
|
|
140
|
+
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Edit ", -1)])]),
|
|
141
|
+
_: 1
|
|
142
|
+
}, 8, ["to"])]),
|
|
143
|
+
_: 1
|
|
144
|
+
})
|
|
145
|
+
]);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
var UserListPage_default = _sfc_main;
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
export { userRowSchemaWithMetadata as n, UserTypeBadge_default as r, UserListPage_default as t };
|
|
153
|
+
//# sourceMappingURL=UserListPage-WU56KiWj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserListPage-WU56KiWj.js","names":["mappedUsers: UserRow[]"],"sources":["../src/slices/admin/components/UserTypeBadge.vue","../src/slices/admin/features/user_management/userRowSchema.ts","../src/slices/admin/features/user_management/UserListPage.vue"],"sourcesContent":["<template>\n <span class=\"badge badge-sm\" :class=\"badgeClasses\">\n {{ typeLabel }}\n </span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\ninterface Props {\n userType: 'consumer' | 'lead' | 'staff' | 'super_admin';\n size?: 'xs' | 'sm' | 'md' | 'lg';\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n size: 'sm',\n});\n\nconst typeConfig = {\n consumer: {\n label: 'Consumer',\n variant: 'neutral',\n },\n lead: {\n label: 'Lead',\n variant: 'info',\n },\n staff: {\n label: 'Staff',\n variant: 'warning',\n },\n super_admin: {\n label: 'Admin',\n variant: 'error',\n },\n};\n\nconst typeLabel = computed(() => {\n return typeConfig[props.userType]?.label || props.userType;\n});\n\nconst badgeClasses = computed(() => {\n const config = typeConfig[props.userType];\n const baseClasses = `badge-${props.size}`;\n\n if (!config) {\n return `${baseClasses} badge-neutral`;\n }\n\n return `${baseClasses} badge-${config.variant}`;\n});\n</script>\n","import { withMetadata } from '@dragonmastery/zinia-forms-core';\nimport { UserReadSchema } from '@dragonmastery/dragoncore-shared';\nimport type { z } from 'zod';\n\nexport const userRowSchemaWithMetadata = withMetadata(UserReadSchema, 'userRowSchema', {\n username: { label: 'Username' },\n email: { label: 'Email' },\n user_type: { label: 'Role' },\n email_verified: { label: 'Verified' },\n created_at: { label: 'Created' },\n});\n\nexport type UserRow = z.infer<typeof UserReadSchema>;\n","<template>\n <div class=\"mt-2\">\n <!-- Header with title and actions -->\n <div class=\"flex justify-between items-center mb-4\">\n <h1 class=\"text-2xl font-bold\">User Management</h1>\n </div>\n\n <!-- Zinia Data Table -->\n <ZiniaDataTable>\n <!-- Custom cell templates -->\n <template #cell-user_type=\"{ row }\">\n <UserTypeBadge :user-type=\"row.user_type\" />\n </template>\n\n <template #cell-email_verified=\"{ row }\">\n <span\n class=\"badge badge-sm\"\n :class=\"row.email_verified ? 'badge-success' : 'badge-error'\"\n >\n {{ row.email_verified ? 'Verified' : 'Not Verified' }}\n </span>\n </template>\n\n <template #cell-created_at=\"{ row }\">\n {{ formatSystemTimestamp(row.created_at) }}\n </template>\n\n <template #cell-actions=\"{ row }\">\n <router-link\n :to=\"{ name: 'EditUser', params: { id: row.id } }\"\n class=\"btn btn-sm btn-primary\"\n >\n Edit\n </router-link>\n </template>\n </ZiniaDataTable>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { executeWithAuth } from '../../../../composables/useRpcAuth';\nimport { getRefreshTokenHandler } from '../../../../utils/EnhancedRefreshTokenHandler';\nimport { formatSystemTimestamp } from '../../../../utils/convertToLocalDateTime';\nimport { useCursorDataTable } from '@dragonmastery/zinia-forms-core';\nimport UserTypeBadge from '../../components/UserTypeBadge.vue';\nimport { userRowSchemaWithMetadata, type UserRow } from './userRowSchema';\n\n// Set up data table\nconst { ZiniaDataTable } = useCursorDataTable(userRowSchemaWithMetadata, {\n fetchData: async () => {\n const users = await executeWithAuth(\n async (api) => {\n return await api.users.listUsers();\n },\n { refreshTokenHandler: getRefreshTokenHandler() },\n );\n\n // Map response to UserRow format\n const mappedUsers: UserRow[] = users.map((user) => ({\n id: user.id,\n username: user.username,\n email: user.email,\n email_verified: user.email_verified,\n user_type: user.user_type,\n created_at: user.created_at,\n updated_at: user.updated_at ?? null,\n }));\n\n return {\n data: mappedUsers,\n hasNextPage: false,\n hasPreviousPage: false,\n prevPageCursor: undefined,\n nextPageCursor: undefined,\n };\n },\n\n // Column configuration\n columns: {\n username: { label: 'Username', field: 'username', sortable: true },\n email: { label: 'Email', field: 'email', sortable: true },\n user_type: { label: 'Role', field: 'user_type', sortable: true },\n email_verified: {\n label: 'Verified',\n field: 'email_verified',\n sortable: true,\n },\n created_at: { label: 'Created', field: 'created_at', sortable: true },\n },\n\n // Action buttons\n actions: {\n items: [\n {\n key: 'edit',\n icon: 'edit',\n size: 'xs',\n variant: 'primary',\n type: 'link',\n href: (row: UserRow) => `/admin/users/${row.id}/edit`,\n },\n ],\n },\n\n pagination: {\n pageSize: 100,\n },\n});\n</script>\n"],"mappings":";;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAId,MAAM,aAAa;GACjB,UAAU;IACR,OAAO;IACP,SAAS;IACV;GACD,MAAM;IACJ,OA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RpcAuth-BLlRSHy8.js";
|
|
2
|
+
import "./useQueryCache-ByayvZgZ.js";
|
|
3
|
+
import "./useMutation-CFwe7H9j.js";
|
|
4
|
+
import "./useQuery-p7oJO7OD.js";
|
|
5
|
+
import { t as UserProfilePage_default } from "./UserProfilePage-BtLUY1kt.js";
|
|
6
|
+
|
|
7
|
+
export { UserProfilePage_default as default };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { l as useUserSessionStore } from "./useRpcAuth-BLlRSHy8.js";
|
|
2
|
+
import { t as useMutation } from "./useMutation-CFwe7H9j.js";
|
|
3
|
+
import { t as useQuery } from "./useQuery-p7oJO7OD.js";
|
|
4
|
+
import { createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
5
|
+
import { UserProfileUpdateSchema } from "@dragonmastery/dragoncore-shared";
|
|
6
|
+
import { useForm, withMetadata } from "@dragonmastery/zinia-forms-core";
|
|
7
|
+
import { toast } from "vue3-toastify";
|
|
8
|
+
|
|
9
|
+
//#region src/slices/user/features/user_profile/userProfileSchema.ts
|
|
10
|
+
const userProfileSchemaWithMetadata = withMetadata(UserProfileUpdateSchema, "userProfileSchema", {
|
|
11
|
+
first_name: {
|
|
12
|
+
inputType: "text",
|
|
13
|
+
placeholder: "Enter first name",
|
|
14
|
+
helpText: "Enter the first name",
|
|
15
|
+
autocomplete: "first-name",
|
|
16
|
+
autofocus: true
|
|
17
|
+
},
|
|
18
|
+
last_name: {
|
|
19
|
+
inputType: "text",
|
|
20
|
+
placeholder: "Enter last name",
|
|
21
|
+
helpText: "Enter the last name",
|
|
22
|
+
autocomplete: "last-name"
|
|
23
|
+
},
|
|
24
|
+
bio: {
|
|
25
|
+
inputType: "textarea",
|
|
26
|
+
placeholder: "Enter bio",
|
|
27
|
+
helpText: "Enter a short bio"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/slices/user/features/user_profile/UserProfilePage.vue
|
|
33
|
+
const _hoisted_1 = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "flex justify-center items-center p-8"
|
|
36
|
+
};
|
|
37
|
+
const _hoisted_2 = {
|
|
38
|
+
key: 1,
|
|
39
|
+
class: "alert alert-error mb-4"
|
|
40
|
+
};
|
|
41
|
+
const _hoisted_3 = {
|
|
42
|
+
key: 2,
|
|
43
|
+
class: "max-w-md mx-auto bg-base-200 p-6 rounded-xl shadow-md container"
|
|
44
|
+
};
|
|
45
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
46
|
+
__name: "UserProfilePage",
|
|
47
|
+
setup(__props) {
|
|
48
|
+
const session = useUserSessionStore();
|
|
49
|
+
const { data: userProfileData, loading: userProfileFetching } = useQuery((api) => api.userProfiles.getCurrentUserProfile(), {
|
|
50
|
+
enabled: !!session.userSession?.user.userId,
|
|
51
|
+
staleTime: 300 * 1e3
|
|
52
|
+
});
|
|
53
|
+
const { form, zinia, ZiniaForm, ZiniaSubmitButton } = useForm(userProfileSchemaWithMetadata, {
|
|
54
|
+
storeName: "user-profile-form",
|
|
55
|
+
persistToLocalStorage: false,
|
|
56
|
+
renderStyle: "daisy_ui",
|
|
57
|
+
fetchData: async () => {
|
|
58
|
+
while (userProfileFetching.value) await new Promise((resolve) => setTimeout(resolve, 100));
|
|
59
|
+
if (!userProfileData.value) return {
|
|
60
|
+
user_id: session.userSession?.user.userId || "",
|
|
61
|
+
bio: "",
|
|
62
|
+
first_name: "",
|
|
63
|
+
last_name: ""
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
user_id: userProfileData.value.user_id,
|
|
67
|
+
bio: userProfileData.value.bio || "",
|
|
68
|
+
first_name: userProfileData.value.first_name || "",
|
|
69
|
+
last_name: userProfileData.value.last_name || ""
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const { mutate: updateUserProfile } = useMutation((api, input) => api.userProfiles.updateUserProfile(input), { invalidate: /^user:profile/ });
|
|
74
|
+
const handleSubmit = async (data) => {
|
|
75
|
+
if (!session.userSession?.user.userId) throw new Error("User session not found");
|
|
76
|
+
const result = await updateUserProfile({
|
|
77
|
+
user_id: session.userSession?.user.userId,
|
|
78
|
+
first_name: data.first_name,
|
|
79
|
+
last_name: data.last_name,
|
|
80
|
+
bio: data.bio
|
|
81
|
+
});
|
|
82
|
+
if (!result) throw new Error("Update user profile failed");
|
|
83
|
+
return result;
|
|
84
|
+
};
|
|
85
|
+
const handleSuccess = (_data) => {
|
|
86
|
+
toast.success("User profile updated successfully!");
|
|
87
|
+
};
|
|
88
|
+
const handleError = (error) => {
|
|
89
|
+
toast.error(error.message || "Update user profile failed");
|
|
90
|
+
};
|
|
91
|
+
return (_ctx, _cache) => {
|
|
92
|
+
return unref(form).isLoading ? (openBlock(), createElementBlock("div", _hoisted_1, [..._cache[0] || (_cache[0] = [createElementVNode("span", { class: "loading loading-spinner loading-lg" }, null, -1)])])) : unref(form).loadError ? (openBlock(), createElementBlock("div", _hoisted_2, [_cache[1] || (_cache[1] = createElementVNode("svg", {
|
|
93
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
94
|
+
class: "stroke-current shrink-0 h-6 w-6",
|
|
95
|
+
fill: "none",
|
|
96
|
+
viewBox: "0 0 24 24"
|
|
97
|
+
}, [createElementVNode("path", {
|
|
98
|
+
"stroke-linecap": "round",
|
|
99
|
+
"stroke-linejoin": "round",
|
|
100
|
+
"stroke-width": "2",
|
|
101
|
+
d: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
102
|
+
})], -1)), createElementVNode("span", null, toDisplayString(unref(form).loadError), 1)])) : (openBlock(), createElementBlock("div", _hoisted_3, [_cache[2] || (_cache[2] = createElementVNode("h1", { class: "text-2xl font-bold mb-6 text-center" }, "Update User Profile", -1)), createVNode(unref(ZiniaForm), {
|
|
103
|
+
onHandleSubmit: handleSubmit,
|
|
104
|
+
onSuccess: handleSuccess,
|
|
105
|
+
onError: handleError
|
|
106
|
+
}, {
|
|
107
|
+
default: withCtx(() => [
|
|
108
|
+
createVNode(unref(zinia).FirstNameField),
|
|
109
|
+
createVNode(unref(zinia).LastNameField),
|
|
110
|
+
createVNode(unref(zinia).BioField),
|
|
111
|
+
createVNode(unref(ZiniaSubmitButton), {
|
|
112
|
+
submitText: "Update",
|
|
113
|
+
submittingText: "Updating..."
|
|
114
|
+
})
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
})]));
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
var UserProfilePage_default = _sfc_main;
|
|
122
|
+
|
|
123
|
+
//#endregion
|
|
124
|
+
export { userProfileSchemaWithMetadata as n, UserProfilePage_default as t };
|
|
125
|
+
//# sourceMappingURL=UserProfilePage-BtLUY1kt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserProfilePage-BtLUY1kt.js","names":[],"sources":["../src/slices/user/features/user_profile/userProfileSchema.ts","../src/slices/user/features/user_profile/UserProfilePage.vue"],"sourcesContent":["import { withMetadata } from '@dragonmastery/zinia-forms-core';\nimport { UserProfileBaseSchema, UserProfileUpdateSchema } from '@dragonmastery/dragoncore-shared';\nimport { z } from 'zod';\n\n// Define the login form type\nexport type UserProfileForm = z.infer<typeof UserProfileBaseSchema>;\n\n// Enhance the schema with metadata\nexport const userProfileSchemaWithMetadata = withMetadata(\n UserProfileUpdateSchema,\n 'userProfileSchema',\n {\n first_name: {\n inputType: 'text',\n placeholder: 'Enter first name',\n helpText: 'Enter the first name',\n autocomplete: 'first-name',\n autofocus: true,\n },\n\n last_name: {\n inputType: 'text',\n placeholder: 'Enter last name',\n helpText: 'Enter the last name',\n autocomplete: 'last-name',\n },\n\n bio: {\n inputType: 'textarea',\n placeholder: 'Enter bio',\n helpText: 'Enter a short bio',\n },\n },\n);\n","<template>\n <div v-if=\"form.isLoading\" class=\"flex justify-center items-center p-8\">\n <span class=\"loading loading-spinner loading-lg\"></span>\n </div>\n <div v-else-if=\"form.loadError\" class=\"alert alert-error mb-4\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"stroke-current shrink-0 h-6 w-6\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n <span>{{ form.loadError }}</span>\n </div>\n <div v-else class=\"max-w-md mx-auto bg-base-200 p-6 rounded-xl shadow-md container\">\n <h1 class=\"text-2xl font-bold mb-6 text-center\">Update User Profile</h1>\n\n <ZiniaForm @handle-submit=\"handleSubmit\" @success=\"handleSuccess\" @error=\"handleError\">\n <zinia.FirstNameField />\n <zinia.LastNameField />\n <zinia.BioField />\n\n <ZiniaSubmitButton submitText=\"Update\" submittingText=\"Updating...\" />\n </ZiniaForm>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport type { UserProfileUpdateDto } from '@dragonmastery/dragoncore-shared';\nimport { useForm } from '@dragonmastery/zinia-forms-core';\nimport { toast } from 'vue3-toastify';\nimport { useMutation } from '../../../../composables/useMutation';\nimport { useQuery } from '../../../../composables/useQuery';\nimport { useUserSessionStore } from '../../../../composables/useUserSessionStore';\nimport { userProfileSchemaWithMetadata } from './userProfileSchema';\n\n//user session\nconst session = useUserSessionStore();\n\n// fetch user profile data\nconst { data: userProfileData, loading: userProfileFetching } = useQuery(\n (api) => api.userProfiles.getCurrentUserProfile(),\n {\n enabled: !!session.userSession?.user.userId,\n staleTime: 5 * 60 * 1000,\n },\n);\n\n// Create a type-safe form using our schema with metadata\nconst { form, zinia, ZiniaForm, ZiniaSubmitButton } = useForm(userProfileSchemaWithMetadata, {\n storeName: 'user-profile-form',\n persistToLocalStorage: false,\n renderStyle: 'daisy_ui',\n fetchData: async () => {\n while (userProfileFetching.value) {\n await new Promise((resolve) => setTimeout(resolve, 100));\n }\n\n if (!userProfileData.value) {\n return {\n user_id: session.userSession?.user.userId || '',\n bio: '',\n first_name: '',\n last_name: '',\n };\n }\n\n return {\n user_id: userProfileData.value.user_id,\n bio: userProfileData.value.bio || '',\n first_name: userProfileData.value.first_name || '',\n last_name: userProfileData.value.last_name || '',\n };\n },\n});\n\nconst { mutate: updateUserProfile } = useMutation(\n (api, input: UserProfileUpdateDto) => api.userProfiles.updateUserProfile(input),\n { invalidate: /^user:profile/ },\n);\n\n// Handle form submission\nconst handleSubmit = async (data: UserProfileUpdateDto) => {\n if (!session.userSession?.user.userId) {\n throw new Error('User session not found');\n }\n\n const result = await updateUserProfile({\n user_id: session.userSession?.user.userId,\n first_name: data.first_name,\n last_name: data.last_name,\n bio: data.bio,\n });\n if (!result) throw new Error('Update user profile failed');\n\n return result;\n};\n\n// Handle success\nconst handleSuccess = (_data: any) => {\n toast.success('User profile updated successfully!');\n};\n\n// Handle error\nconst handleError = (error: any) => {\n toast.error(error.message || 'Update user profile failed');\n};\n</script>\n"],"mappings":";;;;;;;;;AAQA,MAAa,gCAAgC,aAC3C,yBACA,qBACA;CACE,YAAY;EACV,WAAW;EACX,aAAa;EACb,UAAU;EACV,cAAc;EACd,WAAW;EACZ;CAED,WAAW;EACT,WAAW;EACX,aAAa;EACb,UAAU;EACV,cAAc;EACf;CAED,KAAK;EACH,WAAW;EACX,aAAa;EACb,UAAU;EACX;CACF,CACF;;;;;;;;;;;;;;;;;;;ECUD,MAAM,UAAU,qBAAqB;EAGrC,MAAM,EAAE,MAAM,iBAAiB,SAAS,wBAAwB,UAC7D,QAAQ,IAAI,aAAa,uBAAuB,EACjD;GACE,SAAS,CAAC,CAAC,QAAQ,aAAa,KAAK;GACrC,WAAW,MAAS;GACrB,CACF;EAGD,MAAM,EAAE,MAAM,OAAO,WAAW,sBAAsB,QAAQ,+BAA+B;GAC3F,WAAW;GACX,uBAAuB;GACvB,a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Q;OAER,mBAKE,QAAA;IAJA,kBAAe;IACf,mBAAgB;IAChB,gBAAa;IACb,GAAE;cAGN,mBAAiC,QAAA,MAAA,gBAAxB,MAAA,KAAI,CAAC,UAAS,EAAA,EAAA,CAAA,CAAA,KAAA,WAAA,EAEzB,mBAUM,OAVN,YAUM,CAAA,OAAA,OAAA,OAAA,KATJ,mBAAwE,MAAA,EAApE,OAAM,uCAAqC,EAAC,uBAAmB,GAAA,GAEnE,YAMY,MAAA,UAAA,EAAA;IANA,gBAAe;IAAe,WAAS;IAAgB,SAAO;;2BAChD;KAAxB,YAAwB,MAAA,MAAA,CAAA,eAAA;KACxB,YAAuB,MAAA,MAAA,CAAA,cAAA;KACvB,YAAkB,MAAA,MAAA,CAAA,SAAA;KAElB,YAAsE,MAAA,kBAAA,EAAA;MAAnD,YAAW;MAAS,gBAAe"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "./useRpcAuth-BLlRSHy8.js";
|
|
2
|
+
import "./useQueryCache-ByayvZgZ.js";
|
|
3
|
+
import "./useMutation-CFwe7H9j.js";
|
|
4
|
+
import "./useQuery-p7oJO7OD.js";
|
|
5
|
+
import { U as ViewTeam_default } from "./src-o5fMIo5_.js";
|
|
6
|
+
import "./AppLink-CHMMrSFI.js";
|
|
7
|
+
import "./InlineAttachments-I39rOvip.js";
|
|
8
|
+
import "./TeamMembersTab-4gmnP9sD.js";
|
|
9
|
+
import "./Appearance-BfPdKMXw.js";
|
|
10
|
+
import "./useBreadcrumbs-DmgSucoe.js";
|
|
11
|
+
import "./FieldsetSection-CsHN38_o.js";
|
|
12
|
+
import "./ZiniaContainer-C7c7Vwkh.js";
|
|
13
|
+
import "./NoteList-C0hRPNMO.js";
|
|
14
|
+
import "./UserProfilePage-BtLUY1kt.js";
|
|
15
|
+
import "./ChangePasswordPage-Btu5lf-r.js";
|
|
16
|
+
import "./TeamHistoryTab-gB3H2KZv.js";
|
|
17
|
+
import "./TeamNotesTab-pfXTDhg6.js";
|
|
18
|
+
import "./EditTeamMemberForm-ru4WgLz-.js";
|
|
19
|
+
import "./SupportTicketStatusBadge-YdZzjvkh.js";
|
|
20
|
+
import "./creditValueFormatter-DftEzu8d.js";
|
|
21
|
+
import "./CustomerSupportTicketList-C2nUPawb.js";
|
|
22
|
+
import "./CustomerEditSupportTicketForm-Dd5ZB74k.js";
|
|
23
|
+
import "./CustomerViewSupportTicket-tZkxragu.js";
|
|
24
|
+
import "./CustomerSupportTicketParent-2mONd9kL.js";
|
|
25
|
+
import "./CustomerSupportTicketCustomerNotesTab-D1aa9It7.js";
|
|
26
|
+
import "./SupportTicketHistoryTab-CLMopA7a.js";
|
|
27
|
+
import "./CustomerSupportTicketHistoryTab-CFYN_Sa4.js";
|
|
28
|
+
import "./StaffSupportTicketWorkflowTab-DmVTPzxS.js";
|
|
29
|
+
import "./StaffEditSupportTicketForm-DuUKuIGg.js";
|
|
30
|
+
import "./StaffSupportTicketParent-Cx1buQZw.js";
|
|
31
|
+
import "./StaffSupportTicketCustomerNotesTab-CusqQV2-.js";
|
|
32
|
+
import "./StaffSupportTicketInternalNotesTab-D8HM--dp.js";
|
|
33
|
+
import "./StaffSupportTicketHistoryTab-D24myEm3.js";
|
|
34
|
+
import "./LoginForm-_PZ51Uwe.js";
|
|
35
|
+
import "./Signup-c2-_yMOM.js";
|
|
36
|
+
import "./ForgotPassword-CqhenzUG.js";
|
|
37
|
+
import "./Logout-BMjiqHnS.js";
|
|
38
|
+
import "./UserListPage-WU56KiWj.js";
|
|
39
|
+
import "./CreateUserPage-Cmx8xjjv.js";
|
|
40
|
+
import "./NotificationEmailsPage-BjRqtW95.js";
|
|
41
|
+
import "./EditUserPage-BxJ5QvIM.js";
|
|
42
|
+
|
|
43
|
+
export { ViewTeam_default as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "./useRpcAuth-BLlRSHy8.js";
|
|
2
|
+
import "./useQueryCache-ByayvZgZ.js";
|
|
3
|
+
import "./useMutation-CFwe7H9j.js";
|
|
4
|
+
import "./useQuery-p7oJO7OD.js";
|
|
5
|
+
import { L as ViewTeamMember_default } from "./src-o5fMIo5_.js";
|
|
6
|
+
import "./AppLink-CHMMrSFI.js";
|
|
7
|
+
import "./InlineAttachments-I39rOvip.js";
|
|
8
|
+
import "./TeamMembersTab-4gmnP9sD.js";
|
|
9
|
+
import "./Appearance-BfPdKMXw.js";
|
|
10
|
+
import "./useBreadcrumbs-DmgSucoe.js";
|
|
11
|
+
import "./FieldsetSection-CsHN38_o.js";
|
|
12
|
+
import "./ZiniaContainer-C7c7Vwkh.js";
|
|
13
|
+
import "./NoteList-C0hRPNMO.js";
|
|
14
|
+
import "./UserProfilePage-BtLUY1kt.js";
|
|
15
|
+
import "./ChangePasswordPage-Btu5lf-r.js";
|
|
16
|
+
import "./TeamHistoryTab-gB3H2KZv.js";
|
|
17
|
+
import "./TeamNotesTab-pfXTDhg6.js";
|
|
18
|
+
import "./EditTeamMemberForm-ru4WgLz-.js";
|
|
19
|
+
import "./SupportTicketStatusBadge-YdZzjvkh.js";
|
|
20
|
+
import "./creditValueFormatter-DftEzu8d.js";
|
|
21
|
+
import "./CustomerSupportTicketList-C2nUPawb.js";
|
|
22
|
+
import "./CustomerEditSupportTicketForm-Dd5ZB74k.js";
|
|
23
|
+
import "./CustomerViewSupportTicket-tZkxragu.js";
|
|
24
|
+
import "./CustomerSupportTicketParent-2mONd9kL.js";
|
|
25
|
+
import "./CustomerSupportTicketCustomerNotesTab-D1aa9It7.js";
|
|
26
|
+
import "./SupportTicketHistoryTab-CLMopA7a.js";
|
|
27
|
+
import "./CustomerSupportTicketHistoryTab-CFYN_Sa4.js";
|
|
28
|
+
import "./StaffSupportTicketWorkflowTab-DmVTPzxS.js";
|
|
29
|
+
import "./StaffEditSupportTicketForm-DuUKuIGg.js";
|
|
30
|
+
import "./StaffSupportTicketParent-Cx1buQZw.js";
|
|
31
|
+
import "./StaffSupportTicketCustomerNotesTab-CusqQV2-.js";
|
|
32
|
+
import "./StaffSupportTicketInternalNotesTab-D8HM--dp.js";
|
|
33
|
+
import "./StaffSupportTicketHistoryTab-D24myEm3.js";
|
|
34
|
+
import "./LoginForm-_PZ51Uwe.js";
|
|
35
|
+
import "./Signup-c2-_yMOM.js";
|
|
36
|
+
import "./ForgotPassword-CqhenzUG.js";
|
|
37
|
+
import "./Logout-BMjiqHnS.js";
|
|
38
|
+
import "./UserListPage-WU56KiWj.js";
|
|
39
|
+
import "./CreateUserPage-Cmx8xjjv.js";
|
|
40
|
+
import "./NotificationEmailsPage-BjRqtW95.js";
|
|
41
|
+
import "./EditUserPage-BxJ5QvIM.js";
|
|
42
|
+
|
|
43
|
+
export { ViewTeamMember_default as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createElementBlock, createElementVNode, defineComponent, openBlock, renderSlot } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/components/ui/ZiniaContainer.vue
|
|
4
|
+
const _hoisted_1 = { class: "p-0 md:p-4 max-w-4xl mx-auto bg-base-200 card" };
|
|
5
|
+
const _hoisted_2 = { class: "card-body p-4" };
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "ZiniaContainer",
|
|
8
|
+
setup(__props) {
|
|
9
|
+
return (_ctx, _cache) => {
|
|
10
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "default")])]);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var ZiniaContainer_default = _sfc_main;
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ZiniaContainer_default as t };
|
|
18
|
+
//# sourceMappingURL=ZiniaContainer-C7c7Vwkh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZiniaContainer-C7c7Vwkh.js","names":[],"sources":["../src/components/ui/ZiniaContainer.vue"],"sourcesContent":["<template>\n <div class=\"p-0 md:p-4 max-w-4xl mx-auto bg-base-200 card\">\n <div class=\"card-body p-4\">\n <slot />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n// Reusable container that matches ZiniaForm styling\n// Use this for cards/sections that should visually match forms\n</script>\n"],"mappings":";;;;;;;;;uBACE,mBAIM,OAJN,YAIM,CAHJ,mBAEM,OAFN,YAEM,CADJ,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
//#region src/utils/convertToLocalDateTime.ts
|
|
2
|
+
/**
|
|
3
|
+
* Format a date value to ISO date string (YYYY-MM-DD)
|
|
4
|
+
* Used as formatter for date input fields to ensure consistent ISO format
|
|
5
|
+
* @param date - Date string or Date object
|
|
6
|
+
* @returns ISO date string (YYYY-MM-DD) or null if invalid
|
|
7
|
+
*/
|
|
8
|
+
function formatToISODate(date) {
|
|
9
|
+
if (!date) return null;
|
|
10
|
+
try {
|
|
11
|
+
return new Date(date).toISOString().split("T")[0] ?? null;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
console.error("Invalid date format:", e);
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Formats user-inputted date-only fields (YYYY-MM-DD format) or ISO timestamps
|
|
19
|
+
* These represent calendar dates in the user's local context, not precise timestamps
|
|
20
|
+
* @param dateString - Date string in YYYY-MM-DD format or ISO timestamp
|
|
21
|
+
* @param dateOnly - If true, returns only the date portion without time (default: true)
|
|
22
|
+
* @returns Formatted date string or empty string if no date provided
|
|
23
|
+
*/
|
|
24
|
+
function formatUserDate(dateString, dateOnly = true) {
|
|
25
|
+
if (!dateString) return "";
|
|
26
|
+
try {
|
|
27
|
+
let date;
|
|
28
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(dateString)) {
|
|
29
|
+
const [year, month, day] = dateString.split("-").map(Number);
|
|
30
|
+
date = new Date(year, month - 1, day);
|
|
31
|
+
} else date = new Date(dateString);
|
|
32
|
+
if (isNaN(date.getTime())) {
|
|
33
|
+
console.warn("formatUserDate received invalid date:", dateString);
|
|
34
|
+
return dateString;
|
|
35
|
+
}
|
|
36
|
+
if (dateOnly) return date.toLocaleDateString(void 0, {
|
|
37
|
+
year: "numeric",
|
|
38
|
+
month: "short",
|
|
39
|
+
day: "numeric"
|
|
40
|
+
});
|
|
41
|
+
return date.toLocaleString(void 0, {
|
|
42
|
+
year: "numeric",
|
|
43
|
+
month: "short",
|
|
44
|
+
day: "numeric",
|
|
45
|
+
hour: "2-digit",
|
|
46
|
+
minute: "2-digit",
|
|
47
|
+
timeZoneName: "short"
|
|
48
|
+
});
|
|
49
|
+
} catch (error) {
|
|
50
|
+
console.error("Error formatting user date:", error);
|
|
51
|
+
return dateString;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Formats system-generated timestamps (ISO format with time)
|
|
56
|
+
* These represent precise moments in time, typically in UTC
|
|
57
|
+
* @param timestamp - ISO timestamp string or YYYY-MM-DD date string
|
|
58
|
+
* @param dateOnly - If true, returns only the date portion without time (default: false)
|
|
59
|
+
* @returns Formatted timestamp string or empty string if no timestamp provided
|
|
60
|
+
*/
|
|
61
|
+
function formatSystemTimestamp(timestamp, dateOnly = false) {
|
|
62
|
+
if (!timestamp) return "";
|
|
63
|
+
try {
|
|
64
|
+
let date;
|
|
65
|
+
if (dateOnly && /^\d{4}-\d{2}-\d{2}$/.test(timestamp)) {
|
|
66
|
+
const [year, month, day] = timestamp.split("-").map(Number);
|
|
67
|
+
date = new Date(year, month - 1, day);
|
|
68
|
+
} else date = new Date(timestamp);
|
|
69
|
+
if (isNaN(date.getTime())) {
|
|
70
|
+
console.warn("formatSystemTimestamp received invalid timestamp:", timestamp);
|
|
71
|
+
return timestamp;
|
|
72
|
+
}
|
|
73
|
+
if (dateOnly) return date.toLocaleDateString(void 0, {
|
|
74
|
+
year: "numeric",
|
|
75
|
+
month: "short",
|
|
76
|
+
day: "numeric"
|
|
77
|
+
});
|
|
78
|
+
return date.toLocaleString(void 0, {
|
|
79
|
+
year: "numeric",
|
|
80
|
+
month: "short",
|
|
81
|
+
day: "numeric",
|
|
82
|
+
hour: "2-digit",
|
|
83
|
+
minute: "2-digit",
|
|
84
|
+
timeZoneName: "short"
|
|
85
|
+
});
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error("Error formatting system timestamp:", error);
|
|
88
|
+
return timestamp;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const toStringWithLocalTimeZoneOffSet = (date) => {
|
|
92
|
+
if (!date) return null;
|
|
93
|
+
date = date.split("Z")[0];
|
|
94
|
+
if (!date) return null;
|
|
95
|
+
if (date.includes("T")) return date + getTimezoneOffsetString(date);
|
|
96
|
+
else return date + "T12:00:00.000" + getTimezoneOffsetString(date);
|
|
97
|
+
};
|
|
98
|
+
function getTimezoneOffsetString(date) {
|
|
99
|
+
let offset = -new Date(date).getTimezoneOffset();
|
|
100
|
+
let sign = offset < 0 ? "-" : "+";
|
|
101
|
+
let hours = Math.floor(Math.abs(offset / 60));
|
|
102
|
+
let minutes = Math.abs(offset % 60);
|
|
103
|
+
return sign + pad(hours) + ":" + pad(minutes);
|
|
104
|
+
function pad(n) {
|
|
105
|
+
return n < 10 ? "0" + n : "" + n;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { toStringWithLocalTimeZoneOffSet as a, getTimezoneOffsetString as i, formatToISODate as n, formatUserDate as r, formatSystemTimestamp as t };
|
|
111
|
+
//# sourceMappingURL=convertToLocalDateTime-D4IoNvRj.js.map
|