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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
02a2ca6a
Commit
02a2ca6a
authored
Jun 07, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes IDE button on merge requests not working with relative URL config
Closes #46438
parent
3094f1c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
app/assets/javascripts/lib/utils/url_utility.js
app/assets/javascripts/lib/utils/url_utility.js
+1
-1
changelogs/unreleased/ide-url-util-relative-url-fix.yml
changelogs/unreleased/ide-url-util-relative-url-fix.yml
+6
-0
spec/javascripts/lib/utils/url_utility_spec.js
spec/javascripts/lib/utils/url_utility_spec.js
+25
-0
No files found.
app/assets/javascripts/lib/utils/url_utility.js
View file @
02a2ca6a
...
@@ -87,7 +87,7 @@ export function redirectTo(url) {
...
@@ -87,7 +87,7 @@ export function redirectTo(url) {
export
function
webIDEUrl
(
route
=
undefined
)
{
export
function
webIDEUrl
(
route
=
undefined
)
{
let
returnUrl
=
`
${
gon
.
relative_url_root
}
/-/ide/`
;
let
returnUrl
=
`
${
gon
.
relative_url_root
}
/-/ide/`
;
if
(
route
)
{
if
(
route
)
{
returnUrl
+=
`project
${
route
}
`
;
returnUrl
+=
`project
${
route
.
replace
(
new
RegExp
(
`^
${
gon
.
relative_url_root
}
`
),
''
)
}
`
;
}
}
return
returnUrl
;
return
returnUrl
;
}
}
changelogs/unreleased/ide-url-util-relative-url-fix.yml
0 → 100644
View file @
02a2ca6a
---
title
:
Fixes Web IDE button on merge requests when GitLab is installed with relative
URL
merge_request
:
author
:
type
:
fixed
spec/javascripts/lib/utils/url_utility_spec.js
0 → 100644
View file @
02a2ca6a
import
{
webIDEUrl
}
from
'
~/lib/utils/url_utility
'
;
describe
(
'
URL utility
'
,
()
=>
{
describe
(
'
webIDEUrl
'
,
()
=>
{
describe
(
'
without relative_url_root
'
,
()
=>
{
it
(
'
returns IDE path with route
'
,
()
=>
{
expect
(
webIDEUrl
(
'
/gitlab-org/gitlab-ce/merge_requests/1
'
)).
toBe
(
'
/-/ide/project/gitlab-org/gitlab-ce/merge_requests/1
'
,
);
});
});
describe
(
'
with relative_url_root
'
,
()
=>
{
beforeEach
(()
=>
{
gon
.
relative_url_root
=
'
/gitlab
'
;
});
it
(
'
returns IDE path with route
'
,
()
=>
{
expect
(
webIDEUrl
(
'
/gitlab/gitlab-org/gitlab-ce/merge_requests/1
'
)).
toBe
(
'
/gitlab/-/ide/project/gitlab-org/gitlab-ce/merge_requests/1
'
,
);
});
});
});
});
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