feat(status-page): add theme and themeMode fields (backend)
## Changes - Add `theme` (refined | modern | bold | editorial, default "refined") and `themeMode` (auto | light | dark, default "auto") fields to the StatusPage Mongoose model and the shared `StatusPage` type. - Extend the create/update Zod validator to accept both fields optionally. - Map both fields in the repository's `toEntity` so GET responses include them. - Document both fields in the create and update endpoints in `openapi.json`. - Add `STATUS_PAGE_THEMES_ENABLED` env var (default `true`) wired through `SettingsService` for ops-level rollback. When disabled, the controller strips theme fields on write and forces defaults on read. ## Notes - No migration needed; Mongoose applies defaults for legacy documents. - Controller short-circuits to zero-cost when the feature flag is on. - `DEFAULT_STATUS_PAGE_THEME` / `DEFAULT_STATUS_PAGE_THEME_MODE` constants exported so the frontend PR can consume the same values.
This commit is contained in:
1 parent
6ed0818bad
commit
ad964446de
11 files changed
+408
-8
No files matched your search
@@ -2807,6 +2807,12 @@
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "Custom URL for the status page"
|
||||
},
|
||||
"theme": {
|
||||
"$ref": "#/components/schemas/StatusPageTheme"
|
||||
},
|
||||
"themeMode": {
|
||||
"$ref": "#/components/schemas/StatusPageThemeMode"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2859,6 +2865,12 @@
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "Custom URL for the status page"
|
||||
},
|
||||
"theme": {
|
||||
"$ref": "#/components/schemas/StatusPageTheme"
|
||||
},
|
||||
"themeMode": {
|
||||
"$ref": "#/components/schemas/StatusPageThemeMode"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3339,6 +3351,16 @@
|
||||
}
|
||||
},
|
||||
"schemas": {
|
||||
"StatusPageTheme": {
|
||||
"type": "string",
|
||||
"enum": ["refined", "modern", "bold", "editorial"],
|
||||
"description": "Visual theme for the public status page. Defaults to 'refined'."
|
||||
},
|
||||
"StatusPageThemeMode": {
|
||||
"type": "string",
|
||||
"enum": ["auto", "light", "dark"],
|
||||
"description": "Forces a light/dark mode on the public page. 'auto' follows the visitor's OS preference. Defaults to 'auto'."
|
||||
},
|
||||
"SuccessResponse": {
|
||||
"type": "object",
|
||||
"required": ["success", "msg"],
|
||||
|
||||
Reference in new issue
Block a user