aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 })),