@escalated-dev/escalated 0.8.0 → 0.11.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.
- package/LICENSE +21 -21
- package/README.md +388 -361
- package/package.json +85 -84
- package/src/components/ActiveChatsPanel.vue +246 -246
- package/src/components/AdminDashboard.stories.js +1423 -1423
- package/src/components/AttachmentList.vue +65 -65
- package/src/components/ChatActionBar.vue +226 -226
- package/src/components/ChatBubble.vue +162 -162
- package/src/components/ChatComposer.vue +308 -308
- package/src/components/ChatQueue.vue +222 -222
- package/src/components/ChatThread.vue +197 -197
- package/src/components/CustomTicketActions.stories.js +71 -0
- package/src/components/CustomTicketActions.vue +101 -0
- package/src/components/EscalatedLayout.vue +628 -604
- package/src/components/FollowButton.vue +20 -1
- package/src/components/MentionDropdown.vue +154 -154
- package/src/components/MetricComparison.vue +89 -89
- package/src/components/PercentileChart.vue +67 -67
- package/src/components/PeriodSelector.vue +98 -98
- package/src/components/PresenceIndicator.vue +228 -213
- package/src/components/ReplyComposer.vue +336 -336
- package/src/components/ReplyThread.vue +153 -153
- package/src/components/ReportChart.vue +395 -395
- package/src/components/ReportExportButton.vue +108 -108
- package/src/components/SaveViewDialog.vue +172 -172
- package/src/components/SavedViewSidebar.vue +208 -208
- package/src/components/SkillTagManager.vue +3 -0
- package/src/components/SnoozeButton.vue +247 -247
- package/src/components/TicketFilters.vue +270 -270
- package/src/components/TicketList.vue +655 -655
- package/src/components/TicketSidebar.vue +4 -0
- package/src/components/TicketSplitDialog.vue +98 -98
- package/src/components/TicketSubjects.stories.js +63 -0
- package/src/components/TicketSubjects.vue +107 -0
- package/src/components/TwoFactorSetup.vue +1 -37
- package/src/components/VariableTokenInput.vue +111 -111
- package/src/components/WorkflowActionConfig.vue +287 -287
- package/src/components/WorkflowActionList.vue +350 -350
- package/src/components/WorkflowConditionBuilder.vue +265 -265
- package/src/components/WorkflowTriggerSelector.vue +125 -125
- package/src/components/admin/newsletters/AnalyticsTiles.stories.js +14 -0
- package/src/components/admin/newsletters/AnalyticsTiles.vue +55 -0
- package/src/components/admin/newsletters/DeliveriesTable.stories.js +28 -0
- package/src/components/admin/newsletters/DeliveriesTable.vue +104 -0
- package/src/components/admin/newsletters/DynamicFilterBuilder.stories.js +11 -0
- package/src/components/admin/newsletters/DynamicFilterBuilder.vue +53 -0
- package/src/components/admin/newsletters/ListMemberTable.stories.js +12 -0
- package/src/components/admin/newsletters/ListMemberTable.vue +53 -0
- package/src/components/admin/newsletters/MarkdownEditor.stories.js +6 -0
- package/src/components/admin/newsletters/MarkdownEditor.vue +53 -0
- package/src/components/admin/newsletters/MergeFieldDropdown.stories.js +6 -0
- package/src/components/admin/newsletters/MergeFieldDropdown.vue +84 -0
- package/src/components/admin/newsletters/PreviewIframe.stories.js +7 -0
- package/src/components/admin/newsletters/PreviewIframe.vue +40 -0
- package/src/components/admin/newsletters/SummaryTiles.stories.js +8 -0
- package/src/components/admin/newsletters/SummaryTiles.vue +63 -0
- package/src/composables/useChat.js +187 -187
- package/src/composables/useI18n.js +102 -102
- package/src/composables/useMentions.js +134 -134
- package/src/composables/usePermissions.js +31 -0
- package/src/composables/useRealtime.js +182 -182
- package/src/index.js +85 -84
- package/src/locales/README.md +13 -13
- package/src/locales/ar.json +727 -727
- package/src/locales/de.json +690 -690
- package/src/locales/en.json +889 -729
- package/src/locales/es.json +691 -691
- package/src/locales/fr.json +691 -691
- package/src/locales/index.js +16 -16
- package/src/locales/it.json +727 -727
- package/src/locales/ja.json +727 -727
- package/src/locales/ko.json +727 -727
- package/src/locales/nl.json +727 -727
- package/src/locales/pl.json +727 -727
- package/src/locales/pt-BR.json +727 -727
- package/src/locales/ru.json +727 -727
- package/src/locales/tr.json +727 -727
- package/src/locales/zh-CN.json +727 -727
- package/src/pages/Admin/Automations/Form.vue +280 -0
- package/src/pages/Admin/Automations/Index.vue +230 -0
- package/src/pages/Admin/Newsletters/Compose.vue +192 -0
- package/src/pages/Admin/Newsletters/Edit.vue +24 -0
- package/src/pages/Admin/Newsletters/Index.vue +141 -0
- package/src/pages/Admin/Newsletters/Lists/Create.vue +64 -0
- package/src/pages/Admin/Newsletters/Lists/Index.vue +59 -0
- package/src/pages/Admin/Newsletters/Lists/Show.vue +53 -0
- package/src/pages/Admin/Newsletters/Settings.vue +85 -0
- package/src/pages/Admin/Newsletters/Show.vue +140 -0
- package/src/pages/Admin/Newsletters/Templates/Create.vue +11 -0
- package/src/pages/Admin/Newsletters/Templates/Index.vue +54 -0
- package/src/pages/Admin/Newsletters/Templates/Show.vue +65 -0
- package/src/pages/Admin/Newsletters/usePreview.js +44 -0
- package/src/pages/Admin/Plugins/Index.vue +10 -2
- package/src/pages/Admin/Reports/AgentDetail.vue +132 -132
- package/src/pages/Admin/Reports/AgentRanking.vue +246 -246
- package/src/pages/Admin/Reports/Cohorts.vue +180 -180
- package/src/pages/Admin/Reports/Comparison.vue +141 -141
- package/src/pages/Admin/Reports/Dashboard.vue +226 -226
- package/src/pages/Admin/Reports/ResolutionTimes.vue +164 -164
- package/src/pages/Admin/Reports/ResponseTimes.vue +164 -164
- package/src/pages/Admin/Reports/SlaTrends.vue +183 -183
- package/src/pages/Admin/Settings/DatabaseConnection.vue +228 -0
- package/src/pages/Admin/Settings/PublicTickets.vue +163 -0
- package/src/pages/Admin/Settings/SsoSettings.vue +157 -4
- package/src/pages/Admin/Settings/TwoFactor.vue +32 -6
- package/src/pages/Admin/Settings.vue +1008 -1008
- package/src/pages/Admin/Skills/Form.vue +30 -10
- package/src/pages/Admin/Tickets/Index.vue +126 -126
- package/src/pages/Admin/Tickets/Show.vue +254 -249
- package/src/pages/Admin/Users/Index.vue +145 -145
- package/src/pages/Admin/Webhooks/DeliveryLog.vue +1 -2
- package/src/pages/Admin/Workflows/Builder.vue +207 -207
- package/src/pages/Admin/Workflows/Form.vue +24 -0
- package/src/pages/Admin/Workflows/Index.vue +235 -235
- package/src/pages/Admin/Workflows/Logs.vue +286 -286
- package/src/pages/Agent/TicketIndex.vue +112 -112
- package/src/pages/Agent/TicketShow.vue +547 -494
- package/src/pages/Customer/Index.vue +56 -56
- package/src/pages/Customer/KnowledgeBase/Article.vue +129 -129
- package/src/pages/Plugin/Page.vue +61 -0
- package/src/plugin.js +175 -175
- package/src/utils/mentionHighlight.js +24 -24
- package/src/widget/EscalatedWidget.vue +804 -804
- package/src/widget/index.js +254 -254
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import EscalatedLayout from '../../../components/EscalatedLayout.vue';
|
|
3
|
-
import WorkflowTriggerSelector from '../../../components/WorkflowTriggerSelector.vue';
|
|
4
|
-
import WorkflowConditionBuilder from '../../../components/WorkflowConditionBuilder.vue';
|
|
5
|
-
import WorkflowActionList from '../../../components/WorkflowActionList.vue';
|
|
6
|
-
import { useForm } from '@inertiajs/vue3';
|
|
7
|
-
import { ref, computed } from 'vue';
|
|
8
|
-
|
|
9
|
-
const props = defineProps({
|
|
10
|
-
workflow: { type: Object, default: null },
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const form = useForm({
|
|
14
|
-
name: props.workflow?.name || '',
|
|
15
|
-
description: props.workflow?.description || '',
|
|
16
|
-
trigger: props.workflow?.trigger || '',
|
|
17
|
-
conditions: props.workflow?.conditions || { match: 'all', conditions: [] },
|
|
18
|
-
actions: props.workflow?.actions || [],
|
|
19
|
-
active: props.workflow?.active ?? true,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const expandedStep = ref(props.workflow ? null : 1);
|
|
23
|
-
|
|
24
|
-
function toggleStep(step) {
|
|
25
|
-
expandedStep.value = expandedStep.value === step ? null : step;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function submit() {
|
|
29
|
-
if (props.workflow) {
|
|
30
|
-
form.put(route('escalated.admin.workflows.update', props.workflow.id));
|
|
31
|
-
} else {
|
|
32
|
-
form.post(route('escalated.admin.workflows.store'));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const isValid = computed(() => {
|
|
37
|
-
return form.name && form.trigger && form.actions.length > 0;
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const stepBorderColors = {
|
|
41
|
-
1: 'border-l-blue-500',
|
|
42
|
-
2: 'border-l-amber-500',
|
|
43
|
-
3: 'border-l-emerald-500',
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const stepDotColors = {
|
|
47
|
-
1: 'bg-blue-500',
|
|
48
|
-
2: 'bg-amber-500',
|
|
49
|
-
3: 'bg-emerald-500',
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const stepLabels = {
|
|
53
|
-
1: 'Trigger Event',
|
|
54
|
-
2: 'Conditions',
|
|
55
|
-
3: 'Actions',
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const stepDescriptions = {
|
|
59
|
-
1: 'When this happens...',
|
|
60
|
-
2: 'Only if these conditions are met...',
|
|
61
|
-
3: 'Then do this...',
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
function stepHasData(step) {
|
|
65
|
-
switch (step) {
|
|
66
|
-
case 1:
|
|
67
|
-
return !!form.trigger;
|
|
68
|
-
case 2:
|
|
69
|
-
return form.conditions?.conditions?.length > 0;
|
|
70
|
-
case 3:
|
|
71
|
-
return form.actions?.length > 0;
|
|
72
|
-
default:
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
</script>
|
|
77
|
-
|
|
78
|
-
<template>
|
|
79
|
-
<EscalatedLayout :title="workflow ? 'Edit Workflow' : 'Create Workflow'">
|
|
80
|
-
<form class="mx-auto max-w-3xl space-y-6" @submit.prevent="submit">
|
|
81
|
-
<!-- Header -->
|
|
82
|
-
<div class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6">
|
|
83
|
-
<div class="space-y-4">
|
|
84
|
-
<div>
|
|
85
|
-
<label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
|
|
86
|
-
>Workflow Name</label
|
|
87
|
-
>
|
|
88
|
-
<input
|
|
89
|
-
v-model="form.name"
|
|
90
|
-
type="text"
|
|
91
|
-
required
|
|
92
|
-
placeholder="e.g. Auto-assign urgent tickets"
|
|
93
|
-
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)]"
|
|
94
|
-
/>
|
|
95
|
-
<p v-if="form.errors.name" class="mt-1 text-xs text-rose-400">{{ form.errors.name }}</p>
|
|
96
|
-
</div>
|
|
97
|
-
<div>
|
|
98
|
-
<label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
|
|
99
|
-
>Description</label
|
|
100
|
-
>
|
|
101
|
-
<textarea
|
|
102
|
-
v-model="form.description"
|
|
103
|
-
rows="2"
|
|
104
|
-
placeholder="What does this workflow do?"
|
|
105
|
-
class="mt-1 w-full resize-y 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)]"
|
|
106
|
-
/>
|
|
107
|
-
</div>
|
|
108
|
-
<div>
|
|
109
|
-
<label class="flex items-center gap-2 text-sm text-[var(--esc-panel-text-secondary)]">
|
|
110
|
-
<input
|
|
111
|
-
v-model="form.active"
|
|
112
|
-
type="checkbox"
|
|
113
|
-
class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] text-cyan-500 focus:ring-cyan-500/20"
|
|
114
|
-
/>
|
|
115
|
-
Active
|
|
116
|
-
</label>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
<!-- Steps -->
|
|
122
|
-
<div class="relative space-y-4">
|
|
123
|
-
<!-- Vertical connector line -->
|
|
124
|
-
<div class="absolute top-0 bottom-0 left-6 w-px bg-[var(--esc-panel-border)]" />
|
|
125
|
-
|
|
126
|
-
<!-- Step 1: Trigger -->
|
|
127
|
-
<div
|
|
128
|
-
v-for="step in [1, 2, 3]"
|
|
129
|
-
:key="step"
|
|
130
|
-
class="relative rounded-xl border border-[var(--esc-panel-border)] border-l-4 bg-[var(--esc-panel-surface)] transition-all"
|
|
131
|
-
:class="stepBorderColors[step]"
|
|
132
|
-
>
|
|
133
|
-
<!-- Step dot -->
|
|
134
|
-
<div
|
|
135
|
-
class="absolute -left-[11px] top-4 flex h-5 w-5 items-center justify-center rounded-full"
|
|
136
|
-
:class="stepDotColors[step]"
|
|
137
|
-
>
|
|
138
|
-
<span v-if="stepHasData(step)" class="text-[10px] font-bold text-white">
|
|
139
|
-
<svg class="h-3 w-3" fill="none" stroke="currentColor" stroke-width="3" viewBox="0 0 24 24">
|
|
140
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
|
|
141
|
-
</svg>
|
|
142
|
-
</span>
|
|
143
|
-
<span v-else class="text-[10px] font-bold text-white">{{ step }}</span>
|
|
144
|
-
</div>
|
|
145
|
-
|
|
146
|
-
<!-- Step header -->
|
|
147
|
-
<button
|
|
148
|
-
type="button"
|
|
149
|
-
class="flex w-full items-center gap-3 px-6 py-4 text-left"
|
|
150
|
-
@click="toggleStep(step)"
|
|
151
|
-
>
|
|
152
|
-
<div class="flex-1">
|
|
153
|
-
<h3 class="text-sm font-semibold text-[var(--esc-panel-text-secondary)]">
|
|
154
|
-
{{ stepLabels[step] }}
|
|
155
|
-
<span
|
|
156
|
-
v-if="step === 2"
|
|
157
|
-
class="ml-1 text-xs font-normal text-[var(--esc-panel-text-muted)]"
|
|
158
|
-
>(optional)</span
|
|
159
|
-
>
|
|
160
|
-
</h3>
|
|
161
|
-
<p class="text-xs text-[var(--esc-panel-text-muted)]">{{ stepDescriptions[step] }}</p>
|
|
162
|
-
</div>
|
|
163
|
-
<svg
|
|
164
|
-
class="h-4 w-4 text-[var(--esc-panel-text-muted)] transition-transform"
|
|
165
|
-
:class="expandedStep === step ? 'rotate-180' : ''"
|
|
166
|
-
fill="none"
|
|
167
|
-
stroke="currentColor"
|
|
168
|
-
stroke-width="2"
|
|
169
|
-
viewBox="0 0 24 24"
|
|
170
|
-
>
|
|
171
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />
|
|
172
|
-
</svg>
|
|
173
|
-
</button>
|
|
174
|
-
|
|
175
|
-
<!-- Step content -->
|
|
176
|
-
<div v-if="expandedStep === step" class="border-t border-[var(--esc-panel-border)] px-6 py-4">
|
|
177
|
-
<!-- Trigger selector -->
|
|
178
|
-
<WorkflowTriggerSelector v-if="step === 1" v-model="form.trigger" />
|
|
179
|
-
|
|
180
|
-
<!-- Condition builder -->
|
|
181
|
-
<WorkflowConditionBuilder v-if="step === 2" v-model="form.conditions" />
|
|
182
|
-
|
|
183
|
-
<!-- Action list -->
|
|
184
|
-
<WorkflowActionList v-if="step === 3" v-model="form.actions" />
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
</div>
|
|
188
|
-
|
|
189
|
-
<!-- Footer buttons -->
|
|
190
|
-
<div class="flex items-center gap-3 pt-2">
|
|
191
|
-
<button
|
|
192
|
-
type="submit"
|
|
193
|
-
:disabled="form.processing || !isValid"
|
|
194
|
-
class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-6 py-2.5 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"
|
|
195
|
-
>
|
|
196
|
-
{{ form.processing ? 'Saving...' : workflow ? 'Update Workflow' : 'Create Workflow' }}
|
|
197
|
-
</button>
|
|
198
|
-
<a
|
|
199
|
-
:href="route('escalated.admin.workflows.index')"
|
|
200
|
-
class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] px-4 py-2.5 text-sm font-medium text-[var(--esc-panel-text-secondary)] transition-colors hover:bg-[var(--esc-panel-hover)]"
|
|
201
|
-
>
|
|
202
|
-
Cancel
|
|
203
|
-
</a>
|
|
204
|
-
</div>
|
|
205
|
-
</form>
|
|
206
|
-
</EscalatedLayout>
|
|
207
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import EscalatedLayout from '../../../components/EscalatedLayout.vue';
|
|
3
|
+
import WorkflowTriggerSelector from '../../../components/WorkflowTriggerSelector.vue';
|
|
4
|
+
import WorkflowConditionBuilder from '../../../components/WorkflowConditionBuilder.vue';
|
|
5
|
+
import WorkflowActionList from '../../../components/WorkflowActionList.vue';
|
|
6
|
+
import { useForm } from '@inertiajs/vue3';
|
|
7
|
+
import { ref, computed } from 'vue';
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
workflow: { type: Object, default: null },
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const form = useForm({
|
|
14
|
+
name: props.workflow?.name || '',
|
|
15
|
+
description: props.workflow?.description || '',
|
|
16
|
+
trigger: props.workflow?.trigger || '',
|
|
17
|
+
conditions: props.workflow?.conditions || { match: 'all', conditions: [] },
|
|
18
|
+
actions: props.workflow?.actions || [],
|
|
19
|
+
active: props.workflow?.active ?? true,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const expandedStep = ref(props.workflow ? null : 1);
|
|
23
|
+
|
|
24
|
+
function toggleStep(step) {
|
|
25
|
+
expandedStep.value = expandedStep.value === step ? null : step;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function submit() {
|
|
29
|
+
if (props.workflow) {
|
|
30
|
+
form.put(route('escalated.admin.workflows.update', props.workflow.id));
|
|
31
|
+
} else {
|
|
32
|
+
form.post(route('escalated.admin.workflows.store'));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const isValid = computed(() => {
|
|
37
|
+
return form.name && form.trigger && form.actions.length > 0;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const stepBorderColors = {
|
|
41
|
+
1: 'border-l-blue-500',
|
|
42
|
+
2: 'border-l-amber-500',
|
|
43
|
+
3: 'border-l-emerald-500',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const stepDotColors = {
|
|
47
|
+
1: 'bg-blue-500',
|
|
48
|
+
2: 'bg-amber-500',
|
|
49
|
+
3: 'bg-emerald-500',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const stepLabels = {
|
|
53
|
+
1: 'Trigger Event',
|
|
54
|
+
2: 'Conditions',
|
|
55
|
+
3: 'Actions',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const stepDescriptions = {
|
|
59
|
+
1: 'When this happens...',
|
|
60
|
+
2: 'Only if these conditions are met...',
|
|
61
|
+
3: 'Then do this...',
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
function stepHasData(step) {
|
|
65
|
+
switch (step) {
|
|
66
|
+
case 1:
|
|
67
|
+
return !!form.trigger;
|
|
68
|
+
case 2:
|
|
69
|
+
return form.conditions?.conditions?.length > 0;
|
|
70
|
+
case 3:
|
|
71
|
+
return form.actions?.length > 0;
|
|
72
|
+
default:
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<template>
|
|
79
|
+
<EscalatedLayout :title="workflow ? 'Edit Workflow' : 'Create Workflow'">
|
|
80
|
+
<form class="mx-auto max-w-3xl space-y-6" @submit.prevent="submit">
|
|
81
|
+
<!-- Header -->
|
|
82
|
+
<div class="rounded-xl border border-[var(--esc-panel-border)] bg-[var(--esc-panel-surface)] p-6">
|
|
83
|
+
<div class="space-y-4">
|
|
84
|
+
<div>
|
|
85
|
+
<label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
|
|
86
|
+
>Workflow Name</label
|
|
87
|
+
>
|
|
88
|
+
<input
|
|
89
|
+
v-model="form.name"
|
|
90
|
+
type="text"
|
|
91
|
+
required
|
|
92
|
+
placeholder="e.g. Auto-assign urgent tickets"
|
|
93
|
+
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)]"
|
|
94
|
+
/>
|
|
95
|
+
<p v-if="form.errors.name" class="mt-1 text-xs text-rose-400">{{ form.errors.name }}</p>
|
|
96
|
+
</div>
|
|
97
|
+
<div>
|
|
98
|
+
<label class="block text-sm font-medium text-[var(--esc-panel-text-secondary)]"
|
|
99
|
+
>Description</label
|
|
100
|
+
>
|
|
101
|
+
<textarea
|
|
102
|
+
v-model="form.description"
|
|
103
|
+
rows="2"
|
|
104
|
+
placeholder="What does this workflow do?"
|
|
105
|
+
class="mt-1 w-full resize-y 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)]"
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
<div>
|
|
109
|
+
<label class="flex items-center gap-2 text-sm text-[var(--esc-panel-text-secondary)]">
|
|
110
|
+
<input
|
|
111
|
+
v-model="form.active"
|
|
112
|
+
type="checkbox"
|
|
113
|
+
class="rounded border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-surface-alt)] text-cyan-500 focus:ring-cyan-500/20"
|
|
114
|
+
/>
|
|
115
|
+
Active
|
|
116
|
+
</label>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- Steps -->
|
|
122
|
+
<div class="relative space-y-4">
|
|
123
|
+
<!-- Vertical connector line -->
|
|
124
|
+
<div class="absolute top-0 bottom-0 left-6 w-px bg-[var(--esc-panel-border)]" />
|
|
125
|
+
|
|
126
|
+
<!-- Step 1: Trigger -->
|
|
127
|
+
<div
|
|
128
|
+
v-for="step in [1, 2, 3]"
|
|
129
|
+
:key="step"
|
|
130
|
+
class="relative rounded-xl border border-[var(--esc-panel-border)] border-l-4 bg-[var(--esc-panel-surface)] transition-all"
|
|
131
|
+
:class="stepBorderColors[step]"
|
|
132
|
+
>
|
|
133
|
+
<!-- Step dot -->
|
|
134
|
+
<div
|
|
135
|
+
class="absolute -left-[11px] top-4 flex h-5 w-5 items-center justify-center rounded-full"
|
|
136
|
+
:class="stepDotColors[step]"
|
|
137
|
+
>
|
|
138
|
+
<span v-if="stepHasData(step)" class="text-[10px] font-bold text-white">
|
|
139
|
+
<svg class="h-3 w-3" fill="none" stroke="currentColor" stroke-width="3" viewBox="0 0 24 24">
|
|
140
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
|
|
141
|
+
</svg>
|
|
142
|
+
</span>
|
|
143
|
+
<span v-else class="text-[10px] font-bold text-white">{{ step }}</span>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<!-- Step header -->
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
class="flex w-full items-center gap-3 px-6 py-4 text-left"
|
|
150
|
+
@click="toggleStep(step)"
|
|
151
|
+
>
|
|
152
|
+
<div class="flex-1">
|
|
153
|
+
<h3 class="text-sm font-semibold text-[var(--esc-panel-text-secondary)]">
|
|
154
|
+
{{ stepLabels[step] }}
|
|
155
|
+
<span
|
|
156
|
+
v-if="step === 2"
|
|
157
|
+
class="ml-1 text-xs font-normal text-[var(--esc-panel-text-muted)]"
|
|
158
|
+
>(optional)</span
|
|
159
|
+
>
|
|
160
|
+
</h3>
|
|
161
|
+
<p class="text-xs text-[var(--esc-panel-text-muted)]">{{ stepDescriptions[step] }}</p>
|
|
162
|
+
</div>
|
|
163
|
+
<svg
|
|
164
|
+
class="h-4 w-4 text-[var(--esc-panel-text-muted)] transition-transform"
|
|
165
|
+
:class="expandedStep === step ? 'rotate-180' : ''"
|
|
166
|
+
fill="none"
|
|
167
|
+
stroke="currentColor"
|
|
168
|
+
stroke-width="2"
|
|
169
|
+
viewBox="0 0 24 24"
|
|
170
|
+
>
|
|
171
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />
|
|
172
|
+
</svg>
|
|
173
|
+
</button>
|
|
174
|
+
|
|
175
|
+
<!-- Step content -->
|
|
176
|
+
<div v-if="expandedStep === step" class="border-t border-[var(--esc-panel-border)] px-6 py-4">
|
|
177
|
+
<!-- Trigger selector -->
|
|
178
|
+
<WorkflowTriggerSelector v-if="step === 1" v-model="form.trigger" />
|
|
179
|
+
|
|
180
|
+
<!-- Condition builder -->
|
|
181
|
+
<WorkflowConditionBuilder v-if="step === 2" v-model="form.conditions" />
|
|
182
|
+
|
|
183
|
+
<!-- Action list -->
|
|
184
|
+
<WorkflowActionList v-if="step === 3" v-model="form.actions" />
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<!-- Footer buttons -->
|
|
190
|
+
<div class="flex items-center gap-3 pt-2">
|
|
191
|
+
<button
|
|
192
|
+
type="submit"
|
|
193
|
+
:disabled="form.processing || !isValid"
|
|
194
|
+
class="rounded-lg bg-gradient-to-r from-[var(--esc-panel-accent)] to-[var(--esc-panel-accent-secondary)] px-6 py-2.5 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"
|
|
195
|
+
>
|
|
196
|
+
{{ form.processing ? 'Saving...' : workflow ? 'Update Workflow' : 'Create Workflow' }}
|
|
197
|
+
</button>
|
|
198
|
+
<a
|
|
199
|
+
:href="route('escalated.admin.workflows.index')"
|
|
200
|
+
class="rounded-lg border border-[var(--esc-panel-border-input)] bg-[var(--esc-panel-hover)] px-4 py-2.5 text-sm font-medium text-[var(--esc-panel-text-secondary)] transition-colors hover:bg-[var(--esc-panel-hover)]"
|
|
201
|
+
>
|
|
202
|
+
Cancel
|
|
203
|
+
</a>
|
|
204
|
+
</div>
|
|
205
|
+
</form>
|
|
206
|
+
</EscalatedLayout>
|
|
207
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import Builder from './Builder.vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The workflow editor, under the name the backends render.
|
|
6
|
+
*
|
|
7
|
+
* Builder.vue is the editor itself and takes exactly these props. Several
|
|
8
|
+
* backends render `Escalated/Admin/Workflows/Form` for both create and edit,
|
|
9
|
+
* and a page name with no component behind it is not an error in Inertia --
|
|
10
|
+
* the panel simply comes up blank. This is that name.
|
|
11
|
+
*/
|
|
12
|
+
defineProps({
|
|
13
|
+
workflow: { type: Object, default: null },
|
|
14
|
+
|
|
15
|
+
// Passed by the backends alongside the workflow. Builder derives its own
|
|
16
|
+
// trigger list, so this is accepted rather than forwarded; declaring it
|
|
17
|
+
// keeps it out of the fallthrough attributes.
|
|
18
|
+
triggerEvents: { type: [Array, Object], default: null },
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<Builder :workflow="workflow" />
|
|
24
|
+
</template>
|