diff --git a/components/calendar/Calendar.vue b/components/calendar/Calendar.vue index 2dd6b7f..37c312b 100644 --- a/components/calendar/Calendar.vue +++ b/components/calendar/Calendar.vue @@ -53,8 +53,8 @@ onMounted(() => { - - + + diff --git a/components/calendar/CalendarEventDetails.vue b/components/calendar/CalendarEventDetails.vue index c1046ca..8d8afa7 100644 --- a/components/calendar/CalendarEventDetails.vue +++ b/components/calendar/CalendarEventDetails.vue @@ -46,6 +46,7 @@ function deployEditModal() { lastActiveEvent.value = { ...props.event } revealEditEventModal() commandMenuOpened.value = false + emit("query:close-popover") } /** @@ -55,6 +56,7 @@ function deployDeleteModal() { lastActiveEvent.value = { ...props.event } revealDeleteEventModal() commandMenuOpened.value = false + emit("query:close-popover") } diff --git a/components/calendar/CalendarMenu.vue b/components/calendar/CalendarMenu.vue index ce2b3da..12f593e 100644 --- a/components/calendar/CalendarMenu.vue +++ b/components/calendar/CalendarMenu.vue @@ -10,7 +10,10 @@ const { revealAdvancedSearch } = useCalendar()
-
  • +
  • + +
  • +
  • diff --git a/components/calendar/CalendarMenuToday.vue b/components/calendar/CalendarMenuToday.vue index 13bf872..5860fc4 100644 --- a/components/calendar/CalendarMenuToday.vue +++ b/components/calendar/CalendarMenuToday.vue @@ -14,7 +14,7 @@ const buttonDisabledState: ComputedRef = computed(() => { - + {{ $t('entity.calendar.date.today') }} diff --git a/components/calendar/dialog/CreateEvent.vue b/components/calendar/dialog/CreateEvent.vue new file mode 100644 index 0000000..e3619eb --- /dev/null +++ b/components/calendar/dialog/CreateEvent.vue @@ -0,0 +1,68 @@ + + + diff --git a/components/calendar/dialog/DeleteEvent.vue b/components/calendar/dialog/DeleteEvent.vue new file mode 100644 index 0000000..1e02d55 --- /dev/null +++ b/components/calendar/dialog/DeleteEvent.vue @@ -0,0 +1,45 @@ + + + diff --git a/components/calendar/dialog/QuickCreateEvent.vue b/components/calendar/dialog/QuickCreateEvent.vue new file mode 100644 index 0000000..3e487e7 --- /dev/null +++ b/components/calendar/dialog/QuickCreateEvent.vue @@ -0,0 +1,29 @@ + + + diff --git a/components/calendar/dialog/UpdateEvent.vue b/components/calendar/dialog/UpdateEvent.vue new file mode 100644 index 0000000..46003e6 --- /dev/null +++ b/components/calendar/dialog/UpdateEvent.vue @@ -0,0 +1,49 @@ + + + diff --git a/components/calendar/form/CreateEvent.vue b/components/calendar/form/CreateEvent.vue index 65003ee..bc2396e 100644 --- a/components/calendar/form/CreateEvent.vue +++ b/components/calendar/form/CreateEvent.vue @@ -2,9 +2,10 @@ import type { RPGDate } from "~/models/Date"; import { PhAlarm, PhCircleNotch, PhEye, PhEyeClosed, PhMapPinArea, PhTag } from "@phosphor-icons/vue" -const { eventSkeleton, operationInProgress } = storeToRefs(useCalendar()) -const { resetSkeleton, submitSkeleton, cancelLatestRequest } = useCalendar() -const popoverOpen = ref(false) +const emit = defineEmits(["event-created"]) + +const { eventSkeleton } = storeToRefs(useCalendar()) +const { submitSkeleton, cancelLatestRequest } = useCalendar() const { t } = useI18n() @@ -19,26 +20,6 @@ const props = defineProps<{ btnClass?: string }>() -/** - * Opens event creation's popover - */ -function openEventCreatePopover() { - // If another operation is in progress, whether it's another create popup or a modal, don't bother opening it - if (operationInProgress.value) { - popoverOpen.value = false - return - } - - resetSkeleton() - - popoverOpen.value = true - - // Set skeleton initial startDate if it's known - if (props.date) { - eventSkeleton.value.startDate = { ...props.date } // We need to clone it otherwise the props ends up mutating (?) - } -} - async function handleSubmit() { // Prevent form submission if already loading if (isLoading.value) return @@ -48,7 +29,7 @@ async function handleSubmit() { try { await submitSkeleton() - popoverOpen.value = false + emit("event-created") } catch (err) { if (err instanceof Error) { formErrors.message = err.message @@ -58,17 +39,6 @@ async function handleSubmit() { } } -/** - * Prevents the modal from closing if's still loading - * - * @param e The closing event (can be keydown or click) - */ -function handleClosing(e: Event) { - if (isLoading.value) { - e.preventDefault() - } -} - /** * Click on the cancel button * @@ -81,160 +51,141 @@ function handleCancel() {