aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-12-27 14:08:38 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-12-30 17:54:11 +0100
commitd431d6e9616e0133328fdc7592fad097966cee97 (patch)
treec446613f5d2c8e5d96e063edabe72defbac05400 /server/sonar-web/src/main/js/api
parentf67846d313da30b423e32cfbea90f8f71950aa0a (diff)
downloadsonarqube-d431d6e9616e0133328fdc7592fad097966cee97.tar.gz
sonarqube-d431d6e9616e0133328fdc7592fad097966cee97.zip
SONAR-8562 Rewrite issues bulk change
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r--server/sonar-web/src/main/js/api/issues.js28
1 files changed, 23 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/api/issues.js b/server/sonar-web/src/main/js/api/issues.js
index 5ac907806fb..a2592a4af6f 100644
--- a/server/sonar-web/src/main/js/api/issues.js
+++ b/server/sonar-web/src/main/js/api/issues.js
@@ -18,17 +18,20 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
// @flow
-import { getJSON } from '../helpers/request';
+import { getJSON, post } from '../helpers/request';
+
+export const searchIssues = (query: {}) => (
+ getJSON('/api/issues/search', query)
+);
export function getFacets (query: {}, facets: Array<string>): Promise<*> {
- const url = '/api/issues/search';
const data = {
...query,
facets: facets.join(),
ps: 1,
additionalFields: '_all'
};
- return getJSON(url, data).then(r => {
+ return searchIssues(data).then(r => {
return { facets: r.facets, response: r };
});
}
@@ -62,9 +65,24 @@ export function getAssignees (query: {}): Promise<*> {
}
export function getIssuesCount (query: {}): Promise<*> {
- const url = '/api/issues/search';
const data = { ...query, ps: 1, facetMode: 'effort' };
- return getJSON(url, data).then(r => {
+ return searchIssues(data).then(r => {
return { issues: r.total, debt: r.debtTotal };
});
}
+
+export const searchIssueTags = (ps: number = 500) => (
+ getJSON('/api/issues/tags', { ps })
+);
+
+export function getIssueFilters () {
+ const url = '/api/issue_filters/search';
+ return getJSON(url).then(r => r.issueFilters);
+}
+
+export const bulkChangeIssues = (issueKeys: Array<string>, query: {}) => (
+ post('/api/issues/bulk_change', {
+ issues: issueKeys.join(),
+ ...query
+ })
+);