this.props.onRefresh();
},
+ handleReset(e) {
+ e.preventDefault();
+ this.props.onReset();
+ },
+
render() {
return (
<section className="big-spacer-top big-spacer-bottom">
disabled={this.props.fetching}>
{translate('reload')}
</button>
+ {' '}
+ <button
+ ref="resetButton"
+ onClick={this.handleReset}
+ disabled={this.props.fetching}>
+ {translate('reset_verb')}
+ </button>
</li>
</ul>
</section>
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 {
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 })),