@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,195 +1,195 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import EscalatedLayout from '../../../../components/EscalatedLayout.vue';
|
|
3
|
-
import { router } from '@inertiajs/vue3';
|
|
4
|
-
import { ref, watch } from 'vue';
|
|
5
|
-
import { Link } from '@inertiajs/vue3';
|
|
6
|
-
|
|
7
|
-
const props = defineProps({
|
|
8
|
-
articles: Object,
|
|
9
|
-
categories: Array,
|
|
10
|
-
filters: Object,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const search = ref(props.filters?.search || '');
|
|
14
|
-
const status = ref(props.filters?.status || '');
|
|
15
|
-
const categoryId = ref(props.filters?.category_id || '');
|
|
16
|
-
|
|
17
|
-
let debounceTimer;
|
|
18
|
-
function applyFilters() {
|
|
19
|
-
clearTimeout(debounceTimer);
|
|
20
|
-
debounceTimer = setTimeout(() => {
|
|
21
|
-
router.get(
|
|
22
|
-
route('escalated.admin.kb-articles.index'),
|
|
23
|
-
{
|
|
24
|
-
search: search.value || undefined,
|
|
25
|
-
status: status.value || undefined,
|
|
26
|
-
category_id: categoryId.value || undefined,
|
|
27
|
-
},
|
|
28
|
-
{ preserveState: true, preserveScroll: true },
|
|
29
|
-
);
|
|
30
|
-
}, 300);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
watch([search, status, categoryId], applyFilters);
|
|
34
|
-
|
|
35
|
-
function deleteArticle(article) {
|
|
36
|
-
if (confirm('Delete this article?')) {
|
|
37
|
-
router.delete(route('escalated.admin.kb-articles.destroy', article.id));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const statusColors = {
|
|
42
|
-
published: 'bg-emerald-500/10 text-emerald-400 border-emerald-500/20',
|
|
43
|
-
draft: 'bg-amber-500/10 text-amber-400 border-amber-500/20',
|
|
44
|
-
};
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<template>
|
|
48
|
-
<EscalatedLayout title="Knowledge Base — Articles">
|
|
49
|
-
<div class="mb-6 flex items-center justify-between">
|
|
50
|
-
<div class="flex items-center gap-3">
|
|
51
|
-
<input
|
|
52
|
-
v-model="search"
|
|
53
|
-
type="text"
|
|
54
|
-
placeholder="Search articles..."
|
|
55
|
-
class="rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] placeholder-[var(--esc-panel-text-muted)] focus:border-cyan-500/40 focus:outline-none focus:ring-1 focus:ring-cyan-500/40"
|
|
56
|
-
/>
|
|
57
|
-
<select
|
|
58
|
-
v-model="status"
|
|
59
|
-
class="rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-cyan-500/40 focus:outline-none focus:ring-1 focus:ring-cyan-500/40"
|
|
60
|
-
>
|
|
61
|
-
<option value="">All Statuses</option>
|
|
62
|
-
<option value="draft">Draft</option>
|
|
63
|
-
<option value="published">Published</option>
|
|
64
|
-
</select>
|
|
65
|
-
<select
|
|
66
|
-
v-model="categoryId"
|
|
67
|
-
class="rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-cyan-500/40 focus:outline-none focus:ring-1 focus:ring-cyan-500/40"
|
|
68
|
-
>
|
|
69
|
-
<option value="">All Categories</option>
|
|
70
|
-
<option v-for="cat in categories" :key="cat.id" :value="cat.id">{{ cat.name }}</option>
|
|
71
|
-
</select>
|
|
72
|
-
</div>
|
|
73
|
-
<Link
|
|
74
|
-
:href="route('escalated.admin.kb-articles.create')"
|
|
75
|
-
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-opacity hover:opacity-90"
|
|
76
|
-
>
|
|
77
|
-
New Article
|
|
78
|
-
</Link>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)]">
|
|
82
|
-
<table class="w-full">
|
|
83
|
-
<thead>
|
|
84
|
-
<tr class="border-b border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)]">
|
|
85
|
-
<th
|
|
86
|
-
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
87
|
-
>
|
|
88
|
-
Title
|
|
89
|
-
</th>
|
|
90
|
-
<th
|
|
91
|
-
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
92
|
-
>
|
|
93
|
-
Category
|
|
94
|
-
</th>
|
|
95
|
-
<th
|
|
96
|
-
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
97
|
-
>
|
|
98
|
-
Status
|
|
99
|
-
</th>
|
|
100
|
-
<th
|
|
101
|
-
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
102
|
-
>
|
|
103
|
-
Views
|
|
104
|
-
</th>
|
|
105
|
-
<th
|
|
106
|
-
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
107
|
-
>
|
|
108
|
-
Helpful
|
|
109
|
-
</th>
|
|
110
|
-
<th
|
|
111
|
-
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
112
|
-
>
|
|
113
|
-
Date
|
|
114
|
-
</th>
|
|
115
|
-
<th
|
|
116
|
-
class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
117
|
-
>
|
|
118
|
-
Actions
|
|
119
|
-
</th>
|
|
120
|
-
</tr>
|
|
121
|
-
</thead>
|
|
122
|
-
<tbody class="divide-y divide-[var(--esc-panel-border)]">
|
|
123
|
-
<tr v-for="article in articles.data" :key="article.id" class="hover:bg-[var(--esc-panel-hover)]">
|
|
124
|
-
<td class="px-4 py-3">
|
|
125
|
-
<Link
|
|
126
|
-
:href="route('escalated.admin.kb-articles.edit', article.id)"
|
|
127
|
-
class="text-sm font-medium text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
|
|
128
|
-
>
|
|
129
|
-
{{ article.title }}
|
|
130
|
-
</Link>
|
|
131
|
-
</td>
|
|
132
|
-
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
133
|
-
{{ article.category?.name || '—' }}
|
|
134
|
-
</td>
|
|
135
|
-
<td class="px-4 py-3">
|
|
136
|
-
<span
|
|
137
|
-
:class="[
|
|
138
|
-
'inline-flex rounded-full border px-2 py-0.5 text-xs font-medium',
|
|
139
|
-
statusColors[article.status] || 'text-[var(--esc-panel-text-tertiary)]',
|
|
140
|
-
]"
|
|
141
|
-
>
|
|
142
|
-
{{ article.status }}
|
|
143
|
-
</span>
|
|
144
|
-
</td>
|
|
145
|
-
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
146
|
-
{{ article.view_count }}
|
|
147
|
-
</td>
|
|
148
|
-
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
149
|
-
{{ article.helpful_count }}
|
|
150
|
-
</td>
|
|
151
|
-
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-muted)]">
|
|
152
|
-
{{ article.created_at ? new Date(article.created_at).toLocaleDateString() : '—' }}
|
|
153
|
-
</td>
|
|
154
|
-
<td class="px-4 py-3 text-right">
|
|
155
|
-
<Link
|
|
156
|
-
:href="route('escalated.admin.kb-articles.edit', article.id)"
|
|
157
|
-
class="mr-2 text-sm text-[var(--esc-panel-text-muted)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
158
|
-
>
|
|
159
|
-
Edit
|
|
160
|
-
</Link>
|
|
161
|
-
<button class="text-sm text-red-500/60 hover:text-red-400" @click="deleteArticle(article)">
|
|
162
|
-
Delete
|
|
163
|
-
</button>
|
|
164
|
-
</td>
|
|
165
|
-
</tr>
|
|
166
|
-
<tr v-if="!articles.data?.length">
|
|
167
|
-
<td colspan="7" class="px-4 py-8 text-center text-sm text-[var(--esc-panel-text-muted)]">
|
|
168
|
-
No articles found.
|
|
169
|
-
</td>
|
|
170
|
-
</tr>
|
|
171
|
-
</tbody>
|
|
172
|
-
</table>
|
|
173
|
-
</div>
|
|
174
|
-
|
|
175
|
-
<!-- Pagination -->
|
|
176
|
-
<div v-if="articles.links && articles.last_page > 1" class="mt-4 flex items-center justify-center gap-1">
|
|
177
|
-
<Link
|
|
178
|
-
v-for="link in articles.links"
|
|
179
|
-
:key="link.label"
|
|
180
|
-
:href="link.url || '#'"
|
|
181
|
-
:class="[
|
|
182
|
-
'rounded-lg px-3 py-1.5 text-sm transition-colors',
|
|
183
|
-
link.active
|
|
184
|
-
? 'bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] text-white'
|
|
185
|
-
: link.url
|
|
186
|
-
? 'border border-[var(--esc-panel-border)] text-[var(--esc-panel-text-tertiary)] hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]'
|
|
187
|
-
: 'cursor-default text-[var(--esc-panel-text-muted)]',
|
|
188
|
-
]"
|
|
189
|
-
preserve-scroll
|
|
190
|
-
>
|
|
191
|
-
<!-- eslint-disable-next-line vue/no-v-html --><span v-html="link.label" />
|
|
192
|
-
</Link>
|
|
193
|
-
</div>
|
|
194
|
-
</EscalatedLayout>
|
|
195
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import EscalatedLayout from '../../../../components/EscalatedLayout.vue';
|
|
3
|
+
import { router } from '@inertiajs/vue3';
|
|
4
|
+
import { ref, watch } from 'vue';
|
|
5
|
+
import { Link } from '@inertiajs/vue3';
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
articles: Object,
|
|
9
|
+
categories: Array,
|
|
10
|
+
filters: Object,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const search = ref(props.filters?.search || '');
|
|
14
|
+
const status = ref(props.filters?.status || '');
|
|
15
|
+
const categoryId = ref(props.filters?.category_id || '');
|
|
16
|
+
|
|
17
|
+
let debounceTimer;
|
|
18
|
+
function applyFilters() {
|
|
19
|
+
clearTimeout(debounceTimer);
|
|
20
|
+
debounceTimer = setTimeout(() => {
|
|
21
|
+
router.get(
|
|
22
|
+
route('escalated.admin.kb-articles.index'),
|
|
23
|
+
{
|
|
24
|
+
search: search.value || undefined,
|
|
25
|
+
status: status.value || undefined,
|
|
26
|
+
category_id: categoryId.value || undefined,
|
|
27
|
+
},
|
|
28
|
+
{ preserveState: true, preserveScroll: true },
|
|
29
|
+
);
|
|
30
|
+
}, 300);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
watch([search, status, categoryId], applyFilters);
|
|
34
|
+
|
|
35
|
+
function deleteArticle(article) {
|
|
36
|
+
if (confirm('Delete this article?')) {
|
|
37
|
+
router.delete(route('escalated.admin.kb-articles.destroy', article.id));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const statusColors = {
|
|
42
|
+
published: 'bg-emerald-500/10 text-emerald-400 border-emerald-500/20',
|
|
43
|
+
draft: 'bg-amber-500/10 text-amber-400 border-amber-500/20',
|
|
44
|
+
};
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<EscalatedLayout title="Knowledge Base — Articles">
|
|
49
|
+
<div class="mb-6 flex items-center justify-between">
|
|
50
|
+
<div class="flex items-center gap-3">
|
|
51
|
+
<input
|
|
52
|
+
v-model="search"
|
|
53
|
+
type="text"
|
|
54
|
+
placeholder="Search articles..."
|
|
55
|
+
class="rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] placeholder-[var(--esc-panel-text-muted)] focus:border-cyan-500/40 focus:outline-none focus:ring-1 focus:ring-cyan-500/40"
|
|
56
|
+
/>
|
|
57
|
+
<select
|
|
58
|
+
v-model="status"
|
|
59
|
+
class="rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-cyan-500/40 focus:outline-none focus:ring-1 focus:ring-cyan-500/40"
|
|
60
|
+
>
|
|
61
|
+
<option value="">All Statuses</option>
|
|
62
|
+
<option value="draft">Draft</option>
|
|
63
|
+
<option value="published">Published</option>
|
|
64
|
+
</select>
|
|
65
|
+
<select
|
|
66
|
+
v-model="categoryId"
|
|
67
|
+
class="rounded-lg border border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)] px-3 py-2 text-sm text-[var(--esc-panel-text-secondary)] focus:border-cyan-500/40 focus:outline-none focus:ring-1 focus:ring-cyan-500/40"
|
|
68
|
+
>
|
|
69
|
+
<option value="">All Categories</option>
|
|
70
|
+
<option v-for="cat in categories" :key="cat.id" :value="cat.id">{{ cat.name }}</option>
|
|
71
|
+
</select>
|
|
72
|
+
</div>
|
|
73
|
+
<Link
|
|
74
|
+
:href="route('escalated.admin.kb-articles.create')"
|
|
75
|
+
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-opacity hover:opacity-90"
|
|
76
|
+
>
|
|
77
|
+
New Article
|
|
78
|
+
</Link>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="overflow-hidden rounded-xl border border-[var(--esc-panel-border)]">
|
|
82
|
+
<table class="w-full">
|
|
83
|
+
<thead>
|
|
84
|
+
<tr class="border-b border-[var(--esc-panel-border)] bg-[var(--esc-panel-hover)]">
|
|
85
|
+
<th
|
|
86
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
87
|
+
>
|
|
88
|
+
Title
|
|
89
|
+
</th>
|
|
90
|
+
<th
|
|
91
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
92
|
+
>
|
|
93
|
+
Category
|
|
94
|
+
</th>
|
|
95
|
+
<th
|
|
96
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
97
|
+
>
|
|
98
|
+
Status
|
|
99
|
+
</th>
|
|
100
|
+
<th
|
|
101
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
102
|
+
>
|
|
103
|
+
Views
|
|
104
|
+
</th>
|
|
105
|
+
<th
|
|
106
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
107
|
+
>
|
|
108
|
+
Helpful
|
|
109
|
+
</th>
|
|
110
|
+
<th
|
|
111
|
+
class="px-4 py-3 text-left text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
112
|
+
>
|
|
113
|
+
Date
|
|
114
|
+
</th>
|
|
115
|
+
<th
|
|
116
|
+
class="px-4 py-3 text-right text-xs font-medium uppercase tracking-wider text-[var(--esc-panel-text-muted)]"
|
|
117
|
+
>
|
|
118
|
+
Actions
|
|
119
|
+
</th>
|
|
120
|
+
</tr>
|
|
121
|
+
</thead>
|
|
122
|
+
<tbody class="divide-y divide-[var(--esc-panel-border)]">
|
|
123
|
+
<tr v-for="article in articles.data" :key="article.id" class="hover:bg-[var(--esc-panel-hover)]">
|
|
124
|
+
<td class="px-4 py-3">
|
|
125
|
+
<Link
|
|
126
|
+
:href="route('escalated.admin.kb-articles.edit', article.id)"
|
|
127
|
+
class="text-sm font-medium text-[var(--esc-panel-text-secondary)] hover:text-[var(--esc-panel-text)]"
|
|
128
|
+
>
|
|
129
|
+
{{ article.title }}
|
|
130
|
+
</Link>
|
|
131
|
+
</td>
|
|
132
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
133
|
+
{{ article.category?.name || '—' }}
|
|
134
|
+
</td>
|
|
135
|
+
<td class="px-4 py-3">
|
|
136
|
+
<span
|
|
137
|
+
:class="[
|
|
138
|
+
'inline-flex rounded-full border px-2 py-0.5 text-xs font-medium',
|
|
139
|
+
statusColors[article.status] || 'text-[var(--esc-panel-text-tertiary)]',
|
|
140
|
+
]"
|
|
141
|
+
>
|
|
142
|
+
{{ article.status }}
|
|
143
|
+
</span>
|
|
144
|
+
</td>
|
|
145
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
146
|
+
{{ article.view_count }}
|
|
147
|
+
</td>
|
|
148
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-tertiary)]">
|
|
149
|
+
{{ article.helpful_count }}
|
|
150
|
+
</td>
|
|
151
|
+
<td class="px-4 py-3 text-sm text-[var(--esc-panel-text-muted)]">
|
|
152
|
+
{{ article.created_at ? new Date(article.created_at).toLocaleDateString() : '—' }}
|
|
153
|
+
</td>
|
|
154
|
+
<td class="px-4 py-3 text-right">
|
|
155
|
+
<Link
|
|
156
|
+
:href="route('escalated.admin.kb-articles.edit', article.id)"
|
|
157
|
+
class="mr-2 text-sm text-[var(--esc-panel-text-muted)] hover:text-[var(--esc-panel-text-secondary)]"
|
|
158
|
+
>
|
|
159
|
+
Edit
|
|
160
|
+
</Link>
|
|
161
|
+
<button class="text-sm text-red-500/60 hover:text-red-400" @click="deleteArticle(article)">
|
|
162
|
+
Delete
|
|
163
|
+
</button>
|
|
164
|
+
</td>
|
|
165
|
+
</tr>
|
|
166
|
+
<tr v-if="!articles.data?.length">
|
|
167
|
+
<td colspan="7" class="px-4 py-8 text-center text-sm text-[var(--esc-panel-text-muted)]">
|
|
168
|
+
No articles found.
|
|
169
|
+
</td>
|
|
170
|
+
</tr>
|
|
171
|
+
</tbody>
|
|
172
|
+
</table>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<!-- Pagination -->
|
|
176
|
+
<div v-if="articles.links && articles.last_page > 1" class="mt-4 flex items-center justify-center gap-1">
|
|
177
|
+
<Link
|
|
178
|
+
v-for="link in articles.links"
|
|
179
|
+
:key="link.label"
|
|
180
|
+
:href="link.url || '#'"
|
|
181
|
+
:class="[
|
|
182
|
+
'rounded-lg px-3 py-1.5 text-sm transition-colors',
|
|
183
|
+
link.active
|
|
184
|
+
? 'bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] text-white'
|
|
185
|
+
: link.url
|
|
186
|
+
? 'border border-[var(--esc-panel-border)] text-[var(--esc-panel-text-tertiary)] hover:bg-[var(--esc-panel-hover)] hover:text-[var(--esc-panel-text-secondary)]'
|
|
187
|
+
: 'cursor-default text-[var(--esc-panel-text-muted)]',
|
|
188
|
+
]"
|
|
189
|
+
preserve-scroll
|
|
190
|
+
>
|
|
191
|
+
<!-- eslint-disable-next-line vue/no-v-html --><span v-html="link.label" />
|
|
192
|
+
</Link>
|
|
193
|
+
</div>
|
|
194
|
+
</EscalatedLayout>
|
|
195
|
+
</template>
|