fix: guard advance-analytics API calls on Community Edition#9246
Conversation
On CE (is_self_managed: true), the analytics page was mounting components that fired requests to /advance-analytics, /advance-analytics-charts, and /advance-analytics-stats — endpoints that only exist on Pro/Cloud. This caused 500 errors and a broken UI. Check is_self_managed from instance config in the analytics page and render an informational empty state instead of the tabs, preventing any API calls from firing on CE. Adds the not_available_ce i18n key to all 19 supported locales. Fixes makeplane#9237
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (20)
📝 WalkthroughWalkthroughThe analytics page now reads ChangesAnalytics Community Edition Gate
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
On Community Edition, clicking the Analytics tab triggers
/advance-analytics,/advance-analytics-charts, and/advance-analytics-statsAPI calls that don't exist on CE, resulting in 500s and a broken UI.Root cause: The analytics page mounts
TotalInsights,ProjectInsights,CreatedVsResolved,PriorityChart, andWorkItemsInsightTableunconditionally — all of which fireadvance-analyticsrequests on mount. The instance config already exposesis_self_managed: trueon CE, but the analytics page wasn't checking it.Fix: In
apps/web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx, checkinstanceConfig.is_self_managedviauseInstance(). When true, render an informational empty state instead of the tabs. No API calls fire. Also adds thenot_available_cei18n key to all 19 supported locales.Closes #9237
Summary by CodeRabbit