@escalated-dev/escalated 0.7.0 → 0.7.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.
Files changed (179) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +31 -0
  3. package/package.json +12 -6
  4. package/src/components/ActiveChatsPanel.vue +246 -0
  5. package/src/components/ActivityTimeline.stories.js +55 -55
  6. package/src/components/ActivityTimeline.vue +83 -83
  7. package/src/components/AdminDashboard.stories.js +1423 -1095
  8. package/src/components/AgentLoadIndicator.stories.js +37 -37
  9. package/src/components/AgentLoadIndicator.vue +49 -49
  10. package/src/components/AgentPerformanceCard.vue +44 -44
  11. package/src/components/ArticleEditor.vue +82 -82
  12. package/src/components/AssigneeSelect.vue +37 -37
  13. package/src/components/AttachmentList.vue +13 -1
  14. package/src/components/AuditLogEntry.vue +95 -95
  15. package/src/components/BulkActionBar.vue +166 -166
  16. package/src/components/CategoryTree.vue +89 -89
  17. package/src/components/ChartWidget.vue +46 -46
  18. package/src/components/ChatActionBar.vue +226 -0
  19. package/src/components/ChatBubble.vue +162 -0
  20. package/src/components/ChatComposer.vue +308 -0
  21. package/src/components/ChatQueue.vue +222 -0
  22. package/src/components/ChatThread.vue +197 -0
  23. package/src/components/CollisionWarning.stories.js +30 -30
  24. package/src/components/CollisionWarning.vue +68 -68
  25. package/src/components/ConditionalFieldRules.vue +135 -135
  26. package/src/components/ContextPanel.vue +66 -66
  27. package/src/components/ContextPanelSection.vue +65 -65
  28. package/src/components/CustomFieldRenderer.vue +159 -159
  29. package/src/components/EscalatedLayout.vue +29 -6
  30. package/src/components/FileDropzone.vue +57 -57
  31. package/src/components/FollowButton.stories.js +30 -30
  32. package/src/components/FollowButton.vue +88 -88
  33. package/src/components/KeyboardShortcutHelp.vue +213 -213
  34. package/src/components/KnowledgePanel.vue +122 -122
  35. package/src/components/KpiCard.stories.js +32 -32
  36. package/src/components/KpiCard.vue +88 -88
  37. package/src/components/MacroDropdown.vue +150 -150
  38. package/src/components/MentionDropdown.vue +154 -0
  39. package/src/components/MetricComparison.vue +89 -0
  40. package/src/components/PercentileChart.vue +67 -0
  41. package/src/components/PeriodSelector.vue +98 -0
  42. package/src/components/PermissionMatrix.vue +107 -107
  43. package/src/components/PinnedNotes.vue +129 -129
  44. package/src/components/PluginSlot.vue +68 -62
  45. package/src/components/PresenceIndicator.vue +46 -2
  46. package/src/components/PriorityBadge.stories.js +33 -33
  47. package/src/components/PriorityBadge.vue +46 -46
  48. package/src/components/ReplyComposer.vue +81 -18
  49. package/src/components/ReplyThread.vue +40 -2
  50. package/src/components/ReportChart.vue +395 -0
  51. package/src/components/ReportExportButton.vue +108 -0
  52. package/src/components/SatisfactionRating.vue +180 -180
  53. package/src/components/SaveViewDialog.vue +172 -0
  54. package/src/components/SavedViewSidebar.vue +208 -0
  55. package/src/components/ScheduleEditor.vue +104 -104
  56. package/src/components/SideConversation.vue +165 -165
  57. package/src/components/SideConversationList.vue +147 -147
  58. package/src/components/SkillTagManager.vue +79 -79
  59. package/src/components/SlaComplianceChart.vue +46 -53
  60. package/src/components/SlaTimer.stories.js +35 -35
  61. package/src/components/SlaTimer.vue +62 -62
  62. package/src/components/SnoozeButton.vue +247 -0
  63. package/src/components/StatsCard.stories.js +24 -24
  64. package/src/components/StatsCard.vue +58 -58
  65. package/src/components/StatusBadge.stories.js +53 -53
  66. package/src/components/StatusBadge.vue +78 -78
  67. package/src/components/TagSelect.vue +84 -84
  68. package/src/components/TicketFilters.vue +270 -225
  69. package/src/components/TicketLinkPanel.vue +193 -193
  70. package/src/components/TicketList.vue +655 -594
  71. package/src/components/TicketMergeDialog.vue +157 -157
  72. package/src/components/TicketSplitDialog.vue +98 -0
  73. package/src/components/TotpInput.stories.js +9 -9
  74. package/src/components/TotpInput.vue +81 -81
  75. package/src/components/TwoFactorSetup.vue +113 -113
  76. package/src/components/VariableTokenInput.vue +111 -0
  77. package/src/components/WorkflowActionConfig.vue +287 -0
  78. package/src/components/WorkflowActionList.vue +350 -0
  79. package/src/components/WorkflowConditionBuilder.vue +265 -0
  80. package/src/components/WorkflowTriggerSelector.vue +125 -0
  81. package/src/composables/useChat.js +187 -0
  82. package/src/composables/useI18n.js +80 -80
  83. package/src/composables/useKeyboardShortcuts.js +46 -46
  84. package/src/composables/useMentions.js +134 -0
  85. package/src/composables/usePluginExtensions.js +159 -159
  86. package/src/composables/usePluginHooks.js +65 -65
  87. package/src/composables/useRealtime.js +182 -0
  88. package/src/defineEscalatedPlugin.js +76 -76
  89. package/src/index.js +84 -72
  90. package/src/locales/ar.json +727 -0
  91. package/src/locales/de.json +678 -430
  92. package/src/locales/en.json +717 -455
  93. package/src/locales/es.json +679 -430
  94. package/src/locales/fr.json +680 -431
  95. package/src/locales/index.js +12 -2
  96. package/src/locales/it.json +727 -0
  97. package/src/locales/ja.json +727 -0
  98. package/src/locales/ko.json +727 -0
  99. package/src/locales/nl.json +727 -0
  100. package/src/locales/pl.json +727 -0
  101. package/src/locales/pt-BR.json +727 -0
  102. package/src/locales/ru.json +727 -0
  103. package/src/locales/tr.json +727 -0
  104. package/src/locales/zh-CN.json +727 -0
  105. package/src/pages/Admin/ApiTokens/Index.vue +381 -381
  106. package/src/pages/Admin/AuditLog/Index.vue +154 -154
  107. package/src/pages/Admin/BusinessHours/Form.vue +172 -172
  108. package/src/pages/Admin/BusinessHours/Index.vue +113 -113
  109. package/src/pages/Admin/CannedResponses/Index.vue +127 -127
  110. package/src/pages/Admin/Capacity/Index.vue +134 -134
  111. package/src/pages/Admin/CustomFields/Form.vue +195 -195
  112. package/src/pages/Admin/CustomFields/Index.vue +134 -134
  113. package/src/pages/Admin/CustomObjects/Form.vue +202 -202
  114. package/src/pages/Admin/CustomObjects/Index.vue +127 -127
  115. package/src/pages/Admin/CustomObjects/Records.vue +228 -228
  116. package/src/pages/Admin/Departments/Form.vue +75 -75
  117. package/src/pages/Admin/Departments/Index.vue +110 -109
  118. package/src/pages/Admin/EscalationRules/Form.vue +157 -157
  119. package/src/pages/Admin/EscalationRules/Index.vue +178 -178
  120. package/src/pages/Admin/Import/Connect.vue +0 -1
  121. package/src/pages/Admin/Import/Index.vue +1 -1
  122. package/src/pages/Admin/Import/Progress.vue +1 -1
  123. package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -142
  124. package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -195
  125. package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -193
  126. package/src/pages/Admin/Macros/Index.vue +448 -448
  127. package/src/pages/Admin/Plugins/Index.vue +327 -327
  128. package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
  129. package/src/pages/Admin/Reports/AgentMetrics.vue +115 -115
  130. package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
  131. package/src/pages/Admin/Reports/Cohorts.vue +180 -0
  132. package/src/pages/Admin/Reports/Comparison.vue +141 -0
  133. package/src/pages/Admin/Reports/CsatReport.vue +127 -127
  134. package/src/pages/Admin/Reports/Dashboard.vue +36 -21
  135. package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
  136. package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
  137. package/src/pages/Admin/Reports/SlaReport.vue +162 -166
  138. package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
  139. package/src/pages/Admin/Reports.vue +206 -206
  140. package/src/pages/Admin/Roles/Form.vue +71 -71
  141. package/src/pages/Admin/Roles/Index.vue +122 -122
  142. package/src/pages/Admin/Settings/CsatSettings.vue +165 -165
  143. package/src/pages/Admin/Settings/DataRetention.vue +182 -182
  144. package/src/pages/Admin/Settings/EmailSettings.vue +243 -243
  145. package/src/pages/Admin/Settings/Sandbox.vue +135 -135
  146. package/src/pages/Admin/Settings/SsoSettings.vue +218 -218
  147. package/src/pages/Admin/Settings/TwoFactor.vue +110 -110
  148. package/src/pages/Admin/Settings.vue +1008 -468
  149. package/src/pages/Admin/Skills/Form.vue +53 -53
  150. package/src/pages/Admin/Skills/Index.vue +94 -94
  151. package/src/pages/Admin/SlaPolicies/Form.vue +118 -118
  152. package/src/pages/Admin/SlaPolicies/Index.vue +121 -120
  153. package/src/pages/Admin/Statuses/Form.vue +114 -114
  154. package/src/pages/Admin/Statuses/Index.vue +153 -153
  155. package/src/pages/Admin/Tags/Index.vue +191 -191
  156. package/src/pages/Admin/Tickets/Index.vue +126 -91
  157. package/src/pages/Admin/Tickets/Show.vue +29 -0
  158. package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -120
  159. package/src/pages/Admin/Webhooks/Form.vue +110 -110
  160. package/src/pages/Admin/Webhooks/Index.vue +136 -136
  161. package/src/pages/Admin/Workflows/Builder.vue +207 -0
  162. package/src/pages/Admin/Workflows/Index.vue +235 -0
  163. package/src/pages/Admin/Workflows/Logs.vue +286 -0
  164. package/src/pages/Agent/TicketIndex.vue +112 -88
  165. package/src/pages/Agent/TicketShow.vue +192 -60
  166. package/src/pages/Customer/Create.vue +1 -1
  167. package/src/pages/Customer/Index.vue +31 -31
  168. package/src/pages/Customer/KnowledgeBase/Article.vue +4 -2
  169. package/src/pages/Customer/KnowledgeBase/Index.vue +151 -151
  170. package/src/pages/Customer/Show.vue +69 -63
  171. package/src/pages/Guest/Create.vue +40 -15
  172. package/src/pages/Guest/Show.vue +124 -93
  173. package/src/plugin.js +25 -0
  174. package/src/utils/mentionHighlight.js +24 -0
  175. package/src/utils/sanitizeHtml.js +78 -64
  176. package/src/widget/EscalatedWidget.vue +804 -0
  177. package/src/widget/index.js +254 -0
  178. package/src/pages/Admin/Automations/Form.vue +0 -184
  179. package/src/pages/Admin/Automations/Index.vue +0 -129
@@ -1,122 +1,122 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import { Link, router } from '@inertiajs/vue3';
4
-
5
- defineProps({ roles: Array });
6
-
7
- function destroy(role) {
8
- if (role.is_system) return;
9
- if (confirm('Delete this role?')) {
10
- router.delete(route('escalated.admin.roles.destroy', role.id));
11
- }
12
- }
13
- </script>
14
-
15
- <template>
16
- <EscalatedLayout title="Agent Roles">
17
- <div class="mb-4 flex justify-end">
18
- <Link
19
- :href="route('escalated.admin.roles.create')"
20
- class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-4 py-2 text-sm font-medium text-white shadow-lg shadow-[var(--esc-panel-bg)]/20 transition-all hover:from-[var(--esc-panel-accent-hover)] hover:to-[var(--esc-panel-accent-secondary-hover)]"
21
- >
22
- Add Role
23
- </Link>
24
- </div>
25
- <div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]">
26
- <table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
27
- <thead>
28
- <tr class="bg-[var(--esc-panel-hover)]">
29
- <th
30
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
31
- >
32
- Name
33
- </th>
34
- <th
35
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
36
- >
37
- Description
38
- </th>
39
- <th
40
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
41
- >
42
- Users
43
- </th>
44
- <th
45
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
46
- >
47
- Type
48
- </th>
49
- <th
50
- class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
51
- >
52
- Actions
53
- </th>
54
- </tr>
55
- </thead>
56
- <tbody class="divide-y divide-[var(--esc-panel-border)]">
57
- <tr v-if="!roles?.length">
58
- <td colspan="5" class="px-4 py-12 text-center">
59
- <svg
60
- class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
61
- fill="none"
62
- stroke="currentColor"
63
- stroke-width="1.5"
64
- viewBox="0 0 24 24"
65
- >
66
- <path
67
- stroke-linecap="round"
68
- stroke-linejoin="round"
69
- d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"
70
- />
71
- </svg>
72
- <p class="text-sm text-[var(--esc-panel-text-muted)]">No roles defined yet</p>
73
- <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
74
- Create roles with specific permissions to control agent access
75
- </p>
76
- </td>
77
- </tr>
78
- <tr
79
- v-for="role in roles"
80
- :key="role.id"
81
- class="transition-colors hover:bg-[var(--esc-panel-hover)]"
82
- >
83
- <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
84
- {{ role.name }}
85
- </td>
86
- <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
87
- {{ role.description || '-' }}
88
- </td>
89
- <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">{{ role.users_count }}</td>
90
- <td class="px-4 py-3 text-sm">
91
- <span
92
- v-if="role.is_system"
93
- class="inline-flex items-center rounded-full bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-400 ring-1 ring-amber-500/20"
94
- >System</span
95
- >
96
- <span
97
- v-else
98
- class="inline-flex items-center rounded-full bg-[var(--esc-panel-hover)] px-2 py-0.5 text-xs font-medium text-[var(--esc-panel-text-secondary)]"
99
- >Custom</span
100
- >
101
- </td>
102
- <td class="px-4 py-3 text-right text-sm">
103
- <Link
104
- :href="route('escalated.admin.roles.edit', role.id)"
105
- class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
106
- >
107
- Edit
108
- </Link>
109
- <button
110
- v-if="!role.is_system"
111
- class="ml-3 text-rose-400 hover:text-rose-300"
112
- @click="destroy(role)"
113
- >
114
- Delete
115
- </button>
116
- </td>
117
- </tr>
118
- </tbody>
119
- </table>
120
- </div>
121
- </EscalatedLayout>
122
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import { Link, router } from '@inertiajs/vue3';
4
+
5
+ defineProps({ roles: Array });
6
+
7
+ function destroy(role) {
8
+ if (role.is_system) return;
9
+ if (confirm('Delete this role?')) {
10
+ router.delete(route('escalated.admin.roles.destroy', role.id));
11
+ }
12
+ }
13
+ </script>
14
+
15
+ <template>
16
+ <EscalatedLayout title="Agent Roles">
17
+ <div class="mb-4 flex justify-end">
18
+ <Link
19
+ :href="route('escalated.admin.roles.create')"
20
+ class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-4 py-2 text-sm font-medium text-white shadow-lg shadow-[var(--esc-panel-bg)]/20 transition-all hover:from-[var(--esc-panel-accent-hover)] hover:to-[var(--esc-panel-accent-secondary-hover)]"
21
+ >
22
+ Add Role
23
+ </Link>
24
+ </div>
25
+ <div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]">
26
+ <table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
27
+ <thead>
28
+ <tr class="bg-[var(--esc-panel-hover)]">
29
+ <th
30
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
31
+ >
32
+ Name
33
+ </th>
34
+ <th
35
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
36
+ >
37
+ Description
38
+ </th>
39
+ <th
40
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
41
+ >
42
+ Users
43
+ </th>
44
+ <th
45
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
46
+ >
47
+ Type
48
+ </th>
49
+ <th
50
+ class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
51
+ >
52
+ Actions
53
+ </th>
54
+ </tr>
55
+ </thead>
56
+ <tbody class="divide-y divide-[var(--esc-panel-border)]">
57
+ <tr v-if="!roles?.length">
58
+ <td colspan="5" class="px-4 py-12 text-center">
59
+ <svg
60
+ class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
61
+ fill="none"
62
+ stroke="currentColor"
63
+ stroke-width="1.5"
64
+ viewBox="0 0 24 24"
65
+ >
66
+ <path
67
+ stroke-linecap="round"
68
+ stroke-linejoin="round"
69
+ d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"
70
+ />
71
+ </svg>
72
+ <p class="text-sm text-[var(--esc-panel-text-muted)]">No roles defined yet</p>
73
+ <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
74
+ Create roles with specific permissions to control agent access
75
+ </p>
76
+ </td>
77
+ </tr>
78
+ <tr
79
+ v-for="role in roles"
80
+ :key="role.id"
81
+ class="transition-colors hover:bg-[var(--esc-panel-hover)]"
82
+ >
83
+ <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
84
+ {{ role.name }}
85
+ </td>
86
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
87
+ {{ role.description || '-' }}
88
+ </td>
89
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">{{ role.users_count }}</td>
90
+ <td class="px-4 py-3 text-sm">
91
+ <span
92
+ v-if="role.is_system"
93
+ class="inline-flex items-center rounded-full bg-amber-500/10 px-2 py-0.5 text-xs font-medium text-amber-400 ring-1 ring-amber-500/20"
94
+ >System</span
95
+ >
96
+ <span
97
+ v-else
98
+ class="inline-flex items-center rounded-full bg-[var(--esc-panel-hover)] px-2 py-0.5 text-xs font-medium text-[var(--esc-panel-text-secondary)]"
99
+ >Custom</span
100
+ >
101
+ </td>
102
+ <td class="px-4 py-3 text-right text-sm">
103
+ <Link
104
+ :href="route('escalated.admin.roles.edit', role.id)"
105
+ class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
106
+ >
107
+ Edit
108
+ </Link>
109
+ <button
110
+ v-if="!role.is_system"
111
+ class="ml-3 text-rose-400 hover:text-rose-300"
112
+ @click="destroy(role)"
113
+ >
114
+ Delete
115
+ </button>
116
+ </td>
117
+ </tr>
118
+ </tbody>
119
+ </table>
120
+ </div>
121
+ </EscalatedLayout>
122
+ </template>
@@ -1,165 +1,165 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import { useForm, Link } from '@inertiajs/vue3';
4
-
5
- const props = defineProps({
6
- settings: Object,
7
- });
8
-
9
- const form = useForm({
10
- csat_question_text: props.settings?.csat_question_text || 'How would you rate your support experience?',
11
- csat_scale: props.settings?.csat_scale || '1-5',
12
- csat_delivery_trigger: props.settings?.csat_delivery_trigger || 'on_resolve',
13
- csat_delay_hours: props.settings?.csat_delay_hours || 0,
14
- });
15
-
16
- function submit() {
17
- form.post(route('escalated.admin.settings.csat.update'));
18
- }
19
- </script>
20
-
21
- <template>
22
- <EscalatedLayout title="CSAT Survey Settings">
23
- <div class="mx-auto max-w-2xl">
24
- <div class="mb-6">
25
- <Link
26
- :href="route('escalated.admin.settings')"
27
- class="text-sm text-[var(--esc-panel-text-muted)] hover:text-[var(--esc-panel-text-secondary)]"
28
- >
29
- &larr; Back to Settings
30
- </Link>
31
- </div>
32
-
33
- <div class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6">
34
- <h2 class="mb-6 text-lg font-semibold text-[var(--esc-panel-text-secondary)]">
35
- Customer Satisfaction Survey
36
- </h2>
37
-
38
- <form class="space-y-6" @submit.prevent="submit">
39
- <!-- Question Text -->
40
- <div>
41
- <label class="mb-1.5 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
42
- >Survey Question</label
43
- >
44
- <textarea
45
- v-model="form.csat_question_text"
46
- rows="3"
47
- class="w-full rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2.5 text-sm text-[var(--esc-panel-text-secondary)] placeholder-[var(--esc-panel-text-muted)] focus:border-[var(--esc-panel-accent)]/40 focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-accent)]/40"
48
- placeholder="How would you rate your support experience?"
49
- ></textarea>
50
- <p v-if="form.errors.csat_question_text" class="mt-1 text-xs text-red-400">
51
- {{ form.errors.csat_question_text }}
52
- </p>
53
- <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
54
- This question will be shown to customers after their ticket is resolved.
55
- </p>
56
- </div>
57
-
58
- <!-- Rating Scale -->
59
- <div>
60
- <label class="mb-1.5 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
61
- >Rating Scale</label
62
- >
63
- <div class="flex gap-3">
64
- <label
65
- :class="[
66
- 'flex cursor-pointer items-center gap-2 rounded-lg border px-4 py-3 transition-all',
67
- form.csat_scale === '1-3'
68
- ? 'border-[var(--esc-panel-accent)]/40 bg-[var(--esc-panel-accent)]/10 text-[var(--esc-panel-accent)]'
69
- : 'border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] text-[var(--esc-panel-text-tertiary)] hover:border-[var(--esc-panel-border-input)]',
70
- ]"
71
- >
72
- <input v-model="form.csat_scale" type="radio" value="1-3" class="sr-only" />
73
- <span class="text-sm font-medium">1-3 Scale</span>
74
- <span class="text-xs text-[var(--esc-panel-text-muted)]">(Simple)</span>
75
- </label>
76
- <label
77
- :class="[
78
- 'flex cursor-pointer items-center gap-2 rounded-lg border px-4 py-3 transition-all',
79
- form.csat_scale === '1-5'
80
- ? 'border-[var(--esc-panel-accent)]/40 bg-[var(--esc-panel-accent)]/10 text-[var(--esc-panel-accent)]'
81
- : 'border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] text-[var(--esc-panel-text-tertiary)] hover:border-[var(--esc-panel-border-input)]',
82
- ]"
83
- >
84
- <input v-model="form.csat_scale" type="radio" value="1-5" class="sr-only" />
85
- <span class="text-sm font-medium">1-5 Scale</span>
86
- <span class="text-xs text-[var(--esc-panel-text-muted)]">(Detailed)</span>
87
- </label>
88
- </div>
89
- <p v-if="form.errors.csat_scale" class="mt-1 text-xs text-red-400">
90
- {{ form.errors.csat_scale }}
91
- </p>
92
- </div>
93
-
94
- <!-- Delivery Trigger -->
95
- <div>
96
- <label class="mb-1.5 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
97
- >Delivery Trigger</label
98
- >
99
- <select
100
- v-model="form.csat_delivery_trigger"
101
- class="w-full rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-accent)]/40 focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-accent)]/40"
102
- >
103
- <option value="on_resolve">On ticket resolution</option>
104
- <option value="delayed">Delayed after resolution</option>
105
- <option value="manual">Manual only</option>
106
- </select>
107
- <p v-if="form.errors.csat_delivery_trigger" class="mt-1 text-xs text-red-400">
108
- {{ form.errors.csat_delivery_trigger }}
109
- </p>
110
- </div>
111
-
112
- <!-- Delay Hours (shown only for delayed trigger) -->
113
- <div v-if="form.csat_delivery_trigger === 'delayed'">
114
- <label class="mb-1.5 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
115
- >Delay (hours)</label
116
- >
117
- <input
118
- v-model.number="form.csat_delay_hours"
119
- type="number"
120
- min="0"
121
- max="168"
122
- class="w-full rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-accent)]/40 focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-accent)]/40"
123
- />
124
- <p v-if="form.errors.csat_delay_hours" class="mt-1 text-xs text-red-400">
125
- {{ form.errors.csat_delay_hours }}
126
- </p>
127
- <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
128
- How many hours after resolution to send the survey (max 168 = 7 days).
129
- </p>
130
- </div>
131
-
132
- <!-- Submit -->
133
- <div class="pt-2">
134
- <button
135
- type="submit"
136
- :disabled="form.processing"
137
- class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-5 py-2.5 text-sm font-medium text-white shadow-lg shadow-[var(--esc-panel-bg)]/20 transition-opacity hover:opacity-90 disabled:opacity-50"
138
- >
139
- Save Settings
140
- </button>
141
- </div>
142
- </form>
143
- </div>
144
-
145
- <!-- Preview -->
146
- <div class="mt-6 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6">
147
- <h3 class="mb-4 text-sm font-semibold text-[var(--esc-panel-text-secondary)]">Preview</h3>
148
- <div
149
- class="rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] p-6 text-center"
150
- >
151
- <p class="mb-4 text-sm text-[var(--esc-panel-text-secondary)]">{{ form.csat_question_text }}</p>
152
- <div class="flex items-center justify-center gap-2">
153
- <button
154
- v-for="n in form.csat_scale === '1-3' ? 3 : 5"
155
- :key="n"
156
- class="flex h-10 w-10 items-center justify-center rounded-lg border border-[var(--esc-panel-border)] text-sm font-medium text-[var(--esc-panel-text-tertiary)] transition-colors hover:border-amber-500/40 hover:bg-amber-500/10 hover:text-amber-400"
157
- >
158
- {{ n }}
159
- </button>
160
- </div>
161
- </div>
162
- </div>
163
- </div>
164
- </EscalatedLayout>
165
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import { useForm, Link } from '@inertiajs/vue3';
4
+
5
+ const props = defineProps({
6
+ settings: Object,
7
+ });
8
+
9
+ const form = useForm({
10
+ csat_question_text: props.settings?.csat_question_text || 'How would you rate your support experience?',
11
+ csat_scale: props.settings?.csat_scale || '1-5',
12
+ csat_delivery_trigger: props.settings?.csat_delivery_trigger || 'on_resolve',
13
+ csat_delay_hours: props.settings?.csat_delay_hours || 0,
14
+ });
15
+
16
+ function submit() {
17
+ form.post(route('escalated.admin.settings.csat.update'));
18
+ }
19
+ </script>
20
+
21
+ <template>
22
+ <EscalatedLayout title="CSAT Survey Settings">
23
+ <div class="mx-auto max-w-2xl">
24
+ <div class="mb-6">
25
+ <Link
26
+ :href="route('escalated.admin.settings')"
27
+ class="text-sm text-[var(--esc-panel-text-muted)] hover:text-[var(--esc-panel-text-secondary)]"
28
+ >
29
+ &larr; Back to Settings
30
+ </Link>
31
+ </div>
32
+
33
+ <div class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6">
34
+ <h2 class="mb-6 text-lg font-semibold text-[var(--esc-panel-text-secondary)]">
35
+ Customer Satisfaction Survey
36
+ </h2>
37
+
38
+ <form class="space-y-6" @submit.prevent="submit">
39
+ <!-- Question Text -->
40
+ <div>
41
+ <label class="mb-1.5 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
42
+ >Survey Question</label
43
+ >
44
+ <textarea
45
+ v-model="form.csat_question_text"
46
+ rows="3"
47
+ class="w-full rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2.5 text-sm text-[var(--esc-panel-text-secondary)] placeholder-[var(--esc-panel-text-muted)] focus:border-[var(--esc-panel-accent)]/40 focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-accent)]/40"
48
+ placeholder="How would you rate your support experience?"
49
+ ></textarea>
50
+ <p v-if="form.errors.csat_question_text" class="mt-1 text-xs text-red-400">
51
+ {{ form.errors.csat_question_text }}
52
+ </p>
53
+ <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
54
+ This question will be shown to customers after their ticket is resolved.
55
+ </p>
56
+ </div>
57
+
58
+ <!-- Rating Scale -->
59
+ <div>
60
+ <label class="mb-1.5 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
61
+ >Rating Scale</label
62
+ >
63
+ <div class="flex gap-3">
64
+ <label
65
+ :class="[
66
+ 'flex cursor-pointer items-center gap-2 rounded-lg border px-4 py-3 transition-all',
67
+ form.csat_scale === '1-3'
68
+ ? 'border-[var(--esc-panel-accent)]/40 bg-[var(--esc-panel-accent)]/10 text-[var(--esc-panel-accent)]'
69
+ : 'border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] text-[var(--esc-panel-text-tertiary)] hover:border-[var(--esc-panel-border-input)]',
70
+ ]"
71
+ >
72
+ <input v-model="form.csat_scale" type="radio" value="1-3" class="sr-only" />
73
+ <span class="text-sm font-medium">1-3 Scale</span>
74
+ <span class="text-xs text-[var(--esc-panel-text-muted)]">(Simple)</span>
75
+ </label>
76
+ <label
77
+ :class="[
78
+ 'flex cursor-pointer items-center gap-2 rounded-lg border px-4 py-3 transition-all',
79
+ form.csat_scale === '1-5'
80
+ ? 'border-[var(--esc-panel-accent)]/40 bg-[var(--esc-panel-accent)]/10 text-[var(--esc-panel-accent)]'
81
+ : 'border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] text-[var(--esc-panel-text-tertiary)] hover:border-[var(--esc-panel-border-input)]',
82
+ ]"
83
+ >
84
+ <input v-model="form.csat_scale" type="radio" value="1-5" class="sr-only" />
85
+ <span class="text-sm font-medium">1-5 Scale</span>
86
+ <span class="text-xs text-[var(--esc-panel-text-muted)]">(Detailed)</span>
87
+ </label>
88
+ </div>
89
+ <p v-if="form.errors.csat_scale" class="mt-1 text-xs text-red-400">
90
+ {{ form.errors.csat_scale }}
91
+ </p>
92
+ </div>
93
+
94
+ <!-- Delivery Trigger -->
95
+ <div>
96
+ <label class="mb-1.5 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
97
+ >Delivery Trigger</label
98
+ >
99
+ <select
100
+ v-model="form.csat_delivery_trigger"
101
+ class="w-full rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-accent)]/40 focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-accent)]/40"
102
+ >
103
+ <option value="on_resolve">On ticket resolution</option>
104
+ <option value="delayed">Delayed after resolution</option>
105
+ <option value="manual">Manual only</option>
106
+ </select>
107
+ <p v-if="form.errors.csat_delivery_trigger" class="mt-1 text-xs text-red-400">
108
+ {{ form.errors.csat_delivery_trigger }}
109
+ </p>
110
+ </div>
111
+
112
+ <!-- Delay Hours (shown only for delayed trigger) -->
113
+ <div v-if="form.csat_delivery_trigger === 'delayed'">
114
+ <label class="mb-1.5 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
115
+ >Delay (hours)</label
116
+ >
117
+ <input
118
+ v-model.number="form.csat_delay_hours"
119
+ type="number"
120
+ min="0"
121
+ max="168"
122
+ class="w-full rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2.5 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-accent)]/40 focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-accent)]/40"
123
+ />
124
+ <p v-if="form.errors.csat_delay_hours" class="mt-1 text-xs text-red-400">
125
+ {{ form.errors.csat_delay_hours }}
126
+ </p>
127
+ <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
128
+ How many hours after resolution to send the survey (max 168 = 7 days).
129
+ </p>
130
+ </div>
131
+
132
+ <!-- Submit -->
133
+ <div class="pt-2">
134
+ <button
135
+ type="submit"
136
+ :disabled="form.processing"
137
+ class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-5 py-2.5 text-sm font-medium text-white shadow-lg shadow-[var(--esc-panel-bg)]/20 transition-opacity hover:opacity-90 disabled:opacity-50"
138
+ >
139
+ Save Settings
140
+ </button>
141
+ </div>
142
+ </form>
143
+ </div>
144
+
145
+ <!-- Preview -->
146
+ <div class="mt-6 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6">
147
+ <h3 class="mb-4 text-sm font-semibold text-[var(--esc-panel-text-secondary)]">Preview</h3>
148
+ <div
149
+ class="rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] p-6 text-center"
150
+ >
151
+ <p class="mb-4 text-sm text-[var(--esc-panel-text-secondary)]">{{ form.csat_question_text }}</p>
152
+ <div class="flex items-center justify-center gap-2">
153
+ <button
154
+ v-for="n in form.csat_scale === '1-3' ? 3 : 5"
155
+ :key="n"
156
+ class="flex h-10 w-10 items-center justify-center rounded-lg border border-[var(--esc-panel-border)] text-sm font-medium text-[var(--esc-panel-text-tertiary)] transition-colors hover:border-amber-500/40 hover:bg-amber-500/10 hover:text-amber-400"
157
+ >
158
+ {{ n }}
159
+ </button>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ </EscalatedLayout>
165
+ </template>