refactor(layouts): merge portal navbar/drawer into PortalLayout.vue
Migrates the navbar (event/platform two-mode toggle), mobile drawer
with avatar header + logout, RouterView Suspense wrapper, and footer
from apps/portal/src/layouts/portal.vue into the PortalLayout.vue
skeleton from PR-A. The skeleton's structure (VApp / VAppBar / VMain
/ VFooter) is preserved as the outer shell.
Notable adaptations:
- useAuthStore → usePortalAuthStore (renamed in C.3)
- usePortalStore import path → @/stores/portal/usePortalStore
- mobile nav links now point at /portal/evenementen and /portal/profiel
(the new sub-zone paths) instead of /evenementen and /profiel
- explicit `import { useRoute, useRouter }` from vue-router so the
vitest mock can intercept (auto-import not configured for these in
the trimmed test config)
Updated PortalLayout.spec.ts to mock the two pinia stores plus
useSkins, vue-router, UserAvatarMenu, and AppLoadingIndicator. Tests
now assert the auth-conditional rendering: header + drawer hidden
when unauthenticated, main + footer always present.
Also pulls in the @form-schema → @/composables/forms/* import
rewrites in the C.4-moved composables that the previous commit's
rename-only diff left unstaged.
Vitest: 23 files / 162 tests, no errors.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ vi.mock('@/lib/axios', () => ({
|
||||
|
||||
import { apiClient } from '@/lib/axios'
|
||||
import { usePublicFormSections } from '@/composables/api/usePublicFormSections'
|
||||
import type { PublicFormSectionOption } from '@form-schema/types/formBuilder'
|
||||
import type { PublicFormSectionOption } from '@/composables/forms/types/formBuilder'
|
||||
|
||||
interface MockedApi { get: ReturnType<typeof vi.fn> }
|
||||
const mocked = apiClient as unknown as MockedApi
|
||||
|
||||
@@ -9,7 +9,7 @@ vi.mock('@/lib/axios', () => ({
|
||||
|
||||
import { apiClient } from '@/lib/axios'
|
||||
import { usePublicFormTimeSlots } from '@/composables/api/usePublicFormTimeSlots'
|
||||
import type { PublicFormTimeSlot } from '@form-schema/types/formBuilder'
|
||||
import type { PublicFormTimeSlot } from '@/composables/forms/types/formBuilder'
|
||||
|
||||
interface MockedApi { get: ReturnType<typeof vi.fn> }
|
||||
const mocked = apiClient as unknown as MockedApi
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
SaveDraftBody,
|
||||
StartDraftBody,
|
||||
SubmitBody,
|
||||
} from '@form-schema/types/formBuilder'
|
||||
} from '@/composables/forms/types/formBuilder'
|
||||
|
||||
interface ApiResponse<T> {
|
||||
data: T
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useQuery } from '@tanstack/vue-query'
|
||||
import type { Ref } from 'vue'
|
||||
import { apiClient } from '@/lib/axios'
|
||||
import type { PublicFormSectionOption } from '@form-schema/types/formBuilder'
|
||||
import type { PublicFormSectionOption } from '@/composables/forms/types/formBuilder'
|
||||
|
||||
interface ApiResponse<T> {
|
||||
data: T
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useQuery } from '@tanstack/vue-query'
|
||||
import type { Ref } from 'vue'
|
||||
import { apiClient } from '@/lib/axios'
|
||||
import type { PublicFormTimeSlot } from '@form-schema/types/formBuilder'
|
||||
import type { PublicFormTimeSlot } from '@/composables/forms/types/formBuilder'
|
||||
|
||||
interface ApiResponse<T> {
|
||||
data: T
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
useSaveFormDraft,
|
||||
useSubmitForm,
|
||||
} from '@/composables/api/usePublicForm'
|
||||
import type { FormValues, PublicFormSubmission, SaveDraftBody } from '@form-schema/types/formBuilder'
|
||||
import type { FormValues, PublicFormSubmission, SaveDraftBody } from '@/composables/forms/types/formBuilder'
|
||||
|
||||
/** sessionStorage key for reusing an idempotency key across reloads. */
|
||||
export function draftIdempotencyKey(token: string): string {
|
||||
|
||||
Reference in New Issue
Block a user