@escalated-dev/escalated 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -2
- package/package.json +31 -2
- package/src/components/ActivityTimeline.stories.js +55 -0
- package/src/components/ActivityTimeline.vue +24 -7
- package/src/components/AdminDashboard.stories.js +1095 -0
- package/src/components/AgentLoadIndicator.stories.js +37 -0
- package/src/components/AgentLoadIndicator.vue +49 -0
- package/src/components/AgentPerformanceCard.vue +44 -0
- package/src/components/ArticleEditor.vue +82 -0
- package/src/components/AssigneeSelect.vue +19 -5
- package/src/components/AttachmentList.vue +53 -37
- package/src/components/AuditLogEntry.vue +95 -0
- package/src/components/BulkActionBar.vue +99 -30
- package/src/components/CategoryTree.vue +89 -0
- package/src/components/ChartWidget.vue +46 -0
- package/src/components/CollisionWarning.stories.js +30 -0
- package/src/components/CollisionWarning.vue +68 -0
- package/src/components/ConditionalFieldRules.vue +135 -0
- package/src/components/ContextPanel.vue +66 -0
- package/src/components/ContextPanelSection.vue +65 -0
- package/src/components/CustomFieldRenderer.vue +159 -0
- package/src/components/EscalatedLayout.vue +400 -69
- package/src/components/FileDropzone.vue +26 -10
- package/src/components/FollowButton.stories.js +30 -0
- package/src/components/FollowButton.vue +53 -28
- package/src/components/KeyboardShortcutHelp.vue +129 -39
- package/src/components/KnowledgePanel.vue +122 -0
- package/src/components/KpiCard.stories.js +32 -0
- package/src/components/KpiCard.vue +88 -0
- package/src/components/MacroDropdown.vue +95 -35
- package/src/components/PermissionMatrix.vue +107 -0
- package/src/components/PinnedNotes.vue +70 -31
- package/src/components/PresenceIndicator.vue +93 -27
- package/src/components/PriorityBadge.stories.js +33 -0
- package/src/components/PriorityBadge.vue +9 -2
- package/src/components/QuickFilters.vue +65 -49
- package/src/components/ReplyComposer.vue +144 -30
- package/src/components/ReplyThread.vue +72 -20
- package/src/components/SatisfactionRating.vue +98 -46
- package/src/components/ScheduleEditor.vue +104 -0
- package/src/components/SideConversation.vue +165 -0
- package/src/components/SideConversationList.vue +147 -0
- package/src/components/SkillTagManager.vue +79 -0
- package/src/components/SlaComplianceChart.vue +53 -0
- package/src/components/SlaTimer.stories.js +35 -0
- package/src/components/SlaTimer.vue +17 -4
- package/src/components/StatsCard.stories.js +24 -0
- package/src/components/StatsCard.vue +58 -46
- package/src/components/StatusBadge.stories.js +53 -0
- package/src/components/StatusBadge.vue +36 -4
- package/src/components/TagSelect.vue +43 -12
- package/src/components/TicketFilters.vue +225 -69
- package/src/components/TicketLinkPanel.vue +193 -0
- package/src/components/TicketList.vue +594 -193
- package/src/components/TicketMergeDialog.vue +157 -0
- package/src/components/TicketSidebar.vue +167 -99
- package/src/components/TicketTypeSelector.vue +21 -0
- package/src/components/TotpInput.stories.js +9 -0
- package/src/components/TotpInput.vue +81 -0
- package/src/components/TwoFactorSetup.vue +113 -0
- package/src/composables/useDebouncedSearch.js +38 -0
- package/src/composables/usePluginExtensions.js +95 -3
- package/src/composables/usePluginHooks.js +65 -0
- package/src/defineEscalatedPlugin.js +34 -8
- package/src/index.js +72 -35
- package/src/locales/en.json +25 -0
- package/src/pages/Admin/ApiTokens/Index.vue +231 -67
- package/src/pages/Admin/AuditLog/Index.vue +154 -0
- package/src/pages/Admin/Automations/Form.vue +184 -0
- package/src/pages/Admin/Automations/Index.vue +129 -0
- package/src/pages/Admin/BusinessHours/Form.vue +172 -0
- package/src/pages/Admin/BusinessHours/Index.vue +113 -0
- package/src/pages/Admin/CannedResponses/Index.vue +127 -70
- package/src/pages/Admin/Capacity/Index.vue +134 -0
- package/src/pages/Admin/CustomFields/Form.vue +195 -0
- package/src/pages/Admin/CustomFields/Index.vue +134 -0
- package/src/pages/Admin/CustomObjects/Form.vue +202 -0
- package/src/pages/Admin/CustomObjects/Index.vue +127 -0
- package/src/pages/Admin/CustomObjects/Records.vue +228 -0
- package/src/pages/Admin/Departments/Form.vue +75 -51
- package/src/pages/Admin/Departments/Index.vue +109 -57
- package/src/pages/Admin/EscalationRules/Form.vue +157 -96
- package/src/pages/Admin/EscalationRules/Index.vue +178 -57
- package/src/pages/Admin/Import/Connect.vue +96 -0
- package/src/pages/Admin/Import/Index.vue +102 -0
- package/src/pages/Admin/Import/Mapping.vue +110 -0
- package/src/pages/Admin/Import/Progress.vue +153 -0
- package/src/pages/Admin/Import/Review.vue +76 -0
- package/src/pages/Admin/KnowledgeBase/Articles/Form.vue +142 -0
- package/src/pages/Admin/KnowledgeBase/Articles/Index.vue +195 -0
- package/src/pages/Admin/KnowledgeBase/Categories/Index.vue +193 -0
- package/src/pages/Admin/Macros/Index.vue +250 -89
- package/src/pages/Admin/Plugins/Index.vue +205 -75
- package/src/pages/Admin/Reports/AgentMetrics.vue +115 -0
- package/src/pages/Admin/Reports/CsatReport.vue +127 -0
- package/src/pages/Admin/Reports/Dashboard.vue +211 -0
- package/src/pages/Admin/Reports/SlaReport.vue +166 -0
- package/src/pages/Admin/Reports.vue +139 -34
- package/src/pages/Admin/Roles/Form.vue +71 -0
- package/src/pages/Admin/Roles/Index.vue +122 -0
- package/src/pages/Admin/Settings/CsatSettings.vue +165 -0
- package/src/pages/Admin/Settings/DataRetention.vue +182 -0
- package/src/pages/Admin/Settings/EmailSettings.vue +243 -0
- package/src/pages/Admin/Settings/Sandbox.vue +135 -0
- package/src/pages/Admin/Settings/SsoSettings.vue +218 -0
- package/src/pages/Admin/Settings/TwoFactor.vue +110 -0
- package/src/pages/Admin/Settings.vue +468 -260
- package/src/pages/Admin/Skills/Form.vue +53 -0
- package/src/pages/Admin/Skills/Index.vue +94 -0
- package/src/pages/Admin/SlaPolicies/Form.vue +118 -75
- package/src/pages/Admin/SlaPolicies/Index.vue +120 -59
- package/src/pages/Admin/Statuses/Form.vue +114 -0
- package/src/pages/Admin/Statuses/Index.vue +153 -0
- package/src/pages/Admin/Tags/Index.vue +191 -105
- package/src/pages/Admin/Tickets/Index.vue +91 -39
- package/src/pages/Admin/Tickets/Show.vue +101 -37
- package/src/pages/Admin/Webhooks/DeliveryLog.vue +120 -0
- package/src/pages/Admin/Webhooks/Form.vue +110 -0
- package/src/pages/Admin/Webhooks/Index.vue +136 -0
- package/src/pages/Agent/Dashboard.vue +311 -186
- package/src/pages/Agent/TicketIndex.vue +88 -38
- package/src/pages/Agent/TicketShow.vue +258 -51
- package/src/pages/Customer/Create.vue +36 -9
- package/src/pages/Customer/Index.vue +31 -24
- package/src/pages/Customer/KnowledgeBase/Article.vue +127 -0
- package/src/pages/Customer/KnowledgeBase/Index.vue +151 -0
- package/src/plugin.js +86 -1
- package/src/utils/constants.js +30 -0
- package/src/utils/formatting.js +35 -0
- package/src/pages/Admin/Plugins.vue +0 -129
|
@@ -1,24 +1,31 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import EscalatedLayout from '../../components/EscalatedLayout.vue';
|
|
3
|
-
import TicketList from '../../components/TicketList.vue';
|
|
4
|
-
import TicketFilters from '../../components/TicketFilters.vue';
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import EscalatedLayout from '../../components/EscalatedLayout.vue';
|
|
3
|
+
import TicketList from '../../components/TicketList.vue';
|
|
4
|
+
import TicketFilters from '../../components/TicketFilters.vue';
|
|
5
|
+
import PluginSlot from '../../components/PluginSlot.vue';
|
|
6
|
+
import { Link } from '@inertiajs/vue3';
|
|
7
|
+
import { usePluginExtensions } from '../../composables/usePluginExtensions';
|
|
8
|
+
|
|
9
|
+
defineProps({
|
|
10
|
+
tickets: Object,
|
|
11
|
+
filters: Object,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const { getPageComponents } = usePluginExtensions();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<EscalatedLayout title="My Tickets">
|
|
19
|
+
<PluginSlot slot="customer.index.header" :components="getPageComponents('customer.index', 'header')" />
|
|
20
|
+
<div class="mb-6 flex items-center justify-between">
|
|
21
|
+
<TicketFilters :filters="filters" :route="route('escalated.customer.tickets.index')" />
|
|
22
|
+
<Link
|
|
23
|
+
:href="route('escalated.customer.tickets.create')"
|
|
24
|
+
class="rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700"
|
|
25
|
+
>
|
|
26
|
+
New Ticket
|
|
27
|
+
</Link>
|
|
28
|
+
</div>
|
|
29
|
+
<TicketList :tickets="tickets" route-prefix="escalated.customer.tickets" />
|
|
30
|
+
</EscalatedLayout>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import EscalatedLayout from '../../../components/EscalatedLayout.vue';
|
|
3
|
+
import { router, Link } from '@inertiajs/vue3';
|
|
4
|
+
import { ref } from 'vue';
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
article: Object,
|
|
8
|
+
related: Array,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const feedbackSent = ref(false);
|
|
12
|
+
|
|
13
|
+
function sendFeedback(helpful) {
|
|
14
|
+
router.post(
|
|
15
|
+
route('escalated.customer.kb.feedback', props.article.slug),
|
|
16
|
+
{
|
|
17
|
+
helpful,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
preserveScroll: true,
|
|
21
|
+
onSuccess: () => {
|
|
22
|
+
feedbackSent.value = true;
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<EscalatedLayout :title="article.title">
|
|
31
|
+
<div class="mx-auto max-w-3xl">
|
|
32
|
+
<div class="mb-6">
|
|
33
|
+
<Link :href="route('escalated.customer.kb.index')" class="text-sm text-gray-500 hover:text-gray-700">
|
|
34
|
+
← Back to Knowledge Base
|
|
35
|
+
</Link>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- Breadcrumb -->
|
|
39
|
+
<div v-if="article.category" class="mb-4 flex items-center gap-2 text-xs text-gray-500">
|
|
40
|
+
<Link :href="route('escalated.customer.kb.index')" class="hover:text-gray-700">Knowledge Base</Link>
|
|
41
|
+
<span>/</span>
|
|
42
|
+
<Link
|
|
43
|
+
:href="route('escalated.customer.kb.index', { category: article.category.id })"
|
|
44
|
+
class="hover:text-gray-700"
|
|
45
|
+
>{{ article.category.name }}</Link
|
|
46
|
+
>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<!-- Article -->
|
|
50
|
+
<article class="rounded-lg border border-gray-200 bg-white p-8">
|
|
51
|
+
<h1 class="mb-4 text-2xl font-bold text-gray-900">{{ article.title }}</h1>
|
|
52
|
+
<div class="mb-6 flex items-center gap-4 text-xs text-gray-500">
|
|
53
|
+
<span>{{ article.view_count }} views</span>
|
|
54
|
+
<span v-if="article.published_at"
|
|
55
|
+
>Published {{ new Date(article.published_at).toLocaleDateString() }}</span
|
|
56
|
+
>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<!-- Article body rendered as HTML -->
|
|
60
|
+
<div class="prose prose-gray max-w-none text-gray-700" v-html="article.body"></div>
|
|
61
|
+
</article>
|
|
62
|
+
|
|
63
|
+
<!-- Feedback -->
|
|
64
|
+
<div class="mt-6 rounded-lg border border-gray-200 bg-white p-6 text-center">
|
|
65
|
+
<template v-if="!feedbackSent">
|
|
66
|
+
<p class="mb-3 text-sm font-medium text-gray-700">Was this article helpful?</p>
|
|
67
|
+
<div class="flex items-center justify-center gap-3">
|
|
68
|
+
<button
|
|
69
|
+
class="inline-flex items-center gap-2 rounded-lg border border-gray-200 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:border-green-300 hover:bg-green-50 hover:text-green-700"
|
|
70
|
+
@click="sendFeedback(true)"
|
|
71
|
+
>
|
|
72
|
+
<svg
|
|
73
|
+
class="h-4 w-4"
|
|
74
|
+
fill="none"
|
|
75
|
+
stroke="currentColor"
|
|
76
|
+
stroke-width="1.5"
|
|
77
|
+
viewBox="0 0 24 24"
|
|
78
|
+
>
|
|
79
|
+
<path
|
|
80
|
+
stroke-linecap="round"
|
|
81
|
+
stroke-linejoin="round"
|
|
82
|
+
d="M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h.904"
|
|
83
|
+
/>
|
|
84
|
+
</svg>
|
|
85
|
+
Yes
|
|
86
|
+
</button>
|
|
87
|
+
<button
|
|
88
|
+
class="inline-flex items-center gap-2 rounded-lg border border-gray-200 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:border-red-300 hover:bg-red-50 hover:text-red-700"
|
|
89
|
+
@click="sendFeedback(false)"
|
|
90
|
+
>
|
|
91
|
+
<svg
|
|
92
|
+
class="h-4 w-4"
|
|
93
|
+
fill="none"
|
|
94
|
+
stroke="currentColor"
|
|
95
|
+
stroke-width="1.5"
|
|
96
|
+
viewBox="0 0 24 24"
|
|
97
|
+
>
|
|
98
|
+
<path
|
|
99
|
+
stroke-linecap="round"
|
|
100
|
+
stroke-linejoin="round"
|
|
101
|
+
d="M7.5 15h2.25m8.024-9.75c.011.05.028.1.052.148.591 1.2.924 2.55.924 3.977a8.96 8.96 0 01-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398C20.613 14.547 19.833 15 19 15h-.904c-.26 0-.507-.098-.672-.28a5.002 5.002 0 01-.188-.226M7.5 15c-.863 0-1.706-.12-2.514-.348m2.514.348c.26.044.507.22.672.44a4.992 4.992 0 001.423 1.305M4.986 14.652a4.5 4.5 0 01-.236-.442m.236.442c-.31.652-.762 1.168-1.285 1.5m4.78-1.5a11.92 11.92 0 01-.813 1.25m.813-1.25c-.418.593-.91 1.098-1.459 1.5m1.459-1.5a6.12 6.12 0 01-.813 1.25m-2.606 0c-.5.338-1.1.5-1.71.5h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h.904"
|
|
102
|
+
/>
|
|
103
|
+
</svg>
|
|
104
|
+
No
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
<p v-else class="text-sm text-green-600">Thank you for your feedback!</p>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<!-- Related Articles -->
|
|
112
|
+
<div v-if="related?.length" class="mt-6">
|
|
113
|
+
<h3 class="mb-3 text-sm font-semibold text-gray-900">Related Articles</h3>
|
|
114
|
+
<div class="space-y-2">
|
|
115
|
+
<Link
|
|
116
|
+
v-for="item in related"
|
|
117
|
+
:key="item.id"
|
|
118
|
+
:href="route('escalated.customer.kb.show', item.slug)"
|
|
119
|
+
class="block rounded-lg border border-gray-200 bg-white px-4 py-3 text-sm text-gray-700 transition-colors hover:border-gray-300 hover:bg-gray-50"
|
|
120
|
+
>
|
|
121
|
+
{{ item.title }}
|
|
122
|
+
</Link>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</EscalatedLayout>
|
|
127
|
+
</template>
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import EscalatedLayout from '../../../components/EscalatedLayout.vue';
|
|
3
|
+
import { router, Link } from '@inertiajs/vue3';
|
|
4
|
+
import { ref, watch } from 'vue';
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
categories: Array,
|
|
8
|
+
articles: Object,
|
|
9
|
+
filters: Object,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const search = ref(props.filters?.search || '');
|
|
13
|
+
const selectedCategory = ref(props.filters?.category || '');
|
|
14
|
+
|
|
15
|
+
let debounceTimer;
|
|
16
|
+
function applyFilters() {
|
|
17
|
+
clearTimeout(debounceTimer);
|
|
18
|
+
debounceTimer = setTimeout(() => {
|
|
19
|
+
router.get(
|
|
20
|
+
route('escalated.customer.kb.index'),
|
|
21
|
+
{
|
|
22
|
+
search: search.value || undefined,
|
|
23
|
+
category: selectedCategory.value || undefined,
|
|
24
|
+
},
|
|
25
|
+
{ preserveState: true, preserveScroll: true },
|
|
26
|
+
);
|
|
27
|
+
}, 300);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
watch([search, selectedCategory], applyFilters);
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<EscalatedLayout title="Knowledge Base">
|
|
35
|
+
<!-- Search -->
|
|
36
|
+
<div class="mb-8 text-center">
|
|
37
|
+
<h1 class="mb-3 text-2xl font-bold text-gray-900">How can we help you?</h1>
|
|
38
|
+
<div class="mx-auto max-w-lg">
|
|
39
|
+
<input
|
|
40
|
+
v-model="search"
|
|
41
|
+
type="text"
|
|
42
|
+
placeholder="Search articles..."
|
|
43
|
+
class="w-full rounded-lg border border-gray-300 bg-white px-4 py-3 text-sm text-gray-900 shadow-sm placeholder-gray-400 focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/20"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<!-- Categories -->
|
|
49
|
+
<div v-if="categories?.length && !search" class="mb-8 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
50
|
+
<button
|
|
51
|
+
v-for="cat in categories"
|
|
52
|
+
:key="cat.id"
|
|
53
|
+
:class="[
|
|
54
|
+
'rounded-lg border p-5 text-left transition-all',
|
|
55
|
+
selectedCategory == cat.id
|
|
56
|
+
? 'border-indigo-500 bg-indigo-50 shadow-sm'
|
|
57
|
+
: 'border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm',
|
|
58
|
+
]"
|
|
59
|
+
@click="selectedCategory = selectedCategory == cat.id ? '' : cat.id"
|
|
60
|
+
>
|
|
61
|
+
<div class="flex items-center gap-3">
|
|
62
|
+
<div
|
|
63
|
+
:class="[
|
|
64
|
+
'flex h-10 w-10 items-center justify-center rounded-lg',
|
|
65
|
+
selectedCategory == cat.id ? 'bg-indigo-100' : 'bg-gray-100',
|
|
66
|
+
]"
|
|
67
|
+
>
|
|
68
|
+
<svg
|
|
69
|
+
:class="['h-5 w-5', selectedCategory == cat.id ? 'text-indigo-600' : 'text-gray-500']"
|
|
70
|
+
fill="none"
|
|
71
|
+
stroke="currentColor"
|
|
72
|
+
stroke-width="1.5"
|
|
73
|
+
viewBox="0 0 24 24"
|
|
74
|
+
>
|
|
75
|
+
<path
|
|
76
|
+
stroke-linecap="round"
|
|
77
|
+
stroke-linejoin="round"
|
|
78
|
+
d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"
|
|
79
|
+
/>
|
|
80
|
+
</svg>
|
|
81
|
+
</div>
|
|
82
|
+
<div>
|
|
83
|
+
<h3
|
|
84
|
+
:class="[
|
|
85
|
+
'text-sm font-semibold',
|
|
86
|
+
selectedCategory == cat.id ? 'text-indigo-900' : 'text-gray-900',
|
|
87
|
+
]"
|
|
88
|
+
>
|
|
89
|
+
{{ cat.name }}
|
|
90
|
+
</h3>
|
|
91
|
+
<p class="text-xs text-gray-500">{{ cat.articles_count }} articles</p>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<p v-if="cat.description" class="mt-2 text-xs text-gray-500">{{ cat.description }}</p>
|
|
95
|
+
</button>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<!-- Articles -->
|
|
99
|
+
<div class="space-y-3">
|
|
100
|
+
<Link
|
|
101
|
+
v-for="article in articles.data"
|
|
102
|
+
:key="article.id"
|
|
103
|
+
:href="route('escalated.customer.kb.show', article.slug)"
|
|
104
|
+
class="block rounded-lg border border-gray-200 bg-white p-4 transition-all hover:border-gray-300 hover:shadow-sm"
|
|
105
|
+
>
|
|
106
|
+
<h3 class="text-sm font-semibold text-gray-900">{{ article.title }}</h3>
|
|
107
|
+
<div class="mt-1 flex items-center gap-3 text-xs text-gray-500">
|
|
108
|
+
<span v-if="article.category">{{ article.category.name }}</span>
|
|
109
|
+
<span>{{ article.view_count }} views</span>
|
|
110
|
+
</div>
|
|
111
|
+
</Link>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div v-if="!articles.data?.length" class="py-12 text-center">
|
|
115
|
+
<svg
|
|
116
|
+
class="mx-auto mb-3 h-10 w-10 text-gray-300"
|
|
117
|
+
fill="none"
|
|
118
|
+
stroke="currentColor"
|
|
119
|
+
stroke-width="1.5"
|
|
120
|
+
viewBox="0 0 24 24"
|
|
121
|
+
>
|
|
122
|
+
<path
|
|
123
|
+
stroke-linecap="round"
|
|
124
|
+
stroke-linejoin="round"
|
|
125
|
+
d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
|
|
126
|
+
/>
|
|
127
|
+
</svg>
|
|
128
|
+
<p class="text-sm text-gray-500">No articles found.</p>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<!-- Pagination -->
|
|
132
|
+
<div v-if="articles.links && articles.last_page > 1" class="mt-6 flex items-center justify-center gap-1">
|
|
133
|
+
<Link
|
|
134
|
+
v-for="link in articles.links"
|
|
135
|
+
:key="link.label"
|
|
136
|
+
:href="link.url || '#'"
|
|
137
|
+
:class="[
|
|
138
|
+
'rounded-lg px-3 py-1.5 text-sm transition-colors',
|
|
139
|
+
link.active
|
|
140
|
+
? 'bg-indigo-600 text-white'
|
|
141
|
+
: link.url
|
|
142
|
+
? 'border border-gray-200 text-gray-600 hover:bg-gray-50'
|
|
143
|
+
: 'cursor-default text-gray-300',
|
|
144
|
+
]"
|
|
145
|
+
preserve-scroll
|
|
146
|
+
>
|
|
147
|
+
<!-- eslint-disable-next-line vue/no-v-html --><span v-html="link.label" />
|
|
148
|
+
</Link>
|
|
149
|
+
</div>
|
|
150
|
+
</EscalatedLayout>
|
|
151
|
+
</template>
|
package/src/plugin.js
CHANGED
|
@@ -24,6 +24,16 @@ export const EscalatedPlugin = {
|
|
|
24
24
|
if (options.theme) {
|
|
25
25
|
app.provide('escalated-theme', options.theme);
|
|
26
26
|
applyTheme(options.theme);
|
|
27
|
+
|
|
28
|
+
if (options.theme.panel) {
|
|
29
|
+
const panelConfig = options.theme.panel;
|
|
30
|
+
applyPanelTheme(panelConfig);
|
|
31
|
+
app.provide('escalated-panel', {
|
|
32
|
+
appName: panelConfig.appName || 'Escalated',
|
|
33
|
+
logo: panelConfig.logo || null,
|
|
34
|
+
mode: panelConfig.mode || 'dark',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
27
37
|
}
|
|
28
38
|
},
|
|
29
39
|
};
|
|
@@ -55,7 +65,7 @@ function darken(hex, percent) {
|
|
|
55
65
|
const r = Math.max(0, (num >> 16) - Math.round(2.55 * percent));
|
|
56
66
|
const g = Math.max(0, ((num >> 8) & 0x00ff) - Math.round(2.55 * percent));
|
|
57
67
|
const b = Math.max(0, (num & 0x0000ff) - Math.round(2.55 * percent));
|
|
58
|
-
return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, '0')}`;
|
|
68
|
+
return `#${((r << 16) | (g << 8) | b).toString(16).padStart(6, '0')}`;
|
|
59
69
|
}
|
|
60
70
|
|
|
61
71
|
function scaleBorderRadius(radius, factor) {
|
|
@@ -63,3 +73,78 @@ function scaleBorderRadius(radius, factor) {
|
|
|
63
73
|
if (!match) return radius;
|
|
64
74
|
return `${(parseFloat(match[1]) * factor).toFixed(2)}${match[2] || 'rem'}`;
|
|
65
75
|
}
|
|
76
|
+
|
|
77
|
+
const panelDarkDefaults = {
|
|
78
|
+
bg: '#000000',
|
|
79
|
+
sidebarBg: '#0a0a0a',
|
|
80
|
+
topbarBg: 'rgba(0,0,0,0.8)',
|
|
81
|
+
surface: 'rgba(23,23,23,0.6)',
|
|
82
|
+
surfaceAlt: '#0a0a0a',
|
|
83
|
+
border: 'rgba(255,255,255,0.06)',
|
|
84
|
+
borderInput: 'rgba(255,255,255,0.1)',
|
|
85
|
+
text: '#ffffff',
|
|
86
|
+
textSecondary: '#e5e5e5',
|
|
87
|
+
textTertiary: '#a3a3a3',
|
|
88
|
+
textMuted: '#737373',
|
|
89
|
+
accent: '#06b6d4',
|
|
90
|
+
accentSecondary: '#8b5cf6',
|
|
91
|
+
accentHover: '#22d3ee',
|
|
92
|
+
accentSecondaryHover: '#a78bfa',
|
|
93
|
+
hover: 'rgba(255,255,255,0.03)',
|
|
94
|
+
active: 'rgba(255,255,255,0.08)',
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const panelLightDefaults = {
|
|
98
|
+
bg: '#f9fafb',
|
|
99
|
+
sidebarBg: '#ffffff',
|
|
100
|
+
topbarBg: 'rgba(255,255,255,0.95)',
|
|
101
|
+
surface: '#ffffff',
|
|
102
|
+
surfaceAlt: '#f9fafb',
|
|
103
|
+
border: '#e5e7eb',
|
|
104
|
+
borderInput: '#d1d5db',
|
|
105
|
+
text: '#111827',
|
|
106
|
+
textSecondary: '#374151',
|
|
107
|
+
textTertiary: '#6b7280',
|
|
108
|
+
textMuted: '#9ca3af',
|
|
109
|
+
accent: '#3b82f6',
|
|
110
|
+
accentSecondary: '#6366f1',
|
|
111
|
+
accentHover: '#2563eb',
|
|
112
|
+
accentSecondaryHover: '#818cf8',
|
|
113
|
+
hover: 'rgba(0,0,0,0.02)',
|
|
114
|
+
active: '#eff6ff',
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const panelTokenMap = {
|
|
118
|
+
bg: '--esc-panel-bg',
|
|
119
|
+
sidebarBg: '--esc-panel-sidebar-bg',
|
|
120
|
+
topbarBg: '--esc-panel-topbar-bg',
|
|
121
|
+
surface: '--esc-panel-surface',
|
|
122
|
+
surfaceAlt: '--esc-panel-surface-alt',
|
|
123
|
+
border: '--esc-panel-border',
|
|
124
|
+
borderInput: '--esc-panel-border-input',
|
|
125
|
+
text: '--esc-panel-text',
|
|
126
|
+
textSecondary: '--esc-panel-text-secondary',
|
|
127
|
+
textTertiary: '--esc-panel-text-tertiary',
|
|
128
|
+
textMuted: '--esc-panel-text-muted',
|
|
129
|
+
accent: '--esc-panel-accent',
|
|
130
|
+
accentSecondary: '--esc-panel-accent-secondary',
|
|
131
|
+
accentHover: '--esc-panel-accent-hover',
|
|
132
|
+
accentSecondaryHover: '--esc-panel-accent-secondary-hover',
|
|
133
|
+
hover: '--esc-panel-hover',
|
|
134
|
+
active: '--esc-panel-active',
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
function applyPanelTheme(panelConfig) {
|
|
138
|
+
const defaults = panelConfig.mode === 'light' ? panelLightDefaults : panelDarkDefaults;
|
|
139
|
+
const overrides = {};
|
|
140
|
+
for (const key of Object.keys(panelTokenMap)) {
|
|
141
|
+
if (panelConfig[key] !== undefined) {
|
|
142
|
+
overrides[key] = panelConfig[key];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const merged = { ...defaults, ...overrides };
|
|
146
|
+
const style = document.documentElement.style;
|
|
147
|
+
for (const [key, cssVar] of Object.entries(panelTokenMap)) {
|
|
148
|
+
style.setProperty(cssVar, merged[key]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared ticket constants used across multiple components.
|
|
3
|
+
* Single source of truth for statuses, priorities, and types.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const TICKET_STATUSES = [
|
|
7
|
+
'open',
|
|
8
|
+
'in_progress',
|
|
9
|
+
'waiting_on_customer',
|
|
10
|
+
'waiting_on_agent',
|
|
11
|
+
'escalated',
|
|
12
|
+
'resolved',
|
|
13
|
+
'closed',
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export const TICKET_PRIORITIES = ['low', 'medium', 'high', 'urgent', 'critical'];
|
|
17
|
+
|
|
18
|
+
export const TICKET_TYPES = [
|
|
19
|
+
{ value: 'question', label: 'Question', color: 'text-cyan-400' },
|
|
20
|
+
{ value: 'problem', label: 'Problem', color: 'text-rose-400' },
|
|
21
|
+
{ value: 'incident', label: 'Incident', color: 'text-amber-400' },
|
|
22
|
+
{ value: 'task', label: 'Task', color: 'text-violet-400' },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export const TICKET_TYPE_COLORS = {
|
|
26
|
+
question: { dark: 'bg-cyan-500/20 text-cyan-400', light: 'bg-cyan-100 text-cyan-700' },
|
|
27
|
+
problem: { dark: 'bg-rose-500/20 text-rose-400', light: 'bg-rose-100 text-rose-700' },
|
|
28
|
+
incident: { dark: 'bg-amber-500/20 text-amber-400', light: 'bg-amber-100 text-amber-700' },
|
|
29
|
+
task: { dark: 'bg-violet-500/20 text-violet-400', light: 'bg-violet-100 text-violet-700' },
|
|
30
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared formatting utilities for ticket display.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns a human-readable relative time string (e.g. "5m ago", "3h ago", "2d ago").
|
|
7
|
+
* @param {string|Date} date
|
|
8
|
+
* @returns {string}
|
|
9
|
+
*/
|
|
10
|
+
export function timeAgo(date) {
|
|
11
|
+
if (!date) return '';
|
|
12
|
+
const diff = Date.now() - new Date(date).getTime();
|
|
13
|
+
const mins = Math.floor(diff / 60000);
|
|
14
|
+
if (mins < 60) return `${mins}m ago`;
|
|
15
|
+
const hrs = Math.floor(mins / 60);
|
|
16
|
+
if (hrs < 24) return `${hrs}h ago`;
|
|
17
|
+
const days = Math.floor(hrs / 24);
|
|
18
|
+
return `${days}d ago`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns a Tailwind CSS class for the SLA indicator dot based on ticket SLA state.
|
|
23
|
+
* @param {Object} ticket
|
|
24
|
+
* @returns {string}
|
|
25
|
+
*/
|
|
26
|
+
export function slaClass(ticket) {
|
|
27
|
+
if (ticket.sla_first_response_breached || ticket.sla_resolution_breached) return 'bg-rose-500';
|
|
28
|
+
if (ticket.first_response_due_at || ticket.resolution_due_at) {
|
|
29
|
+
const due = ticket.resolution_due_at || ticket.first_response_due_at;
|
|
30
|
+
const mins = (new Date(due) - Date.now()) / 60000;
|
|
31
|
+
if (mins < 30) return 'bg-amber-500';
|
|
32
|
+
return 'bg-emerald-500';
|
|
33
|
+
}
|
|
34
|
+
return '';
|
|
35
|
+
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import EscalatedLayout from '../../components/EscalatedLayout.vue';
|
|
3
|
-
import { useForm, usePage, router } from '@inertiajs/vue3';
|
|
4
|
-
import { computed } from 'vue';
|
|
5
|
-
|
|
6
|
-
const props = defineProps({ plugins: Array });
|
|
7
|
-
const page = usePage();
|
|
8
|
-
|
|
9
|
-
const flash = computed(() => ({
|
|
10
|
-
success: page.props.flash?.success,
|
|
11
|
-
error: page.props.flash?.error,
|
|
12
|
-
}));
|
|
13
|
-
|
|
14
|
-
const uploadForm = useForm({
|
|
15
|
-
plugin: null,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
function onFileChange(e) {
|
|
19
|
-
uploadForm.plugin = e.target.files[0];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function submitUpload() {
|
|
23
|
-
uploadForm.post(route('escalated.admin.plugins.upload'), {
|
|
24
|
-
forceFormData: true,
|
|
25
|
-
onSuccess: () => {
|
|
26
|
-
uploadForm.reset();
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function activate(slug) {
|
|
32
|
-
router.post(route('escalated.admin.plugins.activate', slug));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function deactivate(slug) {
|
|
36
|
-
router.post(route('escalated.admin.plugins.deactivate', slug));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function deletePlugin(slug) {
|
|
40
|
-
if (confirm('Are you sure you want to delete this plugin? This cannot be undone.')) {
|
|
41
|
-
router.delete(route('escalated.admin.plugins.destroy', slug));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<template>
|
|
47
|
-
<EscalatedLayout title="Plugins">
|
|
48
|
-
<div class="mx-auto max-w-4xl space-y-6">
|
|
49
|
-
<!-- Flash messages -->
|
|
50
|
-
<div v-if="flash.success" class="rounded-lg border border-emerald-500/20 bg-emerald-500/10 px-4 py-3 text-sm text-emerald-400">
|
|
51
|
-
{{ flash.success }}
|
|
52
|
-
</div>
|
|
53
|
-
<div v-if="flash.error" class="rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-3 text-sm text-red-400">
|
|
54
|
-
{{ flash.error }}
|
|
55
|
-
</div>
|
|
56
|
-
|
|
57
|
-
<!-- Upload Plugin -->
|
|
58
|
-
<div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
|
|
59
|
-
<h3 class="mb-4 text-sm font-semibold text-white">Upload Plugin</h3>
|
|
60
|
-
<form @submit.prevent="submitUpload" class="flex items-end gap-4">
|
|
61
|
-
<div class="flex-1">
|
|
62
|
-
<label class="block text-sm font-medium text-neutral-200">Plugin ZIP File</label>
|
|
63
|
-
<input type="file" accept=".zip" @change="onFileChange"
|
|
64
|
-
class="mt-2 w-full rounded-lg border border-white/10 bg-neutral-950 px-3 py-2 text-sm text-neutral-200 file:mr-3 file:rounded file:border-0 file:bg-white/10 file:px-3 file:py-1 file:text-sm file:text-neutral-300 focus:border-white/20 focus:outline-none focus:ring-1 focus:ring-white/10" />
|
|
65
|
-
<p v-if="uploadForm.errors.plugin" class="mt-1 text-xs text-red-400">{{ uploadForm.errors.plugin }}</p>
|
|
66
|
-
</div>
|
|
67
|
-
<button type="submit" :disabled="uploadForm.processing || !uploadForm.plugin"
|
|
68
|
-
class="shrink-0 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">
|
|
69
|
-
{{ uploadForm.processing ? 'Uploading...' : 'Upload' }}
|
|
70
|
-
</button>
|
|
71
|
-
</form>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<!-- Plugin List -->
|
|
75
|
-
<div class="rounded-xl border border-white/[0.06] bg-neutral-900/60 p-6">
|
|
76
|
-
<h3 class="mb-5 text-sm font-semibold text-white">Installed Plugins</h3>
|
|
77
|
-
|
|
78
|
-
<div v-if="!plugins || plugins.length === 0" class="py-8 text-center text-sm text-neutral-500">
|
|
79
|
-
No plugins installed yet.
|
|
80
|
-
</div>
|
|
81
|
-
|
|
82
|
-
<div v-else class="divide-y divide-white/[0.06]">
|
|
83
|
-
<div v-for="plugin in plugins" :key="plugin.slug" class="flex items-start justify-between gap-4 py-4 first:pt-0 last:pb-0">
|
|
84
|
-
<!-- Plugin info -->
|
|
85
|
-
<div class="min-w-0 flex-1">
|
|
86
|
-
<div class="flex items-center gap-2.5">
|
|
87
|
-
<span class="text-sm font-medium text-white">{{ plugin.name }}</span>
|
|
88
|
-
<span class="rounded bg-white/[0.06] px-1.5 py-0.5 text-[10px] font-medium text-neutral-500">
|
|
89
|
-
v{{ plugin.version }}
|
|
90
|
-
</span>
|
|
91
|
-
<span :class="[
|
|
92
|
-
'rounded px-1.5 py-0.5 text-[10px] font-medium',
|
|
93
|
-
plugin.source === 'composer'
|
|
94
|
-
? 'bg-violet-500/10 text-violet-400'
|
|
95
|
-
: 'bg-cyan-500/10 text-cyan-400'
|
|
96
|
-
]">
|
|
97
|
-
{{ plugin.source }}
|
|
98
|
-
</span>
|
|
99
|
-
</div>
|
|
100
|
-
<p v-if="plugin.description" class="mt-1 text-xs text-neutral-500">{{ plugin.description }}</p>
|
|
101
|
-
<p class="mt-1 text-xs text-neutral-600">by {{ plugin.author }}</p>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<!-- Actions -->
|
|
105
|
-
<div class="flex shrink-0 items-center gap-2">
|
|
106
|
-
<!-- Active status toggle -->
|
|
107
|
-
<button v-if="plugin.is_active" @click="deactivate(plugin.slug)"
|
|
108
|
-
class="rounded-lg border border-emerald-500/20 bg-emerald-500/10 px-3 py-1.5 text-xs font-medium text-emerald-400 transition-colors hover:bg-emerald-500/20">
|
|
109
|
-
Active
|
|
110
|
-
</button>
|
|
111
|
-
<button v-else @click="activate(plugin.slug)"
|
|
112
|
-
class="rounded-lg border border-white/10 bg-white/[0.04] px-3 py-1.5 text-xs font-medium text-neutral-500 transition-colors hover:bg-white/[0.08] hover:text-neutral-300">
|
|
113
|
-
Inactive
|
|
114
|
-
</button>
|
|
115
|
-
|
|
116
|
-
<!-- Delete (local only) -->
|
|
117
|
-
<button v-if="plugin.source === 'local'" @click="deletePlugin(plugin.slug)"
|
|
118
|
-
class="rounded-lg border border-white/10 bg-white/[0.04] p-1.5 text-neutral-600 transition-colors hover:border-red-500/20 hover:bg-red-500/10 hover:text-red-400">
|
|
119
|
-
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
|
|
120
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
|
|
121
|
-
</svg>
|
|
122
|
-
</button>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</EscalatedLayout>
|
|
129
|
-
</template>
|