validate prefilled champs when editing brouillon

This commit is contained in:
sebastiencarceles 2022-11-30 11:23:04 +01:00
parent 79ef48cafb
commit 3939644030
3 changed files with 7 additions and 1 deletions

View file

@ -228,6 +228,10 @@
}
}
div.field_with_errors > input { // scss-lint:disable SelectorFormat
border: 1px solid $dark-red;
}
input[type=text],
input[type=email],
input[type=password],

View file

@ -148,7 +148,7 @@ module Users
def brouillon
@dossier = dossier_with_champs
# TODO: SEB show validation errors
@dossier.valid?(context: :prefilling)
# TODO: remove when the champs are unifed
if !@dossier.autorisation_donnees

View file

@ -435,6 +435,8 @@ class Dossier < ApplicationRecord
validates :individual, presence: true, if: -> { revision.procedure.for_individual? }
validates :groupe_instructeur, presence: true, if: -> { !brouillon? }
validates_associated :champs_public, on: :prefilling
def types_de_champ_public
types_de_champ
end