]> source.dussan.org Git - sonarqube.git/commitdiff
SONARCLOUD-45 Fix featured projects link
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Thu, 8 Nov 2018 13:42:56 +0000 (14:42 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 12 Nov 2018 09:47:55 +0000 (10:47 +0100)
server/sonar-web/src/main/js/apps/about/sonarcloud/components/FeaturedProjects.tsx
server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/FeaturedProjects-test.tsx.snap

index b14ef2a375a6c48879bc2b0f4710ee3cfefd4459..7dbcd7ec7aa525806442df873b17237543610364 100644 (file)
@@ -21,7 +21,6 @@ import * as React from 'react';
 import * as classNames from 'classnames';
 import CountUp from 'react-countup';
 import { throttle } from 'lodash';
-import { Link } from 'react-router';
 import { FeaturedProject } from '../utils';
 import CoverageRating from '../../../../components/ui/CoverageRating';
 import DuplicationsRating from '../../../../components/ui/DuplicationsRating';
@@ -31,7 +30,7 @@ import ProjectCardLanguagesContainer from '../../../projects/components/ProjectC
 import Rating from '../../../../components/ui/Rating';
 import { formatMeasure } from '../../../../helpers/measures';
 import { getMetricName } from '../../../overview/utils';
-import { getProjectUrl, getBaseUrl } from '../../../../helpers/urls';
+import { getProjectUrl, getBaseUrl, getPathUrlAsString } from '../../../../helpers/urls';
 import './FeaturedProjects.css';
 
 interface Props {
@@ -182,7 +181,7 @@ interface ProjectCardProps {
 export function ProjectCard({ project, order, viewable }: ProjectCardProps) {
   return (
     <div className="sc-project-card-container" style={{ order }}>
-      <Link className="sc-project-card" to={getProjectUrl(project.key)}>
+      <a className="sc-project-card" href={getPathUrlAsString(getProjectUrl(project.key))}>
         <div className="sc-project-card-header">
           <OrganizationAvatar
             className="no-border spacer-bottom"
@@ -268,7 +267,7 @@ export function ProjectCard({ project, order, viewable }: ProjectCardProps) {
             distribution={project.languages.join(';')}
           />
         </div>
-      </Link>
+      </a>
     </div>
   );
 }
index 0f9e28d22ffd4262078a64f555531aff40cedf82..36862944aad8ca8c12dc005b5da204d94e820284 100644 (file)
@@ -9,19 +9,9 @@ exports[`should render ProjectCard correctly 1`] = `
     }
   }
 >
-  <Link
+  <a
     className="sc-project-card"
-    onlyActiveOnIndex={false}
-    style={Object {}}
-    to={
-      Object {
-        "pathname": "/dashboard",
-        "query": Object {
-          "branch": undefined,
-          "id": "sonarsource-jfrog.simple-js-php-project",
-        },
-      }
-    }
+    href="/dashboard?id=sonarsource-jfrog.simple-js-php-project"
   >
     <div
       className="sc-project-card-header"
@@ -104,7 +94,7 @@ exports[`should render ProjectCard correctly 1`] = `
         distribution="js;php"
       />
     </div>
-  </Link>
+  </a>
 </div>
 `;