2023-03-17 16:20:25 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Sidebars
|
|
|
|
module YourWork
|
|
|
|
class Panel < ::Sidebars::Panel
|
|
|
|
override :configure_menus
|
|
|
|
def configure_menus
|
|
|
|
add_menus
|
|
|
|
end
|
|
|
|
|
|
|
|
override :aria_label
|
|
|
|
def aria_label
|
|
|
|
_('Your work')
|
|
|
|
end
|
|
|
|
|
|
|
|
override :render_raw_scope_menu_partial
|
|
|
|
def render_raw_scope_menu_partial
|
|
|
|
"shared/nav/your_work_scope_header"
|
|
|
|
end
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
override :super_sidebar_context_header
|
|
|
|
def super_sidebar_context_header
|
|
|
|
@super_sidebar_context_header ||= {
|
|
|
|
title: aria_label,
|
|
|
|
icon: 'work'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2023-03-17 16:20:25 +05:30
|
|
|
private
|
|
|
|
|
|
|
|
def add_menus
|
|
|
|
add_menu(Sidebars::YourWork::Menus::ProjectsMenu.new(context))
|
|
|
|
add_menu(Sidebars::YourWork::Menus::GroupsMenu.new(context))
|
|
|
|
add_menu(Sidebars::YourWork::Menus::IssuesMenu.new(context))
|
|
|
|
add_menu(Sidebars::YourWork::Menus::MergeRequestsMenu.new(context))
|
|
|
|
add_menu(Sidebars::YourWork::Menus::TodosMenu.new(context))
|
|
|
|
add_menu(Sidebars::YourWork::Menus::MilestonesMenu.new(context))
|
|
|
|
add_menu(Sidebars::YourWork::Menus::SnippetsMenu.new(context))
|
|
|
|
add_menu(Sidebars::YourWork::Menus::ActivityMenu.new(context))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2023-05-27 22:25:52 +05:30
|
|
|
Sidebars::YourWork::Panel.prepend_mod_with('Sidebars::YourWork::Panel')
|