style(app): apply eslint --fix to Tier 1 (Vue templates)
WS-3 session 1b-i Tier 1. Scope: src/components/**, src/pages/**, src/layouts/**, src/views/** restricted to *.vue files. Mechanical formatting only — predominantly vue/html-indent (506 fixes in CrowdListDetailPanel.vue alone), padding-line-between-statements, antfu/if-newline. Excludes (per session prompt): - apps/app/vite.config.ts (Tier 3) - apps/app/themeConfig.ts (Tier 3) - apps/app/vitest.config.ts (Tier 3) - All TypeScript-only files in src/composables, src/lib, src/stores, src/plugins, src/types (Tier 2 — separate commit) Includes session 1a layouts (PortalLayout.vue, PublicLayout.vue) where 2 'lines-around-comment' errors were flagged in the previous 1b-i pre-flight inspection. Tests + typecheck verified green post-fix: - apps/app vitest: 49 passed (unchanged) - apps/app vue-tsc: clean (unchanged) - apps/portal vitest: 113 passed (unchanged — not touched) - backend pest: 1486 passed (unchanged — not touched) Lint baseline progression: - Pre-Tier-1: 1451 problems - Post-Tier-1: 422 problems Visual smoke status: - NOT YET SMOKED — Bert to verify before merge. This Claude Code session has no UI access; cannot run pnpm dev and click through affected routes. The high-traffic candidates are CrowdListDetailPanel (506 fixes), AssignPersonDialog (44), ShiftDetailPanel (36), and the events / form-failures pages. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import draggable from 'vuedraggable'
|
||||
import { useSectionList, useDeleteSection, useReorderSections } from '@/composables/api/useSections'
|
||||
import { useShiftList, useDeleteShift } from '@/composables/api/useShifts'
|
||||
import { useDeleteSection, useReorderSections, useSectionList } from '@/composables/api/useSections'
|
||||
import { useDeleteShift, useShiftList } from '@/composables/api/useShifts'
|
||||
import { useEventDetail } from '@/composables/api/useEvents'
|
||||
import { useAuthStore } from '@/stores/useAuthStore'
|
||||
import CreateSectionDialog from '@/components/sections/CreateSectionDialog.vue'
|
||||
@@ -14,15 +13,15 @@ import InfoTooltip from '@/components/common/InfoTooltip.vue'
|
||||
import type { FestivalSection, Shift, ShiftStatus } from '@/types/section'
|
||||
import type { EventItem } from '@/types/event'
|
||||
|
||||
const shiftDetailStore = useShiftDetailStore()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
const props = defineProps<{
|
||||
eventId: string
|
||||
isSubEvent?: boolean
|
||||
parentEvent?: EventItem | null
|
||||
}>()
|
||||
|
||||
const shiftDetailStore = useShiftDetailStore()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
const orgIdRef = computed(() => authStore.currentOrganisation?.id ?? '')
|
||||
const eventIdRef = computed(() => props.eventId)
|
||||
|
||||
@@ -38,10 +37,9 @@ const { mutate: reorderSections } = useReorderSections(orgIdRef, eventIdRef)
|
||||
// Local ref for draggable — synced from query but not overwritten during drag
|
||||
const sections = ref<FestivalSection[]>([])
|
||||
|
||||
watch(sectionsQuery, (newData) => {
|
||||
if (newData) {
|
||||
watch(sectionsQuery, newData => {
|
||||
if (newData)
|
||||
sections.value = [...newData]
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
function onDragEnd() {
|
||||
@@ -54,19 +52,19 @@ const activeSection = computed(() =>
|
||||
sections.value?.find(s => s.id === activeSectionId.value) ?? null,
|
||||
)
|
||||
|
||||
watch(sections, (list) => {
|
||||
if (list?.length && !activeSectionId.value) {
|
||||
watch(sections, list => {
|
||||
if (list?.length && !activeSectionId.value)
|
||||
activeSectionId.value = list[0].id
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
// For cross_event sections, use the section's own event_id (parent festival)
|
||||
const activeSectionEventId = computed(() => {
|
||||
if (activeSection.value?.type === 'cross_event') {
|
||||
if (activeSection.value?.type === 'cross_event')
|
||||
return activeSection.value.event_id
|
||||
}
|
||||
|
||||
return props.eventId
|
||||
})
|
||||
|
||||
const activeSectionEventIdRef = computed(() => activeSectionEventId.value)
|
||||
|
||||
const { mutate: deleteSection } = useDeleteSection(orgIdRef, activeSectionEventIdRef)
|
||||
@@ -80,7 +78,8 @@ const { mutate: deleteShiftMutation, isPending: isDeleting } = useDeleteShift(or
|
||||
|
||||
// Group shifts by time_slot_id
|
||||
const shiftsByTimeSlot = computed(() => {
|
||||
if (!shifts.value) return []
|
||||
if (!shifts.value)
|
||||
return []
|
||||
|
||||
const groups = new Map<string, { timeSlotName: string; date: string; startTime: string; endTime: string; totalSlots: number; filledSlots: number; shifts: Shift[] }>()
|
||||
|
||||
@@ -98,6 +97,7 @@ const shiftsByTimeSlot = computed(() => {
|
||||
})
|
||||
}
|
||||
const group = groups.get(tsId)!
|
||||
|
||||
group.shifts.push(shift)
|
||||
group.totalSlots += shift.slots_total
|
||||
group.filledSlots += shift.filled_slots
|
||||
@@ -126,13 +126,14 @@ function onDeleteSectionConfirm(section: FestivalSection) {
|
||||
}
|
||||
|
||||
function onDeleteSectionExecute() {
|
||||
if (!deletingSectionId.value) return
|
||||
if (!deletingSectionId.value)
|
||||
return
|
||||
deleteSection(deletingSectionId.value, {
|
||||
onSuccess: () => {
|
||||
isDeleteSectionOpen.value = false
|
||||
if (activeSectionId.value === deletingSectionId.value) {
|
||||
if (activeSectionId.value === deletingSectionId.value)
|
||||
activeSectionId.value = sections.value?.[0]?.id ?? null
|
||||
}
|
||||
|
||||
deletingSectionId.value = null
|
||||
},
|
||||
})
|
||||
@@ -148,7 +149,8 @@ function onDeleteShiftConfirm(shift: Shift) {
|
||||
}
|
||||
|
||||
function onDeleteShiftExecute() {
|
||||
if (!deletingShiftId.value) return
|
||||
if (!deletingShiftId.value)
|
||||
return
|
||||
deleteShiftMutation(deletingShiftId.value, {
|
||||
onSuccess: () => {
|
||||
isDeleteShiftOpen.value = false
|
||||
@@ -196,9 +198,13 @@ const statusLabel: Record<ShiftStatus, string> = {
|
||||
}
|
||||
|
||||
function fillRateColor(shift: Shift): string {
|
||||
if (shift.is_overbooked) return 'warning'
|
||||
if (shift.fill_rate >= 80) return 'success'
|
||||
if (shift.fill_rate >= 40) return 'warning'
|
||||
if (shift.is_overbooked)
|
||||
return 'warning'
|
||||
if (shift.fill_rate >= 80)
|
||||
return 'success'
|
||||
if (shift.fill_rate >= 40)
|
||||
return 'warning'
|
||||
|
||||
return 'error'
|
||||
}
|
||||
|
||||
@@ -210,13 +216,17 @@ const dateFormatter = new Intl.DateTimeFormat('nl-NL', {
|
||||
})
|
||||
|
||||
function formatDate(iso: string) {
|
||||
if (!iso) return ''
|
||||
if (!iso)
|
||||
return ''
|
||||
|
||||
return dateFormatter.format(new Date(iso))
|
||||
}
|
||||
|
||||
// Selected shift for detail panel (resolved from store ID)
|
||||
const selectedShift = computed(() => {
|
||||
if (!shiftDetailStore.selectedShiftId || !shifts.value) return null
|
||||
if (!shiftDetailStore.selectedShiftId || !shifts.value)
|
||||
return null
|
||||
|
||||
return shifts.value.find(s => s.id === shiftDetailStore.selectedShiftId) ?? null
|
||||
})
|
||||
|
||||
@@ -311,7 +321,7 @@ function onSectionCreated(payload: { name: string; redirectedToParent: boolean;
|
||||
</VCardText>
|
||||
|
||||
<!-- Section list -->
|
||||
<draggable
|
||||
<Draggable
|
||||
v-else
|
||||
v-model="sections"
|
||||
item-key="id"
|
||||
@@ -351,7 +361,7 @@ function onSectionCreated(payload: { name: string; redirectedToParent: boolean;
|
||||
</VListItemTitle>
|
||||
</VListItem>
|
||||
</template>
|
||||
</draggable>
|
||||
</Draggable>
|
||||
</VCard>
|
||||
</VCol>
|
||||
|
||||
@@ -520,7 +530,10 @@ function onSectionCreated(payload: { name: string; redirectedToParent: boolean;
|
||||
>
|
||||
<div class="d-flex align-center gap-x-3 py-1 flex-wrap">
|
||||
<!-- Title + lead badge -->
|
||||
<div class="d-flex align-center gap-x-2" style="min-inline-size: 160px;">
|
||||
<div
|
||||
class="d-flex align-center gap-x-2"
|
||||
style="min-inline-size: 160px;"
|
||||
>
|
||||
<span class="text-body-1 font-weight-medium">
|
||||
{{ shift.title ?? 'Shift' }}
|
||||
</span>
|
||||
@@ -534,7 +547,10 @@ function onSectionCreated(payload: { name: string; redirectedToParent: boolean;
|
||||
</div>
|
||||
|
||||
<!-- Fill rate -->
|
||||
<div class="d-flex align-center gap-x-2" style="min-inline-size: 160px;">
|
||||
<div
|
||||
class="d-flex align-center gap-x-2"
|
||||
style="min-inline-size: 160px;"
|
||||
>
|
||||
<VProgressLinear
|
||||
:model-value="shift.is_overbooked ? 100 : shift.fill_rate"
|
||||
:color="fillRateColor(shift)"
|
||||
|
||||
Reference in New Issue
Block a user