From a4f6d0e9afa4993437e3031aaa4771f268ce4d99 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 5 Sep 2018 13:28:55 +0200 Subject: app --- app/client/dashboard/dashboard.component.js | 4 +- app/client/dashboard/tasklist.component.js | 61 ----------------------------- 2 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 app/client/dashboard/tasklist.component.js (limited to 'app/client/dashboard') diff --git a/app/client/dashboard/dashboard.component.js b/app/client/dashboard/dashboard.component.js index 0c15f99..cbfdd33 100644 --- a/app/client/dashboard/dashboard.component.js +++ b/app/client/dashboard/dashboard.component.js @@ -10,9 +10,7 @@ import Select from '../common/select.component' import Button from '../common/button.component' import DashboardHeader from './dashboardheader.component' -import TaskList from './tasklist.component' -import { Loading, FolderList, FileList } from '../common' -import Gallery from '../common/gallery.component' +import { Loading, FolderList, FileList, TaskList, Gallery } from '../common' import * as dashboardActions from './dashboard.actions' import * as audioPlayerActions from '../common/audioPlayer/audioPlayer.actions' diff --git a/app/client/dashboard/tasklist.component.js b/app/client/dashboard/tasklist.component.js deleted file mode 100644 index 3de6efe..0000000 --- a/app/client/dashboard/tasklist.component.js +++ /dev/null @@ -1,61 +0,0 @@ -import { h, Component } from 'preact' -import { bindActionCreators } from 'redux' -import { connect } from 'react-redux' -import { Link } from 'react-router-dom'; -import util from '../util' - -import actions from '../actions' - -class TaskList extends Component { - constructor(props){ - super() - } - render(){ - const { title, tasks } = this.props - let time = 0 - const { mapFn, sortFn } = util.sort.orderByFn('date desc') - const taskList = tasks.map(mapFn).sort(sortFn).map(pair => { - const task = pair[1] - const { dataset } = task - let dataset_link; - if (task.folder_id) { - const href = '/' + task.module + - '/' + (task.module === 'samplernn' ? 'datasets' : 'sequences') + - '/' + task.folder_id + '/' - dataset_link = {dataset} - } else { - dataset_link = dataset - } - return ( -
-
{task.activity} {task.module}
-
{dataset_link}
-
{util.get_age(task.updated_at)}
-
- this.handleDestroy(task)}>x -
-
- ) - }) - return ( -
- {taskList} -
- ) - } - handleDestroy(task) { - const yes = confirm('Are you sure you want to delete this task?') - if (yes) { - actions.task.destroy(task) - } - } -} - -const mapStateToProps = state => ({ -}) - -const mapDispatchToProps = (dispatch, ownProps) => ({ - // actions: bindActionCreators(liveActions, dispatch) -}) - -export default connect(mapStateToProps, mapDispatchToProps)(TaskList) -- cgit v1.2.3-70-g09d2