Skip to content

Commit

Permalink
fix(react-grid): get rid of console error during column dragging (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsobolev authored Dec 12, 2017
1 parent a5ef447 commit c508953
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 44 deletions.
6 changes: 2 additions & 4 deletions packages/dx-react-grid-bootstrap3/src/templates/drag-drop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';

export const Container = ({
clientOffset, columns, columnTemplate,
style, className, children, ...restProps
clientOffset, style, className, children,
...restProps
}) => (
<ul
className={classNames('list-group', className)}
Expand All @@ -29,8 +29,6 @@ Container.propTypes = {
x: PropTypes.number.isRequired,
y: PropTypes.number.isRequired,
}).isRequired,
columns: PropTypes.array.isRequired,
columnTemplate: PropTypes.func.isRequired,
style: PropTypes.object,
className: PropTypes.string,
children: PropTypes.oneOfType([
Expand Down
16 changes: 0 additions & 16 deletions packages/dx-react-grid-bootstrap3/src/templates/drag-drop.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ describe('Container', () => {
const tree = shallow((
<Container
clientOffset={{ x: 10, y: 20 }}
columns={[{
name: 'Test',
}]}
columnTemplate={() => <div />}
/>
));

Expand All @@ -24,11 +20,7 @@ describe('Container', () => {
it('should apply custom styles', () => {
const tree = shallow((
<Container
columns={[{
name: 'Test',
}]}
clientOffset={{ x: 10, y: 20 }}
columnTemplate={() => <div />}
style={{ color: 'red' }}
/>
));
Expand All @@ -43,11 +35,7 @@ describe('Container', () => {
it('should pass the className prop to the root element', () => {
const tree = shallow((
<Container
columns={[{
name: 'Test',
}]}
clientOffset={{ x: 10, y: 20 }}
columnTemplate={() => <div />}
className="custom-class"
/>
));
Expand All @@ -61,11 +49,7 @@ describe('Container', () => {
it('should pass rest props to the root element', () => {
const tree = shallow((
<Container
columns={[{
name: 'Test',
}]}
clientOffset={{ x: 10, y: 20 }}
columnTemplate={() => <div />}
data={{ a: 1 }}
/>
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const styles = theme => ({
});

const ContainerBase = ({
clientOffset, columns, columnTemplate, classes,
style, className, children, ...restProps
clientOffset, classes, style, className, children,
...restProps
}) => (
<Paper
className={classNames(classes.container, className)}
Expand All @@ -47,8 +47,6 @@ ContainerBase.propTypes = {
PropTypes.node,
PropTypes.arrayOf(PropTypes.node),
]),
columns: PropTypes.array.isRequired,
columnTemplate: PropTypes.func.isRequired,
classes: PropTypes.object.isRequired,
style: PropTypes.object,
className: PropTypes.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,15 @@ describe('DragDrop', () => {
shallow = createShallow({ dive: true });
classes = getClasses((
<Container
columns={[{
name: 'Test',
}]}
clientOffset={{ x: 10, y: 20 }}
columnTemplate={() => <div />}
/>
));
});

it('should have correct styles', () => {
const tree = shallow((
<Container
columns={[{
name: 'Test',
}]}
clientOffset={{ x: 10, y: 20 }}
columnTemplate={() => <div />}
/>
));

Expand All @@ -38,11 +30,7 @@ describe('DragDrop', () => {
it('should apply custom styles', () => {
const tree = shallow((
<Container
columns={[{
name: 'Test',
}]}
clientOffset={{ x: 10, y: 20 }}
columnTemplate={() => <div />}
style={{ color: 'red' }}
/>
));
Expand All @@ -57,11 +45,7 @@ describe('DragDrop', () => {
it('should pass the className prop to the root element', () => {
const tree = shallow((
<Container
columns={[{
name: 'Test',
}]}
clientOffset={{ x: 10, y: 20 }}
columnTemplate={() => <div />}
className="custom-class"
/>
));
Expand All @@ -75,11 +59,7 @@ describe('DragDrop', () => {
it('should pass rest props to the root element', () => {
const tree = shallow((
<Container
columns={[{
name: 'Test',
}]}
clientOffset={{ x: 10, y: 20 }}
columnTemplate={() => <div />}
data={{ a: 1 }}
/>
));
Expand Down

0 comments on commit c508953

Please sign in to comment.