Small fix link to prefill type de champ
This commit is contained in:
parent
20ba96ba3c
commit
f91cc05d95
4 changed files with 2 additions and 6 deletions
|
@ -2,7 +2,6 @@ class API::Public::V1::DossiersController < API::Public::V1::BaseController
|
||||||
before_action :retrieve_procedure
|
before_action :retrieve_procedure
|
||||||
|
|
||||||
def create
|
def create
|
||||||
byebug
|
|
||||||
dossier = Dossier.new(
|
dossier = Dossier.new(
|
||||||
revision: @procedure.active_revision,
|
revision: @procedure.active_revision,
|
||||||
groupe_instructeur: @procedure.defaut_groupe_instructeur_for_new_dossier,
|
groupe_instructeur: @procedure.defaut_groupe_instructeur_for_new_dossier,
|
||||||
|
|
|
@ -12,6 +12,6 @@ class PrefillTypeDeChampsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_prefill_type_de_champ
|
def set_prefill_type_de_champ
|
||||||
@type_de_champ = TypesDeChamp::PrefillTypeDeChamp.build(@procedure.active_revision.types_de_champ_public.fillable.find(params[:id]))
|
@type_de_champ = TypesDeChamp::PrefillTypeDeChamp.build(@procedure.active_revision.types_de_champ.fillable.find(params[:id]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,9 +11,6 @@ class PrefillParams
|
||||||
private
|
private
|
||||||
|
|
||||||
def build_prefill_values
|
def build_prefill_values
|
||||||
byebug
|
|
||||||
# nop : "[{\"txt\":\"Texte court\", \"nb\":\"3.14\", \"Test dropdown\":\"Premier choix\", \"régio\":\"53\"}, {\"txt\":\"Texte court\", \"nb\":\"3.14\", \"Test dropdown\":\"Premier choix\", \"régio\":\"53\"}]"
|
|
||||||
# {"champ_Q2hhbXAtNDI="=>["{\"txt\":\"abc\", \"nb\":\"1,12\"}", "{\"txt\":\"def\", \"nb\":\"2,12\"}"]}
|
|
||||||
value_by_stable_id = @params
|
value_by_stable_id = @params
|
||||||
.map { |prefixed_typed_id, value| [stable_id_from_typed_id(prefixed_typed_id), value] }
|
.map { |prefixed_typed_id, value| [stable_id_from_typed_id(prefixed_typed_id), value] }
|
||||||
.filter { |stable_id, value| stable_id.present? && value.present? }
|
.filter { |stable_id, value| stable_id.present? && value.present? }
|
||||||
|
|
|
@ -4,7 +4,7 @@ class TypesDeChamp::PrefillRepetitionTypeDeChamp < TypesDeChamp::PrefillTypeDeCh
|
||||||
def possible_values
|
def possible_values
|
||||||
prefillable_subchamps.map do |prefill_type_de_champ|
|
prefillable_subchamps.map do |prefill_type_de_champ|
|
||||||
if prefill_type_de_champ.too_many_possible_values?
|
if prefill_type_de_champ.too_many_possible_values?
|
||||||
link = link_to "Voir toutes les valeurs possibles", Rails.application.routes.url_helpers.prefill_type_de_champ_path("piece-jointe", self)
|
link = link_to "Voir toutes les valeurs possibles", Rails.application.routes.url_helpers.prefill_type_de_champ_path("piece-jointe", prefill_type_de_champ)
|
||||||
"#{prefill_type_de_champ.libelle}: #{link}"
|
"#{prefill_type_de_champ.libelle}: #{link}"
|
||||||
else
|
else
|
||||||
"#{prefill_type_de_champ.libelle}: #{prefill_type_de_champ.possible_values_sentence}"
|
"#{prefill_type_de_champ.libelle}: #{prefill_type_de_champ.possible_values_sentence}"
|
||||||
|
|
Loading…
Reference in a new issue