refactor(portal): move components to shared/public-form and portal/{event,*}
- public-form/** (18 files + 7 component tests) → shared/public-form/**
This is the runtime form-renderer; goes into shared/ because it will
be reused by the organizer-app Form Builder preview (S3b).
- event/{Claimen,Informatie,Overzicht,Rooster}Tab.vue → portal/event/**
- portal/{StatusCard,EventCard,UserAvatarMenu}.vue → portal/** (no
path change — both apps had a portal/ subfolder).
- AppLoadingIndicator.vue, auth/{PasswordRequirements,MfaChallengeCard}.vue,
settings/Mfa{Disable,Email,Totp}SetupDialog.vue: portal copies
deleted as duplicates of pre-existing apps/app components (diffs
were trivial formatting only).
Inside the moved files: rewrote @form-schema/* → @/composables/forms/*
and @/components/{public-form,event/[Tab]} → new sub-zone paths.
Updated apps/app/tsconfig.json to drop the @form-schema path alias
and the packages/form-schema include path. Updated formSchema.ts to
import from @/composables/forms/types/formBuilder. Carried the
crypto polyfill from apps/portal/tests/setup.ts into
apps/app/tests/setup.ts (needed by useFormDraft tests landing in C.4).
NOTE: Some moved tests still fail because they reference portal
composables (usePublicFormSections, useFormDraft) that move in C.4.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
35
apps/app/src/components/shared/public-form/FieldText.vue
Normal file
35
apps/app/src/components/shared/public-form/FieldText.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import type { PublicFormField } from '@/composables/forms/types/formBuilder'
|
||||
import { getValidatorsForField } from '@/composables/forms/utils/formValidation'
|
||||
|
||||
const props = defineProps<{
|
||||
field: PublicFormField
|
||||
modelValue: unknown
|
||||
errorMessages?: string[]
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:modelValue', v: string): void
|
||||
(e: 'blur'): void
|
||||
}>()
|
||||
|
||||
const rules = computed(() => getValidatorsForField(props.field))
|
||||
const model = computed({
|
||||
get: () => (props.modelValue ?? '') as string,
|
||||
set: (v: string) => emit('update:modelValue', v),
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppTextField
|
||||
v-model="model"
|
||||
:label="field.label"
|
||||
:hint="field.help_text ?? undefined"
|
||||
persistent-hint
|
||||
:rules="rules"
|
||||
:error-messages="errorMessages"
|
||||
:required="field.is_required"
|
||||
:maxlength="field.validation_rules?.max_length ?? undefined"
|
||||
@blur="emit('blur')"
|
||||
/>
|
||||
</template>
|
||||
Reference in New Issue
Block a user