Merge pull request #9234 from demarches-simplifiees/add-field-for-pj-for-description-procedure
[Page accueil demarche] Ajouter la possibilité de créer sa propre liste de PJ pour les Admins
This commit is contained in:
commit
862318ffdd
8 changed files with 31 additions and 1 deletions
|
@ -454,6 +454,7 @@ module Administrateurs
|
|||
:libelle,
|
||||
:description,
|
||||
:description_target_audience,
|
||||
:description_pj,
|
||||
:organisation,
|
||||
:direction,
|
||||
:lien_site_web,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
@ -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)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddPjFieldForDescriptionToProcedure < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_column :procedures, :description_pj, :string
|
||||
end
|
||||
end
|
|
@ -50,5 +50,12 @@ describe 'shared/_procedure_description', type: :view do
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue