@escalated-dev/escalated 0.6.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 (187) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +125 -2
  3. package/package.json +40 -5
  4. package/src/components/ActiveChatsPanel.vue +246 -0
  5. package/src/components/ActivityTimeline.stories.js +55 -0
  6. package/src/components/ActivityTimeline.vue +83 -66
  7. package/src/components/AdminDashboard.stories.js +1423 -0
  8. package/src/components/AgentLoadIndicator.stories.js +37 -0
  9. package/src/components/AgentLoadIndicator.vue +49 -0
  10. package/src/components/AgentPerformanceCard.vue +44 -0
  11. package/src/components/ArticleEditor.vue +82 -0
  12. package/src/components/AssigneeSelect.vue +37 -23
  13. package/src/components/AttachmentList.vue +65 -37
  14. package/src/components/AuditLogEntry.vue +95 -0
  15. package/src/components/BulkActionBar.vue +166 -97
  16. package/src/components/CategoryTree.vue +89 -0
  17. package/src/components/ChartWidget.vue +46 -0
  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 -0
  24. package/src/components/CollisionWarning.vue +68 -0
  25. package/src/components/ConditionalFieldRules.vue +135 -0
  26. package/src/components/ContextPanel.vue +66 -0
  27. package/src/components/ContextPanelSection.vue +65 -0
  28. package/src/components/CustomFieldRenderer.vue +159 -0
  29. package/src/components/EscalatedLayout.vue +424 -70
  30. package/src/components/FileDropzone.vue +57 -41
  31. package/src/components/FollowButton.stories.js +30 -0
  32. package/src/components/FollowButton.vue +88 -63
  33. package/src/components/KeyboardShortcutHelp.vue +213 -123
  34. package/src/components/KnowledgePanel.vue +122 -0
  35. package/src/components/KpiCard.stories.js +32 -0
  36. package/src/components/KpiCard.vue +88 -0
  37. package/src/components/MacroDropdown.vue +150 -90
  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 -0
  43. package/src/components/PinnedNotes.vue +129 -90
  44. package/src/components/PluginSlot.vue +68 -62
  45. package/src/components/PresenceIndicator.vue +138 -28
  46. package/src/components/PriorityBadge.stories.js +33 -0
  47. package/src/components/PriorityBadge.vue +46 -39
  48. package/src/components/QuickFilters.vue +65 -49
  49. package/src/components/ReplyComposer.vue +207 -30
  50. package/src/components/ReplyThread.vue +111 -21
  51. package/src/components/ReportChart.vue +395 -0
  52. package/src/components/ReportExportButton.vue +108 -0
  53. package/src/components/SatisfactionRating.vue +180 -128
  54. package/src/components/SaveViewDialog.vue +172 -0
  55. package/src/components/SavedViewSidebar.vue +208 -0
  56. package/src/components/ScheduleEditor.vue +104 -0
  57. package/src/components/SideConversation.vue +165 -0
  58. package/src/components/SideConversationList.vue +147 -0
  59. package/src/components/SkillTagManager.vue +79 -0
  60. package/src/components/SlaComplianceChart.vue +46 -0
  61. package/src/components/SlaTimer.stories.js +35 -0
  62. package/src/components/SlaTimer.vue +62 -49
  63. package/src/components/SnoozeButton.vue +247 -0
  64. package/src/components/StatsCard.stories.js +24 -0
  65. package/src/components/StatsCard.vue +18 -6
  66. package/src/components/StatusBadge.stories.js +53 -0
  67. package/src/components/StatusBadge.vue +78 -46
  68. package/src/components/TagSelect.vue +84 -53
  69. package/src/components/TicketFilters.vue +247 -46
  70. package/src/components/TicketLinkPanel.vue +193 -0
  71. package/src/components/TicketList.vue +536 -74
  72. package/src/components/TicketMergeDialog.vue +157 -0
  73. package/src/components/TicketSidebar.vue +167 -99
  74. package/src/components/TicketSplitDialog.vue +98 -0
  75. package/src/components/TicketTypeSelector.vue +21 -0
  76. package/src/components/TotpInput.stories.js +9 -0
  77. package/src/components/TotpInput.vue +81 -0
  78. package/src/components/TwoFactorSetup.vue +113 -0
  79. package/src/components/VariableTokenInput.vue +111 -0
  80. package/src/components/WorkflowActionConfig.vue +287 -0
  81. package/src/components/WorkflowActionList.vue +350 -0
  82. package/src/components/WorkflowConditionBuilder.vue +265 -0
  83. package/src/components/WorkflowTriggerSelector.vue +125 -0
  84. package/src/composables/useChat.js +187 -0
  85. package/src/composables/useDebouncedSearch.js +38 -0
  86. package/src/composables/useI18n.js +80 -80
  87. package/src/composables/useKeyboardShortcuts.js +46 -46
  88. package/src/composables/useMentions.js +134 -0
  89. package/src/composables/usePluginExtensions.js +159 -67
  90. package/src/composables/usePluginHooks.js +65 -0
  91. package/src/composables/useRealtime.js +182 -0
  92. package/src/defineEscalatedPlugin.js +76 -50
  93. package/src/index.js +77 -28
  94. package/src/locales/ar.json +727 -0
  95. package/src/locales/de.json +678 -430
  96. package/src/locales/en.json +717 -430
  97. package/src/locales/es.json +679 -430
  98. package/src/locales/fr.json +680 -431
  99. package/src/locales/index.js +12 -2
  100. package/src/locales/it.json +727 -0
  101. package/src/locales/ja.json +727 -0
  102. package/src/locales/ko.json +727 -0
  103. package/src/locales/nl.json +727 -0
  104. package/src/locales/pl.json +727 -0
  105. package/src/locales/pt-BR.json +727 -0
  106. package/src/locales/ru.json +727 -0
  107. package/src/locales/tr.json +727 -0
  108. package/src/locales/zh-CN.json +727 -0
  109. package/src/pages/Admin/ApiTokens/Index.vue +381 -217
  110. package/src/pages/Admin/AuditLog/Index.vue +154 -0
  111. package/src/pages/Admin/BusinessHours/Form.vue +172 -0
  112. package/src/pages/Admin/BusinessHours/Index.vue +113 -0
  113. package/src/pages/Admin/CannedResponses/Index.vue +82 -25
  114. package/src/pages/Admin/Capacity/Index.vue +134 -0
  115. package/src/pages/Admin/CustomFields/Form.vue +195 -0
  116. package/src/pages/Admin/CustomFields/Index.vue +134 -0
  117. package/src/pages/Admin/CustomObjects/Form.vue +202 -0
  118. package/src/pages/Admin/CustomObjects/Index.vue +127 -0
  119. package/src/pages/Admin/CustomObjects/Records.vue +228 -0
  120. package/src/pages/Admin/Departments/Form.vue +35 -11
  121. package/src/pages/Admin/Departments/Index.vue +74 -21
  122. package/src/pages/Admin/EscalationRules/Form.vue +86 -25
  123. package/src/pages/Admin/EscalationRules/Index.vue +158 -37
  124. package/src/pages/Admin/Import/Connect.vue +95 -0
  125. package/src/pages/Admin/Import/Index.vue +102 -0
  126. package/src/pages/Admin/Import/Mapping.vue +110 -0
  127. package/src/pages/Admin/Import/Progress.vue +153 -0
  128. package/src/pages/Admin/Import/Review.vue +76 -0
  129. package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -0
  130. package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -0
  131. package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -0
  132. package/src/pages/Admin/Macros/Index.vue +448 -287
  133. package/src/pages/Admin/Plugins/Index.vue +327 -197
  134. package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
  135. package/src/pages/Admin/Reports/AgentMetrics.vue +115 -0
  136. package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
  137. package/src/pages/Admin/Reports/Cohorts.vue +180 -0
  138. package/src/pages/Admin/Reports/Comparison.vue +141 -0
  139. package/src/pages/Admin/Reports/CsatReport.vue +127 -0
  140. package/src/pages/Admin/Reports/Dashboard.vue +226 -0
  141. package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
  142. package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
  143. package/src/pages/Admin/Reports/SlaReport.vue +162 -0
  144. package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
  145. package/src/pages/Admin/Reports.vue +206 -101
  146. package/src/pages/Admin/Roles/Form.vue +71 -0
  147. package/src/pages/Admin/Roles/Index.vue +122 -0
  148. package/src/pages/Admin/Settings/CsatSettings.vue +165 -0
  149. package/src/pages/Admin/Settings/DataRetention.vue +182 -0
  150. package/src/pages/Admin/Settings/EmailSettings.vue +243 -0
  151. package/src/pages/Admin/Settings/Sandbox.vue +135 -0
  152. package/src/pages/Admin/Settings/SsoSettings.vue +218 -0
  153. package/src/pages/Admin/Settings/TwoFactor.vue +110 -0
  154. package/src/pages/Admin/Settings.vue +847 -99
  155. package/src/pages/Admin/Skills/Form.vue +53 -0
  156. package/src/pages/Admin/Skills/Index.vue +94 -0
  157. package/src/pages/Admin/SlaPolicies/Form.vue +62 -19
  158. package/src/pages/Admin/SlaPolicies/Index.vue +85 -23
  159. package/src/pages/Admin/Statuses/Form.vue +114 -0
  160. package/src/pages/Admin/Statuses/Index.vue +153 -0
  161. package/src/pages/Admin/Tags/Index.vue +121 -35
  162. package/src/pages/Admin/Tickets/Index.vue +96 -9
  163. package/src/pages/Admin/Tickets/Show.vue +130 -37
  164. package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -0
  165. package/src/pages/Admin/Webhooks/Form.vue +110 -0
  166. package/src/pages/Admin/Webhooks/Index.vue +136 -0
  167. package/src/pages/Admin/Workflows/Builder.vue +207 -0
  168. package/src/pages/Admin/Workflows/Index.vue +235 -0
  169. package/src/pages/Admin/Workflows/Logs.vue +286 -0
  170. package/src/pages/Agent/Dashboard.vue +311 -186
  171. package/src/pages/Agent/TicketIndex.vue +80 -6
  172. package/src/pages/Agent/TicketShow.vue +399 -60
  173. package/src/pages/Customer/Create.vue +37 -10
  174. package/src/pages/Customer/Index.vue +9 -2
  175. package/src/pages/Customer/KnowledgeBase/Article.vue +129 -0
  176. package/src/pages/Customer/KnowledgeBase/Index.vue +151 -0
  177. package/src/pages/Customer/Show.vue +69 -63
  178. package/src/pages/Guest/Create.vue +40 -15
  179. package/src/pages/Guest/Show.vue +124 -93
  180. package/src/plugin.js +111 -1
  181. package/src/utils/constants.js +30 -0
  182. package/src/utils/formatting.js +35 -0
  183. package/src/utils/mentionHighlight.js +24 -0
  184. package/src/utils/sanitizeHtml.js +78 -64
  185. package/src/widget/EscalatedWidget.vue +804 -0
  186. package/src/widget/index.js +254 -0
  187. package/src/pages/Admin/Plugins.vue +0 -129
@@ -14,40 +14,93 @@ function destroy(id) {
14
14
  <template>
15
15
  <EscalatedLayout title="Departments">
16
16
  <div class="mb-4 flex justify-end">
17
- <Link :href="route('escalated.admin.departments.create')"
18
- 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">
17
+ <Link
18
+ :href="route('escalated.admin.departments.create')"
19
+ 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)]"
20
+ >
19
21
  Add Department
20
22
  </Link>
21
23
  </div>
22
- <div class="overflow-hidden rounded-xl border border-white/[0.06] bg-neutral-900/60">
23
- <table class="min-w-full divide-y divide-white/[0.06]">
24
+ <div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]">
25
+ <table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
24
26
  <thead>
25
- <tr class="bg-white/[0.02]">
26
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Name</th>
27
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Tickets</th>
28
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Agents</th>
29
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Active</th>
30
- <th class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Actions</th>
27
+ <tr class="bg-[var(--esc-panel-hover)]">
28
+ <th
29
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
30
+ >
31
+ Name
32
+ </th>
33
+ <th
34
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
35
+ >
36
+ Tickets
37
+ </th>
38
+ <th
39
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
40
+ >
41
+ Agents
42
+ </th>
43
+ <th
44
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
45
+ >
46
+ Active
47
+ </th>
48
+ <th
49
+ class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
50
+ >
51
+ Actions
52
+ </th>
31
53
  </tr>
32
54
  </thead>
33
- <tbody class="divide-y divide-white/[0.04]">
34
- <tr v-for="dept in departments" :key="dept.id" class="transition-colors hover:bg-white/[0.03]">
35
- <td class="px-4 py-3 text-sm font-medium text-neutral-200">{{ dept.name }}</td>
36
- <td class="px-4 py-3 text-sm text-neutral-400">{{ dept.tickets_count }}</td>
37
- <td class="px-4 py-3 text-sm text-neutral-400">{{ dept.agents_count }}</td>
55
+ <tbody class="divide-y divide-[var(--esc-panel-border)]">
56
+ <tr
57
+ v-for="dept in departments"
58
+ :key="dept.id"
59
+ class="transition-colors hover:bg-[var(--esc-panel-hover)]"
60
+ >
61
+ <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
62
+ {{ dept.name }}
63
+ </td>
64
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
65
+ {{ dept.tickets_count }}
66
+ </td>
67
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">{{ dept.agents_count }}</td>
38
68
  <td class="px-4 py-3 text-sm">
39
- <span :class="dept.is_active ? 'text-emerald-400' : 'text-neutral-500'">{{ dept.is_active ? 'Yes' : 'No' }}</span>
69
+ <span :class="dept.is_active ? 'text-emerald-400' : 'text-[var(--esc-panel-text-muted)]'">{{
70
+ dept.is_active ? 'Yes' : 'No'
71
+ }}</span>
40
72
  </td>
41
73
  <td class="px-4 py-3 text-right text-sm">
42
- <Link :href="route('escalated.admin.departments.edit', dept.id)" class="text-neutral-300 hover:text-white">Edit</Link>
43
- <button @click="destroy(dept.id)" class="ml-3 text-rose-400 hover:text-rose-300">Delete</button>
74
+ <Link
75
+ :href="route('escalated.admin.departments.edit', dept.id)"
76
+ class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
77
+ >
78
+ Edit
79
+ </Link>
80
+ <button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(dept.id)">
81
+ Delete
82
+ </button>
44
83
  </td>
45
84
  </tr>
46
85
  <tr v-if="!departments?.length">
47
86
  <td colspan="5" class="px-4 py-12 text-center">
48
- <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="M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 01-1.125-1.125v-3.75zM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-8.25zM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-2.25z" /></svg>
49
- <p class="text-sm text-neutral-500">No departments yet</p>
50
- <p class="mt-1 text-xs text-neutral-600">Create your first department to organize tickets</p>
87
+ <svg
88
+ class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
89
+ fill="none"
90
+ stroke="currentColor"
91
+ stroke-width="1.5"
92
+ viewBox="0 0 24 24"
93
+ >
94
+ <path
95
+ stroke-linecap="round"
96
+ stroke-linejoin="round"
97
+ d="M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 01-1.125-1.125v-3.75zM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-8.25zM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 01-1.125-1.125v-2.25z"
98
+ />
99
+ </svg>
100
+ <p class="text-sm text-[var(--esc-panel-text-muted)]">No departments yet</p>
101
+ <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
102
+ Create your first department to organize tickets
103
+ </p>
51
104
  </td>
52
105
  </tr>
53
106
  </tbody>
@@ -14,10 +14,18 @@ const form = useForm({
14
14
  is_active: props.rule?.is_active ?? true,
15
15
  });
16
16
 
17
- function addCondition() { form.conditions.push({ field: '', value: '' }); }
18
- function removeCondition(idx) { form.conditions.splice(idx, 1); }
19
- function addAction() { form.actions.push({ type: '', value: '' }); }
20
- function removeAction(idx) { form.actions.splice(idx, 1); }
17
+ function addCondition() {
18
+ form.conditions.push({ field: '', value: '' });
19
+ }
20
+ function removeCondition(idx) {
21
+ form.conditions.splice(idx, 1);
22
+ }
23
+ function addAction() {
24
+ form.actions.push({ type: '', value: '' });
25
+ }
26
+ function removeAction(idx) {
27
+ form.actions.splice(idx, 1);
28
+ }
21
29
 
22
30
  function submit() {
23
31
  if (props.rule) {
@@ -30,14 +38,25 @@ function submit() {
30
38
 
31
39
  <template>
32
40
  <EscalatedLayout :title="rule ? 'Edit Escalation Rule' : 'New Escalation Rule'">
33
- <form @submit.prevent="submit" class="mx-auto max-w-lg space-y-5 rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
41
+ <form
42
+ class="mx-auto max-w-lg space-y-5 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6"
43
+ @submit.prevent="submit"
44
+ >
34
45
  <div>
35
- <label class="block text-sm font-medium text-neutral-300">Name</label>
36
- <input v-model="form.name" type="text" required class="mt-1 w-full 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" />
46
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Name</label>
47
+ <input
48
+ v-model="form.name"
49
+ type="text"
50
+ required
51
+ 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)]"
52
+ />
37
53
  </div>
38
54
  <div>
39
- <label class="block text-sm font-medium text-neutral-300">Trigger Type</label>
40
- <select v-model="form.trigger_type" class="mt-1 w-full 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">
55
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Trigger Type</label>
56
+ <select
57
+ v-model="form.trigger_type"
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
+ >
41
60
  <option value="time_based">Time Based</option>
42
61
  <option value="sla_breach">SLA Breach</option>
43
62
  <option value="priority_based">Priority Based</option>
@@ -45,11 +64,20 @@ function submit() {
45
64
  </div>
46
65
  <div>
47
66
  <div class="mb-2 flex items-center justify-between">
48
- <label class="text-sm font-medium text-neutral-300">Conditions</label>
49
- <button type="button" @click="addCondition" class="text-sm text-neutral-300 hover:text-white">+ Add</button>
67
+ <label class="text-sm font-medium text-[var(--esc-panel-text-secondary)]">Conditions</label>
68
+ <button
69
+ type="button"
70
+ class="text-sm text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
71
+ @click="addCondition"
72
+ >
73
+ + Add
74
+ </button>
50
75
  </div>
51
76
  <div v-for="(cond, idx) in form.conditions" :key="idx" class="mb-2 flex gap-2">
52
- <select v-model="cond.field" class="w-1/2 rounded-lg border border-white/10 bg-neutral-950 px-2 py-1.5 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10">
77
+ <select
78
+ v-model="cond.field"
79
+ class="w-1/2 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 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)]"
80
+ >
53
81
  <option value="status">Status</option>
54
82
  <option value="priority">Priority</option>
55
83
  <option value="assigned">Assignment</option>
@@ -57,37 +85,70 @@ function submit() {
57
85
  <option value="no_response_hours">No Response (hours)</option>
58
86
  <option value="sla_breached">SLA Breached</option>
59
87
  </select>
60
- <input v-model="cond.value" class="w-1/2 rounded-lg border border-white/10 bg-neutral-950 px-2 py-1.5 text-sm text-neutral-200 placeholder-gray-500 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" placeholder="Value" />
61
- <button type="button" @click="removeCondition(idx)" class="text-rose-400 hover:text-rose-300">&times;</button>
88
+ <input
89
+ v-model="cond.value"
90
+ class="w-1/2 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] placeholder-gray-500 focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
91
+ placeholder="Value"
92
+ />
93
+ <button type="button" class="text-rose-400 hover:text-rose-300" @click="removeCondition(idx)">
94
+ &times;
95
+ </button>
62
96
  </div>
63
97
  </div>
64
98
  <div>
65
99
  <div class="mb-2 flex items-center justify-between">
66
- <label class="text-sm font-medium text-neutral-300">Actions</label>
67
- <button type="button" @click="addAction" class="text-sm text-neutral-300 hover:text-white">+ Add</button>
100
+ <label class="text-sm font-medium text-[var(--esc-panel-text-secondary)]">Actions</label>
101
+ <button
102
+ type="button"
103
+ class="text-sm text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
104
+ @click="addAction"
105
+ >
106
+ + Add
107
+ </button>
68
108
  </div>
69
109
  <div v-for="(action, idx) in form.actions" :key="idx" class="mb-2 flex gap-2">
70
- <select v-model="action.type" class="w-1/2 rounded-lg border border-white/10 bg-neutral-950 px-2 py-1.5 text-sm text-neutral-200 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10">
110
+ <select
111
+ v-model="action.type"
112
+ class="w-1/2 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 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)]"
113
+ >
71
114
  <option value="escalate">Escalate</option>
72
115
  <option value="change_priority">Change Priority</option>
73
116
  <option value="assign_to">Assign To</option>
74
117
  <option value="change_department">Change Department</option>
75
118
  </select>
76
- <input v-model="action.value" class="w-1/2 rounded-lg border border-white/10 bg-neutral-950 px-2 py-1.5 text-sm text-neutral-200 placeholder-gray-500 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" placeholder="Value" />
77
- <button type="button" @click="removeAction(idx)" class="text-rose-400 hover:text-rose-300">&times;</button>
119
+ <input
120
+ v-model="action.value"
121
+ class="w-1/2 rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-2 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] placeholder-gray-500 focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
122
+ placeholder="Value"
123
+ />
124
+ <button type="button" class="text-rose-400 hover:text-rose-300" @click="removeAction(idx)">
125
+ &times;
126
+ </button>
78
127
  </div>
79
128
  </div>
80
129
  <div>
81
- <label class="block text-sm font-medium text-neutral-300">Order</label>
82
- <input v-model.number="form.order" type="number" min="0" class="mt-1 w-24 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" />
130
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Order</label>
131
+ <input
132
+ v-model.number="form.order"
133
+ type="number"
134
+ min="0"
135
+ class="mt-1 w-24 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)]"
136
+ />
83
137
  </div>
84
138
  <label class="flex items-center gap-2">
85
- <input v-model="form.is_active" type="checkbox" class="rounded border-white/20 bg-neutral-900 text-white focus:ring-white/10" />
86
- <span class="text-sm text-neutral-300">Active</span>
139
+ <input
140
+ v-model="form.is_active"
141
+ type="checkbox"
142
+ class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface)] text-[var(--esc-panel-text)] focus:ring-[var(--esc-panel-border-input)]"
143
+ />
144
+ <span class="text-sm text-[var(--esc-panel-text-secondary)]">Active</span>
87
145
  </label>
88
146
  <div class="flex justify-end">
89
- <button type="submit" :disabled="form.processing"
90
- class="rounded-lg bg-gradient-to-r from-cyan-500 to-violet-500 px-5 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">
147
+ <button
148
+ type="submit"
149
+ :disabled="form.processing"
150
+ 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"
151
+ >
91
152
  {{ rule ? 'Update' : 'Create' }}
92
153
  </button>
93
154
  </div>
@@ -1,57 +1,178 @@
1
1
  <script setup>
2
2
  import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
3
  import { Link, router } from '@inertiajs/vue3';
4
+ import { ref, computed } from 'vue';
4
5
 
5
- defineProps({ rules: Array });
6
+ const props = defineProps({ rules: Array });
7
+
8
+ const selectedCategory = ref('');
9
+ const collapsedCategories = ref({});
6
10
 
7
11
  function destroy(id) {
8
12
  if (confirm('Delete this escalation rule?')) {
9
13
  router.delete(route('escalated.admin.escalation-rules.destroy', id));
10
14
  }
11
15
  }
16
+
17
+ const categories = computed(() => {
18
+ const cats = new Set();
19
+ (props.rules || []).forEach((r) => cats.add(r.category || 'Uncategorized'));
20
+ return Array.from(cats).sort();
21
+ });
22
+
23
+ const filteredRules = computed(() => {
24
+ if (!selectedCategory.value) return props.rules || [];
25
+ return (props.rules || []).filter((r) => (r.category || 'Uncategorized') === selectedCategory.value);
26
+ });
27
+
28
+ const groupedRules = computed(() => {
29
+ const groups = {};
30
+ filteredRules.value.forEach((rule) => {
31
+ const cat = rule.category || 'Uncategorized';
32
+ if (!groups[cat]) groups[cat] = [];
33
+ groups[cat].push(rule);
34
+ });
35
+ return groups;
36
+ });
37
+
38
+ function toggleCategory(cat) {
39
+ collapsedCategories.value[cat] = !collapsedCategories.value[cat];
40
+ }
12
41
  </script>
13
42
 
14
43
  <template>
15
44
  <EscalatedLayout title="Escalation Rules">
16
- <div class="mb-4 flex justify-end">
17
- <Link :href="route('escalated.admin.escalation-rules.create')"
18
- 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">
45
+ <div class="mb-4 flex items-center justify-between">
46
+ <div class="flex items-center gap-3">
47
+ <select
48
+ v-model="selectedCategory"
49
+ class="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)]"
50
+ >
51
+ <option value="">All Categories</option>
52
+ <option v-for="cat in categories" :key="cat" :value="cat">{{ cat }}</option>
53
+ </select>
54
+ </div>
55
+ <Link
56
+ :href="route('escalated.admin.escalation-rules.create')"
57
+ 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)]"
58
+ >
19
59
  Add Rule
20
60
  </Link>
21
61
  </div>
22
- <div class="overflow-hidden rounded-xl border border-white/[0.06] bg-neutral-900/60">
23
- <table class="min-w-full divide-y divide-white/[0.06]">
24
- <thead>
25
- <tr class="bg-white/[0.02]">
26
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Order</th>
27
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Name</th>
28
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Trigger</th>
29
- <th class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Active</th>
30
- <th class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-neutral-500">Actions</th>
31
- </tr>
32
- </thead>
33
- <tbody class="divide-y divide-white/[0.04]">
34
- <tr v-if="!rules?.length">
35
- <td colspan="5" class="px-4 py-12 text-center">
36
- <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="M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12" /></svg>
37
- <p class="text-sm text-neutral-500">No escalation rules yet</p>
38
- <p class="mt-1 text-xs text-neutral-600">Set up automatic escalation for overdue tickets</p>
39
- </td>
40
- </tr>
41
- <tr v-for="rule in rules" :key="rule.id" class="transition-colors hover:bg-white/[0.03]">
42
- <td class="px-4 py-3 text-sm text-neutral-400">{{ rule.order }}</td>
43
- <td class="px-4 py-3 text-sm font-medium text-neutral-200">{{ rule.name }}</td>
44
- <td class="px-4 py-3 text-sm text-neutral-400">{{ rule.trigger_type }}</td>
45
- <td class="px-4 py-3 text-sm">
46
- <span :class="rule.is_active ? 'text-emerald-400' : 'text-neutral-500'">{{ rule.is_active ? 'Yes' : 'No' }}</span>
47
- </td>
48
- <td class="px-4 py-3 text-right text-sm">
49
- <Link :href="route('escalated.admin.escalation-rules.edit', rule.id)" class="text-neutral-300 hover:text-white">Edit</Link>
50
- <button @click="destroy(rule.id)" class="ml-3 text-rose-400 hover:text-rose-300">Delete</button>
51
- </td>
52
- </tr>
53
- </tbody>
54
- </table>
62
+
63
+ <div
64
+ v-if="!rules?.length"
65
+ class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] px-4 py-12 text-center"
66
+ >
67
+ <svg
68
+ class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
69
+ fill="none"
70
+ stroke="currentColor"
71
+ stroke-width="1.5"
72
+ viewBox="0 0 24 24"
73
+ >
74
+ <path
75
+ stroke-linecap="round"
76
+ stroke-linejoin="round"
77
+ d="M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"
78
+ />
79
+ </svg>
80
+ <p class="text-sm text-[var(--esc-panel-text-muted)]">No escalation rules yet</p>
81
+ <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
82
+ Set up automatic escalation for overdue tickets
83
+ </p>
84
+ </div>
85
+
86
+ <!-- Grouped by category -->
87
+ <div v-for="(catRules, category) in groupedRules" :key="category" class="mb-4">
88
+ <button
89
+ class="mb-2 flex w-full items-center gap-2 text-sm font-semibold text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
90
+ @click="toggleCategory(category)"
91
+ >
92
+ <svg
93
+ :class="[
94
+ 'h-4 w-4 text-[var(--esc-panel-text-muted)] transition-transform',
95
+ !collapsedCategories[category] && 'rotate-90',
96
+ ]"
97
+ fill="none"
98
+ stroke="currentColor"
99
+ stroke-width="1.5"
100
+ viewBox="0 0 24 24"
101
+ >
102
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
103
+ </svg>
104
+ {{ category }}
105
+ <span class="text-xs text-[var(--esc-panel-text-muted)]">({{ catRules.length }})</span>
106
+ </button>
107
+
108
+ <div
109
+ v-if="!collapsedCategories[category]"
110
+ class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)]"
111
+ >
112
+ <table class="min-w-full divide-y divide-[var(--esc-panel-border)]">
113
+ <thead>
114
+ <tr class="bg-[var(--esc-panel-hover)]">
115
+ <th
116
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
117
+ >
118
+ Order
119
+ </th>
120
+ <th
121
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
122
+ >
123
+ Name
124
+ </th>
125
+ <th
126
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
127
+ >
128
+ Trigger
129
+ </th>
130
+ <th
131
+ class="px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
132
+ >
133
+ Active
134
+ </th>
135
+ <th
136
+ class="px-4 py-3 text-right text-[11px] font-semibold uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
137
+ >
138
+ Actions
139
+ </th>
140
+ </tr>
141
+ </thead>
142
+ <tbody class="divide-y divide-[var(--esc-panel-border)]">
143
+ <tr
144
+ v-for="rule in catRules"
145
+ :key="rule.id"
146
+ class="transition-colors hover:bg-[var(--esc-panel-hover)]"
147
+ >
148
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">{{ rule.order }}</td>
149
+ <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
150
+ {{ rule.name }}
151
+ </td>
152
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
153
+ {{ rule.trigger_type }}
154
+ </td>
155
+ <td class="px-4 py-3 text-sm">
156
+ <span
157
+ :class="rule.is_active ? 'text-emerald-400' : 'text-[var(--esc-panel-text-muted)]'"
158
+ >{{ rule.is_active ? 'Yes' : 'No' }}</span
159
+ >
160
+ </td>
161
+ <td class="px-4 py-3 text-right text-sm">
162
+ <Link
163
+ :href="route('escalated.admin.escalation-rules.edit', rule.id)"
164
+ class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
165
+ >
166
+ Edit
167
+ </Link>
168
+ <button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(rule.id)">
169
+ Delete
170
+ </button>
171
+ </td>
172
+ </tr>
173
+ </tbody>
174
+ </table>
175
+ </div>
55
176
  </div>
56
177
  </EscalatedLayout>
57
178
  </template>
@@ -0,0 +1,95 @@
1
+ <script setup>
2
+ import { router } from '@inertiajs/vue3';
3
+ import { ref } from 'vue';
4
+
5
+ const props = defineProps({
6
+ platform: String,
7
+ display_name: String,
8
+ credential_fields: { type: Array, default: () => [] },
9
+ });
10
+
11
+ const credentials = ref({});
12
+ const testing = ref(false);
13
+ const testResult = ref(null);
14
+
15
+ props.credential_fields.forEach((f) => {
16
+ credentials.value[f.name] = '';
17
+ });
18
+
19
+ async function testConnection() {
20
+ testing.value = true;
21
+ testResult.value = null;
22
+
23
+ try {
24
+ const response = await fetch(route('escalated.admin.import.test-connection', props.platform), {
25
+ method: 'POST',
26
+ headers: {
27
+ 'Content-Type': 'application/json',
28
+ 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]')?.content,
29
+ },
30
+ body: JSON.stringify({ credentials: credentials.value }),
31
+ });
32
+
33
+ const data = await response.json();
34
+ testResult.value = data.success ? 'success' : data.error || 'Connection failed';
35
+ } catch (e) {
36
+ testResult.value = 'Connection failed: ' + e.message;
37
+ } finally {
38
+ testing.value = false;
39
+ }
40
+ }
41
+
42
+ function proceed() {
43
+ // Credentials already stored server-side after successful test connection
44
+ router.get(route('escalated.admin.import.mapping', props.platform));
45
+ }
46
+ </script>
47
+
48
+ <template>
49
+ <div class="mx-auto max-w-lg space-y-6">
50
+ <div>
51
+ <h2 class="text-lg font-semibold text-[var(--esc-panel-text)]">Connect to {{ display_name }}</h2>
52
+ <p class="mt-1 text-sm text-[var(--esc-panel-text-secondary)]">
53
+ Enter your {{ display_name }} credentials to connect.
54
+ </p>
55
+ </div>
56
+
57
+ <div class="space-y-4 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6">
58
+ <div v-for="field in credential_fields" :key="field.name">
59
+ <label class="mb-1 block text-sm font-medium text-[var(--esc-panel-text)]">{{ field.label }}</label>
60
+ <input
61
+ v-model="credentials[field.name]"
62
+ :type="field.type || 'text'"
63
+ :placeholder="field.help || ''"
64
+ class="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)]"
65
+ />
66
+ <p v-if="field.help" class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">{{ field.help }}</p>
67
+ </div>
68
+ </div>
69
+
70
+ <!-- Test connection -->
71
+ <div class="flex items-center gap-4">
72
+ <button
73
+ :disabled="testing"
74
+ class="rounded-lg border border-[var(--esc-panel-border)] px-4 py-2 text-sm font-medium text-[var(--esc-panel-text)] hover:bg-[var(--esc-panel-hover)]"
75
+ @click="testConnection"
76
+ >
77
+ {{ testing ? 'Testing...' : 'Test Connection' }}
78
+ </button>
79
+
80
+ <span v-if="testResult === 'success'" class="text-sm text-green-400">Connected successfully</span>
81
+ <span v-else-if="testResult" class="text-sm text-red-400">{{ testResult }}</span>
82
+ </div>
83
+
84
+ <!-- Proceed -->
85
+ <div class="flex justify-end">
86
+ <button
87
+ :disabled="testResult !== 'success'"
88
+ class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-6 py-2 text-sm font-medium text-white disabled:opacity-50"
89
+ @click="proceed"
90
+ >
91
+ Next: Configure Mappings
92
+ </button>
93
+ </div>
94
+ </div>
95
+ </template>