From 48748d04ba6a59cbbcfa84ca07bc1a7e99829110 Mon Sep 17 00:00:00 2001 From: Andrey Luiz Date: Wed, 21 Jun 2023 14:17:48 +0200 Subject: [PATCH] New Code definition UX validation fixes (#8622) --- .../js/apps/create/project/CreateProjectPage.tsx | 2 +- .../src/main/js/apps/projectBaseline/styles.css | 4 ---- .../GlobalNewCodeDefinitionDescription.tsx | 13 ++++++++----- .../main/resources/org/sonar/l10n/core.properties | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx index 29f69c240c4..7b2abaa73dd 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPage.tsx @@ -329,7 +329,7 @@ export class CreateProjectPage extends React.PureComponent -
+
{translate('back')} hr { margin: 0 calc(-4 * var(--gridSize)) calc(4 * var(--gridSize)); } diff --git a/server/sonar-web/src/main/js/components/new-code-definition/GlobalNewCodeDefinitionDescription.tsx b/server/sonar-web/src/main/js/components/new-code-definition/GlobalNewCodeDefinitionDescription.tsx index 2751b703257..cf41e0236f6 100644 --- a/server/sonar-web/src/main/js/components/new-code-definition/GlobalNewCodeDefinitionDescription.tsx +++ b/server/sonar-web/src/main/js/components/new-code-definition/GlobalNewCodeDefinitionDescription.tsx @@ -53,11 +53,14 @@ export default function GlobalNewCodeDefinitionDescription({ return ( <> -
- {setting}:  - - {description} {useCase} - +
+ {setting} + {isGlobalNcdCompliant && ( + <> + {description} + {useCase} + + )}
{!isGlobalNcdCompliant && ( diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 0853667c347..99d7d002a8a 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3757,8 +3757,8 @@ new_code_definition.global_setting=Use the global setting new_code_definition.specific_setting=Define a specific setting for this project new_code_definition.compliance.warning.title.global=Your global new code definition is not compliant with the Clean as You Code methodology -new_code_definition.compliance.warning.explanation=Please ask an administrator to update the global new code definition before switching back to it. -new_code_definition.compliance.warning.explanation.admin=Please update the global new code definition under {link} before switching back to it. +new_code_definition.compliance.warning.explanation=Please ask an administrator to update the global new code definition before you can use it for your project. +new_code_definition.compliance.warning.explanation.admin=Please update the global new code definition under {link} before you can use it for your project. new_code_definition.compliance.warning.explanation.action.admin.link=General Settings > New Code new_code_definition.previous_version=Previous version -- 2.39.5