Fix backend field validation [SCI-11471]

This commit is contained in:
Anton 2025-01-16 14:51:51 +01:00
parent 833d6b703e
commit baeadd11ac
3 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
<template>
<div class="p-4 rounded bg-white text-sm grid grid-cols-[minmax(0,1fr)_170px]">
<div class="p-4 rounded bg-white text-sm grid grid-cols-[minmax(0,1fr)_170px] mb-2">
<div>
<div class="font-bold">
{{ field.attributes.name }}

View file

@ -1,5 +1,5 @@
<template>
<div class="sci-input-container-v2 mb-2" :class="{'error': !isValidValue}" :data-error="errorMessage">
<div class="sci-input-container-v2" :class="{'error': !isValidValue}" :data-error="errorMessage">
<input type="number" v-model="value" class="sci-input" :disabled="fieldDisabled" @change="saveValue"
:placeholder="fieldDisabled ? '' : i18n.t('forms.fields.add_number')"></input>
</div>

View file

@ -7,7 +7,7 @@ class FormField < ApplicationRecord
has_many :form_field_values, dependent: :destroy
validates :name, length: { minimum: Constants::NAME_MIN_LENGTH, maximum: Constants::NAME_MAX_LENGTH }
validates :description, length: { maximum: Constants::NAME_MAX_LENGTH }
validates :description, length: { maximum: Constants::TEXT_MAX_LENGTH }
validates :position, presence: true, uniqueness: { scope: :form }
acts_as_list scope: :form, top_of_list: 0, sequential_updates: true