aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projectsManagement
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2020-05-01 10:50:58 +0200
committersonartech <sonartech@sonarsource.com>2020-05-05 20:03:43 +0000
commitd2dc8046525bb4538ca4d7ba4c5bc91346e31596 (patch)
treec8c97ea7a96e9a2cff883a07573b16c14eb1aa13 /server/sonar-web/src/main/js/apps/projectsManagement
parentb994ce6100ae6664b1b08aafbaf763cefdf582cb (diff)
downloadsonarqube-d2dc8046525bb4538ca4d7ba4c5bc91346e31596.tar.gz
sonarqube-d2dc8046525bb4538ca4d7ba4c5bc91346e31596.zip
SONAR-13342 Fix faulty links
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectsManagement')
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx13
-rw-r--r--server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap2
2 files changed, 4 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx
index c04d80194dd..fe4a70a5f4a 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx
@@ -25,8 +25,7 @@ import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
import DateTooltipFormatter from 'sonar-ui-common/components/intl/DateTooltipFormatter';
import { Project } from '../../api/components';
import PrivacyBadgeContainer from '../../components/common/PrivacyBadgeContainer';
-import { getPortfolioUrl, getProjectUrl } from '../../helpers/urls';
-import { ComponentQualifier } from '../../types/component';
+import { getComponentOverviewUrl } from '../../helpers/urls';
import './ProjectRow.css';
import ProjectRowActions from './ProjectRowActions';
@@ -43,12 +42,6 @@ export default class ProjectRow extends React.PureComponent<Props> {
this.props.onProjectCheck(this.props.project, checked);
};
- getComponentUrl(project: Project) {
- return project.qualifier === ComponentQualifier.Portfolio
- ? getPortfolioUrl(project.key)
- : getProjectUrl(project.key);
- }
-
render() {
const { organization, project, selected } = this.props;
@@ -59,7 +52,9 @@ export default class ProjectRow extends React.PureComponent<Props> {
</td>
<td className="nowrap hide-overflow project-row-text-cell">
- <Link className="link-with-icon" to={this.getComponentUrl(project)}>
+ <Link
+ className="link-with-icon"
+ to={getComponentOverviewUrl(project.key, project.qualifier)}>
<QualifierIcon className="little-spacer-right" qualifier={project.qualifier} />
<Tooltip overlay={project.name} placement="left">
diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap
index 52589366e34..c11442aa7ce 100644
--- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/__snapshots__/ProjectRow-test.tsx.snap
@@ -24,7 +24,6 @@ exports[`renders 1`] = `
Object {
"pathname": "/dashboard",
"query": Object {
- "branch": undefined,
"id": "project",
},
}
@@ -217,7 +216,6 @@ exports[`renders: with lastAnalysisDate 1`] = `
Object {
"pathname": "/dashboard",
"query": Object {
- "branch": undefined,
"id": "project",
},
}