diff options
Diffstat (limited to 'server/sonar-web/src/main/js/app')
13 files changed, 241 insertions, 256 deletions
diff --git a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx index da7f3d83e95..43c2465e9e2 100644 --- a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getSettingsNavigation } from '../../api/nav'; @@ -120,7 +120,7 @@ export class AdminContainer extends React.PureComponent<Props, State> { return ( <div> - <Helmet defaultTitle={defaultTitle} titleTemplate={'%s - ' + defaultTitle} /> + <Helmet defaultTitle={defaultTitle} defer={false} titleTemplate={`%s - ${defaultTitle}`} /> <SettingsNav extensions={adminPages} fetchPendingPlugins={this.fetchPendingPlugins} diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainerNotFound.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainerNotFound.tsx index 8ebe58c73d7..2c1210593ab 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainerNotFound.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainerNotFound.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Helmet } from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { Link } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; diff --git a/server/sonar-web/src/main/js/app/components/NotFound.tsx b/server/sonar-web/src/main/js/app/components/NotFound.tsx index 257aec5ec41..5671fd2ef35 100644 --- a/server/sonar-web/src/main/js/app/components/NotFound.tsx +++ b/server/sonar-web/src/main/js/app/components/NotFound.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Helmet } from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { Link } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; import SimpleContainer from './SimpleContainer'; diff --git a/server/sonar-web/src/main/js/app/components/PageTracker.tsx b/server/sonar-web/src/main/js/app/components/PageTracker.tsx index cd4b9087ec8..debc7bb9253 100644 --- a/server/sonar-web/src/main/js/app/components/PageTracker.tsx +++ b/server/sonar-web/src/main/js/app/components/PageTracker.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { Location, withRouter } from '../../components/hoc/withRouter'; import { gtm } from '../../helpers/analytics'; @@ -74,6 +74,7 @@ export class PageTracker extends React.Component<Props, State> { return ( <Helmet defaultTitle={getInstance()} + defer={false} onChangeClientState={trackingIdGTM || webAnalytics ? this.trackPage : undefined}> {this.props.children} </Helmet> diff --git a/server/sonar-web/src/main/js/app/components/__tests__/PageTracker-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/PageTracker-test.tsx index e7b69acbe68..ddae1db9a74 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/PageTracker-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/PageTracker-test.tsx @@ -55,9 +55,7 @@ it('should work for WebAnalytics plugin', () => { const wrapper = shallowRender({ webAnalytics }); expect(wrapper).toMatchSnapshot(); - expect(wrapper.find('HelmetWrapper').prop('onChangeClientState')).toBe( - wrapper.instance().trackPage - ); + expect(wrapper.find('Helmet').prop('onChangeClientState')).toBe(wrapper.instance().trackPage); expect(installScript).toBeCalledWith(webAnalytics, 'head'); (getWebAnalyticsPageHandlerFromCache as jest.Mock).mockReturnValueOnce(pageChange); @@ -72,9 +70,7 @@ it('should work for Google Tag Manager', () => { const push = jest.spyOn(dataLayer, 'push'); const wrapper = shallowRender({ trackingIdGTM: '123' }); - expect(wrapper.find('HelmetWrapper').prop('onChangeClientState')).toBe( - wrapper.instance().trackPage - ); + expect(wrapper.find('Helmet').prop('onChangeClientState')).toBe(wrapper.instance().trackPage); expect(gtm).toBeCalled(); expect(dataLayer).toHaveLength(0); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap index 4763a40ec18..c7a5276bf45 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap @@ -2,9 +2,9 @@ exports[`should render correctly 1`] = ` <div> - <HelmetWrapper + <Helmet defaultTitle="layout.settings" - defer={true} + defer={false} encodeSpecialCharacters={true} titleTemplate="%s - layout.settings" /> diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/PageTracker-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/PageTracker-test.tsx.snap index ec84971fa84..b350cdcc21d 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/PageTracker-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/PageTracker-test.tsx.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`should not trigger if no analytics system is given 1`] = ` -<HelmetWrapper - defer={true} +<Helmet + defer={false} encodeSpecialCharacters={true} /> `; exports[`should work for WebAnalytics plugin 1`] = ` -<HelmetWrapper - defer={true} +<Helmet + defer={false} encodeSpecialCharacters={true} onChangeClientState={[Function]} /> diff --git a/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx b/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx index 1d244025286..dc1a7cc5c79 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { InjectedIntlProps, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { translate } from 'sonar-ui-common/helpers/l10n'; diff --git a/server/sonar-web/src/main/js/app/components/extensions/__tests__/Extension-test.tsx b/server/sonar-web/src/main/js/app/components/extensions/__tests__/Extension-test.tsx index 05dfe881f91..fbb67eb0698 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/__tests__/Extension-test.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/__tests__/Extension-test.tsx @@ -28,6 +28,10 @@ jest.mock('../../../../helpers/extensions', () => ({ getExtensionStart: jest.fn().mockResolvedValue({}) })); +jest.mock('react-helmet-async', () => ({ + Helmet: () => null +})); + beforeEach(() => { jest.clearAllMocks(); }); diff --git a/server/sonar-web/src/main/js/app/components/extensions/__tests__/__snapshots__/Extension-test.tsx.snap b/server/sonar-web/src/main/js/app/components/extensions/__tests__/__snapshots__/Extension-test.tsx.snap index 1dbd93f12a1..06877479c04 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/__tests__/__snapshots__/Extension-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/extensions/__tests__/__snapshots__/Extension-test.tsx.snap @@ -41,23 +41,9 @@ exports[`should render React extensions correctly 1`] = ` } > <div> - <HelmetWrapper - defer={true} - encodeSpecialCharacters={true} + <Helmet title="Foo" - > - <SideEffect(NullComponent) - defer={true} - encodeSpecialCharacters={true} - title="Foo" - > - <NullComponent - defer={true} - encodeSpecialCharacters={true} - title="Foo" - /> - </SideEffect(NullComponent)> - </HelmetWrapper> + /> <div /> </div> </Extension> @@ -104,23 +90,9 @@ exports[`should render React extensions correctly 2`] = ` } > <div> - <HelmetWrapper - defer={true} - encodeSpecialCharacters={true} + <Helmet title="Foo" - > - <SideEffect(NullComponent) - defer={true} - encodeSpecialCharacters={true} - title="Foo" - > - <NullComponent - defer={true} - encodeSpecialCharacters={true} - title="Foo" - /> - </SideEffect(NullComponent)> - </HelmetWrapper> + /> <div className="extension" /> diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavHeader.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavHeader.tsx index a719dfab390..dec1d32e10d 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavHeader.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavHeader.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { BranchLike } from '../../../../types/branch-like'; import BranchLikeNavigation from './branch-like/BranchLikeNavigation'; import CurrentBranchLikeMergeInformation from './branch-like/CurrentBranchLikeMergeInformation'; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavHeader-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavHeader-test.tsx.snap index 81197bd8cc8..e230965909e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavHeader-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavHeader-test.tsx.snap @@ -2,7 +2,7 @@ exports[`should render correctly 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="MyProject" 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 6236c95f182..49d05fbc8ae 100644 --- a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx +++ b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx @@ -21,6 +21,7 @@ import { Location } from 'history'; import * as React from 'react'; import { render } from 'react-dom'; +import { HelmetProvider } from 'react-helmet-async'; import { IntlProvider } from 'react-intl'; import { Provider } from 'react-redux'; import { IndexRoute, Redirect, Route, RouteConfig, RouteProps, Router } from 'react-router'; @@ -96,246 +97,257 @@ export default function startReactApp( const store = getStore(currentUser, appState); render( - <Provider store={store}> - <IntlProvider defaultLocale={lang} locale={lang}> - <ThemeProvider theme={theme}> - <Router history={history} onUpdate={handleUpdate}> - <Route - path="/account/issues" - onEnter={(_, replace) => { - replace({ pathname: '/issues', query: { myIssues: 'true', resolved: 'false' } }); - }} - /> + <HelmetProvider> + <Provider store={store}> + <IntlProvider defaultLocale={lang} locale={lang}> + <ThemeProvider theme={theme}> + <Router history={history} onUpdate={handleUpdate}> + <Route + path="/account/issues" + onEnter={(_, replace) => { + replace({ pathname: '/issues', query: { myIssues: 'true', resolved: 'false' } }); + }} + /> - <Route - path="/codingrules" - onEnter={(_, replace) => { - replace('/coding_rules' + window.location.hash); - }} - /> + <Route + path="/codingrules" + onEnter={(_, replace) => { + replace('/coding_rules' + window.location.hash); + }} + /> - <Route - path="/dashboard/index/:key" - onEnter={(nextState, replace) => { - replace({ pathname: '/dashboard', query: { id: nextState.params.key } }); - }} - /> + <Route + path="/dashboard/index/:key" + onEnter={(nextState, replace) => { + replace({ pathname: '/dashboard', query: { id: nextState.params.key } }); + }} + /> - <Route - path="/issues/search" - onEnter={(_, replace) => { - replace('/issues' + window.location.hash); - }} - /> + <Route + path="/issues/search" + onEnter={(_, replace) => { + replace('/issues' + window.location.hash); + }} + /> - <Redirect from="/admin" to="/admin/settings" /> - <Redirect from="/background_tasks" to="/admin/background_tasks" /> - <Redirect from="/component/index" to="/component" /> - <Redirect from="/component_issues" to="/project/issues" /> - <Redirect from="/dashboard/index" to="/dashboard" /> - <Redirect - from="/documentation/analysis/languages/vb" - to="/documentation/analysis/languages/vbnet/" - /> - <Redirect from="/governance" to="/portfolio" /> - <Redirect from="/groups" to="/admin/groups" /> - <Redirect from="/extension/governance/portfolios" to="/portfolios" /> - <Redirect from="/metrics" to="/admin/custom_metrics" /> - <Redirect from="/permission_templates" to="/admin/permission_templates" /> - <Redirect from="/profiles/index" to="/profiles" /> - <Redirect from="/projects_admin" to="/admin/projects_management" /> - <Redirect from="/quality_gates/index" to="/quality_gates" /> - <Redirect from="/roles/global" to="/admin/permissions" /> - <Redirect from="/admin/roles/global" to="/admin/permissions" /> - <Redirect from="/settings" to="/admin/settings" /> - <Redirect from="/settings/encryption" to="/admin/settings/encryption" /> - <Redirect from="/settings/index" to="/admin/settings" /> - <Redirect from="/sessions/login" to="/sessions/new" /> - <Redirect from="/system" to="/admin/system" /> - <Redirect from="/system/index" to="/admin/system" /> - <Redirect from="/view" to="/portfolio" /> - <Redirect from="/users" to="/admin/users" /> + <Redirect from="/admin" to="/admin/settings" /> + <Redirect from="/background_tasks" to="/admin/background_tasks" /> + <Redirect from="/component/index" to="/component" /> + <Redirect from="/component_issues" to="/project/issues" /> + <Redirect from="/dashboard/index" to="/dashboard" /> + <Redirect + from="/documentation/analysis/languages/vb" + to="/documentation/analysis/languages/vbnet/" + /> + <Redirect from="/governance" to="/portfolio" /> + <Redirect from="/groups" to="/admin/groups" /> + <Redirect from="/extension/governance/portfolios" to="/portfolios" /> + <Redirect from="/metrics" to="/admin/custom_metrics" /> + <Redirect from="/permission_templates" to="/admin/permission_templates" /> + <Redirect from="/profiles/index" to="/profiles" /> + <Redirect from="/projects_admin" to="/admin/projects_management" /> + <Redirect from="/quality_gates/index" to="/quality_gates" /> + <Redirect from="/roles/global" to="/admin/permissions" /> + <Redirect from="/admin/roles/global" to="/admin/permissions" /> + <Redirect from="/settings" to="/admin/settings" /> + <Redirect from="/settings/encryption" to="/admin/settings/encryption" /> + <Redirect from="/settings/index" to="/admin/settings" /> + <Redirect from="/sessions/login" to="/sessions/new" /> + <Redirect from="/system" to="/admin/system" /> + <Redirect from="/system/index" to="/admin/system" /> + <Redirect from="/view" to="/portfolio" /> + <Redirect from="/users" to="/admin/users" /> - <Route - path="markdown/help" - component={lazyLoad(() => import('../components/MarkdownHelp'))} - /> + <Route + path="markdown/help" + component={lazyLoad(() => import('../components/MarkdownHelp'))} + /> - <Route component={lazyLoad(() => import('../components/SimpleContainer'))}> - <Route path="maintenance">{maintenanceRoutes}</Route> - <Route path="setup">{setupRoutes}</Route> - </Route> - - <Route component={MigrationContainer}> - <Route component={lazyLoad(() => import('../components/SimpleSessionsContainer'))}> - <RouteWithChildRoutes path="/sessions" childRoutes={sessionsRoutes} /> + <Route component={lazyLoad(() => import('../components/SimpleContainer'))}> + <Route path="maintenance">{maintenanceRoutes}</Route> + <Route path="setup">{setupRoutes}</Route> </Route> - <Route path="/" component={App}> - <IndexRoute component={lazyLoad(() => import('../components/Landing'))} /> - <RouteWithChildRoutes path="about" childRoutes={aboutRoutes} /> + <Route component={MigrationContainer}> + <Route component={lazyLoad(() => import('../components/SimpleSessionsContainer'))}> + <RouteWithChildRoutes path="/sessions" childRoutes={sessionsRoutes} /> + </Route> - <Route component={GlobalContainer}> - <RouteWithChildRoutes path="account" childRoutes={accountRoutes} /> - {!isSonarCloud() && ( - <RouteWithChildRoutes path="coding_rules" childRoutes={codingRulesRoutes} /> - )} - <RouteWithChildRoutes path="documentation" childRoutes={documentationRoutes} /> - <Route path="explore" component={Explore}> - <Route path="issues" component={ExploreIssues} /> - <Route path="projects" component={ExploreProjects} /> - </Route> - <Route - path="extension/:pluginKey/:extensionKey" - component={lazyLoad(() => - import('../components/extensions/GlobalPageExtension') - )} - /> - <Route path="issues" component={IssuesPageSelector} /> - <RouteWithChildRoutes path="onboarding" childRoutes={onboardingRoutes} /> - {isSonarCloud() && ( - <Route - path="create-organization" - component={lazyLoad(() => - import('../../apps/create/organization/CreateOrganization') - )} - /> - )} - <RouteWithChildRoutes path="organizations" childRoutes={organizationsRoutes} /> - <RouteWithChildRoutes path="projects" childRoutes={projectsRoutes} /> - <RouteWithChildRoutes path="quality_gates" childRoutes={qualityGatesRoutes} /> - <Route - path="portfolios" - component={lazyLoad(() => import('../components/extensions/PortfoliosPage'))} - /> - {!isSonarCloud() && ( - <RouteWithChildRoutes path="profiles" childRoutes={qualityProfilesRoutes} /> - )} - <RouteWithChildRoutes path="web_api" childRoutes={webAPIRoutes} /> + <Route path="/" component={App}> + <IndexRoute component={lazyLoad(() => import('../components/Landing'))} /> + <RouteWithChildRoutes path="about" childRoutes={aboutRoutes} /> - <Route component={lazyLoad(() => import('../components/ComponentContainer'))}> - <RouteWithChildRoutes path="code" childRoutes={codeRoutes} /> - <RouteWithChildRoutes - path="component_measures" - childRoutes={componentMeasuresRoutes} - /> - <RouteWithChildRoutes path="dashboard" childRoutes={overviewRoutes} /> - <RouteWithChildRoutes path="portfolio" childRoutes={portfolioRoutes} /> - <RouteWithChildRoutes - path="project/activity" - childRoutes={projectActivityRoutes} - /> + <Route component={GlobalContainer}> + <RouteWithChildRoutes path="account" childRoutes={accountRoutes} /> + {!isSonarCloud() && ( + <RouteWithChildRoutes path="coding_rules" childRoutes={codingRulesRoutes} /> + )} + <RouteWithChildRoutes path="documentation" childRoutes={documentationRoutes} /> + <Route path="explore" component={Explore}> + <Route path="issues" component={ExploreIssues} /> + <Route path="projects" component={ExploreProjects} /> + </Route> <Route - path="project/extension/:pluginKey/:extensionKey" + path="extension/:pluginKey/:extensionKey" component={lazyLoad(() => - import('../components/extensions/ProjectPageExtension') + import('../components/extensions/GlobalPageExtension') )} /> - <Route path="project/issues" component={Issues} /> - <RouteWithChildRoutes - path="project/quality_gate" - childRoutes={projectQualityGateRoutes} - /> - <RouteWithChildRoutes - path="project/quality_profiles" - childRoutes={projectQualityProfilesRoutes} - /> - <Route - component={lazyLoad(() => import('../components/ProjectAdminContainer'))}> - {!isSonarCloud() && ( - <RouteWithChildRoutes - path="custom_measures" - childRoutes={customMeasuresRoutes} - /> - )} + <Route path="issues" component={IssuesPageSelector} /> + <RouteWithChildRoutes path="onboarding" childRoutes={onboardingRoutes} /> + {isSonarCloud() && ( <Route - path="project/admin/extension/:pluginKey/:extensionKey" + path="create-organization" component={lazyLoad(() => - import('../components/extensions/ProjectAdminPageExtension') + import('../../apps/create/organization/CreateOrganization') )} /> + )} + <RouteWithChildRoutes path="organizations" childRoutes={organizationsRoutes} /> + <RouteWithChildRoutes path="projects" childRoutes={projectsRoutes} /> + <RouteWithChildRoutes path="quality_gates" childRoutes={qualityGatesRoutes} /> + <Route + path="portfolios" + component={lazyLoad(() => import('../components/extensions/PortfoliosPage'))} + /> + {!isSonarCloud() && ( + <RouteWithChildRoutes path="profiles" childRoutes={qualityProfilesRoutes} /> + )} + <RouteWithChildRoutes path="web_api" childRoutes={webAPIRoutes} /> + + <Route component={lazyLoad(() => import('../components/ComponentContainer'))}> + <RouteWithChildRoutes path="code" childRoutes={codeRoutes} /> <RouteWithChildRoutes - path="project/background_tasks" - childRoutes={backgroundTasksRoutes} + path="component_measures" + childRoutes={componentMeasuresRoutes} /> + <RouteWithChildRoutes path="dashboard" childRoutes={overviewRoutes} /> + <RouteWithChildRoutes path="portfolio" childRoutes={portfolioRoutes} /> <RouteWithChildRoutes - path="project/baseline" - childRoutes={projectBaselineRoutes} + path="project/activity" + childRoutes={projectActivityRoutes} /> - <RouteWithChildRoutes - path="project/branches" - childRoutes={projectBranchesRoutes} + <Route + path="project/extension/:pluginKey/:extensionKey" + component={lazyLoad(() => + import('../components/extensions/ProjectPageExtension') + )} /> - <RouteWithChildRoutes path="project/settings" childRoutes={settingsRoutes} /> + <Route path="project/issues" component={Issues} /> <RouteWithChildRoutes - path="project_roles" - childRoutes={projectPermissionsRoutes} + path="project/quality_gate" + childRoutes={projectQualityGateRoutes} /> - <RouteWithChildRoutes path="project/webhooks" childRoutes={webhooksRoutes} /> - <Route - path="project/deletion" - component={lazyLoad(() => import('../../apps/projectDeletion/App'))} - /> - <Route - path="project/links" - component={lazyLoad(() => import('../../apps/projectLinks/App'))} + <RouteWithChildRoutes + path="project/quality_profiles" + childRoutes={projectQualityProfilesRoutes} /> <Route - path="project/key" - component={lazyLoad(() => import('../../apps/projectKey/Key'))} - /> - </Route> - </Route> - - <Route - component={lazyLoad(() => import('../components/AdminContainer'))} - path="admin"> - <Route - path="extension/:pluginKey/:extensionKey" - component={lazyLoad(() => - import('../components/extensions/GlobalAdminPageExtension') - )} - /> - <RouteWithChildRoutes - path="background_tasks" - childRoutes={backgroundTasksRoutes} - /> - <RouteWithChildRoutes path="custom_metrics" childRoutes={customMetricsRoutes} /> - {!isSonarCloud() && ( - <> - <RouteWithChildRoutes path="groups" childRoutes={groupsRoutes} /> + component={lazyLoad(() => import('../components/ProjectAdminContainer'))}> + {!isSonarCloud() && ( + <RouteWithChildRoutes + path="custom_measures" + childRoutes={customMeasuresRoutes} + /> + )} + <Route + path="project/admin/extension/:pluginKey/:extensionKey" + component={lazyLoad(() => + import('../components/extensions/ProjectAdminPageExtension') + )} + /> <RouteWithChildRoutes - path="permission_templates" - childRoutes={permissionTemplatesRoutes} + path="project/background_tasks" + childRoutes={backgroundTasksRoutes} /> <RouteWithChildRoutes - path="permissions" - childRoutes={globalPermissionsRoutes} + path="project/baseline" + childRoutes={projectBaselineRoutes} /> <RouteWithChildRoutes - path="projects_management" - childRoutes={projectsManagementRoutes} + path="project/branches" + childRoutes={projectBranchesRoutes} /> - </> - )} - <RouteWithChildRoutes path="settings" childRoutes={settingsRoutes} /> - <RouteWithChildRoutes path="system" childRoutes={systemRoutes} /> - <RouteWithChildRoutes path="marketplace" childRoutes={marketplaceRoutes} /> - <RouteWithChildRoutes path="users" childRoutes={usersRoutes} /> - <RouteWithChildRoutes path="webhooks" childRoutes={webhooksRoutes} /> + <RouteWithChildRoutes + path="project/settings" + childRoutes={settingsRoutes} + /> + <RouteWithChildRoutes + path="project_roles" + childRoutes={projectPermissionsRoutes} + /> + <RouteWithChildRoutes + path="project/webhooks" + childRoutes={webhooksRoutes} + /> + <Route + path="project/deletion" + component={lazyLoad(() => import('../../apps/projectDeletion/App'))} + /> + <Route + path="project/links" + component={lazyLoad(() => import('../../apps/projectLinks/App'))} + /> + <Route + path="project/key" + component={lazyLoad(() => import('../../apps/projectKey/Key'))} + /> + </Route> + </Route> + + <Route + component={lazyLoad(() => import('../components/AdminContainer'))} + path="admin"> + <Route + path="extension/:pluginKey/:extensionKey" + component={lazyLoad(() => + import('../components/extensions/GlobalAdminPageExtension') + )} + /> + <RouteWithChildRoutes + path="background_tasks" + childRoutes={backgroundTasksRoutes} + /> + <RouteWithChildRoutes + path="custom_metrics" + childRoutes={customMetricsRoutes} + /> + {!isSonarCloud() && ( + <> + <RouteWithChildRoutes path="groups" childRoutes={groupsRoutes} /> + <RouteWithChildRoutes + path="permission_templates" + childRoutes={permissionTemplatesRoutes} + /> + <RouteWithChildRoutes + path="permissions" + childRoutes={globalPermissionsRoutes} + /> + <RouteWithChildRoutes + path="projects_management" + childRoutes={projectsManagementRoutes} + /> + </> + )} + <RouteWithChildRoutes path="settings" childRoutes={settingsRoutes} /> + <RouteWithChildRoutes path="system" childRoutes={systemRoutes} /> + <RouteWithChildRoutes path="marketplace" childRoutes={marketplaceRoutes} /> + <RouteWithChildRoutes path="users" childRoutes={usersRoutes} /> + <RouteWithChildRoutes path="webhooks" childRoutes={webhooksRoutes} /> + </Route> </Route> + <Route + path="not_found" + component={lazyLoad(() => import('../components/NotFound'))} + /> + <Route path="*" component={lazyLoad(() => import('../components/NotFound'))} /> </Route> - <Route - path="not_found" - component={lazyLoad(() => import('../components/NotFound'))} - /> - <Route path="*" component={lazyLoad(() => import('../components/NotFound'))} /> </Route> - </Route> - </Router> - </ThemeProvider> - </IntlProvider> - </Provider>, + </Router> + </ThemeProvider> + </IntlProvider> + </Provider> + </HelmetProvider>, el ); } |