From: Zipeng WU Date: Mon, 8 May 2023 08:09:04 +0000 (+0200) Subject: SONAR-19103 Update contextual information for New Code definition options X-Git-Tag: 10.1.0.73491~325 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9e906a6151503e38c17a30529407be8f820aa158;p=sonarqube.git SONAR-19103 Update contextual information for New Code definition options --- diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx index 446bfeb698b..5e20a0b36c7 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx @@ -47,7 +47,7 @@ export default function AppHeader(props: AppHeaderProps) { }} />

-

+

{canAdmin && ( +

+ + {translate('settings.new_code_period.description3.link')} + + ), + }} + /> +

+

{translate('project_baseline.page.question')}

diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx index a35a6c19f70..36f9b536d8e 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx @@ -102,7 +102,10 @@ export default function BaselineSettingReferenceBranch(props: BaselineSettingRef title={translate('baseline.reference_branch')} > <> -

{translate('baseline.reference_branch.description')}

+
+

{translate('baseline.reference_branch.description')}

+

{translate('baseline.reference_branch.usecase')}

+
{selected && ( <> {settingLevel === 'project' && ( diff --git a/server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx b/server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx index ac0eb18dbef..3010e74e101 100644 --- a/server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx +++ b/server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx @@ -19,8 +19,8 @@ */ import classNames from 'classnames'; import * as React from 'react'; -import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; import Radio from '../../../components/controls/Radio'; +import { ResetButtonLink, SubmitButton } from '../../../components/controls/buttons'; import { Alert } from '../../../components/ui/Alert'; import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { translate, translateWithParameters } from '../../../helpers/l10n'; @@ -60,20 +60,26 @@ export interface ProjectBaselineSelectorProps { function renderGeneralSetting(generalSetting: NewCodePeriod) { let setting: string; let description: string; + let useCase: string; if (generalSetting.type === NewCodePeriodSettingType.NUMBER_OF_DAYS) { setting = `${translate('baseline.number_days')} (${translateWithParameters( 'duration.days', generalSetting.value || '?' )})`; description = translate('baseline.number_days.description'); + useCase = translate('baseline.number_days.usecase'); } else { setting = translate('baseline.previous_version'); description = translate('baseline.previous_version.description'); + useCase = translate('baseline.previous_version.usecase'); } return ( -
- {setting}: {description} +
+ {setting}:  + + {description} {useCase} +
); } diff --git a/server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx b/server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx index bce46eedbfc..ccd94da007e 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx @@ -151,21 +151,26 @@ export default class NewCodePeriod extends React.PureComponent<{}, State> {

{translate('settings.new_code_period.description0')}

+

+ {translate('settings.new_code_period.description1')} +

+

+ {translate('settings.new_code_period.description2')} +

- {translate('settings.new_code_period.description1.link')} + {translate('settings.new_code_period.description3.link')} ), }} />

-

{translate('settings.new_code_period.description2')}

{translate('settings.new_code_period.question')} 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 c37a64d1e7b..4702ad16e86 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -629,7 +629,7 @@ project_branch_pull_request.last_analysis_date=Last Analysis Date project_baseline.page=New Code project_baseline.page.description=The new code definition sets which part of your code will be considered new code. project_baseline.page.description2=You can adjust this setting globally in {link}. -project_baseline.page.description2.link=General settings +project_baseline.page.description2.link=General Settings project_baseline.page.question=What should be the baseline for new code for this project? project_baseline.default_setting=Project setting project_baseline.general_setting=Use the general setting @@ -637,16 +637,17 @@ project_baseline.specific_setting=Define a specific setting for this project project_baseline.configure_branches=Set a specific setting for a branch baseline.previous_version=Previous version -baseline.previous_version.usecase=Recommended for projects with regular versions or releases. -baseline.previous_version.description=All code that has changed since the previous version is considered new code. +baseline.previous_version.usecase=Recommended for projects following regular versions or releases. +baseline.previous_version.description=Any code that has changed since the previous version is considered new code. baseline.number_days=Number of days baseline.number_days.usecase=Recommended for projects following continuous delivery. -baseline.number_days.description=All code that has changed in the last x days is considered new code. +baseline.number_days.description=Any code that has changed in the last x days is considered new code. If no action is taken on a new issue after x days, this issue will become part of the overall code. baseline.specific_analysis=Specific analysis baseline.specific_analysis.description=Choose an analysis as the baseline for the new code. baseline.reference_branch=Reference branch baseline.reference_branch.description=Choose a branch as the baseline for the new code. +baseline.reference_branch.usecase=Recommended for projects using feature branches. baseline.reference_branch.description2=The branch you select as the reference branch will need its own new code definition to prevent it from using itself as a reference. baseline.specify_days=Specify a number of days @@ -1203,9 +1204,10 @@ settings.analysis_scope.wildcards.single_char=Match a single character settings.new_code_period.category=New Code settings.new_code_period.title=New Code settings.new_code_period.description0=The new code definition sets which part of your code will be considered new code. -settings.new_code_period.description1=This helps you focus attention on the most recent changes to your project, enabling you to follow the Clean as You Code methodology. {link}. -settings.new_code_period.description1.link=Learn more +settings.new_code_period.description1=This helps you focus attention on the most recent changes to your project, enabling you to follow the Clean as You Code methodology. settings.new_code_period.description2=A specific new code definition can be configured at project level. +settings.new_code_period.description3=Learn more: {link} +settings.new_code_period.description3.link=Defining New Code settings.new_code_period.question=What should be the baseline for new code for all projects by default? settings.languages.select_a_language_placeholder=Select a language