diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2022-08-25 10:45:27 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-08-29 20:02:53 +0000 |
commit | 06f6244b0ae2fd288e05fbdd0bd077a0da9066c4 (patch) | |
tree | 5c1cc37e9aee4859a31321b83d32eafad07f2c14 /server/sonar-web/src/main/js/apps/maintenance | |
parent | c757692a0a8d02998bfd8839c2612e17011013a7 (diff) | |
download | sonarqube-06f6244b0ae2fd288e05fbdd0bd077a0da9066c4.tar.gz sonarqube-06f6244b0ae2fd288e05fbdd0bd077a0da9066c4.zip |
SONAR-17027 Align the way we display links (internal & external) in the UI
Diffstat (limited to 'server/sonar-web/src/main/js/apps/maintenance')
-rw-r--r-- | server/sonar-web/src/main/js/apps/maintenance/components/App.tsx | 25 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/maintenance/components/__tests__/__snapshots__/App-test.tsx.snap | 46 |
2 files changed, 33 insertions, 38 deletions
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 447c8510fec..7b943cf2000 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 @@ -23,6 +23,7 @@ import { Helmet } from 'react-helmet-async'; import { FormattedMessage } from 'react-intl'; import { getMigrationStatus, getSystemStatus, migrateDatabase } from '../../../api/system'; import InstanceMessage from '../../../components/common/InstanceMessage'; +import Link from '../../../components/common/Link'; import { Button } from '../../../components/controls/buttons'; import DateFromNow from '../../../components/intl/DateFromNow'; import TimeFormatter from '../../../components/intl/TimeFormatter'; @@ -163,7 +164,7 @@ export default class App extends React.PureComponent<Props, State> { {translate('maintenance.all_systems_opetational')} </p> <p className="maintenance-text text-center"> - <a href={getBaseUrl() + '/'}>{translate('layout.home')}</a> + <Link to={getBaseUrl() + '/'}>{translate('layout.home')}</Link> </p> </> )} @@ -204,12 +205,11 @@ export default class App extends React.PureComponent<Props, State> { id="maintenance.sonarqube_is_under_maintenance.1" values={{ link: ( - <a - href="https://www.sonarlint.org/?referrer=sonarqube-maintenance" - target="_blank" - rel="noopener noreferrer"> + <Link + to="https://www.sonarlint.org/?referrer=sonarqube-maintenance" + target="_blank"> {translate('maintenance.sonarqube_is_under_maintenance_link.1')} - </a> + </Link> ) }} /> @@ -220,12 +220,11 @@ export default class App extends React.PureComponent<Props, State> { id="maintenance.sonarqube_is_under_maintenance.2" values={{ link: ( - <a - href="https://redirect.sonarsource.com/doc/upgrading.html" - target="_blank" - rel="noopener noreferrer"> + <Link + to="https://redirect.sonarsource.com/doc/upgrading.html" + target="_blank"> {translate('maintenance.sonarqube_is_under_maintenance_link.2')} - </a> + </Link> ) }} /> @@ -239,7 +238,7 @@ export default class App extends React.PureComponent<Props, State> { {translate('maintenance.database_is_up_to_date')} </h1> <p className="maintenance-text text-center"> - <a href={getBaseUrl() + '/'}>{translate('layout.home')}</a> + <Link to={getBaseUrl() + '/'}>{translate('layout.home')}</Link> </p> </> )} @@ -295,7 +294,7 @@ export default class App extends React.PureComponent<Props, State> { {translate('maintenance.database_is_up_to_date')} </h1> <p className="maintenance-text text-center"> - <a href={getBaseUrl() + '/'}>{translate('layout.home')}</a> + <Link to={getBaseUrl() + '/'}>{translate('layout.home')}</Link> </p> </> )} 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 478c483d9a4..0dc87dd0165 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 @@ -31,13 +31,12 @@ exports[`Maintenance Page should render DB_MIGRATION_NEEDED status 1`] = ` id="maintenance.sonarqube_is_under_maintenance.1" values={ Object { - "link": <a - href="https://www.sonarlint.org/?referrer=sonarqube-maintenance" - rel="noopener noreferrer" + "link": <ForwardRef(Link) target="_blank" + to="https://www.sonarlint.org/?referrer=sonarqube-maintenance" > maintenance.sonarqube_is_under_maintenance_link.1 - </a>, + </ForwardRef(Link)>, } } /> @@ -50,13 +49,12 @@ exports[`Maintenance Page should render DB_MIGRATION_NEEDED status 1`] = ` id="maintenance.sonarqube_is_under_maintenance.2" values={ Object { - "link": <a - href="https://redirect.sonarsource.com/doc/upgrading.html" - rel="noopener noreferrer" + "link": <ForwardRef(Link) target="_blank" + to="https://redirect.sonarsource.com/doc/upgrading.html" > maintenance.sonarqube_is_under_maintenance_link.2 - </a>, + </ForwardRef(Link)>, } } /> @@ -97,13 +95,12 @@ exports[`Maintenance Page should render DB_MIGRATION_RUNNING status 1`] = ` id="maintenance.sonarqube_is_under_maintenance.1" values={ Object { - "link": <a - href="https://www.sonarlint.org/?referrer=sonarqube-maintenance" - rel="noopener noreferrer" + "link": <ForwardRef(Link) target="_blank" + to="https://www.sonarlint.org/?referrer=sonarqube-maintenance" > maintenance.sonarqube_is_under_maintenance_link.1 - </a>, + </ForwardRef(Link)>, } } /> @@ -116,13 +113,12 @@ exports[`Maintenance Page should render DB_MIGRATION_RUNNING status 1`] = ` id="maintenance.sonarqube_is_under_maintenance.2" values={ Object { - "link": <a - href="https://redirect.sonarsource.com/doc/upgrading.html" - rel="noopener noreferrer" + "link": <ForwardRef(Link) target="_blank" + to="https://redirect.sonarsource.com/doc/upgrading.html" > maintenance.sonarqube_is_under_maintenance_link.2 - </a>, + </ForwardRef(Link)>, } } /> @@ -282,11 +278,11 @@ exports[`Maintenance Page should render UP status 1`] = ` <p className="maintenance-text text-center" > - <a - href="/" + <ForwardRef(Link) + to="/" > layout.home - </a> + </ForwardRef(Link)> </p> </div> </div> @@ -348,11 +344,11 @@ exports[`Setup Page should render MIGRATION_SUCCEEDED state 1`] = ` <p className="maintenance-text text-center" > - <a - href="/" + <ForwardRef(Link) + to="/" > layout.home - </a> + </ForwardRef(Link)> </p> </div> </div> @@ -383,11 +379,11 @@ exports[`Setup Page should render NO_MIGRATION state 1`] = ` <p className="maintenance-text text-center" > - <a - href="/" + <ForwardRef(Link) + to="/" > layout.home - </a> + </ForwardRef(Link)> </p> </div> </div> |