From ae5565501496a0d8e95a8b49b1ab75b543566214 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Thu, 6 Jul 2023 14:20:16 +0200 Subject: [PATCH] add placeholder for motivation field --- app/components/dossiers/batch_operation_component.rb | 9 ++++++--- .../batch_operation_component.en.yml | 4 ++++ .../batch_operation_component.fr.yml | 4 ++++ .../instruction_menu_component.en.yml | 4 ++++ .../instruction_menu_component.fr.yml | 4 ++++ .../instructeurs/dossiers/_instruction_button.html.haml | 6 +++--- .../_instruction_button_motivation_batch.html.haml | 2 +- 7 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/components/dossiers/batch_operation_component.rb b/app/components/dossiers/batch_operation_component.rb index 14709bfa7..3164f91f7 100644 --- a/app/components/dossiers/batch_operation_component.rb +++ b/app/components/dossiers/batch_operation_component.rb @@ -64,21 +64,24 @@ class Dossiers::BatchOperationComponent < ApplicationComponent label: t(".operations.accepter"), operation_description: t(".operations.accepter_description"), operation: BatchOperation.operations.fetch(:accepter), - operation_class_name: 'accept' + operation_class_name: 'accept', + placeholder: t(".placeholders.accepter") }, { label: t(".operations.refuser"), operation_description: t(".operations.refuser_description"), operation: BatchOperation.operations.fetch(:refuser), - operation_class_name: 'refuse' + operation_class_name: 'refuse', + placeholder: t(".placeholders.refuser") }, { label: t(".operations.classer_sans_suite"), operation_description: t(".operations.classer_sans_suite_description"), operation: BatchOperation.operations.fetch(:classer_sans_suite), - operation_class_name: 'without-continuation' + operation_class_name: 'without-continuation', + placeholder: t(".placeholders.classer_sans_suite") } ] }, diff --git a/app/components/dossiers/batch_operation_component/batch_operation_component.en.yml b/app/components/dossiers/batch_operation_component/batch_operation_component.en.yml index e0197b398..fb10bc430 100644 --- a/app/components/dossiers/batch_operation_component/batch_operation_component.en.yml +++ b/app/components/dossiers/batch_operation_component/batch_operation_component.en.yml @@ -14,3 +14,7 @@ fr: repasser_en_construction: 'Change selected files to in progress' other: Other batch operations confirm: Do you confirm the batch operation for selected files ? + placeholders: + accepter: "Explain to users why their file is accepted (optional)" + refuser: "Explain to users why their file is refused (mandatory)" + classer_sans_suite: "Explain to users why their file is closed without continuation (mandatory)" diff --git a/app/components/dossiers/batch_operation_component/batch_operation_component.fr.yml b/app/components/dossiers/batch_operation_component/batch_operation_component.fr.yml index d908162f3..ef7980d39 100644 --- a/app/components/dossiers/batch_operation_component/batch_operation_component.fr.yml +++ b/app/components/dossiers/batch_operation_component/batch_operation_component.fr.yml @@ -14,3 +14,7 @@ fr: repasser_en_construction: 'Repasser les dossiers en construction' other: Autres actions multiples confirm: Confirmez-vous le traitement multiple des dossiers sélectionnés ? + placeholders: + accepter: "Expliquez aux demandeurs pourquoi leur dossier est accepté (facultatif)" + refuser: "Expliquez aux demandeurs pourquoi leur dossier est accepté (obligatoire)" + classer_sans_suite: "Expliquez aux demandeurs pourquoi leur dossier est accepté (obligatoire)" diff --git a/app/components/instructeurs/instruction_menu_component/instruction_menu_component.en.yml b/app/components/instructeurs/instruction_menu_component/instruction_menu_component.en.yml index 165ddbeaf..34a90708d 100644 --- a/app/components/instructeurs/instruction_menu_component/instruction_menu_component.en.yml +++ b/app/components/instructeurs/instruction_menu_component/instruction_menu_component.en.yml @@ -1,3 +1,7 @@ --- en: instruct: Instruct the file + placeholders: + accepter: "Explain to the user why this file is accepted (optional)" + refuser: "Explain to the user why this file is refused (mandatory)" + classer_sans_suite: "Explain to the user why this file is closed without continuation (mandatory)" diff --git a/app/components/instructeurs/instruction_menu_component/instruction_menu_component.fr.yml b/app/components/instructeurs/instruction_menu_component/instruction_menu_component.fr.yml index e82e45e9e..76d3c259a 100644 --- a/app/components/instructeurs/instruction_menu_component/instruction_menu_component.fr.yml +++ b/app/components/instructeurs/instruction_menu_component/instruction_menu_component.fr.yml @@ -1,3 +1,7 @@ --- fr: instruct: Instruire le dossier + placeholders: + accepter: "Expliquez au demandeur pourquoi ce dossier est accepté (facultatif)" + refuser: "Expliquez au demandeur pourquoi ce dossier est refusé (obligatoire)" + classer_sans_suite: "Expliquez au demandeur pourquoi ce dossier est classé sans suite (obligatoire)" diff --git a/app/views/instructeurs/dossiers/_instruction_button.html.haml b/app/views/instructeurs/dossiers/_instruction_button.html.haml index 85a5b10ca..5c528bcf9 100644 --- a/app/views/instructeurs/dossiers/_instruction_button.html.haml +++ b/app/views/instructeurs/dossiers/_instruction_button.html.haml @@ -12,7 +12,7 @@ L’usager sera informé que son dossier a été accepté - menu.with_item(class: "hidden inactive form-inside") do - = render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: 'Expliquez au demandeur pourquoi ce dossier est accepté (facultatif)', popup_class: 'accept', process_action: 'accepter', title: 'Accepter', confirm: "Confirmez-vous l'acceptation ce dossier ?" } + = render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: placeholder, popup_class: 'accept', process_action: 'accepter', title: 'Accepter', confirm: "Confirmez-vous l'acceptation ce dossier ?" } - menu.with_item do @@ -23,7 +23,7 @@ L’usager sera informé que son dossier a été classé sans suite - menu.with_item(class: "hidden inactive form-inside") do - = render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: 'Expliquez au demandeur pourquoi ce dossier est classé sans suite (obligatoire)', popup_class: 'without-continuation', process_action: 'classer_sans_suite', title: 'Classer sans suite', confirm: 'Confirmez-vous le classement sans suite de ce dossier ?' } + = render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: placeholder, popup_class: 'without-continuation', process_action: 'classer_sans_suite', title: 'Classer sans suite', confirm: 'Confirmez-vous le classement sans suite de ce dossier ?' } - menu.with_item do = link_to('#', onclick: "DS.showMotivation(event, 'refuse');", role: 'menuitem') do @@ -33,7 +33,7 @@ L’usager sera informé que son dossier a été refusé - menu.with_item(class: "hidden inactive form-inside") do - = render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: 'Expliquez au demandeur pourquoi ce dossier est refusé (obligatoire)', popup_class: 'refuse', process_action: 'refuser', title: 'Refuser', confirm: 'Confirmez-vous le refus de ce dossier ?' } + = render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: placeholder, popup_class: 'refuse', process_action: 'refuser', title: 'Refuser', confirm: 'Confirmez-vous le refus de ce dossier ?' } - if dossier.may_flag_as_pending_correction? - menu.with_item do diff --git a/app/views/instructeurs/dossiers/_instruction_button_motivation_batch.html.haml b/app/views/instructeurs/dossiers/_instruction_button_motivation_batch.html.haml index b336f23e9..654babf26 100644 --- a/app/views/instructeurs/dossiers/_instruction_button_motivation_batch.html.haml +++ b/app/views/instructeurs/dossiers/_instruction_button_motivation_batch.html.haml @@ -1,5 +1,5 @@ %div{ class: "motivation #{instruction_operation}" } - = form.text_area :motivation, class: "fr-input js_batch_operation_motivation_#{instruction_operation}" + = form.text_area :motivation, class: "fr-input js_batch_operation_motivation_#{instruction_operation}", placeholder: opt[:placeholder] .optional-justificatif{ id: "justificatif_motivation_suggest_#{instruction_operation}" } %button.fr-btn.fr-btn--sm.fr-btn--tertiary-no-outline.fr-btn--icon-left.fr-icon-attachment-line.fr-ml-0{ type: 'button', onclick: "DS.showImportJustificatif('#{instruction_operation}');" } Ajouter un justificatif (optionnel) .hidden{ id: "justificatif_motivation_import_#{instruction_operation}" }