summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-05-10 14:04:34 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-05-10 14:04:34 +0200
commit5b6b6f53a10a533524c08e2a0dcb3340b9f2c4e8 (patch)
tree57ef7ed3ef5002c264bb96a76ad5a34267bc7b40 /server
parent76deac91850be73e2396cd1daeaebc47c569a826 (diff)
downloadsonarqube-5b6b6f53a10a533524c08e2a0dcb3340b9f2c4e8.tar.gz
sonarqube-5b6b6f53a10a533524c08e2a0dcb3340b9f2c4e8.zip
display message that only the first 1000 items are displayed on background tasks page
Diffstat (limited to 'server')
-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/components/Footer.js38
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/containers/BackgroundTasksAppContainer.js6
3 files changed, 44 insertions, 2 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 aa9515725fd..382e5e32983 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
@@ -22,6 +22,7 @@ import React, { Component } from 'react';
import { DATE } from './../constants';
import Header from './Header';
+import Footer from './Footer';
import StatsContainer from '../containers/StatsContainer';
import SearchContainer from '../containers/SearchContainer';
import TasksContainer from '../containers/TasksContainer';
@@ -68,6 +69,7 @@ export default class BackgroundTasksApp extends Component {
<StatsContainer/>
<SearchContainer/>
<TasksContainer/>
+ <Footer tasks={this.props.tasks}/>
</div>
);
}
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Footer.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Footer.js
new file mode 100644
index 00000000000..b9fd65ca96e
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Footer.js
@@ -0,0 +1,38 @@
+/*
+ * 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 React from 'react';
+
+import { translateWithParameters } from '../../../helpers/l10n';
+
+const LIMIT = 1000;
+
+const Footer = ({ tasks }) => {
+ if (tasks.length < LIMIT) {
+ return null;
+ }
+
+ return (
+ <footer className="spacer-top note text-center">
+ {translateWithParameters('max_results_reached', LIMIT)}
+ </footer>
+ );
+};
+
+export default Footer;
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/containers/BackgroundTasksAppContainer.js b/server/sonar-web/src/main/js/apps/background-tasks/containers/BackgroundTasksAppContainer.js
index 553f123ceaa..478c53f2dfc 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/containers/BackgroundTasksAppContainer.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/containers/BackgroundTasksAppContainer.js
@@ -22,8 +22,10 @@ import { connect } from 'react-redux';
import Main from '../components/BackgroundTasksApp';
import { initApp } from '../store/actions';
-function mapStateToProps () {
- return {};
+function mapStateToProps (state) {
+ return {
+ tasks: state.tasks
+ };
}
function mapDispatchToProps (dispatch) {