refactor: polish shift create dialog layout and hierarchy
Made-with: Cursor
This commit is contained in:
@@ -5,7 +5,6 @@ import { useTimeSlotList } from '@/composables/api/useTimeSlots'
|
|||||||
import { useEventDetail } from '@/composables/api/useEvents'
|
import { useEventDetail } from '@/composables/api/useEvents'
|
||||||
import { useAuthStore } from '@/stores/useAuthStore'
|
import { useAuthStore } from '@/stores/useAuthStore'
|
||||||
import { useTimeSlotDropdown } from '@/composables/useTimeSlotDropdown'
|
import { useTimeSlotDropdown } from '@/composables/useTimeSlotDropdown'
|
||||||
import InfoTooltip from '@/components/common/InfoTooltip.vue'
|
|
||||||
import { requiredValidator } from '@core/utils/validators'
|
import { requiredValidator } from '@core/utils/validators'
|
||||||
import type { FestivalSection, Shift, ShiftStatus } from '@/types/section'
|
import type { FestivalSection, Shift, ShiftStatus } from '@/types/section'
|
||||||
|
|
||||||
@@ -196,41 +195,63 @@ function onSubmit() {
|
|||||||
<template>
|
<template>
|
||||||
<VDialog
|
<VDialog
|
||||||
v-model="modelValue"
|
v-model="modelValue"
|
||||||
max-width="600"
|
max-width="640"
|
||||||
|
scrollable
|
||||||
@after-leave="!isEditing && resetForm()"
|
@after-leave="!isEditing && resetForm()"
|
||||||
>
|
>
|
||||||
<VCard :title="isEditing ? 'Shift bewerken' : 'Shift toevoegen'">
|
<VCard rounded="lg">
|
||||||
|
<VCardItem class="py-4">
|
||||||
|
<VCardTitle class="text-h6">
|
||||||
|
{{ isEditing ? 'Shift bewerken' : 'Shift toevoegen' }}
|
||||||
|
</VCardTitle>
|
||||||
|
<VCardSubtitle
|
||||||
|
v-if="section"
|
||||||
|
class="text-body-2 text-high-emphasis opacity-100 mt-1"
|
||||||
|
>
|
||||||
|
<span>{{ section.name }}</span>
|
||||||
|
<VChip
|
||||||
|
v-if="section.type === 'cross_event'"
|
||||||
|
size="x-small"
|
||||||
|
color="info"
|
||||||
|
variant="tonal"
|
||||||
|
class="ms-2"
|
||||||
|
>
|
||||||
|
festival-breed
|
||||||
|
</VChip>
|
||||||
|
<span
|
||||||
|
v-else-if="isSubEvent && eventDetail?.name"
|
||||||
|
class="text-medium-emphasis"
|
||||||
|
> · {{ eventDetail.name }}</span>
|
||||||
|
</VCardSubtitle>
|
||||||
|
</VCardItem>
|
||||||
|
|
||||||
|
<VDivider />
|
||||||
|
|
||||||
<VForm
|
<VForm
|
||||||
ref="refVForm"
|
ref="refVForm"
|
||||||
@submit.prevent="onSubmit"
|
@submit.prevent="onSubmit"
|
||||||
>
|
>
|
||||||
<VCardText>
|
<VCardText class="pt-5">
|
||||||
<!-- Cross_event section context indicator -->
|
<VAlert
|
||||||
<div
|
v-if="showInfoTooltip && tooltipText"
|
||||||
v-if="section?.type === 'cross_event'"
|
type="info"
|
||||||
class="mb-4"
|
variant="tonal"
|
||||||
|
density="compact"
|
||||||
|
class="mb-6"
|
||||||
|
title="Tijdsloten in dit evenement"
|
||||||
>
|
>
|
||||||
<span class="text-body-2 text-medium-emphasis">
|
<p class="text-body-2 mb-0">
|
||||||
{{ section.name }}
|
{{ tooltipText.main }}
|
||||||
</span>
|
</p>
|
||||||
<VChip
|
<p class="text-caption text-medium-emphasis mb-0 mt-2">
|
||||||
size="x-small"
|
<span class="font-weight-medium text-high-emphasis">Tip:</span>
|
||||||
color="info"
|
{{ tooltipText.tip }}
|
||||||
variant="tonal"
|
</p>
|
||||||
class="ml-2"
|
</VAlert>
|
||||||
>
|
|
||||||
festival-breed
|
|
||||||
</VChip>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else-if="isSubEvent && section"
|
|
||||||
class="mb-4"
|
|
||||||
>
|
|
||||||
<span class="text-body-2 text-medium-emphasis">
|
|
||||||
{{ section.name }} · {{ eventDetail?.name }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<p class="text-overline text-medium-emphasis letter-spacing-normal mb-3">
|
||||||
|
Tijd & rol
|
||||||
|
</p>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
<VAutocomplete
|
<VAutocomplete
|
||||||
@@ -243,22 +264,8 @@ function onSubmit() {
|
|||||||
:loading="timeSlotsLoading"
|
:loading="timeSlotsLoading"
|
||||||
:rules="[requiredValidator]"
|
:rules="[requiredValidator]"
|
||||||
:error-messages="errors.time_slot_id"
|
:error-messages="errors.time_slot_id"
|
||||||
|
hide-details="auto"
|
||||||
>
|
>
|
||||||
<template
|
|
||||||
v-if="showInfoTooltip"
|
|
||||||
#prepend-inner
|
|
||||||
>
|
|
||||||
<InfoTooltip>
|
|
||||||
<p>{{ tooltipText?.main }}</p>
|
|
||||||
<div
|
|
||||||
class="mt-2 pa-2 rounded text-caption"
|
|
||||||
style="background: rgb(var(--v-theme-surface-variant)); line-height: 1.5;"
|
|
||||||
>
|
|
||||||
<strong>Tip:</strong> {{ tooltipText?.tip }}
|
|
||||||
</div>
|
|
||||||
</InfoTooltip>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #item="{ props: itemProps, item, index }">
|
<template #item="{ props: itemProps, item, index }">
|
||||||
<!-- Group header: rendered when event_name changes -->
|
<!-- Group header: rendered when event_name changes -->
|
||||||
<VListSubheader
|
<VListSubheader
|
||||||
@@ -313,14 +320,27 @@ function onSubmit() {
|
|||||||
autocomplete="one-time-code"
|
autocomplete="one-time-code"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
|
||||||
|
<VDivider class="my-5" />
|
||||||
|
|
||||||
|
<p class="text-overline text-medium-emphasis letter-spacing-normal mb-3">
|
||||||
|
Tijden (optioneel)
|
||||||
|
</p>
|
||||||
|
<p class="text-caption text-medium-emphasis mb-4">
|
||||||
|
Laat leeg om de start- en eindtijd van het gekozen tijdslot te gebruiken.
|
||||||
|
</p>
|
||||||
|
<VRow>
|
||||||
<VCol
|
<VCol
|
||||||
cols="12"
|
cols="12"
|
||||||
sm="4"
|
sm="4"
|
||||||
>
|
>
|
||||||
<AppTextField
|
<AppTextField
|
||||||
v-model="form.report_time"
|
v-model="form.report_time"
|
||||||
label="Aanwezig om (rapport tijd)"
|
label="Rapporttijd"
|
||||||
type="time"
|
type="time"
|
||||||
|
hint="Aanwezig vanaf"
|
||||||
|
persistent-hint
|
||||||
:error-messages="errors.report_time"
|
:error-messages="errors.report_time"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
@@ -330,9 +350,9 @@ function onSubmit() {
|
|||||||
>
|
>
|
||||||
<AppTextField
|
<AppTextField
|
||||||
v-model="form.actual_start_time"
|
v-model="form.actual_start_time"
|
||||||
label="Afwijkende starttijd"
|
label="Starttijd"
|
||||||
type="time"
|
type="time"
|
||||||
hint="Leeg = time slot tijd"
|
hint="Leeg = time slot"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
:error-messages="errors.actual_start_time"
|
:error-messages="errors.actual_start_time"
|
||||||
/>
|
/>
|
||||||
@@ -343,11 +363,21 @@ function onSubmit() {
|
|||||||
>
|
>
|
||||||
<AppTextField
|
<AppTextField
|
||||||
v-model="form.actual_end_time"
|
v-model="form.actual_end_time"
|
||||||
label="Afwijkende eindtijd"
|
label="Eindtijd"
|
||||||
type="time"
|
type="time"
|
||||||
|
hint="Leeg = time slot"
|
||||||
|
persistent-hint
|
||||||
:error-messages="errors.actual_end_time"
|
:error-messages="errors.actual_end_time"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
|
||||||
|
<VDivider class="my-5" />
|
||||||
|
|
||||||
|
<p class="text-overline text-medium-emphasis letter-spacing-normal mb-3">
|
||||||
|
Capaciteit
|
||||||
|
</p>
|
||||||
|
<VRow>
|
||||||
<VCol
|
<VCol
|
||||||
cols="12"
|
cols="12"
|
||||||
sm="6"
|
sm="6"
|
||||||
@@ -367,7 +397,7 @@ function onSubmit() {
|
|||||||
>
|
>
|
||||||
<AppTextField
|
<AppTextField
|
||||||
v-model.number="form.slots_open_for_claiming"
|
v-model.number="form.slots_open_for_claiming"
|
||||||
label="Open voor claimen"
|
label="Open voor vrijwilligers (claimen)"
|
||||||
type="number"
|
type="number"
|
||||||
min="0"
|
min="0"
|
||||||
:max="form.slots_total"
|
:max="form.slots_total"
|
||||||
@@ -375,20 +405,46 @@ function onSubmit() {
|
|||||||
:error-messages="errors.slots_open_for_claiming"
|
:error-messages="errors.slots_open_for_claiming"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12">
|
</VRow>
|
||||||
|
|
||||||
|
<VDivider class="my-5" />
|
||||||
|
|
||||||
|
<p class="text-overline text-medium-emphasis letter-spacing-normal mb-3">
|
||||||
|
Opties
|
||||||
|
</p>
|
||||||
|
<VRow>
|
||||||
|
<VCol
|
||||||
|
cols="12"
|
||||||
|
md="6"
|
||||||
|
>
|
||||||
<VSwitch
|
<VSwitch
|
||||||
v-model="form.is_lead_role"
|
v-model="form.is_lead_role"
|
||||||
label="Dit is een leidinggevende rol"
|
color="primary"
|
||||||
/>
|
label="Leidinggevende rol"
|
||||||
</VCol>
|
hint="Coördinatie / verantwoordelijke"
|
||||||
<VCol cols="12">
|
|
||||||
<VSwitch
|
|
||||||
v-model="form.allow_overlap"
|
|
||||||
label="Overlap toegestaan"
|
|
||||||
hint="Persoon mag meerdere shifts in hetzelfde tijdvak hebben"
|
|
||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol
|
||||||
|
cols="12"
|
||||||
|
md="6"
|
||||||
|
>
|
||||||
|
<VSwitch
|
||||||
|
v-model="form.allow_overlap"
|
||||||
|
color="primary"
|
||||||
|
label="Overlap toegestaan"
|
||||||
|
hint="Zelfde tijdvak, meerdere shifts voor één persoon"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
|
||||||
|
<VDivider class="my-5" />
|
||||||
|
|
||||||
|
<p class="text-overline text-medium-emphasis letter-spacing-normal mb-3">
|
||||||
|
Documentatie & status
|
||||||
|
</p>
|
||||||
|
<VRow>
|
||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
<AppTextarea
|
<AppTextarea
|
||||||
v-model="form.instructions"
|
v-model="form.instructions"
|
||||||
@@ -408,7 +464,10 @@ function onSubmit() {
|
|||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
<VCardActions>
|
|
||||||
|
<VDivider />
|
||||||
|
|
||||||
|
<VCardActions class="px-6 py-4">
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn
|
<VBtn
|
||||||
variant="text"
|
variant="text"
|
||||||
|
|||||||
Reference in New Issue
Block a user