Sha256: 2e3fdf31b20da83cddc193dba658f3b55caf7df69094a0768b7dccc647ebe924

Contents?: true

Size: 643 Bytes

Versions: 10

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

class Avo::FiltersComponent < Avo::BaseComponent
  include Avo::ApplicationHelper

  prop :filters, default: [].freeze
  prop :resource
  prop :applied_filters, default: {}.freeze
  prop :parent_record

  def render?
    @filters.present?
  end

  def reset_path
    # If come from a association page
    if @parent_record.present?
      helpers.related_resources_path(@parent_record, @parent_record, encoded_filters: nil, reset_filter: true, keep_query_params: true)
    else
      helpers.resources_path(resource: @resource, encoded_filters: nil, reset_filter: true, keep_query_params: true)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
avo-3.15.1 app/components/avo/filters_component.rb
avo-3.15.0 app/components/avo/filters_component.rb
avo-3.14.5 app/components/avo/filters_component.rb
avo-3.14.4 app/components/avo/filters_component.rb
avo-3.14.3 app/components/avo/filters_component.rb
avo-3.14.2 app/components/avo/filters_component.rb
avo-3.14.1 app/components/avo/filters_component.rb
avo-3.14.0 app/components/avo/filters_component.rb
avo-3.13.7 app/components/avo/filters_component.rb
avo-3.13.6 app/components/avo/filters_component.rb