]> source.dussan.org Git - sonarqube.git/commitdiff
Fix hotspots
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Thu, 17 Dec 2020 14:53:19 +0000 (15:53 +0100)
committersonartech <sonartech@sonarsource.com>
Thu, 17 Dec 2020 20:08:01 +0000 (20:08 +0000)
server/sonar-web/src/main/js/app/components/GlobalFooter.tsx
server/sonar-web/src/main/js/app/components/GlobalFooterBranding.tsx
server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx [deleted file]
server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx
server/sonar-web/src/main/js/app/components/__tests__/GlobalFooterSonarCloud-test.tsx [deleted file]
server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooter-test.tsx.snap
server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/apps/coding-rules/components/RuleInheritanceIcon.tsx

index 63e806e974d8f430c15aaf4b7ae08822c3930d51..fa66c09d45ec767c5d21270df2a4da82ea74682a 100644 (file)
@@ -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')}
index ae2d1ef07191b98e56c95b006ee73ca8db63e30b..bc6a350aa2224025b05bd57311bbbf3c41d4a1fd 100644 (file)
@@ -27,7 +27,7 @@ export default function GlobalFooterBranding() {
   return official ? (
     <div>
       SonarQube&trade; 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 (file)
index c8e4ac0..0000000
+++ /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>
-  );
-}
index 284cae5fad8f3b024795465c712d9a70a09f91ef..262aea472942230a21aa46ac243ad9f388b260f8 100644 (file)
@@ -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 (file)
index 8ebb8d1..0000000
+++ /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();
-});
index cb115f4ab66c5559e4b4ac8717a4ddd52e9cbdae..d0526336fd98ce7a43cec801a45e77de36454b41 100644 (file)
@@ -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 (file)
index f27e9ef..0000000
+++ /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>
-`;
index 056582e5d32c95f13fd51997b89532c12d44239e..a6edca938a645ca2fa5d680ea6cd237181b864fb 100644 (file)
@@ -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"