@escalated-dev/escalated 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +36 -1
- package/package.json +16 -7
- package/src/components/ActiveChatsPanel.vue +246 -0
- package/src/components/ActivityTimeline.stories.js +55 -55
- package/src/components/ActivityTimeline.vue +83 -83
- package/src/components/AdminDashboard.stories.js +1423 -1095
- package/src/components/AgentLoadIndicator.stories.js +37 -37
- package/src/components/AgentLoadIndicator.vue +49 -49
- package/src/components/AgentPerformanceCard.vue +44 -44
- package/src/components/ArticleEditor.vue +82 -82
- package/src/components/AssigneeSelect.vue +37 -37
- package/src/components/AttachmentList.vue +13 -1
- package/src/components/AuditLogEntry.vue +95 -95
- package/src/components/BulkActionBar.vue +166 -166
- package/src/components/CategoryTree.vue +89 -89
- package/src/components/ChartWidget.vue +46 -46
- package/src/components/ChatActionBar.vue +226 -0
- package/src/components/ChatBubble.vue +162 -0
- package/src/components/ChatComposer.vue +308 -0
- package/src/components/ChatQueue.vue +222 -0
- package/src/components/ChatThread.vue +197 -0
- package/src/components/CollisionWarning.stories.js +30 -30
- package/src/components/CollisionWarning.vue +68 -68
- package/src/components/ConditionalFieldRules.vue +135 -135
- package/src/components/ContextPanel.vue +66 -66
- package/src/components/ContextPanelSection.vue +65 -65
- package/src/components/CustomFieldRenderer.vue +159 -159
- package/src/components/EscalatedLayout.vue +35 -6
- package/src/components/FileDropzone.vue +57 -57
- package/src/components/FollowButton.stories.js +30 -30
- package/src/components/FollowButton.vue +88 -88
- package/src/components/KeyboardShortcutHelp.vue +213 -213
- package/src/components/KnowledgePanel.vue +122 -122
- package/src/components/KpiCard.stories.js +32 -32
- package/src/components/KpiCard.vue +88 -88
- package/src/components/MacroDropdown.vue +150 -150
- package/src/components/MentionDropdown.vue +154 -0
- package/src/components/MetricComparison.vue +89 -0
- package/src/components/PercentileChart.vue +67 -0
- package/src/components/PeriodSelector.vue +98 -0
- package/src/components/PermissionMatrix.vue +107 -107
- package/src/components/PinnedNotes.vue +129 -129
- package/src/components/PluginSlot.vue +68 -62
- package/src/components/PresenceIndicator.vue +46 -2
- package/src/components/PriorityBadge.stories.js +33 -33
- package/src/components/PriorityBadge.vue +46 -46
- package/src/components/ReplyComposer.vue +81 -18
- package/src/components/ReplyThread.vue +40 -2
- package/src/components/ReportChart.vue +395 -0
- package/src/components/ReportExportButton.vue +108 -0
- package/src/components/SatisfactionRating.vue +180 -180
- package/src/components/SaveViewDialog.vue +172 -0
- package/src/components/SavedViewSidebar.vue +208 -0
- package/src/components/ScheduleEditor.vue +104 -104
- package/src/components/SideConversation.vue +165 -165
- package/src/components/SideConversationList.vue +147 -147
- package/src/components/SkillTagManager.vue +83 -79
- package/src/components/SlaComplianceChart.vue +46 -53
- package/src/components/SlaTimer.stories.js +35 -35
- package/src/components/SlaTimer.vue +62 -62
- package/src/components/SnoozeButton.vue +247 -0
- package/src/components/StatsCard.stories.js +24 -24
- package/src/components/StatsCard.vue +58 -58
- package/src/components/StatusBadge.stories.js +53 -53
- package/src/components/StatusBadge.vue +78 -78
- package/src/components/TagSelect.vue +84 -84
- package/src/components/TicketFilters.vue +270 -225
- package/src/components/TicketLinkPanel.vue +193 -193
- package/src/components/TicketList.vue +655 -594
- package/src/components/TicketMergeDialog.vue +157 -157
- package/src/components/TicketSplitDialog.vue +98 -0
- package/src/components/TotpInput.stories.js +9 -9
- package/src/components/TotpInput.vue +81 -81
- package/src/components/TwoFactorSetup.vue +113 -113
- package/src/components/VariableTokenInput.vue +111 -0
- package/src/components/WorkflowActionConfig.vue +287 -0
- package/src/components/WorkflowActionList.vue +350 -0
- package/src/components/WorkflowConditionBuilder.vue +265 -0
- package/src/components/WorkflowTriggerSelector.vue +125 -0
- package/src/composables/useChat.js +187 -0
- package/src/composables/useI18n.js +30 -8
- package/src/composables/useKeyboardShortcuts.js +46 -46
- package/src/composables/useMentions.js +134 -0
- package/src/composables/usePluginExtensions.js +159 -159
- package/src/composables/usePluginHooks.js +65 -65
- package/src/composables/useRealtime.js +182 -0
- package/src/defineEscalatedPlugin.js +76 -76
- package/src/index.js +84 -72
- package/src/locales/README.md +13 -0
- package/src/locales/ar.json +727 -0
- package/src/locales/de.json +678 -430
- package/src/locales/en.json +717 -455
- package/src/locales/es.json +679 -430
- package/src/locales/fr.json +680 -431
- package/src/locales/index.js +12 -2
- package/src/locales/it.json +727 -0
- package/src/locales/ja.json +727 -0
- package/src/locales/ko.json +727 -0
- package/src/locales/nl.json +727 -0
- package/src/locales/pl.json +727 -0
- package/src/locales/pt-BR.json +727 -0
- package/src/locales/ru.json +727 -0
- package/src/locales/tr.json +727 -0
- package/src/locales/zh-CN.json +727 -0
- package/src/pages/Admin/ApiTokens/Index.vue +381 -381
- package/src/pages/Admin/AuditLog/Index.vue +154 -154
- package/src/pages/Admin/BusinessHours/Form.vue +172 -172
- package/src/pages/Admin/BusinessHours/Index.vue +113 -113
- package/src/pages/Admin/CannedResponses/Index.vue +127 -127
- package/src/pages/Admin/Capacity/Index.vue +134 -134
- package/src/pages/Admin/CustomFields/Form.vue +195 -195
- package/src/pages/Admin/CustomFields/Index.vue +134 -134
- package/src/pages/Admin/CustomObjects/Form.vue +202 -202
- package/src/pages/Admin/CustomObjects/Index.vue +127 -127
- package/src/pages/Admin/CustomObjects/Records.vue +228 -228
- package/src/pages/Admin/Departments/Form.vue +75 -75
- package/src/pages/Admin/Departments/Index.vue +110 -109
- package/src/pages/Admin/EscalationRules/Form.vue +157 -157
- package/src/pages/Admin/EscalationRules/Index.vue +178 -178
- package/src/pages/Admin/Import/Connect.vue +0 -1
- package/src/pages/Admin/Import/Index.vue +1 -1
- package/src/pages/Admin/Import/Progress.vue +1 -1
- package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -142
- package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -195
- package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -193
- package/src/pages/Admin/Macros/Index.vue +448 -448
- package/src/pages/Admin/Plugins/Index.vue +327 -327
- package/src/pages/Admin/Reports/AgentDetail.vue +132 -0
- package/src/pages/Admin/Reports/AgentMetrics.vue +115 -115
- package/src/pages/Admin/Reports/AgentRanking.vue +246 -0
- package/src/pages/Admin/Reports/Cohorts.vue +180 -0
- package/src/pages/Admin/Reports/Comparison.vue +141 -0
- package/src/pages/Admin/Reports/CsatReport.vue +127 -127
- package/src/pages/Admin/Reports/Dashboard.vue +36 -21
- package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -0
- package/src/pages/Admin/Reports/ResponseTimes.vue +164 -0
- package/src/pages/Admin/Reports/SlaReport.vue +162 -166
- package/src/pages/Admin/Reports/SlaTrends.vue +183 -0
- package/src/pages/Admin/Reports.vue +206 -206
- package/src/pages/Admin/Roles/Form.vue +71 -71
- package/src/pages/Admin/Roles/Index.vue +122 -122
- package/src/pages/Admin/Settings/CsatSettings.vue +165 -165
- package/src/pages/Admin/Settings/DataRetention.vue +182 -182
- package/src/pages/Admin/Settings/EmailSettings.vue +243 -243
- package/src/pages/Admin/Settings/Sandbox.vue +135 -135
- package/src/pages/Admin/Settings/SsoSettings.vue +218 -218
- package/src/pages/Admin/Settings/TwoFactor.vue +110 -110
- package/src/pages/Admin/Settings.vue +1008 -468
- package/src/pages/Admin/Skills/Form.vue +193 -53
- package/src/pages/Admin/Skills/Index.vue +105 -94
- package/src/pages/Admin/SlaPolicies/Form.vue +118 -118
- package/src/pages/Admin/SlaPolicies/Index.vue +121 -120
- package/src/pages/Admin/Statuses/Form.vue +114 -114
- package/src/pages/Admin/Statuses/Index.vue +153 -153
- package/src/pages/Admin/Tags/Index.vue +191 -191
- package/src/pages/Admin/Tickets/Index.vue +126 -91
- package/src/pages/Admin/Tickets/Show.vue +29 -0
- package/src/pages/Admin/Users/Index.vue +145 -0
- package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -120
- package/src/pages/Admin/Webhooks/Form.vue +110 -110
- package/src/pages/Admin/Webhooks/Index.vue +136 -136
- package/src/pages/Admin/Workflows/Builder.vue +207 -0
- package/src/pages/Admin/Workflows/Index.vue +235 -0
- package/src/pages/Admin/Workflows/Logs.vue +286 -0
- package/src/pages/Agent/TicketIndex.vue +112 -88
- package/src/pages/Agent/TicketShow.vue +192 -60
- package/src/pages/Customer/Create.vue +1 -1
- package/src/pages/Customer/Index.vue +26 -1
- package/src/pages/Customer/KnowledgeBase/Article.vue +4 -2
- package/src/pages/Customer/KnowledgeBase/Index.vue +151 -151
- package/src/pages/Customer/Show.vue +69 -63
- package/src/pages/Guest/Create.vue +40 -15
- package/src/pages/Guest/Show.vue +124 -93
- package/src/plugin.js +26 -1
- package/src/utils/mentionHighlight.js +24 -0
- package/src/utils/sanitizeHtml.js +78 -64
- package/src/widget/EscalatedWidget.vue +804 -0
- package/src/widget/index.js +254 -0
- package/src/pages/Admin/Automations/Form.vue +0 -184
- package/src/pages/Admin/Automations/Index.vue +0 -129
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
log: { type: Object, required: true },
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const actionColors = {
|
|
9
|
-
created: 'bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20',
|
|
10
|
-
updated: 'bg-cyan-500/10 text-cyan-400 ring-1 ring-cyan-500/20',
|
|
11
|
-
deleted: 'bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const actionColor = computed(
|
|
15
|
-
() => actionColors[props.log.action] || 'bg-gray-500/10 text-gray-400 ring-1 ring-gray-500/20',
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const userInitial = computed(() => {
|
|
19
|
-
const name = props.log.user?.name || 'System';
|
|
20
|
-
return name.charAt(0).toUpperCase();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const resourceName = computed(() => {
|
|
24
|
-
const type = props.log.auditable_type || '';
|
|
25
|
-
return type.split('\\').pop() || type;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const changedFields = computed(() => {
|
|
29
|
-
if (props.log.action !== 'updated') return [];
|
|
30
|
-
const oldVals = props.log.old_values || {};
|
|
31
|
-
const newVals = props.log.new_values || {};
|
|
32
|
-
const keys = new Set([...Object.keys(oldVals), ...Object.keys(newVals)]);
|
|
33
|
-
return Array.from(keys).map((key) => ({
|
|
34
|
-
field: key,
|
|
35
|
-
old: oldVals[key] ?? '-',
|
|
36
|
-
new: newVals[key] ?? '-',
|
|
37
|
-
}));
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const formattedDate = computed(() => {
|
|
41
|
-
if (!props.log.created_at) return '';
|
|
42
|
-
const d = new Date(props.log.created_at);
|
|
43
|
-
return d.toLocaleString();
|
|
44
|
-
});
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<template>
|
|
48
|
-
<div
|
|
49
|
-
class="flex gap-3 rounded-lg border border-white/[0.04] bg-white/[0.02] px-4 py-3 transition-colors hover:bg-white/[0.03]"
|
|
50
|
-
>
|
|
51
|
-
<!-- Avatar -->
|
|
52
|
-
<div
|
|
53
|
-
class="flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-cyan-500/20 to-violet-500/20 text-xs font-semibold text-neutral-300"
|
|
54
|
-
>
|
|
55
|
-
{{ userInitial }}
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<div class="min-w-0 flex-1">
|
|
59
|
-
<div class="flex items-center gap-2 text-sm">
|
|
60
|
-
<span class="font-medium text-neutral-200">{{ log.user?.name || 'System' }}</span>
|
|
61
|
-
<span :class="['inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium', actionColor]">
|
|
62
|
-
{{ log.action }}
|
|
63
|
-
</span>
|
|
64
|
-
<span class="text-neutral-400">{{ resourceName }}</span>
|
|
65
|
-
<span class="text-neutral-600">#{{ log.auditable_id }}</span>
|
|
66
|
-
<span class="ml-auto text-xs text-neutral-500">{{ formattedDate }}</span>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<!-- Changed fields diff -->
|
|
70
|
-
<div v-if="changedFields.length" class="mt-2 space-y-1">
|
|
71
|
-
<div v-for="change in changedFields" :key="change.field" class="flex items-center gap-2 text-xs">
|
|
72
|
-
<span class="font-medium text-neutral-400">{{ change.field }}:</span>
|
|
73
|
-
<span class="text-rose-400/70 line-through">{{
|
|
74
|
-
typeof change.old === 'object' ? JSON.stringify(change.old) : change.old
|
|
75
|
-
}}</span>
|
|
76
|
-
<svg
|
|
77
|
-
class="h-3 w-3 text-neutral-600"
|
|
78
|
-
fill="none"
|
|
79
|
-
stroke="currentColor"
|
|
80
|
-
stroke-width="2"
|
|
81
|
-
viewBox="0 0 24 24"
|
|
82
|
-
>
|
|
83
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3" />
|
|
84
|
-
</svg>
|
|
85
|
-
<span class="text-emerald-400/70">{{
|
|
86
|
-
typeof change.new === 'object' ? JSON.stringify(change.new) : change.new
|
|
87
|
-
}}</span>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<!-- IP address -->
|
|
92
|
-
<div v-if="log.ip_address" class="mt-1 text-xs text-neutral-600">IP: {{ log.ip_address }}</div>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
log: { type: Object, required: true },
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const actionColors = {
|
|
9
|
+
created: 'bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20',
|
|
10
|
+
updated: 'bg-cyan-500/10 text-cyan-400 ring-1 ring-cyan-500/20',
|
|
11
|
+
deleted: 'bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const actionColor = computed(
|
|
15
|
+
() => actionColors[props.log.action] || 'bg-gray-500/10 text-gray-400 ring-1 ring-gray-500/20',
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const userInitial = computed(() => {
|
|
19
|
+
const name = props.log.user?.name || 'System';
|
|
20
|
+
return name.charAt(0).toUpperCase();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const resourceName = computed(() => {
|
|
24
|
+
const type = props.log.auditable_type || '';
|
|
25
|
+
return type.split('\\').pop() || type;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const changedFields = computed(() => {
|
|
29
|
+
if (props.log.action !== 'updated') return [];
|
|
30
|
+
const oldVals = props.log.old_values || {};
|
|
31
|
+
const newVals = props.log.new_values || {};
|
|
32
|
+
const keys = new Set([...Object.keys(oldVals), ...Object.keys(newVals)]);
|
|
33
|
+
return Array.from(keys).map((key) => ({
|
|
34
|
+
field: key,
|
|
35
|
+
old: oldVals[key] ?? '-',
|
|
36
|
+
new: newVals[key] ?? '-',
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const formattedDate = computed(() => {
|
|
41
|
+
if (!props.log.created_at) return '';
|
|
42
|
+
const d = new Date(props.log.created_at);
|
|
43
|
+
return d.toLocaleString();
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<div
|
|
49
|
+
class="flex gap-3 rounded-lg border border-white/[0.04] bg-white/[0.02] px-4 py-3 transition-colors hover:bg-white/[0.03]"
|
|
50
|
+
>
|
|
51
|
+
<!-- Avatar -->
|
|
52
|
+
<div
|
|
53
|
+
class="flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-cyan-500/20 to-violet-500/20 text-xs font-semibold text-neutral-300"
|
|
54
|
+
>
|
|
55
|
+
{{ userInitial }}
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="min-w-0 flex-1">
|
|
59
|
+
<div class="flex items-center gap-2 text-sm">
|
|
60
|
+
<span class="font-medium text-neutral-200">{{ log.user?.name || 'System' }}</span>
|
|
61
|
+
<span :class="['inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium', actionColor]">
|
|
62
|
+
{{ log.action }}
|
|
63
|
+
</span>
|
|
64
|
+
<span class="text-neutral-400">{{ resourceName }}</span>
|
|
65
|
+
<span class="text-neutral-600">#{{ log.auditable_id }}</span>
|
|
66
|
+
<span class="ml-auto text-xs text-neutral-500">{{ formattedDate }}</span>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<!-- Changed fields diff -->
|
|
70
|
+
<div v-if="changedFields.length" class="mt-2 space-y-1">
|
|
71
|
+
<div v-for="change in changedFields" :key="change.field" class="flex items-center gap-2 text-xs">
|
|
72
|
+
<span class="font-medium text-neutral-400">{{ change.field }}:</span>
|
|
73
|
+
<span class="text-rose-400/70 line-through">{{
|
|
74
|
+
typeof change.old === 'object' ? JSON.stringify(change.old) : change.old
|
|
75
|
+
}}</span>
|
|
76
|
+
<svg
|
|
77
|
+
class="h-3 w-3 text-neutral-600"
|
|
78
|
+
fill="none"
|
|
79
|
+
stroke="currentColor"
|
|
80
|
+
stroke-width="2"
|
|
81
|
+
viewBox="0 0 24 24"
|
|
82
|
+
>
|
|
83
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3" />
|
|
84
|
+
</svg>
|
|
85
|
+
<span class="text-emerald-400/70">{{
|
|
86
|
+
typeof change.new === 'object' ? JSON.stringify(change.new) : change.new
|
|
87
|
+
}}</span>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<!-- IP address -->
|
|
92
|
+
<div v-if="log.ip_address" class="mt-1 text-xs text-neutral-600">IP: {{ log.ip_address }}</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref, computed, inject } from 'vue';
|
|
3
|
-
import { router } from '@inertiajs/vue3';
|
|
4
|
-
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
selectedIds: { type: Array, required: true },
|
|
7
|
-
bulkRoute: { type: String, required: true },
|
|
8
|
-
agents: { type: Array, default: () => [] },
|
|
9
|
-
departments: { type: Array, default: () => [] },
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const emit = defineEmits(['clear']);
|
|
13
|
-
const escDark = inject(
|
|
14
|
-
'esc-dark',
|
|
15
|
-
computed(() => false),
|
|
16
|
-
);
|
|
17
|
-
const processing = ref(false);
|
|
18
|
-
|
|
19
|
-
function performAction(action, value) {
|
|
20
|
-
if (!props.selectedIds.length || processing.value) return;
|
|
21
|
-
processing.value = true;
|
|
22
|
-
router.post(
|
|
23
|
-
props.bulkRoute,
|
|
24
|
-
{
|
|
25
|
-
ticket_ids: props.selectedIds,
|
|
26
|
-
action,
|
|
27
|
-
value,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
preserveScroll: true,
|
|
31
|
-
onSuccess: () => emit('clear'),
|
|
32
|
-
onFinish: () => {
|
|
33
|
-
processing.value = false;
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const statusOptions = [
|
|
40
|
-
{ value: 'in_progress', label: 'In Progress' },
|
|
41
|
-
{ value: 'waiting_on_customer', label: 'Waiting on Customer' },
|
|
42
|
-
{ value: 'resolved', label: 'Resolved' },
|
|
43
|
-
{ value: 'closed', label: 'Closed' },
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
const priorityOptions = [
|
|
47
|
-
{ value: 'low', label: 'Low' },
|
|
48
|
-
{ value: 'medium', label: 'Medium' },
|
|
49
|
-
{ value: 'high', label: 'High' },
|
|
50
|
-
{ value: 'urgent', label: 'Urgent' },
|
|
51
|
-
{ value: 'critical', label: 'Critical' },
|
|
52
|
-
];
|
|
53
|
-
|
|
54
|
-
const selectClass = computed(() =>
|
|
55
|
-
escDark.value
|
|
56
|
-
? '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)]'
|
|
57
|
-
: 'rounded-md border border-gray-300 bg-white px-2 py-1.5 text-sm focus:border-blue-500 focus:outline-none',
|
|
58
|
-
);
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<template>
|
|
62
|
-
<Transition
|
|
63
|
-
enter-active-class="transition-all duration-200 ease-out"
|
|
64
|
-
enter-from-class="translate-y-full opacity-0"
|
|
65
|
-
enter-to-class="translate-y-0 opacity-100"
|
|
66
|
-
leave-active-class="transition-all duration-150 ease-in"
|
|
67
|
-
leave-from-class="translate-y-0 opacity-100"
|
|
68
|
-
leave-to-class="translate-y-full opacity-0"
|
|
69
|
-
>
|
|
70
|
-
<div
|
|
71
|
-
v-if="selectedIds.length > 0"
|
|
72
|
-
:class="[
|
|
73
|
-
'fixed bottom-0 left-0 right-0 z-50 border-t px-6 py-3',
|
|
74
|
-
escDark
|
|
75
|
-
? 'border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface-alt)]/95 backdrop-blur-xl'
|
|
76
|
-
: 'border-gray-200 bg-white/95 backdrop-blur-xl shadow-lg',
|
|
77
|
-
]"
|
|
78
|
-
>
|
|
79
|
-
<div class="mx-auto flex max-w-7xl items-center gap-4">
|
|
80
|
-
<span
|
|
81
|
-
:class="['text-sm font-semibold', escDark ? 'text-[var(--esc-panel-text)]' : 'text-gray-900']"
|
|
82
|
-
aria-live="polite"
|
|
83
|
-
>
|
|
84
|
-
{{ selectedIds.length }} ticket{{ selectedIds.length !== 1 ? 's' : '' }} selected
|
|
85
|
-
</span>
|
|
86
|
-
|
|
87
|
-
<select
|
|
88
|
-
:class="selectClass"
|
|
89
|
-
:disabled="processing"
|
|
90
|
-
aria-label="Change status"
|
|
91
|
-
@change="
|
|
92
|
-
performAction('status', $event.target.value);
|
|
93
|
-
$event.target.value = '';
|
|
94
|
-
"
|
|
95
|
-
>
|
|
96
|
-
<option value="">Status...</option>
|
|
97
|
-
<option v-for="o in statusOptions" :key="o.value" :value="o.value">{{ o.label }}</option>
|
|
98
|
-
</select>
|
|
99
|
-
|
|
100
|
-
<select
|
|
101
|
-
:class="selectClass"
|
|
102
|
-
:disabled="processing"
|
|
103
|
-
aria-label="Change priority"
|
|
104
|
-
@change="
|
|
105
|
-
performAction('priority', $event.target.value);
|
|
106
|
-
$event.target.value = '';
|
|
107
|
-
"
|
|
108
|
-
>
|
|
109
|
-
<option value="">Priority...</option>
|
|
110
|
-
<option v-for="o in priorityOptions" :key="o.value" :value="o.value">{{ o.label }}</option>
|
|
111
|
-
</select>
|
|
112
|
-
|
|
113
|
-
<select
|
|
114
|
-
v-if="agents.length"
|
|
115
|
-
:class="selectClass"
|
|
116
|
-
:disabled="processing"
|
|
117
|
-
@change="
|
|
118
|
-
performAction('assign', $event.target.value);
|
|
119
|
-
$event.target.value = '';
|
|
120
|
-
"
|
|
121
|
-
>
|
|
122
|
-
<option value="">Assign to...</option>
|
|
123
|
-
<option v-for="a in agents" :key="a.id" :value="a.id">{{ a.name }}</option>
|
|
124
|
-
</select>
|
|
125
|
-
|
|
126
|
-
<select
|
|
127
|
-
v-if="departments.length"
|
|
128
|
-
:class="selectClass"
|
|
129
|
-
:disabled="processing"
|
|
130
|
-
@change="
|
|
131
|
-
performAction('department', $event.target.value);
|
|
132
|
-
$event.target.value = '';
|
|
133
|
-
"
|
|
134
|
-
>
|
|
135
|
-
<option value="">Department...</option>
|
|
136
|
-
<option v-for="d in departments" :key="d.id" :value="d.id">{{ d.name }}</option>
|
|
137
|
-
</select>
|
|
138
|
-
|
|
139
|
-
<button
|
|
140
|
-
:class="[
|
|
141
|
-
'rounded-lg px-3 py-1.5 text-sm font-medium transition-colors',
|
|
142
|
-
escDark
|
|
143
|
-
? 'bg-rose-500/15 text-rose-400 ring-1 ring-rose-500/20 hover:bg-rose-500/25'
|
|
144
|
-
: 'bg-red-50 text-red-600 ring-1 ring-red-200 hover:bg-red-100',
|
|
145
|
-
]"
|
|
146
|
-
:disabled="processing"
|
|
147
|
-
@click="performAction('delete', null)"
|
|
148
|
-
>
|
|
149
|
-
Delete
|
|
150
|
-
</button>
|
|
151
|
-
|
|
152
|
-
<button
|
|
153
|
-
:class="[
|
|
154
|
-
'ml-auto rounded-lg px-3 py-1.5 text-sm font-medium transition-colors',
|
|
155
|
-
escDark
|
|
156
|
-
? 'text-[var(--esc-panel-text-tertiary)] hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]'
|
|
157
|
-
: 'text-gray-500 hover:bg-gray-100 hover:text-gray-700',
|
|
158
|
-
]"
|
|
159
|
-
@click="emit('clear')"
|
|
160
|
-
>
|
|
161
|
-
Deselect All
|
|
162
|
-
</button>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
</Transition>
|
|
166
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed, inject } from 'vue';
|
|
3
|
+
import { router } from '@inertiajs/vue3';
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
selectedIds: { type: Array, required: true },
|
|
7
|
+
bulkRoute: { type: String, required: true },
|
|
8
|
+
agents: { type: Array, default: () => [] },
|
|
9
|
+
departments: { type: Array, default: () => [] },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits(['clear']);
|
|
13
|
+
const escDark = inject(
|
|
14
|
+
'esc-dark',
|
|
15
|
+
computed(() => false),
|
|
16
|
+
);
|
|
17
|
+
const processing = ref(false);
|
|
18
|
+
|
|
19
|
+
function performAction(action, value) {
|
|
20
|
+
if (!props.selectedIds.length || processing.value) return;
|
|
21
|
+
processing.value = true;
|
|
22
|
+
router.post(
|
|
23
|
+
props.bulkRoute,
|
|
24
|
+
{
|
|
25
|
+
ticket_ids: props.selectedIds,
|
|
26
|
+
action,
|
|
27
|
+
value,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
preserveScroll: true,
|
|
31
|
+
onSuccess: () => emit('clear'),
|
|
32
|
+
onFinish: () => {
|
|
33
|
+
processing.value = false;
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const statusOptions = [
|
|
40
|
+
{ value: 'in_progress', label: 'In Progress' },
|
|
41
|
+
{ value: 'waiting_on_customer', label: 'Waiting on Customer' },
|
|
42
|
+
{ value: 'resolved', label: 'Resolved' },
|
|
43
|
+
{ value: 'closed', label: 'Closed' },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const priorityOptions = [
|
|
47
|
+
{ value: 'low', label: 'Low' },
|
|
48
|
+
{ value: 'medium', label: 'Medium' },
|
|
49
|
+
{ value: 'high', label: 'High' },
|
|
50
|
+
{ value: 'urgent', label: 'Urgent' },
|
|
51
|
+
{ value: 'critical', label: 'Critical' },
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
const selectClass = computed(() =>
|
|
55
|
+
escDark.value
|
|
56
|
+
? '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)]'
|
|
57
|
+
: 'rounded-md border border-gray-300 bg-white px-2 py-1.5 text-sm focus:border-blue-500 focus:outline-none',
|
|
58
|
+
);
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<Transition
|
|
63
|
+
enter-active-class="transition-all duration-200 ease-out"
|
|
64
|
+
enter-from-class="translate-y-full opacity-0"
|
|
65
|
+
enter-to-class="translate-y-0 opacity-100"
|
|
66
|
+
leave-active-class="transition-all duration-150 ease-in"
|
|
67
|
+
leave-from-class="translate-y-0 opacity-100"
|
|
68
|
+
leave-to-class="translate-y-full opacity-0"
|
|
69
|
+
>
|
|
70
|
+
<div
|
|
71
|
+
v-if="selectedIds.length > 0"
|
|
72
|
+
:class="[
|
|
73
|
+
'fixed bottom-0 left-0 right-0 z-50 border-t px-6 py-3',
|
|
74
|
+
escDark
|
|
75
|
+
? 'border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface-alt)]/95 backdrop-blur-xl'
|
|
76
|
+
: 'border-gray-200 bg-white/95 backdrop-blur-xl shadow-lg',
|
|
77
|
+
]"
|
|
78
|
+
>
|
|
79
|
+
<div class="mx-auto flex max-w-7xl items-center gap-4">
|
|
80
|
+
<span
|
|
81
|
+
:class="['text-sm font-semibold', escDark ? 'text-[var(--esc-panel-text)]' : 'text-gray-900']"
|
|
82
|
+
aria-live="polite"
|
|
83
|
+
>
|
|
84
|
+
{{ selectedIds.length }} ticket{{ selectedIds.length !== 1 ? 's' : '' }} selected
|
|
85
|
+
</span>
|
|
86
|
+
|
|
87
|
+
<select
|
|
88
|
+
:class="selectClass"
|
|
89
|
+
:disabled="processing"
|
|
90
|
+
aria-label="Change status"
|
|
91
|
+
@change="
|
|
92
|
+
performAction('status', $event.target.value);
|
|
93
|
+
$event.target.value = '';
|
|
94
|
+
"
|
|
95
|
+
>
|
|
96
|
+
<option value="">Status...</option>
|
|
97
|
+
<option v-for="o in statusOptions" :key="o.value" :value="o.value">{{ o.label }}</option>
|
|
98
|
+
</select>
|
|
99
|
+
|
|
100
|
+
<select
|
|
101
|
+
:class="selectClass"
|
|
102
|
+
:disabled="processing"
|
|
103
|
+
aria-label="Change priority"
|
|
104
|
+
@change="
|
|
105
|
+
performAction('priority', $event.target.value);
|
|
106
|
+
$event.target.value = '';
|
|
107
|
+
"
|
|
108
|
+
>
|
|
109
|
+
<option value="">Priority...</option>
|
|
110
|
+
<option v-for="o in priorityOptions" :key="o.value" :value="o.value">{{ o.label }}</option>
|
|
111
|
+
</select>
|
|
112
|
+
|
|
113
|
+
<select
|
|
114
|
+
v-if="agents.length"
|
|
115
|
+
:class="selectClass"
|
|
116
|
+
:disabled="processing"
|
|
117
|
+
@change="
|
|
118
|
+
performAction('assign', $event.target.value);
|
|
119
|
+
$event.target.value = '';
|
|
120
|
+
"
|
|
121
|
+
>
|
|
122
|
+
<option value="">Assign to...</option>
|
|
123
|
+
<option v-for="a in agents" :key="a.id" :value="a.id">{{ a.name }}</option>
|
|
124
|
+
</select>
|
|
125
|
+
|
|
126
|
+
<select
|
|
127
|
+
v-if="departments.length"
|
|
128
|
+
:class="selectClass"
|
|
129
|
+
:disabled="processing"
|
|
130
|
+
@change="
|
|
131
|
+
performAction('department', $event.target.value);
|
|
132
|
+
$event.target.value = '';
|
|
133
|
+
"
|
|
134
|
+
>
|
|
135
|
+
<option value="">Department...</option>
|
|
136
|
+
<option v-for="d in departments" :key="d.id" :value="d.id">{{ d.name }}</option>
|
|
137
|
+
</select>
|
|
138
|
+
|
|
139
|
+
<button
|
|
140
|
+
:class="[
|
|
141
|
+
'rounded-lg px-3 py-1.5 text-sm font-medium transition-colors',
|
|
142
|
+
escDark
|
|
143
|
+
? 'bg-rose-500/15 text-rose-400 ring-1 ring-rose-500/20 hover:bg-rose-500/25'
|
|
144
|
+
: 'bg-red-50 text-red-600 ring-1 ring-red-200 hover:bg-red-100',
|
|
145
|
+
]"
|
|
146
|
+
:disabled="processing"
|
|
147
|
+
@click="performAction('delete', null)"
|
|
148
|
+
>
|
|
149
|
+
Delete
|
|
150
|
+
</button>
|
|
151
|
+
|
|
152
|
+
<button
|
|
153
|
+
:class="[
|
|
154
|
+
'ml-auto rounded-lg px-3 py-1.5 text-sm font-medium transition-colors',
|
|
155
|
+
escDark
|
|
156
|
+
? 'text-[var(--esc-panel-text-tertiary)] hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]'
|
|
157
|
+
: 'text-gray-500 hover:bg-gray-100 hover:text-gray-700',
|
|
158
|
+
]"
|
|
159
|
+
@click="emit('clear')"
|
|
160
|
+
>
|
|
161
|
+
Deselect All
|
|
162
|
+
</button>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</Transition>
|
|
166
|
+
</template>
|