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=text],
|
||||||
input[type=email],
|
input[type=email],
|
||||||
input[type=password],
|
input[type=password],
|
||||||
|
|
|
@ -148,7 +148,7 @@ module Users
|
||||||
|
|
||||||
def brouillon
|
def brouillon
|
||||||
@dossier = dossier_with_champs
|
@dossier = dossier_with_champs
|
||||||
# TODO: SEB show validation errors
|
@dossier.valid?(context: :prefilling)
|
||||||
|
|
||||||
# TODO: remove when the champs are unifed
|
# TODO: remove when the champs are unifed
|
||||||
if !@dossier.autorisation_donnees
|
if !@dossier.autorisation_donnees
|
||||||
|
|
|
@ -435,6 +435,8 @@ class Dossier < ApplicationRecord
|
||||||
validates :individual, presence: true, if: -> { revision.procedure.for_individual? }
|
validates :individual, presence: true, if: -> { revision.procedure.for_individual? }
|
||||||
validates :groupe_instructeur, presence: true, if: -> { !brouillon? }
|
validates :groupe_instructeur, presence: true, if: -> { !brouillon? }
|
||||||
|
|
||||||
|
validates_associated :champs_public, on: :prefilling
|
||||||
|
|
||||||
def types_de_champ_public
|
def types_de_champ_public
|
||||||
types_de_champ
|
types_de_champ
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue