Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9ebfe40a
Commit
9ebfe40a
authored
Dec 16, 2021
by
orozot
Committed by
Mayra Cabrera
Dec 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract canary toggle page url to a variable
parent
6568965c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
3 deletions
+20
-3
app/views/layouts/header/_current_user_dropdown.html.haml
app/views/layouts/header/_current_user_dropdown.html.haml
+1
-1
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+1
-1
app/views/layouts/header/_help_dropdown.html.haml
app/views/layouts/header/_help_dropdown.html.haml
+1
-1
lib/gitlab/saas.rb
lib/gitlab/saas.rb
+4
-0
spec/lib/gitlab/saas_spec.rb
spec/lib/gitlab/saas_spec.rb
+13
-0
No files found.
app/views/layouts/header/_current_user_dropdown.html.haml
View file @
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
...
...
app/views/layouts/header/_default.html.haml
View file @
9ebfe40a
...
...
@@ -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'
)
...
...
app/views/layouts/header/_help_dropdown.html.haml
View file @
9ebfe40a
...
...
@@ -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
lib/gitlab/saas.rb
View file @
9ebfe40a
...
...
@@ -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{
\A
https://[a-z0-9]+
\.
gitlab
\.
com
\z
}
.
freeze
end
...
...
spec/lib/gitlab/saas_spec.rb
0 → 100644
View file @
9ebfe40a
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment