@@ -15,13 +15,11 @@ import * as boardActions from '../actions/BoardActions'
1515import * as laneActions from '../actions/LaneActions'
1616
1717class BoardContainer extends Component {
18- //+add 2018.08.23
1918 state = {
2019 addLaneMode : false
2120 }
2221
23- //+end
24- componentWillMount ( ) {
22+ componentDidMount ( ) {
2523 const { actions, eventBusHandle} = this . props
2624 actions . loadBoard ( this . props . data )
2725 if ( eventBusHandle ) {
@@ -48,8 +46,7 @@ class BoardContainer extends Component {
4846
4947 onLaneDrop = ( { removedIndex, addedIndex, payload} ) => {
5048 const { actions, handleLaneDragEnd} = this . props
51- if ( removedIndex !== addedIndex ) { // 2018.08.22
52- // actions.moveLane({oldIndex: removedIndex, newIndex: addedIndex});
49+ if ( removedIndex !== addedIndex ) {
5350 handleLaneDragEnd ( removedIndex , addedIndex , payload )
5451 }
5552 }
@@ -77,12 +74,12 @@ class BoardContainer extends Component {
7774 toLaneId : event . toLaneId ,
7875 cardId : event . cardId ,
7976 index : event . index
80- } ) ;
77+ } )
8178 case 'UPDATE_LANES' :
8279 return actions . updateLanes ( event . lanes )
8380 }
84- } ,
85- } ;
81+ }
82+ }
8683 eventBusHandle ( eventBus )
8784 }
8885
@@ -109,7 +106,7 @@ class BoardContainer extends Component {
109106 } )
110107 return < span > { newCardWithProps } </ span >
111108 } else {
112- return < NewLane onCancel = { this . hideEditableLane } onAdd = { this . addNewLane } />
109+ return < NewLane onCancel = { this . hideEditableLane } onAdd = { this . addNewLane } />
113110 }
114111 }
115112
@@ -142,7 +139,7 @@ class BoardContainer extends Component {
142139 'addCardTitle' ,
143140 'newLaneTemplate' ,
144141 'newCardTemplate'
145- ] ) ;
142+ ] )
146143
147144 return (
148145 < BoardDiv style = { style } { ...otherProps } draggable = { false } >
@@ -153,8 +150,7 @@ class BoardContainer extends Component {
153150 onDrop = { this . onLaneDrop }
154151 lockAxis = "x"
155152 getChildPayload = { index => this . getLaneDetails ( index ) }
156- groupName = { `TrelloBoard${ id } ` }
157- >
153+ groupName = { `TrelloBoard${ id } ` } >
158154 { reducerData . lanes . map ( ( lane , index ) => {
159155 const { id, droppable, ...otherProps } = lane
160156 const laneToRender = (
@@ -167,28 +163,23 @@ class BoardContainer extends Component {
167163 { ...otherProps }
168164 { ...passthroughProps }
169165 />
170- ) ;
171- return draggable && laneDraggable ? (
172- < Draggable key = { lane . id } > { laneToRender } </ Draggable >
173- ) : (
174- < span key = { lane . id } > { laneToRender } </ span >
175- ) ;
166+ )
167+ return draggable && laneDraggable ? < Draggable key = { lane . id } > { laneToRender } </ Draggable > : < span key = { lane . id } > { laneToRender } </ span >
176168 } ) }
177169 </ Container >
178- {
179- canAddLanes &&
180- < Container
181- orientation = "horizontal"
182- >
170+ { canAddLanes && (
171+ < Container orientation = "horizontal" >
183172 { editable && ! addLaneMode ? (
184- < LaneSection style = { { width : 200 } } >
173+ < LaneSection style = { { width : 200 } } >
185174 < NewLaneButton onClick = { this . showEditableLane } > { addLaneTitle } </ NewLaneButton >
186175 </ LaneSection >
187- ) : ( addLaneMode && this . renderNewLane ( ) ) }
176+ ) : (
177+ addLaneMode && this . renderNewLane ( )
178+ ) }
188179 </ Container >
189- }
180+ ) }
190181 </ BoardDiv >
191- ) ;
182+ )
192183 }
193184}
194185
@@ -226,7 +217,7 @@ BoardContainer.propTypes = {
226217 addLaneTitle : PropTypes . string ,
227218 addCardTitle : PropTypes . string ,
228219 newLaneTemplate : PropTypes . node
229- } ;
220+ }
230221
231222BoardContainer . defaultProps = {
232223 onDataChange : ( ) => { } ,
@@ -245,12 +236,15 @@ BoardContainer.defaultProps = {
245236 laneDragClass : 'react_trello_dragLaneClass' ,
246237 addLaneTitle : '+ Add another lane' ,
247238 addCardTitle : 'Add Card'
248- } ;
239+ }
249240
250241const mapStateToProps = state => {
251242 return state . lanes ? { reducerData : state } : { }
252- } ;
243+ }
253244
254245const mapDispatchToProps = dispatch => ( { actions : bindActionCreators ( { ...boardActions , ...laneActions } , dispatch ) } )
255246
256- export default connect ( mapStateToProps , mapDispatchToProps ) ( BoardContainer )
247+ export default connect (
248+ mapStateToProps ,
249+ mapDispatchToProps
250+ ) ( BoardContainer )
0 commit comments