Skip to content

Commit

Permalink
Add missing id attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdonarski committed Oct 6, 2023
1 parent 8c14fa8 commit 1ecdaeb
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/models/spree/admin/actions/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Spree
module Admin
module Actions
class Action
attr_reader :icon_name, :name, :classes, :text, :method
attr_reader :icon_name, :name, :classes, :text, :method, :id

def initialize(config)
@icon_name = config[:icon_name]
Expand All @@ -12,6 +12,7 @@ def initialize(config)
@availability_check = config[:availability_check]
@text = config[:text]
@method = config[:method]
@id = config[:id]
end

def available?(current_ability, resource = nil)
Expand Down
4 changes: 3 additions & 1 deletion app/models/spree/admin/actions/action_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def initialize(config)
@classes = config[:classes]
@availability_check = nil
@method = config[:method]
@id = config[:id]
end

def build
Expand All @@ -27,7 +28,8 @@ def build_config
classes: @classes,
availability_check: @availability_check,
text: text,
method: @method
method: @method,
id: @id
}
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def new_order_config
icon_name: 'add.svg',
name: :new_order,
url: new_admin_order_path,
classes: 'btn-success'
classes: 'btn-success',
id: 'admin_new_order'
}
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def new_product_config
icon_name: 'add.svg',
name: :new_product,
url: new_admin_product_path,
classes: 'btn-success'
classes: 'btn-success',
id: 'admin_new_product'
}
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def new_user_config
icon_name: 'add.svg',
name: :new_user,
url: new_admin_user_path,
classes: 'btn-success'
classes: 'btn-success',
id: 'admin_new_user_link'
}
end
end
Expand Down
3 changes: 2 additions & 1 deletion app/views/spree/admin/orders/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
action.text,
action.url,
class: action.classes,
icon: action.icon_name
icon: action.icon_name,
id: action.id
) %>
<% end %>
<% end %>
Expand Down
3 changes: 2 additions & 1 deletion app/views/spree/admin/products/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
action.text,
action.url,
class: action.classes,
icon: action.icon_name
icon: action.icon_name,
id: action.id
) %>
<% end %>
<% end %>
Expand Down
3 changes: 2 additions & 1 deletion app/views/spree/admin/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
action.text,
action.url,
class: action.classes,
icon: action.icon_name
icon: action.icon_name,
id: action.id
) %>
<% end %>
<% end %>
Expand Down

0 comments on commit 1ecdaeb

Please sign in to comment.