From de6d72ff3cde8da0d9e4cb49ecd6e885eeeaf90e Mon Sep 17 00:00:00 2001 From: Veikkosuhonen Date: Fri, 22 Dec 2023 18:54:48 +0200 Subject: [PATCH] feat: Add cfb & cfb digest mail settings to fbt logs --- src/client/pages/FeedbackTarget/tabs/Logs/Logs.js | 12 ++++++++++++ src/server/services/auditLog/feedbackTargetLogs.js | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/src/client/pages/FeedbackTarget/tabs/Logs/Logs.js b/src/client/pages/FeedbackTarget/tabs/Logs/Logs.js index 18553e608..ead9765da 100644 --- a/src/client/pages/FeedbackTarget/tabs/Logs/Logs.js +++ b/src/client/pages/FeedbackTarget/tabs/Logs/Logs.js @@ -77,6 +77,18 @@ const getLogMessage = data => { messages = messages.concat(`Sent feedback response email`) } + if (data.continuousFeedbackEnabled !== undefined) { + messages = data.continuousFeedbackEnabled + ? messages.concat(`Enabled continuous feedback`) + : messages.concat(`Disabled continuous feedback`) + } + + if (data.sendContinuousFeedbackDigestEmails !== undefined) { + messages = data.sendContinuousFeedbackDigestEmails + ? messages.concat(`Enabled continuous feedback digest mail`) + : messages.concat(`Disabled continuous feedback digest mail`) + } + if (data.mockedBy) { messages = messages.concat(`(Mocked by ${data.mockedBy})`) } diff --git a/src/server/services/auditLog/feedbackTargetLogs.js b/src/server/services/auditLog/feedbackTargetLogs.js index f39ac404e..a4fe2f05e 100644 --- a/src/server/services/auditLog/feedbackTargetLogs.js +++ b/src/server/services/auditLog/feedbackTargetLogs.js @@ -87,6 +87,14 @@ const createFeedbackTargetLog = async (feedbackTarget, updates, user) => { data.openImmediately = updates.openImmediately } + if (updates.continuousFeedbackEnabled !== undefined) { + data.continuousFeedbackEnabled = updates.continuousFeedbackEnabled + } + + if (updates.sendContinuousFeedbackDigestEmails !== undefined) { + data.sendContinuousFeedbackDigestEmails = updates.sendContinuousFeedbackDigestEmails + } + if (Object.keys(data).length === 0) return await createFromData(feedbackTarget.id, user, data)