Class: SolidusAdmin::Roles::Index::Component
- Inherits:
-
UsersAndRoles::Component
- Object
- UsersAndRoles::Component
- SolidusAdmin::Roles::Index::Component
- Defined in:
- app/components/solidus_admin/roles/index/component.rb
Instance Method Summary collapse
- #batch_actions ⇒ Object
- #columns ⇒ Object
- #filters ⇒ Object
- #model_class ⇒ Object
- #page_actions ⇒ Object
- #row_url(role) ⇒ Object
- #scopes ⇒ Object
- #search_key ⇒ Object
- #search_url ⇒ Object
- #turbo_frames ⇒ Object
Instance Method Details
#batch_actions ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 36 def batch_actions [ { label: t('.batch_actions.delete'), action: solidus_admin.roles_path, method: :delete, icon: 'delete-bin-7-line', }, ] end |
#columns ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 58 def columns [ { header: :role, data: :name, }, { header: :description, data: :description, } ] end |
#filters ⇒ Object
54 55 56 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 54 def filters [] end |
#model_class ⇒ Object
4 5 6 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 4 def model_class Spree::Role end |
#page_actions ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 20 def page_actions render component("ui/button").new( tag: :a, text: t('.add'), href: solidus_admin.new_role_path, data: { turbo_frame: :new_role_modal }, icon: "add-line", ) end |
#row_url(role) ⇒ Object
16 17 18 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 16 def row_url(role) solidus_admin.edit_role_path(role, _turbo_frame: :edit_role_modal) end |
#scopes ⇒ Object
47 48 49 50 51 52 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 47 def scopes [ { name: :all, label: t('.scopes.all'), default: true }, { name: :admin, label: t('.scopes.admin') }, ] end |
#search_key ⇒ Object
8 9 10 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 8 def search_key :name_cont end |
#search_url ⇒ Object
12 13 14 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 12 def search_url solidus_admin.roles_path end |
#turbo_frames ⇒ Object
29 30 31 32 33 34 |
# File 'app/components/solidus_admin/roles/index/component.rb', line 29 def turbo_frames %w[ new_role_modal edit_role_modal ] end |