Fixed organization

This commit is contained in:
Alexis
2024-12-03 15:21:36 +01:00
parent dd1cb1f420
commit bb6df1d440
4 changed files with 8 additions and 5 deletions

View File

@@ -46,6 +46,7 @@ function deployEditModal() {
lastActiveEvent.value = { ...props.event } lastActiveEvent.value = { ...props.event }
revealEditEventModal() revealEditEventModal()
commandMenuOpened.value = false commandMenuOpened.value = false
emit("query:close-popover")
} }
/** /**
@@ -55,6 +56,7 @@ function deployDeleteModal() {
lastActiveEvent.value = { ...props.event } lastActiveEvent.value = { ...props.event }
revealDeleteEventModal() revealDeleteEventModal()
commandMenuOpened.value = false commandMenuOpened.value = false
emit("query:close-popover")
} }
</script> </script>

View File

@@ -14,7 +14,7 @@ const buttonDisabledState: ComputedRef<boolean> = computed<boolean>(() => {
<UiTooltipProvider :delay-duration="250"> <UiTooltipProvider :delay-duration="250">
<UiTooltip> <UiTooltip>
<UiTooltipTrigger as-child> <UiTooltipTrigger as-child>
<UiButton size="sm" :disabled="buttonDisabledState" @click="jumpToDefaultDate"> <UiButton size="sm" variant="secondary" :disabled="buttonDisabledState" @click="jumpToDefaultDate">
{{ $t('entity.calendar.date.today') }} {{ $t('entity.calendar.date.today') }}
</UiButton> </UiButton>
</UiTooltipTrigger> </UiTooltipTrigger>

View File

@@ -39,6 +39,7 @@ function openEventCreatePopover() {
*/ */
function handleClosing(e: Event) { function handleClosing(e: Event) {
if (isLoading.value) { if (isLoading.value) {
popoverOpen.value = false
e.preventDefault() e.preventDefault()
} }
} }
@@ -61,7 +62,7 @@ function handleClosing(e: Event) {
@interact-outside="handleClosing" @interact-outside="handleClosing"
@pointer-down-outside="handleClosing" @pointer-down-outside="handleClosing"
> >
<CalendarFormCreateEvent /> <CalendarFormCreateEvent @event-created="handleClosing" />
</UiPopoverContent> </UiPopoverContent>
</UiPopover> </UiPopover>
</template> </template>

View File

@@ -2,9 +2,10 @@
import type { RPGDate } from "~/models/Date"; import type { RPGDate } from "~/models/Date";
import { PhAlarm, PhCircleNotch, PhEye, PhEyeClosed, PhMapPinArea, PhTag } from "@phosphor-icons/vue" import { PhAlarm, PhCircleNotch, PhEye, PhEyeClosed, PhMapPinArea, PhTag } from "@phosphor-icons/vue"
const emit = defineEmits(["event-created"])
const { eventSkeleton } = storeToRefs(useCalendar()) const { eventSkeleton } = storeToRefs(useCalendar())
const { submitSkeleton, cancelLatestRequest } = useCalendar() const { submitSkeleton, cancelLatestRequest } = useCalendar()
const popoverOpen = ref(false)
const { t } = useI18n() const { t } = useI18n()
@@ -28,7 +29,7 @@ async function handleSubmit() {
try { try {
await submitSkeleton() await submitSkeleton()
popoverOpen.value = false emit("event-created")
} catch (err) { } catch (err) {
if (err instanceof Error) { if (err instanceof Error) {
formErrors.message = err.message formErrors.message = err.message
@@ -64,7 +65,6 @@ function handleCancel() {
pattern="([A-Za-zÀ-ÖØ-öø-ÿ0-9\s\&\-\~]+){3,120}" pattern="([A-Za-zÀ-ÖØ-öø-ÿ0-9\s\&\-\~]+){3,120}"
class="w-full -my-1 py-1 -mx-1 px-1 text-lg border-b-[1px] bg-transparent focus-visible:outline-none focus-visible:border-blue-600 invalid:border-red-500" class="w-full -my-1 py-1 -mx-1 px-1 text-lg border-b-[1px] bg-transparent focus-visible:outline-none focus-visible:border-blue-600 invalid:border-red-500"
> >
<div class="mt-2 mb-1 text-xs opacity-50"> <div class="mt-2 mb-1 text-xs opacity-50">
{{ t('entity.calendar.event.patterns.title') }} {{ t('entity.calendar.event.patterns.title') }}
</div> </div>