diff options
author | Philippe Perrin <philippe.perrin@sonarsource.com> | 2020-12-17 15:53:19 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-12-17 20:08:01 +0000 |
commit | aed46d9ffaf2af2acbb0b0cdde59ce8d64abf082 (patch) | |
tree | 3d7290c9365b262988ab2499e9c8c4676c69aedb /server | |
parent | 30287fb9c01be104a84a48cc0d42fe4f99f12684 (diff) | |
download | sonarqube-aed46d9ffaf2af2acbb0b0cdde59ce8d64abf082.tar.gz sonarqube-aed46d9ffaf2af2acbb0b0cdde59ce8d64abf082.zip |
Fix hotspots
Diffstat (limited to 'server')
8 files changed, 9 insertions, 278 deletions
diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx b/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx index 63e806e974d..fa66c09d45e 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalFooter.tsx @@ -23,10 +23,8 @@ import { Alert } from 'sonar-ui-common/components/ui/Alert'; import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n'; import InstanceMessage from '../../components/common/InstanceMessage'; import { getEdition } from '../../helpers/editions'; -import { isSonarCloud } from '../../helpers/system'; import { EditionKey } from '../../types/editions'; import GlobalFooterBranding from './GlobalFooterBranding'; -import GlobalFooterSonarCloud from './GlobalFooterSonarCloud'; interface Props { hideLoggedInInfo?: boolean; @@ -41,10 +39,6 @@ export default function GlobalFooter({ sonarqubeEdition, sonarqubeVersion }: Props) { - if (isSonarCloud()) { - return <GlobalFooterSonarCloud />; - } - const currentEdition = sonarqubeEdition && getEdition(sonarqubeEdition); return ( @@ -71,7 +65,7 @@ export default function GlobalFooter({ )} <li className="page-footer-menu-item"> <a - href="http://www.gnu.org/licenses/lgpl-3.0.txt" + href="https://www.gnu.org/licenses/lgpl-3.0.txt" rel="noopener noreferrer" target="_blank"> {translate('footer.license')} diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooterBranding.tsx b/server/sonar-web/src/main/js/app/components/GlobalFooterBranding.tsx index ae2d1ef0719..bc6a350aa22 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalFooterBranding.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalFooterBranding.tsx @@ -27,7 +27,7 @@ export default function GlobalFooterBranding() { return official ? ( <div> SonarQube™ technology is powered by{' '} - <a href="http://www.sonarsource.com" rel="noopener noreferrer" target="_blank"> + <a href="https://www.sonarsource.com" rel="noopener noreferrer" target="_blank"> SonarSource SA </a> </div> @@ -35,7 +35,7 @@ export default function GlobalFooterBranding() { <div> This application is based on{' '} <a - href="http://www.sonarqube.org/?referrer=sonarqube" + href="https://www.sonarqube.org/?referrer=sonarqube" rel="noopener noreferrer" target="_blank" title="SonarQube™"> @@ -43,7 +43,7 @@ export default function GlobalFooterBranding() { </a>{' '} but is <strong>not</strong> an official version provided by{' '} <a - href="http://www.sonarsource.com" + href="https://www.sonarsource.com" rel="noopener noreferrer" target="_blank" title="SonarSource SA"> diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx b/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx deleted file mode 100644 index c8e4ac01533..00000000000 --- a/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx +++ /dev/null @@ -1,90 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as getYear from 'date-fns/get_year'; -import * as React from 'react'; -import { Link } from 'react-router'; -import { translate } from 'sonar-ui-common/helpers/l10n'; - -export default function GlobalFooterSonarCloud() { - return ( - <div className="page-footer page-container" id="footer"> - <div> - {`© 2008-${getYear(new Date())}, SonarCloud by `} - <a - href="http://www.sonarsource.com" - rel="noopener noreferrer" - target="_blank" - title="SonarSource SA"> - SonarSource SA - </a> - . All rights reserved. - </div> - - <ul className="page-footer-menu"> - <li className="page-footer-menu-item"> - <a - href="https://blog.sonarsource.com/product/SonarCloud" - rel="noopener noreferrer" - target="_blank"> - {translate('footer.news')} - </a> - </li> - <li className="page-footer-menu-item"> - <a href="https://twitter.com/sonarcloud" rel="noopener noreferrer" target="_blank"> - {translate('footer.twitter')} - </a> - </li> - <li className="page-footer-menu-item"> - <Link rel="noopener noreferrer" target="_blank" to="/terms.pdf"> - {translate('footer.terms')} - </Link> - </li> - <li className="page-footer-menu-item"> - <Link to="/about/pricing/">{translate('footer.pricing')}</Link> - </li> - <li className="page-footer-menu-item"> - <Link to="/documentation/privacy/">{translate('footer.privacy')}</Link> - </li> - <li className="page-footer-menu-item"> - <Link to="/documentation/security/">{translate('footer.security')}</Link> - </li> - <li className="page-footer-menu-item"> - <a - href="https://community.sonarsource.com/c/help/sc" - rel="noopener noreferrer" - target="_blank"> - {translate('footer.help')} - </a> - </li> - <li className="page-footer-menu-item"> - <Link to="/about/contact">{translate('footer.contact_us')}</Link> - </li> - <li className="page-footer-menu-item"> - <a href="https://sonarcloud.statuspage.io/" rel="noopener noreferrer" target="_blank"> - {translate('footer.status')} - </a> - </li> - <li className="page-footer-menu-item"> - <Link to="/about">{translate('footer.about')}</Link> - </li> - </ul> - </div> - ); -} diff --git a/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx index 284cae5fad8..262aea47294 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx @@ -19,7 +19,6 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { isSonarCloud } from '../../../helpers/system'; import { EditionKey } from '../../../types/editions'; import GlobalFooter from '../GlobalFooter'; @@ -45,12 +44,7 @@ it('should display the sq version', () => { ).toMatchSnapshot(); }); -it('should render SonarCloud footer', () => { - expect(getWrapper({}, true)).toMatchSnapshot(); -}); - -function getWrapper(props = {}, onSonarCloud = false) { - (isSonarCloud as jest.Mock).mockImplementation(() => onSonarCloud); +function getWrapper(props = {}) { return shallow( <GlobalFooter productionDatabase={true} sonarqubeEdition={EditionKey.community} {...props} /> ); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooterSonarCloud-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooterSonarCloud-test.tsx deleted file mode 100644 index 8ebb8d1d06e..00000000000 --- a/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooterSonarCloud-test.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2020 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import GlobalFooterSonarCloud from '../GlobalFooterSonarCloud'; - -jest.mock('date-fns/get_year', () => jest.fn(() => '20XX')); - -it('should render correctly', () => { - expect(shallow(<GlobalFooterSonarCloud />)).toMatchSnapshot(); -}); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap index cb115f4ab66..d0526336fd9 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap @@ -23,7 +23,7 @@ exports[`should display the sq version 1`] = ` className="page-footer-menu-item" > <a - href="http://www.gnu.org/licenses/lgpl-3.0.txt" + href="https://www.gnu.org/licenses/lgpl-3.0.txt" rel="noopener noreferrer" target="_blank" > @@ -102,7 +102,7 @@ exports[`should not render the only logged in information 1`] = ` className="page-footer-menu-item" > <a - href="http://www.gnu.org/licenses/lgpl-3.0.txt" + href="https://www.gnu.org/licenses/lgpl-3.0.txt" rel="noopener noreferrer" target="_blank" > @@ -146,8 +146,6 @@ exports[`should not render the only logged in information 1`] = ` </div> `; -exports[`should render SonarCloud footer 1`] = `<GlobalFooterSonarCloud />`; - exports[`should render the only logged in information 1`] = ` <div className="page-footer page-container" @@ -166,7 +164,7 @@ exports[`should render the only logged in information 1`] = ` className="page-footer-menu-item" > <a - href="http://www.gnu.org/licenses/lgpl-3.0.txt" + href="https://www.gnu.org/licenses/lgpl-3.0.txt" rel="noopener noreferrer" target="_blank" > diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap deleted file mode 100644 index f27e9ef2d71..00000000000 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap +++ /dev/null @@ -1,137 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` -<div - className="page-footer page-container" - id="footer" -> - <div> - © 2008-20XX, SonarCloud by - <a - href="http://www.sonarsource.com" - rel="noopener noreferrer" - target="_blank" - title="SonarSource SA" - > - SonarSource SA - </a> - . All rights reserved. - </div> - <ul - className="page-footer-menu" - > - <li - className="page-footer-menu-item" - > - <a - href="https://blog.sonarsource.com/product/SonarCloud" - rel="noopener noreferrer" - target="_blank" - > - footer.news - </a> - </li> - <li - className="page-footer-menu-item" - > - <a - href="https://twitter.com/sonarcloud" - rel="noopener noreferrer" - target="_blank" - > - footer.twitter - </a> - </li> - <li - className="page-footer-menu-item" - > - <Link - onlyActiveOnIndex={false} - rel="noopener noreferrer" - style={Object {}} - target="_blank" - to="/terms.pdf" - > - footer.terms - </Link> - </li> - <li - className="page-footer-menu-item" - > - <Link - onlyActiveOnIndex={false} - style={Object {}} - to="/about/pricing/" - > - footer.pricing - </Link> - </li> - <li - className="page-footer-menu-item" - > - <Link - onlyActiveOnIndex={false} - style={Object {}} - to="/documentation/privacy/" - > - footer.privacy - </Link> - </li> - <li - className="page-footer-menu-item" - > - <Link - onlyActiveOnIndex={false} - style={Object {}} - to="/documentation/security/" - > - footer.security - </Link> - </li> - <li - className="page-footer-menu-item" - > - <a - href="https://community.sonarsource.com/c/help/sc" - rel="noopener noreferrer" - target="_blank" - > - footer.help - </a> - </li> - <li - className="page-footer-menu-item" - > - <Link - onlyActiveOnIndex={false} - style={Object {}} - to="/about/contact" - > - footer.contact_us - </Link> - </li> - <li - className="page-footer-menu-item" - > - <a - href="https://sonarcloud.statuspage.io/" - rel="noopener noreferrer" - target="_blank" - > - footer.status - </a> - </li> - <li - className="page-footer-menu-item" - > - <Link - onlyActiveOnIndex={false} - style={Object {}} - to="/about" - > - footer.about - </Link> - </li> - </ul> -</div> -`; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleInheritanceIcon.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleInheritanceIcon.tsx index 056582e5d32..a6edca938a6 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleInheritanceIcon.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleInheritanceIcon.tsx @@ -36,7 +36,7 @@ export default function RuleInheritanceIcon({ className, inheritance, ...other } viewBox="0 0 16 16" width={16} xmlSpace="preserve" - xmlnsXlink="http://www.w3.org/1999/xlink" + xmlnsXlink="https://www.w3.org/1999/xlink" {...other}> <path d="M6.25 12.5a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0zm0-9a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0zm5 1a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0zm.75 0a1.5 1.5 0 0 1-.75 1.297c-.023 2.82-2.023 3.445-3.352 3.867-1.242.39-1.648.578-1.648 1.336v.203A1.5 1.5 0 1 1 4 12.5a1.5 1.5 0 0 1 .75-1.297V4.797A1.5 1.5 0 1 1 7 3.5a1.5 1.5 0 0 1-.75 1.297V8.68c.398-.196.82-.328 1.203-.446 1.453-.46 2.281-.804 2.297-2.437A1.5 1.5 0 1 1 12 4.5z" |