From f311f9e7d8b18cbcf60096057e7a5fda408e2f1e Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Wed, 6 Dec 2023 16:57:29 +0100 Subject: [PATCH] fix actions multiples dropdown instruction --- app/assets/stylesheets/motivation.scss | 1 + .../dossiers/batch_operation_component.rb | 27 ++++++++++--------- .../batch_operation_component.fr.yml | 4 +-- ...eration_inline_buttons_component.html.haml | 4 +-- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/app/assets/stylesheets/motivation.scss b/app/assets/stylesheets/motivation.scss index fff6c80f0..0d824a311 100644 --- a/app/assets/stylesheets/motivation.scss +++ b/app/assets/stylesheets/motivation.scss @@ -18,6 +18,7 @@ textarea { margin-bottom: $default-spacer; + min-height: 10em; } .help { diff --git a/app/components/dossiers/batch_operation_component.rb b/app/components/dossiers/batch_operation_component.rb index 3164f91f7..74cb9dd7c 100644 --- a/app/components/dossiers/batch_operation_component.rb +++ b/app/components/dossiers/batch_operation_component.rb @@ -64,24 +64,27 @@ class Dossiers::BatchOperationComponent < ApplicationComponent label: t(".operations.accepter"), operation_description: t(".operations.accepter_description"), operation: BatchOperation.operations.fetch(:accepter), - 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', - placeholder: t(".placeholders.refuser") + operation_class_name: 'fr-icon-checkbox-circle-fill fr-text-default--success', + placeholder: t(".placeholders.accepter"), + instruction_operation: 'accept' }, { 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', - placeholder: t(".placeholders.classer_sans_suite") + operation_class_name: 'fr-icon-intermediate-circle-fill fr-text-mention--grey', + placeholder: t(".placeholders.classer_sans_suite"), + instruction_operation: 'without-continuation' + }, + + { + label: t(".operations.refuser"), + operation_description: t(".operations.refuser_description"), + operation: BatchOperation.operations.fetch(:refuser), + operation_class_name: 'fr-icon-close-circle-fill fr-text-default--warning', + placeholder: t(".placeholders.refuser"), + instruction_operation: 'refuse' } ] }, 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 ef7980d39..8358c19ca 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 @@ -16,5 +16,5 @@ fr: 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)" + refuser: "Expliquez aux demandeurs pourquoi leur dossier est refusé (obligatoire)" + classer_sans_suite: "Expliquez aux demandeurs pourquoi leur dossier est classé sans suite (obligatoire)" diff --git a/app/components/dossiers/batch_operation_inline_buttons_component/batch_operation_inline_buttons_component.html.haml b/app/components/dossiers/batch_operation_inline_buttons_component/batch_operation_inline_buttons_component.html.haml index f3f1e6ca5..733e3009c 100644 --- a/app/components/dossiers/batch_operation_inline_buttons_component/batch_operation_inline_buttons_component.html.haml +++ b/app/components/dossiers/batch_operation_inline_buttons_component/batch_operation_inline_buttons_component.html.haml @@ -5,13 +5,13 @@ - opt[:instruction].each do |opt| - menu.with_item do - = link_to('#', onclick: "DS.showMotivation(event, '#{opt[:operation_class_name]}');", role: 'menuitem') do + = link_to('#', onclick: "DS.showMotivation(event, '#{opt[:instruction_operation]}');", role: 'menuitem') do %span{ class: "icon #{opt[:operation_class_name]}" } .dropdown-description %h4= opt[:label] = opt[:operation_description] - menu.with_item(class: "hidden inactive form-inside fr-pt-1v") do - = render partial: 'instructeurs/dossiers/instruction_button_motivation_batch', locals: { instruction_operation: opt[:operation_class_name], form:, opt: } + = render partial: 'instructeurs/dossiers/instruction_button_motivation_batch', locals: { instruction_operation: opt[:instruction_operation], form:, opt: } - else = form.button opt[:label], class: ['fr-btn fr-btn--sm fr-btn--icon-left fr-ml-1w', icons[opt[:operation].to_sym]], disabled: true, name: "#{form.object_name}[operation]", value: opt[:operation], data: { operation: opt[:operation] }