Skip to content

Commit 01e8189

Browse files
authored
Chore: Upgrade versions in package.json (#26)
Removed redundant packages like react-dnd Removed prop-types Change makeDroppable to use flow Remove unused code from makeDroppable Fix new lint issues
1 parent e0eb813 commit 01e8189

8 files changed

Lines changed: 652 additions & 808 deletions

File tree

.stylelintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"rules": {
55
"indentation": 4,
66
"at-rule-no-vendor-prefix": true,
7+
"at-rule-no-unknown": [true, { ignoreAtRules: ["mixin", "include", "extend"] }],
78
"media-feature-name-no-vendor-prefix": true,
89
"property-no-vendor-prefix": true,
910
"selector-no-vendor-prefix": true,

package.json

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,20 @@
7474
"lodash.noop": "^3.0.1",
7575
"lodash.omit": "^4.5.0",
7676
"lodash.uniqueid": "^4.0.1",
77-
"prop-types": "^15.5.10",
78-
"react-dnd": "^2.4.0",
79-
"react-dnd-html5-backend": "^2.4.1",
8077
"react-measure": "^2.0.2",
81-
"react-modal": "^2.0.2",
78+
"react-modal": "^2.2.2",
8279
"react-tether": "^0.5.7",
83-
"react-virtualized": "^9.8.0",
80+
"react-virtualized": "^9.9.0",
8481
"rusha": "^0.8.6",
82+
"webpack-dev-middleware": "^1.11.0",
8583
"whatwg-fetch": "^2.0.3"
8684
},
8785
"devDependencies": {
88-
"autoprefixer": "^7.1.1",
86+
"autoprefixer": "^7.1.2",
8987
"babel-cli": "^6.24.1",
9088
"babel-core": "^6.25.0",
9189
"babel-eslint": "^7.2.3",
92-
"babel-loader": "^7.0.0",
90+
"babel-loader": "^7.1.1",
9391
"babel-plugin-istanbul": "^4.1.4",
9492
"babel-plugin-react-intl": "^2.3.1",
9593
"babel-plugin-rewire": "^1.1.0",
@@ -106,33 +104,33 @@
106104
"babel-preset-react": "^6.24.1",
107105
"babel-template": "^6.25.0",
108106
"babel-types": "^6.25.0",
109-
"chai": "^4.0.2",
110-
"color": "^1.0.3",
107+
"chai": "^4.1.0",
108+
"color": "^2.0.0",
111109
"conventional-changelog": "^1.1.3",
112110
"conventional-changelog-cli": "^1.3.1",
113-
"conventional-changelog-lint": "^1.1.9",
111+
"conventional-changelog-lint": "^2.1.1",
114112
"cpx": "^1.5.0",
115113
"css-loader": "^0.28.4",
116-
"deepmerge": "^1.4.4",
117-
"enzyme": "^2.8.2",
114+
"deepmerge": "^1.5.0",
115+
"enzyme": "^2.9.1",
118116
"eslint": "^3.19.0",
119117
"eslint-config-airbnb": "^15.0.1",
120-
"eslint-config-prettier": "^2.2.0",
121-
"eslint-import-resolver-webpack": "^0.8.1",
118+
"eslint-config-prettier": "^2.3.0",
119+
"eslint-import-resolver-webpack": "^0.8.3",
122120
"eslint-plugin-babel": "^4.1.1",
123121
"eslint-plugin-flowtype": "^2.34.0",
124-
"eslint-plugin-import": "^2.3.0",
122+
"eslint-plugin-import": "^2.7.0",
125123
"eslint-plugin-jsx-a11y": "^5.0.3",
126124
"eslint-plugin-react": "^7.1.0",
127-
"extract-text-webpack-plugin": "^2.1.2",
125+
"extract-text-webpack-plugin": "^3.0.0",
128126
"fetch-mock-forwarder": "^1.0.0",
129-
"flow-bin": "^0.48.0",
130-
"husky": "^0.13.4",
127+
"flow-bin": "^0.50.0",
128+
"husky": "^0.14.3",
131129
"intl": "^1.2.5",
132130
"karma": "^1.7.0",
133131
"karma-chai": "^0.1.0",
134132
"karma-chai-sinon": "^0.1.5",
135-
"karma-chrome-launcher": "^2.1.1",
133+
"karma-chrome-launcher": "^2.2.0",
136134
"karma-coverage": "^1.1.1",
137135
"karma-junit-reporter": "^1.2.0",
138136
"karma-mocha": "^1.3.0",
@@ -141,33 +139,32 @@
141139
"karma-sinon": "^1.0.5",
142140
"karma-sinon-stub-promise": "^1.0.0",
143141
"karma-sourcemap-loader": "^0.3.7",
144-
"karma-webpack": "^2.0.3",
145-
"leche": "^2.1.2",
146-
"lint-staged": "^4.0.0",
142+
"karma-webpack": "^2.0.4",
143+
"leche": "^2.2.1",
144+
"lint-staged": "^4.0.2",
147145
"mocha": "^3.4.2",
148146
"node-sass": "^4.5.3",
149147
"optimize-css-assets-webpack-plugin": "^2.0.0",
150148
"postcss-loader": "^2.0.6",
151-
"prettier": "^1.4.4",
149+
"prettier": "^1.5.3",
152150
"prettier-eslint-cli": "^4.1.1",
153-
"prop-types": "^15.5.10",
154151
"properties-parser": "^0.3.1",
155152
"react": "^15.6.1",
156153
"react-addons-test-utils": "^15.6.0",
157154
"react-dom": "^15.6.1",
158155
"react-intl": "^2.3.0",
159156
"sass-lint": "^1.10.2",
160157
"sass-loader": "^6.0.6",
161-
"sinon": "^2.3.4",
158+
"sinon": "^2.3.8",
162159
"sinon-chai": "^2.11.0",
163160
"sinon-stub-promise": "^4.0.0",
164161
"style-loader": "^0.18.2",
165-
"stylelint": "^7.11.1",
166-
"stylelint-config-standard": "^16.0.0",
167-
"stylelint-order": "^0.5.0",
168-
"webpack": "^2.6.1",
169-
"webpack-bundle-analyzer": "^2.8.2",
170-
"webpack-dev-server": "^2.4.5"
162+
"stylelint": "^8.0.0",
163+
"stylelint-config-standard": "^17.0.0",
164+
"stylelint-order": "^0.6.0",
165+
"webpack": "^3.3.0",
166+
"webpack-bundle-analyzer": "^2.8.3",
167+
"webpack-dev-server": "^2.5.1"
171168
},
172169
"peerDependencies": {
173170
"react": "^15.6.0 || ^16.0.0-alpha",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
2+
* @flow
23
* @file Function to render the date table cell
34
* @author Box
45
*/
56

67
import React from 'react';
78
import getDate from '../../util/date';
89

9-
/* eslint-disable react/prop-types */
10-
export default (getLocalizedMessage) => ({ cellData }) =>
10+
export default (getLocalizedMessage: Function) => ({ cellData }: { cellData: string }) =>
1111
<span>
1212
{getDate(cellData, getLocalizedMessage('buik.date.today'), getLocalizedMessage('buik.date.yesterday'))}
1313
</span>;
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
/**
2+
* @flow
23
* @file Function to render the date table cell
34
* @author Box
45
*/
56

67
import React from 'react';
78
import getSize from '../../util/size';
89

9-
/* eslint-disable react/prop-types */
10-
export default () => ({ cellData }) => <span>{getSize(cellData)}</span>;
10+
export default () => ({ cellData }: { cellData: number }) =>
11+
<span>
12+
{getSize(cellData)}
13+
</span>;

src/components/Droppable/__tests__/makeDroppable-test.js

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('Droppable/makeDroppable', () => {
2424
});
2525

2626
it('should correctly wrap the base component and set props', () => {
27-
const DroppableComponent = makeDroppable()(TestComponent);
27+
const DroppableComponent = makeDroppable({})(TestComponent);
2828
const component = shallow(<DroppableComponent />);
2929

3030
assert.equal(component.find('TestComponent').length, 1);
@@ -34,15 +34,15 @@ describe('Droppable/makeDroppable', () => {
3434
});
3535

3636
it('should correctly set the initial state', () => {
37-
const DroppableComponent = makeDroppable()(TestComponent);
37+
const DroppableComponent = makeDroppable({})(TestComponent);
3838
const component = shallow(<DroppableComponent />);
3939

4040
assert.equal(component.state('canDrop'), false);
4141
assert.equal(component.state('isOver'), false);
4242
});
4343

4444
it('should set isOver to true and default canDrop to true on handleDragEnter', () => {
45-
const DroppableComponent = makeDroppable()(TestComponent);
45+
const DroppableComponent = makeDroppable({})(TestComponent);
4646
const component = shallow(<DroppableComponent />);
4747
const instance = component.instance();
4848

@@ -72,22 +72,19 @@ describe('Droppable/makeDroppable', () => {
7272
assert.equal(component.state('canDrop'), false);
7373
});
7474

75-
it('should pass props, dataTransfer, and dragItem into dropValidator', () => {
76-
const dragData = { hello: 'wasdfas' };
75+
it('should pass props, dataTransfer into dropValidator', () => {
7776
const props = {
7877
className: 'abc'
7978
};
8079
const dataTransfer = {};
8180

8281
const dropDefinition = {
83-
dropValidator: sandbox.mock().withArgs(props, dataTransfer, dragData).once().returns(true)
82+
dropValidator: sandbox.mock().withArgs(props, dataTransfer).once().returns(true)
8483
};
8584
const DroppableComponent = makeDroppable(dropDefinition)(TestComponent);
8685
const component = shallow(<DroppableComponent {...props} />);
8786
const instance = component.instance();
8887

89-
sandbox.mock(instance).expects('getDragItem').returns(dragData).once();
90-
9188
assert.equal(component.state('isOver'), false);
9289
instance.handleDragEnter({
9390
dataTransfer,
@@ -97,22 +94,8 @@ describe('Droppable/makeDroppable', () => {
9794
assert.equal(component.state('canDrop'), true);
9895
});
9996

100-
it('should call onDragEnter during handleDragEnter if passed in through props', () => {
101-
const dropDefinition = {
102-
onDragEnter: sandbox.mock().once()
103-
};
104-
const DroppableComponent = makeDroppable(dropDefinition)(TestComponent);
105-
const component = shallow(<DroppableComponent />);
106-
const instance = component.instance();
107-
108-
instance.handleDragEnter({
109-
dataTransfer: {},
110-
preventDefault: sandbox.mock().once()
111-
});
112-
});
113-
11497
it('should set dropEffect to none on handleDragOver if canDrop is false', () => {
115-
const DroppableComponent = makeDroppable()(TestComponent);
98+
const DroppableComponent = makeDroppable({})(TestComponent);
11699
const component = shallow(<DroppableComponent />);
117100
const instance = component.instance();
118101
const event = {
@@ -129,7 +112,7 @@ describe('Droppable/makeDroppable', () => {
129112
});
130113

131114
it('should set dropEffect on handleDragOver if canDrop is true and dropEffect was defined', () => {
132-
const DroppableComponent = makeDroppable()(TestComponent);
115+
const DroppableComponent = makeDroppable({})(TestComponent);
133116
const component = shallow(<DroppableComponent />);
134117
const instance = component.instance();
135118
const event = {
@@ -148,7 +131,7 @@ describe('Droppable/makeDroppable', () => {
148131
});
149132

150133
it('should prevent default event on handleDragOver', () => {
151-
const DroppableComponent = makeDroppable()(TestComponent);
134+
const DroppableComponent = makeDroppable({})(TestComponent);
152135
const component = shallow(<DroppableComponent />);
153136
const instance = component.instance();
154137

@@ -162,22 +145,8 @@ describe('Droppable/makeDroppable', () => {
162145
});
163146
});
164147

165-
it('should call onDragOver during handleDragOver if passed in through props', () => {
166-
const dropDefinition = {
167-
onDragOver: sandbox.mock().once()
168-
};
169-
const DroppableComponent = makeDroppable(dropDefinition)(TestComponent);
170-
const component = shallow(<DroppableComponent />);
171-
const instance = component.instance();
172-
173-
instance.handleDragOver({
174-
dataTransfer: {},
175-
preventDefault: sandbox.mock().once()
176-
});
177-
});
178-
179148
it('should prevent default event and reset state on handleDrop', () => {
180-
const DroppableComponent = makeDroppable()(TestComponent);
149+
const DroppableComponent = makeDroppable({})(TestComponent);
181150
const component = shallow(<DroppableComponent />);
182151
const instance = component.instance();
183152

@@ -191,7 +160,6 @@ describe('Droppable/makeDroppable', () => {
191160
});
192161

193162
it('should call onDrop if canDrop is true and onDrop is passed in through props', () => {
194-
const data = { hello: 'wasdfas' };
195163
const event = {
196164
preventDefault: sandbox.mock().once()
197165
};
@@ -206,8 +174,6 @@ describe('Droppable/makeDroppable', () => {
206174
canDrop: true
207175
});
208176

209-
sandbox.mock(context.dragDrop).expects('getDragItem').returns(data).once();
210-
211177
instance.handleDrop(event);
212178
clock.tick(10);
213179
});

0 commit comments

Comments
 (0)