[PR #3011] Hide alerting UI when disable_enterprise_features is true #12057

Open
opened 2026-05-06 16:38:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/pangolin/pull/3011
Author: @Copilot
Created: 5/6/2026
Status: 🔄 Open

Base: mainHead: copilot/fix-create-alert-visibility


📝 Commits (3)

  • 0c643e9 Initial plan
  • 1b183d3 Hide alerting features when disable_enterprise_features is set
  • 3ac315b Fix useEffect dependency array in create alert page

📊 Changes

3 files changed (+37 additions, -10 deletions)

View changed files

📝 src/app/[orgId]/settings/alerting/create/page.tsx (+16 -1)
📝 src/app/navigation.tsx (+9 -5)
📝 src/components/AlertingRulesTable.tsx (+12 -4)

📄 Description

With disable_enterprise_features: true, the Alerting sidebar entry and "Create Alert Rule" page were still rendered (just grayed out), inconsistent with other enterprise features that are fully hidden under this flag.

Changes

  • src/app/navigation.tsx: Gate sidebarAlerting behind !env?.flags.disableEnterpriseFeatures, matching the existing pattern for sidebarApprovals, access logs, etc.

  • src/components/AlertingRulesTable.tsx: Pass onAdd={undefined} when enterprise features are disabled, suppressing the "+ Create Alert" button.

  • src/app/[orgId]/settings/alerting/create/page.tsx: Guard the create page — renders null and calls router.replace back to the rules list if enterprise features are disabled, preventing direct URL access.

// create/page.tsx
const disableEnterpriseFeatures = env.flags.disableEnterpriseFeatures;

useEffect(() => {
    if (disableEnterpriseFeatures) {
        router.replace(`/${orgId}/settings/alerting/rules`);
    }
}, [disableEnterpriseFeatures, orgId, router]);

if (disableEnterpriseFeatures) return null;

Fixes #3009


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/pangolin/pull/3011 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 5/6/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `copilot/fix-create-alert-visibility` --- ### 📝 Commits (3) - [`0c643e9`](https://github.com/fosrl/pangolin/commit/0c643e91a6c39a50219ed63310a30ba6fa5dddc7) Initial plan - [`1b183d3`](https://github.com/fosrl/pangolin/commit/1b183d32c0bd2875a7d17274a77a09e9c42e3589) Hide alerting features when disable_enterprise_features is set - [`3ac315b`](https://github.com/fosrl/pangolin/commit/3ac315b52ed7ced3841c23095e21a46d5cfffb48) Fix useEffect dependency array in create alert page ### 📊 Changes **3 files changed** (+37 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/app/[orgId]/settings/alerting/create/page.tsx` (+16 -1) 📝 `src/app/navigation.tsx` (+9 -5) 📝 `src/components/AlertingRulesTable.tsx` (+12 -4) </details> ### 📄 Description With `disable_enterprise_features: true`, the Alerting sidebar entry and "Create Alert Rule" page were still rendered (just grayed out), inconsistent with other enterprise features that are fully hidden under this flag. ## Changes - **`src/app/navigation.tsx`**: Gate `sidebarAlerting` behind `!env?.flags.disableEnterpriseFeatures`, matching the existing pattern for `sidebarApprovals`, access logs, etc. - **`src/components/AlertingRulesTable.tsx`**: Pass `onAdd={undefined}` when enterprise features are disabled, suppressing the "+ Create Alert" button. - **`src/app/[orgId]/settings/alerting/create/page.tsx`**: Guard the create page — renders `null` and calls `router.replace` back to the rules list if enterprise features are disabled, preventing direct URL access. ```tsx // create/page.tsx const disableEnterpriseFeatures = env.flags.disableEnterpriseFeatures; useEffect(() => { if (disableEnterpriseFeatures) { router.replace(`/${orgId}/settings/alerting/rules`); } }, [disableEnterpriseFeatures, orgId, router]); if (disableEnterpriseFeatures) return null; ``` Fixes #3009 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-06 16:38:40 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#12057