2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
module DashboardHelper
|
2015-04-26 12:48:37 +05:30
|
|
|
def assigned_issues_dashboard_path
|
2019-02-15 15:39:39 +05:30
|
|
|
issues_dashboard_path(assignee_username: current_user.username)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
def assigned_mrs_dashboard_path
|
2019-02-15 15:39:39 +05:30
|
|
|
merge_requests_dashboard_path(assignee_username: current_user.username)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
2018-03-27 19:54:05 +05:30
|
|
|
|
|
|
|
def dashboard_nav_links
|
|
|
|
@dashboard_nav_links ||= get_dashboard_nav_links
|
|
|
|
end
|
|
|
|
|
|
|
|
def dashboard_nav_link?(link)
|
|
|
|
dashboard_nav_links.include?(link)
|
|
|
|
end
|
|
|
|
|
|
|
|
def any_dashboard_nav_link?(links)
|
|
|
|
links.any? { |link| dashboard_nav_link?(link) }
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def get_dashboard_nav_links
|
|
|
|
links = [:projects, :groups, :snippets]
|
|
|
|
|
|
|
|
if can?(current_user, :read_cross_project)
|
|
|
|
links += [:activity, :milestones]
|
|
|
|
end
|
|
|
|
|
|
|
|
links
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|