Skip to content

Commit

Permalink
feat: Add cfb & cfb digest mail settings to fbt logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Veikkosuhonen committed Dec 22, 2023
1 parent 54f3951 commit de6d72f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/client/pages/FeedbackTarget/tabs/Logs/Logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})`)
}
Expand Down
8 changes: 8 additions & 0 deletions src/server/services/auditLog/feedbackTargetLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit de6d72f

Please sign in to comment.