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

Closed
opened 2026-05-16 04:11:58 -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: Merged
Merged: 5/6/2026
Merged by: @oschwartz10612

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


📝 Commits (10+)

📊 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:** ✅ Merged **Merged:** 5/6/2026 **Merged by:** [@oschwartz10612](https://github.com/oschwartz10612) **Base:** `dev` ← **Head:** `copilot/fix-create-alert-visibility` --- ### 📝 Commits (10+) - [`cf596d9`](https://github.com/fosrl/pangolin/commit/cf596d980fe2c5ba3ebabcfa7a8f628f34912c2c) Merge pull request #2971 from fosrl/dev - [`fb4bda0`](https://github.com/fosrl/pangolin/commit/fb4bda077bfe8676fc5593419c5b505e23db7041) Merge pull request #2983 from fosrl/dev - [`23f4302`](https://github.com/fosrl/pangolin/commit/23f4302186eba1ec75084ce0c395b9e28a943e2a) Merge pull request #2995 from fosrl/dev - [`9410a18`](https://github.com/fosrl/pangolin/commit/9410a18404cf1c9fa0a6e6a3c24d1936adb3b9a9) Merge pull request #2997 from fosrl/dev - [`87e6c7b`](https://github.com/fosrl/pangolin/commit/87e6c7ba36458df9d6465f27fec31d6c33424d37) Merge pull request #3003 from fosrl/dev - [`9b71c42`](https://github.com/fosrl/pangolin/commit/9b71c426c7db06353b4d257724c153e3bc14d7b5) Merge pull request #3005 from fosrl/dev - [`432dc81`](https://github.com/fosrl/pangolin/commit/432dc818759be486fb8ad1b2ec4e0e6c082607b9) Merge pull request #3006 from fosrl/dev - [`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-16 04:11:58 -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#16193