Class: Avo::FiltersComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Avo::FiltersComponent
- Includes:
- ApplicationHelper
- Defined in:
- app/components/avo/filters_component.rb
Constant Summary
Constants included from Concerns::FindAssociationField
Concerns::FindAssociationField::ASSOCIATIONS
Instance Method Summary collapse
Methods included from ApplicationHelper
#a_button, #a_link, #body_classes, #button_classes, #chart_color, #container_classes, #d, #decode_filter_params, #e, #editor_file_path, #editor_url, #empty_state, #encode_filter_params, #frame_id, #get_model_class, #input_classes, #mount_path, #number_to_social, #possibly_rails_authentication?, #render_license_warning, #root_path_without_url, #rtl?, #text_direction, #ui, #wrap_in_modal
Methods included from ResourcesHelper
#field_wrapper, #filter_wrapper, #index_field_wrapper, #item_selector_data_attributes, #record_path, #record_title, #resource_for_record, #resource_grid, #resource_show_path, #resource_table
Methods inherited from BaseComponent
#component_name, #hotkey_badge
Methods included from Concerns::FindAssociationField
Instance Method Details
#applied_filters_count ⇒ Object
24 25 26 |
# File 'app/components/avo/filters_component.rb', line 24 def applied_filters_count @applied_filters_count ||= Avo::Filters::BasicFilters.to_be_applied(resource: @resource, applied_filters: @applied_filters).count { |_, value| value.present? } end |
#render? ⇒ Boolean
11 12 13 |
# File 'app/components/avo/filters_component.rb', line 11 def render? @filters.present? end |
#reset_path ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/components/avo/filters_component.rb', line 15 def reset_path # If come from a association page if @parent_record.present? helpers.(@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 |