From ad0d0e393e5b3dfb602946a21646daf6d53dc7b8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 16 Mar 2023 15:12:00 +0100 Subject: [PATCH] ConfirmModalComponent is ready to receive `data-reflex` And not only `data-action` --- app/components/confirm_modal_component.rb | 3 ++- .../confirm_modal_component/confirm_modal_component.html.haml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/confirm_modal_component.rb b/app/components/confirm_modal_component.rb index d942ed5551..3a73af0e68 100644 --- a/app/components/confirm_modal_component.rb +++ b/app/components/confirm_modal_component.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true class ConfirmModalComponent < ModalComponent - def initialize(id:, confirm_actions: nil, controllers: nil, message: nil) + def initialize(id:, confirm_actions: nil, controllers: nil, message: nil, confirm_reflexes: nil) super(id: id, close_button: true) @confirm_actions = confirm_actions + @confirm_reflexes = confirm_reflexes @controllers = controllers @message = message end diff --git a/app/components/confirm_modal_component/confirm_modal_component.html.haml b/app/components/confirm_modal_component/confirm_modal_component.html.haml index 7da8ccebc6..0c507885ce 100644 --- a/app/components/confirm_modal_component/confirm_modal_component.html.haml +++ b/app/components/confirm_modal_component/confirm_modal_component.html.haml @@ -7,4 +7,4 @@ .modal-actions %input{ class: "button icon-plus #{close_button_class}", type: 'button', value: t('js.admin.modals.cancel'), "data-action": "click->modal#close" } - %input{ class: "button icon-plus primary", type: 'button', value: t('js.admin.modals.confirm'), "data-action": @confirm_actions } + %input{ class: "button icon-plus primary", type: 'button', value: t('js.admin.modals.confirm'), "data-action": @confirm_actions, "data-reflex": @confirm_reflexes }