mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-14 03:45:57 +00:00
[AB-343] fixing link buttons not being properly supported in templates
This commit is contained in:
@@ -124,17 +124,14 @@ public class TemplateServiceBean implements TemplateService {
|
|||||||
throw new AbstractoRunTimeException("Referenced class in button config could not be found: " + buttonConfig.getPayloadType(), e);
|
throw new AbstractoRunTimeException("Referenced class in button config could not be found: " + buttonConfig.getPayloadType(), e);
|
||||||
}
|
}
|
||||||
componentPayloads.put(id, componentConfig);
|
componentPayloads.put(id, componentConfig);
|
||||||
Button createdButton = Button.primary(id, buttonConfig.getLabel());
|
String idOrUl = buttonConfig.getUrl() == null ? buttonConfig.getId() : buttonConfig.getUrl();
|
||||||
if (buttonConfig.getUrl() != null) {
|
Button createdButton = Button.of(ButtonStyleConfig.getStyle(buttonConfig.getButtonStyle()), idOrUl, buttonConfig.getLabel());
|
||||||
createdButton = createdButton.withUrl(buttonConfig.getUrl());
|
|
||||||
}
|
|
||||||
if (buttonConfig.getDisabled() != null) {
|
if (buttonConfig.getDisabled() != null) {
|
||||||
createdButton = createdButton.withDisabled(buttonConfig.getDisabled());
|
createdButton = createdButton.withDisabled(buttonConfig.getDisabled());
|
||||||
}
|
}
|
||||||
if (buttonConfig.getEmoteMarkdown() != null) {
|
if (buttonConfig.getEmoteMarkdown() != null) {
|
||||||
createdButton = createdButton.withEmoji(Emoji.fromMarkdown(buttonConfig.getEmoteMarkdown()));
|
createdButton = createdButton.withEmoji(Emoji.fromMarkdown(buttonConfig.getEmoteMarkdown()));
|
||||||
}
|
}
|
||||||
createdButton = createdButton.withStyle(ButtonStyleConfig.getStyle(buttonConfig.getButtonStyle()));
|
|
||||||
if(currentRow == null) {
|
if(currentRow == null) {
|
||||||
currentRow = ActionRow.of(createdButton);
|
currentRow = ActionRow.of(createdButton);
|
||||||
} else if (
|
} else if (
|
||||||
|
|||||||
Reference in New Issue
Block a user