Skip to content

Commit

Permalink
Fixed edit and renamed Notes to Tasks, also renamed task title to nam…
Browse files Browse the repository at this point in the history
…e to be in sync with the scrumboard models
  • Loading branch information
acidjunk committed Dec 20, 2016
1 parent 25b61e7 commit 5d39f80
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions static/react/kanban-app/app/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
]
};
Expand All @@ -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'
}])
});
}
Expand All @@ -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;
})
Expand Down
3 changes: 2 additions & 1 deletion static/react/kanban-app/app/components/Editable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <input
type="text"
Expand Down
4 changes: 2 additions & 2 deletions static/react/kanban-app/app/components/Tasks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export default ({
tasks,
onTaskClick=() => {}, onEdit=() => {}, onDelete=() => {}
}) => (
<ul>{tasks.map(({id, editing, task}) =>
<ul>{tasks.map(({id, editing, name}) =>
<li key={id}>
<Task onClick={onTaskClick.bind(null, id)}>
<Editable
editing={editing}
value={task}
value={name}
onEdit={onEdit.bind(null, id)} />
<button onClick={onDelete.bind(null, id)}>x</button>
</Task>
Expand Down

0 comments on commit 5d39f80

Please sign in to comment.