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

fix: paginator component turbo_frame #3183

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion app/components/avo/paginator_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ class Avo::PaginatorComponent < Avo::BaseComponent
prop :resource, _Nilable(Avo::BaseResource)
prop :parent_record, _Nilable(ActiveRecord::Base)
prop :pagy, _Nilable(Pagy)
prop :turbo_frame, _Nilable(String)
prop :turbo_frame, _Nilable(String) do |frame|
frame.present? ? CGI.escapeHTML(frame) : "_top"
end
prop :index_params, _Nilable(Hash)
prop :discreet_pagination, _Nilable(_Boolean)

Expand Down
4 changes: 2 additions & 2 deletions app/components/avo/views/resource_index_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<% if view_type.to_sym == :table || view_type.to_sym == :map %>
<% if @records.present? %>
<div class="mt-4 w-full">
<%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame || "none", index_params: @index_params, resource: @resource, parent_record: @parent_record, discreet_pagination: field&.discreet_pagination %>
<%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame, index_params: @index_params, resource: @resource, parent_record: @parent_record, discreet_pagination: field&.discreet_pagination %>
</div>
<% end %>
<% end %>
Expand All @@ -88,7 +88,7 @@
<%= render Avo::Index::ResourceGridComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_record: @parent_record, parent_resource: @parent_resource, actions: @actions) %>
</div>
<div class="mt-6">
<%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame || "none", index_params: @index_params, resource: @resource, parent_record: @parent_record, discreet_pagination: field&.discreet_pagination %>
<%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame, index_params: @index_params, resource: @resource, parent_record: @parent_record, discreet_pagination: field&.discreet_pagination %>
</div>
<% end %>
<% end %>
Expand Down
Loading