import TreeMap from '../../../components/charts/TreeMap';
import { translate, translateWithParameters, getLocalizedMetricName } from '../../../helpers/l10n';
import { formatMeasure, isDiffMetric } from '../../../helpers/measures';
-import { getComponentUrl } from '../../../helpers/urls';
+import { getProjectUrl } from '../../../helpers/urls';
/*:: import type { Metric } from '../../../store/metrics/actions'; */
/*:: import type { ComponentEnhanced } from '../types'; */
/*:: import type { TreeMapItem } from '../../../components/charts/TreeMap'; */
sizeValue
),
label: component.name,
- link: getComponentUrl(component.refKey || component.key, branch)
+ link: getProjectUrl(component.refKey || component.key, branch)
};
})
.filter(Boolean);
/**
* Generate URL for a component's home page
+ * Deprecated : use getProjectUrl
*/
export function getComponentUrl(componentKey: string, branch?: string): string {
const branchQuery = branch ? `&branch=${encodeURIComponent(branch)}` : '';
return getBaseUrl() + '/dashboard?id=' + encodeURIComponent(componentKey) + branchQuery;
}
-export function getComponentBackgroundTaskUrl(componentKey: string): string {
- return getBaseUrl() + '/project/background_tasks?id=' + encodeURIComponent(componentKey);
-}
-
export function getProjectUrl(key: string, branch?: string): Location {
return { pathname: '/dashboard', query: { id: key, branch } };
}
+export function getComponentBackgroundTaskUrl(componentKey: string): Location {
+ return { pathname: '/project/background_tasks', query: { id: componentKey } };
+}
+
export function getProjectBranchUrl(key: string, branch: Branch): Location {
if (isShortLivingBranch(branch)) {
return {
return getRulesUrl({ ...query, ...baseQuery }, organization);
}
-export function getProjectsUrl(): string {
- return getBaseUrl() + '/projects';
-}
-
export function getMarkdownHelpUrl(): string {
return getBaseUrl() + '/markdown/help';
}