From c80b4686ec46504cf7050c4698d16646f18dc70d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 Jun 2018 17:01:04 +0200 Subject: deleting tasks --- app/client/dashboard/tasklist.component.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/client/dashboard/tasklist.component.js') diff --git a/app/client/dashboard/tasklist.component.js b/app/client/dashboard/tasklist.component.js index b14202f..a365454 100644 --- a/app/client/dashboard/tasklist.component.js +++ b/app/client/dashboard/tasklist.component.js @@ -3,6 +3,8 @@ import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import * as util from '../util' +import actions from '../actions' + class TaskList extends Component { constructor(props){ super() @@ -24,6 +26,9 @@ class TaskList extends Component {
{task.activity} {task.module} {dataset_type}
{dataset_name}
{util.get_age(task.updated_at)}
+
+ this.handleDestroy(task)}>x +
) }) @@ -33,6 +38,12 @@ class TaskList extends Component { ) } + handleDestroy(task) { + const yes = confirm('Are you sure you want to delete this task?') + if (yes) { + actions.task.destroy(task) + } + } } const mapStateToProps = state => ({ -- cgit v1.2.3-70-g09d2