From: Stas Vilchik Date: Fri, 2 Oct 2015 10:19:40 +0000 (+0200) Subject: SONAR-6833 provide "componentId" parameter to api/ce/queue X-Git-Tag: 5.2-RC1~108 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fccefba5bd06d0b7d9635bb8d8b3523351822362;p=sonarqube.git SONAR-6833 provide "componentId" parameter to api/ce/queue --- diff --git a/server/sonar-web/src/main/js/api/ce.js b/server/sonar-web/src/main/js/api/ce.js index f14185b7882..4fcf075acea 100644 --- a/server/sonar-web/src/main/js/api/ce.js +++ b/server/sonar-web/src/main/js/api/ce.js @@ -1,8 +1,8 @@ import $ from 'jquery'; -export function getQueue () { +export function getQueue (data) { let url = baseUrl + '/api/ce/queue'; - return $.get(url); + return $.get(url, data); } export function getActivity (data) { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/main.js b/server/sonar-web/src/main/js/apps/background-tasks/main.js index b9b7ced5138..026f2d7e264 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/main.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/main.js @@ -24,16 +24,6 @@ export default React.createClass({ }; }, - filterQueueForComponent(queue) { - if (this.props.options.componentId) { - return queue.filter(task => { - return task.componentId === this.props.options.componentId; - }); - } else { - return queue; - } - }, - componentDidMount() { this.requestData(); }, @@ -91,9 +81,10 @@ export default React.createClass({ }, requestQueue() { + let filters = this.getComponentFilter(); if (!Object.keys(this.getCurrentFilters()).length) { - getQueue().done(queue => { - let tasks = this.filterQueueForComponent(queue.tasks); + getQueue(filters).done(queue => { + let tasks = queue.tasks; this.setState({ queue: this.orderTasks(tasks), pendingCount: this.countPending(tasks),