debian-mirror-gitlab/lib/sidebars/your_work/menus/issues_menu.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
949 B
Ruby
Raw Normal View History

2023-03-17 16:20:25 +05:30
# frozen_string_literal: true
module Sidebars
module YourWork
module Menus
class IssuesMenu < ::Sidebars::Menu
include Gitlab::Utils::StrongMemoize
override :link
def link
issues_dashboard_path(assignee_username: @context.current_user.username)
end
override :title
def title
_('Issues')
end
override :sprite_icon
def sprite_icon
'issues'
end
override :render?
def render?
!!context.current_user
end
override :active_routes
def active_routes
{ path: 'dashboard#issues' }
end
override :has_pill?
def has_pill?
pill_count > 0
end
override :pill_count
def pill_count
context.current_user.assigned_open_issues_count
end
strong_memoize_attr :pill_count
end
end
end
end