import { getMetrics } from '../../../store/rootReducer';
import { BranchLike, Component, Metric } from '../../../app/types';
import { translate } from '../../../helpers/l10n';
-import { getPathUrlAsString, getProjectUrl } from '../../../helpers/urls';
+import { getProjectUrl, getSonarCloudUrlAsString } from '../../../helpers/urls';
+import { isSonarCloud } from '../../../helpers/system';
import '../styles.css';
interface OwnProps {
<div className="page page-limited">
<div className="overview page-with-sidebar">
<Suggestions suggestions="overview" />
- <Helmet>
- <link href={getPathUrlAsString(getProjectUrl(component.key))} rel="canonical" />
- </Helmet>
+
+ {isSonarCloud() && (
+ <Helmet>
+ <link href={getSonarCloudUrlAsString(getProjectUrl(component.key))} rel="canonical" />
+ </Helmet>
+ )}
{this.renderMain()}
return `${getBaseUrl()}${path.pathname}?${stringify(omitBy(path.query, isNil))}`;
}
+export function getSonarCloudUrlAsString(location: Location) {
+ return 'https://sonarcloud.io' + getPathUrlAsString(location);
+}
+
export function getProjectUrl(project: string): Location {
return { pathname: '/dashboard', query: { id: project } };
}