From 5332b4c9c4dddc32385bb70c1137502d0c06329b Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Sun, 2 Jun 2024 10:35:18 +0200 Subject: [PATCH] Updated form component I'll need to refactor this to a Calendar level component --- components/calendar/CalendarEventDetails.vue | 104 ++++++++++--------- components/calendar/form/UpdateEvent.vue | 100 ++++++++++++++++++ 2 files changed, 153 insertions(+), 51 deletions(-) create mode 100644 components/calendar/form/UpdateEvent.vue diff --git a/components/calendar/CalendarEventDetails.vue b/components/calendar/CalendarEventDetails.vue index 799f982..eb93c77 100644 --- a/components/calendar/CalendarEventDetails.vue +++ b/components/calendar/CalendarEventDetails.vue @@ -2,19 +2,16 @@ import type { RPGDate } from '@/models/Date' import type { CalendarEvent } from '@/models/CalendarEvent' import { useCalendar } from '@/stores/CalendarStore' -import { useCalendarEvents } from '@/stores/EventStore' import { PhHourglassMedium, PhAlarm, PhHourglassHigh, PhHourglassLow, - PhArrowBendDoubleUpLeft, - PhArrowBendDoubleUpRight + PhDotsThreeOutlineVertical } from '@phosphor-icons/vue' const { defaultDate, getFormattedDateTitle, jumpToDate } = useCalendar() -const { getRelativeEventFromEvent } = useCalendarEvents() const props = defineProps<{ event: CalendarEvent @@ -23,9 +20,10 @@ const props = defineProps<{ isEndEvent?: boolean }>() -const emit = defineEmits<{ - (e: 'query:close-popover'): void -}>() +// Ref for the popover +const eventDetails = ref() + +const emit = defineEmits(['query:close-popover']) const { getRelativeString } = useCalendar() @@ -39,14 +37,15 @@ function handleJumpToDate(date: RPGDate) { emit('query:close-popover') } -function handleGotoRelativeEvent(position: 'next' | 'prev' = 'next') { - try { - const { targetDate } = getRelativeEventFromEvent(props.event, position, props.isEndEvent) +/** + * Edit event + */ +const commandMenuOpened = ref(false) +const editModelOpened = ref(false) - handleJumpToDate(targetDate) - } catch (err) { - console.log(err) - } +function deployEditModal() { + commandMenuOpened.value = false + editModelOpened.value = true } @@ -80,22 +79,24 @@ function handleGotoRelativeEvent(position: 'next' | 'prev' = 'next') { 'border-yellow-600': event.category?.name === 'commerce' }" > -
-
- {{ event.title }} -
+
+
+
+ {{ event.title }} +
-
- - -
+
+ + +
+

@@ -133,7 +134,29 @@ function handleGotoRelativeEvent(position: 'next' | 'prev' = 'next') {

-