From 6a8eba1b0a016b92f5b57d294c33d0c4b18f0367 Mon Sep 17 00:00:00 2001 From: Viktor Vorona Date: Mon, 19 Jun 2023 13:22:59 +0200 Subject: [PATCH] SONAR-19613 Move Project Info from sidebar to separate page --- .../src/components/Title.tsx} | 43 +++--- .../design-system/src/components/index.ts | 1 + .../js/app/components/ComponentContainer.tsx | 3 +- .../components/nav/component/ComponentNav.tsx | 18 +-- .../js/app/components/nav/component/Menu.tsx | 5 +- .../component/__tests__/ComponentNav-test.tsx | 6 +- .../projectInformation/InfoDrawer.css | 66 -------- .../projectInformation/InfoDrawer.tsx | 57 ------- .../projectInformation/InfoDrawerPage.tsx | 58 ------- .../projectInformation/ProjectInformation.css | 46 ------ .../projectInformation/ProjectInformation.tsx | 126 --------------- .../src/main/js/app/utils/startReactApp.tsx | 2 + .../js/apps/account/projects/ProjectCard.tsx | 2 +- .../ProjectInformationApp.tsx | 144 ++++++++++++++++++ .../about/AboutProject.tsx} | 84 ++-------- .../projectInformation/badges/BadgeButton.tsx | 4 +- .../projectInformation/badges/BadgeParams.tsx | 10 +- .../badges/ProjectBadges.tsx | 23 ++- .../badges/__tests__/ProjectBadges-test.tsx | 20 +-- .../badges/__tests__/utils-test.ts | 6 +- .../projectInformation/badges/styles.css | 0 .../projectInformation/badges/utils.ts | 6 +- .../projectInformation/meta/MetaKey.tsx | 4 +- .../projectInformation/meta/MetaLink.tsx | 10 +- .../projectInformation/meta/MetaLinks.tsx | 8 +- .../meta/MetaQualityGate.tsx | 6 +- .../meta/MetaQualityProfiles.tsx | 16 +- .../projectInformation/meta/MetaSize.tsx | 14 +- .../projectInformation/meta/MetaTags.tsx | 16 +- .../meta/MetaTagsSelector.tsx | 4 +- .../meta/__tests__/MetaKey-test.tsx | 4 +- .../__tests__/MetaQualityProfiles-test.tsx | 16 +- .../meta/__tests__/MetaTags-test.tsx | 14 +- .../notifications/ProjectNotifications.tsx | 16 +- .../__tests__/ProjectNotifications-test.tsx | 15 +- .../RegulatoryReport.tsx | 20 +-- .../RegulatoryReportModal.tsx | 10 +- .../__tests__/RegulatoryReport-it.tsx | 8 +- .../projectInformation/routes.tsx} | 12 +- 39 files changed, 314 insertions(+), 609 deletions(-) rename server/sonar-web/{src/main/js/app/components/nav/component/projectInformation/DrawerLink.tsx => design-system/src/components/Title.tsx} (59%) delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.css delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawerPage.tsx delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.css delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx create mode 100644 server/sonar-web/src/main/js/apps/projectInformation/ProjectInformationApp.tsx rename server/sonar-web/src/main/js/{app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx => apps/projectInformation/about/AboutProject.tsx} (51%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/badges/BadgeButton.tsx (92%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/badges/BadgeParams.tsx (92%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/badges/ProjectBadges.tsx (87%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/badges/__tests__/ProjectBadges-test.tsx (85%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/badges/__tests__/utils-test.ts (92%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/badges/styles.css (100%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/badges/utils.ts (93%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/MetaKey.tsx (91%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/MetaLink.tsx (87%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/MetaLinks.tsx (88%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/MetaQualityGate.tsx (88%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/MetaQualityProfiles.tsx (88%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/MetaSize.tsx (84%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/MetaTags.tsx (82%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/MetaTagsSelector.tsx (93%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/__tests__/MetaKey-test.tsx (89%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx (83%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/meta/__tests__/MetaTags-test.tsx (89%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/notifications/ProjectNotifications.tsx (87%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/notifications/__tests__/ProjectNotifications-test.tsx (85%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx (90%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/projectRegulatoryReport/RegulatoryReportModal.tsx (80%) rename server/sonar-web/src/main/js/{app/components/nav/component => apps}/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx (93%) rename server/sonar-web/src/main/js/{app/components/nav/component/projectInformation/ProjectInformationPages.ts => apps/projectInformation/routes.tsx} (77%) diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/DrawerLink.tsx b/server/sonar-web/design-system/src/components/Title.tsx similarity index 59% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/DrawerLink.tsx rename to server/sonar-web/design-system/src/components/Title.tsx index ea4faa6cb62..3e4b8d26969 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/DrawerLink.tsx +++ b/server/sonar-web/design-system/src/components/Title.tsx @@ -17,29 +17,28 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as React from 'react'; -import ChevronRightIcon from '../../../../../components/icons/ChevronRightIcon'; +import styled from '@emotion/styled'; +import tw from 'twin.macro'; +import { themeColor } from '../helpers/theme'; -export interface DrawerLinkProps

{ - label: string; - onPageChange: (page: P) => void; - to: P; -} +export const Title = styled.h1` + ${tw`sw-heading-lg`} + ${tw`sw-mb-4`} + color: ${themeColor('pageTitle')}; +`; -export function DrawerLink

(props: DrawerLinkProps

) { - const { label, to } = props; +export const SubTitle = styled.h2` + ${tw`sw-heading-md`} + ${tw`sw-mb-4`} + color: ${themeColor('pageTitle')}; +`; - return ( - props.onPageChange(to)} - role="link" - tabIndex={0} - > - {label} - - - ); -} +export const SubHeading = styled.h3` + ${tw`sw-body-md-highlight`} + ${tw`sw-mb-2`} + color: ${themeColor('pageContent')}; +`; -export default React.memo(DrawerLink); +export const SubHeadingHighlight = styled(SubHeading)` + color: ${themeColor('pageContentDark')}; +`; diff --git a/server/sonar-web/design-system/src/components/index.ts b/server/sonar-web/design-system/src/components/index.ts index c8d59d982b1..ba3cb3bc20a 100644 --- a/server/sonar-web/design-system/src/components/index.ts +++ b/server/sonar-web/design-system/src/components/index.ts @@ -81,6 +81,7 @@ export * from './Table'; export * from './Tags'; export * from './TagsSelector'; export * from './Text'; +export * from './Title'; export { ToggleButton } from './ToggleButton'; export { TopBar } from './TopBar'; export * from './TreeMap'; diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index bddd03d7ae9..0f01470dd74 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -46,11 +46,11 @@ import { Feature } from '../../types/features'; import { Task, TaskStatuses, TaskTypes, TaskWarning } from '../../types/tasks'; import { Component, Status } from '../../types/types'; import handleRequiredAuthorization from '../utils/handleRequiredAuthorization'; +import ComponentContainerNotFound from './ComponentContainerNotFound'; import withAvailableFeatures, { WithAvailableFeaturesProps, } from './available-features/withAvailableFeatures'; import withBranchStatusActions from './branch-status/withBranchStatusActions'; -import ComponentContainerNotFound from './ComponentContainerNotFound'; import { ComponentContext } from './componentContext/ComponentContext'; import PageUnavailableDueToIndexation from './indexation/PageUnavailableDueToIndexation'; import ComponentNav from './nav/component/ComponentNav'; @@ -456,7 +456,6 @@ export class ComponentContainer extends React.PureComponent { currentTaskOnSameBranch={currentTask && this.isSameBranch(currentTask, branchLike)} isInProgress={isInProgress} isPending={isPending} - onComponentChange={this.handleComponentChange} onWarningDismiss={this.handleWarningDismiss} projectBinding={projectBinding} projectBindingErrors={projectBindingErrors} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx index 98c59386a46..361f3d68d43 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.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 { LAYOUT_GLOBAL_NAV_HEIGHT, LAYOUT_PROJECT_NAV_HEIGHT, TopBar } from 'design-system'; +import { TopBar } from 'design-system'; import * as React from 'react'; import { translate } from '../../../../helpers/l10n'; import { @@ -33,8 +33,6 @@ import ComponentNavProjectBindingErrorNotif from './ComponentNavProjectBindingEr import Header from './Header'; import HeaderMeta from './HeaderMeta'; import Menu from './Menu'; -import InfoDrawer from './projectInformation/InfoDrawer'; -import ProjectInformation from './projectInformation/ProjectInformation'; export interface ComponentNavProps { branchLikes: BranchLike[]; @@ -44,7 +42,6 @@ export interface ComponentNavProps { currentTaskOnSameBranch?: boolean; isInProgress?: boolean; isPending?: boolean; - onComponentChange: (changes: Partial) => void; onWarningDismiss: () => void; projectBinding?: ProjectAlmBindingResponse; projectBindingErrors?: ProjectAlmBindingConfigurationErrors; @@ -119,19 +116,6 @@ export default function ComponentNav(props: ComponentNavProps) { }} projectInfoDisplayed={displayProjectInfo} /> - { - setDisplayProjectInfo(false); - }} - top={LAYOUT_GLOBAL_NAV_HEIGHT + LAYOUT_PROJECT_NAV_HEIGHT} - > - - {prDecoNotifComponent} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx index 3806988aa99..bab7b4e3e5d 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/Menu.tsx @@ -342,6 +342,7 @@ export class Menu extends React.PureComponent { const isApplication = this.isApplication(); const label = translate(isProject ? 'project' : 'application', 'info.title'); const isApplicationChildInaccessble = this.isApplicationChildInaccessble(); + const query = this.getQuery(); if (isPullRequest(this.props.branchLike)) { return null; @@ -355,10 +356,8 @@ export class Menu extends React.PureComponent { (isProject || isApplication) && (

  • (this.projectInfoLink = node)} - to={{}} + to={{ pathname: '/project/info', search: new URLSearchParams(query).toString() }} > {label} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx index 18c7a3353f2..35ad1906cb9 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNav-test.tsx @@ -67,10 +67,7 @@ it('renders correctly when the project binding is incorrect', () => { it('correctly returns focus to the Project Information link when the drawer is closed', () => { renderComponentNav(); screen.getByRole('link', { name: 'project.info.title' }).click(); - expect(screen.getByRole('link', { name: 'project.info.title' })).not.toHaveFocus(); - - screen.getByRole('button', { name: 'close' }).click(); - expect(screen.getByRole('link', { name: 'project.info.title' })).toHaveFocus(); + expect(screen.getByText('/project/info?id=my-project')).toBeInTheDocument(); }); function renderComponentNav(props: Partial = {}) { @@ -84,7 +81,6 @@ function renderComponentNav(props: Partial = {}) { currentBranchLike={undefined} isInProgress={false} isPending={false} - onComponentChange={jest.fn()} onWarningDismiss={jest.fn()} warnings={[]} {...props} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.css b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.css deleted file mode 100644 index 1070a3d4c24..00000000000 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.css +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -:root { - --drawer-width: 380px; -} - -.info-drawer-pane { - background-color: white; - right: calc(-1 * var(--drawer-width)); - width: var(--drawer-width); - transition: right 0.3s ease-in-out; - border-top: 1px solid var(--barBorderColor); - border-left: 1px solid var(--barBorderColor); - box-sizing: border-box; -} - -.info-drawer-pane.open { - right: 0; -} - -.info-drawer { - position: fixed; - /* top is defined programmatically by ComponentNav */ - bottom: 0; - z-index: var(--pageSideZIndex); -} - -.info-drawer .close-button { - position: absolute; - top: 0; - right: 0; - background: white; - padding: calc(2 * var(--gridSize)); - z-index: var(--normalZIndex); -} - -.info-drawer .back-button { - cursor: pointer; -} - -.info-drawer .back-button:hover { - color: var(--blue); -} - -.info-drawer-page { - position: absolute; - top: 0; - bottom: 0; -} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx deleted file mode 100644 index 8edd77bd2c0..00000000000 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawer.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import { ClearButton } from '../../../../../components/controls/buttons'; -import EscKeydownHandler from '../../../../../components/controls/EscKeydownHandler'; -import OutsideClickHandler from '../../../../../components/controls/OutsideClickHandler'; -import { translate } from '../../../../../helpers/l10n'; -import './InfoDrawer.css'; - -export interface InfoDrawerProps { - children: React.ReactNode; - displayed: boolean; - onClose: () => void; - top: number; -} - -export default function InfoDrawer(props: InfoDrawerProps) { - const { children, displayed, onClose, top } = props; - - return ( -
    - {displayed && ( - <> -
    - -
    - - -
    {children}
    -
    -
    - - )} -
    - ); -} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawerPage.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawerPage.tsx deleted file mode 100644 index 072a05f5a7e..00000000000 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/InfoDrawerPage.tsx +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import BackIcon from '../../../../../components/icons/BackIcon'; -import { translate } from '../../../../../helpers/l10n'; - -export interface InfoDrawerPageProps { - children: React.ReactNode; - displayed: boolean; - onPageChange: () => void; -} - -export default function InfoDrawerPage(props: InfoDrawerPageProps) { - const { children, displayed, onPageChange } = props; - return ( -
    - {displayed && ( - <> - onPageChange()} - role="link" - tabIndex={-1} - > - - {translate('back')} - -
    {children}
    - - )} -
    - ); -} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.css b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.css deleted file mode 100644 index 4a86ab5b4ae..00000000000 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.css +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.project-info-list > li { - /* 1px to not cut icons on the left */ - padding-left: 1px; - padding-bottom: 4px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.project-info-tags { - position: relative; -} - -.project-info-deleted-profile, -.project-info-deprecated-rules { - margin: 4px -6px 4px; - padding: 3px 6px !important; - border: 1px solid var(--alertBorderError); - border-radius: 3px; - background-color: var(--alertBackgroundError); -} - -.project-info-deleted-profile a, -.project-info-deprecated-rules a { - color: var(--veryDarkBlue); - border-color: darken(var(--lightBlue)); -} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx b/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx deleted file mode 100644 index 2b02e440b42..00000000000 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformation.tsx +++ /dev/null @@ -1,126 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { getMeasures } from '../../../../../api/measures'; -import { BranchLike } from '../../../../../types/branch-like'; -import { ComponentQualifier } from '../../../../../types/component'; -import { MetricKey } from '../../../../../types/metrics'; -import { Component, Dict, Measure, Metric } from '../../../../../types/types'; -import { CurrentUser, isLoggedIn } from '../../../../../types/users'; -import withCurrentUserContext from '../../../current-user/withCurrentUserContext'; -import withMetricsContext from '../../../metrics/withMetricsContext'; -import ProjectBadges from './badges/ProjectBadges'; -import InfoDrawerPage from './InfoDrawerPage'; -import ProjectNotifications from './notifications/ProjectNotifications'; -import './ProjectInformation.css'; -import { ProjectInformationPages } from './ProjectInformationPages'; -import ProjectInformationRenderer from './ProjectInformationRenderer'; - -interface Props { - branchLike?: BranchLike; - component: Component; - currentUser: CurrentUser; - onComponentChange: (changes: {}) => void; - metrics: Dict; -} - -interface State { - measures?: Measure[]; - page: ProjectInformationPages; -} - -export class ProjectInformation extends React.PureComponent { - mounted = false; - state: State = { - page: ProjectInformationPages.main, - }; - - componentDidMount() { - this.mounted = true; - this.loadMeasures(); - } - - componentWillUnmount() { - this.mounted = false; - } - - setPage = (page: ProjectInformationPages = ProjectInformationPages.main) => { - this.setState({ page }); - }; - - loadMeasures = () => { - const { - component: { key }, - } = this.props; - - return getMeasures({ - component: key, - metricKeys: [MetricKey.ncloc, MetricKey.projects].join(), - }).then((measures) => { - if (this.mounted) { - this.setState({ measures }); - } - }); - }; - - render() { - const { branchLike, component, currentUser, metrics } = this.props; - const { measures, page } = this.state; - - const canConfigureNotifications = - isLoggedIn(currentUser) && component.qualifier === ComponentQualifier.Project; - const canUseBadges = - metrics !== undefined && - (component.qualifier === ComponentQualifier.Application || - component.qualifier === ComponentQualifier.Project); - - return ( - <> - - {canUseBadges && ( - - - - )} - {canConfigureNotifications && ( - - - - )} - - ); - } -} - -export default withCurrentUserContext(withMetricsContext(ProjectInformation)); diff --git a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx index 6ecd1108c13..1664ad7abcc 100644 --- a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx +++ b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx @@ -44,6 +44,7 @@ import projectBaselineRoutes from '../../apps/projectBaseline/routes'; import projectBranchesRoutes from '../../apps/projectBranches/routes'; import ProjectDeletionApp from '../../apps/projectDeletion/App'; import projectDumpRoutes from '../../apps/projectDump/routes'; +import projectInfoRoutes from '../../apps/projectInformation/routes'; import ProjectKeyApp from '../../apps/projectKey/ProjectKeyApp'; import ProjectLinksApp from '../../apps/projectLinks/ProjectLinksApp'; import projectQualityGateRoutes from '../../apps/projectQualityGate/routes'; @@ -114,6 +115,7 @@ function renderComponentRoutes() { } /> {projectQualityGateRoutes()} {projectQualityProfilesRoutes()} + {projectInfoRoutes()} {tutorialsRoutes()} diff --git a/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx b/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx index 649e40a2287..93899de2a3f 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx +++ b/server/sonar-web/src/main/js/apps/account/projects/ProjectCard.tsx @@ -18,7 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import MetaLink from '../../../app/components/nav/component/projectInformation/meta/MetaLink'; import Link from '../../../components/common/Link'; import HelpTooltip from '../../../components/controls/HelpTooltip'; import DateFromNow from '../../../components/intl/DateFromNow'; @@ -27,6 +26,7 @@ import { translate, translateWithParameters } from '../../../helpers/l10n'; import { orderLinks } from '../../../helpers/projectLinks'; import { getProjectUrl } from '../../../helpers/urls'; import { MyProject, ProjectLink } from '../../../types/types'; +import MetaLink from '../../projectInformation/meta/MetaLink'; interface Props { project: MyProject; diff --git a/server/sonar-web/src/main/js/apps/projectInformation/ProjectInformationApp.tsx b/server/sonar-web/src/main/js/apps/projectInformation/ProjectInformationApp.tsx new file mode 100644 index 00000000000..08dabafccd2 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/projectInformation/ProjectInformationApp.tsx @@ -0,0 +1,144 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { Card, LargeCenteredLayout, PageContentFontWrapper, Title } from 'design-system'; +import * as React from 'react'; +import { getMeasures } from '../../api/measures'; +import withAvailableFeatures, { + WithAvailableFeaturesProps, +} from '../../app/components/available-features/withAvailableFeatures'; +import withComponentContext from '../../app/components/componentContext/withComponentContext'; +import withCurrentUserContext from '../../app/components/current-user/withCurrentUserContext'; +import withMetricsContext from '../../app/components/metrics/withMetricsContext'; +import { translate } from '../../helpers/l10n'; +import { BranchLike } from '../../types/branch-like'; +import { ComponentQualifier } from '../../types/component'; +import { Feature } from '../../types/features'; +import { MetricKey } from '../../types/metrics'; +import { Component, Dict, Measure, Metric } from '../../types/types'; +import { CurrentUser, isLoggedIn } from '../../types/users'; +import AboutProject from './about/AboutProject'; +import ProjectBadges from './badges/ProjectBadges'; +import ProjectNotifications from './notifications/ProjectNotifications'; +import RegulatoryReport from './projectRegulatoryReport/RegulatoryReport'; + +interface Props extends WithAvailableFeaturesProps { + branchLike?: BranchLike; + component: Component; + currentUser: CurrentUser; + onComponentChange: (changes: {}) => void; + metrics: Dict; +} + +interface State { + measures?: Measure[]; +} + +export class ProjectInformationApp extends React.PureComponent { + mounted = false; + state: State = {}; + + componentDidMount() { + this.mounted = true; + this.loadMeasures(); + } + + componentWillUnmount() { + this.mounted = false; + } + + loadMeasures = () => { + const { + component: { key }, + } = this.props; + + return getMeasures({ + component: key, + metricKeys: [MetricKey.ncloc, MetricKey.projects].join(), + }).then((measures) => { + if (this.mounted) { + this.setState({ measures }); + } + }); + }; + + render() { + const { branchLike, component, currentUser, metrics } = this.props; + const { measures } = this.state; + + const canConfigureNotifications = + isLoggedIn(currentUser) && component.qualifier === ComponentQualifier.Project; + const canUseBadges = + metrics !== undefined && + (component.qualifier === ComponentQualifier.Application || + component.qualifier === ComponentQualifier.Project); + const regulatoryReportFeatureEnabled = this.props.hasFeature(Feature.RegulatoryReport); + const isApp = component.qualifier === ComponentQualifier.Application; + + return ( +
    + + +
    + + {translate(isApp ? 'application' : 'project', 'info.title')} + +
    +
    + + + +
    + + {canConfigureNotifications && ( + + + + )} + {canUseBadges && ( + + + + )} + {component.qualifier === ComponentQualifier.Project && + regulatoryReportFeatureEnabled && ( + + {}} + /> + + )} +
    +
    +
    +
    +
    + ); + } +} + +export default withComponentContext( + withCurrentUserContext(withMetricsContext(withAvailableFeatures(ProjectInformationApp))) +); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx b/server/sonar-web/src/main/js/apps/projectInformation/about/AboutProject.tsx similarity index 51% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/about/AboutProject.tsx index 7383f110e7b..5b2b9a38d50 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationRenderer.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/about/AboutProject.tsx @@ -18,39 +18,25 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import PrivacyBadgeContainer from '../../../../../components/common/PrivacyBadgeContainer'; -import { ButtonLink } from '../../../../../components/controls/buttons'; -import ModalButton from '../../../../../components/controls/ModalButton'; -import { translate } from '../../../../../helpers/l10n'; -import { BranchLike } from '../../../../../types/branch-like'; -import { ComponentQualifier } from '../../../../../types/component'; -import { Feature } from '../../../../../types/features'; -import { Component, Measure } from '../../../../../types/types'; -import withAvailableFeatures, { - WithAvailableFeaturesProps, -} from '../../../available-features/withAvailableFeatures'; -import DrawerLink from './DrawerLink'; -import MetaKey from './meta/MetaKey'; -import MetaLinks from './meta/MetaLinks'; -import MetaQualityGate from './meta/MetaQualityGate'; -import MetaQualityProfiles from './meta/MetaQualityProfiles'; -import MetaSize from './meta/MetaSize'; -import MetaTags from './meta/MetaTags'; -import { ProjectInformationPages } from './ProjectInformationPages'; -import RegulatoryReportModal from './projectRegulatoryReport/RegulatoryReportModal'; - -export interface ProjectInformationRendererProps extends WithAvailableFeaturesProps { - canConfigureNotifications: boolean; - canUseBadges: boolean; +import PrivacyBadgeContainer from '../../../components/common/PrivacyBadgeContainer'; +import { translate } from '../../../helpers/l10n'; +import { ComponentQualifier } from '../../../types/component'; +import { Component, Measure } from '../../../types/types'; +import MetaKey from '../meta/MetaKey'; +import MetaLinks from '../meta/MetaLinks'; +import MetaQualityGate from '../meta/MetaQualityGate'; +import MetaQualityProfiles from '../meta/MetaQualityProfiles'; +import MetaSize from '../meta/MetaSize'; +import MetaTags from '../meta/MetaTags'; + +export interface AboutProjectProps { component: Component; - branchLike?: BranchLike; measures?: Measure[]; onComponentChange: (changes: {}) => void; - onPageChange: (page: ProjectInformationPages) => void; } -export function ProjectInformationRenderer(props: ProjectInformationRendererProps) { - const { canConfigureNotifications, canUseBadges, component, measures = [], branchLike } = props; +export function AboutProject(props: AboutProjectProps) { + const { component, measures = [] } = props; const heading = React.useRef(null); const isApp = component.qualifier === ComponentQualifier.Application; @@ -62,8 +48,6 @@ export function ProjectInformationRenderer(props: ProjectInformationRendererProp } }, [heading]); - const regulatoryReportFeatureEnabled = props.hasFeature(Feature.RegulatoryReport); - return ( <>
    @@ -115,47 +99,9 @@ export function ProjectInformationRenderer(props: ProjectInformationRendererProp
    - -
      - {canUseBadges && ( -
    • - -
    • - )} - {canConfigureNotifications && ( -
    • - -
    • - )} - {component.qualifier === ComponentQualifier.Project && regulatoryReportFeatureEnabled && ( -
    • - ( - - )} - > - {({ onClick }) => ( - {translate('regulatory_report.page')} - )} - -
    • - )} -
    ); } -export default withAvailableFeatures(React.memo(ProjectInformationRenderer)); +export default AboutProject; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeButton.tsx b/server/sonar-web/src/main/js/apps/projectInformation/badges/BadgeButton.tsx similarity index 92% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeButton.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/badges/BadgeButton.tsx index de00c7dfebc..daea2e46afa 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeButton.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/BadgeButton.tsx @@ -19,8 +19,8 @@ */ import classNames from 'classnames'; import * as React from 'react'; -import { Button } from '../../../../../../components/controls/buttons'; -import { translate } from '../../../../../../helpers/l10n'; +import { Button } from '../../../components/controls/buttons'; +import { translate } from '../../../helpers/l10n'; import { BadgeType } from './utils'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx b/server/sonar-web/src/main/js/apps/projectInformation/badges/BadgeParams.tsx similarity index 92% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/badges/BadgeParams.tsx index 90d34112b59..c8789b0c048 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/BadgeParams.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/BadgeParams.tsx @@ -19,11 +19,11 @@ */ import classNames from 'classnames'; import * as React from 'react'; -import { fetchWebApi } from '../../../../../../api/web-api'; -import Select from '../../../../../../components/controls/Select'; -import { getLocalizedMetricName, translate } from '../../../../../../helpers/l10n'; -import { Dict, Metric } from '../../../../../../types/types'; -import withMetricsContext from '../../../../metrics/withMetricsContext'; +import { fetchWebApi } from '../../../api/web-api'; +import withMetricsContext from '../../../app/components/metrics/withMetricsContext'; +import Select from '../../../components/controls/Select'; +import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; +import { Dict, Metric } from '../../../types/types'; import { BadgeFormats, BadgeOptions, BadgeType } from './utils'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx b/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx similarity index 87% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx index ae60a291df9..4b4a8ff6815 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/ProjectBadges.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/ProjectBadges.tsx @@ -18,19 +18,16 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { - getProjectBadgesToken, - renewProjectBadgesToken, -} from '../../../../../../api/project-badges'; -import CodeSnippet from '../../../../../../components/common/CodeSnippet'; -import { Button } from '../../../../../../components/controls/buttons'; -import { Alert } from '../../../../../../components/ui/Alert'; -import DeferredSpinner from '../../../../../../components/ui/DeferredSpinner'; -import { getBranchLikeQuery } from '../../../../../../helpers/branch-like'; -import { translate } from '../../../../../../helpers/l10n'; -import { BranchLike } from '../../../../../../types/branch-like'; -import { MetricKey } from '../../../../../../types/metrics'; -import { Component } from '../../../../../../types/types'; +import { getProjectBadgesToken, renewProjectBadgesToken } from '../../../api/project-badges'; +import CodeSnippet from '../../../components/common/CodeSnippet'; +import { Button } from '../../../components/controls/buttons'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { getBranchLikeQuery } from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; +import { BranchLike } from '../../../types/branch-like'; +import { MetricKey } from '../../../types/metrics'; +import { Component } from '../../../types/types'; import BadgeButton from './BadgeButton'; import BadgeParams from './BadgeParams'; import './styles.css'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/ProjectBadges-test.tsx b/server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/ProjectBadges-test.tsx similarity index 85% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/ProjectBadges-test.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/ProjectBadges-test.tsx index 0ce8130e2f9..28e3bfb173b 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/ProjectBadges-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/ProjectBadges-test.tsx @@ -21,28 +21,28 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; import selectEvent from 'react-select-event'; -import { getProjectBadgesToken } from '../../../../../../../api/project-badges'; -import { mockBranch } from '../../../../../../../helpers/mocks/branch-like'; -import { mockComponent } from '../../../../../../../helpers/mocks/component'; -import { renderComponent } from '../../../../../../../helpers/testReactTestingUtils'; -import { Location } from '../../../../../../../helpers/urls'; -import { ComponentQualifier } from '../../../../../../../types/component'; -import { MetricKey } from '../../../../../../../types/metrics'; +import { getProjectBadgesToken } from '../../../../api/project-badges'; +import { mockBranch } from '../../../../helpers/mocks/branch-like'; +import { mockComponent } from '../../../../helpers/mocks/component'; +import { renderComponent } from '../../../../helpers/testReactTestingUtils'; +import { Location } from '../../../../helpers/urls'; +import { ComponentQualifier } from '../../../../types/component'; +import { MetricKey } from '../../../../types/metrics'; import ProjectBadges from '../ProjectBadges'; import { BadgeType } from '../utils'; -jest.mock('../../../../../../../helpers/urls', () => ({ +jest.mock('../../../../helpers/urls', () => ({ getHostUrl: () => 'host', getPathUrlAsString: (l: Location) => l.pathname, getProjectUrl: () => ({ pathname: '/dashboard' } as Location), })); -jest.mock('../../../../../../../api/project-badges', () => ({ +jest.mock('../../../../api/project-badges', () => ({ getProjectBadgesToken: jest.fn().mockResolvedValue('foo'), renewProjectBadgesToken: jest.fn().mockResolvedValue({}), })); -jest.mock('../../../../../../../api/web-api', () => ({ +jest.mock('../../../../api/web-api', () => ({ fetchWebApi: () => Promise.resolve([ { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/utils-test.ts similarity index 92% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/utils-test.ts rename to server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/utils-test.ts index c29891a4c5f..359d288c0aa 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/__tests__/utils-test.ts @@ -17,11 +17,11 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { Location } from '../../../../../../../components/hoc/withRouter'; +import { Location } from '../../../../components/hoc/withRouter'; import { BadgeOptions, BadgeType, getBadgeSnippet, getBadgeUrl } from '../utils'; -jest.mock('../../../../../../../helpers/urls', () => ({ - ...jest.requireActual('../../../../../../../helpers/urls'), +jest.mock('../../../../helpers/urls', () => ({ + ...jest.requireActual('../../../../helpers/urls'), getHostUrl: () => 'host', getPathUrlAsString: (o: Location) => `host${o.pathname}${o.search}`, })); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/styles.css b/server/sonar-web/src/main/js/apps/projectInformation/badges/styles.css similarity index 100% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/styles.css rename to server/sonar-web/src/main/js/apps/projectInformation/badges/styles.css diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/utils.ts b/server/sonar-web/src/main/js/apps/projectInformation/badges/utils.ts similarity index 93% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/utils.ts rename to server/sonar-web/src/main/js/apps/projectInformation/badges/utils.ts index 15f2c884e86..c43e9c6acfa 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/badges/utils.ts +++ b/server/sonar-web/src/main/js/apps/projectInformation/badges/utils.ts @@ -17,9 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { getLocalizedMetricName } from '../../../../../../helpers/l10n'; -import { omitNil } from '../../../../../../helpers/request'; -import { getHostUrl, getPathUrlAsString, getProjectUrl } from '../../../../../../helpers/urls'; +import { getLocalizedMetricName } from '../../../helpers/l10n'; +import { omitNil } from '../../../helpers/request'; +import { getHostUrl, getPathUrlAsString, getProjectUrl } from '../../../helpers/urls'; export type BadgeColors = 'white' | 'black' | 'orange'; export type BadgeFormats = 'md' | 'url'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaKey.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaKey.tsx similarity index 91% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaKey.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/MetaKey.tsx index 432b7134f58..8532fac8291 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaKey.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaKey.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ClipboardButton } from '../../../../../../components/controls/clipboard'; -import { translate } from '../../../../../../helpers/l10n'; +import { ClipboardButton } from '../../../components/controls/clipboard'; +import { translate } from '../../../helpers/l10n'; export interface MetaKeyProps { componentKey: string; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaLink.tsx similarity index 87% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/MetaLink.tsx index 03d41acb293..e81f53c7554 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLink.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaLink.tsx @@ -18,11 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { ClearButton } from '../../../../../../components/controls/buttons'; -import ProjectLinkIcon from '../../../../../../components/icons/ProjectLinkIcon'; -import { getLinkName } from '../../../../../../helpers/projectLinks'; -import { ProjectLink } from '../../../../../../types/types'; -import isValidUri from '../../../../../utils/isValidUri'; +import isValidUri from '../../../app/utils/isValidUri'; +import { ClearButton } from '../../../components/controls/buttons'; +import ProjectLinkIcon from '../../../components/icons/ProjectLinkIcon'; +import { getLinkName } from '../../../helpers/projectLinks'; +import { ProjectLink } from '../../../types/types'; interface Props { iconOnly?: boolean; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaLinks.tsx similarity index 88% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/MetaLinks.tsx index 8976d94d014..c6df449cb8f 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaLinks.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaLinks.tsx @@ -18,10 +18,10 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { getProjectLinks } from '../../../../../../api/projectLinks'; -import { translate } from '../../../../../../helpers/l10n'; -import { orderLinks } from '../../../../../../helpers/projectLinks'; -import { LightComponent, ProjectLink } from '../../../../../../types/types'; +import { getProjectLinks } from '../../../api/projectLinks'; +import { translate } from '../../../helpers/l10n'; +import { orderLinks } from '../../../helpers/projectLinks'; +import { LightComponent, ProjectLink } from '../../../types/types'; import MetaLink from './MetaLink'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityGate.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaQualityGate.tsx similarity index 88% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityGate.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/MetaQualityGate.tsx index a6f4637962c..94719fc965e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityGate.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaQualityGate.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Link from '../../../../../../components/common/Link'; -import { translate } from '../../../../../../helpers/l10n'; -import { getQualityGateUrl } from '../../../../../../helpers/urls'; +import Link from '../../../components/common/Link'; +import { translate } from '../../../helpers/l10n'; +import { getQualityGateUrl } from '../../../helpers/urls'; interface Props { qualityGate: { isDefault?: boolean; name: string }; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaQualityProfiles.tsx similarity index 88% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/MetaQualityProfiles.tsx index 514218f0fc5..1788efdad17 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaQualityProfiles.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaQualityProfiles.tsx @@ -18,14 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { searchRules } from '../../../../../../api/rules'; -import Link from '../../../../../../components/common/Link'; -import Tooltip from '../../../../../../components/controls/Tooltip'; -import { translate, translateWithParameters } from '../../../../../../helpers/l10n'; -import { getQualityProfileUrl } from '../../../../../../helpers/urls'; -import { Languages } from '../../../../../../types/languages'; -import { ComponentQualityProfile, Dict } from '../../../../../../types/types'; -import withLanguagesContext from '../../../../languages/withLanguagesContext'; +import { searchRules } from '../../../api/rules'; +import withLanguagesContext from '../../../app/components/languages/withLanguagesContext'; +import Link from '../../../components/common/Link'; +import Tooltip from '../../../components/controls/Tooltip'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { getQualityProfileUrl } from '../../../helpers/urls'; +import { Languages } from '../../../types/languages'; +import { ComponentQualityProfile, Dict } from '../../../types/types'; interface Props { headerClassName?: string; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaSize.tsx similarity index 84% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/MetaSize.tsx index 66d0d37c2cb..499d3b18492 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaSize.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaSize.tsx @@ -18,13 +18,13 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import DrilldownLink from '../../../../../../components/shared/DrilldownLink'; -import SizeRating from '../../../../../../components/ui/SizeRating'; -import { translate, translateWithParameters } from '../../../../../../helpers/l10n'; -import { formatMeasure, localizeMetric } from '../../../../../../helpers/measures'; -import { ComponentQualifier } from '../../../../../../types/component'; -import { MetricKey } from '../../../../../../types/metrics'; -import { Component, Measure } from '../../../../../../types/types'; +import DrilldownLink from '../../../components/shared/DrilldownLink'; +import SizeRating from '../../../components/ui/SizeRating'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { formatMeasure, localizeMetric } from '../../../helpers/measures'; +import { ComponentQualifier } from '../../../types/component'; +import { MetricKey } from '../../../types/metrics'; +import { Component, Measure } from '../../../types/types'; export interface MetaSizeProps { component: Component; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaTags.tsx similarity index 82% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/MetaTags.tsx index f384bb5531b..d12a0bf75ce 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTags.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaTags.tsx @@ -18,14 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { setApplicationTags, setProjectTags } from '../../../../../../api/components'; -import { ButtonLink } from '../../../../../../components/controls/buttons'; -import Dropdown from '../../../../../../components/controls/Dropdown'; -import TagsList from '../../../../../../components/tags/TagsList'; -import { PopupPlacement } from '../../../../../../components/ui/popups'; -import { translate } from '../../../../../../helpers/l10n'; -import { ComponentQualifier } from '../../../../../../types/component'; -import { Component } from '../../../../../../types/types'; +import { setApplicationTags, setProjectTags } from '../../../api/components'; +import Dropdown from '../../../components/controls/Dropdown'; +import { ButtonLink } from '../../../components/controls/buttons'; +import TagsList from '../../../components/tags/TagsList'; +import { PopupPlacement } from '../../../components/ui/popups'; +import { translate } from '../../../helpers/l10n'; +import { ComponentQualifier } from '../../../types/component'; +import { Component } from '../../../types/types'; import MetaTagsSelector from './MetaTagsSelector'; interface Props { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTagsSelector.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaTagsSelector.tsx similarity index 93% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTagsSelector.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/MetaTagsSelector.tsx index b7bc47fcc10..d2602d40f2d 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/MetaTagsSelector.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/MetaTagsSelector.tsx @@ -19,8 +19,8 @@ */ import { difference, without } from 'lodash'; import * as React from 'react'; -import { searchProjectTags } from '../../../../../../api/components'; -import TagsSelector from '../../../../../../components/tags/TagsSelector'; +import { searchProjectTags } from '../../../api/components'; +import TagsSelector from '../../../components/tags/TagsSelector'; interface Props { selectedTags: string[]; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaKey-test.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaKey-test.tsx similarity index 89% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaKey-test.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaKey-test.tsx index 4f55e67a774..0fd2885b200 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaKey-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaKey-test.tsx @@ -19,8 +19,8 @@ */ import { screen } from '@testing-library/react'; import * as React from 'react'; -import { renderComponent } from '../../../../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../../../../types/component'; +import { renderComponent } from '../../../../helpers/testReactTestingUtils'; +import { ComponentQualifier } from '../../../../types/component'; import MetaKey, { MetaKeyProps } from '../MetaKey'; it('should render correctly', () => { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx similarity index 83% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx index 5d6b2e7574c..842045daff7 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaQualityProfiles-test.tsx @@ -19,18 +19,14 @@ */ import { screen } from '@testing-library/react'; import * as React from 'react'; -import { searchRules } from '../../../../../../../api/rules'; -import { - mockLanguage, - mockPaging, - mockQualityProfile, -} from '../../../../../../../helpers/testMocks'; -import { renderComponent } from '../../../../../../../helpers/testReactTestingUtils'; -import { SearchRulesResponse } from '../../../../../../../types/coding-rules'; -import { Dict } from '../../../../../../../types/types'; +import { searchRules } from '../../../../api/rules'; +import { mockLanguage, mockPaging, mockQualityProfile } from '../../../../helpers/testMocks'; +import { renderComponent } from '../../../../helpers/testReactTestingUtils'; +import { SearchRulesResponse } from '../../../../types/coding-rules'; +import { Dict } from '../../../../types/types'; import { MetaQualityProfiles } from '../MetaQualityProfiles'; -jest.mock('../../../../../../../api/rules', () => { +jest.mock('../../../../api/rules', () => { return { searchRules: jest.fn().mockResolvedValue({ total: 10, diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaTags-test.tsx b/server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaTags-test.tsx similarity index 89% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaTags-test.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaTags-test.tsx index c4c8804797f..04b073db83e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/meta/__tests__/MetaTags-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/meta/__tests__/MetaTags-test.tsx @@ -20,17 +20,13 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; -import { - searchProjectTags, - setApplicationTags, - setProjectTags, -} from '../../../../../../../api/components'; -import { mockComponent } from '../../../../../../../helpers/mocks/component'; -import { renderComponent } from '../../../../../../../helpers/testReactTestingUtils'; -import { ComponentQualifier } from '../../../../../../../types/component'; +import { searchProjectTags, setApplicationTags, setProjectTags } from '../../../../api/components'; +import { mockComponent } from '../../../../helpers/mocks/component'; +import { renderComponent } from '../../../../helpers/testReactTestingUtils'; +import { ComponentQualifier } from '../../../../types/component'; import MetaTags from '../MetaTags'; -jest.mock('../../../../../../../api/components', () => ({ +jest.mock('../../../../api/components', () => ({ setApplicationTags: jest.fn().mockResolvedValue(true), setProjectTags: jest.fn().mockResolvedValue(true), searchProjectTags: jest.fn(), diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx b/server/sonar-web/src/main/js/apps/projectInformation/notifications/ProjectNotifications.tsx similarity index 87% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/notifications/ProjectNotifications.tsx index b8d254a6dbc..d0ddd4fd9fc 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/ProjectNotifications.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/notifications/ProjectNotifications.tsx @@ -18,15 +18,15 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import NotificationsList from '../../../../../../apps/account/notifications/NotificationsList'; import { withNotifications, WithNotificationsProps, -} from '../../../../../../components/hoc/withNotifications'; -import { Alert } from '../../../../../../components/ui/Alert'; -import DeferredSpinner from '../../../../../../components/ui/DeferredSpinner'; -import { translate } from '../../../../../../helpers/l10n'; -import { Component } from '../../../../../../types/types'; +} from '../../../components/hoc/withNotifications'; +import { Alert } from '../../../components/ui/Alert'; +import DeferredSpinner from '../../../components/ui/DeferredSpinner'; +import { translate } from '../../../helpers/l10n'; +import { Component } from '../../../types/types'; +import NotificationsList from '../../account/notifications/NotificationsList'; interface Props { component: Component; @@ -64,7 +64,7 @@ export function ProjectNotifications(props: WithNotificationsProps & Props) { ); return ( - <> +

    {translate('project.info.notifications')}

    @@ -97,7 +97,7 @@ export function ProjectNotifications(props: WithNotificationsProps & Props) { /> - +
    ); } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/__tests__/ProjectNotifications-test.tsx b/server/sonar-web/src/main/js/apps/projectInformation/notifications/__tests__/ProjectNotifications-test.tsx similarity index 85% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/__tests__/ProjectNotifications-test.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/notifications/__tests__/ProjectNotifications-test.tsx index a9950202ad4..e7d187c574f 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/notifications/__tests__/ProjectNotifications-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/notifications/__tests__/ProjectNotifications-test.tsx @@ -20,17 +20,14 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; -import { getNotifications } from '../../../../../../../api/notifications'; -import { mockComponent } from '../../../../../../../helpers/mocks/component'; -import { mockNotification } from '../../../../../../../helpers/testMocks'; -import { renderComponent } from '../../../../../../../helpers/testReactTestingUtils'; -import { - NotificationGlobalType, - NotificationProjectType, -} from '../../../../../../../types/notifications'; +import { getNotifications } from '../../../../api/notifications'; +import { mockComponent } from '../../../../helpers/mocks/component'; +import { mockNotification } from '../../../../helpers/testMocks'; +import { renderComponent } from '../../../../helpers/testReactTestingUtils'; +import { NotificationGlobalType, NotificationProjectType } from '../../../../types/notifications'; import ProjectNotifications from '../ProjectNotifications'; -jest.mock('../../../../../../../api/notifications', () => ({ +jest.mock('../../../../api/notifications', () => ({ addNotification: jest.fn().mockResolvedValue(undefined), removeNotification: jest.fn().mockResolvedValue(undefined), getNotifications: jest.fn(), diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx b/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx similarity index 90% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx index 62df8b7c4a5..59b3f860f6d 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx @@ -21,20 +21,20 @@ import classNames from 'classnames'; import { orderBy } from 'lodash'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { getBranches } from '../../../../../../api/branches'; -import { getRegulatoryReportUrl } from '../../../../../../api/regulatory-report'; -import DocLink from '../../../../../../components/common/DocLink'; -import Select, { LabelValueSelectOption } from '../../../../../../components/controls/Select'; -import { ButtonLink } from '../../../../../../components/controls/buttons'; -import { Alert } from '../../../../../../components/ui/Alert'; +import { getBranches } from '../../../api/branches'; +import { getRegulatoryReportUrl } from '../../../api/regulatory-report'; +import DocLink from '../../../components/common/DocLink'; +import Select, { LabelValueSelectOption } from '../../../components/controls/Select'; +import { ButtonLink } from '../../../components/controls/buttons'; +import { Alert } from '../../../components/ui/Alert'; import { getBranchLikeDisplayName, getBranchLikeKey, isMainBranch, -} from '../../../../../../helpers/branch-like'; -import { translate } from '../../../../../../helpers/l10n'; -import { BranchLike } from '../../../../../../types/branch-like'; -import { Component } from '../../../../../../types/types'; +} from '../../../helpers/branch-like'; +import { translate } from '../../../helpers/l10n'; +import { BranchLike } from '../../../types/branch-like'; +import { Component } from '../../../types/types'; interface Props { component: Pick; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/RegulatoryReportModal.tsx b/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReportModal.tsx similarity index 80% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/RegulatoryReportModal.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReportModal.tsx index 9556833bad0..8311b93cfc5 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/RegulatoryReportModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/RegulatoryReportModal.tsx @@ -18,12 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { translate } from '../../../../../../helpers/l10n'; -import { Component } from '../../../../../../types/types'; -import Modal from '../../../../../../components/controls/Modal'; +import ClickEventBoundary from '../../../components/controls/ClickEventBoundary'; +import Modal from '../../../components/controls/Modal'; +import { translate } from '../../../helpers/l10n'; +import { BranchLike } from '../../../types/branch-like'; +import { Component } from '../../../types/types'; import RegulatoryReport from './RegulatoryReport'; -import ClickEventBoundary from '../../../../../../components/controls/ClickEventBoundary'; -import { BranchLike } from '../../../../../../types/branch-like'; interface Props { component: Component; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx b/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx similarity index 93% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx rename to server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx index 00bec0d8b5c..2d2a2f22c90 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx @@ -20,10 +20,10 @@ import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import * as React from 'react'; -import BranchesServiceMock from '../../../../../../../api/mocks/BranchesServiceMock'; -import { mockBranch, mockMainBranch } from '../../../../../../../helpers/mocks/branch-like'; -import { renderComponent } from '../../../../../../../helpers/testReactTestingUtils'; -import { BranchLike } from '../../../../../../../types/branch-like'; +import BranchesServiceMock from '../../../../api/mocks/BranchesServiceMock'; +import { mockBranch, mockMainBranch } from '../../../../helpers/mocks/branch-like'; +import { renderComponent } from '../../../../helpers/testReactTestingUtils'; +import { BranchLike } from '../../../../types/branch-like'; import RegulatoryReport from '../RegulatoryReport'; let handler: BranchesServiceMock; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationPages.ts b/server/sonar-web/src/main/js/apps/projectInformation/routes.tsx similarity index 77% rename from server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationPages.ts rename to server/sonar-web/src/main/js/apps/projectInformation/routes.tsx index cafa737fb8c..669de902ac8 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/projectInformation/ProjectInformationPages.ts +++ b/server/sonar-web/src/main/js/apps/projectInformation/routes.tsx @@ -17,8 +17,10 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -export enum ProjectInformationPages { - main, - badges, - notifications, -} +import React from 'react'; +import { Route } from 'react-router-dom'; +import ProjectInformationApp from './ProjectInformationApp'; + +const routes = () => } />; + +export default routes; -- 2.39.5