mirror of
https://github.com/fleetdm/fleet
synced 2026-05-21 16:08:47 +00:00
# Details As mentioned in a previous front-end sync, I realized after having to add a `reload()` method to the `PaginatedList` imperative handle that I had strayed too far from the path. The original concept for this component was for it to be fully self-contained, so the parent didn't have to concern itself with pagination at all other than being told what page to load. But the addition of an `onChangePage` property isn't a tragedy and is totally worth the reduction in code, consistency with use of `useQuery` elsewhere and React best practice of passing data from parent to child. This refactor still retains the use of the imperative handle for querying the "dirty state" of the list, so parents don't have to manage that state themselves. ## Testing - [X] Added/updated automated tests Updated PaginatedList tests as needed. Also confirmed that tests for the upstream components (PoliciesPaginatedList, Secrets, RunBatchScriptModal and ScriptBatchProgress) all passed without any modification. - [X] QA'd all new/changed functionality manually Added enough data to paginate each of the components that uses PaginatedList, confirmed pagination still works and dirty state functionality (in PoliciesPaginatedList) still works. Also confirmed add/delete functionality works as expected in Secrets. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - New Features - Consistent, responsive pagination across Scripts, Secrets, Hosts, and Policies pages with clearer loading and empty states. - Bug Fixes - Delete Secret modal now reliably displays errors and refreshes the list after deletion. - Refactor - Unified data-driven pagination flow for improved performance and smoother navigation. - Simplified list interactions by removing manual reloads. - Tests - Updated tests to align with the new pagination behavior and data flow. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|---|---|---|
| .. | ||
| _styles.scss | ||
| index.ts | ||
| PaginatedList.tests.tsx | ||
| PaginatedList.tsx | ||