]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7187 do not usage pagination
authorStas Vilchik <vilchiks@gmail.com>
Mon, 18 Apr 2016 08:56:59 +0000 (10:56 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 20 Apr 2016 23:23:38 +0000 (01:23 +0200)
server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js
server/sonar-web/src/main/js/apps/background-tasks/containers/ListFooterContainer.js [deleted file]
server/sonar-web/src/main/js/apps/background-tasks/store/actions.js
server/sonar-web/src/main/js/apps/background-tasks/store/reducers.js

index 3e2ec7e35109dc80948be658d2e96f37da2e5fb7..aa9515725fd6d7b4e9f5118f96f2d0361fbe9694 100644 (file)
@@ -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 (file)
index 048068f..0000000
+++ /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);
index b3d54560da2dadc256aa70307e236eb60777754f..0a7ef85b2778cd320aa6be531c10962078cc3166 100644 (file)
@@ -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 }));
     });
index 44cb08af7fd77f06a6ff0a68fc10ec4dc2604020..35dc518845d9ccb8166dbf7e84c93d2ed504809d 100644 (file)
@@ -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 {