Skip to content

Commit

Permalink
Use ui/pages/index component in propertiies/index component
Browse files Browse the repository at this point in the history
  • Loading branch information
rainerdema authored and elia committed Jan 2, 2024
1 parent 6f264b4 commit 7973173
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 52 deletions.

This file was deleted.

35 changes: 17 additions & 18 deletions admin/app/components/solidus_admin/properties/index/component.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# frozen_string_literal: true

class SolidusAdmin::Properties::Index::Component < SolidusAdmin::BaseComponent
include SolidusAdmin::Layout::PageHelpers
class SolidusAdmin::Properties::Index::Component < SolidusAdmin::UI::Pages::Index::Component
def model_class
Spree::Property
end

def initialize(page:)
@page = page
def search_key
:name_cont
end

def title
Spree::Property.model_name.human.pluralize
def search_url
solidus_admin.properties_path
end

def prev_page_path
solidus_admin.url_for(**request.params, page: @page.number - 1, only_path: true) unless @page.first?
def row_url(property)
spree.admin_property_path(property)
end

def next_page_path
solidus_admin.url_for(**request.params, page: @page.next_param, only_path: true) unless @page.last?
def page_actions
render component("ui/button").new(
tag: :a,
text: t('.add'),
href: spree.new_admin_property_path,
icon: "add-line",
)
end

def batch_actions
Expand All @@ -30,14 +37,6 @@ def batch_actions
]
end

def scopes
[]
end

def filters
[]
end

def columns
[
name_column,
Expand Down

0 comments on commit 7973173

Please sign in to comment.