From 7aa03fb03157192edeeb764f3927e51f122f4a7d Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 18 Apr 2016 10:56:59 +0200 Subject: [PATCH] SONAR-7187 do not usage pagination --- .../components/BackgroundTasksApp.js | 2 -- .../containers/ListFooterContainer.js | 34 ------------------- .../js/apps/background-tasks/store/actions.js | 21 +++++------- .../apps/background-tasks/store/reducers.js | 4 +-- 4 files changed, 9 insertions(+), 52 deletions(-) delete mode 100644 server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.js 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 { - ); } 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..0a7ef85b277 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 @@ -48,11 +48,10 @@ export function requestTasks (filters) { }; } -export function receiveTasks (tasks, total) { +export function receiveTasks (tasks) { return { type: RECEIVE_TASKS, - tasks, - total + tasks }; } @@ -145,8 +144,6 @@ function fetchTasks (filters) { const { component } = getState(); const parameters = mapFiltersToParameters(filters); - parameters.ps = PAGE_SIZE; - if (component) { parameters.componentId = component.id; } @@ -154,18 +151,16 @@ function fetchTasks (filters) { dispatch(requestTasks(filters)); return Promise.all([ - getActivity(parameters), - getActivity({ ps: 1, onlyCurrents: true, status: STATUSES.FAILED }), - getActivity({ ps: 1, status: STATUSES.PENDING }) + getActivity(parameters) ]).then(responses => { - const [activity, failingActivity, pendingActivity] = responses; + const [activity] = 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; + // FIXME request real numbers + const pendingCount = 0; + const failingCount = 0; 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 44cb08af7fd..35dc518845d 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 { -- 2.39.5