app/components/avo/index/resource_grid_component.html.erb in avo-2.53.0 vs app/components/avo/index/resource_grid_component.html.erb in avo-3.0.0.beta1

- old
+ new

@@ -1,14 +1,16 @@ <% if @resources.present?%> <div class="w-full grid grid-cols-1 xs:grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6 gap-6 mt-8" + data-component-name="<%= self.class.to_s.underscore %>" data-selected-resources-name="<%= @resource.model_key %>" data-selected-resources="[]"> <% @resources.each_with_index do |resource, index| %> - <% cache_if Avo.configuration.cache_resources_on_index_view, resource.cache_hash(@parent_model) do %> - <%= render(Avo::Index::GridItemComponent.new(resource: resource, reflection: @reflection, parent_model: @parent_model, parent_resource: @parent_resource)) %> + <% cache_if Avo.configuration.cache_resources_on_index_view, resource.cache_hash(@parent_record) do %> + <%= render(Avo::Index::GridItemComponent.new(resource: resource, reflection: @reflection, parent_record: @parent_record, parent_resource: @parent_resource, actions: actions)) %> <% end %> <% end %> </div> <% else %> - <div class="bg-white rounded shadow-panel"> + <div class="bg-white rounded shadow-panel" + data-component-name="<%= self.class.to_s.underscore %>"> <%= helpers.empty_state by_association: params[:related_name].present?, view_type: :grid %> </div> <% end %>