@@ -6,14 +6,25 @@ import isEqual from 'lodash/isEqual'
66import Container from '../dnd/Container'
77import Draggable from '../dnd/Draggable'
88import uuidv1 from 'uuid/v1'
9+ import Popover from '@terebentina/react-popover'
910
1011import Loader from './Loader'
1112import Card from './Card'
1213import NewCard from './NewCard'
1314import { AddCardLink , LaneFooter , LaneHeader , RightContent , ScrollableLane , Section , Title } from '../styles/Base'
1415
1516import * as laneActions from '../actions/LaneActions'
16- import { CollapseBtn , ExpandBtn } from '../styles/Elements'
17+ import {
18+ CollapseBtn ,
19+ DeleteWrapper ,
20+ ExpandBtn ,
21+ GenDelButton ,
22+ LaneMenuContent ,
23+ LaneMenuHeader ,
24+ LaneMenuItem ,
25+ LaneMenuTitle ,
26+ MenuButton
27+ } from '../styles/Elements'
1728
1829class Lane extends Component {
1930 state = {
@@ -195,8 +206,29 @@ class Lane extends Component {
195206 )
196207 }
197208
209+ removeLane = ( ) => {
210+ const { id} = this . props
211+ this . props . actions . removeLane ( { laneId : id } )
212+ }
213+
214+ laneMenu = ( ) => {
215+ return (
216+ < Popover className = "menu" position = "bottom" trigger = { < MenuButton > ⋮</ MenuButton > } >
217+ < LaneMenuHeader >
218+ < LaneMenuTitle > Lane actions</ LaneMenuTitle >
219+ < DeleteWrapper >
220+ < GenDelButton > ✖</ GenDelButton >
221+ </ DeleteWrapper >
222+ </ LaneMenuHeader >
223+ < LaneMenuContent >
224+ < LaneMenuItem onClick = { this . removeLane } > Delete Lane...</ LaneMenuItem >
225+ </ LaneMenuContent >
226+ </ Popover >
227+ )
228+ }
229+
198230 renderHeader = ( ) => {
199- const { customLaneHeader} = this . props
231+ const { customLaneHeader, canAddLanes } = this . props
200232 if ( customLaneHeader ) {
201233 const customLaneElement = React . cloneElement ( customLaneHeader , { ...this . props } )
202234 return < span > { customLaneElement } </ span >
@@ -210,6 +242,7 @@ class Lane extends Component {
210242 < span style = { labelStyle } > { label } </ span >
211243 </ RightContent >
212244 ) }
245+ { canAddLanes && this . laneMenu ( ) }
213246 </ LaneHeader >
214247 )
215248 }
@@ -272,7 +305,8 @@ Lane.propTypes = {
272305 addCardTitle : PropTypes . string ,
273306 editable : PropTypes . bool ,
274307 cardDraggable : PropTypes . bool ,
275- cardDragClass : PropTypes . string
308+ cardDragClass : PropTypes . string ,
309+ canAddLanes : PropTypes . bool
276310}
277311
278312Lane . defaultProps = {
0 commit comments