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
132db99a
Commit
132db99a
authored
Jun 07, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed karma
parent
02a2ca6a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
app/assets/javascripts/lib/utils/url_utility.js
app/assets/javascripts/lib/utils/url_utility.js
+2
-2
spec/javascripts/lib/utils/url_utility_spec.js
spec/javascripts/lib/utils/url_utility_spec.js
+4
-0
No files found.
app/assets/javascripts/lib/utils/url_utility.js
View file @
132db99a
...
...
@@ -85,9 +85,9 @@ export function redirectTo(url) {
}
export
function
webIDEUrl
(
route
=
undefined
)
{
let
returnUrl
=
`
${
gon
.
relative_url_root
}
/-/ide/`
;
let
returnUrl
=
`
${
gon
.
relative_url_root
||
''
}
/-/ide/`
;
if
(
route
)
{
returnUrl
+=
`project
${
route
.
replace
(
new
RegExp
(
`^
${
gon
.
relative_url_root
}
`
),
''
)}
`
;
returnUrl
+=
`project
${
route
.
replace
(
new
RegExp
(
`^
${
gon
.
relative_url_root
||
''
}
`
),
''
)}
`
;
}
return
returnUrl
;
}
spec/javascripts/lib/utils/url_utility_spec.js
View file @
132db99a
...
...
@@ -2,6 +2,10 @@ import { webIDEUrl } from '~/lib/utils/url_utility';
describe
(
'
URL utility
'
,
()
=>
{
describe
(
'
webIDEUrl
'
,
()
=>
{
afterEach
(()
=>
{
gon
.
relative_url_root
=
''
;
});
describe
(
'
without relative_url_root
'
,
()
=>
{
it
(
'
returns IDE path with route
'
,
()
=>
{
expect
(
webIDEUrl
(
'
/gitlab-org/gitlab-ce/merge_requests/1
'
)).
toBe
(
...
...
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