Only renders Next badge for gitlab.com

This commit is contained in:
Filipa Lacerda 2019-05-07 07:43:52 +00:00 committed by Phil Hughes
parent bd73925b85
commit 2f8154a4e5
3 changed files with 23 additions and 5 deletions

View File

@ -136,10 +136,22 @@ function deferredInitialisation() {
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') {
document.querySelector('.js-canary-badge').classList.remove('hidden');
document.querySelector('.js-canary-link').classList.add('hidden');
const canaryBadge = document.querySelector('.js-canary-badge');
const canaryLink = document.querySelector('.js-canary-link');
if (canaryBadge) {
canaryBadge.classList.remove('hidden');
}
if (canaryLink) {
canaryLink.classList.add('hidden');
}
}
}

View File

@ -17,8 +17,9 @@
- 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 Gitlab.com?
%span.js-canary-badge.badge.badge-pill.green-badge.align-self-center
= _('Next')
- if current_user
= render "layouts/nav/dashboard"

View File

@ -0,0 +1,5 @@
---
title: Render Next badge only for gitlab.com
merge_request: 28056
author:
type: fixed