From 62799c3ad4b293acdce91bfbed7744c4db4dcfea Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Mon, 29 Sep 2025 09:04:31 -0500 Subject: [PATCH] Fix path for Controls top nav link (#33556) **Related issue:** Resolves #33222 # Details This PR fixes an issue where clicking "Controls" in the top nav doesn't go to the expected page when the current page is a Controls tab like "Scripts". The expected page is the default "Controls" page, i.e. the first tab (currently the "OS Settings" tab). # 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 I made a pass at this but it requires either the router or mocking the `/` components which seems like overkill for this. - [X] QA'd all new/changed functionality manually ![33222](https://github.com/user-attachments/assets/e3af7a65-f216-45ee-b75c-40b090608942) --- changes/33222-fix-controls-top-nav | 1 + frontend/components/top_nav/SiteTopNav/navItems.ts | 1 + 2 files changed, 2 insertions(+) create mode 100644 changes/33222-fix-controls-top-nav diff --git a/changes/33222-fix-controls-top-nav b/changes/33222-fix-controls-top-nav new file mode 100644 index 0000000000..81761e9f3c --- /dev/null +++ b/changes/33222-fix-controls-top-nav @@ -0,0 +1 @@ +- Fixed issue where "Controls" link in the top nav didn't always go to the default controls page. diff --git a/frontend/components/top_nav/SiteTopNav/navItems.ts b/frontend/components/top_nav/SiteTopNav/navItems.ts index 00e145ae4b..794d07f1a0 100644 --- a/frontend/components/top_nav/SiteTopNav/navItems.ts +++ b/frontend/components/top_nav/SiteTopNav/navItems.ts @@ -67,6 +67,7 @@ export default ( pathname: PATHS.CONTROLS, }, exclude: !isMaintainerOrAdmin, + alwaysToPathname: true, withParams: { type: "query", names: ["team_id"] }, }, {