From 3d5f7d3271020fa2cca9fc1f5ec5eb2bf2d2585e Mon Sep 17 00:00:00 2001 From: guillaume-peoch-sonarsource Date: Thu, 26 Oct 2023 15:35:38 +0200 Subject: [PATCH] SONAR-20901 Quality Gate can't be displayed in details if name contains % --- server/sonar-web/src/main/js/helpers/urls.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/sonar-web/src/main/js/helpers/urls.ts b/server/sonar-web/src/main/js/helpers/urls.ts index 99b03c8a463..3b302c6fb82 100644 --- a/server/sonar-web/src/main/js/helpers/urls.ts +++ b/server/sonar-web/src/main/js/helpers/urls.ts @@ -313,8 +313,10 @@ export function getQualityProfileUrl(name: string, language: string): To { } export function getQualityGateUrl(name: string): To { + // This is a workaround for the react router bug: https://github.com/remix-run/react-router/issues/10814 + const qualityGateName = name.replace(/%/g, '%25'); return { - pathname: '/quality_gates/show/' + encodeURIComponent(name), + pathname: '/quality_gates/show/' + encodeURIComponent(qualityGateName), }; } -- 2.39.5