-
Notifications
You must be signed in to change notification settings - Fork 1k
Enhance DataTableColumns ordering options #7193
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
Conversation
This is a partial, draft, PR to enhance DataTableColumns to disallow changing the order of selected columns. This PR addresses this issue: grommet#7170 A new attribute, pinOrder, can be specified in an object in the options property. This attribute pins the order of this column in DataTableColumns. This is implemented using the existing pinned property of the List component. Here is a description of requirements provided by Taylor Seamans: 1. Whichever item is effectively the “first” reorderable item should have the up arrow button disabled 2. If an item that isn’t the leftmost is not reorderable, then the items around it should shift while keeping its order fixed 3. This behavior should work for both drag + drop as well as using the arrow keys
…into pin-column-order
2ec6422
to
410e583
Compare
@ganondev
Similar to this test lmk if you need help! Also we decided on a styling but I will do those changes in a separate PR so we don't hold this up. |
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.
Looking really good, just dropped one small comment.
Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
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.
LGTM
src/js/components/DataTableColumns/__tests__/DataTableColumns-test.tsx
Outdated
Show resolved
Hide resolved
…test.tsx Co-authored-by: Taylor Seamans <taylor.seamans@yahoo.com>
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.
LGTM, thank you!
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.
Thank you @ganondev for your contribution!
Clones #7178
This is a partial, draft, PR to enhance DataTableColumns to disallow changing the order of selected columns.
Closes #7170
A new attribute, pinOrder, can be specified in an object in the options property. This attribute pins the order of this column in DataTableColumns.
This is implemented using the existing pinned property of the List component.
Here is a description of requirements provided by Taylor Seamans:
What does this PR do?
Where should the reviewer start?
What testing has been done on this PR?
How should this be manually tested?
Do Jest tests follow these best practices?
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
What are the relevant issues?
Screenshots (if appropriate)
Do the grommet docs need to be updated?
Should this PR be mentioned in the release notes?
Is this change backwards compatible or is it a breaking change?