From fccefba5bd06d0b7d9635bb8d8b3523351822362 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 2 Oct 2015 12:19:40 +0200 Subject: [PATCH] SONAR-6833 provide "componentId" parameter to api/ce/queue --- server/sonar-web/src/main/js/api/ce.js | 4 ++-- .../src/main/js/apps/background-tasks/main.js | 15 +++------------ 2 files changed, 5 insertions(+), 14 deletions(-) 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), -- 2.39.5