From 2562a76cd3565c02343112e3949c00a00ba8f5f8 Mon Sep 17 00:00:00 2001 From: Jeff Casimir Date: Thu, 9 Jul 2026 13:22:57 +0000 Subject: [PATCH] feat: per-branding disabledFeatures Allow multi-host installations to disable features per branding entry in addition to the installation-wide DISABLED_FEATURES env. A branding entry may carry disabledFeatures (same comma-separated format); the two lists are merged at client bootstrap (web and desktop), so the env remains the baseline and brandings can only extend it. Co-Authored-By: Claude Fable 5 --- desktop/src/ui/platform.ts | 4 +++- desktop/src/ui/types.ts | 1 + dev/prod/src/platform.ts | 5 ++++- docs/disableFeatures.md | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/desktop/src/ui/platform.ts b/desktop/src/ui/platform.ts index 0ae2a507fd3..e641cd5e1c3 100644 --- a/desktop/src/ui/platform.ts +++ b/desktop/src/ui/platform.ts @@ -361,7 +361,9 @@ export async function configurePlatform (onWorkbenchConnect?: () => Promise it.trim()).filter(it => it.length > 0) + const disabledFeatures = [...(config.DISABLED_FEATURES ?? '').split(','), ...(myBranding.disabledFeatures ?? '').split(',')] + .map(it => it.trim()) + .filter(it => it.length > 0) setMetadata(presentation.metadata.DisabledFeatures, new Set(disabledFeatures)) setMetadata(textEditor.metadata.Collaborator, config.COLLABORATOR ?? '') diff --git a/desktop/src/ui/types.ts b/desktop/src/ui/types.ts index d2c018d31a5..4bc285cbadd 100644 --- a/desktop/src/ui/types.ts +++ b/desktop/src/ui/types.ts @@ -90,6 +90,7 @@ export interface Branding { languages?: string lastNameFirst?: string defaultLanguage?: string + disabledFeatures?: string defaultApplication?: string defaultSpace?: string defaultSpecial?: string diff --git a/dev/prod/src/platform.ts b/dev/prod/src/platform.ts index 943b4a1529e..3dbe0fc03cb 100644 --- a/dev/prod/src/platform.ts +++ b/dev/prod/src/platform.ts @@ -223,6 +223,7 @@ export interface Branding { languages?: string lastNameFirst?: string defaultLanguage?: string + disabledFeatures?: string defaultApplication?: string defaultSpace?: string defaultSpecial?: string @@ -492,7 +493,9 @@ export async function configurePlatform() { setMetadata(presentation.metadata.MailUrl, config.MAIL_URL) setMetadata(presentation.metadata.SignupUrl, config.SIGNUP_URL ?? 'https://huly.io/signup') - const disabledFeatures = (config.DISABLED_FEATURES ??'').split(',').map(it => it.trim()).filter(it => it.length > 0) + const disabledFeatures = [...(config.DISABLED_FEATURES ?? '').split(','), ...(myBranding.disabledFeatures ?? '').split(',')] + .map(it => it.trim()) + .filter(it => it.length > 0) setMetadata(presentation.metadata.DisabledFeatures, new Set(disabledFeatures)) setMetadata(recorder.metadata.StreamUrl, config.STREAM_URL) diff --git a/docs/disableFeatures.md b/docs/disableFeatures.md index be16cd915a6..c89b7db9617 100644 --- a/docs/disableFeatures.md +++ b/docs/disableFeatures.md @@ -26,3 +26,21 @@ Please set a DISABLED_FEATURES environment variable for front service container, - testManagement - Will disable test management - process - Will disable process module - cards - Will disable cards + +## Per-branding disabled features + +When serving multiple brands/hosts from one installation (see `BRANDING_URL`), +features can also be disabled per host by adding a `disabledFeatures` key +(same comma-separated format) to a branding entry. The lists from +`DISABLED_FEATURES` and the matched branding are merged, so the environment +variable acts as the installation-wide baseline and brandings can only extend +it: + +```json +{ + "tracker.example-client.com": { + "title": "Example Client Tracker", + "disabledFeatures": "recruit,lead,inventory,training" + } +} +```