Skip to content

Commit 93cea44

Browse files
authored
Cursor on lane header respects draggable (#302)
* no grab cursor if lane not draggable * Update CHANGELOG.md
1 parent 67b4b95 commit 93cea44

File tree

7 files changed

+1005
-318
lines changed

7 files changed

+1005
-318
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased] - 2019-07-22
9+
10+
### Improvements
11+
12+
* Cursor on lane header respects draggable
13+
814
## [2.2.0] - 2019-07-20
915

1016
### Added

src/components/Card.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Card extends Component {
3131
label,
3232
description,
3333
tags,
34+
cardDraggable
3435
} = this.props
3536

3637
return (
@@ -41,7 +42,7 @@ class Card extends Component {
4142
className={className}
4243
>
4344
<CardHeader>
44-
<CardTitle>{title}</CardTitle>
45+
<CardTitle draggable={cardDraggable}>{title}</CardTitle>
4546
<CardRightContent>{label}</CardRightContent>
4647
{showDeleteButton && <DeleteButton onClick={this.onDelete} />}
4748
</CardHeader>

src/components/Lane/LaneHeader.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import {Title, LaneHeader, RightContent } from 'rt/styles/Base'
55
import LaneMenu from './LaneHeader/LaneMenu'
66

77
const LaneHeaderComponent = ({
8-
updateTitle, canAddLanes, onDelete, onDoubleClick, editLaneTitle, label, title, titleStyle, labelStyle, t
8+
updateTitle, canAddLanes, onDelete, onDoubleClick, editLaneTitle, label, title, titleStyle, labelStyle, t, laneDraggable
99
}) => {
1010

1111
return (
1212
<LaneHeader onDoubleClick={onDoubleClick} editLaneTitle={editLaneTitle}>
13-
<Title style={titleStyle}>
13+
<Title draggable={laneDraggable} style={titleStyle}>
1414
{editLaneTitle ?
1515
<InlineInput value={title} border placeholder={t('placeholder.title')} resize='vertical' onSave={updateTitle} /> :
1616
title
@@ -30,6 +30,7 @@ LaneHeaderComponent.propTypes = {
3030
updateTitle: PropTypes.func,
3131
editLaneTitle: PropTypes.bool,
3232
canAddLanes: PropTypes.bool,
33+
laneDraggable: PropTypes.bool,
3334
label: PropTypes.string,
3435
title: PropTypes.string,
3536
onDelete: PropTypes.func,

src/controllers/BoardContainer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class BoardContainer extends Component {
143143
'onLaneClick',
144144
'laneSortFunction',
145145
'draggable',
146+
'laneDraggable',
146147
'cardDraggable',
147148
'collapsibleLanes',
148149
'canAddLanes',

src/controllers/Lane.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ class Lane extends Component {
137137
laneSortFunction,
138138
editable,
139139
hideCardDeleteIcon,
140-
draggable,
141140
cardDraggable,
142141
cardDragClass,
143142
tagStyle,
@@ -161,10 +160,11 @@ class Lane extends Component {
161160
onClick={e => this.handleCardClick(e, card)}
162161
showDeleteButton={!hideCardDeleteIcon}
163162
tagStyle={tagStyle}
163+
cardDraggable={cardDraggable}
164164
{...card}
165165
/>
166166
)
167-
return draggable && cardDraggable && (!card.hasOwnProperty('draggable') || card.draggable) ? (
167+
return cardDraggable && (!card.hasOwnProperty('draggable') || card.draggable) ? (
168168
<Draggable key={card.id}>{cardToRender}</Draggable>
169169
) : (
170170
<span key={card.id}>{cardToRender}</span>
@@ -215,7 +215,8 @@ class Lane extends Component {
215215
'labelStyle',
216216
't',
217217
'editLaneTitle',
218-
'canAddLanes'
218+
'canAddLanes',
219+
'laneDraggable',
219220
])
220221
return (
221222
<components.LaneHeader
@@ -293,6 +294,7 @@ Lane.propTypes = {
293294
onLaneClick: PropTypes.func,
294295
onLaneScroll: PropTypes.func,
295296
editable: PropTypes.bool,
297+
laneDraggable: PropTypes.bool,
296298
cardDraggable: PropTypes.bool,
297299
cardDragClass: PropTypes.string,
298300
canAddLanes: PropTypes.bool,

src/styles/Base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const Title = styled.span`
151151
font-weight: bold;
152152
font-size: 15px;
153153
line-height: 18px;
154-
cursor: grab;
154+
cursor: ${props => (props.draggable ? 'grab' : `auto`)};
155155
width: 70%;
156156
`
157157

0 commit comments

Comments
 (0)