From 972fbb7c67e82347909c6aba0165cf517ec82c29 Mon Sep 17 00:00:00 2001 From: Alexandre Bourdin Date: Thu, 8 Aug 2024 14:29:47 +0200 Subject: [PATCH] Merge pull request #19818 from overleaf/ab-fix-split-test-archived-notification-comment [web] Skip sending last versions comment with archived test notification GitOrigin-RevId: 997111220161eaf7588cac8809024ac4a09bc037 --- .../app/src/Features/SplitTests/SlackNotificationManager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/Features/SplitTests/SlackNotificationManager.js b/services/web/app/src/Features/SplitTests/SlackNotificationManager.js index 7774b5fd9d..e90d4954b1 100644 --- a/services/web/app/src/Features/SplitTests/SlackNotificationManager.js +++ b/services/web/app/src/Features/SplitTests/SlackNotificationManager.js @@ -30,6 +30,10 @@ async function sendNotification(splitTest, action, user) { ].join('\n') const date = splitTest.archived ? splitTest.archivedAt : lastVersion.createdAt + const comment = + action !== 'archived' && lastVersion.comment + ? `with comment: ${lastVersion.comment}` + : '' const payload = { name: splitTest.name, @@ -41,7 +45,7 @@ async function sendNotification(splitTest, action, user) { active: lastVersion.active.toString(), author: user.email, date: moment(date).utc().format('Do MMM YYYY, h:mm a') + ' UTC', - comment: lastVersion.comment ? `with comment: ${lastVersion.comment}` : '', + comment, versionNumber: `${lastVersion.versionNumber}`, url: `${Settings.siteUrl}/admin/split-test/edit/${splitTest.name}`, }