aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api/components.ts
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-12-06 11:01:55 +0100
committerSonarTech <sonartech@sonarsource.com>2018-12-11 20:20:58 +0100
commit0a3fef5c6baba580a558b996bd23b435dfc9e4aa (patch)
treebb77180eee99ccb74dab24fac7a07a2e1a801ac3 /server/sonar-web/src/main/js/api/components.ts
parent18e3109273c9b26709c76effaeaa98449e5f5cac (diff)
downloadsonarqube-0a3fef5c6baba580a558b996bd23b435dfc9e4aa.tar.gz
sonarqube-0a3fef5c6baba580a558b996bd23b435dfc9e4aa.zip
replace deprecated componentKey in web api calls
Diffstat (limited to 'server/sonar-web/src/main/js/api/components.ts')
-rw-r--r--server/sonar-web/src/main/js/api/components.ts18
1 files changed, 7 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts
index c2706de28ef..6b9ab423821 100644
--- a/server/sonar-web/src/main/js/api/components.ts
+++ b/server/sonar-web/src/main/js/api/components.ts
@@ -89,7 +89,7 @@ export function setProjectTags(data: { project: string; tags: string }): Promise
export function getComponentTree(
strategy: string,
- componentKey: string,
+ component: string,
metrics: string[] = [],
additional: RequestData = {}
): Promise<{
@@ -98,32 +98,28 @@ export function getComponentTree(
paging: T.Paging;
}> {
const url = '/api/measures/component_tree';
- const data = Object.assign({}, additional, {
- baseComponentKey: componentKey,
- metricKeys: metrics.join(','),
- strategy
- });
+ const data = { ...additional, component, metricKeys: metrics.join(','), strategy };
return getJSON(url, data).catch(throwGlobalError);
}
export function getChildren(
- componentKey: string,
+ component: string,
metrics: string[] = [],
additional: RequestData = {}
) {
- return getComponentTree('children', componentKey, metrics, additional);
+ return getComponentTree('children', component, metrics, additional);
}
export function getComponentLeaves(
- componentKey: string,
+ component: string,
metrics: string[] = [],
additional: RequestData = {}
) {
- return getComponentTree('leaves', componentKey, metrics, additional);
+ return getComponentTree('leaves', component, metrics, additional);
}
export function getComponent(
- data: { componentKey: string; metricKeys: string } & T.BranchParameters
+ data: { component: string; metricKeys: string } & T.BranchParameters
): Promise<any> {
return getJSON('/api/measures/component', data).then(r => r.component, throwGlobalError);
}