feat(form-builder): form_field_configs relational table + non-validation key split + drop validation_rules JSON columns
This commit is contained in:
@@ -43,8 +43,8 @@ function onUpdate(raw: string | number | null) {
|
||||
:label="field.label"
|
||||
:hint="field.help_text ?? undefined"
|
||||
persistent-hint
|
||||
:min="field.validation_rules?.min ?? undefined"
|
||||
:max="field.validation_rules?.max ?? undefined"
|
||||
:min="field.validation_rules?.min_value ?? undefined"
|
||||
:max="field.validation_rules?.max_value ?? undefined"
|
||||
:rules="rules"
|
||||
:error-messages="errorMessages"
|
||||
:required="field.is_required"
|
||||
|
||||
@@ -54,7 +54,9 @@ watch(() => props.modelValue, v => {
|
||||
}, { deep: true })
|
||||
|
||||
const maxPriorities = computed(() => {
|
||||
const raw = props.field.validation_rules?.max_priorities
|
||||
// WS-5b canonicalised the legacy `max_priorities` key to `max_selected`;
|
||||
// the field's cap (if any) is surfaced under `validation_rules.max_selected`.
|
||||
const raw = props.field.validation_rules?.max_selected
|
||||
if (typeof raw === 'number' && Number.isFinite(raw) && raw > 0) {
|
||||
return Math.min(raw, HARD_CAP)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ const model = computed({
|
||||
:rules="rules"
|
||||
:error-messages="errorMessages"
|
||||
:required="field.is_required"
|
||||
:maxlength="field.validation_rules?.max ?? undefined"
|
||||
:maxlength="field.validation_rules?.max_length ?? undefined"
|
||||
@blur="emit('blur')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -31,7 +31,7 @@ const model = computed({
|
||||
:rules="rules"
|
||||
:error-messages="errorMessages"
|
||||
:required="field.is_required"
|
||||
:maxlength="field.validation_rules?.max ?? undefined"
|
||||
:maxlength="field.validation_rules?.max_length ?? undefined"
|
||||
@blur="emit('blur')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user