mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-14 09:04:56 +08:00
Fix backend field validation [SCI-11471]
This commit is contained in:
parent
833d6b703e
commit
baeadd11ac
3 changed files with 3 additions and 3 deletions
|
@ -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 }}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue