Skip to content

Commit ff144d9

Browse files
committed
[#183 #235] Hide the add card button on specific lanes
1 parent 9837d31 commit ff144d9

4 files changed

Lines changed: 1853 additions & 247 deletions

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ This is the container component that encapsulates the lanes and cards
145145
| lang | string | Language of compiled texts ("en", "ru"). Default is "en" |
146146
| t | function | Translation function. You can specify either one key as a `String`. Look into ./src/locales for keys list |
147147

148-
### Style customisation
148+
### Style customization
149149

150150
| Name | Type | Description |
151151
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
@@ -157,6 +157,18 @@ This is the container component that encapsulates the lanes and cards
157157
| laneDragClass | string | CSS class to be applied to Lane when being dragged |
158158
| components | object | Map of customised components. [List](src/components/index.js) of available. |
159159

160+
161+
### Lane specific props
162+
163+
| Name | Type | Description |
164+
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
165+
| id | string | ID of lane |
166+
| style | object | Pass CSS style props to lane container |
167+
| labelStyle | object | Pass CSS style props of label |
168+
| cardStyle | object | Pass CSS style props for cards in this lane |
169+
| disallowAddingCard | boolean | Disallow adding card button in this lane (default: false) |
170+
171+
160172
Refer to `stories` folder for examples on many more options for customization.
161173

162174
## Editable Board

src/controllers/BoardContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ class BoardContainer extends Component {
140140
'draggable',
141141
'cardDraggable',
142142
'collapsibleLanes',
143-
'editable',
144143
'canAddLanes',
145144
'hideCardDeleteIcon',
146145
'tagStyle',
@@ -176,6 +175,7 @@ class BoardContainer extends Component {
176175
style={laneStyle || lane.style || {}}
177176
labelStyle={lane.labelStyle || {}}
178177
cardStyle={this.props.cardStyle || lane.cardStyle}
178+
editable={editable && !lane.disallowAddingCard}
179179
{...otherProps}
180180
{...passthroughProps}
181181
/>

stories/EditableBoard.story.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import Board from '../src'
77
const data = require('./data/base.json')
88
const smallData = require('./data/data-sort')
99

10+
const disallowAddingCardData = {...data}
11+
disallowAddingCardData.lanes[0].title = 'Disallowed adding card'
12+
disallowAddingCardData.lanes[0].disallowAddingCard = true
13+
1014
storiesOf('Editable Board', module)
1115
.add(
1216
'Add/Delete Cards',
@@ -54,3 +58,15 @@ storiesOf('Editable Board', module)
5458
},
5559
{info: 'Allow adding new lane'}
5660
)
61+
.add(
62+
'Disallow Adding Card for specific Lane',
63+
() => {
64+
return (
65+
<Board
66+
data={disallowAddingCardData}
67+
editable
68+
/>
69+
)
70+
},
71+
{info: 'Can hide the add card button on specific lanes'}
72+
)

0 commit comments

Comments
 (0)