From 5d39f806d01894e03454075d37068185fdd0af4b Mon Sep 17 00:00:00 2001 From: Rene Dohmen Date: Tue, 20 Dec 2016 12:46:51 +0100 Subject: [PATCH] Fixed edit and renamed Notes to Tasks, also renamed task title to name to be in sync with the scrumboard models --- static/react/kanban-app/app/components/App.jsx | 12 ++++++------ static/react/kanban-app/app/components/Editable.jsx | 3 ++- static/react/kanban-app/app/components/Tasks.jsx | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/static/react/kanban-app/app/components/App.jsx b/static/react/kanban-app/app/components/App.jsx index ec45e6a..36b8c22 100644 --- a/static/react/kanban-app/app/components/App.jsx +++ b/static/react/kanban-app/app/components/App.jsx @@ -12,15 +12,15 @@ export default class App extends React.Component { tasks: [ { id: uuid.v4(), - task: 'Implement other data structures' + name: 'Implement other data structures' }, { id: uuid.v4(), - task: 'Use test data from other sources' + name: 'Use test data from other sources' }, { id: uuid.v4(), - task: 'Finish the kanban implementation' + name: 'Finish the kanban implementation' } ] }; @@ -47,7 +47,7 @@ export default class App extends React.Component { this.setState({ tasks: this.state.tasks.concat([{ id: uuid.v4(), - task: 'New task' + name: 'New task' }]) }); } @@ -72,12 +72,12 @@ export default class App extends React.Component { }); } - editTask = (id, task) => { + editTask = (id, name) => { this.setState({ tasks: this.state.tasks.map(task => { if(task.id === id) { task.editing = false; - task.task = task; + task.name = name; } return task; }) diff --git a/static/react/kanban-app/app/components/Editable.jsx b/static/react/kanban-app/app/components/Editable.jsx index 345ec97..b8147c8 100644 --- a/static/react/kanban-app/app/components/Editable.jsx +++ b/static/react/kanban-app/app/components/Editable.jsx @@ -9,7 +9,8 @@ export default ({editing, value, onEdit, ...props}) => { class Edit extends React.Component { render() { - const {value, ...props} = this.props; + //const {value, ...props} = this.props; + const {className, value, onEdit, ...props} = this.props; return {}, onEdit=() => {}, onDelete=() => {} }) => ( -