diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-04-18 21:04:01 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-04-25 18:36:56 +0300 |
commit | d275336b0b68f8b3c4e65cf754d5062d18ad9da4 (patch) | |
tree | 3768eeef168c4646a6473ed05f3a1603d45398fc /app/assets/javascripts/main.js | |
parent | e7c494cc08de77a8898a561016bd38abc903a5d8 (diff) |
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
Diffstat (limited to 'app/assets/javascripts/main.js')
-rw-r--r-- | app/assets/javascripts/main.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index 1b722c0505a..a2ca4b07a66 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -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', () => { |