Class: Avo::FiltersComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Avo::FiltersComponent
show all
- Includes:
- ApplicationHelper
- Defined in:
- app/components/avo/filters_component.rb
Instance Method Summary
collapse
#a_button, #a_link, #appearance_neutral_labels, #avo_appearance_t, #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, #manual_frame_cookie_name, #manual_frame_remembered?, #mount_path, #number_to_social, #possibly_rails_authentication?, #render_header_menu_items, #render_license_warning, #root_path_without_url, #rtl?, #safe_blob_path, #safe_blob_representation_url, #safe_blob_url, #text_direction, #ui, #wrap_in_modal
#summary_chart_params_for
#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
Instance Method Details
#applied_filters_count ⇒ Object
25
26
27
|
# File 'app/components/avo/filters_component.rb', line 25
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
12
13
14
|
# File 'app/components/avo/filters_component.rb', line 12
def render?
@filters.present?
end
|
#reset_path ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'app/components/avo/filters_component.rb', line 16
def reset_path
if @parent_record.present?
helpers.related_resources_path(@parent_record, @parent_record, parent_resource: @parent_resource, 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
|