Class: Avo::SidebarComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Avo::SidebarComponent
- Defined in:
- app/components/avo/sidebar_component.rb
Instance Method Summary collapse
- #dashboards ⇒ Object
-
#initialize(sidebar_open: nil, for_mobile: false) ⇒ SidebarComponent
constructor
A new instance of SidebarComponent.
- #resources ⇒ Object
- #stimulus_target ⇒ Object
- #tools ⇒ Object
Constructor Details
#initialize(sidebar_open: nil, for_mobile: false) ⇒ SidebarComponent
Returns a new instance of SidebarComponent.
4 5 6 7 |
# File 'app/components/avo/sidebar_component.rb', line 4 def initialize(sidebar_open: nil, for_mobile: false) @sidebar_open = @for_mobile = for_mobile end |
Instance Method Details
#dashboards ⇒ Object
9 10 11 12 13 |
# File 'app/components/avo/sidebar_component.rb', line 9 def dashboards return [] unless Avo.plugin_manager.installed?("avo-dashboards") Avo::Dashboards.dashboard_manager. end |
#resources ⇒ Object
15 16 17 |
# File 'app/components/avo/sidebar_component.rb', line 15 def resources Avo.resource_manager. helpers._current_user end |
#stimulus_target ⇒ Object
23 24 25 |
# File 'app/components/avo/sidebar_component.rb', line 23 def stimulus_target @for_mobile ? "mobileSidebar" : "sidebar" end |
#tools ⇒ Object
19 20 21 |
# File 'app/components/avo/sidebar_component.rb', line 19 def tools Avo.tool_manager. end |