Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 18:09:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-12 18:09:37 +0300
commit2c89e169769ead722394a79ed67fcd08e96863dd (patch)
tree0dadb576846c484475b895f75fab41f71cdb952e /app/assets/javascripts/lib/utils/url_utility.js
parentbd497e352ebd279536ae11855871162e82a3f88c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/lib/utils/url_utility.js')
-rw-r--r--app/assets/javascripts/lib/utils/url_utility.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/lib/utils/url_utility.js b/app/assets/javascripts/lib/utils/url_utility.js
index 267b49e9d98..1ff4f7bab97 100644
--- a/app/assets/javascripts/lib/utils/url_utility.js
+++ b/app/assets/javascripts/lib/utils/url_utility.js
@@ -194,12 +194,14 @@ export function redirectTo(url) {
return window.location.assign(url);
}
+export const escapeFileUrl = fileUrl => encodeURIComponent(fileUrl).replace(/%2F/g, '/');
+
export function webIDEUrl(route = undefined) {
let returnUrl = `${gon.relative_url_root || ''}/-/ide/`;
if (route) {
returnUrl += `project${route.replace(new RegExp(`^${gon.relative_url_root || ''}`), '')}`;
}
- return returnUrl;
+ return escapeFileUrl(returnUrl);
}
/**
@@ -313,8 +315,6 @@ export const setUrlParams = (params, url = window.location.href, clearParams = f
return urlObj.toString();
};
-export const escapeFileUrl = fileUrl => encodeURIComponent(fileUrl).replace(/%2F/g, '/');
-
export function urlIsDifferent(url, compare = String(window.location)) {
return url !== compare;
}