validate prefilled champs when editing brouillon
This commit is contained in:
parent
79ef48cafb
commit
3939644030
3 changed files with 7 additions and 1 deletions
|
@ -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],
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue