Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(frontend): hide run plan checks when issue is not open (BYT-9755) (#20640)

boojack15ed8ca03e7b
diff --git a/frontend/src/react/pages/project/issue-detail/components/IssueDetailChecks.tsx b/frontend/src/react/pages/project/issue-detail/components/IssueDetailChecks.tsx
index bab8361f6f..f78185ec12 100644
--- a/frontend/src/react/pages/project/issue-detail/components/IssueDetailChecks.tsx
+++ b/frontend/src/react/pages/project/issue-detail/components/IssueDetailChecks.tsx
@@ -40,12 +40,15 @@ export function IssueDetailChecks() {
const allowRunChecks = useMemo(() => {
if (!page.plan) return false;
+ // A closed/done issue (or deleted plan) is read-only — running checks is
+ // rejected by the backend too, so hide the action.
+ if (page.readonly) return false;
// Once a rollout exists the plan is frozen — re-running checks would only
// produce the same results and misleads the user.
if (page.plan.hasRollout) return false;
if (extractUserEmail(page.plan.creator) === currentUser.email) return true;
return hasProjectPermissionV2(project, "bb.planCheckRuns.run");
- }, [currentUser.email, page.plan, project]);
+ }, [currentUser.email, page.plan, page.readonly, project]);
const refreshChecks = useCallback(async (): Promise<PlanCheckRun[]> => {
const planName = page.plan?.name;
diff --git a/frontend/src/react/pages/project/plan-detail/hooks/usePlanCheckActions.tsx b/frontend/src/react/pages/project/plan-detail/hooks/usePlanCheckActions.tsx
index f2eaa07f6d..640cdb0a14 100644
--- a/frontend/src/react/pages/project/plan-detail/hooks/usePlanCheckActions.tsx
+++ b/frontend/src/react/pages/project/plan-detail/hooks/usePlanCheckActions.tsx
@@ -30,10 +30,19 @@ export function usePlanCheckActions() {
const project = useProjectByName(projectName);
const allowRunChecks = useMemo(() => {
+ // A closed/done issue (or deleted plan) is read-only — running checks is
+ // rejected by the backend too, so hide the action.
+ if (page.readonly) return false;
if (page.plan.hasRollout) return false;
if (extractUserEmail(page.plan.creator) === currentUser.email) return true;
return hasProjectPermissionV2(project, "bb.planCheckRuns.run");
- }, [currentUser.email, page.plan.creator, page.plan.hasRollout, project]);
+ }, [
+ currentUser.email,
+ page.plan.creator,
+ page.plan.hasRollout,
+ page.readonly,
+ project,
+ ]);
const refreshChecks = useCallback(async (): Promise<PlanCheckRun[]> => {
const [nextPlan, runOrNull] = await Promise.all([