-
Notifications
You must be signed in to change notification settings - Fork 44
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
Table - Sort by selected #2387
Table - Sort by selected #2387
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
7c91a50
to
516bd22
Compare
9e767c6
to
798eeb4
Compare
… rows (doesn’t make sense, they would not be used) as discussed and agreed with Zack on a call
…d rows (after more testing, they are actually needed)
…r>/<thsort>` and no `@model/@columns`
Co-authored-by: Cristiano Rastelli <cristiano.rastelli@hashicorp.com>
b2bb815
to
0af97b5
Compare
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.
From a purely design side, this is already following the design patterns established previously (8px gap between buttons and text), using the right convention with the arrow up/down for letting the user know it's sortable, colored when selected, etc.
👍 Nicely done
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.
Sorry for the delayed review – it took me a while, but it eventually clicked 😄 .
Couldn't spot anything off in my testing, so I think it's a go. I left a few non-blocking comments
`Hds::Table::Tr` | ||
- Added `@selectableColumnKey` argument which enables sorting by row selection state and specifies the corresponding selection state key. | ||
- Added `@sortBySelectedOrder` argument which determines the state of the sort button in the selected item column. | ||
- Added `@onClickSortBySelected` argument which is the callback for the sort button in the selected item column. | ||
|
||
`Hds::Table::ThSelectable` | ||
- Added `@onClickSortBySelected` argument which is the callback for the sort button in the selected item column. | ||
- Added `@sortBySelectedOrder` argument which determines the state of the sort button in the selected item column. |
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.
thought: some of these are for internal use; I don't think we plan on documenting them all (but I might be wrong) so I suggest we add to the changelog only the arguments we will expose in the component API
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.
That was what I had originally, but @didoo suggested that I document all of the additions to subcomponents as well. Curious to hear his thoughts
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.
In terms of changelog, we all agree the changes should be mentioned.
For the website, personally I would document them anyway (and in case add a note clarifying that it's meant for internal use). That said, I totally get that the Table API documentation is already heavy so if you decide differently I would not oppose (but consider that, at times, we use the component API documentation too, to understand what a certain argument does).
Co-authored-by: Alex <alex-ju@users.noreply.github.com>
📌 Summary
If merged, this PR implements new "sort-by-selected" behavior in the
Hds::Table
component.⚙️ Details
There is a new argument that need to be provided to the component to enable this behavior:
@sortBySelectedItemKey
:string
Flag to enable SBS behavior
Sets which
@model
property is used to store the record's selection stateJira ticket: https://hashicorp.atlassian.net/browse/HDS-3592