summaryrefslogtreecommitdiff
path: root/client/components/Tasks/Tasks.jsx
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-07 21:18:33 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-07 21:18:33 +0200
commitf8b61281be84a6e4e7a44be5109e688a7c56c671 (patch)
tree43797c6b6cfa5c0f89c020f8c89e0da10f791a55 /client/components/Tasks/Tasks.jsx
parent3d3a7b80d34c100846c8ae130b424b63ba3c0784 (diff)
refactor files so list updates while processing
Diffstat (limited to 'client/components/Tasks/Tasks.jsx')
-rw-r--r--client/components/Tasks/Tasks.jsx27
1 files changed, 2 insertions, 25 deletions
diff --git a/client/components/Tasks/Tasks.jsx b/client/components/Tasks/Tasks.jsx
index 263e669..79ee0a1 100644
--- a/client/components/Tasks/Tasks.jsx
+++ b/client/components/Tasks/Tasks.jsx
@@ -2,31 +2,10 @@ import { h, Component } from 'preact'
import { Link } from 'react-router-dom'
import TaskForm from '../../containers/taskForm.js'
-
-import client from '../../client.js'
+import TaskList from '../../containers/taskList.js'
export default class Tasks extends Component {
- constructor(props) {
- super()
- this.state = {
- adding: false,
- tasks: [],
- }
- client.task.index().then( tasks => this.setState({ tasks }) )
- }
render() {
-// <span class='name'>{task.result_file.name}</span>
- const tasks = (this.state.tasks || []).map( (task, i) => {
- return (
- <div key={i} onClick={() => this.toggle(task)}>
- <span>{task.id}</span>
- <span>{task.created_at}</span>
- <span class='name'>{task.content_file.name}</span>
- <span class='name'>{task.style_file.name}</span>
- <span>{task.alpha}</span>
- </div>
- )
- })
return (
<div class='column'>
<div class='window'>
@@ -39,9 +18,7 @@ export default class Tasks extends Component {
<div class='heading'>
<b>recent tasks</b>
</div>
- <div class='list'>
- {tasks}
- </div>
+ <TaskList />
</div>
</div>
)