Commit 9ebe4510 authored by Clement Ho's avatar Clement Ho

Merge branch 'analytics-top-nav' into 'master'

Add top navigation analytics link

See merge request gitlab-org/gitlab-ce!30324
parents d61dab91 941f2e36
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
= link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets qa-snippets-link' do = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets qa-snippets-link' do
= _('Snippets') = _('Snippets')
= render_if_exists 'layouts/nav/sidebar/analytics_link'
- if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets]) - if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets])
%li.header-more.dropdown.d-xl-none{ class: ('d-lg-none' unless has_extra_nav_icons?) } %li.header-more.dropdown.d-xl-none{ class: ('d-lg-none' unless has_extra_nav_icons?) }
%a{ href: "#", data: { toggle: "dropdown" } } %a{ href: "#", data: { toggle: "dropdown" } }
...@@ -53,6 +55,9 @@ ...@@ -53,6 +55,9 @@
= nav_link(controller: 'dashboard/snippets') do = nav_link(controller: 'dashboard/snippets') do
= link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets' do = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets' do
= _('Snippets') = _('Snippets')
= render_if_exists 'layouts/nav/sidebar/analytics_more_link'
%li.dropdown.d-lg-none %li.dropdown.d-lg-none
= render_if_exists 'dashboard/operations/nav_link_list' = render_if_exists 'dashboard/operations/nav_link_list'
- if can?(current_user, :read_instance_statistics) - if can?(current_user, :read_instance_statistics)
......
...@@ -12,7 +12,7 @@ describe DashboardHelper do ...@@ -12,7 +12,7 @@ describe DashboardHelper do
it 'has all the expected links by default' do it 'has all the expected links by default' do
menu_items = [:projects, :groups, :activity, :milestones, :snippets] menu_items = [:projects, :groups, :activity, :milestones, :snippets]
expect(helper.dashboard_nav_links).to contain_exactly(*menu_items) expect(helper.dashboard_nav_links).to include(*menu_items)
end end
it 'does not contain cross project elements when the user cannot read cross project' do it 'does not contain cross project elements when the user cannot read cross project' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment