Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: alias row to cluster #3669

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/avo/concerns/has_items.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def sidebar(**args, &block)
delegate :field, to: :items_holder
delegate :panel, to: :items_holder
delegate :row, to: :items_holder
delegate :cluster, to: :items_holder
delegate :tabs, to: :items_holder
delegate :tool, to: :items_holder
delegate :heading, to: :items_holder
Expand Down
5 changes: 4 additions & 1 deletion lib/avo/resources/items/holder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ def tab(name, **args, &block)
add_item Avo::Resources::Items::Tab::Builder.parse_block(name: name, parent: @parent, **args, &block)
end

def row(**args, &block)
def cluster(**args, &block)
add_item Avo::Resources::Items::Row::Builder.parse_block(parent: @parent, **args, &block)
end

# def row
alias_method :row, :cluster

def tool(klass, **args)
add_item klass.new(**args, view: self.parent.view, parent: self.parent)
end
Expand Down
1 change: 1 addition & 0 deletions lib/avo/resources/items/item_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Builder
delegate :heading, to: :items_holder
delegate :field, to: :items_holder
delegate :row, to: :items_holder
delegate :cluster, to: :items_holder
delegate :items, to: :items_holder
delegate :sidebar, to: :items_holder

Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/app/avo/resources/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def fields
"Software Engineer"
end

row do
cluster do
field :company, stacked: true do
"TechCorp Inc."
end
Expand Down
Loading