diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Icons.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Icons.java index 117671e..2a0c8c3 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Icons.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/utils/Icons.java @@ -18,10 +18,10 @@ public class Icons { public static final String DANGEROUS = "⚠️"; public static final String PEN = "✏️"; public static final String ASSIGNEE = "\uD83C\uDFA9"; - public static final String BUILD = "\uD83D\uDEE0"; + public static final String BUILD = "⚙️"; public static final String LINK = "\uD83D\uDD17"; public static final String REVIEWER = "\uD83D\uDD0E"; - public static final String PROJECT = "Project"; + public static final String PROJECT = "\uD83C\uDFD7"; private Icons() { utilityClass(); diff --git a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java index 5bd1f94..398c612 100644 --- a/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java +++ b/telegram-bot/src/main/java/dev/struchkov/bot/gitlab/telegram/service/notify/PipelineNotifyGenerator.java @@ -24,25 +24,25 @@ public class PipelineNotifyGenerator implements NotifyBoxAnswerGenerator optProjectName = projectService.getProjectNameById(notify.getProjectId()) - .map(Strings::escapeMarkdown); + final StringBuilder builder = new StringBuilder(Icons.BUILD).append(" *New pipeline |").append(notify.getPipelineId()).append("*"); - final StringBuilder builder = new StringBuilder(Icons.BUILD).append(" *Pipeline ").append(notify.getPipelineId()).append("*"); - - if (optProjectName.isPresent()) { - final String projectName = optProjectName.get(); - builder.append(" | ").append(projectName); - } - - final String notifyMessage = builder - .append(Icons.HR) - .append(Icons.TREE).append(": ").append(notify.getRefName()) + builder .append(Icons.HR) .append(notify.getOldStatus().getIcon()).append(" ").append(notify.getOldStatus()).append(Icons.ARROW).append(notify.getNewStatus().getIcon()).append(" ").append(notify.getNewStatus()) - .toString(); + .append(Icons.HR); + + final Optional optProjectName = projectService.getProjectNameById(notify.getProjectId()) + .map(Strings::escapeMarkdown); + if (optProjectName.isPresent()) { + final String projectName = optProjectName.get(); + builder.append(Icons.PROJECT).append(": ").append(projectName).append("\n"); + } + + builder + .append(Icons.TREE).append(": ").append(notify.getRefName()); return boxAnswer( - notifyMessage, + builder.toString(), inlineKeyBoard( simpleLine( simpleButton(Icons.VIEW, "DELETE_MESSAGE"),