]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19103 Update contextual information for New Code definition options
authorZipeng WU <zipeng.wu@sonarsource.com>
Mon, 8 May 2023 08:09:04 +0000 (10:09 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 9 May 2023 20:10:37 +0000 (20:10 +0000)
server/sonar-web/src/main/js/apps/projectBaseline/components/AppHeader.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/BaselineSettingReferenceBranch.tsx
server/sonar-web/src/main/js/apps/projectBaseline/components/ProjectBaselineSelector.tsx
server/sonar-web/src/main/js/apps/settings/components/NewCodePeriod.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 446bfeb698b0297ec7ca020d2bd85ba308f20164..5e20a0b36c70803a28260a1d3423824b7b70e892 100644 (file)
@@ -47,7 +47,7 @@ export default function AppHeader(props: AppHeaderProps) {
           }}
         />
       </p>
-      <p>
+      <p className="sw-mb-2">
         {canAdmin && (
           <FormattedMessage
             defaultMessage={translate('project_baseline.page.description2')}
@@ -63,6 +63,20 @@ export default function AppHeader(props: AppHeaderProps) {
         )}
       </p>
 
+      <p className="sw-mb-2">
+        <FormattedMessage
+          defaultMessage={translate('settings.new_code_period.description3')}
+          id="settings.new_code_period.description3"
+          values={{
+            link: (
+              <DocLink to="/project-administration/defining-new-code/">
+                {translate('settings.new_code_period.description3.link')}
+              </DocLink>
+            ),
+          }}
+        />
+      </p>
+
       <p className="sw-mt-4">
         <strong>{translate('project_baseline.page.question')}</strong>
       </p>
index a35a6c19f70095284d70020432a1aa056fa8a6ed..36f9b536d8e69311ef652557053be4754bb233f5 100644 (file)
@@ -102,7 +102,10 @@ export default function BaselineSettingReferenceBranch(props: BaselineSettingRef
       title={translate('baseline.reference_branch')}
     >
       <>
-        <p>{translate('baseline.reference_branch.description')}</p>
+        <div>
+          <p className="sw-mb-3">{translate('baseline.reference_branch.description')}</p>
+          <p className="sw-mb-4">{translate('baseline.reference_branch.usecase')}</p>
+        </div>
         {selected && (
           <>
             {settingLevel === 'project' && (
index ac0eb18dbeff2e660fdf11035eebad683bf958da..3010e74e10196d29bcd13cab99070293f6403d30 100644 (file)
@@ -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 (
-    <div className="general-setting">
-      <strong>{setting}</strong>: {description}
+    <div className="general-setting display-flex-start">
+      <span className="sw-font-bold flex-0">{setting}:&nbsp;</span>
+      <span>
+        {description} {useCase}
+      </span>
     </div>
   );
 }
index bce46eedbfcf2fdcc5b2b9757fdf38e5f5cb7b8e..ccd94da007e967ee5910d448283b406fe4450c90 100644 (file)
@@ -151,21 +151,26 @@ export default class NewCodePeriod extends React.PureComponent<{}, State> {
                       <p className="sw-mb-2">
                         {translate('settings.new_code_period.description0')}
                       </p>
+                      <p className="sw-mb-2">
+                        {translate('settings.new_code_period.description1')}
+                      </p>
+                      <p className="sw-mb-2">
+                        {translate('settings.new_code_period.description2')}
+                      </p>
 
                       <p className="sw-mb-2">
                         <FormattedMessage
-                          defaultMessage={translate('settings.new_code_period.description1')}
-                          id="settings.new_code_period.description1"
+                          defaultMessage={translate('settings.new_code_period.description3')}
+                          id="settings.new_code_period.description3"
                           values={{
                             link: (
                               <DocLink to="/project-administration/defining-new-code/">
-                                {translate('settings.new_code_period.description1.link')}
+                                {translate('settings.new_code_period.description3.link')}
                               </DocLink>
                             ),
                           }}
                         />
                       </p>
-                      <p>{translate('settings.new_code_period.description2')}</p>
 
                       <p className="sw-mt-4">
                         <strong>{translate('settings.new_code_period.question')}</strong>
index c37a64d1e7b3b40c0ae1aad47f67ac8724ddc8d3..4702ad16e86caa99460fe7c098d3ee1756fc123d 100644 (file)
@@ -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