-
Notifications
You must be signed in to change notification settings - Fork 981
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
Fixes #37398 - Extend TableIndexPage and TableHooks with new capabilities for All Hosts page #10128
base: develop
Are you sure you want to change the base?
Conversation
ea8b790
to
12f1b7f
Compare
fffa834
to
100fff9
Compare
100fff9
to
ae81195
Compare
Updated package.json with |
Packit will still fail, as 13.1.0 ain't packaged yet, but we'll get there |
with new capabilities for All Hosts page - add the option to use `idColumnName` to `<RowSelectTd>` - Add the option to supply your own pagination component in `<Table>` - Add a `hasInteracted` state to `useBulkSelect` - Add a `pushToHistory` option to `useSetParamsAndAPIAndSearch` to skip changing the browser URL - Add `updateParamsByUrl` to `<TableIndexPage>` for the same reason - Add `restrictedSearchQuery` to `<TableIndexPage>`
ae81195
to
60b7481
Compare
Testing this PR via Katello/katello#10962 showed no technical issues. |
@jeremylenz you dropped the use of |
@evgeni Nope, that use is in the Katello PR. |
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.
Happy with the changes here. Tested it with Katello PR. Works well 👍
2f2a294
to
60b7481
Compare
Re: React on plugins katello/katello failures, see Katello/katello#10962 (comment) |
I plan to wait til after stabilization week to merge this. Will need an ack from @theforeman/packaging then. |
Foreman is now branched. @theforeman/packaging are we good here? |
(that ack is purely packaging, I did not look at the code) |
This adds several features to TableIndexPage and TableHooks, enabling Katello/katello#10962 to work. Ideally the two PRs should be reviewed together.
idColumnName
to<RowSelectTd>
. This is so you can optionally pass in an alternateidColumn
touseBulkSelect
.<Table>
. When using the<TableIndexPage>
without specifying children, it was causing some issues with the bottom pagination not being in sync or making API requests. Allowing the parent to specify the bottomPagination solves this, because you can now guarantee that the top and bottom pagination have the same data.hasInteracted
state touseBulkSelect
. This is so you can delay showing validations (e.g. for forms and wizards ;) until the user has actually interacted with the component. It's bad UX to throw up a validation message such as "You must select at least one X!!" before the user has even gotten a chance to do anything. I had tried adding this to the pagination functions in Katello, but this solution is much more elegant.pushToHistory
option touseSetParamsAndAPIAndSearch
. When you are using an embedded table (e.g. one that should not keep itself in sync with URL params for search and pagination), you need to be able to skip changing the browser URL.updateParamsByUrl
to<TableIndexPage>
for the same reason.restrictedSearchQuery
to<TableIndexPage>
. This allows you to restrict all table rows to ones matching the search you specify here. This restricted search query will not show up visually in the search input, but will be added to the user search in the API request, causing every search to be "within" the restricted search query's results. Usage example: I select 50 hosts and bring up the package install wizard. The package install wizard has the 50 hosts I selected. I am able to search within those and deselect if desired, but I cannot add any hosts to the selection.