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() { ...@@ -135,6 +135,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,8 +447,8 @@ ...@@ -447,8 +447,8 @@
} }
} }
.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;
...@@ -460,7 +460,7 @@ ...@@ -460,7 +460,7 @@
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);
&.issues-count { &.green-badge {
background-color: $green-500; background-color: $green-500;
} }
...@@ -472,7 +472,6 @@ ...@@ -472,7 +472,6 @@
background-color: $blue-500; background-color: $blue-500;
} }
} }
}
} }
@include media-breakpoint-down(xs) { @include media-breakpoint-down(xs) {
......
...@@ -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
......
...@@ -7,3 +7,6 @@ ...@@ -7,3 +7,6 @@
= link_to _("Submit feedback"), "https://about.gitlab.com/submit-feedback" = link_to _("Submit feedback"), "https://about.gitlab.com/submit-feedback"
- if current_user_menu?(:help) || current_user_menu?(:settings) || current_user_menu?(:profile) - if current_user_menu?(:help) || current_user_menu?(:settings) || current_user_menu?(:profile)
= render 'shared/user_dropdown_contributing_link' = 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 "" ...@@ -5936,6 +5936,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 ""
...@@ -8671,6 +8674,9 @@ msgstr "" ...@@ -8671,6 +8674,9 @@ msgstr ""
msgid "Switch branch/tag" msgid "Switch branch/tag"
msgstr "" msgstr ""
msgid "Switch to GitLab Next"
msgstr ""
msgid "System Hooks" msgid "System Hooks"
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