Skip to content

Commit e5f32bf

Browse files
authored
Merge pull request #429 from ashleydavis/master
Fix for #375 so that the id for a new lane is passed to onLaneAdd.
2 parents d88f792 + 8e2ac68 commit e5f32bf

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/components/NewLaneForm.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ import PropTypes from 'prop-types'
33
import { LaneTitle, NewLaneButtons, Section } from 'rt/styles/Base'
44
import { AddButton, CancelButton } from 'rt/styles/Elements'
55
import NewLaneTitleEditor from 'rt/widgets/NewLaneTitleEditor'
6+
import uuidv1 from 'uuid/v1'
67

78
class NewLane extends Component {
89
handleSubmit = () => {
9-
this.props.onAdd({ title: this.getValue() })
10+
this.props.onAdd({
11+
id: uuidv1(),
12+
title: this.getValue()
13+
})
1014
}
1115

1216
getValue = () => this.refInput.getValue()

src/helpers/LaneHelper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import update from 'immutability-helper'
2-
import uuidv1 from 'uuid/v1'
32

43
const LaneHelper = {
54
initialiseLanes: (state, {lanes}) => {
@@ -42,7 +41,7 @@ const LaneHelper = {
4241
},
4342

4443
addLane: (state, lane) => {
45-
const newLane = {id: uuidv1(), cards: [], ...lane}
44+
const newLane = {cards: [], ...lane}
4645
return update(state, {lanes: {$push: [newLane]}})
4746
},
4847

0 commit comments

Comments
 (0)