aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-11-08 14:42:56 +0100
committersonartech <sonartech@sonarsource.com>2018-11-12 10:47:55 +0100
commit952890a67ed15b7d63e64ea4383a43f44e33b442 (patch)
tree01c3763601b1828eac1dd536c82b97a34b1732a3
parent588867f3d94b20df9bd288e862b6903face77aab (diff)
downloadsonarqube-952890a67ed15b7d63e64ea4383a43f44e33b442.tar.gz
sonarqube-952890a67ed15b7d63e64ea4383a43f44e33b442.zip
SONARCLOUD-45 Fix featured projects link
-rw-r--r--server/sonar-web/src/main/js/apps/about/sonarcloud/components/FeaturedProjects.tsx7
-rw-r--r--server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/FeaturedProjects-test.tsx.snap16
2 files changed, 6 insertions, 17 deletions
diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/components/FeaturedProjects.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/components/FeaturedProjects.tsx
index b14ef2a375a..7dbcd7ec7aa 100644
--- a/server/sonar-web/src/main/js/apps/about/sonarcloud/components/FeaturedProjects.tsx
+++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/components/FeaturedProjects.tsx
@@ -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>
);
}
diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/FeaturedProjects-test.tsx.snap b/server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/FeaturedProjects-test.tsx.snap
index 0f9e28d22ff..36862944aad 100644
--- a/server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/FeaturedProjects-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/FeaturedProjects-test.tsx.snap
@@ -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>
`;