Commit d275336b authored by Filipa Lacerda's avatar Filipa Lacerda

Adds information about Canary env

This commit adds a badge to the navbar
that indicates if Canary is being used
When canary is not being used, it renders a link
to next.gitlab.com
parent e7c494cc
......@@ -135,6 +135,12 @@ function deferredInitialisation() {
});
loadAwardsHandler();
// Toggle Canary Badge
if (Cookies.get('gitlab_canary') && Cookies.get('gitlab_canary') === 'true') {
document.querySelector('.js-canary-badge').classList.remove('hidden');
document.querySelector('.js-canary-link').classList.add('hidden');
}
}
document.addEventListener('DOMContentLoaded', () => {
......
......@@ -447,30 +447,29 @@
}
}
.title-container,
.navbar-nav {
li {
.badge.badge-pill {
position: inherit;
font-weight: $gl-font-weight-normal;
margin-left: -6px;
font-size: 11px;
color: $white-light;
padding: 0 5px;
line-height: 12px;
border-radius: 7px;
box-shadow: 0 1px 0 rgba($gl-header-color, 0.2);
&.issues-count {
background-color: $green-500;
}
.badge.badge-pill {
position: inherit;
font-weight: $gl-font-weight-normal;
margin-left: -6px;
font-size: 11px;
color: $white-light;
padding: 0 5px;
line-height: 12px;
border-radius: 7px;
box-shadow: 0 1px 0 rgba($gl-header-color, 0.2);
&.green-badge {
background-color: $green-500;
}
&.merge-requests-count {
background-color: $orange-600;
}
&.merge-requests-count {
background-color: $orange-600;
}
&.todos-count {
background-color: $blue-500;
}
&.todos-count {
background-color: $blue-500;
}
}
}
......
......@@ -17,6 +17,8 @@
- if logo_text.present?
%span.logo-text.d-none.d-lg-block.prepend-left-8
= logo_text
%span.js-canary-badge.badge.badge-pill.green-badge.align-self-center
= _('Next')
- if current_user
= render "layouts/nav/dashboard"
......@@ -38,7 +40,7 @@
= link_to assigned_issues_dashboard_path, title: _('Issues'), class: 'dashboard-shortcuts-issues', aria: { label: _('Issues') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('issues', size: 16)
- issues_count = assigned_issuables_count(:issues)
%span.badge.badge-pill.issues-count{ class: ('hidden' if issues_count.zero?) }
%span.badge.badge-pill.issues-count.green-badge{ class: ('hidden' if issues_count.zero?) }
= number_with_delimiter(issues_count)
- if header_link?(:merge_requests)
= nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter" }) do
......
......@@ -7,3 +7,6 @@
= 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 Gitlab.com?
%li.js-canary-link
= link_to _("Switch to GitLab Next"), "https://next.gitlab.com/"
---
title: Adds badge for Canary environment and help link
merge_request:
author:
type: added
......@@ -5936,6 +5936,9 @@ msgstr ""
msgid "Newly registered users will by default be external"
msgstr ""
msgid "Next"
msgstr ""
msgid "No"
msgstr ""
......@@ -8671,6 +8674,9 @@ msgstr ""
msgid "Switch branch/tag"
msgstr ""
msgid "Switch to GitLab Next"
msgstr ""
msgid "System Hooks"
msgstr ""
......
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