Merge pull request #29738 from brianphillips/slack-notification-text
fix slack notification processor attachment blocks
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user