@@ -68,7 +68,8 @@ class Lane extends Component {
68
68
}
69
69
}
70
70
71
- removeCard = ( cardId ) => {
71
+ removeCard = cardId => {
72
+ this . props . onCardDelete && this . props . onCardDelete ( cardId , this . props . id )
72
73
this . props . actions . removeCard ( { laneId : this . props . id , cardId : cardId } )
73
74
}
74
75
@@ -143,7 +144,7 @@ class Lane extends Component {
143
144
cardStyle,
144
145
components,
145
146
t
146
- } = this . props
147
+ } = this . props
147
148
const { addCardMode, collapsed} = this . state
148
149
149
150
const showableCards = collapsed ? [ ] : cards
@@ -155,15 +156,15 @@ class Lane extends Component {
155
156
key = { card . id }
156
157
index = { idx }
157
158
style = { card . style || cardStyle }
158
- className = ' react-trello-card'
159
+ className = " react-trello-card"
159
160
onDelete = { onDeleteCard }
160
161
onClick = { e => this . handleCardClick ( e , card ) }
161
162
showDeleteButton = { ! hideCardDeleteIcon }
162
163
tagStyle = { tagStyle }
163
164
{ ...card }
164
165
/>
165
166
)
166
- return draggable && cardDraggable && ( ! card . hasOwnProperty ( 'draggable' ) || card . draggable ) ? (
167
+ return draggable && cardDraggable && ( ! card . hasOwnProperty ( 'draggable' ) || card . draggable ) ? (
167
168
< Draggable key = { card . id } > { cardToRender } </ Draggable >
168
169
) : (
169
170
< span key = { card . id } > { cardToRender } </ span >
@@ -185,7 +186,9 @@ class Lane extends Component {
185
186
{ cardList }
186
187
</ Container >
187
188
{ editable && ! addCardMode && < components . AddCardLink onClick = { this . showEditableCard } t = { t } /> }
188
- { addCardMode && < components . NewCardForm onCancel = { this . hideEditableCard } t = { t } laneId = { id } onAdd = { this . addNewCard } /> }
189
+ { addCardMode && (
190
+ < components . NewCardForm onCancel = { this . hideEditableCard } t = { t } laneId = { id } onAdd = { this . addNewCard } />
191
+ ) }
189
192
</ components . ScrollableLane >
190
193
)
191
194
}
@@ -194,21 +197,33 @@ class Lane extends Component {
194
197
const { id} = this . props
195
198
this . props . actions . removeLane ( { laneId : id } )
196
199
this . props . onLaneDelete ( id )
197
- }
200
+ }
198
201
199
- updateTitle = ( value ) => {
202
+ updateTitle = value => {
200
203
this . props . actions . updateLane ( { id : this . props . id , title : value } )
201
- this . props . onLaneUpdate ( this . props . id , { title : value } )
204
+ this . props . onLaneUpdate ( this . props . id , { title : value } )
202
205
}
203
206
204
207
renderHeader = ( ) => {
205
- const { components } = this . props
206
- const pickedProps = pick (
207
- this . props ,
208
- [ 'id' , 'label' , 'title' , 'titleStyle' , 'cards' , 'labelStyle' , 't' , 'editLaneTitle' , 'canAddLanes' ]
209
- )
208
+ const { components} = this . props
209
+ const pickedProps = pick ( this . props , [
210
+ 'id' ,
211
+ 'label' ,
212
+ 'title' ,
213
+ 'titleStyle' ,
214
+ 'cards' ,
215
+ 'labelStyle' ,
216
+ 't' ,
217
+ 'editLaneTitle' ,
218
+ 'canAddLanes'
219
+ ] )
210
220
return (
211
- < components . LaneHeader { ...pickedProps } onDelete = { this . removeLane } onDoubleClick = { this . toggleLaneCollapsed } updateTitle = { this . updateTitle } />
221
+ < components . LaneHeader
222
+ { ...pickedProps }
223
+ onDelete = { this . removeLane }
224
+ onDoubleClick = { this . toggleLaneCollapsed }
225
+ updateTitle = { this . updateTitle }
226
+ />
212
227
)
213
228
}
214
229
@@ -217,11 +232,7 @@ class Lane extends Component {
217
232
}
218
233
219
234
render ( ) {
220
- const {
221
- loading,
222
- isDraggingOver,
223
- collapsed
224
- } = this . state
235
+ const { loading, isDraggingOver, collapsed} = this . state
225
236
const {
226
237
id,
227
238
cards,
@@ -240,7 +251,12 @@ class Lane extends Component {
240
251
const allClassNames = classNames ( 'react-trello-lane' , this . props . className || '' )
241
252
const showFooter = collapsibleLanes && cards . length > 0
242
253
return (
243
- < components . Section { ...otherProps } key = { id } onClick = { ( ) => onLaneClick && onLaneClick ( id ) } draggable = { false } className = { allClassNames } >
254
+ < components . Section
255
+ { ...otherProps }
256
+ key = { id }
257
+ onClick = { ( ) => onLaneClick && onLaneClick ( id ) }
258
+ draggable = { false }
259
+ className = { allClassNames } >
244
260
{ this . renderHeader ( ) }
245
261
{ this . renderDragContainer ( isDraggingOver ) }
246
262
{ loading && < components . Loader /> }
@@ -290,7 +306,7 @@ Lane.defaultProps = {
290
306
label : undefined ,
291
307
editable : false ,
292
308
onLaneUpdate : ( ) => { } ,
293
- onCardAdd : ( ) => { } ,
309
+ onCardAdd : ( ) => { }
294
310
}
295
311
296
312
const mapDispatchToProps = dispatch => ( {
0 commit comments