From f96515bbe2fbbfb77f638a73dad7ed686e090c7f Mon Sep 17 00:00:00 2001 From: Kevin Silva Date: Tue, 24 Oct 2023 13:16:29 +0200 Subject: [PATCH] SONAR-20814 - Clean up new code on project settings --- .../js/app/components/GlobalContainer.tsx | 6 +++++- .../projectNewCode/components/AppHeader.tsx | 10 ++++----- .../ProjectNewCodeDefinitionApp.tsx | 21 +++++++++++-------- .../main/js/apps/projectNewCode/styles.css | 3 --- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/server/sonar-web/src/main/js/app/components/GlobalContainer.tsx b/server/sonar-web/src/main/js/app/components/GlobalContainer.tsx index d099db095ad..8193f3e2a34 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalContainer.tsx @@ -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 diff --git a/server/sonar-web/src/main/js/apps/projectNewCode/components/AppHeader.tsx b/server/sonar-web/src/main/js/apps/projectNewCode/components/AppHeader.tsx index 832b657ac30..fff02d0ccc1 100644 --- a/server/sonar-web/src/main/js/apps/projectNewCode/components/AppHeader.tsx +++ b/server/sonar-web/src/main/js/apps/projectNewCode/components/AppHeader.tsx @@ -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) { /> )}

-

- -

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

+ + {translate('project_baseline.page.question')} + ); } diff --git a/server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx b/server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx index 448f454a305..94934c50105 100644 --- a/server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectNewCode/components/ProjectNewCodeDefinitionApp.tsx @@ -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 + -
+ {!isLoading && ( -
- {branchSupportEnabled &&

{translate('project_baseline.default_setting')}

} +
+ {branchSupportEnabled && ( + + {translate('project_baseline.default_setting')} + + )} {globalNewCodeDefinition && isSpecificNewCodeDefinition !== undefined && ( - + {translate('project_baseline.configure_branches')} )} -
- + + ); } diff --git a/server/sonar-web/src/main/js/apps/projectNewCode/styles.css b/server/sonar-web/src/main/js/apps/projectNewCode/styles.css index 665f3fdf466..dc17c4421a0 100644 --- a/server/sonar-web/src/main/js/apps/projectNewCode/styles.css +++ b/server/sonar-web/src/main/js/apps/projectNewCode/styles.css @@ -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)); -- 2.39.5