Merge pull request #29738 from brianphillips/slack-notification-text

fix slack notification processor attachment blocks
This commit is contained in:
Ben Lambert
2025-05-06 12:12:37 +02:00
committed by GitHub
3 changed files with 17 additions and 6 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-notifications-backend-module-slack': patch
---
Fix slack notification processor to handle a notification with an empty description
@@ -158,6 +158,10 @@ describe('SlackNotificationProcessor', () => {
blocks: [
{
type: 'section',
text: {
text: 'No description provided',
type: 'mrkdwn',
},
accessory: {
type: 'button',
text: {
@@ -229,6 +233,10 @@ describe('SlackNotificationProcessor', () => {
blocks: [
{
type: 'section',
text: {
text: 'No description provided',
type: 'mrkdwn',
},
accessory: {
type: 'button',
text: {
@@ -46,12 +46,10 @@ export function toSlackBlockKit(payload: NotificationPayload): KnownBlock[] {
return [
{
type: 'section',
...(description && {
text: {
type: 'mrkdwn',
text: description ?? 'No description provided',
},
}),
text: {
type: 'mrkdwn',
text: description ?? 'No description provided',
},
accessory: {
type: 'button',
text: {