diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-08-24 11:53:47 +0200 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2017-09-12 11:34:49 +0200 |
commit | 404d315b077c84da3c31b0c0f4dde852d918c8d1 (patch) | |
tree | 176840ffdfb472a469848539dfbb803372c94b93 /server/sonar-web/src/main/js/api | |
parent | 9f5272cac177f024354dd72da2cda2160c5440af (diff) | |
download | sonarqube-404d315b077c84da3c31b0c0f4dde852d918c8d1.tar.gz sonarqube-404d315b077c84da3c31b0c0f4dde852d918c8d1.zip |
SONAR-9736 Build UI for long-living branches (#2390)
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r-- | server/sonar-web/src/main/js/api/branches.ts | 7 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/api/components.ts | 8 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/api/measures.ts | 8 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/api/projectActivity.ts | 1 |
4 files changed, 11 insertions, 13 deletions
diff --git a/server/sonar-web/src/main/js/api/branches.ts b/server/sonar-web/src/main/js/api/branches.ts index 5c597385c85..6435c575aae 100644 --- a/server/sonar-web/src/main/js/api/branches.ts +++ b/server/sonar-web/src/main/js/api/branches.ts @@ -23,10 +23,3 @@ import throwGlobalError from '../app/utils/throwGlobalError'; export function getBranches(project: string): Promise<any> { return getJSON('/api/project_branches/list', { project }).then(r => r.branches, throwGlobalError); } - -export function getBranch(project: string, branch: string): Promise<any> { - return getJSON('/api/project_branches/show', { component: project, branch }).then( - r => r.branch, - throwGlobalError - ); -} diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts index fd46c34d559..361713b815d 100644 --- a/server/sonar-web/src/main/js/api/components.ts +++ b/server/sonar-web/src/main/js/api/components.ts @@ -243,11 +243,11 @@ export function getSources( return getJSON('/api/sources/lines', data).then(r => r.sources); } -export function getDuplications(component: string): Promise<any> { - return getJSON('/api/duplications/show', { key: component }); +export function getDuplications(component: string, branch?: string): Promise<any> { + return getJSON('/api/duplications/show', { key: component, branch }); } -export function getTests(component: string, line: number | string): Promise<any> { - const data = { sourceFileKey: component, sourceFileLineNumber: line }; +export function getTests(component: string, line: number | string, branch?: string): Promise<any> { + const data = { sourceFileKey: component, sourceFileLineNumber: line, branch }; return getJSON('/api/tests/list', data).then(r => r.tests); } diff --git a/server/sonar-web/src/main/js/api/measures.ts b/server/sonar-web/src/main/js/api/measures.ts index 5f6ff93f40f..fd4f5259d2f 100644 --- a/server/sonar-web/src/main/js/api/measures.ts +++ b/server/sonar-web/src/main/js/api/measures.ts @@ -19,9 +19,13 @@ */ import { getJSON, RequestData } from '../helpers/request'; -export function getMeasures(componentKey: string, metrics: string[]): Promise<any> { +export function getMeasures( + componentKey: string, + metrics: string[], + branch?: string +): Promise<any> { const url = '/api/measures/component'; - const data = { componentKey, metricKeys: metrics.join(',') }; + const data = { componentKey, metricKeys: metrics.join(','), branch }; return getJSON(url, data).then(r => r.component.measures); } diff --git a/server/sonar-web/src/main/js/api/projectActivity.ts b/server/sonar-web/src/main/js/api/projectActivity.ts index b2dddd8c890..a01fd36dec3 100644 --- a/server/sonar-web/src/main/js/api/projectActivity.ts +++ b/server/sonar-web/src/main/js/api/projectActivity.ts @@ -30,6 +30,7 @@ interface GetProjectActivityResponse { } export function getProjectActivity(data: { + branch?: string; project: string; category?: string; p?: number; |