Skip to content
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

Replace lib-ui useSelectionState with a batteries implementation, fix related quirks, handle shift+click multiselect and bulk selection #3

Merged
merged 29 commits into from
Nov 21, 2023

Conversation

mturley
Copy link
Collaborator

@mturley mturley commented Nov 17, 2023

Addresses some tech debt that has been bugging me for a while. The selection feature is now fully integrated alongside the other features and no longer depends on the migtools lib-ui useSelectionState (which will be retired). The selection feature handles the behavior it used to plus non-selectable items, shift+click to select multiple items, and logic related to bulk select (specifically around the differences between client and server tables -- we can't "select all" on a server-driven table because we don't know all the item ids).

Also implements the Selection feature example in docs in order to test drive these changes.

One thing to note here is that I've also renamed all of the get*DerivedState functions to use*DerivedState since we needed to call a useMemo in useSelectionDerivedState which means it needed hook naming. The other derived state hooks aren't calling any hooks currently, but consistent naming made sense to me and now we can introduce future memoization or whatever other hook usage in them as necessary without renaming stuff.

Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
… - isn't going to work because we don't always call the derived state hooks (only on client for pagination, for example)

Signed-off-by: Mike Turley <[email protected]>
…pHelpers - isn't going to work because we don't always call the derived state hooks (only on client for pagination, for example)"

This reverts commit c2f84e3.
Signed-off-by: Mike Turley <[email protected]>
Signed-off-by: Mike Turley <[email protected]>
@mturley mturley merged commit e67b6fe into patternfly-labs:main Nov 21, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants