[AB-137] fixing occurrences for templates in cases entities do not exist anymore

fixing feature mode retrieval to adapt to lowercase
fixing disable exp role creation and retrieval
removing ansible code
This commit is contained in:
Sheldan
2021-03-09 21:33:51 +01:00
parent d0c06538e3
commit e780b0e75c
29 changed files with 200 additions and 909 deletions

View File

@@ -59,14 +59,12 @@ public class ListChannelGroups extends AbstractConditionableCommand {
List<ChannelGroupChannelModel> convertedChannels = new ArrayList<>();
group.getChannels().forEach(channel -> {
Optional<TextChannel> textChannelInGuild = channelService.getTextChannelFromServerOptional(channel.getServer().getId(), channel.getId());
if(textChannelInGuild.isPresent()) {
ChannelGroupChannelModel convertedChannel = ChannelGroupChannelModel
.builder()
.channel(channel)
.discordChannel(textChannelInGuild.get())
.build();
convertedChannels.add(convertedChannel);
}
ChannelGroupChannelModel convertedChannel = ChannelGroupChannelModel
.builder()
.channel(channel)
.discordChannel(textChannelInGuild.orElse(null))
.build();
convertedChannels.add(convertedChannel);
});
ChannelGroupModel channelGroup = ChannelGroupModel
.builder()

View File

@@ -41,11 +41,11 @@ public class DefaultFeatureModeManagementBean implements DefaultFeatureModeManag
public Optional<FeatureModeProperty> getFeatureModeOptional(AFeature feature, String mode) {
return Optional.ofNullable(defaultConfigProperties
.getFeatureModes()
.get(mode));
.get(mode.toLowerCase()));
}
@Override
public FeatureModeProperty getFeatureMode(AFeature feature, String mode) {
return getFeatureModeOptional(feature, mode).orElseThrow(() -> new FeatureModeNotFoundException(mode, featureConfigService.getFeatureModesFromFeatureAsString(feature.getKey())));
return getFeatureModeOptional(feature, mode.toLowerCase()).orElseThrow(() -> new FeatureModeNotFoundException(mode, featureConfigService.getFeatureModesFromFeatureAsString(feature.getKey())));
}
}