-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gt - WIP UncontrolledTable #440
Conversation
gthomas-appfolio
commented
Aug 10, 2018
- Name is temp, maybe combine with Table
src/components/UncontrolledTable.js
Outdated
[...selected, value]; | ||
|
||
this.setState({ selected: newSelection }, | ||
this.props.onSelect(newSelection) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a callback?
src/components/UncontrolledTable.js
Outdated
const { page, sort } = this.state; | ||
const { ascending, column } = sort; | ||
const { columns, expandable, pageSize, paginated, rowClassName, rowExpanded, rows, selectable, onSelect, ...props } = this.props; | ||
const cols = columns.map(col => (col.sortable !== false) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you just do col.sortable
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks odd, but am supporting a "default" of sortable == true, without it actually being set to true. This explicitly checks for false.
src/components/UncontrolledTable.js
Outdated
type="checkbox" | ||
className="mx-1" | ||
checked={this.allSelected} | ||
onChange={() => this.toggleAll()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can just be this.toggleAll
assert.equal(ths.length, columns.length + 1); // For selectable column | ||
}); | ||
|
||
it('should call onSelect when selectable row picked'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something we need to wait for for these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, just getting up to speed with enzyme 3 test changes