Added flag check to hide pages #378

This commit is contained in:
2023-09-28 15:14:38 +02:00
parent 376cb76036
commit 3546d38f75
7 changed files with 218 additions and 156 deletions

View File

@@ -35,7 +35,7 @@ type Server implements TableWithHistoryQuery {
shortRoleNames(filter: ShortRoleNameFilter, page: Page, sort: Sort): [ShortRoleName]
config: ServerConfig
hasFeatureFlag(flag: String): Boolean
hasFeatureFlag(flag: String): FeatureFlag
createdAt: String
modifiedAt: String

View File

@@ -103,4 +103,7 @@ class ServerQuery(DataQueryWithHistoryABC):
settings: ServerConfig = self._config.get_configuration(f"ServerConfig_{server.discord_id}")
if "flag" not in kwargs:
return False
return FeatureFlagsSettings.get_flag_from_dict(settings.feature_flags, FeatureFlagsEnum(kwargs["flag"]))
return {
"key": kwargs["flag"],
"value": FeatureFlagsSettings.get_flag_from_dict(settings.feature_flags, FeatureFlagsEnum(kwargs["flag"])),
}