From 6adb3985cb2f31973fb055297b320b055c69e2e0 Mon Sep 17 00:00:00 2001 From: saridsa2 Date: Wed, 15 Apr 2026 18:55:25 +0530 Subject: [PATCH] feat(config): ui-flags endpoint driven by HELIX_SETUP_MANAGED Per-tenant flag that hides self-serve setup surfaces when the product team owns onboarding for a workspace. Set HELIX_SETUP_MANAGED=true on the sidecar env for that tenant; the frontend reads this endpoint at boot, hides the Settings nav + Setup banner, and blocks /settings/* routes. Setup-state APIs stay live so ops can still drive the wizard remotely. --- src/config/setup-state.controller.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/config/setup-state.controller.ts b/src/config/setup-state.controller.ts index b760715..fe6b538 100644 --- a/src/config/setup-state.controller.ts +++ b/src/config/setup-state.controller.ts @@ -53,4 +53,20 @@ export class SetupStateController { const updated = this.setupState.resetState(); return { ...updated, wizardRequired: this.setupState.isWizardRequired() }; } + + // UI-level flags the frontend reads at app boot to tailor which admin + // surfaces are available. Driven by sidecar env vars so each workspace + // can be configured independently without touching the frontend build. + // + // setupManaged=true means "the product team handles setup for this + // workspace" — hide the Settings nav, routes, and the resume-setup + // banner. The wizard + setup-state APIs stay functional for ops use + // (a support engineer can still PUT /steps/:step or hit the routes + // directly); only the end-user admin UI is hidden. + @Get('ui-flags') + uiFlags() { + return { + setupManaged: process.env.HELIX_SETUP_MANAGED === 'true', + }; + } }