refactor(settings): remove global appearance settings — tenant is sole source
Removes the global app_theme, app_theme_user and app_primary_color settings from the admin/settings area and the underlying service/cache/API/i18n/docs layers. The tenant columns (tenants.primary_color, default_theme, allow_user_theme) become the single source of truth for appearance. Branding helpers are tenant-only and fall back to a hardcoded 'light' theme with no brand color when no tenant context is available (login, error, pre-session pages). The APP_THEME env var is removed. Scope: - UI: Appearance tab gone from /admin/settings; tenant edit form drops the global-fallback color preview. - Service: SettingsAppGateway no longer exposes setting-backed accessors for theme/user-theme/primary-color. Theme catalog utilities (listThemes, isAllowedTheme, normalizeTheme, resolveDefaultTheme) stay and are used across Tenant / Auth / User flows; resolveDefaultTheme now hardcodes 'light' with a catalog fallback (no global/env lookup). - AdminSettingsService: buildPageData, sanitization, audit snapshot, apply step and cache payload are all stripped of the three keys. Dead helper applyAppPrimaryColor + normalizePrimaryColor removed. - Cache: SettingCacheService HOT_PATH_KEYS drops the three keys. - API: /settings (GET/PUT) and /settings/public (GET) no longer expose appearance fields; OpenAPI schemas pruned accordingly. - Audit redaction list shortened. - DB: db/init/init.sql seed rows removed. No migration for existing installs — legacy rows stay inert. - i18n + docs: setting.app_theme, setting.app_theme_user, setting.app_primary_color removed from de+en locales; reference and explanation docs updated. - Tests: covering tests for the removed methods pruned; ThemeResolutionTest rewritten for tenant-only semantics. One unrelated PHP-CS-Fixer issue in UserRegistrar.php cleaned up to keep QG-006 green. Workflow: .agents/runs/SETTINGS-APPEARANCE-TENANT-ONLY/ (gitignored). Gates: QG-001..003, QG-006, QG-008 all pass (1985 tests, 28764 assertions). Reviews: code, security, acceptance all pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -411,13 +411,10 @@
|
||||
"setting.app_title": "App title shown in the browser title bar",
|
||||
"setting.app_locale": "Default language used when no user or URL locale is set",
|
||||
"Default language": "Default language",
|
||||
"setting.app_theme": "Default theme used when a user has no theme preference",
|
||||
"setting.app_theme_user": "Allow users to choose their own theme",
|
||||
"setting.app_registration": "Allow public self-registration",
|
||||
"setting.api_token_default_ttl_days": "Default lifetime for newly created API tokens in days (default: 90)",
|
||||
"setting.api_token_max_ttl_days": "Maximum lifetime for API tokens in days (hard cap)",
|
||||
"setting.api_cors_allowed_origins": "Allowed browser origins for API CORS (one origin per line)",
|
||||
"setting.app_primary_color": "Overrides the default primary color (hex like #2FA4A4)",
|
||||
"API token default lifetime (days)": "API token default lifetime (days)",
|
||||
"API token maximum lifetime (days)": "API token maximum lifetime (days)",
|
||||
"Allowed CORS origins": "Allowed CORS origins",
|
||||
@@ -1270,5 +1267,14 @@
|
||||
"Priority": "Priority",
|
||||
"Note": "Note",
|
||||
"Optional note...": "Optional note...",
|
||||
"Security level updated": "Security level updated"
|
||||
"Security level updated": "Security level updated",
|
||||
"About": "About",
|
||||
"Call": "Call",
|
||||
"Copy email address": "Copy email address",
|
||||
"Copy phone number": "Copy phone number",
|
||||
"Copy mobile number": "Copy mobile number",
|
||||
"Hired": "Hired",
|
||||
"Primary": "Primary",
|
||||
"Send email": "Send email",
|
||||
"Summary": "Summary"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user