diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-05 13:28:55 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-05 13:28:55 +0200 |
| commit | a4f6d0e9afa4993437e3031aaa4771f268ce4d99 (patch) | |
| tree | 1524924ff751f752a8db6341f08b152d9dcb11b6 /app/client/dashboard | |
| parent | ead43de436c7e625a77b0103e70ba0100ad52f8e (diff) | |
app
Diffstat (limited to 'app/client/dashboard')
| -rw-r--r-- | app/client/dashboard/dashboard.component.js | 4 | ||||
| -rw-r--r-- | app/client/dashboard/tasklist.component.js | 61 |
2 files changed, 1 insertions, 64 deletions
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 = <Link to={href}>{dataset}</Link> - } else { - dataset_link = dataset - } - return ( - <div class='row'> - <div class='activity'>{task.activity} {task.module}</div> - <div class='dataset'>{dataset_link}</div> - <div className={"age " + util.carbon_date(task.updated_at)}>{util.get_age(task.updated_at)}</div> - <div class='options'> - <span class='destroy' onClick={() => this.handleDestroy(task)}>x</span> - </div> - </div> - ) - }) - return ( - <div class='tasklist rows'> - {taskList} - </div> - ) - } - 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) |
