Skip to content

Commit

Permalink
Merge commit '862318ffddfddf81af77254811b3b11564be9ca1' into feature/…
Browse files Browse the repository at this point in the history
…import-2023-06-23
  • Loading branch information
maatinito committed Sep 6, 2023
2 parents 3c5e652 + 862318f commit 6642380
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/administrateurs/procedures_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ def procedure_params
:libelle,
:description,
:description_target_audience,
:description_pj,
:organisation,
:direction,
:lien_site_web,
Expand Down
1 change: 1 addition & 0 deletions app/models/procedure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# closed_at :datetime
# declarative_with_state :string
# description :string
# description_pj :string
# description_target_audience :string
# dossiers_count_computed_at :datetime
# duree_conservation_dossiers_dans_ds :integer
Expand Down
2 changes: 2 additions & 0 deletions app/views/administrateurs/procedures/_informations.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

= render Dsfr::InputComponent.new(form: f, attribute: :description_target_audience, input_type: :text_area, opts: {}, required: false)

= render Dsfr::InputComponent.new(form: f, attribute: :description_pj, input_type: :text_area, opts: {placeholder: t('activerecord.attributes.procedure.description_pj_placeholder')}, required: false)

= f.label :logo, 'Ajouter un logo de la démarche (facultatif)', class: 'fr-label'
= render Attachment::EditComponent.new(attached_file: @procedure.logo, view_as: :link)

Expand Down
10 changes: 9 additions & 1 deletion app/views/shared/_procedure_description.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@
#accordion-115.fr-collapse
= h render SimpleFormatComponent.new(procedure.description_target_audience, allow_a: true)
- if procedure.pieces_jointes_list?
- if procedure.description_pj.present?
%section.fr-accordion.pieces_jointes
%h2.fr-accordion__title
%button.fr-accordion__btn{ "aria-controls" => "accordion-116", "aria-expanded" => "false" }
= t('shared.procedure_description.pieces_jointes')
#accordion-116.fr-collapse
= h render SimpleFormatComponent.new(procedure.description_pj, allow_a: true)
- elsif procedure.pieces_jointes_list?
%section.fr-accordion.pieces_jointes
%h2.fr-accordion__title
%button.fr-accordion__btn{ "aria-controls" => "accordion-116", "aria-expanded" => "false" }
Expand Down
1 change: 1 addition & 0 deletions config/initializers/lograge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

config.lograge.keep_original_rails_log = true
config.lograge.logger = ActiveSupport::Logger.new(Rails.root.join('log', "logstash_#{Rails.env}.log"))
config.lograge.ignore_actions = ['PingController#index']
end

Rails.application.config.after_initialize do |app|
Expand Down
3 changes: 3 additions & 0 deletions config/locales/models/procedure/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ en:
hints:
description: Describe in a few lines the context, the aim etc.
description_target_audience: Describe in a few lines the final recipients of the process, the eligibility criteria if there are any, the prerequisites, etc.
description_pj: Describe the required attachments list if there is any
lien_site_web: "Exemple: 'https://exemple.gouv.fr/ma_demarche'"
cadre_juridique: "Exemple: 'https://www.legifrance.gouv.fr/'"
path: Public link
organisation: Service
description: What is the purpose of this procedure?
description_target_audience: Who is the procedure intended for?
description_pj: Required attachments list
description_pj_placeholder: If you leave this field blank and your form contains attachments, an automatically generated list will be displayed on the home page of your procedure.
lien_site_web: Where will users find the link to the procedure?
cadre_juridique: Link to the legal text
lien_dpo: Link or email to contact the data protection officer (DPO)
Expand Down
3 changes: 3 additions & 0 deletions config/locales/models/procedure/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fr:
hints:
description: Décrivez en quelques lignes le contexte, la finalité, etc.
description_target_audience: Décrivez en quelques lignes les destinataires finaux de la démarche, les critères d’éligibilité s’il y en a, les pré-requis, etc.
description_pj: Décrivez la liste des pièces jointes à fournir s’il y en a
lien_site_web: "Exemple: 'https://exemple.gouv.fr/ma_demarche'"
cadre_juridique: "Exemple: 'https://www.legifrance.gouv.fr/'"
path: Lien public
Expand All @@ -19,6 +20,8 @@ fr:
libelle: Titre de la démarche
description: Quel est l’objet de la démarche ?
description_target_audience: À qui s’adresse la démarche ?
description_pj: Liste des pièces jointes demandées
description_pj_placeholder: Si vous ne renseignez pas ce champ et que votre formulaire contient des pièces jointes, une liste générée automatiquement s'affichera dans la page d'accueil de votre démarche.
lien_site_web: Où les usagers trouveront-ils le lien vers la démarche ?
cadre_juridique: Lien vers le texte
lien_dpo: Lien ou email pour contacter le Délégué à la Protection des Données (DPO)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddPjFieldForDescriptionToProcedure < ActiveRecord::Migration[7.0]
def change
add_column :procedures, :description_pj, :string
end
end
7 changes: 7 additions & 0 deletions spec/views/shared/_procedure_description.html.haml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,12 @@
expect(rendered).to have_text('Libelle du champ')
expect(rendered).to have_selector('.pieces_jointes ul li', count: 2)
end

it 'shows the manual description pieces jointes list if admin filled one' do
procedure.update!(description_pj: 'une description des pj manuelle')
subject
expect(rendered).to have_text('Quelles sont les pièces justificatives à fournir')
expect(rendered).to have_text('une description des pj manuelle')
end
end
end

0 comments on commit 6642380

Please sign in to comment.