add placeholder for motivation field

This commit is contained in:
Lisa Durand 2023-07-06 14:20:16 +02:00
parent e1c7f2ac6f
commit ae55655014
7 changed files with 26 additions and 7 deletions

View file

@ -64,21 +64,24 @@ class Dossiers::BatchOperationComponent < ApplicationComponent
label: t(".operations.accepter"), label: t(".operations.accepter"),
operation_description: t(".operations.accepter_description"), operation_description: t(".operations.accepter_description"),
operation: BatchOperation.operations.fetch(:accepter), operation: BatchOperation.operations.fetch(:accepter),
operation_class_name: 'accept' operation_class_name: 'accept',
placeholder: t(".placeholders.accepter")
}, },
{ {
label: t(".operations.refuser"), label: t(".operations.refuser"),
operation_description: t(".operations.refuser_description"), operation_description: t(".operations.refuser_description"),
operation: BatchOperation.operations.fetch(:refuser), operation: BatchOperation.operations.fetch(:refuser),
operation_class_name: 'refuse' operation_class_name: 'refuse',
placeholder: t(".placeholders.refuser")
}, },
{ {
label: t(".operations.classer_sans_suite"), label: t(".operations.classer_sans_suite"),
operation_description: t(".operations.classer_sans_suite_description"), operation_description: t(".operations.classer_sans_suite_description"),
operation: BatchOperation.operations.fetch(:classer_sans_suite), operation: BatchOperation.operations.fetch(:classer_sans_suite),
operation_class_name: 'without-continuation' operation_class_name: 'without-continuation',
placeholder: t(".placeholders.classer_sans_suite")
} }
] ]
}, },

View file

@ -14,3 +14,7 @@ fr:
repasser_en_construction: 'Change selected files to in progress' repasser_en_construction: 'Change selected files to in progress'
other: Other batch operations other: Other batch operations
confirm: Do you confirm the batch operation for selected files ? 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)"

View file

@ -14,3 +14,7 @@ fr:
repasser_en_construction: 'Repasser les dossiers en construction' repasser_en_construction: 'Repasser les dossiers en construction'
other: Autres actions multiples other: Autres actions multiples
confirm: Confirmez-vous le traitement multiple des dossiers sélectionnés ? 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)"

View file

@ -1,3 +1,7 @@
--- ---
en: en:
instruct: Instruct the file 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)"

View file

@ -1,3 +1,7 @@
--- ---
fr: fr:
instruct: Instruire le dossier 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)"

View file

@ -12,7 +12,7 @@
Lusager sera informé que son dossier a été accepté Lusager sera informé que son dossier a été accepté
- menu.with_item(class: "hidden inactive form-inside") do - 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 - menu.with_item do
@ -23,7 +23,7 @@
Lusager sera informé que son dossier a été classé sans suite Lusager sera informé que son dossier a été classé sans suite
- menu.with_item(class: "hidden inactive form-inside") do - 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 - menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'refuse');", role: 'menuitem') do = link_to('#', onclick: "DS.showMotivation(event, 'refuse');", role: 'menuitem') do
@ -33,7 +33,7 @@
Lusager sera informé que son dossier a été refusé Lusager sera informé que son dossier a été refusé
- menu.with_item(class: "hidden inactive form-inside") do - 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? - if dossier.may_flag_as_pending_correction?
- menu.with_item do - menu.with_item do

View file

@ -1,5 +1,5 @@
%div{ class: "motivation #{instruction_operation}" } %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}" } .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) %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}" } .hidden{ id: "justificatif_motivation_import_#{instruction_operation}" }