From a71bb217890cffa2d313bebf4940e172ef907d97 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Thu, 14 Dec 2023 00:32:40 +0500 Subject: [PATCH] 11068: update confirm_button_color to confirm_button_class --- app/components/confirm_modal_component.rb | 4 ++-- .../confirm_modal_component/confirm_modal_component.html.haml | 2 +- app/views/admin/products_v3/_delete_modals.html.haml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/confirm_modal_component.rb b/app/components/confirm_modal_component.rb index 32cdebe5ba..2aafd0bb37 100644 --- a/app/components/confirm_modal_component.rb +++ b/app/components/confirm_modal_component.rb @@ -9,7 +9,7 @@ class ConfirmModalComponent < ModalComponent message: nil, confirm_actions: nil, confirm_reflexes: nil, - confirm_button_color: :primary, + confirm_button_class: :primary, confirm_button_text: I18n.t('js.admin.modals.confirm'), cancel_button_text: I18n.t('js.admin.modals.cancel'), controller_data_values: {} @@ -20,7 +20,7 @@ class ConfirmModalComponent < ModalComponent @confirm_reflexes = confirm_reflexes @controller = controller @message = message - @confirm_button_color = confirm_button_color + @confirm_button_class = confirm_button_class @confirm_button_text = confirm_button_text @cancel_button_text = cancel_button_text @controller_data_values = transform_values_for_controller(controller_data_values) 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 3ab7e1b281..7d7b5cd77a 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: @cancel_button_text, "data-action": "click->modal#close" } - %input{ class: "button icon-plus #{@confirm_button_color}", type: 'button', value: @confirm_button_text, "data-action": @confirm_actions, "data-reflex": @confirm_reflexes } + %input{ class: "button icon-plus #{@confirm_button_class}", type: 'button', value: @confirm_button_text, "data-action": @confirm_actions, "data-reflex": @confirm_reflexes } diff --git a/app/views/admin/products_v3/_delete_modals.html.haml b/app/views/admin/products_v3/_delete_modals.html.haml index 5a8e9bd69c..d2091f792b 100644 --- a/app/views/admin/products_v3/_delete_modals.html.haml +++ b/app/views/admin/products_v3/_delete_modals.html.haml @@ -2,8 +2,8 @@ - delete_modal = ConfirmModalComponent.new(id: "delete_#{object_type}_#{object_id}", confirm_button_text: t(".delete_#{object_type}_modal.confirmation_text"), cancel_button_text: t(".delete_#{object_type}_modal.cancellation_text"), - confirm_button_color: :red, confirm_reflexes: nil, + confirm_button_class: :red, controller: "products", confirm_actions: "click->products#delete#{object_type.titleize}", controller_data_values: {"current-id": object_id},