Skip to content

Commit

Permalink
Rename the batch_actions text key from display_name to label
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Jan 10, 2024
1 parent 64f6a58 commit 2adb60a
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def row_url(adjustment_reason)
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.adjustment_reasons_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def next_page_path
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.option_types_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.payment_methods_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.products_path,
method: :delete,
icon: 'delete-bin-7-line',
},
{
display_name: t('.batch_actions.discontinue'),
label: t('.batch_actions.discontinue'),
action: solidus_admin.discontinue_products_path,
method: :put,
icon: 'pause-circle-line',
},
{
display_name: t('.batch_actions.activate'),
label: t('.batch_actions.activate'),
action: solidus_admin.activate_products_path,
method: :put,
icon: 'play-circle-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.promotion_categories_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.promotions_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.properties_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.refund_reasons_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def row_url(return_reason)
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.return_reasons_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def search_url
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.shipping_categories_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.shipping_methods_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def search_key
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.stock_locations_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def search_key
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.store_credit_reasons_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.stores_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def search_key
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.tax_categories_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def search_key
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.tax_rates_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.taxonomies_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
4 changes: 2 additions & 2 deletions admin/app/components/solidus_admin/ui/table/component.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class SolidusAdmin::UI::Table::Component < SolidusAdmin::BaseComponent
BatchAction = Struct.new(:display_name, :icon, :action, :method, keyword_init: true) # rubocop:disable Lint/StructNewOverride
BatchAction = Struct.new(:label, :icon, :action, :method, keyword_init: true) # rubocop:disable Lint/StructNewOverride
Column = Struct.new(:header, :data, :col, :wrap, keyword_init: true)
Filter = Struct.new(:presentation, :combinator, :attribute, :predicate, :options, keyword_init: true)
Scope = Struct.new(:name, :label, :default, keyword_init: true)
Expand Down Expand Up @@ -108,7 +108,7 @@ def render_batch_action_button(batch_action)
form: batch_actions_form_id,
type: :submit,
icon: batch_action.icon,
text: batch_action.display_name,
text: batch_action.label,
scheme: :secondary,
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.users_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def page_actions
def batch_actions
[
{
display_name: t('.batch_actions.delete'),
label: t('.batch_actions.delete'),
action: solidus_admin.zones_path,
method: :delete,
icon: 'delete-bin-7-line',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def page_actions

def batch_actions
[{
display_name: "Print",
label: "Print",
action: "print",
}]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ def table_data(batch_actions, sortable)
def batch_actions_data
[
{
display_name: "Delete",
label: "Delete",
action: "#",
method: :delete,
icon: 'delete-bin-7-line',
},
{
display_name: "Discontinue",
label: "Discontinue",
action: "#",
method: :put,
icon: 'pause-circle-line',
},
{
display_name: "Activate",
label: "Activate",
action: "#",
method: :put,
icon: 'play-circle-line',
Expand Down

0 comments on commit 2adb60a

Please sign in to comment.