fleet/frontend/hooks
Scott Gress 29aa39a392
Update default fleet selected on dashboard and controls (#42688)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #40317

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [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/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [ ] Added/updated automated tests
With the current router we have in place, we can't really test `<Link>`
elements, so our ability to make useful automated tests is pretty
limited here. I extracted the fleet name sorting code into an exported
function and added some tests for that.
- [X] QA'd all new/changed functionality manually
- [X] verified that when All Fleets is selected in dropdown, navigating
to Controls switches to Workstations
- [X] verified that when another fleet is selected in dropdown,
navigating to Controls maintains that selection
- [X] verified that when a fleet is selected in dropdown, navigating to
the dashboard changes to All Fleets
- [X] verified that when "Unassigned" is present in the fleets dropdown,
it is at the bottom
- [X] verified that when using a permalink to the dashboard with a fleet
selected (e.g. `?fleet_id=1`), the correct fleet shows as selected
2026-03-31 09:11:51 -05:00
..
useCheckboxListStateManagement.tsx 17445 calendar events modal (#17717) 2024-03-26 13:39:37 -05:00
useCheckTruncatedElement.ts UI: Improve TooltipTruncatedText and now underlying useCheckTruncatedElement (#29232) 2025-05-20 15:41:53 -07:00
useDeepEffect.ts Removed all traces of Redux from the app! (#5287) 2022-04-22 09:45:35 -07:00
useGitOpsMode.ts Remove UI gating in GitOps mode for excepted entities (#42486) 2026-03-31 09:10:56 -05:00
useIsMobileWidth.tsx My device page (self-service) for iOS/iPadOS (#35238) 2025-11-07 17:30:51 -05:00
usePlatformCompatibility.tsx 21855 – Paginate and filter Queries on the server, update platform filtering from compatible to targeted platforms (#24446) 2024-12-11 10:50:28 -08:00
usePlatformSelector.tsx Fleet UI: VPP auto install software on failed policies, filter software compatible to policy's target platform, etc (#25202) 2025-01-13 16:45:16 -08:00
useQueryTargets.ts Fleet UI: Fix new query bugs introduced (#14309) 2023-10-06 10:03:19 -07:00
useSoftwareInstallerMeta.ts Remove UI gating in GitOps mode for excepted entities (#42486) 2026-03-31 09:10:56 -05:00
useTeamIdParam.ts Update default fleet selected on dashboard and controls (#42688) 2026-03-31 09:11:51 -05:00
useToggleSidePanel.ts Fleet UI: Fix bug with label sidebar not collapsing (#7402) 2022-09-01 17:42:25 -04:00