@escalated-dev/escalated 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +31 -0
  3. package/package.json +12 -6
  4. package/src/components/ActiveChatsPanel.vue +246 -0
  5. package/src/components/ActivityTimeline.stories.js +55 -55
  6. package/src/components/ActivityTimeline.vue +83 -83
  7. package/src/components/AdminDashboard.stories.js +1423 -1095
  8. package/src/components/AgentLoadIndicator.stories.js +37 -37
  9. package/src/components/AgentLoadIndicator.vue +49 -49
  10. package/src/components/AgentPerformanceCard.vue +44 -44
  11. package/src/components/ArticleEditor.vue +82 -82
  12. package/src/components/AssigneeSelect.vue +37 -37
  13. package/src/components/AttachmentList.vue +13 -1
  14. package/src/components/AuditLogEntry.vue +95 -95
  15. package/src/components/BulkActionBar.vue +166 -166
  16. package/src/components/CategoryTree.vue +89 -89
  17. package/src/components/ChartWidget.vue +46 -46
  18. package/src/components/ChatActionBar.vue +226 -0
  19. package/src/components/ChatBubble.vue +162 -0
  20. package/src/components/ChatComposer.vue +308 -0
  21. package/src/components/ChatQueue.vue +222 -0
  22. package/src/components/ChatThread.vue +197 -0
  23. package/src/components/CollisionWarning.stories.js +30 -30
  24. package/src/components/CollisionWarning.vue +68 -68
  25. package/src/components/ConditionalFieldRules.vue +135 -135
  26. package/src/components/ContextPanel.vue +66 -66
  27. package/src/components/ContextPanelSection.vue +65 -65
  28. package/src/components/CustomFieldRenderer.vue +159 -159
  29. package/src/components/EscalatedLayout.vue +29 -6
  30. package/src/components/FileDropzone.vue +57 -57
  31. package/src/components/FollowButton.stories.js +30 -30
  32. package/src/components/FollowButton.vue +88 -88
  33. package/src/components/KeyboardShortcutHelp.vue +213 -213
  34. package/src/components/KnowledgePanel.vue +122 -122
  35. package/src/components/KpiCard.stories.js +32 -32
  36. package/src/components/KpiCard.vue +88 -88
  37. package/src/components/MacroDropdown.vue +150 -150
  38. package/src/components/MentionDropdown.vue +154 -0
  39. package/src/components/MetricComparison.vue +89 -0
  40. package/src/components/PercentileChart.vue +67 -0
  41. package/src/components/PeriodSelector.vue +98 -0
  42. package/src/components/PermissionMatrix.vue +107 -107
  43. package/src/components/PinnedNotes.vue +129 -129
  44. package/src/components/PluginSlot.vue +68 -62
  45. package/src/components/PresenceIndicator.vue +46 -2
  46. package/src/components/PriorityBadge.stories.js +33 -33
  47. package/src/components/PriorityBadge.vue +46 -46
  48. package/src/components/ReplyComposer.vue +81 -18
  49. package/src/components/ReplyThread.vue +40 -2
  50. package/src/components/ReportChart.vue +395 -0
  51. package/src/components/ReportExportButton.vue +108 -0
  52. package/src/components/SatisfactionRating.vue +180 -180
  53. package/src/components/SaveViewDialog.vue +172 -0
  54. package/src/components/SavedViewSidebar.vue +208 -0
  55. package/src/components/ScheduleEditor.vue +104 -104
  56. package/src/components/SideConversation.vue +165 -165
  57. package/src/components/SideConversationList.vue +147 -147
  58. package/src/components/SkillTagManager.vue +79 -79
  59. package/src/components/SlaComplianceChart.vue +46 -53
  60. package/src/components/SlaTimer.stories.js +35 -35
  61. package/src/components/SlaTimer.vue +62 -62
  62. package/src/components/SnoozeButton.vue +247 -0
  63. package/src/components/StatsCard.stories.js +24 -24
  64. package/src/components/StatsCard.vue +58 -58
  65. package/src/components/StatusBadge.stories.js +53 -53
  66. package/src/components/StatusBadge.vue +78 -78
  67. package/src/components/TagSelect.vue +84 -84
  68. package/src/components/TicketFilters.vue +270 -225
  69. package/src/components/TicketLinkPanel.vue +193 -193
  70. package/src/components/TicketList.vue +655 -594
  71. package/src/components/TicketMergeDialog.vue +157 -157
  72. package/src/components/TicketSplitDialog.vue +98 -0
  73. package/src/components/TotpInput.stories.js +9 -9
  74. package/src/components/TotpInput.vue +81 -81
  75. package/src/components/TwoFactorSetup.vue +113 -113
  76. package/src/components/VariableTokenInput.vue +111 -0
  77. package/src/components/WorkflowActionConfig.vue +287 -0
  78. package/src/components/WorkflowActionList.vue +350 -0
  79. package/src/components/WorkflowConditionBuilder.vue +265 -0
  80. package/src/components/WorkflowTriggerSelector.vue +125 -0
  81. package/src/composables/useChat.js +187 -0
  82. package/src/composables/useI18n.js +80 -80
  83. package/src/composables/useKeyboardShortcuts.js +46 -46
  84. package/src/composables/useMentions.js +134 -0
  85. package/src/composables/usePluginExtensions.js +159 -159
  86. package/src/composables/usePluginHooks.js +65 -65
  87. package/src/composables/useRealtime.js +182 -0
  88. package/src/defineEscalatedPlugin.js +76 -76
  89. package/src/index.js +84 -72
  90. package/src/locales/ar.json +727 -0
  91. package/src/locales/de.json +678 -430
  92. package/src/locales/en.json +717 -455
  93. package/src/locales/es.json +679 -430
  94. package/src/locales/fr.json +680 -431
  95. package/src/locales/index.js +12 -2
  96. package/src/locales/it.json +727 -0
  97. package/src/locales/ja.json +727 -0
  98. package/src/locales/ko.json +727 -0
  99. package/src/locales/nl.json +727 -0
  100. package/src/locales/pl.json +727 -0
  101. package/src/locales/pt-BR.json +727 -0
  102. package/src/locales/ru.json +727 -0
  103. package/src/locales/tr.json +727 -0
  104. package/src/locales/zh-CN.json +727 -0
  105. package/src/pages/Admin/ApiTokens/Index.vue +381 -381
  106. package/src/pages/Admin/AuditLog/Index.vue +154 -154
  107. package/src/pages/Admin/BusinessHours/Form.vue +172 -172
  108. package/src/pages/Admin/BusinessHours/Index.vue +113 -113
  109. package/src/pages/Admin/CannedResponses/Index.vue +127 -127
  110. package/src/pages/Admin/Capacity/Index.vue +134 -134
  111. package/src/pages/Admin/CustomFields/Form.vue +195 -195
  112. package/src/pages/Admin/CustomFields/Index.vue +134 -134
  113. package/src/pages/Admin/CustomObjects/Form.vue +202 -202
  114. package/src/pages/Admin/CustomObjects/Index.vue +127 -127
  115. package/src/pages/Admin/CustomObjects/Records.vue +228 -228
  116. package/src/pages/Admin/Departments/Form.vue +75 -75
  117. package/src/pages/Admin/Departments/Index.vue +110 -109
  118. package/src/pages/Admin/EscalationRules/Form.vue +157 -157
  119. package/src/pages/Admin/EscalationRules/Index.vue +178 -178
  120. package/src/pages/Admin/Import/Connect.vue +0 -1
  121. package/src/pages/Admin/Import/Index.vue +1 -1
  122. package/src/pages/Admin/Import/Progress.vue +1 -1
  123. package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -142
  124. package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -195
  125. package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -193
  126. package/src/pages/Admin/Macros/Index.vue +448 -448
  127. package/src/pages/Admin/Plugins/Index.vue +327 -327
  128. package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
  129. package/src/pages/Admin/Reports/AgentMetrics.vue +115 -115
  130. package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
  131. package/src/pages/Admin/Reports/Cohorts.vue +180 -0
  132. package/src/pages/Admin/Reports/Comparison.vue +141 -0
  133. package/src/pages/Admin/Reports/CsatReport.vue +127 -127
  134. package/src/pages/Admin/Reports/Dashboard.vue +36 -21
  135. package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
  136. package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
  137. package/src/pages/Admin/Reports/SlaReport.vue +162 -166
  138. package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
  139. package/src/pages/Admin/Reports.vue +206 -206
  140. package/src/pages/Admin/Roles/Form.vue +71 -71
  141. package/src/pages/Admin/Roles/Index.vue +122 -122
  142. package/src/pages/Admin/Settings/CsatSettings.vue +165 -165
  143. package/src/pages/Admin/Settings/DataRetention.vue +182 -182
  144. package/src/pages/Admin/Settings/EmailSettings.vue +243 -243
  145. package/src/pages/Admin/Settings/Sandbox.vue +135 -135
  146. package/src/pages/Admin/Settings/SsoSettings.vue +218 -218
  147. package/src/pages/Admin/Settings/TwoFactor.vue +110 -110
  148. package/src/pages/Admin/Settings.vue +1008 -468
  149. package/src/pages/Admin/Skills/Form.vue +53 -53
  150. package/src/pages/Admin/Skills/Index.vue +94 -94
  151. package/src/pages/Admin/SlaPolicies/Form.vue +118 -118
  152. package/src/pages/Admin/SlaPolicies/Index.vue +121 -120
  153. package/src/pages/Admin/Statuses/Form.vue +114 -114
  154. package/src/pages/Admin/Statuses/Index.vue +153 -153
  155. package/src/pages/Admin/Tags/Index.vue +191 -191
  156. package/src/pages/Admin/Tickets/Index.vue +126 -91
  157. package/src/pages/Admin/Tickets/Show.vue +29 -0
  158. package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -120
  159. package/src/pages/Admin/Webhooks/Form.vue +110 -110
  160. package/src/pages/Admin/Webhooks/Index.vue +136 -136
  161. package/src/pages/Admin/Workflows/Builder.vue +207 -0
  162. package/src/pages/Admin/Workflows/Index.vue +235 -0
  163. package/src/pages/Admin/Workflows/Logs.vue +286 -0
  164. package/src/pages/Agent/TicketIndex.vue +112 -88
  165. package/src/pages/Agent/TicketShow.vue +192 -60
  166. package/src/pages/Customer/Create.vue +1 -1
  167. package/src/pages/Customer/Index.vue +31 -31
  168. package/src/pages/Customer/KnowledgeBase/Article.vue +4 -2
  169. package/src/pages/Customer/KnowledgeBase/Index.vue +151 -151
  170. package/src/pages/Customer/Show.vue +69 -63
  171. package/src/pages/Guest/Create.vue +40 -15
  172. package/src/pages/Guest/Show.vue +124 -93
  173. package/src/plugin.js +25 -0
  174. package/src/utils/mentionHighlight.js +24 -0
  175. package/src/utils/sanitizeHtml.js +78 -64
  176. package/src/widget/EscalatedWidget.vue +804 -0
  177. package/src/widget/index.js +254 -0
  178. package/src/pages/Admin/Automations/Form.vue +0 -184
  179. package/src/pages/Admin/Automations/Index.vue +0 -129
@@ -1,172 +1,172 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import ScheduleEditor from '../../../components/ScheduleEditor.vue';
4
- import { useForm } from '@inertiajs/vue3';
5
- import { ref } from 'vue';
6
-
7
- const props = defineProps({
8
- schedule: { type: Object, default: null },
9
- timezones: { type: Array, default: () => [] },
10
- });
11
-
12
- const defaultSchedule = {
13
- monday: { start: '09:00', end: '17:00' },
14
- tuesday: { start: '09:00', end: '17:00' },
15
- wednesday: { start: '09:00', end: '17:00' },
16
- thursday: { start: '09:00', end: '17:00' },
17
- friday: { start: '09:00', end: '17:00' },
18
- saturday: { start: '', end: '' },
19
- sunday: { start: '', end: '' },
20
- };
21
-
22
- const form = useForm({
23
- name: props.schedule?.name || '',
24
- timezone: props.schedule?.timezone || 'UTC',
25
- is_default: props.schedule?.is_default ?? false,
26
- schedule: props.schedule?.schedule || { ...defaultSchedule },
27
- holidays:
28
- props.schedule?.holidays?.map((h) => ({
29
- name: h.name,
30
- date: h.date?.split('T')[0] || h.date,
31
- recurring: h.recurring,
32
- })) || [],
33
- });
34
-
35
- const newHoliday = ref({ name: '', date: '', recurring: false });
36
-
37
- function addHoliday() {
38
- if (newHoliday.value.name && newHoliday.value.date) {
39
- form.holidays.push({ ...newHoliday.value });
40
- newHoliday.value = { name: '', date: '', recurring: false };
41
- }
42
- }
43
-
44
- function removeHoliday(index) {
45
- form.holidays.splice(index, 1);
46
- }
47
-
48
- function submit() {
49
- if (props.schedule) {
50
- form.put(route('escalated.admin.business-hours.update', props.schedule.id));
51
- } else {
52
- form.post(route('escalated.admin.business-hours.store'));
53
- }
54
- }
55
- </script>
56
-
57
- <template>
58
- <EscalatedLayout :title="schedule ? 'Edit Schedule' : 'New Schedule'">
59
- <form
60
- class="mx-auto max-w-2xl space-y-5 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6"
61
- @submit.prevent="submit"
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 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)]"
70
- />
71
- <div v-if="form.errors.name" class="mt-1 text-sm text-rose-400">{{ form.errors.name }}</div>
72
- </div>
73
-
74
- <div>
75
- <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Timezone</label>
76
- <select
77
- v-model="form.timezone"
78
- required
79
- 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)]"
80
- >
81
- <option v-for="tz in timezones" :key="tz" :value="tz">{{ tz }}</option>
82
- </select>
83
- <div v-if="form.errors.timezone" class="mt-1 text-sm text-rose-400">{{ form.errors.timezone }}</div>
84
- </div>
85
-
86
- <label class="flex items-center gap-2">
87
- <input
88
- v-model="form.is_default"
89
- type="checkbox"
90
- class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface)] text-cyan-500 focus:ring-[var(--esc-panel-border-input)]"
91
- />
92
- <span class="text-sm text-[var(--esc-panel-text-secondary)]">Default schedule</span>
93
- </label>
94
-
95
- <div>
96
- <label class="mb-2 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
97
- >Weekly Hours</label
98
- >
99
- <ScheduleEditor v-model="form.schedule" />
100
- <div v-if="form.errors.schedule" class="mt-1 text-sm text-rose-400">{{ form.errors.schedule }}</div>
101
- </div>
102
-
103
- <div>
104
- <label class="mb-2 block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Holidays</label>
105
- <div class="space-y-2">
106
- <div
107
- v-for="(holiday, idx) in form.holidays"
108
- :key="idx"
109
- class="flex items-center gap-2 rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface-alt)] px-3 py-2"
110
- >
111
- <span class="flex-1 text-sm text-[var(--esc-panel-text-secondary)]">{{ holiday.name }}</span>
112
- <span class="text-sm text-[var(--esc-panel-text-tertiary)]">{{ holiday.date }}</span>
113
- <span
114
- v-if="holiday.recurring"
115
- class="inline-flex items-center rounded-full bg-violet-500/10 px-2 py-0.5 text-xs font-medium text-violet-400 ring-1 ring-violet-500/20"
116
- >Recurring</span
117
- >
118
- <button
119
- type="button"
120
- class="text-sm text-rose-400 hover:text-rose-300"
121
- @click="removeHoliday(idx)"
122
- >
123
- Remove
124
- </button>
125
- </div>
126
- <div class="flex items-end gap-2">
127
- <div class="flex-1">
128
- <input
129
- v-model="newHoliday.name"
130
- type="text"
131
- placeholder="Holiday name"
132
- class="w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] placeholder-[var(--esc-panel-text-muted)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
133
- />
134
- </div>
135
- <div>
136
- <input
137
- v-model="newHoliday.date"
138
- type="date"
139
- class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 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)]"
140
- />
141
- </div>
142
- <label class="flex items-center gap-1">
143
- <input
144
- v-model="newHoliday.recurring"
145
- type="checkbox"
146
- class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface)] text-cyan-500 focus:ring-[var(--esc-panel-border-input)]"
147
- />
148
- <span class="text-xs text-[var(--esc-panel-text-tertiary)]">Recurring</span>
149
- </label>
150
- <button
151
- type="button"
152
- class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] px-3 py-1.5 text-sm font-medium text-[var(--esc-panel-text-secondary)] transition-colors hover:bg-[var(--esc-panel-hover)]"
153
- @click="addHoliday"
154
- >
155
- Add
156
- </button>
157
- </div>
158
- </div>
159
- </div>
160
-
161
- <div class="flex justify-end">
162
- <button
163
- type="submit"
164
- :disabled="form.processing"
165
- 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"
166
- >
167
- {{ schedule ? 'Update' : 'Create' }}
168
- </button>
169
- </div>
170
- </form>
171
- </EscalatedLayout>
172
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import ScheduleEditor from '../../../components/ScheduleEditor.vue';
4
+ import { useForm } from '@inertiajs/vue3';
5
+ import { ref } from 'vue';
6
+
7
+ const props = defineProps({
8
+ schedule: { type: Object, default: null },
9
+ timezones: { type: Array, default: () => [] },
10
+ });
11
+
12
+ const defaultSchedule = {
13
+ monday: { start: '09:00', end: '17:00' },
14
+ tuesday: { start: '09:00', end: '17:00' },
15
+ wednesday: { start: '09:00', end: '17:00' },
16
+ thursday: { start: '09:00', end: '17:00' },
17
+ friday: { start: '09:00', end: '17:00' },
18
+ saturday: { start: '', end: '' },
19
+ sunday: { start: '', end: '' },
20
+ };
21
+
22
+ const form = useForm({
23
+ name: props.schedule?.name || '',
24
+ timezone: props.schedule?.timezone || 'UTC',
25
+ is_default: props.schedule?.is_default ?? false,
26
+ schedule: props.schedule?.schedule || { ...defaultSchedule },
27
+ holidays:
28
+ props.schedule?.holidays?.map((h) => ({
29
+ name: h.name,
30
+ date: h.date?.split('T')[0] || h.date,
31
+ recurring: h.recurring,
32
+ })) || [],
33
+ });
34
+
35
+ const newHoliday = ref({ name: '', date: '', recurring: false });
36
+
37
+ function addHoliday() {
38
+ if (newHoliday.value.name && newHoliday.value.date) {
39
+ form.holidays.push({ ...newHoliday.value });
40
+ newHoliday.value = { name: '', date: '', recurring: false };
41
+ }
42
+ }
43
+
44
+ function removeHoliday(index) {
45
+ form.holidays.splice(index, 1);
46
+ }
47
+
48
+ function submit() {
49
+ if (props.schedule) {
50
+ form.put(route('escalated.admin.business-hours.update', props.schedule.id));
51
+ } else {
52
+ form.post(route('escalated.admin.business-hours.store'));
53
+ }
54
+ }
55
+ </script>
56
+
57
+ <template>
58
+ <EscalatedLayout :title="schedule ? 'Edit Schedule' : 'New Schedule'">
59
+ <form
60
+ class="mx-auto max-w-2xl space-y-5 rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6"
61
+ @submit.prevent="submit"
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 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)]"
70
+ />
71
+ <div v-if="form.errors.name" class="mt-1 text-sm text-rose-400">{{ form.errors.name }}</div>
72
+ </div>
73
+
74
+ <div>
75
+ <label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Timezone</label>
76
+ <select
77
+ v-model="form.timezone"
78
+ required
79
+ 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)]"
80
+ >
81
+ <option v-for="tz in timezones" :key="tz" :value="tz">{{ tz }}</option>
82
+ </select>
83
+ <div v-if="form.errors.timezone" class="mt-1 text-sm text-rose-400">{{ form.errors.timezone }}</div>
84
+ </div>
85
+
86
+ <label class="flex items-center gap-2">
87
+ <input
88
+ v-model="form.is_default"
89
+ type="checkbox"
90
+ class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface)] text-cyan-500 focus:ring-[var(--esc-panel-border-input)]"
91
+ />
92
+ <span class="text-sm text-[var(--esc-panel-text-secondary)]">Default schedule</span>
93
+ </label>
94
+
95
+ <div>
96
+ <label class="mb-2 block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
97
+ >Weekly Hours</label
98
+ >
99
+ <ScheduleEditor v-model="form.schedule" />
100
+ <div v-if="form.errors.schedule" class="mt-1 text-sm text-rose-400">{{ form.errors.schedule }}</div>
101
+ </div>
102
+
103
+ <div>
104
+ <label class="mb-2 block text-sm font-medium text-[var(--esc-panel-text-secondary)]">Holidays</label>
105
+ <div class="space-y-2">
106
+ <div
107
+ v-for="(holiday, idx) in form.holidays"
108
+ :key="idx"
109
+ class="flex items-center gap-2 rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface-alt)] px-3 py-2"
110
+ >
111
+ <span class="flex-1 text-sm text-[var(--esc-panel-text-secondary)]">{{ holiday.name }}</span>
112
+ <span class="text-sm text-[var(--esc-panel-text-tertiary)]">{{ holiday.date }}</span>
113
+ <span
114
+ v-if="holiday.recurring"
115
+ class="inline-flex items-center rounded-full bg-violet-500/10 px-2 py-0.5 text-xs font-medium text-violet-400 ring-1 ring-violet-500/20"
116
+ >Recurring</span
117
+ >
118
+ <button
119
+ type="button"
120
+ class="text-sm text-rose-400 hover:text-rose-300"
121
+ @click="removeHoliday(idx)"
122
+ >
123
+ Remove
124
+ </button>
125
+ </div>
126
+ <div class="flex items-end gap-2">
127
+ <div class="flex-1">
128
+ <input
129
+ v-model="newHoliday.name"
130
+ type="text"
131
+ placeholder="Holiday name"
132
+ class="w-full rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 py-1.5 text-sm text-[var(--esc-panel-text-secondary)] placeholder-[var(--esc-panel-text-muted)] focus:border-[var(--esc-panel-border-input)] focus:outline-none focus:ring-1 focus:ring-[var(--esc-panel-border-input)]"
133
+ />
134
+ </div>
135
+ <div>
136
+ <input
137
+ v-model="newHoliday.date"
138
+ type="date"
139
+ class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] px-3 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)]"
140
+ />
141
+ </div>
142
+ <label class="flex items-center gap-1">
143
+ <input
144
+ v-model="newHoliday.recurring"
145
+ type="checkbox"
146
+ class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface)] text-cyan-500 focus:ring-[var(--esc-panel-border-input)]"
147
+ />
148
+ <span class="text-xs text-[var(--esc-panel-text-tertiary)]">Recurring</span>
149
+ </label>
150
+ <button
151
+ type="button"
152
+ class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] px-3 py-1.5 text-sm font-medium text-[var(--esc-panel-text-secondary)] transition-colors hover:bg-[var(--esc-panel-hover)]"
153
+ @click="addHoliday"
154
+ >
155
+ Add
156
+ </button>
157
+ </div>
158
+ </div>
159
+ </div>
160
+
161
+ <div class="flex justify-end">
162
+ <button
163
+ type="submit"
164
+ :disabled="form.processing"
165
+ 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"
166
+ >
167
+ {{ schedule ? 'Update' : 'Create' }}
168
+ </button>
169
+ </div>
170
+ </form>
171
+ </EscalatedLayout>
172
+ </template>
@@ -1,113 +1,113 @@
1
- <script setup>
2
- import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
- import { Link, router } from '@inertiajs/vue3';
4
-
5
- defineProps({ schedules: Array });
6
-
7
- function destroy(id) {
8
- if (confirm('Delete this schedule?')) {
9
- router.delete(route('escalated.admin.business-hours.destroy', id));
10
- }
11
- }
12
- </script>
13
-
14
- <template>
15
- <EscalatedLayout title="Business Hours">
16
- <div class="mb-4 flex justify-end">
17
- <Link
18
- :href="route('escalated.admin.business-hours.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
- >
21
- Add Schedule
22
- </Link>
23
- </div>
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)]">
26
- <thead>
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
- Timezone
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
- Default
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
- Holidays
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>
53
- </tr>
54
- </thead>
55
- <tbody class="divide-y divide-[var(--esc-panel-border)]">
56
- <tr v-if="!schedules?.length">
57
- <td colspan="5" class="px-4 py-12 text-center">
58
- <svg
59
- class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
60
- fill="none"
61
- stroke="currentColor"
62
- stroke-width="1.5"
63
- viewBox="0 0 24 24"
64
- >
65
- <path
66
- stroke-linecap="round"
67
- stroke-linejoin="round"
68
- d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"
69
- />
70
- </svg>
71
- <p class="text-sm text-[var(--esc-panel-text-muted)]">No business schedules yet</p>
72
- <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
73
- Create a schedule to define your team's working hours
74
- </p>
75
- </td>
76
- </tr>
77
- <tr
78
- v-for="sched in schedules"
79
- :key="sched.id"
80
- class="transition-colors hover:bg-[var(--esc-panel-hover)]"
81
- >
82
- <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
83
- {{ sched.name }}
84
- </td>
85
- <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">{{ sched.timezone }}</td>
86
- <td class="px-4 py-3 text-sm">
87
- <span
88
- v-if="sched.is_default"
89
- 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"
90
- >Default</span
91
- >
92
- <span v-else class="text-[var(--esc-panel-text-muted)]">-</span>
93
- </td>
94
- <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
95
- {{ sched.holidays?.length || 0 }}
96
- </td>
97
- <td class="px-4 py-3 text-right text-sm">
98
- <Link
99
- :href="route('escalated.admin.business-hours.edit', sched.id)"
100
- class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
101
- >
102
- Edit
103
- </Link>
104
- <button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(sched.id)">
105
- Delete
106
- </button>
107
- </td>
108
- </tr>
109
- </tbody>
110
- </table>
111
- </div>
112
- </EscalatedLayout>
113
- </template>
1
+ <script setup>
2
+ import EscalatedLayout from '../../../components/EscalatedLayout.vue';
3
+ import { Link, router } from '@inertiajs/vue3';
4
+
5
+ defineProps({ schedules: Array });
6
+
7
+ function destroy(id) {
8
+ if (confirm('Delete this schedule?')) {
9
+ router.delete(route('escalated.admin.business-hours.destroy', id));
10
+ }
11
+ }
12
+ </script>
13
+
14
+ <template>
15
+ <EscalatedLayout title="Business Hours">
16
+ <div class="mb-4 flex justify-end">
17
+ <Link
18
+ :href="route('escalated.admin.business-hours.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
+ >
21
+ Add Schedule
22
+ </Link>
23
+ </div>
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)]">
26
+ <thead>
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
+ Timezone
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
+ Default
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
+ Holidays
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>
53
+ </tr>
54
+ </thead>
55
+ <tbody class="divide-y divide-[var(--esc-panel-border)]">
56
+ <tr v-if="!schedules?.length">
57
+ <td colspan="5" class="px-4 py-12 text-center">
58
+ <svg
59
+ class="mx-auto mb-3 h-8 w-8 text-[var(--esc-panel-text-muted)]"
60
+ fill="none"
61
+ stroke="currentColor"
62
+ stroke-width="1.5"
63
+ viewBox="0 0 24 24"
64
+ >
65
+ <path
66
+ stroke-linecap="round"
67
+ stroke-linejoin="round"
68
+ d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"
69
+ />
70
+ </svg>
71
+ <p class="text-sm text-[var(--esc-panel-text-muted)]">No business schedules yet</p>
72
+ <p class="mt-1 text-xs text-[var(--esc-panel-text-muted)]">
73
+ Create a schedule to define your team's working hours
74
+ </p>
75
+ </td>
76
+ </tr>
77
+ <tr
78
+ v-for="sched in schedules"
79
+ :key="sched.id"
80
+ class="transition-colors hover:bg-[var(--esc-panel-hover)]"
81
+ >
82
+ <td class="px-4 py-3 text-sm font-medium text-[var(--esc-panel-text-secondary)]">
83
+ {{ sched.name }}
84
+ </td>
85
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">{{ sched.timezone }}</td>
86
+ <td class="px-4 py-3 text-sm">
87
+ <span
88
+ v-if="sched.is_default"
89
+ 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"
90
+ >Default</span
91
+ >
92
+ <span v-else class="text-[var(--esc-panel-text-muted)]">-</span>
93
+ </td>
94
+ <td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
95
+ {{ sched.holidays?.length || 0 }}
96
+ </td>
97
+ <td class="px-4 py-3 text-right text-sm">
98
+ <Link
99
+ :href="route('escalated.admin.business-hours.edit', sched.id)"
100
+ class="text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
101
+ >
102
+ Edit
103
+ </Link>
104
+ <button class="ml-3 text-rose-400 hover:text-rose-300" @click="destroy(sched.id)">
105
+ Delete
106
+ </button>
107
+ </td>
108
+ </tr>
109
+ </tbody>
110
+ </table>
111
+ </div>
112
+ </EscalatedLayout>
113
+ </template>