@escalated-dev/escalated 0.7.0 → 0.8.0

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 (181) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +36 -1
  3. package/package.json +16 -7
  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 +35 -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 +83 -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 +30 -8
  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/README.md +13 -0
  91. package/src/locales/ar.json +727 -0
  92. package/src/locales/de.json +678 -430
  93. package/src/locales/en.json +717 -455
  94. package/src/locales/es.json +679 -430
  95. package/src/locales/fr.json +680 -431
  96. package/src/locales/index.js +12 -2
  97. package/src/locales/it.json +727 -0
  98. package/src/locales/ja.json +727 -0
  99. package/src/locales/ko.json +727 -0
  100. package/src/locales/nl.json +727 -0
  101. package/src/locales/pl.json +727 -0
  102. package/src/locales/pt-BR.json +727 -0
  103. package/src/locales/ru.json +727 -0
  104. package/src/locales/tr.json +727 -0
  105. package/src/locales/zh-CN.json +727 -0
  106. package/src/pages/Admin/ApiTokens/Index.vue +381 -381
  107. package/src/pages/Admin/AuditLog/Index.vue +154 -154
  108. package/src/pages/Admin/BusinessHours/Form.vue +172 -172
  109. package/src/pages/Admin/BusinessHours/Index.vue +113 -113
  110. package/src/pages/Admin/CannedResponses/Index.vue +127 -127
  111. package/src/pages/Admin/Capacity/Index.vue +134 -134
  112. package/src/pages/Admin/CustomFields/Form.vue +195 -195
  113. package/src/pages/Admin/CustomFields/Index.vue +134 -134
  114. package/src/pages/Admin/CustomObjects/Form.vue +202 -202
  115. package/src/pages/Admin/CustomObjects/Index.vue +127 -127
  116. package/src/pages/Admin/CustomObjects/Records.vue +228 -228
  117. package/src/pages/Admin/Departments/Form.vue +75 -75
  118. package/src/pages/Admin/Departments/Index.vue +110 -109
  119. package/src/pages/Admin/EscalationRules/Form.vue +157 -157
  120. package/src/pages/Admin/EscalationRules/Index.vue +178 -178
  121. package/src/pages/Admin/Import/Connect.vue +0 -1
  122. package/src/pages/Admin/Import/Index.vue +1 -1
  123. package/src/pages/Admin/Import/Progress.vue +1 -1
  124. package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -142
  125. package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -195
  126. package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -193
  127. package/src/pages/Admin/Macros/Index.vue +448 -448
  128. package/src/pages/Admin/Plugins/Index.vue +327 -327
  129. package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
  130. package/src/pages/Admin/Reports/AgentMetrics.vue +115 -115
  131. package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
  132. package/src/pages/Admin/Reports/Cohorts.vue +180 -0
  133. package/src/pages/Admin/Reports/Comparison.vue +141 -0
  134. package/src/pages/Admin/Reports/CsatReport.vue +127 -127
  135. package/src/pages/Admin/Reports/Dashboard.vue +36 -21
  136. package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
  137. package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
  138. package/src/pages/Admin/Reports/SlaReport.vue +162 -166
  139. package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
  140. package/src/pages/Admin/Reports.vue +206 -206
  141. package/src/pages/Admin/Roles/Form.vue +71 -71
  142. package/src/pages/Admin/Roles/Index.vue +122 -122
  143. package/src/pages/Admin/Settings/CsatSettings.vue +165 -165
  144. package/src/pages/Admin/Settings/DataRetention.vue +182 -182
  145. package/src/pages/Admin/Settings/EmailSettings.vue +243 -243
  146. package/src/pages/Admin/Settings/Sandbox.vue +135 -135
  147. package/src/pages/Admin/Settings/SsoSettings.vue +218 -218
  148. package/src/pages/Admin/Settings/TwoFactor.vue +110 -110
  149. package/src/pages/Admin/Settings.vue +1008 -468
  150. package/src/pages/Admin/Skills/Form.vue +193 -53
  151. package/src/pages/Admin/Skills/Index.vue +105 -94
  152. package/src/pages/Admin/SlaPolicies/Form.vue +118 -118
  153. package/src/pages/Admin/SlaPolicies/Index.vue +121 -120
  154. package/src/pages/Admin/Statuses/Form.vue +114 -114
  155. package/src/pages/Admin/Statuses/Index.vue +153 -153
  156. package/src/pages/Admin/Tags/Index.vue +191 -191
  157. package/src/pages/Admin/Tickets/Index.vue +126 -91
  158. package/src/pages/Admin/Tickets/Show.vue +29 -0
  159. package/src/pages/Admin/Users/Index.vue +145 -0
  160. package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -120
  161. package/src/pages/Admin/Webhooks/Form.vue +110 -110
  162. package/src/pages/Admin/Webhooks/Index.vue +136 -136
  163. package/src/pages/Admin/Workflows/Builder.vue +207 -0
  164. package/src/pages/Admin/Workflows/Index.vue +235 -0
  165. package/src/pages/Admin/Workflows/Logs.vue +286 -0
  166. package/src/pages/Agent/TicketIndex.vue +112 -88
  167. package/src/pages/Agent/TicketShow.vue +192 -60
  168. package/src/pages/Customer/Create.vue +1 -1
  169. package/src/pages/Customer/Index.vue +26 -1
  170. package/src/pages/Customer/KnowledgeBase/Article.vue +4 -2
  171. package/src/pages/Customer/KnowledgeBase/Index.vue +151 -151
  172. package/src/pages/Customer/Show.vue +69 -63
  173. package/src/pages/Guest/Create.vue +40 -15
  174. package/src/pages/Guest/Show.vue +124 -93
  175. package/src/plugin.js +26 -1
  176. package/src/utils/mentionHighlight.js +24 -0
  177. package/src/utils/sanitizeHtml.js +78 -64
  178. package/src/widget/EscalatedWidget.vue +804 -0
  179. package/src/widget/index.js +254 -0
  180. package/src/pages/Admin/Automations/Form.vue +0 -184
  181. package/src/pages/Admin/Automations/Index.vue +0 -129
@@ -1,114 +1,114 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import { useForm } from '@inertiajs/vue3';
4
-
5
- const props = defineProps({
6
- status: { type: Object, default: null },
7
- categories: { type: Array, default: () => ['new', 'open', 'pending', 'on_hold', 'solved'] },
8
- });
9
-
10
- const categoryLabels = {
11
- new: 'New',
12
- open: 'Open',
13
- pending: 'Pending',
14
- on_hold: 'On-Hold',
15
- solved: 'Solved',
16
- };
17
-
18
- const form = useForm({
19
- label: props.status?.label || '',
20
- category: props.status?.category || 'open',
21
- color: props.status?.color || '#6b7280',
22
- description: props.status?.description || '',
23
- position: props.status?.position ?? 0,
24
- is_default: props.status?.is_default ?? false,
25
- });
26
-
27
- function submit() {
28
- if (props.status) {
29
- form.put(route('escalated.admin.statuses.update', props.status.id));
30
- } else {
31
- form.post(route('escalated.admin.statuses.store'));
32
- }
33
- }
34
- </script>
35
-
36
- <template>
37
- <EscalatedLayout :title="status ? 'Edit Status' : 'New Status'">
38
- <form
39
- class="mx-auto max-w-lg space-y-5 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6"
40
- @submit.prevent="submit"
41
- >
42
- <div>
43
- <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Label</label>
44
- <input
45
- v-model="form.label"
46
- type="text"
47
- required
48
- class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
49
- />
50
- <div v-if="form.errors.label" class="mt-1 text-sm text-rose-400">{{ form.errors.label }}</div>
51
- </div>
52
-
53
- <div>
54
- <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Category</label>
55
- <select
56
- v-model="form.category"
57
- required
58
- class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
59
- >
60
- <option v-for="cat in categories" :key="cat" :value="cat">{{ categoryLabels[cat] || cat }}</option>
61
- </select>
62
- <div v-if="form.errors.category" class="mt-1 text-sm text-rose-400">{{ form.errors.category }}</div>
63
- </div>
64
-
65
- <div>
66
- <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Color</label>
67
- <input
68
- v-model="form.color"
69
- type="color"
70
- class="mt-1 h-10 w-16 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)]"
71
- />
72
- <div v-if="form.errors.color" class="mt-1 text-sm text-rose-400">{{ form.errors.color }}</div>
73
- </div>
74
-
75
- <div>
76
- <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Description</label>
77
- <textarea
78
- v-model="form.description"
79
- rows="2"
80
- class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
81
- ></textarea>
82
- </div>
83
-
84
- <div>
85
- <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Position</label>
86
- <input
87
- v-model.number="form.position"
88
- type="number"
89
- min="0"
90
- class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
91
- />
92
- </div>
93
-
94
- <label class="flex items-center gap-2">
95
- <input
96
- v-model="form.is_default"
97
- type="checkbox"
98
- class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface)] text-cyan-500 focus:ring-[var(--esc-panel-border-input)]"
99
- />
100
- <span class="text-sm text-[var(--esc-panel-text-secondary)]">Default status for this category</span>
101
- </label>
102
-
103
- <div class="flex justify-end">
104
- <button
105
- type="submit"
106
- :disabled="form.processing"
107
- class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-5 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)] disabled:opacity-50"
108
- >
109
- {{ status ? 'Update' : 'Create' }}
110
- </button>
111
- </div>
112
- </form>
113
- </EscalatedLayout>
114
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import { useForm } from '@inertiajs/vue3';
4
+
5
+ const props = defineProps({
6
+ status: { type: Object, default: null },
7
+ categories: { type: Array, default: () => ['new', 'open', 'pending', 'on_hold', 'solved'] },
8
+ });
9
+
10
+ const categoryLabels = {
11
+ new: 'New',
12
+ open: 'Open',
13
+ pending: 'Pending',
14
+ on_hold: 'On-Hold',
15
+ solved: 'Solved',
16
+ };
17
+
18
+ const form = useForm({
19
+ label: props.status?.label || '',
20
+ category: props.status?.category || 'open',
21
+ color: props.status?.color || '#6b7280',
22
+ description: props.status?.description || '',
23
+ position: props.status?.position ?? 0,
24
+ is_default: props.status?.is_default ?? false,
25
+ });
26
+
27
+ function submit() {
28
+ if (props.status) {
29
+ form.put(route('escalated.admin.statuses.update', props.status.id));
30
+ } else {
31
+ form.post(route('escalated.admin.statuses.store'));
32
+ }
33
+ }
34
+ </script>
35
+
36
+ <template>
37
+ <EscalatedLayout :title="status ? 'Edit Status' : 'New Status'">
38
+ <form
39
+ class="mx-auto max-w-lg space-y-5 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6"
40
+ @submit.prevent="submit"
41
+ >
42
+ <div>
43
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Label</label>
44
+ <input
45
+ v-model="form.label"
46
+ type="text"
47
+ required
48
+ class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
49
+ />
50
+ <div v-if="form.errors.label" class="mt-1 text-sm text-rose-400">{{ form.errors.label }}</div>
51
+ </div>
52
+
53
+ <div>
54
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Category</label>
55
+ <select
56
+ v-model="form.category"
57
+ required
58
+ class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
59
+ >
60
+ <option v-for="cat in categories" :key="cat" :value="cat">{{ categoryLabels[cat] || cat }}</option>
61
+ </select>
62
+ <div v-if="form.errors.category" class="mt-1 text-sm text-rose-400">{{ form.errors.category }}</div>
63
+ </div>
64
+
65
+ <div>
66
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Color</label>
67
+ <input
68
+ v-model="form.color"
69
+ type="color"
70
+ class="mt-1 h-10 w-16 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)]"
71
+ />
72
+ <div v-if="form.errors.color" class="mt-1 text-sm text-rose-400">{{ form.errors.color }}</div>
73
+ </div>
74
+
75
+ <div>
76
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Description</label>
77
+ <textarea
78
+ v-model="form.description"
79
+ rows="2"
80
+ class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
81
+ ></textarea>
82
+ </div>
83
+
84
+ <div>
85
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Position</label>
86
+ <input
87
+ v-model.number="form.position"
88
+ type="number"
89
+ min="0"
90
+ class="mt-1 w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
91
+ />
92
+ </div>
93
+
94
+ <label class="flex items-center gap-2">
95
+ <input
96
+ v-model="form.is_default"
97
+ type="checkbox"
98
+ class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface)] text-cyan-500 focus:ring-[var(--esc-panel-border-input)]"
99
+ />
100
+ <span class="text-sm text-[var(--esc-panel-text-secondary)]">Default status for this category</span>
101
+ </label>
102
+
103
+ <div class="flex justify-end">
104
+ <button
105
+ type="submit"
106
+ :disabled="form.processing"
107
+ class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-5 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)] disabled:opacity-50"
108
+ >
109
+ {{ status ? 'Update' : 'Create' }}
110
+ </button>
111
+ </div>
112
+ </form>
113
+ </EscalatedLayout>
114
+ </template>
@@ -1,153 +1,153 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import { Link, router } from '@inertiajs/vue3';
4
- import { computed } from 'vue';
5
-
6
- const props = defineProps({
7
- statuses: Array,
8
- categories: Array,
9
- });
10
-
11
- const categoryLabels = {
12
- new: 'New',
13
- open: 'Open',
14
- pending: 'Pending',
15
- on_hold: 'On-Hold',
16
- solved: 'Solved',
17
- };
18
-
19
- const groupedStatuses = computed(() => {
20
- const groups = {};
21
- for (const cat of props.categories || []) {
22
- groups[cat] = (props.statuses || []).filter((s) => s.category === cat);
23
- }
24
- return groups;
25
- });
26
-
27
- function destroy(id) {
28
- if (confirm('Delete this status?')) {
29
- router.delete(route('escalated.admin.statuses.destroy', id));
30
- }
31
- }
32
- </script>
33
-
34
- <template>
35
- <EscalatedLayout title="Ticket Statuses">
36
- <div class="mb-4 flex justify-end">
37
- <Link
38
- :href="route('escalated.admin.statuses.create')"
39
- 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)]"
40
- >
41
- Add Status
42
- </Link>
43
- </div>
44
-
45
- <div
46
- v-if="!statuses?.length"
47
- class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] px-4 py-12 text-center"
48
- >
49
- <svg
50
- class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
51
- fill="none"
52
- stroke="currentColor"
53
- stroke-width="1.5"
54
- viewBox="0 0 24 24"
55
- >
56
- <path
57
- stroke-linecap="round"
58
- stroke-linejoin="round"
59
- d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
60
- />
61
- </svg>
62
- <p class="text-sm text-[var(--esc-panel-text-muted)]">No custom statuses yet</p>
63
- <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
64
- Create sub-statuses to track ticket progress in detail
65
- </p>
66
- </div>
67
-
68
- <div v-for="cat in categories" :key="cat" class="mb-6">
69
- <h3 class="mb-2 text-sm font-semibold uppercase tracking-wider text-[var(--esc-panel-text-tertiary)]">
70
- {{ categoryLabels[cat] || cat }}
71
- </h3>
72
- <div
73
- class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]"
74
- >
75
- <table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
76
- <thead>
77
- <tr class="bg-[var(--esc-panel-hover)]">
78
- <th
79
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
80
- >
81
- Color
82
- </th>
83
- <th
84
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
85
- >
86
- Label
87
- </th>
88
- <th
89
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
90
- >
91
- Default
92
- </th>
93
- <th
94
- class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
95
- >
96
- Position
97
- </th>
98
- <th
99
- class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
100
- >
101
- Actions
102
- </th>
103
- </tr>
104
- </thead>
105
- <tbody class="divide-y divide-[var(--esc-panel-border)]">
106
- <tr v-if="!groupedStatuses[cat]?.length">
107
- <td colspan="5" class="px-4 py-6 text-center text-sm text-[var(--esc-panel-text-muted)]">
108
- No statuses in this category
109
- </td>
110
- </tr>
111
- <tr
112
- v-for="status in groupedStatuses[cat]"
113
- :key="status.id"
114
- class="transition-colors hover:bg-[var(--esc-panel-hover)]"
115
- >
116
- <td class="px-4 py-3">
117
- <span
118
- class="inline-block h-4 w-4 rounded-full ring-1 ring-[var(--esc-panel-border-input)]"
119
- :style="{ backgroundColor: status.color }"
120
- ></span>
121
- </td>
122
- <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
123
- {{ status.label }}
124
- </td>
125
- <td class="px-4 py-3 text-sm">
126
- <span
127
- v-if="status.is_default"
128
- class="inline-flex items-center rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-400 ring-1 ring-emerald-500/20"
129
- >Default</span
130
- >
131
- <span v-else class="text-[var(--esc-panel-text-muted)]">-</span>
132
- </td>
133
- <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
134
- {{ status.position }}
135
- </td>
136
- <td class="px-4 py-3 text-right text-sm">
137
- <Link
138
- :href="route('escalated.admin.statuses.edit', status.id)"
139
- class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
140
- >
141
- Edit
142
- </Link>
143
- <button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(status.id)">
144
- Delete
145
- </button>
146
- </td>
147
- </tr>
148
- </tbody>
149
- </table>
150
- </div>
151
- </div>
152
- </EscalatedLayout>
153
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import { Link, router } from '@inertiajs/vue3';
4
+ import { computed } from 'vue';
5
+
6
+ const props = defineProps({
7
+ statuses: Array,
8
+ categories: Array,
9
+ });
10
+
11
+ const categoryLabels = {
12
+ new: 'New',
13
+ open: 'Open',
14
+ pending: 'Pending',
15
+ on_hold: 'On-Hold',
16
+ solved: 'Solved',
17
+ };
18
+
19
+ const groupedStatuses = computed(() => {
20
+ const groups = {};
21
+ for (const cat of props.categories || []) {
22
+ groups[cat] = (props.statuses || []).filter((s) => s.category === cat);
23
+ }
24
+ return groups;
25
+ });
26
+
27
+ function destroy(id) {
28
+ if (confirm('Delete this status?')) {
29
+ router.delete(route('escalated.admin.statuses.destroy', id));
30
+ }
31
+ }
32
+ </script>
33
+
34
+ <template>
35
+ <EscalatedLayout title="Ticket Statuses">
36
+ <div class="mb-4 flex justify-end">
37
+ <Link
38
+ :href="route('escalated.admin.statuses.create')"
39
+ 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)]"
40
+ >
41
+ Add Status
42
+ </Link>
43
+ </div>
44
+
45
+ <div
46
+ v-if="!statuses?.length"
47
+ class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] px-4 py-12 text-center"
48
+ >
49
+ <svg
50
+ class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
51
+ fill="none"
52
+ stroke="currentColor"
53
+ stroke-width="1.5"
54
+ viewBox="0 0 24 24"
55
+ >
56
+ <path
57
+ stroke-linecap="round"
58
+ stroke-linejoin="round"
59
+ d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
60
+ />
61
+ </svg>
62
+ <p class="text-sm text-[var(--esc-panel-text-muted)]">No custom statuses yet</p>
63
+ <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
64
+ Create sub-statuses to track ticket progress in detail
65
+ </p>
66
+ </div>
67
+
68
+ <div v-for="cat in categories" :key="cat" class="mb-6">
69
+ <h3 class="mb-2 text-sm font-semibold uppercase tracking-wider text-[var(--esc-panel-text-tertiary)]">
70
+ {{ categoryLabels[cat] || cat }}
71
+ </h3>
72
+ <div
73
+ class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]"
74
+ >
75
+ <table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
76
+ <thead>
77
+ <tr class="bg-[var(--esc-panel-hover)]">
78
+ <th
79
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
80
+ >
81
+ Color
82
+ </th>
83
+ <th
84
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
85
+ >
86
+ Label
87
+ </th>
88
+ <th
89
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
90
+ >
91
+ Default
92
+ </th>
93
+ <th
94
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
95
+ >
96
+ Position
97
+ </th>
98
+ <th
99
+ class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
100
+ >
101
+ Actions
102
+ </th>
103
+ </tr>
104
+ </thead>
105
+ <tbody class="divide-y divide-[var(--esc-panel-border)]">
106
+ <tr v-if="!groupedStatuses[cat]?.length">
107
+ <td colspan="5" class="px-4 py-6 text-center text-sm text-[var(--esc-panel-text-muted)]">
108
+ No statuses in this category
109
+ </td>
110
+ </tr>
111
+ <tr
112
+ v-for="status in groupedStatuses[cat]"
113
+ :key="status.id"
114
+ class="transition-colors hover:bg-[var(--esc-panel-hover)]"
115
+ >
116
+ <td class="px-4 py-3">
117
+ <span
118
+ class="inline-block h-4 w-4 rounded-full ring-1 ring-[var(--esc-panel-border-input)]"
119
+ :style="{ backgroundColor: status.color }"
120
+ ></span>
121
+ </td>
122
+ <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
123
+ {{ status.label }}
124
+ </td>
125
+ <td class="px-4 py-3 text-sm">
126
+ <span
127
+ v-if="status.is_default"
128
+ class="inline-flex items-center rounded-full bg-emerald-500/10 px-2 py-0.5 text-xs font-medium text-emerald-400 ring-1 ring-emerald-500/20"
129
+ >Default</span
130
+ >
131
+ <span v-else class="text-[var(--esc-panel-text-muted)]">-</span>
132
+ </td>
133
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
134
+ {{ status.position }}
135
+ </td>
136
+ <td class="px-4 py-3 text-right text-sm">
137
+ <Link
138
+ :href="route('escalated.admin.statuses.edit', status.id)"
139
+ class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
140
+ >
141
+ Edit
142
+ </Link>
143
+ <button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(status.id)">
144
+ Delete
145
+ </button>
146
+ </td>
147
+ </tr>
148
+ </tbody>
149
+ </table>
150
+ </div>
151
+ </div>
152
+ </EscalatedLayout>
153
+ </template>