diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2020-01-03 13:44:12 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2020-01-08 20:46:11 +0100 |
commit | 279deef3e8534bba914245ccf10610a459073640 (patch) | |
tree | 22cfcf63ecee905641dfd3bc76043c0cfb2843f1 | |
parent | 3365182508367bfcc080452d7cf932f9cfbf8c1b (diff) | |
download | sonarqube-279deef3e8534bba914245ccf10610a459073640.tar.gz sonarqube-279deef3e8534bba914245ccf10610a459073640.zip |
SONAR-12429 Fix 404 when opening embedded documentation in new tab
Cherry-pick of SC-1304
101 files changed, 534 insertions, 532 deletions
diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index 0b77826a88e..e287662a99e 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -27,7 +27,7 @@ "react-day-picker": "7.3.0", "react-dom": "16.8.6", "react-draggable": "3.2.1", - "react-helmet": "5.2.0", + "react-helmet-async": "1.0.4", "react-intl": "2.8.0", "react-redux": "5.1.1", "react-router": "3.2.1", @@ -66,7 +66,7 @@ "@types/prop-types": "15.7.0", "@types/react": "16.8.23", "@types/react-dom": "16.8.4", - "@types/react-helmet": "5.0.8", + "@types/react-helmet": "5.0.14", "@types/react-intl": "2.3.17", "@types/react-redux": "6.0.6", "@types/react-router": "3.0.20", 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 ); } diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx index a656db9b3e4..ddc1e0c0405 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.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 { getBaseUrl } from 'sonar-ui-common/helpers/urls'; import { isLoggedIn } from '../../../helpers/users'; import SQPageContainer from './components/SQPageContainer'; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/AzureDevOps.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/AzureDevOps.tsx index d795c7f49f1..a3b1f147848 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/AzureDevOps.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/AzureDevOps.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 { getBaseUrl } from 'sonar-ui-common/helpers/urls'; import { isLoggedIn } from '../../../helpers/users'; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.tsx index 11613e40afa..fb46e682969 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.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 { getBaseUrl } from 'sonar-ui-common/helpers/urls'; import { isLoggedIn } from '../../../helpers/users'; import SQPageContainer from './components/SQPageContainer'; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Contact.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Contact.tsx index 77531403845..df5ca89bca5 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Contact.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Contact.tsx @@ -19,7 +19,7 @@ */ import { Location } from 'history'; import * as React from 'react'; -import { Helmet } from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { Link } from 'react-router'; import Select from 'sonar-ui-common/components/controls/Select'; import { Alert } from 'sonar-ui-common/components/ui/Alert'; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx index 1df7fa41b85..f5988f2e8d6 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.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 { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages'; import { getBaseUrl } from 'sonar-ui-common/helpers/urls'; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx index 8be14d667a1..b0e49a11e25 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.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 { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages'; import { scrollToElement } from 'sonar-ui-common/helpers/scrolling'; import { getBaseUrl } from 'sonar-ui-common/helpers/urls'; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx index 76994fd72fc..24678ed4418 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.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 { getBaseUrl } from 'sonar-ui-common/helpers/urls'; import { isLoggedIn } from '../../../helpers/users'; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.tsx index 20f820890f1..e763e0f6d67 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.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 { getBaseUrl } from 'sonar-ui-common/helpers/urls'; import { isLoggedIn } from '../../../helpers/users'; import SQPageContainer from './components/SQPageContainer'; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/__snapshots__/Home-test.tsx.snap b/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/__snapshots__/Home-test.tsx.snap index 0527dbd3e26..8e97298c65b 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/__snapshots__/Home-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/__snapshots__/Home-test.tsx.snap @@ -47,7 +47,7 @@ exports[`should render 1`] = ` <div className="page-container sc-page" > - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="SonarCloud | Clean Code, Rockstar Status" @@ -56,7 +56,7 @@ exports[`should render 1`] = ` content="Enhance your workflow with continuous code quality, SonarCloud automatically analyzes and decorates pull requests on GitHub, Bitbucket and Azure DevOps on major languages." name="description" /> - </HelmetWrapper> + </Helmet> <FixedNavBar /> <PageBackgroundHeader /> <TopNavBar /> diff --git a/server/sonar-web/src/main/js/apps/account/components/Account.tsx b/server/sonar-web/src/main/js/apps/account/components/Account.tsx index 60ed098c5c5..ec8613cba29 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Account.tsx +++ b/server/sonar-web/src/main/js/apps/account/components/Account.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 handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -52,7 +52,7 @@ export class Account extends React.PureComponent<Props> { return ( <div id="account-page"> <Suggestions suggestions="account" /> - <Helmet defaultTitle={title} titleTemplate={'%s - ' + title} /> + <Helmet defaultTitle={title} defer={false} titleTemplate={`%s - ${title}`} /> <A11ySkipTarget anchor="account_main" /> <header className="account-header"> <div className="account-container clearfix"> diff --git a/server/sonar-web/src/main/js/apps/account/components/Security.tsx b/server/sonar-web/src/main/js/apps/account/components/Security.tsx index ea3e8412777..704dee0c4a8 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Security.tsx +++ b/server/sonar-web/src/main/js/apps/account/components/Security.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 { getCurrentUser, Store } from '../../../store/rootReducer'; @@ -32,7 +32,7 @@ interface Props { function Security({ user }: Props) { return ( <div className="account-body account-container"> - <Helmet title={translate('my_account.security')} /> + <Helmet defer={false} title={translate('my_account.security')} /> <Tokens login={user.login} /> {user.local && <Password user={user} />} </div> diff --git a/server/sonar-web/src/main/js/apps/account/components/__tests__/__snapshots__/Account-test.tsx.snap b/server/sonar-web/src/main/js/apps/account/components/__tests__/__snapshots__/Account-test.tsx.snap index 23c112c210b..7fbdf3071cc 100644 --- a/server/sonar-web/src/main/js/apps/account/components/__tests__/__snapshots__/Account-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/account/components/__tests__/__snapshots__/Account-test.tsx.snap @@ -7,9 +7,9 @@ exports[`should render correctly 1`] = ` <Suggestions suggestions="account" /> - <HelmetWrapper + <Helmet defaultTitle="my_account.page" - defer={true} + defer={false} encodeSpecialCharacters={true} titleTemplate="%s - my_account.page" /> diff --git a/server/sonar-web/src/main/js/apps/account/notifications/Notifications.tsx b/server/sonar-web/src/main/js/apps/account/notifications/Notifications.tsx index 34ef22e8f14..aa3c88097ed 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/Notifications.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/Notifications.tsx @@ -19,7 +19,7 @@ */ import { partition } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { Alert } from 'sonar-ui-common/components/ui/Alert'; import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -45,7 +45,7 @@ export function Notifications(props: WithNotificationsProps) { return ( <div className="account-body account-container"> - <Helmet title={translate('my_account.notifications')} /> + <Helmet defer={false} title={translate('my_account.notifications')} /> <Alert variant="info">{translate('notification.dispatcher.information')}</Alert> <DeferredSpinner loading={loading}> {notifications && ( diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.tsx.snap b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.tsx.snap index 46053156fbf..9d312772640 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.tsx.snap @@ -4,8 +4,8 @@ exports[`should render correctly 1`] = ` <div className="account-body account-container" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="my_account.notifications" /> @@ -83,8 +83,8 @@ exports[`should render correctly 2`] = ` <div className="account-body account-container" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="my_account.notifications" /> @@ -162,8 +162,8 @@ exports[`should render correctly 3`] = ` <div className="account-body account-container" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="my_account.notifications" /> diff --git a/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx b/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx index 04de8d89908..7aff55375e5 100644 --- a/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx +++ b/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.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 { Link } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; diff --git a/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx b/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx index a373c7dd65f..713fef2d335 100644 --- a/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.tsx +++ b/server/sonar-web/src/main/js/apps/account/projects/ProjectsContainer.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 { translate } from 'sonar-ui-common/helpers/l10n'; import { getMyProjects } from '../../../api/components'; import Projects from './Projects'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx index cf8e86047ab..aad93b01500 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx @@ -19,7 +19,7 @@ */ import { debounce, uniq } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { toShortNotSoISOString } from 'sonar-ui-common/helpers/dates'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -218,7 +218,7 @@ export class BackgroundTasksApp extends React.PureComponent<Props, State> { return ( <div className="page page-limited"> <Suggestions suggestions="background_tasks" /> - <Helmet title={translate('background_tasks.page')} /> + <Helmet defer={false} title={translate('background_tasks.page')} /> <Header component={component} /> <Stats diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/BackgroundTasksApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/BackgroundTasksApp-test.tsx.snap index 72846dc1217..4bc07059a03 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/BackgroundTasksApp-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/BackgroundTasksApp-test.tsx.snap @@ -17,8 +17,8 @@ exports[`should render correctly 2`] = ` <Suggestions suggestions="background_tasks" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="background_tasks.page" /> diff --git a/server/sonar-web/src/main/js/apps/code/components/App.tsx b/server/sonar-web/src/main/js/apps/code/components/App.tsx index 37dae7d6679..c1a65d7aca1 100644 --- a/server/sonar-web/src/main/js/apps/code/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/App.tsx @@ -21,7 +21,7 @@ import * as classNames from 'classnames'; import { Location } from 'history'; import { debounce } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { InjectedRouter } from 'react-router'; import ListFooter from 'sonar-ui-common/components/controls/ListFooter'; @@ -269,7 +269,10 @@ export class App extends React.PureComponent<Props, State> { return ( <div className="page page-limited"> <Suggestions suggestions="code" /> - <Helmet title={sourceViewer !== undefined ? sourceViewer.name : defaultTitle} /> + <Helmet + defer={false} + title={sourceViewer !== undefined ? sourceViewer.name : defaultTitle} + /> <A11ySkipTarget anchor="code_main" /> <Search diff --git a/server/sonar-web/src/main/js/apps/code/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/code/components/__tests__/App-test.tsx index 9bd31e97160..9035233ffcc 100644 --- a/server/sonar-web/src/main/js/apps/code/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/__tests__/App-test.tsx @@ -48,7 +48,7 @@ beforeEach(() => { it('should have correct title for APP based component', async () => { const wrapper = shallowRender(); await waitAndUpdate(wrapper); - expect(wrapper.find('HelmetWrapper')).toMatchSnapshot(); + expect(wrapper.find('Helmet')).toMatchSnapshot(); }); it('should have correct title for portfolio base component', async () => { @@ -61,7 +61,7 @@ it('should have correct title for portfolio base component', async () => { }); const wrapper = shallowRender(); await waitAndUpdate(wrapper); - expect(wrapper.find('HelmetWrapper')).toMatchSnapshot(); + expect(wrapper.find('Helmet')).toMatchSnapshot(); }); it('should have correct title for project component', async () => { @@ -74,7 +74,7 @@ it('should have correct title for project component', async () => { }); const wrapper = shallowRender(); await waitAndUpdate(wrapper); - expect(wrapper.find('HelmetWrapper')).toMatchSnapshot(); + expect(wrapper.find('Helmet')).toMatchSnapshot(); }); it('should refresh branch status if issues are updated', async () => { diff --git a/server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/App-test.tsx.snap index ac0f4eaa14b..7d2227bf3a1 100644 --- a/server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/App-test.tsx.snap @@ -1,24 +1,24 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`should have correct title for APP based component 1`] = ` -<HelmetWrapper - defer={true} +<Helmet + defer={false} encodeSpecialCharacters={true} title="projects.page" /> `; exports[`should have correct title for portfolio base component 1`] = ` -<HelmetWrapper - defer={true} +<Helmet + defer={false} encodeSpecialCharacters={true} title="projects.page" /> `; exports[`should have correct title for project component 1`] = ` -<HelmetWrapper - defer={true} +<Helmet + defer={false} encodeSpecialCharacters={true} title="code.page" /> diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx index 5b9c648d63b..5177a6355a5 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx @@ -20,7 +20,7 @@ import * as key from 'keymaster'; import { keyBy } from 'lodash'; import * as React from 'react'; -import { Helmet } from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { withRouter, WithRouterProps } from 'react-router'; import ListFooter from 'sonar-ui-common/components/controls/ListFooter'; @@ -559,7 +559,7 @@ export class App extends React.PureComponent<Props, State> { return ( <> <Suggestions suggestions="coding_rules" /> - <Helmet title={translate('coding_rules.page')}> + <Helmet defer={false} title={translate('coding_rules.page')}> <meta content="noindex" name="robots" /> </Helmet> <div className="layout-page" id="coding-rules-page"> diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap index 3184fc1ed0c..8cbccf1f3a9 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/App-test.tsx.snap @@ -44,8 +44,8 @@ exports[`should render correctly 1`] = ` <Suggestions suggestions="coding_rules" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="coding_rules.page" > @@ -53,7 +53,7 @@ exports[`should render correctly 1`] = ` content="noindex" name="robots" /> - </HelmetWrapper> + </Helmet> <div className="layout-page" id="coding-rules-page" @@ -98,8 +98,8 @@ exports[`should render correctly 2`] = ` <Suggestions suggestions="coding_rules" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="coding_rules.page" > @@ -107,7 +107,7 @@ exports[`should render correctly 2`] = ` content="noindex" name="robots" /> - </HelmetWrapper> + </Helmet> <div className="layout-page" id="coding-rules-page" diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx index 5ea2507c4cf..146d6d1af19 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx @@ -20,7 +20,7 @@ import * as key from 'keymaster'; import { debounce, keyBy } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { withRouter, WithRouterProps } from 'react-router'; import { @@ -310,7 +310,7 @@ export class App extends React.PureComponent<Props, State> { return ( <div id="component-measures"> <Suggestions suggestions="component_measures" /> - <Helmet title={this.getHelmetTitle(query, displayOverview, metric)} /> + <Helmet defer={false} title={this.getHelmetTitle(query, displayOverview, metric)} /> {measures.length > 0 ? ( <div className="layout-page"> diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap index 2cf9448032f..4c5f9bf8bcd 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/App-test.tsx.snap @@ -7,8 +7,8 @@ exports[`should not render drilldown for estimated duplications 1`] = ` <Suggestions suggestions="component_measures" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="Coverage" /> @@ -44,8 +44,8 @@ exports[`should render a message when there are no measures 1`] = ` <Suggestions suggestions="component_measures" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="Coverage" /> @@ -60,8 +60,8 @@ exports[`should render correctly 1`] = ` <Suggestions suggestions="component_measures" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="Coverage" /> diff --git a/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx b/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx index ef3b5f66e24..9f546c857c8 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx @@ -21,7 +21,7 @@ import * as classNames from 'classnames'; import * as differenceInMinutes from 'date-fns/difference_in_minutes'; import { times } from 'lodash'; import * as React from 'react'; -import { Helmet } from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { withRouter, WithRouterProps } from 'react-router'; import Tabs from 'sonar-ui-common/components/controls/Tabs'; @@ -425,7 +425,7 @@ export class CreateOrganization extends React.PureComponent<Props & WithRouterPr return ( <> - <Helmet title={header} titleTemplate="%s" /> + <Helmet defer={false} title={header} titleTemplate="%s" /> <div className="page page-limited huge-spacer-top huge-spacer-bottom"> <A11ySkipTarget anchor="create_org_main" /> diff --git a/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx b/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx index 2cd7c56eecf..4b1f7a339ae 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx @@ -21,6 +21,7 @@ import { mount, shallow } from 'enzyme'; import { Location } from 'history'; import { times } from 'lodash'; import * as React from 'react'; +import { HelmetProvider } from 'react-helmet-async'; import { get, remove } from 'sonar-ui-common/helpers/storage'; import { waitAndUpdate } from 'sonar-ui-common/helpers/testUtils'; import { @@ -312,7 +313,7 @@ it('should bind org and redirect to org home when coming from org binding', asyn }); function mountRender(props: Partial<CreateOrganization['props']> = {}) { - return mount<CreateOrganization>(createComponent(props)); + return mount<CreateOrganization>(<HelmetProvider>{createComponent(props)}</HelmetProvider>); } function shallowRender(props: Partial<CreateOrganization['props']> = {}) { diff --git a/server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/CreateOrganization-test.tsx.snap b/server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/CreateOrganization-test.tsx.snap index 46829d9e422..927b7d368f9 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/CreateOrganization-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/create/organization/__tests__/__snapshots__/CreateOrganization-test.tsx.snap @@ -2,8 +2,8 @@ exports[`should render with auto tab displayed 1`] = ` <Fragment> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="onboarding.create_organization.page.header" titleTemplate="%s" @@ -92,8 +92,8 @@ exports[`should render with auto tab selected and manual disabled 1`] = ` exports[`should render with auto tab selected and manual disabled 2`] = ` <Fragment> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="onboarding.create_organization.page.header" titleTemplate="%s" @@ -218,8 +218,8 @@ exports[`should render with auto tab selected and manual disabled 2`] = ` exports[`should render with manual tab displayed 1`] = ` <Fragment> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="onboarding.create_organization.page.header" titleTemplate="%s" @@ -278,8 +278,8 @@ exports[`should render with organization bind page 1`] = ` exports[`should render with organization bind page 2`] = ` <Fragment> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="onboarding.create_organization.page.header" titleTemplate="%s" @@ -406,8 +406,8 @@ exports[`should render with organization bind page 2`] = ` exports[`should switch tabs 1`] = ` <Fragment> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="onboarding.create_organization.page.header" titleTemplate="%s" diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarCloud.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarCloud.tsx index 8056c3f5523..35bd08cce28 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarCloud.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarCloud.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 { WithRouterProps } from 'react-router'; import Tabs from 'sonar-ui-common/components/controls/Tabs'; diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarQube.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarQube.tsx index f36ef28fd20..aa88ce27183 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarQube.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarQube.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 { WithRouterProps } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { addWhitePageClass, removeWhitePageClass } from 'sonar-ui-common/helpers/pages'; diff --git a/server/sonar-web/src/main/js/apps/create/project/__tests__/__snapshots__/CreateProjectPageSonarCloud-test.tsx.snap b/server/sonar-web/src/main/js/apps/create/project/__tests__/__snapshots__/CreateProjectPageSonarCloud-test.tsx.snap index 71566a53266..50addeb1eab 100644 --- a/server/sonar-web/src/main/js/apps/create/project/__tests__/__snapshots__/CreateProjectPageSonarCloud-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/create/project/__tests__/__snapshots__/CreateProjectPageSonarCloud-test.tsx.snap @@ -2,7 +2,7 @@ exports[`should render correctly 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="onboarding.create_project.header" @@ -31,7 +31,7 @@ exports[`should render correctly 1`] = ` exports[`should render correctly 2`] = ` <Fragment> - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="onboarding.create_project.header" @@ -103,7 +103,7 @@ exports[`should render correctly 2`] = ` exports[`should render with Custom creation only 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="onboarding.create_project.header" @@ -168,7 +168,7 @@ exports[`should render with Custom creation only 1`] = ` exports[`should switch tabs 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="onboarding.create_project.header" diff --git a/server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx b/server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx index f5afcfc3520..d49d1c41334 100644 --- a/server/sonar-web/src/main/js/apps/custom-measures/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/custom-measures/components/App.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 ListFooter from 'sonar-ui-common/components/controls/ListFooter'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { diff --git a/server/sonar-web/src/main/js/apps/custom-measures/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/custom-measures/components/__tests__/__snapshots__/App-test.tsx.snap index d59b5a86c0b..d58a7526a53 100644 --- a/server/sonar-web/src/main/js/apps/custom-measures/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/custom-measures/components/__tests__/__snapshots__/App-test.tsx.snap @@ -5,7 +5,7 @@ exports[`should work 1`] = ` <Suggestions suggestions="custom_measures" /> - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="custom_measures.page" @@ -26,7 +26,7 @@ exports[`should work 2`] = ` <Suggestions suggestions="custom_measures" /> - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="custom_measures.page" diff --git a/server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx b/server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx index f65aedce0fc..8800cb09376 100644 --- a/server/sonar-web/src/main/js/apps/custom-metrics/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/custom-metrics/components/App.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 ListFooter from 'sonar-ui-common/components/controls/ListFooter'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { @@ -147,7 +147,7 @@ export default class App extends React.PureComponent<Props, State> { return ( <> <Suggestions suggestions="custom_metrics" /> - <Helmet title={translate('custom_metrics.page')} /> + <Helmet defer={false} title={translate('custom_metrics.page')} /> <div className="page page-limited" id="custom-metrics-page"> <Header domains={domains} loading={loading} onCreate={this.handleCreate} types={types} /> {metrics && ( diff --git a/server/sonar-web/src/main/js/apps/custom-metrics/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/custom-metrics/components/__tests__/__snapshots__/App-test.tsx.snap index a7d3664d8ae..8514fc4c8e2 100644 --- a/server/sonar-web/src/main/js/apps/custom-metrics/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/custom-metrics/components/__tests__/__snapshots__/App-test.tsx.snap @@ -5,8 +5,8 @@ exports[`should work 1`] = ` <Suggestions suggestions="custom_metrics" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="custom_metrics.page" /> @@ -27,8 +27,8 @@ exports[`should work 2`] = ` <Suggestions suggestions="custom_metrics" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="custom_metrics.page" /> diff --git a/server/sonar-web/src/main/js/apps/documentation/components/App.tsx b/server/sonar-web/src/main/js/apps/documentation/components/App.tsx index 66e85c130be..e745735be8d 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/App.tsx @@ -21,7 +21,7 @@ import * as navigationTreeSonarCloud from 'Docs/../static/SonarCloudNavigationTr import * as navigationTreeSonarQube from 'Docs/../static/SonarQubeNavigationTree.json'; import { DocNavigationItem } from 'Docs/@types/types'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { Link } from 'react-router'; import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -174,7 +174,9 @@ export default class App extends React.PureComponent<Props, State> { return ( <div className="layout-page"> - <Helmet title={isIndex || !page.title ? mainTitle : `${page.title} | ${mainTitle}`}> + <Helmet + defer={false} + title={isIndex || !page.title ? mainTitle : `${page.title} | ${mainTitle}`}> {!isSonarCloud() && <meta content="noindex nofollow" name="robots" />} </Helmet> diff --git a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/__snapshots__/App-test.tsx.snap index d5701016b02..fc7aa1ecf74 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/__snapshots__/App-test.tsx.snap @@ -4,8 +4,8 @@ exports[`should render correctly for SonarCloud 1`] = ` <div className="layout-page" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="Lorem | documentation.page_title.sonarcloud" /> @@ -42,8 +42,8 @@ exports[`should render correctly for SonarQube 1`] = ` <div className="layout-page" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="Lorem | documentation.page_title.sonarqube" > @@ -51,7 +51,7 @@ exports[`should render correctly for SonarQube 1`] = ` content="noindex nofollow" name="robots" /> - </HelmetWrapper> + </Helmet> <ScreenPositionHelper className="layout-page-side-outer" > @@ -168,7 +168,7 @@ exports[`should render correctly for SonarQube 2`] = ` exports[`should show a 404 if the page doesn't exist 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defer={true} encodeSpecialCharacters={true} title="documentation.page_title.sonarcloud" @@ -177,7 +177,7 @@ exports[`should show a 404 if the page doesn't exist 1`] = ` content="noindex nofollow" name="robots" /> - </HelmetWrapper> + </Helmet> <A11ySkipTarget anchor="documentation_main" /> diff --git a/server/sonar-web/src/main/js/apps/groups/components/App.tsx b/server/sonar-web/src/main/js/apps/groups/components/App.tsx index fc866e9da2d..664e07f2dc5 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/groups/components/App.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 ListFooter from 'sonar-ui-common/components/controls/ListFooter'; import SearchBox from 'sonar-ui-common/components/controls/SearchBox'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -141,7 +141,7 @@ export default class App extends React.PureComponent<Props, State> { return ( <> <Suggestions suggestions="user_groups" /> - <Helmet title={translate('user_groups.page')} /> + <Helmet defer={false} title={translate('user_groups.page')} /> <div className="page page-limited" id="groups-page"> <Header loading={loading} onCreate={this.handleCreate} /> diff --git a/server/sonar-web/src/main/js/apps/groups/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/groups/components/__tests__/__snapshots__/App-test.tsx.snap index 11190d8cf61..5deb2d97b50 100644 --- a/server/sonar-web/src/main/js/apps/groups/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/groups/components/__tests__/__snapshots__/App-test.tsx.snap @@ -5,8 +5,8 @@ exports[`should render correctly 1`] = ` <Suggestions suggestions="user_groups" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="user_groups.page" /> @@ -35,8 +35,8 @@ exports[`should render correctly 2`] = ` <Suggestions suggestions="user_groups" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="user_groups.page" /> diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.tsx b/server/sonar-web/src/main/js/apps/issues/components/App.tsx index 1fdb546dda4..237aae53a18 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/App.tsx @@ -20,7 +20,7 @@ import * as key from 'keymaster'; import { debounce, keyBy, omit, without } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { Button } from 'sonar-ui-common/components/controls/buttons'; @@ -1169,7 +1169,7 @@ export class App extends React.PureComponent<Props, State> { return ( <div className="layout-page issues" id="issues-page"> <Suggestions suggestions="issues" /> - <Helmet title={openIssue ? openIssue.message : translate('issues.page')} /> + <Helmet defer={false} title={openIssue ? openIssue.message : translate('issues.page')} /> {this.renderSide(openIssue)} diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/App-test.tsx.snap index 29638709728..5953cce8636 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/App-test.tsx.snap @@ -28,8 +28,8 @@ exports[`should switch to source view if an issue is selected 1`] = ` <Suggestions suggestions="issues" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="issues.page" /> @@ -370,8 +370,8 @@ exports[`should switch to source view if an issue is selected 2`] = ` <Suggestions suggestions="issues" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="Reduce the number of conditional operators (4) used in the expression" /> diff --git a/server/sonar-web/src/main/js/apps/maintenance/components/App.tsx b/server/sonar-web/src/main/js/apps/maintenance/components/App.tsx index ea72c28fd20..1f776921f25 100644 --- a/server/sonar-web/src/main/js/apps/maintenance/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/maintenance/components/App.tsx @@ -19,7 +19,7 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; import { Button } from 'sonar-ui-common/components/controls/buttons'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -133,7 +133,7 @@ export default class App extends React.PureComponent<Props, State> { return ( <> - <Helmet defaultTitle={translate('maintenance.page')} /> + <Helmet defaultTitle={translate('maintenance.page')} defer={false} /> <div className="page-wrapper-simple" id="bd"> <div className={classNames('page-simple', { diff --git a/server/sonar-web/src/main/js/apps/maintenance/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/maintenance/components/__tests__/__snapshots__/App-test.tsx.snap index e0606efd1df..1c9dbb2b24e 100644 --- a/server/sonar-web/src/main/js/apps/maintenance/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/maintenance/components/__tests__/__snapshots__/App-test.tsx.snap @@ -2,9 +2,9 @@ exports[`Maintenance Page should render DB_MIGRATION_NEEDED status 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -63,9 +63,9 @@ exports[`Maintenance Page should render DB_MIGRATION_NEEDED status 1`] = ` exports[`Maintenance Page should render DB_MIGRATION_RUNNING status 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -124,9 +124,9 @@ exports[`Maintenance Page should render DB_MIGRATION_RUNNING status 1`] = ` exports[`Maintenance Page should render DOWN status 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -165,9 +165,9 @@ exports[`Maintenance Page should render DOWN status 1`] = ` exports[`Maintenance Page should render OFFLINE status 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -206,9 +206,9 @@ exports[`Maintenance Page should render OFFLINE status 1`] = ` exports[`Maintenance Page should render STARTING status 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -240,9 +240,9 @@ exports[`Maintenance Page should render STARTING status 1`] = ` exports[`Maintenance Page should render UP status 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -281,9 +281,9 @@ exports[`Maintenance Page should render UP status 1`] = ` exports[`Setup Page should render MIGRATION_FAILED state 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -311,9 +311,9 @@ exports[`Setup Page should render MIGRATION_FAILED state 1`] = ` exports[`Setup Page should render MIGRATION_SUCCEEDED state 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -345,9 +345,9 @@ exports[`Setup Page should render MIGRATION_SUCCEEDED state 1`] = ` exports[`Setup Page should render NO_MIGRATION state 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -379,9 +379,9 @@ exports[`Setup Page should render NO_MIGRATION state 1`] = ` exports[`Setup Page should render NOT_SUPPORTED state 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -407,9 +407,9 @@ exports[`Setup Page should render NOT_SUPPORTED state 1`] = ` exports[`Setup Page should start migration 1`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div @@ -457,9 +457,9 @@ exports[`Setup Page should start migration 1`] = ` exports[`Setup Page should start migration 2`] = ` <Fragment> - <HelmetWrapper + <Helmet defaultTitle="maintenance.page" - defer={true} + defer={false} encodeSpecialCharacters={true} /> <div diff --git a/server/sonar-web/src/main/js/apps/marketplace/App.tsx b/server/sonar-web/src/main/js/apps/marketplace/App.tsx index bc279bbfab0..fc0b4f8484c 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/App.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/App.tsx @@ -19,7 +19,7 @@ */ import { sortBy, uniqBy } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getAvailablePlugins, diff --git a/server/sonar-web/src/main/js/apps/organizationMembers/OrganizationMembers.tsx b/server/sonar-web/src/main/js/apps/organizationMembers/OrganizationMembers.tsx index 90bb6e760db..766921c28cf 100644 --- a/server/sonar-web/src/main/js/apps/organizationMembers/OrganizationMembers.tsx +++ b/server/sonar-web/src/main/js/apps/organizationMembers/OrganizationMembers.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 ListFooter from 'sonar-ui-common/components/controls/ListFooter'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { addMember, removeMember, searchMembers } from '../../api/organizations'; @@ -199,7 +199,7 @@ export default class OrganizationMembers extends React.PureComponent<Props, Stat const hasMemberSync = organization.alm && organization.alm.membersSync; return ( <div className="page page-limited"> - <Helmet title={translate('organization.members.page')} /> + <Helmet defer={false} title={translate('organization.members.page')} /> <Suggestions suggestions="organization_members" /> <A11ySkipTarget anchor="members_main" /> <MembersPageHeader diff --git a/server/sonar-web/src/main/js/apps/organizationMembers/__tests__/__snapshots__/OrganizationMembers-test.tsx.snap b/server/sonar-web/src/main/js/apps/organizationMembers/__tests__/__snapshots__/OrganizationMembers-test.tsx.snap index b10011aca00..23fbb81a067 100644 --- a/server/sonar-web/src/main/js/apps/organizationMembers/__tests__/__snapshots__/OrganizationMembers-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/organizationMembers/__tests__/__snapshots__/OrganizationMembers-test.tsx.snap @@ -4,8 +4,8 @@ exports[`should fetch members and render for non-admin 1`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="organization.members.page" /> @@ -33,8 +33,8 @@ exports[`should fetch members and render for non-admin 2`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="organization.members.page" /> diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx index 633ecf1b17c..da74e304893 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx @@ -19,7 +19,7 @@ */ import { debounce } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { SubmitButton } from 'sonar-ui-common/components/controls/buttons'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -113,7 +113,7 @@ export class OrganizationEdit extends React.PureComponent<Props, State> { return ( <div className="page page-limited"> - <Helmet title={title} /> + <Helmet defer={false} title={title} /> <header className="page-header"> <h1 className="page-title">{title}</h1> diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.tsx b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.tsx index 28574fb0e0d..6e97d53198c 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.tsx +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.tsx @@ -19,7 +19,7 @@ */ import { Location } from 'history'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; import NotFound from '../../../app/components/NotFound'; @@ -97,7 +97,11 @@ export class OrganizationPage extends React.PureComponent<Props, State> { return ( <div> - <Helmet defaultTitle={organization.name} titleTemplate={'%s - ' + organization.name} /> + <Helmet + defaultTitle={organization.name} + defer={false} + titleTemplate={`%s - ${organization.name}`} + /> <Suggestions suggestions="organization_space" /> <OrganizationNavigation currentUser={this.props.currentUser} diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.tsx.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.tsx.snap index b80d299eb16..fbb063779aa 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationEdit-test.tsx.snap @@ -4,8 +4,8 @@ exports[`smoke test 1`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="organization.settings" /> @@ -164,8 +164,8 @@ exports[`smoke test 2`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="organization.settings" /> @@ -324,8 +324,8 @@ exports[`smoke test 3`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="organization.settings" /> diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.tsx.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.tsx.snap index 9836ed00ed4..df00c8a8a01 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.tsx.snap @@ -19,9 +19,9 @@ Array [ exports[`smoke test 1`] = ` <div> - <HelmetWrapper + <Helmet defaultTitle="Foo" - defer={true} + defer={false} encodeSpecialCharacters={true} titleTemplate="%s - Foo" /> diff --git a/server/sonar-web/src/main/js/apps/overview/components/App.tsx b/server/sonar-web/src/main/js/apps/overview/components/App.tsx index db723584e8a..3a25fa68865 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/App.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 { lazyLoad } from 'sonar-ui-common/components/lazyLoad'; import { getBaseUrl, getPathUrlAsString } from 'sonar-ui-common/helpers/urls'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Home.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/Home.tsx index 4558a6db10d..cd06304d915 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Home.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Home.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 { translate } from 'sonar-ui-common/helpers/l10n'; import Header from './Header'; import List from './List'; @@ -35,7 +35,7 @@ interface Props { export default function Home(props: Props) { return ( <div className="page page-limited"> - <Helmet title={translate('permission_templates.page')} /> + <Helmet defer={false} title={translate('permission_templates.page')} /> <Header organization={props.organization} ready={props.ready} refresh={props.refresh} /> diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.tsx b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.tsx index 7e501b0c361..5aa316db1c1 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.tsx +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.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 { translate } from 'sonar-ui-common/helpers/l10n'; import * as api from '../../../api/permissions'; import HoldersList from '../../permissions/shared/components/HoldersList'; @@ -198,7 +198,7 @@ export default class Template extends React.PureComponent<Props, State> { return ( <div className="page page-limited"> - <Helmet title={this.props.template.name} /> + <Helmet defer={false} title={this.props.template.name} /> <TemplateHeader loading={this.state.loading} diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx b/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx index ee17154254e..b8bbb81ae98 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/App.tsx @@ -19,7 +19,7 @@ */ import { without } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { translate } from 'sonar-ui-common/helpers/l10n'; import * as api from '../../../../api/permissions'; import Suggestions from '../../../../app/components/embed-docs-modal/Suggestions'; @@ -273,7 +273,7 @@ export default class App extends React.PureComponent<Props, State> { return ( <div className="page page-limited"> <Suggestions suggestions="global_permissions" /> - <Helmet title={translate('global_permissions.permission')} /> + <Helmet defer={false} title={translate('global_permissions.permission')} /> <PageHeader loading={this.state.loading} organization={this.props.organization} /> <AllHoldersList filter={this.state.filter} diff --git a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/__snapshots__/App-test.tsx.snap index e204f06b3de..a22f405ecc5 100644 --- a/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/permissions/global/components/__tests__/__snapshots__/App-test.tsx.snap @@ -7,8 +7,8 @@ exports[`should render correctly 1`] = ` <Suggestions suggestions="global_permissions" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="global_permissions.permission" /> @@ -46,8 +46,8 @@ exports[`should render correctly 2`] = ` <Suggestions suggestions="global_permissions" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="global_permissions.permission" /> diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx index d909cba2012..586e1503a1e 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/App.tsx @@ -19,7 +19,7 @@ */ import { without } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { translate } from 'sonar-ui-common/helpers/l10n'; import * as api from '../../../../api/permissions'; import VisibilitySelector from '../../../../components/common/VisibilitySelector'; @@ -371,7 +371,7 @@ export default class App extends React.PureComponent<Props, State> { return ( <div className="page page-limited" id="project-permissions-page"> - <Helmet title={translate('permissions.page')} /> + <Helmet defer={false} title={translate('permissions.page')} /> <PageHeader component={component} diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/__snapshots__/App-test.tsx.snap index 0cacc59dfc9..2348992ede3 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/__snapshots__/App-test.tsx.snap @@ -5,8 +5,8 @@ exports[`should render correctly 1`] = ` className="page page-limited" id="project-permissions-page" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="permissions.page" /> @@ -88,8 +88,8 @@ exports[`should render correctly 2`] = ` className="page page-limited" id="project-permissions-page" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="permissions.page" /> diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx index af7750f6a70..d586c683458 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityApp.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 { parseDate } from 'sonar-ui-common/helpers/dates'; import { translate } from 'sonar-ui-common/helpers/l10n'; import A11ySkipTarget from '../../../app/components/a11y/A11ySkipTarget'; @@ -56,7 +56,7 @@ export default function ProjectActivityApp(props: Props) { return ( <div className="page page-limited" id="project-activity"> <Suggestions suggestions="project_activity" /> - <Helmet title={translate('project_activity.page')} /> + <Helmet defer={false} title={translate('project_activity.page')} /> <A11ySkipTarget anchor="activity_main" /> diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.tsx.snap index caa6cdf253c..ac2a991a3c9 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.tsx.snap @@ -8,8 +8,8 @@ exports[`should render correctly 1`] = ` <Suggestions suggestions="project_activity" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="project_activity.page" /> diff --git a/server/sonar-web/src/main/js/apps/projectDeletion/App.tsx b/server/sonar-web/src/main/js/apps/projectDeletion/App.tsx index 3ff820eab2c..a57cca56f9c 100644 --- a/server/sonar-web/src/main/js/apps/projectDeletion/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectDeletion/App.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 { translate } from 'sonar-ui-common/helpers/l10n'; import Form from './Form'; import Header from './Header'; @@ -30,7 +30,7 @@ interface Props { export default function App(props: Props) { return ( <div className="page page-limited"> - <Helmet title={translate('deletion.page')} /> + <Helmet defer={false} title={translate('deletion.page')} /> <Header component={props.component} /> <Form component={props.component} /> </div> diff --git a/server/sonar-web/src/main/js/apps/projectDeletion/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectDeletion/__tests__/__snapshots__/App-test.tsx.snap index 4bbc7bf918a..162b55e77fd 100644 --- a/server/sonar-web/src/main/js/apps/projectDeletion/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectDeletion/__tests__/__snapshots__/App-test.tsx.snap @@ -4,8 +4,8 @@ exports[`should render 1`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="deletion.page" /> diff --git a/server/sonar-web/src/main/js/apps/projectKey/Key.tsx b/server/sonar-web/src/main/js/apps/projectKey/Key.tsx index 6b4c6cddc1a..692ede78f58 100644 --- a/server/sonar-web/src/main/js/apps/projectKey/Key.tsx +++ b/server/sonar-web/src/main/js/apps/projectKey/Key.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 { withRouter, WithRouterProps } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { changeKey } from '../../api/components'; @@ -41,7 +41,7 @@ export class Key extends React.PureComponent<Props & WithRouterProps> { const { component } = this.props; return ( <div className="page page-limited" id="project-key"> - <Helmet title={translate('update_key.page')} /> + <Helmet defer={false} title={translate('update_key.page')} /> <header className="page-header"> <h1 className="page-title">{translate('update_key.page')}</h1> <div className="page-description">{translate('update_key.page.description')}</div> diff --git a/server/sonar-web/src/main/js/apps/projectKey/__tests__/__snapshots__/Key-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectKey/__tests__/__snapshots__/Key-test.tsx.snap index da5365e6d5c..84897de357a 100644 --- a/server/sonar-web/src/main/js/apps/projectKey/__tests__/__snapshots__/Key-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectKey/__tests__/__snapshots__/Key-test.tsx.snap @@ -5,8 +5,8 @@ exports[`should render and change key 1`] = ` className="page page-limited" id="project-key" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="update_key.page" /> diff --git a/server/sonar-web/src/main/js/apps/projectLinks/App.tsx b/server/sonar-web/src/main/js/apps/projectLinks/App.tsx index 4130098fc83..ab0b7fce8bc 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/App.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 DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { createLink, deleteLink, getProjectLinks } from '../../api/projectLinks'; @@ -92,7 +92,7 @@ export default class App extends React.PureComponent<Props, State> { render() { return ( <div className="page page-limited"> - <Helmet title={translate('project_links.page')} /> + <Helmet defer={false} title={translate('project_links.page')} /> <Header onCreate={this.handleCreateLink} /> <DeferredSpinner loading={this.state.loading}> {this.state.links && <Table links={this.state.links} onDelete={this.handleDeleteLink} />} diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/App-test.tsx.snap index b817f3fbcfd..1062c8f90cd 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/App-test.tsx.snap @@ -4,8 +4,8 @@ exports[`should create link 1`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="project_links.page" /> @@ -48,8 +48,8 @@ exports[`should delete link 1`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="project_links.page" /> @@ -86,8 +86,8 @@ exports[`should fetch links and render 1`] = ` <div className="page page-limited" > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="project_links.page" /> diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx index ff65af05222..fa6f38802eb 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityGate/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityGate/App.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 { translate } from 'sonar-ui-common/helpers/l10n'; import { associateGateWithProject, @@ -133,7 +133,7 @@ export default class App extends React.PureComponent<Props> { return ( <div className="page page-limited" id="project-quality-gate"> <Suggestions suggestions="project_quality_gate" /> - <Helmet title={translate('project_quality_gate.page')} /> + <Helmet defer={false} title={translate('project_quality_gate.page')} /> <A11ySkipTarget anchor="qg_main" /> <Header /> {loading ? ( diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx index 19821a0b93b..8fd4a17e1f9 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/App.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 { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n'; import { associateProject, @@ -131,7 +131,7 @@ export default class QualityProfiles extends React.PureComponent<Props, State> { return ( <div className="page page-limited"> <Suggestions suggestions="project_quality_profiles" /> - <Helmet title={translate('project_quality_profiles.page')} /> + <Helmet defer={false} title={translate('project_quality_profiles.page')} /> <A11ySkipTarget anchor="profiles_main" /> diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx index b4cfb2333e7..07aee81409d 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx @@ -19,7 +19,7 @@ */ import { omitBy } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import ListFooter from 'sonar-ui-common/components/controls/ListFooter'; import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; import handleRequiredAuthentication from 'sonar-ui-common/helpers/handleRequiredAuthentication'; @@ -364,7 +364,7 @@ export class AllProjects extends React.PureComponent<Props, State> { return ( <div className="layout-page projects-page" id="projects-page"> <Suggestions suggestions="projects" /> - <Helmet title={translate('projects.page')} /> + <Helmet defer={false} title={translate('projects.page')} /> {initialLoading ? ( <div className="display-flex-space-around width-100 huge-spacer-top"> diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/AllProjects-test.tsx.snap b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/AllProjects-test.tsx.snap index d902f9e0b70..5d307bf0df6 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/AllProjects-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/__snapshots__/AllProjects-test.tsx.snap @@ -33,8 +33,8 @@ exports[`renders 1`] = ` <Suggestions suggestions="projects" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="projects.page" /> @@ -179,8 +179,8 @@ exports[`renders 2`] = ` <Suggestions suggestions="projects" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="projects.page" /> @@ -271,8 +271,8 @@ exports[`renders correctly empty organization 1`] = ` <Suggestions suggestions="projects" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="projects.page" /> @@ -294,8 +294,8 @@ exports[`renders correctly empty organization 2`] = ` <Suggestions suggestions="projects" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="projects.page" /> @@ -320,8 +320,8 @@ exports[`renders correctly empty organization 3`] = ` <Suggestions suggestions="projects" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="projects.page" /> diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx index 88215024d1d..f61ebdf5ddb 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/App.tsx @@ -19,7 +19,7 @@ */ import { debounce, uniq, without } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import ListFooter from 'sonar-ui-common/components/controls/ListFooter'; import { toShortNotSoISOString } from 'sonar-ui-common/helpers/dates'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -183,7 +183,7 @@ export default class App extends React.PureComponent<Props, State> { return ( <div className="page page-limited" id="projects-management-page"> <Suggestions suggestions="projects_management" /> - <Helmet title={translate('projects_management')} /> + <Helmet defer={false} title={translate('projects_management')} /> <Header hasProvisionPermission={this.props.hasProvisionPermission} diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx index e7a1f25bdf4..9506b773e74 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/App.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 { WithRouterProps } from 'react-router'; import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -120,7 +120,7 @@ class App extends React.PureComponent<Props, State> { return ( <> - <Helmet defaultTitle={defaultTitle} titleTemplate={'%s - ' + defaultTitle} /> + <Helmet defaultTitle={defaultTitle} defer={false} titleTemplate={`%s - ${defaultTitle}`} /> <div className="layout-page" id="quality-gates-page"> <Suggestions suggestions="quality_gates" /> diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx index cb4e762b467..1c0a686dd9b 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.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 DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; import { fetchQualityGate } from '../../../api/quality-gates'; @@ -138,7 +138,7 @@ export class Details extends React.PureComponent<Props, State> { <DeferredSpinner loading={loading} timeout={200}> {qualityGate && ( <> - <Helmet title={qualityGate.name} /> + <Helmet defer={false} title={qualityGate.name} /> <DetailsHeader onSetDefault={this.handleSetDefault} organization={organization} diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/Details-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/Details-test.tsx.snap index 4cc1de5c82a..bdcfec6b95d 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/Details-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/Details-test.tsx.snap @@ -8,8 +8,8 @@ exports[`should render correctly: loaded 1`] = ` loading={false} timeout={200} > - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="qualitygate" /> diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileContainer.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileContainer.tsx index 615604ed3c7..c0d7e479073 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileContainer.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/ProfileContainer.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 { WithRouterProps } from 'react-router'; import ProfileHeader from '../details/ProfileHeader'; import { Profile } from '../types'; @@ -82,7 +82,7 @@ export default class ProfileContainer extends React.PureComponent<Props & WithRo return ( <div id="quality-profile"> - <Helmet title={profile.name} /> + <Helmet defer={false} title={profile.name} /> <ProfileHeader organization={organization} profile={profile} diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileContainer-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileContainer-test.tsx index 42683348643..e028d15bb4b 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileContainer-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/ProfileContainer-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { WithRouterProps } from 'react-router'; import { mockQualityProfile } from '../../../../helpers/testMocks'; import ProfileHeader from '../../details/ProfileHeader'; diff --git a/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx b/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx index 08d345a05bd..eba2be3ae79 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx @@ -19,7 +19,7 @@ */ import { find } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { connect } from 'react-redux'; import { WithRouterProps } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; @@ -93,7 +93,7 @@ export class App extends React.PureComponent<Props & WithRouterProps, State> { return ( <div className="page page-limited" id="settings-page"> <Suggestions suggestions="settings" /> - <Helmet title={translate('settings.page')} /> + <Helmet defer={false} title={translate('settings.page')} /> <PageHeader component={this.props.component} /> diff --git a/server/sonar-web/src/main/js/apps/settings/components/__tests__/__snapshots__/AppContainer-test.tsx.snap b/server/sonar-web/src/main/js/apps/settings/components/__tests__/__snapshots__/AppContainer-test.tsx.snap index d3f5cdc9a8b..cabe4ab6945 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/__tests__/__snapshots__/AppContainer-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/settings/components/__tests__/__snapshots__/AppContainer-test.tsx.snap @@ -8,8 +8,8 @@ exports[`should render analysis scope correctly 1`] = ` <Suggestions suggestions="settings" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="settings.page" /> @@ -44,8 +44,8 @@ exports[`should render default view correctly 1`] = ` <Suggestions suggestions="settings" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="settings.page" /> @@ -80,8 +80,8 @@ exports[`should render languages correctly 1`] = ` <Suggestions suggestions="settings" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="settings.page" /> @@ -116,8 +116,8 @@ exports[`should render newCodePeriod correctly 1`] = ` <Suggestions suggestions="settings" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="settings.page" /> @@ -150,8 +150,8 @@ exports[`should render pull request decoration binding correctly 1`] = ` <Suggestions suggestions="settings" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="settings.page" /> @@ -186,8 +186,8 @@ exports[`should render pull request decoration correctly 1`] = ` <Suggestions suggestions="settings" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="settings.page" /> diff --git a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.tsx b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.tsx index 76c3750ec94..54996329f85 100644 --- a/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.tsx +++ b/server/sonar-web/src/main/js/apps/settings/encryption/EncryptionApp.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 DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { checkSecretKey, generateSecretKey } from '../../../api/settings'; @@ -71,7 +71,7 @@ export default class EncryptionApp extends React.PureComponent<{}, State> { const { loading, secretKey, secretKeyAvailable } = this.state; return ( <div className="page page-limited" id="encryption-page"> - <Helmet title={translate('property.category.security.encryption')} /> + <Helmet defer={false} title={translate('property.category.security.encryption')} /> <header className="page-header"> <h1 className="page-title">{translate('property.category.security.encryption')}</h1> <DeferredSpinner loading={loading} /> diff --git a/server/sonar-web/src/main/js/apps/system/components/App.tsx b/server/sonar-web/src/main/js/apps/system/components/App.tsx index 5f9a69f9d8c..205c98c0e1c 100644 --- a/server/sonar-web/src/main/js/apps/system/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/App.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 { withRouter, WithRouterProps } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getSystemInfo } from '../../../api/system'; @@ -121,7 +121,7 @@ class App extends React.PureComponent<Props, State> { return ( <div className="page page-limited"> <Suggestions suggestions="system_info" /> - <Helmet title={translate('system_info.page')} /> + <Helmet defer={false} title={translate('system_info.page')} /> <SystemUpgradeNotif /> {sysInfoData && ( <PageHeader diff --git a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx index e9a218cc96a..a06ce473b52 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersApp.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 ListFooter from 'sonar-ui-common/components/controls/ListFooter'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getIdentityProviders, searchUsers } from '../../api/users'; @@ -120,7 +120,7 @@ export class UsersApp extends React.PureComponent<Props, State> { return ( <div className="page page-limited" id="users-page"> <Suggestions suggestions="users" /> - <Helmet title={translate('users.page')} /> + <Helmet defer={false} title={translate('users.page')} /> <Header loading={loading} onUpdateUsers={this.fetchUsers} /> <Search query={query} updateQuery={this.updateQuery} /> <UsersList diff --git a/server/sonar-web/src/main/js/apps/users/__tests__/__snapshots__/UsersApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/users/__tests__/__snapshots__/UsersApp-test.tsx.snap index 68ea461d488..3f747643705 100644 --- a/server/sonar-web/src/main/js/apps/users/__tests__/__snapshots__/UsersApp-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/users/__tests__/__snapshots__/UsersApp-test.tsx.snap @@ -8,8 +8,8 @@ exports[`should render correctly 1`] = ` <Suggestions suggestions="users" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="users.page" /> @@ -49,8 +49,8 @@ exports[`should render correctly 2`] = ` <Suggestions suggestions="users" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="users.page" /> diff --git a/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx b/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx index 44367d6c0c7..e882d27cf0f 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/WebApiApp.tsx @@ -19,7 +19,7 @@ */ import { maxBy } from 'lodash'; import * as React from 'react'; -import Helmet from 'react-helmet'; +import { Helmet } from 'react-helmet-async'; import { Link, withRouter, WithRouterProps } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { addSideBarClass, removeSideBarClass } from 'sonar-ui-common/helpers/pages'; @@ -158,7 +158,7 @@ export class WebApiApp extends React.PureComponent<Props, State> { return ( <div className="layout-page"> <Suggestions suggestions="api_documentation" /> - <Helmet title={translate('api_documentation.page')} /> + <Helmet defer={false} title={translate('api_documentation.page')} /> <ScreenPositionHelper className="layout-page-side-outer"> {({ top }) => ( <div className="layout-page-side" style={{ top }}> diff --git a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/WebApiApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/WebApiApp-test.tsx.snap index db788e7b310..3c4c81e3623 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/WebApiApp-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/WebApiApp-test.tsx.snap @@ -7,8 +7,8 @@ exports[`should render correctly 1`] = ` <Suggestions suggestions="api_documentation" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="api_documentation.page" /> diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx index 5762f3ef146..d4f3346219a 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/App.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 { translate } from 'sonar-ui-common/helpers/l10n'; import { createWebhook, deleteWebhook, searchWebhooks, updateWebhook } from '../../../api/webhooks'; import Suggestions from '../../../app/components/embed-docs-modal/Suggestions'; @@ -124,7 +124,7 @@ export default class App extends React.PureComponent<Props, State> { return ( <> <Suggestions suggestions="webhooks" /> - <Helmet title={translate('webhooks.page')} /> + <Helmet defer={false} title={translate('webhooks.page')} /> <div className="page page-limited"> <PageHeader loading={loading}> diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/__snapshots__/App-test.tsx.snap index c871f49d18a..7cf43d1539a 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/__snapshots__/App-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/webhooks/components/__tests__/__snapshots__/App-test.tsx.snap @@ -5,8 +5,8 @@ exports[`should be in loading status 1`] = ` <Suggestions suggestions="webhooks" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="webhooks.page" /> @@ -31,8 +31,8 @@ exports[`should fetch webhooks and display them 1`] = ` <Suggestions suggestions="webhooks" /> - <HelmetWrapper - defer={true} + <Helmet + defer={false} encodeSpecialCharacters={true} title="webhooks.page" /> diff --git a/server/sonar-web/src/main/js/components/common/OrganizationHelmet.tsx b/server/sonar-web/src/main/js/components/common/OrganizationHelmet.tsx index fc26b4de9f8..9ba732fa1ae 100644 --- a/server/sonar-web/src/main/js/components/common/OrganizationHelmet.tsx +++ b/server/sonar-web/src/main/js/components/common/OrganizationHelmet.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'; interface Props { organization?: { name: string }; @@ -27,5 +27,7 @@ interface Props { export default function OrganizationHelmet({ title, organization }: Props) { const defaultTitle = title + (organization ? ' - ' + organization.name : ''); - return <Helmet defaultTitle={defaultTitle} titleTemplate={'%s - ' + defaultTitle} />; + return ( + <Helmet defaultTitle={defaultTitle} defer={false} titleTemplate={`%s - ${defaultTitle}`} /> + ); } diff --git a/server/sonar-web/yarn.lock b/server/sonar-web/yarn.lock index f2edd945254..ba8f6d6059b 100644 --- a/server/sonar-web/yarn.lock +++ b/server/sonar-web/yarn.lock @@ -700,6 +700,13 @@ dependencies: regenerator-runtime "^0.13.2" +"@babel/runtime@^7.3.4": + version "7.7.7" + resolved "https://repox.jfrog.io/repox/api/npm/npm/@babel/runtime/-/runtime-7.7.7.tgz#194769ca8d6d7790ec23605af9ee3e42a0aa79cf" + integrity sha1-GUdpyo1td5DsI2Ba+e4+QqCqec8= + dependencies: + regenerator-runtime "^0.13.2" + "@babel/runtime@^7.4.2", "@babel/runtime@^7.5.5": version "7.6.2" resolved "https://repox.jfrog.io/repox/api/npm/npm/@babel/runtime/-/runtime-7.6.2.tgz#c3d6e41b304ef10dcf13777a33e7694ec4a9a6dd" @@ -1239,10 +1246,10 @@ dependencies: "@types/react" "*" -"@types/react-helmet@5.0.8": - version "5.0.8" - resolved "https://repox.jfrog.io/repox/api/npm/npm/@types/react-helmet/-/react-helmet-5.0.8.tgz#f080eea6652e44f60b4574463d238f268d81d9af" - integrity sha1-8IDupmUuRPYLRXRGPSOPJo2B2a8= +"@types/react-helmet@5.0.14": + version "5.0.14" + resolved "https://repox.jfrog.io/repox/api/npm/npm/@types/react-helmet/-/react-helmet-5.0.14.tgz#a07979ccb2cee088e74e735c84058fc8607d32e4" + integrity sha1-oHl5zLLO4IjnTnNchAWPyGB9MuQ= dependencies: "@types/react" "*" @@ -4153,7 +4160,7 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -exenv@^1.2.0, exenv@^1.2.1: +exenv@^1.2.0: version "1.2.2" resolved "https://repox.jfrog.io/repox/api/npm/npm/exenv/-/exenv-1.2.2.tgz#2ae78e85d9894158670b03d47bec1f03bd91bb9d" integrity sha1-KueOhdmJQVhnCwPUe+wfA72Ru50= @@ -8224,7 +8231,7 @@ prop-types-exact@^1.2.0: object.assign "^4.1.0" reflect.ownkeys "^0.2.0" -prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@15.7.2, prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://repox.jfrog.io/repox/api/npm/npm/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha1-UsQedbjIfnK52TYOAga5ncv/psU= @@ -8533,15 +8540,21 @@ react-fast-compare@^1.0.0: resolved "https://repox.jfrog.io/repox/api/npm/npm/react-fast-compare/-/react-fast-compare-1.0.0.tgz#813a039155e49b43ceffe99528fe5e9d97a6c938" integrity sha1-gToDkVXkm0PO/+mVKP5enZemyTg= -react-helmet@5.2.0: - version "5.2.0" - resolved "https://repox.jfrog.io/repox/api/npm/npm/react-helmet/-/react-helmet-5.2.0.tgz#a81811df21313a6d55c5f058c4aeba5d6f3d97a7" - integrity sha1-qBgR3yExOm1VxfBYxK66XW89l6c= +react-fast-compare@^2.0.4: + version "2.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" + integrity sha1-6EtNRVsP7BE+BALDKTUnFRlvgfk= + +react-helmet-async@1.0.4: + version "1.0.4" + resolved "https://repox.jfrog.io/repox/api/npm/npm/react-helmet-async/-/react-helmet-async-1.0.4.tgz#079ef10b7fefcaee6240fefd150711e62463cc97" + integrity sha1-B57xC3/vyu5iQP79FQcR5iRjzJc= dependencies: - deep-equal "^1.0.1" - object-assign "^4.1.1" - prop-types "^15.5.4" - react-side-effect "^1.1.0" + "@babel/runtime" "^7.3.4" + invariant "^2.2.4" + prop-types "^15.7.2" + react-fast-compare "^2.0.4" + shallowequal "^1.1.0" react-input-autosize@^2.1.2: version "2.2.1" @@ -8616,14 +8629,6 @@ react-select@1.2.1: prop-types "^15.5.8" react-input-autosize "^2.1.2" -react-side-effect@^1.1.0: - version "1.1.5" - resolved "https://repox.jfrog.io/repox/api/npm/npm/react-side-effect/-/react-side-effect-1.1.5.tgz#f26059e50ed9c626d91d661b9f3c8bb38cd0ff2d" - integrity sha1-8mBZ5Q7ZxibZHWYbnzyLs4zQ/y0= - dependencies: - exenv "^1.2.1" - shallowequal "^1.0.1" - react-test-renderer@16.8.6, react-test-renderer@^16.0.0-0: version "16.8.6" resolved "https://repox.jfrog.io/repox/api/npm/npm/react-test-renderer/-/react-test-renderer-16.8.6.tgz#188d8029b8c39c786f998aa3efd3ffe7642d5ba1" @@ -9322,7 +9327,7 @@ sha.js@^2.4.0, sha.js@^2.4.8: inherits "^2.0.1" safe-buffer "^5.0.1" -shallowequal@^1.0.1: +shallowequal@^1.1.0: version "1.1.0" resolved "https://repox.jfrog.io/repox/api/npm/npm/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha1-GI1SHelbkIdAT9TctosT3wrk5/g= |