Class: Avo::SidebarComponent

Inherits:
BaseComponent show all
Defined in:
app/components/avo/sidebar_component.rb

Constant Summary

Constants included from Concerns::FindAssociationField

Concerns::FindAssociationField::ASSOCIATIONS

Instance Method Summary collapse

Methods inherited from BaseComponent

#component_name

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 included from Concerns::FindAssociationField

#find_association_field

Instance Method Details

#custom_sidebar_componentObject



31
32
33
# File 'app/components/avo/sidebar_component.rb', line 31

def custom_sidebar_component
  Avo::Sidebar::CustomSidebarComponent.new
end

#dashboardsObject



7
8
9
10
11
# File 'app/components/avo/sidebar_component.rb', line 7

def dashboards
  return [] unless Avo.plugin_manager.installed?("avo-dashboards")

  Avo::Dashboards.dashboard_manager.dashboards_for_navigation
end

#pagesObject



21
22
23
24
25
# File 'app/components/avo/sidebar_component.rb', line 21

def pages
  return [] unless Avo.plugin_manager.installed?("avo-forms")

  Avo::Forms::Core::Page.descendants.uniq(&:name).select(&:main_page?)
end

#render_custom_sidebar?Boolean

Returns:

  • (Boolean)


35
36
37
38
39
# File 'app/components/avo/sidebar_component.rb', line 35

def render_custom_sidebar?
  return false unless Avo.plugin_manager.installed?("avo-menu")

  custom_sidebar_component.render?
end

#resourcesObject



13
14
15
# File 'app/components/avo/sidebar_component.rb', line 13

def resources
  Avo.resource_manager.resources_for_navigation helpers._current_user
end

#stimulus_targetObject



27
28
29
# File 'app/components/avo/sidebar_component.rb', line 27

def stimulus_target
  @for_mobile ? "mobileSidebar" : "sidebar"
end

#toolsObject



17
18
19
# File 'app/components/avo/sidebar_component.rb', line 17

def tools
  Avo.tool_manager.tools_for_navigation
end