Show navigation line separator when instance metrics is disabled

This commit is contained in:
George Tsiolis 2018-11-09 14:17:00 +02:00
parent 42873a191f
commit cd10655f53
2 changed files with 13 additions and 5 deletions

View File

@ -19,10 +19,7 @@ module NavHelper
end
def page_gutter_class
if current_path?('merge_requests#show') ||
current_path?('projects/merge_requests/conflicts#show') ||
current_path?('issues#show') ||
current_path?('milestones#show')
if page_has_markdown?
if cookies[:collapsed_gutter] == 'true'
%w[page-gutter right-sidebar-collapsed]
@ -50,6 +47,17 @@ module NavHelper
class_names
end
def show_separator?
Gitlab::Sherlock.enabled? || can?(current_user, :read_instance_statistics)
end
def page_has_markdown?
current_path?('merge_requests#show') ||
current_path?('projects/merge_requests/conflicts#show') ||
current_path?('issues#show') ||
current_path?('milestones#show')
end
private
def get_header_links

View File

@ -64,7 +64,7 @@
= link_to '#', class: 'dashboard-shortcuts-web-ide', title: _('Web IDE') do
= _('Web IDE')
- if Gitlab::Sherlock.enabled? || can?(current_user, :read_instance_statistics)
- if show_separator?
%li.line-separator.d-none.d-sm-block
= render_if_exists 'dashboard/operations/nav_link'
- if can?(current_user, :read_instance_statistics)