Commit 2f8154a4 authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Phil Hughes

Only renders Next badge for gitlab.com

parent bd73925b
...@@ -136,10 +136,22 @@ function deferredInitialisation() { ...@@ -136,10 +136,22 @@ function deferredInitialisation() {
loadAwardsHandler(); loadAwardsHandler();
// Toggle Canary Badge /**
* Toggle Canary Badge
*
* For GitLab.com only, when the user is using canary
* we render a Next badge and hide the option to switch
* to canay
*/
if (Cookies.get('gitlab_canary') && Cookies.get('gitlab_canary') === 'true') { if (Cookies.get('gitlab_canary') && Cookies.get('gitlab_canary') === 'true') {
document.querySelector('.js-canary-badge').classList.remove('hidden'); const canaryBadge = document.querySelector('.js-canary-badge');
document.querySelector('.js-canary-link').classList.add('hidden'); const canaryLink = document.querySelector('.js-canary-link');
if (canaryBadge) {
canaryBadge.classList.remove('hidden');
}
if (canaryLink) {
canaryLink.classList.add('hidden');
}
} }
} }
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
- 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
- if Gitlab.com?
%span.js-canary-badge.badge.badge-pill.green-badge.align-self-center %span.js-canary-badge.badge.badge-pill.green-badge.align-self-center
= _('Next') = _('Next')
......
---
title: Render Next badge only for gitlab.com
merge_request: 28056
author:
type: fixed
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