From 20109fa7f8ea46442e8cdf2baeeedaadfcced153 Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Wed, 12 Mar 2025 12:30:32 -0500 Subject: [PATCH] Allow team admins to view inherited policy details (#26896) ## Details Quick fix to an issue where when a team admin attempted to via an inherited policy, they would encounter an eternal spinner / flickering page. The issue stemmed from a reload cycle being set off by the stored policy being returned with a team ID of `null`, and existing code that works around the fact that the `useTeamId` hook modifies the router state. ## Testing 1. Create an All Teams policy on an instance with at least one team 2. Create an admin for the team 3. Log in as the team admin 4. Go to Policies page, select the team from the dropdown, click on the inherited policy in the list to view its details. On main, the details never load. On this branch, they do. --- frontend/pages/policies/PolicyPage/PolicyPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/pages/policies/PolicyPage/PolicyPage.tsx b/frontend/pages/policies/PolicyPage/PolicyPage.tsx index 235f5b150d..a52112c34a 100644 --- a/frontend/pages/policies/PolicyPage/PolicyPage.tsx +++ b/frontend/pages/policies/PolicyPage/PolicyPage.tsx @@ -213,6 +213,7 @@ const PolicyPage = ({ !isOnGlobalTeam && !isStoredPolicyLoading && storedPolicy?.team_id !== undefined && + storedPolicy?.team_id !== null && !(storedPolicy?.team_id?.toString() === location.query.team_id) ) { router.push(