Изменение формата уведомлений о пайплайне
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b530c061f3
commit
88f0450be2
@ -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();
|
||||
|
@ -24,25 +24,25 @@ public class PipelineNotifyGenerator implements NotifyBoxAnswerGenerator<Pipelin
|
||||
|
||||
@Override
|
||||
public BoxAnswer generate(PipelineNotify notify) {
|
||||
final Optional<String> 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<String> 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"),
|
||||
|
Loading…
Reference in New Issue
Block a user