Added highest role setting to gql #391
This commit is contained in:
parent
a9c9880fd4
commit
2182c021b9
@ -14,6 +14,7 @@ type ServerConfig implements TableWithHistoryQuery {
|
|||||||
teamChannelId: String
|
teamChannelId: String
|
||||||
loginMessageChannelId: String
|
loginMessageChannelId: String
|
||||||
defaultRoleId: String
|
defaultRoleId: String
|
||||||
|
shortRoleNameOnlySetHighestRole: Boolean
|
||||||
featureFlagCount: Int
|
featureFlagCount: Int
|
||||||
featureFlags: [FeatureFlag]
|
featureFlags: [FeatureFlag]
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ type ServerConfigHistory implements HistoryTableQuery {
|
|||||||
teamChannelId: String
|
teamChannelId: String
|
||||||
loginMessageChannelId: String
|
loginMessageChannelId: String
|
||||||
defaultRoleId: String
|
defaultRoleId: String
|
||||||
|
shortRoleNameOnlySetHighestRole: Boolean
|
||||||
featureFlagCount: Int
|
featureFlagCount: Int
|
||||||
featureFlags: [FeatureFlag]
|
featureFlags: [FeatureFlag]
|
||||||
|
|
||||||
@ -94,6 +96,7 @@ input ServerConfigInput {
|
|||||||
teamChannelId: String
|
teamChannelId: String
|
||||||
loginMessageChannelId: String
|
loginMessageChannelId: String
|
||||||
defaultRoleId: String
|
defaultRoleId: String
|
||||||
|
shortRoleNameOnlySetHighestRole: Boolean
|
||||||
featureFlags: [FeatureFlagInput]
|
featureFlags: [FeatureFlagInput]
|
||||||
|
|
||||||
afkChannelIds: [String]
|
afkChannelIds: [String]
|
||||||
|
@ -92,6 +92,11 @@ class ServerConfigMutation(QueryABC):
|
|||||||
server_config.default_role_id = (
|
server_config.default_role_id = (
|
||||||
input["defaultRoleId"] if "defaultRoleId" in input else server_config.default_role_id
|
input["defaultRoleId"] if "defaultRoleId" in input else server_config.default_role_id
|
||||||
)
|
)
|
||||||
|
server_config.default_role_id = (
|
||||||
|
input["shortRoleNameOnlySetHighestRole"]
|
||||||
|
if "shortRoleNameOnlySetHighestRole" in input
|
||||||
|
else server_config.short_role_name_only_set_highest_role
|
||||||
|
)
|
||||||
server_config.feature_flags = (
|
server_config.feature_flags = (
|
||||||
dict(zip([x["key"] for x in input["featureFlags"]], [x["value"] for x in input["featureFlags"]]))
|
dict(zip([x["key"] for x in input["featureFlags"]], [x["value"] for x in input["featureFlags"]]))
|
||||||
if "featureFlags" in input
|
if "featureFlags" in input
|
||||||
|
@ -25,6 +25,9 @@ class ServerConfigQuery(DataQueryWithHistoryABC):
|
|||||||
self.set_field("teamChannelId", lambda config, *_: config.team_channel_id)
|
self.set_field("teamChannelId", lambda config, *_: config.team_channel_id)
|
||||||
self.set_field("loginMessageChannelId", lambda config, *_: config.login_message_channel_id)
|
self.set_field("loginMessageChannelId", lambda config, *_: config.login_message_channel_id)
|
||||||
self.set_field("defaultRoleId", lambda config, *_: config.default_role_id)
|
self.set_field("defaultRoleId", lambda config, *_: config.default_role_id)
|
||||||
|
self.set_field(
|
||||||
|
"shortRoleNameOnlySetHighestRole", lambda config, *_: config.short_role_name_only_set_highest_role
|
||||||
|
)
|
||||||
self.add_collection(
|
self.add_collection(
|
||||||
"featureFlag",
|
"featureFlag",
|
||||||
lambda config, *_: List(any, [{"key": x, "value": config.feature_flags[x]} for x in config.feature_flags]),
|
lambda config, *_: List(any, [{"key": x, "value": config.feature_flags[x]} for x in config.feature_flags]),
|
||||||
|
Loading…
Reference in New Issue
Block a user