Skip to content

Commit 2e64045

Browse files
committed
Remove all support for deprecated node.title
1 parent 4f8dd68 commit 2e64045

File tree

4 files changed

+11
-28
lines changed

4 files changed

+11
-28
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## v0.5.0
4+
5+
### Breaking Changes
6+
7+
* [#20]: Remove deprecated `title` property in `nodes` (use `label` instead)
8+
39
## [v0.4.2](https://github.com/jakezatecky/react-checkbox-tree/compare/v0.4.1...v0.4.2) (2016-02-27)
410

511
### Bug Fixes

src/js/CheckboxTree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class CheckboxTree extends React.Component {
141141
key={key}
142142
checked={checked}
143143
expanded={node.expanded}
144-
label={node.label || node.title}
144+
label={node.label}
145145
optimisticToggle={this.props.optimisticToggle}
146146
rawChildren={node.children}
147147
treeId={this.id}

src/js/nodeShape.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,12 @@ const nodeShape = {
88
label: React.PropTypes.string.isRequired,
99
};
1010

11-
const legacyShape = {
12-
value: React.PropTypes.oneOfType([
13-
React.PropTypes.string,
14-
React.PropTypes.number,
15-
]).isRequired,
16-
title: React.PropTypes.string.isRequired,
17-
};
18-
1911
const nodeShapeWithChildren = React.PropTypes.oneOfType([
2012
React.PropTypes.shape(nodeShape),
21-
React.PropTypes.shape(legacyShape),
2213
React.PropTypes.shape({
2314
...nodeShape,
2415
children: React.PropTypes.arrayOf(nodeShape).isRequired,
2516
}),
26-
React.PropTypes.shape({
27-
...legacyShape,
28-
children: React.PropTypes.arrayOf(nodeShape).isRequired,
29-
}),
3017
]);
3118

3219
export default nodeShapeWithChildren;

test/CheckboxTree.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,10 @@ describe('<CheckboxTree />', () => {
3333
assert.equal('Jupiter', wrapper.find(TreeNode).prop('label'));
3434
});
3535

36-
it('should render the node\'s legacy label', () => {
37-
const wrapper = shallow(
38-
<CheckboxTree
39-
nodes={[{ value: 'jupiter', title: 'Jupiter' }]}
40-
/>,
41-
);
42-
43-
assert.equal('Jupiter', wrapper.find(TreeNode).prop('label'));
44-
});
45-
4636
it('should render the node\'s value', () => {
4737
const wrapper = shallow(
4838
<CheckboxTree
49-
nodes={[{ value: 'jupiter', title: 'Jupiter' }]}
39+
nodes={[{ value: 'jupiter', label: 'Jupiter' }]}
5040
/>,
5141
);
5242

@@ -57,8 +47,8 @@ describe('<CheckboxTree />', () => {
5747
const wrapper = shallow(
5848
<CheckboxTree
5949
nodes={[
60-
{ value: 'jupiter', title: 'Jupiter' },
61-
{ value: 'saturn', title: 'Saturn' },
50+
{ value: 'jupiter', label: 'Jupiter' },
51+
{ value: 'saturn', label: 'Saturn' },
6252
]}
6353
/>,
6454
);
@@ -73,7 +63,7 @@ describe('<CheckboxTree />', () => {
7363
nodes={[
7464
{
7565
value: 'jupiter',
76-
title: 'Jupiter',
66+
label: 'Jupiter',
7767
children: [
7868
{ value: 'europa', label: 'Europa' },
7969
],

0 commit comments

Comments
 (0)