]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20814 - Clean up new code on project settings
authorKevin Silva <kevin.silva@sonarsource.com>
Tue, 24 Oct 2023 11:16:29 +0000 (13:16 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 25 Oct 2023 20:02:59 +0000 (20:02 +0000)
server/sonar-web/src/main/js/app/components/GlobalContainer.tsx
server/sonar-web/src/main/js/apps/projectNewCode/components/AppHeader.tsx
server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx
server/sonar-web/src/main/js/apps/projectNewCode/styles.css

index d099db095adae68c04c8eb81dea644c196c1dddb..8193f3e2a34a801b4359f4f229791292567a11c3 100644 (file)
@@ -54,7 +54,11 @@ const TEMP_PAGELIST_WITH_NEW_BACKGROUND = [
   '/coding_rules',
 ];
 
-const TEMP_PAGELIST_WITH_NEW_BACKGROUND_WHITE = ['/tutorials', '/projects/create'];
+const TEMP_PAGELIST_WITH_NEW_BACKGROUND_WHITE = [
+  '/tutorials',
+  '/projects/create',
+  '/project/baseline',
+];
 
 export default function GlobalContainer() {
   // it is important to pass `location` down to `GlobalNav` to trigger render on url change
index 832b657ac30d605ba71ecf3e1eee08a301e7eb1d..fff02d0ccc126ee64874ec7ed1056f8fda07fc9f 100644 (file)
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { Link, Title } from 'design-system';
+import { HeadingDark, Link, Title } from 'design-system';
 import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
 import { useDocUrl } from '../../../helpers/docs';
@@ -51,7 +51,6 @@ export default function AppHeader(props: AppHeaderProps) {
           />
         )}
       </p>
-
       <p className="sw-mb-2">
         <FormattedMessage
           defaultMessage={translate('settings.new_code_period.description3')}
@@ -61,10 +60,9 @@ export default function AppHeader(props: AppHeaderProps) {
           }}
         />
       </p>
-
-      <p className="sw-mt-4">
-        <strong>{translate('project_baseline.page.question')}</strong>
-      </p>
+      <HeadingDark className="sw-mt-4" as="h2">
+        {translate('project_baseline.page.question')}
+      </HeadingDark>
     </header>
   );
 }
index 448f454a3051ab9eb0137ccc64bc85c2ae9318fe..94934c501052f102108387df807cde26d67f0784 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-import { HeadingDark } from 'design-system';
+import { HeadingDark, LargeCenteredLayout, PageContentFontWrapper, Spinner } from 'design-system';
 import React, { useCallback, useEffect, useMemo, useState } from 'react';
 import { Helmet } from 'react-helmet-async';
 import withAppStateContext from '../../../app/components/app-state/withAppStateContext';
@@ -27,7 +27,6 @@ import withAvailableFeatures, {
 } from '../../../app/components/available-features/withAvailableFeatures';
 import withComponentContext from '../../../app/components/componentContext/withComponentContext';
 import Suggestions from '../../../components/embed-docs-modal/Suggestions';
-import Spinner from '../../../components/ui/Spinner';
 import { isBranch, sortBranches } from '../../../helpers/branch-like';
 import { translate } from '../../../helpers/l10n';
 import {
@@ -181,16 +180,20 @@ function ProjectNewCodeDefinitionApp(props: Readonly<ProjectNewCodeDefinitionApp
   }, [resetStatesFromProjectNewCodeDefinition]);
 
   return (
-    <>
+    <LargeCenteredLayout id="new-code-rules-page">
       <Suggestions suggestions="project_baseline" />
       <Helmet defer={false} title={translate('project_baseline.page')} />
-      <div className="page page-limited">
+      <PageContentFontWrapper className="sw-my-8 sw-body-sm">
         <AppHeader canAdmin={!!appState.canAdmin} />
         <Spinner loading={isLoading} />
 
         {!isLoading && (
-          <div className="panel-white project-baseline">
-            {branchSupportEnabled && <h2>{translate('project_baseline.default_setting')}</h2>}
+          <div className="it__project-baseline">
+            {branchSupportEnabled && (
+              <HeadingDark as="h3" className="sw-mt-4">
+                {translate('project_baseline.default_setting')}
+              </HeadingDark>
+            )}
 
             {globalNewCodeDefinition && isSpecificNewCodeDefinition !== undefined && (
               <ProjectNewCodeDefinitionSelector
@@ -221,7 +224,7 @@ function ProjectNewCodeDefinitionApp(props: Readonly<ProjectNewCodeDefinitionApp
 
             {globalNewCodeDefinition && branchSupportEnabled && (
               <div className="sw-mt-6">
-                <HeadingDark className="sw-mb-4">
+                <HeadingDark as="h3" className="sw-mb-4">
                   {translate('project_baseline.configure_branches')}
                 </HeadingDark>
                 <BranchList
@@ -234,8 +237,8 @@ function ProjectNewCodeDefinitionApp(props: Readonly<ProjectNewCodeDefinitionApp
             )}
           </div>
         )}
-      </div>
-    </>
+      </PageContentFontWrapper>
+    </LargeCenteredLayout>
   );
 }
 
index 665f3fdf46690916b2e89fd22ab6a5d23540c1c3..dc17c4421a06ae6d73efa8b14ecca11d7b050388 100644 (file)
@@ -17,9 +17,6 @@
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-.project-baseline {
-  padding: calc(4 * var(--gridSize));
-}
 
 .branch-baseline-selector > hr {
   margin: 0 calc(-4 * var(--gridSize)) calc(4 * var(--gridSize));