Commit a625161e authored by Phil Hughes's avatar Phil Hughes

Merge branch 'layouts-scb' into 'master'

Resolve CE/EE diffs in app/views/layouts view

Closes #6647

See merge request gitlab-org/gitlab-ee!12443
parents f5dd04e7 79ef8e10
......@@ -58,6 +58,14 @@ module NavHelper
current_path?('milestones#show')
end
def admin_monitoring_nav_links
%w(system_info background_jobs logs health_check requests_profiles)
end
def group_issues_sub_menu_items
%w(groups#issues labels#index milestones#index boards#index boards#show)
end
private
def get_header_links
......
......@@ -7,6 +7,7 @@ class DeviseMailer < Devise::Mailer
layout 'mailer/devise'
helper EmailsHelper
helper ApplicationHelper
protected
......
......@@ -77,4 +77,4 @@
= render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id')
= render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id')
= render 'layouts/snowplow' if Gitlab::CurrentSettings.snowplow_enabled?
= render_if_exists 'layouts/snowplow'
......@@ -64,9 +64,7 @@
%tbody
= yield
-# EE-specific start
= render 'layouts/mailer/additional_text'
-# EE-specific end
= render_if_exists 'layouts/mailer/additional_text'
%tr.footer
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:25px 0;font-size:13px;line-height:1.6;color:#5c5c5c;" }
......
......@@ -5,7 +5,7 @@
= render 'shared/outdated_browser'
.mobile-overlay
.alert-wrapper
= render "layouts/header/ee_license_banner"
= render_if_exists "layouts/header/ee_license_banner"
= render "layouts/broadcast"
= render "layouts/header/read_only_banner"
= render "layouts/nav/classification_level_banner"
......
......@@ -27,11 +27,8 @@
- if Gitlab::CurrentSettings.sign_in_text.present?
= markdown_field(Gitlab::CurrentSettings.current_application_settings, :sign_in_text)
- if Gitlab::CurrentSettings.help_text.present?
%h3= _("Need help?")
%hr
%p.slead
= markdown(Gitlab::CurrentSettings.help_text)
= render_if_exists 'layouts/devise_help_text'
.col-sm-5.new-session-forms-container
= yield
......
......@@ -8,8 +8,7 @@
= link_to _("Submit feedback"), "https://about.gitlab.com/submit-feedback"
- if current_user_menu?(:help) || current_user_menu?(:settings) || current_user_menu?(:profile)
= render 'shared/user_dropdown_contributing_link'
- if instance_review_permitted?
= render 'shared/user_dropdown_instance_review'
= render_if_exists 'shared/user_dropdown_instance_review'
- if Gitlab.com?
%li.js-canary-link
= link_to _("Switch to GitLab Next"), "https://next.gitlab.com/"
......@@ -4,6 +4,6 @@
-- <%# signature marker %>
<%= _("You're receiving this email because of your account on %{host}.") % { host: Gitlab.config.gitlab.host } %>
<%# EE-specific start %><%= render 'layouts/mailer/additional_text' %><%# EE-specific end %>
<%= render_if_exists 'layouts/mailer/additional_text' %>
<%= text_footer_message %>
......@@ -95,7 +95,4 @@
= link_to sherlock_transactions_path, class: 'admin-icon d-none d-lg-block d-xl-block', title: _('Sherlock Transactions'),
data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= icon('tachometer fw')
- if Gitlab::Geo.secondary? && Gitlab::Geo.primary_node_configured?
%li
= link_to Gitlab::Geo.primary_node.url, title: 'Go to primary node', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('location-dot', size: 18)
= render_if_exists 'layouts/nav/geo_primary_node_url'
......@@ -48,7 +48,7 @@
%span
= _('Gitaly Servers')
= nav_link(controller: %w(system_info background_jobs logs health_check requests_profiles audit_logs)) do
= nav_link(controller: admin_monitoring_nav_links) do
= link_to admin_system_info_path do
.nav-icon-container
= sprite_icon('monitor')
......@@ -81,7 +81,7 @@
= link_to admin_requests_profiles_path, title: _('Requests Profiles') do
%span
= _('Requests Profiles')
= render 'layouts/nav/ee/admin/new_monitoring_sidebar'
= render_if_exists 'layouts/nav/ee/admin/new_monitoring_sidebar'
= nav_link(controller: :broadcast_messages) do
= link_to admin_broadcast_messages_path do
......@@ -133,17 +133,7 @@
= _('Abuse Reports')
%span.badge.badge-pill.count.merge_counter.js-merge-counter.fly-out-badge= number_with_delimiter(AbuseReport.count(:all))
= nav_link(controller: :licenses) do
= link_to admin_license_path, class: "qa-link-license-menu" do
.nav-icon-container
= sprite_icon('license')
%span.nav-item-name
= _('License')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :licenses, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_license_path do
%strong.fly-out-top-item-name
= _('License')
= render_if_exists 'layouts/nav/sidebar/licenses_link'
- if instance_clusters_enabled?
= nav_link(controller: :clusters) do
......@@ -171,19 +161,9 @@
%strong.fly-out-top-item-name
= _('Spam Logs')
= nav_link(controller: :push_rules) do
= link_to admin_push_rule_path do
.nav-icon-container
= sprite_icon('push-rules')
%span.nav-item-name
= _('Push Rules')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :push_rules, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_push_rule_path do
%strong.fly-out-top-item-name
= _('Push Rules')
= render_if_exists 'layouts/nav/sidebar/push_rules_link'
= render 'layouts/nav/ee/admin/geo_sidebar'
= render_if_exists 'layouts/nav/ee/admin/geo_sidebar'
= nav_link(controller: :deploy_keys) do
= link_to admin_deploy_keys_path do
......
- issues_count = group_issues_count(state: 'opened')
- merge_requests_count = group_merge_requests_count(state: 'opened')
- issues_sub_menu_items = ['groups#issues', 'labels#index', 'milestones#index', 'boards#index', 'boards#show', 'issues_analytics#show']
.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) }
.nav-sidebar-inner-scroll
......@@ -51,7 +50,7 @@
= render_if_exists "layouts/nav/ee/epic_link", group: @group
- if group_sidebar_link?(:issues)
= nav_link(path: issues_sub_menu_items) do
= nav_link(path: group_issues_sub_menu_items) do
= link_to issues_group_path(@group) do
.nav-icon-container
= sprite_icon('issues')
......
......@@ -28,18 +28,8 @@
= link_to profile_account_path do
%strong.fly-out-top-item-name
= _('Account')
- if Gitlab::CurrentSettings.should_check_namespace_plan?
= nav_link(controller: :billings) do
= link_to profile_billings_path do
.nav-icon-container
= custom_icon('credit_card')
%span.nav-item-name
= _("Billing")
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :billings, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_billings_path do
%strong.fly-out-top-item-name
#{ _('Billing') }
= render_if_exists 'layouts/nav/sidebar/profile_billing_link'
= nav_link(controller: 'oauth/applications') do
= link_to applications_profile_path do
.nav-icon-container
......@@ -162,16 +152,7 @@
= link_to audit_log_profile_path do
%strong.fly-out-top-item-name
= _('Authentication Log')
= nav_link(path: 'profiles#pipeline_quota') do
= link_to profile_pipeline_quota_path do
.nav-icon-container
= custom_icon('pipeline')
%span.nav-item-name
= _('Pipeline quota')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(path: 'profiles#pipeline_quota', html_options: { class: "fly-out-top-item" } ) do
= link_to profile_pipeline_quota_path do
%strong.fly-out-top-item-name
= _('Pipeline quota')
= render_if_exists 'layouts/nav/sidebar/profile_pipeline_quota_link'
= render 'shared/sidebar_toggle_button'
......@@ -270,11 +270,7 @@
%span= _("Got it!")
= sprite_icon('thumb-up')
- if project_nav_tab? :feature_flags
= nav_link(controller: :feature_flags) do
= link_to project_feature_flags_path(@project), title: _('Feature Flags'), class: 'shortcuts-feature-flags' do
%span
= _('Feature Flags')
= render_if_exists 'layouts/nav/sidebar/project_feature_flags_link'
- if project_nav_tab? :container_registry
= nav_link(controller: %w[projects/registry/repositories]) do
......@@ -289,18 +285,7 @@
%strong.fly-out-top-item-name
= _('Registry')
- if project_nav_tab? :packages
= nav_link(controller: %w[projects/packages/packages]) do
= link_to project_packages_path(@project) do
.nav-icon-container
= sprite_icon('package')
%span.nav-item-name
= _('Packages')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: %w[projects/packages/packages], html_options: { class: "fly-out-top-item" } ) do
= link_to project_packages_path(@project) do
%strong.fly-out-top-item-name
= _('Packages')
= render_if_exists 'layouts/nav/sidebar/project_packages_link'
- if project_nav_tab? :wiki
- wiki_url = project_wiki_path(@project, :home)
......
......@@ -32,10 +32,5 @@
= email_action @target_url
-# EE-specific start
- if Gitlab::CurrentSettings.email_additional_text.present?
%br
%br
= Gitlab::Utils.nlbr(Gitlab::CurrentSettings.email_additional_text)
-# EE-specific end
= render_if_exists 'layouts/email_additional_text'
= html_footer_message
......@@ -12,6 +12,6 @@
<% end -%>
<%= "You're receiving this email because #{notification_reason_text(@reason)}." %>
<%# EE-specific start %><%= render 'layouts/mailer/additional_text' %><%# EE-specific end %>
<%= render_if_exists 'layouts/mailer/additional_text' %>
<%= text_footer_message -%>
......@@ -13,5 +13,17 @@ module EE
def page_has_markdown?
super || current_path?('epics#show')
end
override :admin_monitoring_nav_links
def admin_monitoring_nav_links
controllers = %w(audit_logs)
super.concat(controllers)
end
override :group_issues_sub_menu_items
def group_issues_sub_menu_items
controllers = %w(issues_analytics#show)
super.concat(controllers)
end
end
end
- if Gitlab::CurrentSettings.help_text.present?
%h3= _("Need help?")
%hr
%p.slead
= markdown(Gitlab::CurrentSettings.help_text)
- if Gitlab::CurrentSettings.email_additional_text.present?
%br
%br
= Gitlab::Utils.nlbr(Gitlab::CurrentSettings.email_additional_text)
- return unless Gitlab::CurrentSettings.snowplow_enabled?
-# haml-lint:disable InlineJavaScript
:javascript
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
......
- if Gitlab::Geo.secondary? && Gitlab::Geo.primary_node_configured?
%li
= link_to Gitlab::Geo.primary_node.url, title: 'Go to primary node', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('location-dot', size: 18)
= nav_link(controller: :licenses) do
= link_to admin_license_path, class: "qa-link-license-menu" do
.nav-icon-container
= sprite_icon('license')
%span.nav-item-name
= _('License')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :licenses, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_license_path do
%strong.fly-out-top-item-name
= _('License')
- if Gitlab::CurrentSettings.should_check_namespace_plan?
= nav_link(controller: :billings) do
= link_to profile_billings_path do
.nav-icon-container
= custom_icon('credit_card')
%span.nav-item-name
= _("Billing")
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :billings, html_options: { class: "fly-out-top-item" } ) do
= link_to profile_billings_path do
%strong.fly-out-top-item-name
#{ _('Billing') }
= nav_link(path: 'profiles#pipeline_quota') do
= link_to profile_pipeline_quota_path do
.nav-icon-container
= custom_icon('pipeline')
%span.nav-item-name
= _('Pipeline quota')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(path: 'profiles#pipeline_quota', html_options: { class: "fly-out-top-item" } ) do
= link_to profile_pipeline_quota_path do
%strong.fly-out-top-item-name
= _('Pipeline quota')
- if project_nav_tab? :feature_flags
= nav_link(controller: :feature_flags) do
= link_to project_feature_flags_path(@project), title: _('Feature Flags'), class: 'shortcuts-feature-flags' do
%span
= _('Feature Flags')
- if project_nav_tab? :packages
= nav_link(controller: %w[projects/packages/packages]) do
= link_to project_packages_path(@project) do
.nav-icon-container
= sprite_icon('package')
%span.nav-item-name
= _('Packages')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: %w[projects/packages/packages], html_options: { class: "fly-out-top-item" } ) do
= link_to project_packages_path(@project) do
%strong.fly-out-top-item-name
= _('Packages')
= nav_link(controller: :push_rules) do
= link_to admin_push_rule_path do
.nav-icon-container
= sprite_icon('push-rules')
%span.nav-item-name
= _('Push Rules')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :push_rules, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_push_rule_path do
%strong.fly-out-top-item-name
= _('Push Rules')
- return unless instance_review_permitted?
%li.divider
%li
= link_to admin_instance_review_path, target: '_blank', class: 'text-nowrap' do
......
......@@ -8,13 +8,16 @@ module QA
def self.prepended(page)
page.module_eval do
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
element :link_license_menu
element :admin_settings_template_item
end
view 'ee/app/views/layouts/nav/ee/admin/_geo_sidebar.html.haml' do
element :link_geo_menu
end
view 'ee/app/views/layouts/nav/sidebar/_licenses_link.html.haml' do
element :link_license_menu
end
end
end
......
......@@ -50,4 +50,16 @@ describe NavHelper do
expect(helper.header_links).to contain_exactly(:sign_in, :search)
end
end
context '.admin_monitoring_nav_links' do
subject { helper.admin_monitoring_nav_links }
it { is_expected.to all(be_a(String)) }
end
context '.group_issues_sub_menu_items' do
subject { helper.group_issues_sub_menu_items }
it { is_expected.to all(be_a(String)) }
end
end
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