diff --git a/app/components/avo/paginator_component.rb b/app/components/avo/paginator_component.rb index 324d8ec85..1f93db803 100644 --- a/app/components/avo/paginator_component.rb +++ b/app/components/avo/paginator_component.rb @@ -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(_Union(String, Symbol)) do |frame| + frame.present? ? CGI.escapeHTML(frame) : :_top + end prop :index_params, _Nilable(Hash) prop :discreet_pagination, _Nilable(_Boolean) diff --git a/app/components/avo/views/resource_index_component.html.erb b/app/components/avo/views/resource_index_component.html.erb index 612d8c54f..89135d7ad 100644 --- a/app/components/avo/views/resource_index_component.html.erb +++ b/app/components/avo/views/resource_index_component.html.erb @@ -79,7 +79,7 @@ <% if view_type.to_sym == :table || view_type.to_sym == :map %> <% if @records.present? %>
- <%= 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 %>
<% end %> <% end %> @@ -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) %>
- <%= 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 %>
<% end %> <% end %>