mirror of
https://github.com/fleetdm/fleet
synced 2026-05-09 02:01:09 +00:00
For #23243 # Checklist for submitter <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Added/updated automated tests - [ ] A detailed QA plan exists on the associated ticket (if it isn't there, work with the product group's QA engineer to add it) - [x] Manual QA for all new/changed functionality ## Details This PR updates the policy Manage Automations modals to support pagination. Previously, these modals received a list of policies from the main Manage Policies page, which is itself paginated, so that a user could only add automations to whatever policies were currently listed on the Manage Automations page. This PR does some refactoring via the creation of a new PaginatedList component which: * accepts a `fetchPage` property it can call to get a page of data, * renders the data in a list with checkboxes and optional custom markup (e.g. dropdowns) * keeps track of changed ("dirty") items in the list, even across page changes * allows parent components to access the list of dirty items via a React `ref` For this specific use case, there's also a new `PoliciesPaginatedList` which implements the `fetchPage` for getting a page of policies, and adds Save and Cancel buttons. Each of the updated modals uses `PoliciesPaginatedList` to replace its current code for rendering policies in a list, and delegates much of the logic around change tracking to the new components. |
||
|---|---|---|
| .. | ||
| _styles.scss | ||
| Checkbox.stories.tsx | ||
| Checkbox.tests.tsx | ||
| Checkbox.tsx | ||
| index.ts | ||