diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-06-07 18:57:24 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-06-07 18:57:24 +0300 |
commit | 3b3b705ab5ca690459e40a63e101372e34f2701b (patch) | |
tree | 0d506679e524fcabbfc7addab1d74778b517b6d1 /app/assets | |
parent | 570c4928aaca1a0842c2dfdc8240f99e72ba1fc4 (diff) | |
parent | cb6a16a2c6b15bbd51c02e74a6086ae33e83d3c8 (diff) |
Merge branch 'ide-url-util-relative-url-fix' into 'master'
Fixes IDE button on merge requests not working with relative URL config
Closes #46438
See merge request gitlab-org/gitlab-ce!19546
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/lib/utils/url_utility.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js index dd17544b656..72b72f4247d 100644 --- a/app/assets/javascripts/lib/utils/url_utility.js +++ b/app/assets/javascripts/lib/utils/url_utility.js @@ -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}`; + returnUrl += `project${route.replace(new RegExp(`^${gon.relative_url_root || ''}`), '')}`; } return returnUrl; } |