Skip to content

Commit 00f75da

Browse files
committed
RC1
1 parent c8ac984 commit 00f75da

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/components/BoardContainer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class BoardContainer extends Component {
9696
addNewLane = params => {
9797
this.hideEditableLane()
9898
this.props.actions.addLane(params)
99+
this.props.onLaneAdd(params)
99100
}
100101

101102
renderNewLane = () => {
@@ -117,7 +118,7 @@ class BoardContainer extends Component {
117118
}
118119

119120
render() {
120-
const {id, reducerData, draggable, laneDraggable, laneDragClass, style, onDataChange, onLaneScroll, onCardClick, onLaneClick, onCardDelete, onCardAdd, addLaneTitle, editable, canAddLanes, ...otherProps} = this.props
121+
const {id, reducerData, draggable, laneDraggable, laneDragClass, style, onDataChange, onLaneScroll, onCardClick, onLaneClick, onLaneAdd, onCardDelete, onCardAdd, addLaneTitle, editable, canAddLanes, ...otherProps} = this.props
121122
const {addLaneMode} = this.state
122123
// Stick to whitelisting attributes to segregate board and lane props
123124
const passthroughProps = pick(this.props, [
@@ -203,6 +204,7 @@ BoardContainer.propTypes = {
203204
onCardDelete: PropTypes.func,
204205
onCardAdd: PropTypes.func,
205206
addCardLink: PropTypes.node,
207+
onLaneAdd: PropTypes.func,
206208
onLaneClick: PropTypes.func,
207209
laneSortFunction: PropTypes.func,
208210
draggable: PropTypes.bool,
@@ -233,6 +235,7 @@ BoardContainer.defaultProps = {
233235
handleDragEnd: () => {},
234236
handleLaneDragStart: () => {},
235237
handleLaneDragEnd: () => {},
238+
onLaneAdd: () => {},
236239
editable: false,
237240
canAddLanes: false,
238241
hideCardDeleteIcon: false,

stories/EditableBoard.story.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,21 @@ storiesOf('Editable Board', module)
7979
.add(
8080
'New Card Template',
8181
() => {
82-
return <Board data={data} editable newCardTemplate={<NewCard />} addCardTitle='Click to add'/>
82+
return <Board data={data} editable newCardTemplate={<NewCard />} addCardTitle="Click to add" />
8383
},
8484
{info: 'Pass a custom new card template to add card'}
8585
)
8686
.add(
8787
'Add New Lane',
8888
() => {
89-
return <Board data={smallData} editable canAddLanes />
89+
return (
90+
<Board
91+
data={smallData}
92+
editable
93+
canAddLanes
94+
onLaneAdd={t => console.log('You added a line with title ' + t.title)}
95+
/>
96+
)
9097
},
9198
{info: 'Allow adding new lane'}
9299
)

0 commit comments

Comments
 (0)