aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/background-tasks
diff options
context:
space:
mode:
authorJenkins CI <ci@sonarsource.com>2016-04-21 08:01:09 +0200
committerJenkins CI <ci@sonarsource.com>2016-04-21 08:01:09 +0200
commit91584ca578a35442467d075ec42151b409778503 (patch)
tree3e1ea4ea59a2d4e4d05de51affca73172fe65f78 /server/sonar-web/src/main/js/apps/background-tasks
parent6c65ff90687ebe7d184864b0d665f8a51aecfc7a (diff)
parent9d70ff56e7d45ca6d26ee5725cdea6288585358b (diff)
downloadsonarqube-91584ca578a35442467d075ec42151b409778503.tar.gz
sonarqube-91584ca578a35442467d075ec42151b409778503.zip
Automatic merge from branch-5.5
* origin/branch-5.5: SONAR-7553 use api/ce/activity_status to get number of pending and failing tasks SONAR-7553 WS api/ce/activity_status display background tasks related metrics for UI SONAR-7553 DAO of CE_QUEUE count number of rows by status SONAR-7553 DAO of CE_ACTIVITY count number of tasks still failing SONAR-7187 WS api/ce/activity stop using count(1) on DB table CE_QUEUE SONAR-7553 Create composite DB index CE_ACTIVITY(is_last, status) SONAR-7187 do not usage pagination SONAR-7187 Remove paging from api/ce/activity
Diffstat (limited to 'server/sonar-web/src/main/js/apps/background-tasks')
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js2
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.js34
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/store/actions.js23
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js4
4 files changed, 9 insertions, 54 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js
index 3e2ec7e3510..aa9515725fd 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js
@@ -25,7 +25,6 @@ import Header from './Header';
import StatsContainer from '../containers/StatsContainer';
import SearchContainer from '../containers/SearchContainer';
import TasksContainer from '../containers/TasksContainer';
-import ListFooterContainer from '../containers/ListFooterContainer';
export default class BackgroundTasksApp extends Component {
componentDidMount () {
@@ -69,7 +68,6 @@ export default class BackgroundTasksApp extends Component {
<StatsContainer/>
<SearchContainer/>
<TasksContainer/>
- <ListFooterContainer/>
</div>
);
}
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.js b/server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.js
deleted file mode 100644
index 048068f63f5..00000000000
--- a/server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import { connect } from 'react-redux';
-
-import ListFooter from '../../../components/shared/list-footer';
-
-function mapStateToProps (state) {
- return {
- ready: !state.fetching,
- total: state.total,
- count: state.tasks.length
- };
-}
-
-export default connect(
- mapStateToProps
-)(ListFooter);
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/store/actions.js b/server/sonar-web/src/main/js/apps/background-tasks/store/actions.js
index b3d54560da2..095f659f0ca 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/store/actions.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/store/actions.js
@@ -18,12 +18,10 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import _ from 'underscore';
-import { getTypes, getActivity, cancelAllTasks, cancelTask as cancelTaskAPI } from '../../../api/ce';
+import { getTypes, getActivity, getStatus, cancelAllTasks, cancelTask as cancelTaskAPI } from '../../../api/ce';
import { STATUSES, ALL_TYPES, CURRENTS, DEBOUNCE_DELAY } from '../constants';
-const PAGE_SIZE = 1000;
-
export const INIT = 'INIT';
export const REQUEST_TASKS = 'REQUEST_TASKS';
export const RECEIVE_TASKS = 'RECEIVE_TASKS';
@@ -48,11 +46,10 @@ export function requestTasks (filters) {
};
}
-export function receiveTasks (tasks, total) {
+export function receiveTasks (tasks) {
return {
type: RECEIVE_TASKS,
- tasks,
- total
+ tasks
};
}
@@ -145,8 +142,6 @@ function fetchTasks (filters) {
const { component } = getState();
const parameters = mapFiltersToParameters(filters);
- parameters.ps = PAGE_SIZE;
-
if (component) {
parameters.componentId = component.id;
}
@@ -155,17 +150,15 @@ function fetchTasks (filters) {
return Promise.all([
getActivity(parameters),
- getActivity({ ps: 1, onlyCurrents: true, status: STATUSES.FAILED }),
- getActivity({ ps: 1, status: STATUSES.PENDING })
+ getStatus(parameters.componentId)
]).then(responses => {
- const [activity, failingActivity, pendingActivity] = responses;
+ const [activity, status] = responses;
const tasks = activity.tasks;
- const total = activity.paging.total;
- dispatch(receiveTasks(tasks, total));
+ dispatch(receiveTasks(tasks));
- const pendingCount = pendingActivity.paging.total;
- const failingCount = failingActivity.paging.total;
+ const pendingCount = status.pending;
+ const failingCount = status.failing;
dispatch(receiveStats({ pendingCount, failingCount }));
});
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js b/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
index 82ada158894..5ac2f53ee93 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js
@@ -31,7 +31,6 @@ import { DEFAULT_FILTERS } from '../constants';
export const initialState = {
fetching: false,
tasks: [],
- total: 0,
types: [],
@@ -69,8 +68,7 @@ export default function (state = initialState, action = {}) {
return {
...state,
fetching: false,
- tasks: action.tasks,
- total: action.total
+ tasks: action.tasks
};
case UPDATE_QUERY:
return {