Completed feature #391

This commit is contained in:
2023-10-02 08:24:20 +02:00
parent 2182c021b9
commit f5d88ec94c
11 changed files with 113 additions and 82 deletions

View File

@@ -17,6 +17,7 @@ export interface ServerConfig extends DataWithHistory {
teamChannelId?: string;
loginMessageChannelId?: string;
defaultRoleId?: string;
shortRoleNameOnlySetHighestRole?: boolean;
featureFlags: FeatureFlag[];
afkChannelIds: string[];
moderatorRoleIds: string[];

View File

@@ -254,6 +254,7 @@ export class Mutations {
$teamChannelId: String,
$loginMessageChannelId: String,
$defaultRoleId: String,
$shortRoleNameOnlySetHighestRole: Boolean
$featureFlags: [FeatureFlagInput],
$afkChannelIds: [String],
$moderatorRoleIds: [String],
@@ -276,6 +277,7 @@ export class Mutations {
teamChannelId: $teamChannelId,
loginMessageChannelId: $loginMessageChannelId,
defaultRoleId: $defaultRoleId,
shortRoleNameOnlySetHighestRole: $shortRoleNameOnlySetHighestRole,
featureFlags: $featureFlags,
afkChannelIds: $afkChannelIds,
moderatorRoleIds: $moderatorRoleIds,
@@ -295,6 +297,8 @@ export class Mutations {
helpVoiceChannelId
teamChannelId
loginMessageChannelId
defaultRoleId
shortRoleNameOnlySetHighestRole
featureFlags {
key
value

View File

@@ -487,6 +487,7 @@ export class Queries {
teamChannelId
loginMessageChannelId
defaultRoleId
shortRoleNameOnlySetHighestRole
featureFlags {
key
value

View File

@@ -122,6 +122,14 @@
</div>
</div>
<div class="content-row">
<div class="content-column">
<div class="content-data-name">{{'view.server.config.bot.short_role_name_only_set_highest_role' | translate}}:</div>
<p-dropdown class="content-data-value" [options]="boolAsStrings" [(ngModel)]="config.shortRoleNameOnlySetHighestRole"
placeholder="{{'view.server.config.bot.short_role_name_only_set_highest_role' | translate}}"></p-dropdown>
</div>
</div>
<div class="content-divider"></div>
<app-config-list [options]="voiceChannels" optionLabel="name" optionValue="id" translationKey="view.server.config.bot.afk_channels"
[(data)]="config.afkChannelIds"></app-config-list>

View File

@@ -46,6 +46,10 @@ export class ConfigComponent implements OnInit {
roles?: Role[];
voiceChannels: Channel[] = [];
textChannels: Channel[] = [];
boolAsStrings = [
{ label: this.translate.instant("common.bool_as_string.true"), value: true },
{ label: this.translate.instant("common.bool_as_string.false"), value: false }
];
constructor(
private data: DataService,
@@ -119,6 +123,7 @@ export class ConfigComponent implements OnInit {
teamChannelId: this.config.teamChannelId,
loginMessageChannelId: this.config.loginMessageChannelId,
defaultRoleId: this.config.defaultRoleId,
shortRoleNameOnlySetHighestRole: this.config.shortRoleNameOnlySetHighestRole,
featureFlags: this.config.featureFlags,
afkChannelIds: this.config.afkChannelIds,
moderatorRoleIds: this.config.moderatorRoleIds,

View File

@@ -419,6 +419,7 @@
"afk_channels": "AFK Sprachkanäle",
"afk_command_channel_id": "AFK Kanal für den Befehl /afk",
"default_role_id": "Standardrolle des Servers",
"short_role_name_only_set_highest_role": "Bei Rollen Kürzeln nur die höchste Rolle verwenden",
"header": "Bot Konfiguration",
"help_voice_channel_id": "Sprachkanal für Hilfsbenachrichtung",
"login_message_channel_id": "Kanal für die Nachricht vom Bot nach Start",

View File

@@ -419,6 +419,7 @@
"afk_channels": "AFK Voicechannel",
"afk_command_channel_id": "AFK Channel for the command /afk",
"default_role_id": "Default role",
"short_role_name_only_set_highest_role": "For role abbreviations use only the highest role",
"header": "Bot configuration",
"help_voice_channel_id": "Voicechannel für help notifications",
"login_message_channel_id": "Channel for bot message after start",