Commit 298a6594 authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Phil Hughes

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 700d31da
...@@ -138,6 +138,12 @@ function deferredInitialisation() { ...@@ -138,6 +138,12 @@ function deferredInitialisation() {
}); });
loadAwardsHandler(); 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', () => { document.addEventListener('DOMContentLoaded', () => {
......
...@@ -447,30 +447,29 @@ ...@@ -447,30 +447,29 @@
} }
} }
.title-container,
.navbar-nav { .navbar-nav {
li { .badge.badge-pill {
.badge.badge-pill { position: inherit;
position: inherit; font-weight: $gl-font-weight-normal;
font-weight: $gl-font-weight-normal; margin-left: -6px;
margin-left: -6px; font-size: 11px;
font-size: 11px; color: $white-light;
color: $white-light; padding: 0 5px;
padding: 0 5px; line-height: 12px;
line-height: 12px; border-radius: 7px;
border-radius: 7px; box-shadow: 0 1px 0 rgba($gl-header-color, 0.2);
box-shadow: 0 1px 0 rgba($gl-header-color, 0.2);
&.green-badge {
&.issues-count { background-color: $green-500;
background-color: $green-500; }
}
&.merge-requests-count { &.merge-requests-count {
background-color: $orange-600; background-color: $orange-600;
} }
&.todos-count { &.todos-count {
background-color: $blue-500; background-color: $blue-500;
}
} }
} }
} }
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
- if logo_text.present? - if logo_text.present?
%span.logo-text.d-none.d-lg-block.prepend-left-8 %span.logo-text.d-none.d-lg-block.prepend-left-8
= logo_text = logo_text
%span.js-canary-badge.badge.badge-pill.green-badge.align-self-center
= _('Next')
- if current_user - if current_user
= render "layouts/nav/dashboard" = render "layouts/nav/dashboard"
...@@ -38,7 +40,7 @@ ...@@ -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 = 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) = sprite_icon('issues', size: 16)
- issues_count = assigned_issuables_count(:issues) - 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) = number_with_delimiter(issues_count)
- if header_link?(:merge_requests) - if header_link?(:merge_requests)
= nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter" }) do = nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter" }) do
......
...@@ -9,3 +9,6 @@ ...@@ -9,3 +9,6 @@
= render 'shared/user_dropdown_contributing_link' = render 'shared/user_dropdown_contributing_link'
- if instance_review_permitted? - if instance_review_permitted?
= render 'shared/user_dropdown_instance_review' = render 'shared/user_dropdown_instance_review'
- 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
...@@ -7825,6 +7825,9 @@ msgstr "" ...@@ -7825,6 +7825,9 @@ msgstr ""
msgid "Newly registered users will by default be external" msgid "Newly registered users will by default be external"
msgstr "" msgstr ""
msgid "Next"
msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
...@@ -11359,6 +11362,9 @@ msgstr "" ...@@ -11359,6 +11362,9 @@ msgstr ""
msgid "Switch branch/tag" msgid "Switch branch/tag"
msgstr "" msgstr ""
msgid "Switch to GitLab Next"
msgstr ""
msgid "Sync information" msgid "Sync information"
msgstr "" 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