Skip to content

Commit bdb0c54

Browse files
committed
Remove category filtering and fix critical navigation bug
- Remove category filtering in realtime agent to show ALL 10 templates instead of 6 - Update template filtering logic to include team_meeting and strategic categories - Fix critical 404 bug in TemplateForm.vue cancel function (was navigating to deleted route) - Update cancel navigation from /realtime-agent/settings to /templates - Simplify template selection with cleaner variable names (allTemplates, filteredTemplates) Resolves navigation issues and provides access to complete template library.
1 parent a973a90 commit bdb0c54

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

resources/js/pages/RealtimeAgent/Main.vue

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@
6969
<div
7070
class="scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent hover:scrollbar-thumb-gray-400 flex-1 overflow-y-auto"
7171
>
72-
<div v-if="filteredCoachingTemplates.length === 0" class="p-3 text-center text-xs text-gray-600 dark:text-gray-400">
72+
<div v-if="filteredTemplates.length === 0" class="p-3 text-center text-xs text-gray-600 dark:text-gray-400">
7373
No templates found
7474
</div>
7575
<div
76-
v-for="template in filteredCoachingTemplates"
76+
v-for="template in filteredTemplates"
7777
:key="template.id"
7878
@click="
7979
selectTemplateFromDropdown(template);
@@ -251,11 +251,11 @@
251251
@click.stop
252252
/>
253253
<div class="max-h-36 overflow-y-auto">
254-
<div v-if="filteredCoachingTemplates.length === 0" class="p-2 text-center text-xs text-gray-600 dark:text-gray-400">
254+
<div v-if="filteredTemplates.length === 0" class="p-2 text-center text-xs text-gray-600 dark:text-gray-400">
255255
No templates found
256256
</div>
257257
<button
258-
v-for="template in filteredCoachingTemplates"
258+
v-for="template in filteredTemplates"
259259
:key="template.id"
260260
@click.stop="
261261
selectTemplateFromDropdown(template);
@@ -902,19 +902,17 @@ const { isOverlayMode, isSupported: isOverlaySupported, toggleOverlayMode } = us
902902
const hasApiKey = ref(false); // Will be checked on mount
903903
// const isDev = computed(() => import.meta.env.DEV)
904904
905-
// Coaching templates filtered - expanded to include more relevant categories
906-
const coachingTemplates = computed(() => {
907-
// Include multiple relevant categories for broader template selection
908-
const relevantCategories = ['sales_coach', 'customer_success', 'executive', 'support', 'partnership', 'technical'];
909-
return templates.value.filter((t) => relevantCategories.includes(t.category));
905+
// All available templates (no category filtering)
906+
const allTemplates = computed(() => {
907+
return templates.value;
910908
});
911909
912910
// Filtered templates based on search
913-
const filteredCoachingTemplates = computed(() => {
914-
if (!templateSearchQuery.value) return coachingTemplates.value;
911+
const filteredTemplates = computed(() => {
912+
if (!templateSearchQuery.value) return allTemplates.value;
915913
916914
const query = templateSearchQuery.value.toLowerCase();
917-
return coachingTemplates.value.filter((t) => t.name.toLowerCase().includes(query) || t.description?.toLowerCase().includes(query));
915+
return allTemplates.value.filter((t) => t.name.toLowerCase().includes(query) || t.description?.toLowerCase().includes(query));
918916
});
919917
920918
// New computed properties for intelligence dashboard
@@ -2512,10 +2510,8 @@ const fetchTemplates = async () => {
25122510
25132511
console.log(`✅ Loaded ${templates.value.length} templates`);
25142512
console.log(
2515-
'Available coaching templates:',
2516-
templates.value
2517-
.filter((t) => ['sales_coach', 'customer_success', 'executive', 'support', 'partnership', 'technical'].includes(t.category))
2518-
.map((t) => t.name),
2513+
'Available templates:',
2514+
templates.value.map((t) => t.name),
25192515
);
25202516
25212517
// Load persisted template or select default
@@ -2530,9 +2526,8 @@ const fetchTemplates = async () => {
25302526
25312527
// Select default template if none selected
25322528
if (!selectedTemplate.value && templates.value.length > 0) {
2533-
// Try to find the Sales Discovery Call template as default, otherwise use first available coaching template
2534-
const defaultTemplate =
2535-
templates.value.find((t) => t.name === 'Sales Discovery Call') || coachingTemplates.value[0] || templates.value[0];
2529+
// Try to find the Sales Discovery Call template as default, otherwise use first available template
2530+
const defaultTemplate = templates.value.find((t) => t.name === 'Sales Discovery Call') || templates.value[0];
25362531
if (defaultTemplate) {
25372532
selectedTemplate.value = defaultTemplate;
25382533
console.log('📌 Selected default template:', defaultTemplate.name);

resources/js/pages/RealtimeAgent/TemplateForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const saveTemplate = async () => {
142142
};
143143
144144
const cancel = () => {
145-
router.visit('/realtime-agent/settings');
145+
router.visit('/templates');
146146
};
147147
</script>
148148

0 commit comments

Comments
 (0)