aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-02-18 17:15:47 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-02-18 17:22:01 +0100
commit9ab21a8a2994ba43689b402ba6fcf443becae8ef (patch)
treea036c1e2c91b90f758b19c6bdceeeee77b29f902 /server/sonar-web/src/main/js/apps
parent5da5452b322aaa9c6f3fbb313f05e54195c29458 (diff)
downloadsonarqube-9ab21a8a2994ba43689b402ba6fcf443becae8ef.tar.gz
sonarqube-9ab21a8a2994ba43689b402ba6fcf443becae8ef.zip
SONAR-7191 add "Reset" button
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/components/Search.js12
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/containers/SearchContainer.js3
2 files changed, 14 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js
index 74344b23cf4..961d56b3ebd 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.js
@@ -64,6 +64,11 @@ export default React.createClass({
this.props.onRefresh();
},
+ handleReset(e) {
+ e.preventDefault();
+ this.props.onReset();
+ },
+
render() {
return (
<section className="big-spacer-top big-spacer-bottom">
@@ -113,6 +118,13 @@ export default React.createClass({
disabled={this.props.fetching}>
{translate('reload')}
</button>
+ {' '}
+ <button
+ ref="resetButton"
+ onClick={this.handleReset}
+ disabled={this.props.fetching}>
+ {translate('reset_verb')}
+ </button>
</li>
</ul>
</section>
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/containers/SearchContainer.js b/server/sonar-web/src/main/js/apps/background-tasks/containers/SearchContainer.js
index fbf24e4477a..4b21e10ac9f 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/containers/SearchContainer.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/containers/SearchContainer.js
@@ -21,7 +21,7 @@ import { connect } from 'react-redux';
import Search from '../components/Search';
import { filterTasks, search } from '../store/actions';
-import { STATUSES, CURRENTS } from '../constants';
+import { STATUSES, CURRENTS, DEFAULT_FILTERS } from '../constants';
function mapStateToProps (state) {
return {
@@ -47,6 +47,7 @@ function updateStatusQuery (status) {
function mapDispatchToProps (dispatch) {
return {
onRefresh: () => dispatch(filterTasks()),
+ onReset: () => dispatch(filterTasks(DEFAULT_FILTERS)),
onStatusChange: (status) => dispatch(filterTasks(updateStatusQuery(status))),
onTypeChange: (taskType) => dispatch(filterTasks({ taskType })),
onCurrentsChange: (currents) => dispatch(filterTasks({ currents })),