From 3002ae593c591ccfee5c089a41aba3fcc605246a Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Sat, 8 Jun 2024 14:18:19 +0200 Subject: [PATCH] Fixed crash with function stringify --- components/calendar/Calendar.vue | 17 ++++++++++++++--- components/calendar/CalendarEvent.vue | 2 +- components/global/sidebar/Sidebar.vue | 10 +++++++++- components/global/sidebar/SidebarProps.ts | 4 +++- pages/calendar/[id].vue | 13 ------------- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/components/calendar/Calendar.vue b/components/calendar/Calendar.vue index 202e877..950b36b 100644 --- a/components/calendar/Calendar.vue +++ b/components/calendar/Calendar.vue @@ -2,6 +2,7 @@ import { useCalendar } from '@/stores/CalendarStore' import { computed, type Component, type ComputedRef } from 'vue' +import { PhMagnifyingGlass } from '@phosphor-icons/vue' import MonthlyLayout from './state/monthly/Layout.vue' import CenturyLayout from './state/centennially/Layout.vue' import DecadeLayout from './state/decennially/Layout.vue' @@ -85,8 +86,18 @@ const currentViewComponent: ComputedRef = computed(() => { } }) +const { setCurrentMenu } = useUiStore() + onMounted(() => { jumpToDate(selectedDate) + + setCurrentMenu([ + { + phIcon: PhMagnifyingGlass, + tooltip: 'Recherche avancée', + action: 'event-search' + } + ]) }) @@ -107,8 +118,8 @@ onMounted(() => { - - - + + + diff --git a/components/calendar/CalendarEvent.vue b/components/calendar/CalendarEvent.vue index 2127b68..03e1795 100644 --- a/components/calendar/CalendarEvent.vue +++ b/components/calendar/CalendarEvent.vue @@ -65,7 +65,7 @@ function handleClosePopover() { - import { PhHouse, PhList } from '@phosphor-icons/vue' +import type { SidebarMenuActionType } from './SidebarProps'; +const { revealAdvancedSearch } = useCalendar() const { currentMenu } = storeToRefs(useUiStore()) + +function handleMenuItemAction(actionType: SidebarMenuActionType) { + if (actionType === 'event-search') { + revealAdvancedSearch() + } +}