Commit ec8c6adf authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '348319-extract-next-gitlab-url-to-variable' into 'master'

Extract canary toggle page url to a variable

See merge request gitlab-org/gitlab!76676
parents 02917968 9ebfe40a
......@@ -45,7 +45,7 @@
= render 'shared/user_dropdown_instance_review'
- if Gitlab.com_but_not_canary?
%li.d-md-none
= link_to _("Switch to GitLab Next"), "https://next.gitlab.com/"
= link_to _("Switch to GitLab Next"), Gitlab::Saas.canary_toggle_com_url
- if current_user_menu?(:sign_out)
%li.divider
......
......@@ -15,7 +15,7 @@
%span.logo-text.d-none.d-lg-block.gl-ml-3
= logo_text
- if Gitlab.com_and_canary?
= link_to 'https://next.gitlab.com', class: 'canary-badge bg-transparent', data: { qa_selector: 'canary_badge_link' }, target: :_blank, rel: :_noopener do
= link_to Gitlab::Saas.canary_toggle_com_url, class: 'canary-badge bg-transparent', data: { qa_selector: 'canary_badge_link' }, target: :_blank, rel: 'noopener noreferrer' do
%span.gl-badge.gl-bg-green-500.gl-text-white.gl-rounded-pill.gl-font-weight-bold.gl-py-1
= _('Next')
......
......@@ -20,4 +20,4 @@
= render 'shared/user_dropdown_instance_review'
- if Gitlab.com_but_not_canary?
%li
= link_to _("Switch to GitLab Next"), "https://next.gitlab.com/"
= link_to _("Switch to GitLab Next"), Gitlab::Saas.canary_toggle_com_url
......@@ -13,6 +13,10 @@ module Gitlab
'https://staging.gitlab.com'
end
def self.canary_toggle_com_url
'https://next.gitlab.com'
end
def self.subdomain_regex
%r{\Ahttps://[a-z0-9]+\.gitlab\.com\z}.freeze
end
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Saas do
describe '.canary_toggle_com_url' do
subject { described_class.canary_toggle_com_url }
let(:next_url) { 'https://next.gitlab.com' }
it { is_expected.to eq(next_url) }
end
end
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