aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/urls.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/urls.js')
-rw-r--r--server/sonar-web/src/main/js/helpers/urls.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/helpers/urls.js b/server/sonar-web/src/main/js/helpers/urls.js
index 07103e12255..27c2ec6ee6c 100644
--- a/server/sonar-web/src/main/js/helpers/urls.js
+++ b/server/sonar-web/src/main/js/helpers/urls.js
@@ -100,16 +100,14 @@ export function getQualityProfileUrl(name, language, organization) {
return getProfilePath(name, language, organization);
}
-/**
- * Generate URL for a quality gate
- * @param {string} key
- * @returns {Object}
- */
-export function getQualityGateUrl(key) {
- return {
- pathname: '/quality_gates/show/' + encodeURIComponent(key)
- };
-}
+export const getQualityGateUrl = (key: string, organization?: string) => ({
+ pathname: getQualityGatesUrl(organization).pathname + '/show/' + encodeURIComponent(key)
+});
+
+export const getQualityGatesUrl = (organization?: string) => ({
+ pathname:
+ (organization ? '/organizations/' + encodeURIComponent(organization) : '') + '/quality_gates'
+});
/**
* Generate URL for the rules page