@escalated-dev/escalated 0.5.0 → 0.7.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 (136) hide show
  1. package/README.md +102 -0
  2. package/package.json +37 -6
  3. package/src/components/ActivityTimeline.stories.js +55 -0
  4. package/src/components/ActivityTimeline.vue +83 -66
  5. package/src/components/AdminDashboard.stories.js +1095 -0
  6. package/src/components/AgentLoadIndicator.stories.js +37 -0
  7. package/src/components/AgentLoadIndicator.vue +49 -0
  8. package/src/components/AgentPerformanceCard.vue +44 -0
  9. package/src/components/ArticleEditor.vue +82 -0
  10. package/src/components/AssigneeSelect.vue +37 -23
  11. package/src/components/AttachmentList.vue +53 -37
  12. package/src/components/AuditLogEntry.vue +95 -0
  13. package/src/components/BulkActionBar.vue +99 -30
  14. package/src/components/CategoryTree.vue +89 -0
  15. package/src/components/ChartWidget.vue +46 -0
  16. package/src/components/CollisionWarning.stories.js +30 -0
  17. package/src/components/CollisionWarning.vue +68 -0
  18. package/src/components/ConditionalFieldRules.vue +135 -0
  19. package/src/components/ContextPanel.vue +66 -0
  20. package/src/components/ContextPanelSection.vue +65 -0
  21. package/src/components/CustomFieldRenderer.vue +159 -0
  22. package/src/components/EscalatedLayout.vue +400 -69
  23. package/src/components/FileDropzone.vue +57 -41
  24. package/src/components/FollowButton.stories.js +30 -0
  25. package/src/components/FollowButton.vue +53 -28
  26. package/src/components/KeyboardShortcutHelp.vue +129 -39
  27. package/src/components/KnowledgePanel.vue +122 -0
  28. package/src/components/KpiCard.stories.js +32 -0
  29. package/src/components/KpiCard.vue +88 -0
  30. package/src/components/MacroDropdown.vue +95 -35
  31. package/src/components/PermissionMatrix.vue +107 -0
  32. package/src/components/PinnedNotes.vue +75 -33
  33. package/src/components/PresenceIndicator.vue +93 -27
  34. package/src/components/PriorityBadge.stories.js +33 -0
  35. package/src/components/PriorityBadge.vue +46 -39
  36. package/src/components/QuickFilters.vue +65 -49
  37. package/src/components/ReplyComposer.vue +273 -159
  38. package/src/components/ReplyThread.vue +78 -23
  39. package/src/components/SatisfactionRating.vue +98 -46
  40. package/src/components/ScheduleEditor.vue +104 -0
  41. package/src/components/SideConversation.vue +165 -0
  42. package/src/components/SideConversationList.vue +147 -0
  43. package/src/components/SkillTagManager.vue +79 -0
  44. package/src/components/SlaComplianceChart.vue +53 -0
  45. package/src/components/SlaTimer.stories.js +35 -0
  46. package/src/components/SlaTimer.vue +62 -49
  47. package/src/components/StatsCard.stories.js +24 -0
  48. package/src/components/StatsCard.vue +58 -46
  49. package/src/components/StatusBadge.stories.js +53 -0
  50. package/src/components/StatusBadge.vue +78 -46
  51. package/src/components/TagSelect.vue +84 -53
  52. package/src/components/TicketFilters.vue +225 -69
  53. package/src/components/TicketLinkPanel.vue +193 -0
  54. package/src/components/TicketList.vue +594 -193
  55. package/src/components/TicketMergeDialog.vue +157 -0
  56. package/src/components/TicketSidebar.vue +167 -99
  57. package/src/components/TicketTypeSelector.vue +21 -0
  58. package/src/components/TotpInput.stories.js +9 -0
  59. package/src/components/TotpInput.vue +81 -0
  60. package/src/components/TwoFactorSetup.vue +113 -0
  61. package/src/composables/useDebouncedSearch.js +38 -0
  62. package/src/composables/useI18n.js +80 -0
  63. package/src/composables/usePluginExtensions.js +95 -3
  64. package/src/composables/usePluginHooks.js +65 -0
  65. package/src/defineEscalatedPlugin.js +34 -8
  66. package/src/index.js +72 -35
  67. package/src/locales/de.json +442 -0
  68. package/src/locales/en.json +467 -0
  69. package/src/locales/es.json +442 -0
  70. package/src/locales/fr.json +442 -0
  71. package/src/locales/index.js +6 -0
  72. package/src/pages/Admin/ApiTokens/Index.vue +231 -67
  73. package/src/pages/Admin/AuditLog/Index.vue +154 -0
  74. package/src/pages/Admin/Automations/Form.vue +184 -0
  75. package/src/pages/Admin/Automations/Index.vue +129 -0
  76. package/src/pages/Admin/BusinessHours/Form.vue +172 -0
  77. package/src/pages/Admin/BusinessHours/Index.vue +113 -0
  78. package/src/pages/Admin/CannedResponses/Index.vue +127 -70
  79. package/src/pages/Admin/Capacity/Index.vue +134 -0
  80. package/src/pages/Admin/CustomFields/Form.vue +195 -0
  81. package/src/pages/Admin/CustomFields/Index.vue +134 -0
  82. package/src/pages/Admin/CustomObjects/Form.vue +202 -0
  83. package/src/pages/Admin/CustomObjects/Index.vue +127 -0
  84. package/src/pages/Admin/CustomObjects/Records.vue +228 -0
  85. package/src/pages/Admin/Departments/Form.vue +75 -51
  86. package/src/pages/Admin/Departments/Index.vue +109 -57
  87. package/src/pages/Admin/EscalationRules/Form.vue +157 -96
  88. package/src/pages/Admin/EscalationRules/Index.vue +178 -57
  89. package/src/pages/Admin/Import/Connect.vue +96 -0
  90. package/src/pages/Admin/Import/Index.vue +102 -0
  91. package/src/pages/Admin/Import/Mapping.vue +110 -0
  92. package/src/pages/Admin/Import/Progress.vue +153 -0
  93. package/src/pages/Admin/Import/Review.vue +76 -0
  94. package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -0
  95. package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -0
  96. package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -0
  97. package/src/pages/Admin/Macros/Index.vue +250 -89
  98. package/src/pages/Admin/Plugins/Index.vue +205 -75
  99. package/src/pages/Admin/Reports/AgentMetrics.vue +115 -0
  100. package/src/pages/Admin/Reports/CsatReport.vue +127 -0
  101. package/src/pages/Admin/Reports/Dashboard.vue +211 -0
  102. package/src/pages/Admin/Reports/SlaReport.vue +166 -0
  103. package/src/pages/Admin/Reports.vue +139 -34
  104. package/src/pages/Admin/Roles/Form.vue +71 -0
  105. package/src/pages/Admin/Roles/Index.vue +122 -0
  106. package/src/pages/Admin/Settings/CsatSettings.vue +165 -0
  107. package/src/pages/Admin/Settings/DataRetention.vue +182 -0
  108. package/src/pages/Admin/Settings/EmailSettings.vue +243 -0
  109. package/src/pages/Admin/Settings/Sandbox.vue +135 -0
  110. package/src/pages/Admin/Settings/SsoSettings.vue +218 -0
  111. package/src/pages/Admin/Settings/TwoFactor.vue +110 -0
  112. package/src/pages/Admin/Settings.vue +468 -260
  113. package/src/pages/Admin/Skills/Form.vue +53 -0
  114. package/src/pages/Admin/Skills/Index.vue +94 -0
  115. package/src/pages/Admin/SlaPolicies/Form.vue +118 -75
  116. package/src/pages/Admin/SlaPolicies/Index.vue +120 -59
  117. package/src/pages/Admin/Statuses/Form.vue +114 -0
  118. package/src/pages/Admin/Statuses/Index.vue +153 -0
  119. package/src/pages/Admin/Tags/Index.vue +191 -105
  120. package/src/pages/Admin/Tickets/Index.vue +91 -39
  121. package/src/pages/Admin/Tickets/Show.vue +101 -37
  122. package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -0
  123. package/src/pages/Admin/Webhooks/Form.vue +110 -0
  124. package/src/pages/Admin/Webhooks/Index.vue +136 -0
  125. package/src/pages/Agent/Dashboard.vue +311 -186
  126. package/src/pages/Agent/TicketIndex.vue +88 -38
  127. package/src/pages/Agent/TicketShow.vue +258 -51
  128. package/src/pages/Customer/Create.vue +36 -9
  129. package/src/pages/Customer/Index.vue +31 -24
  130. package/src/pages/Customer/KnowledgeBase/Article.vue +127 -0
  131. package/src/pages/Customer/KnowledgeBase/Index.vue +151 -0
  132. package/src/plugin.js +86 -1
  133. package/src/utils/constants.js +30 -0
  134. package/src/utils/formatting.js +35 -0
  135. package/src/utils/sanitizeHtml.js +64 -0
  136. package/src/pages/Admin/Plugins.vue +0 -129
@@ -0,0 +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>
@@ -0,0 +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,105 +1,191 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import { useForm, router } from '@inertiajs/vue3';
4
- import { ref } from 'vue';
5
-
6
- defineProps({ tags: Array });
7
-
8
- const showForm = ref(false);
9
- const editingTag = ref(null);
10
-
11
- const form = useForm({ name: '', color: '#06b6d4' });
12
-
13
- function createTag() {
14
- form.post(route('escalated.admin.tags.store'), {
15
- onSuccess: () => { form.reset(); showForm.value = false; },
16
- });
17
- }
18
-
19
- function startEdit(tag) {
20
- editingTag.value = tag.id;
21
- form.name = tag.name;
22
- form.color = tag.color;
23
- }
24
-
25
- function updateTag(id) {
26
- form.put(route('escalated.admin.tags.update', id), {
27
- onSuccess: () => { editingTag.value = null; form.reset(); },
28
- });
29
- }
30
-
31
- function destroy(id) {
32
- if (confirm('Delete this tag?')) {
33
- router.delete(route('escalated.admin.tags.destroy', id));
34
- }
35
- }
36
- </script>
37
-
38
- <template>
39
- <EscalatedLayout title="Tags">
40
- <div class="mb-4 flex justify-end">
41
- <button @click="showForm = !showForm"
42
- :class="showForm
43
- ? 'rounded-lg border border-white/10 bg-white/[0.03] px-4 py-2 text-sm font-medium text-neutral-300 transition-colors hover:bg-white/[0.06]'
44
- : 'rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-4 py-2 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400'">
45
- {{ showForm ? 'Cancel' : 'Add Tag' }}
46
- </button>
47
- </div>
48
- <form v-if="showForm" @submit.prevent="createTag" class="mb-6 flex items-end gap-3 rounded-xl border border-white/[0.06] bg-neutral-900/60 p-4">
49
- <div>
50
- <label class="block text-sm font-medium text-neutral-300">Name</label>
51
- <input v-model="form.name" type="text" required class="mt-1 rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
52
- </div>
53
- <div>
54
- <label class="block text-sm font-medium text-neutral-300">Color</label>
55
- <input v-model="form.color" type="color" class="mt-1 h-10 w-16 rounded-lg border border-white/10 bg-neutral-950" />
56
- </div>
57
- <button type="submit" :disabled="form.processing"
58
- class="rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-4 py-2 text-sm font-medium text-white shadow-lg shadow-black/20 transition-all hover:from-cyan-400 hover:to-violet-400 disabled:opacity-50">
59
- Create
60
- </button>
61
- </form>
62
- <div class="overflow-hidden rounded-xl border border-white/[0.06] bg-neutral-900/60">
63
- <table class="min-w-full divide-y divide-white/[0.06]">
64
- <thead>
65
- <tr class="bg-white/[0.02]">
66
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Color</th>
67
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Name</th>
68
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Tickets</th>
69
- <th class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Actions</th>
70
- </tr>
71
- </thead>
72
- <tbody class="divide-y divide-white/[0.04]">
73
- <tr v-if="!tags?.length">
74
- <td colspan="4" class="px-4 py-12 text-center">
75
- <svg class="mx-auto mb-3 h-8 w-8 text-neutral-700" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z M6 6h.008v.008H6V6z" /></svg>
76
- <p class="text-sm text-neutral-500">No tags yet</p>
77
- <p class="mt-1 text-xs text-neutral-600">Create tags to categorize and filter tickets</p>
78
- </td>
79
- </tr>
80
- <tr v-for="tag in tags" :key="tag.id" class="transition-colors hover:bg-white/[0.03]">
81
- <td class="px-4 py-3">
82
- <span class="inline-block h-4 w-4 rounded-full ring-1 ring-white/10" :style="{ backgroundColor: tag.color }"></span>
83
- </td>
84
- <td class="px-4 py-3 text-sm font-medium text-neutral-200">
85
- <template v-if="editingTag === tag.id">
86
- <form @submit.prevent="updateTag(tag.id)" class="flex items-center gap-2">
87
- <input v-model="form.name" type="text" required class="rounded-lg border border-white/10 bg-neutral-950 px-2 py-1 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
88
- <input v-model="form.color" type="color" class="h-8 w-10 rounded border border-white/10 bg-neutral-950" />
89
- <button type="submit" class="text-sm text-neutral-300 hover:text-white">Save</button>
90
- <button type="button" @click="editingTag = null" class="text-sm text-neutral-400 hover:text-neutral-300">Cancel</button>
91
- </form>
92
- </template>
93
- <template v-else>{{ tag.name }}</template>
94
- </td>
95
- <td class="px-4 py-3 text-sm text-neutral-400">{{ tag.tickets_count }}</td>
96
- <td class="px-4 py-3 text-right text-sm">
97
- <button @click="startEdit(tag)" class="text-neutral-300 hover:text-white">Edit</button>
98
- <button @click="destroy(tag.id)" class="ml-3 text-rose-400 hover:text-rose-300">Delete</button>
99
- </td>
100
- </tr>
101
- </tbody>
102
- </table>
103
- </div>
104
- </EscalatedLayout>
105
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import { useForm, router } from '@inertiajs/vue3';
4
+ import { ref } from 'vue';
5
+
6
+ defineProps({ tags: Array });
7
+
8
+ const showForm = ref(false);
9
+ const editingTag = ref(null);
10
+
11
+ const form = useForm({ name: '', color: '#06b6d4' });
12
+
13
+ function createTag() {
14
+ form.post(route('escalated.admin.tags.store'), {
15
+ onSuccess: () => {
16
+ form.reset();
17
+ showForm.value = false;
18
+ },
19
+ });
20
+ }
21
+
22
+ function startEdit(tag) {
23
+ editingTag.value = tag.id;
24
+ form.name = tag.name;
25
+ form.color = tag.color;
26
+ }
27
+
28
+ function updateTag(id) {
29
+ form.put(route('escalated.admin.tags.update', id), {
30
+ onSuccess: () => {
31
+ editingTag.value = null;
32
+ form.reset();
33
+ },
34
+ });
35
+ }
36
+
37
+ function destroy(id) {
38
+ if (confirm('Delete this tag?')) {
39
+ router.delete(route('escalated.admin.tags.destroy', id));
40
+ }
41
+ }
42
+ </script>
43
+
44
+ <template>
45
+ <EscalatedLayout title="Tags">
46
+ <div class="mb-4 flex justify-end">
47
+ <button
48
+ :class="
49
+ showForm
50
+ ? 'rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] px-4 py-2 text-sm font-medium text-[var(--esc-panel-text-secondary)] transition-colors hover:bg-[var(--esc-panel-hover)]'
51
+ : '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)]'
52
+ "
53
+ @click="showForm = !showForm"
54
+ >
55
+ {{ showForm ? 'Cancel' : 'Add Tag' }}
56
+ </button>
57
+ </div>
58
+ <form
59
+ v-if="showForm"
60
+ class="mb-6 flex items-end gap-3 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-4"
61
+ @submit.prevent="createTag"
62
+ >
63
+ <div>
64
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Name</label>
65
+ <input
66
+ v-model="form.name"
67
+ type="text"
68
+ required
69
+ class="mt-1 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)]"
70
+ />
71
+ </div>
72
+ <div>
73
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Color</label>
74
+ <input
75
+ v-model="form.color"
76
+ type="color"
77
+ class="mt-1 h-10 w-16 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)]"
78
+ />
79
+ </div>
80
+ <button
81
+ type="submit"
82
+ :disabled="form.processing"
83
+ 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)] disabled:opacity-50"
84
+ >
85
+ Create
86
+ </button>
87
+ </form>
88
+ <div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]">
89
+ <table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
90
+ <thead>
91
+ <tr class="bg-[var(--esc-panel-hover)]">
92
+ <th
93
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
94
+ >
95
+ Color
96
+ </th>
97
+ <th
98
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
99
+ >
100
+ Name
101
+ </th>
102
+ <th
103
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
104
+ >
105
+ Tickets
106
+ </th>
107
+ <th
108
+ class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
109
+ >
110
+ Actions
111
+ </th>
112
+ </tr>
113
+ </thead>
114
+ <tbody class="divide-y divide-[var(--esc-panel-border)]">
115
+ <tr v-if="!tags?.length">
116
+ <td colspan="4" class="px-4 py-12 text-center">
117
+ <svg
118
+ class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
119
+ fill="none"
120
+ stroke="currentColor"
121
+ stroke-width="1.5"
122
+ viewBox="0 0 24 24"
123
+ >
124
+ <path
125
+ stroke-linecap="round"
126
+ stroke-linejoin="round"
127
+ d="M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z M6 6h.008v.008H6V6z"
128
+ />
129
+ </svg>
130
+ <p class="text-sm text-[var(--esc-panel-text-muted)]">No tags yet</p>
131
+ <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
132
+ Create tags to categorize and filter tickets
133
+ </p>
134
+ </td>
135
+ </tr>
136
+ <tr v-for="tag in tags" :key="tag.id" class="transition-colors hover:bg-[var(--esc-panel-hover)]">
137
+ <td class="px-4 py-3">
138
+ <span
139
+ class="inline-block h-4 w-4 rounded-full ring-1 ring-[var(--esc-panel-border-input)]"
140
+ :style="{ backgroundColor: tag.color }"
141
+ ></span>
142
+ </td>
143
+ <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
144
+ <template v-if="editingTag === tag.id">
145
+ <form class="flex items-center gap-2" @submit.prevent="updateTag(tag.id)">
146
+ <input
147
+ v-model="form.name"
148
+ type="text"
149
+ required
150
+ class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1 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)]"
151
+ />
152
+ <input
153
+ v-model="form.color"
154
+ type="color"
155
+ class="h-8 w-10 rounded border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)]"
156
+ />
157
+ <button
158
+ type="submit"
159
+ class="text-sm text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
160
+ >
161
+ Save
162
+ </button>
163
+ <button
164
+ type="button"
165
+ class="text-sm text-[var(--esc-panel-text-tertiary)] hover:text-[var(--esc-panel-text-secondary)]"
166
+ @click="editingTag = null"
167
+ >
168
+ Cancel
169
+ </button>
170
+ </form>
171
+ </template>
172
+ <template v-else>{{ tag.name }}</template>
173
+ </td>
174
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">{{ tag.tickets_count }}</td>
175
+ <td class="px-4 py-3 text-right text-sm">
176
+ <button
177
+ class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
178
+ @click="startEdit(tag)"
179
+ >
180
+ Edit
181
+ </button>
182
+ <button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(tag.id)">
183
+ Delete
184
+ </button>
185
+ </td>
186
+ </tr>
187
+ </tbody>
188
+ </table>
189
+ </div>
190
+ </EscalatedLayout>
191
+ </template>