fix format notify PipelineNotify
This commit is contained in:
parent
050ab4eaa7
commit
d6512a695c
@ -28,19 +28,21 @@ public class PipelineNotifyGenerator implements NotifyBoxAnswerGenerator<Pipelin
|
|||||||
final StringBuilder builder = new StringBuilder(Icons.BUILD).append(" *New pipeline | ").append(notify.getPipelineId()).append("*");
|
final StringBuilder builder = new StringBuilder(Icons.BUILD).append(" *New pipeline | ").append(notify.getPipelineId()).append("*");
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.append(Icons.HR)
|
|
||||||
.append(notify.getOldStatus().getIcon()).append(" ").append(notify.getOldStatus()).append(Icons.ARROW).append(notify.getNewStatus().getIcon()).append(" ").append(notify.getNewStatus())
|
|
||||||
.append(Icons.HR);
|
.append(Icons.HR);
|
||||||
|
|
||||||
final Optional<String> optProjectName = projectService.getProjectNameById(notify.getProjectId())
|
final Optional<String> optProjectName = projectService.getProjectNameById(notify.getProjectId())
|
||||||
.map(Strings::escapeMarkdown);
|
.map(Strings::escapeMarkdown);
|
||||||
|
|
||||||
if (optProjectName.isPresent()) {
|
if (optProjectName.isPresent()) {
|
||||||
final String projectName = optProjectName.get();
|
final String projectName = optProjectName.get();
|
||||||
builder.append(Icons.PROJECT).append(": ").append(projectName).append("\n");
|
builder.append(Icons.PROJECT).append(": ").append(projectName).append("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
builder
|
builder
|
||||||
.append(Icons.TREE).append(": ").append(notify.getRefName());
|
.append(Icons.TREE).append(": ").append(notify.getRefName())
|
||||||
|
.append(Icons.HR)
|
||||||
|
.append(notify.getOldStatus().getIcon()).append(" ").append(notify.getOldStatus()).append(Icons.ARROW).append(notify.getNewStatus().getIcon()).append(" ").append(notify.getNewStatus());
|
||||||
|
|
||||||
|
|
||||||
return BoxAnswer.builder()
|
return BoxAnswer.builder()
|
||||||
.message(builder.toString())
|
.message(builder.toString())
|
||||||
|
Loading…
Reference in New Issue
Block a user