Merge pull request #4766 from betagouv/dev

2020-02-11-02
This commit is contained in:
LeSim 2020-02-11 16:10:15 +01:00 committed by GitHub
commit a75f1d7ae9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 25 deletions

View file

@ -4,31 +4,15 @@
%tr
%td.cell-label Libelle
%td.cell-label Type de champ
%td.cell-label Rempli
%td.cell-label Modifier le modèle
%tbody
- field.data.order(:order_place).each do |f|
%tr
%td.cell-data
= f.libelle
- if f.mandatory?
%span.mandatory{ style: 'color: #A10005;' } *
%td.cell-data
= I18n.t("activerecord.attributes.type_de_champ.type_champs.#{f.type_champ}")
- field.data.order(:order_place).each do |type_de_champ|
= render partial: 'fields/types_de_champ_collection_field/type_champ_line',
locals: { type_de_champ: type_de_champ }
%td.cell-data
- if f.blank?
vide
- else
rempli
%td.cell-data
- if f.type_champ == 'piece_justificative'
= form_for f,
url: change_piece_justificative_template_manager_procedure_path,
method: :post do |form|
= form.hidden_field :id
= form.file_field :piece_justificative_template
= form.submit 'modifier'
- if type_de_champ.type_champ == 'repetition'
- type_de_champ.types_de_champ.each do |sub_champ|
= render partial: 'fields/types_de_champ_collection_field/type_champ_line',
locals: { type_de_champ: sub_champ }
- else
Aucun

View file

@ -0,0 +1,16 @@
%tr
%td.cell-data
= type_de_champ.libelle
- if type_de_champ.mandatory?
%span.mandatory{ style: 'color: #A10005;' } *
%td.cell-data
= I18n.t("activerecord.attributes.type_de_champ.type_champs.#{type_de_champ.type_champ}")
%td.cell-data
- if type_de_champ.type_champ == 'piece_justificative'
= form_for type_de_champ,
url: change_piece_justificative_template_manager_procedure_path,
method: :post do |form|
= form.hidden_field :id
= form.file_field :piece_justificative_template
= form.submit 'modifier'

View file

@ -18,9 +18,9 @@
.contact-champ
= label_tag :type do
Votre problème
Votre question
%span.mandatory *
= select_tag :type, options_for_select(@options, params[:type]), include_blank: "Choisir un problème", required: true
= select_tag :type, options_for_select(@options, params[:type]), include_blank: "Choisir une question", required: true
.support.card.featured.hidden{ data: { 'contact-type-only': Helpscout::FormAdapter::TYPE_INFO } }
.card-title
@ -53,6 +53,24 @@
%br
%p Si vous souhaitez poser une question pour un problème technique sur le site, utilisez le formulaire ci-dessous. Nous ne pourrons pas vous renseigner sur l'instruction de votre dossier.
.support.card.featured.hidden{ data: { 'contact-type-only': Helpscout::FormAdapter::TYPE_AMELIORATION } }
.card-title
👉 Notre réponse
%p
Une idée ? Pensez à consulter notre
= succeed ' !' do
%strong
tableau de bord des améliorations
%p
%ul
%li • Votez pour vos améliorations prioritaires ;
%li • Proposez votre propre idée.
%p
%strong
%a{ href: 'https://demarches-simplifiees.featureupvote.com' }
➡ Accéder au tableau des améliorations
.contact-champ
= label_tag :dossier_id, 'Numéro du dossier concerné'
= text_field_tag :dossier_id, @dossier_id

View file

@ -11,4 +11,18 @@ describe Manager::ProceduresController, type: :controller do
it { expect(procedure.whitelisted_at).not_to be_nil }
end
describe '#show' do
render_views
let(:administration) { create(:administration) }
let!(:procedure) { create(:procedure, :with_repetition) }
before do
sign_in(administration)
get :show, params: { id: procedure.id }
end
it { expect(response.body).to include('sub type de champ') }
end
end

View file

@ -153,6 +153,15 @@ FactoryBot.define do
end
end
trait :with_repetition do
after(:build) do |procedure, _evaluator|
type_de_champ = create(:type_de_champ_repetition)
procedure.types_de_champ << type_de_champ
type_de_champ.types_de_champ << create(:type_de_champ, libelle: 'sub type de champ')
end
end
trait :published do
after(:build) do |procedure, _evaluator|
procedure.path = generate(:published_path)