semantic cleanup
This commit is contained in:
@@ -111,6 +111,22 @@ async def get_settings(
|
||||
# [/DEF:get_settings:Function]
|
||||
|
||||
|
||||
# [DEF:get_features:Function]
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Public endpoint returning feature flags for frontend sidebar filtering.
|
||||
# @RATIONALE: Unauthenticated because sidebar filtering must work for all users, not just admins.
|
||||
# @PRE: Config manager is available.
|
||||
# @POST: Returns dict with dataset_review and health_monitor booleans.
|
||||
@router.get("/features")
|
||||
async def get_features(
|
||||
config_manager: ConfigManager = Depends(get_config_manager),
|
||||
):
|
||||
return config_manager.get_config().settings.features.model_dump()
|
||||
|
||||
|
||||
# [/DEF:get_features:Function]
|
||||
|
||||
|
||||
# [DEF:update_global_settings:Function]
|
||||
# @COMPLEXITY: 2
|
||||
# @PURPOSE: Updates global application settings.
|
||||
@@ -403,6 +419,7 @@ class ConsolidatedSettingsResponse(BaseModel):
|
||||
logging: dict
|
||||
storage: dict
|
||||
notifications: dict = {}
|
||||
features: dict = {}
|
||||
|
||||
|
||||
# [/DEF:ConsolidatedSettingsResponse:Class]
|
||||
@@ -472,6 +489,7 @@ async def get_consolidated_settings(
|
||||
logging=config.settings.logging.dict(),
|
||||
storage=config.settings.storage.dict(),
|
||||
notifications=notifications_payload,
|
||||
features=config.settings.features.model_dump(),
|
||||
)
|
||||
logger.reflect(
|
||||
"Consolidated settings payload assembled",
|
||||
@@ -525,6 +543,12 @@ async def update_consolidated_settings(
|
||||
raise HTTPException(status_code=400, detail=message)
|
||||
current_settings.storage = new_storage
|
||||
|
||||
# Update Features if provided
|
||||
if "features" in settings_patch:
|
||||
from ...core.config_models import FeaturesConfig
|
||||
|
||||
current_settings.features = FeaturesConfig(**settings_patch["features"])
|
||||
|
||||
if "notifications" in settings_patch:
|
||||
payload = config_manager.get_payload()
|
||||
payload["notifications"] = settings_patch["notifications"]
|
||||
|
||||
Reference in New Issue
Block a user