diff --git a/frontend/app/components/Alerts/AlertForm.js b/frontend/app/components/Alerts/AlertForm.js index 17f377a99..2d9f26027 100644 --- a/frontend/app/components/Alerts/AlertForm.js +++ b/frontend/app/components/Alerts/AlertForm.js @@ -306,10 +306,10 @@ const AlertForm = (props) => {
props.edit({ msTeamsInput: selected })} + onChange={(selected) => props.edit({ msteamsInput: selected })} />
diff --git a/frontend/app/components/Dashboard/components/Alerts/AlertListItem.tsx b/frontend/app/components/Dashboard/components/Alerts/AlertListItem.tsx index 32e6ff3bc..217f05332 100644 --- a/frontend/app/components/Dashboard/components/Alerts/AlertListItem.tsx +++ b/frontend/app/components/Dashboard/components/Alerts/AlertListItem.tsx @@ -36,13 +36,31 @@ const getNotifyChannel = (alert: Record, webhooks: Array) => { ')' ); }; + const getMsTeamsChannels = () => { + return ( + ' (' + + alert.msteamsInput + .map((channelId: number) => { + return ( + webhooks.find((hook) => hook.webhookId === channelId && hook.type === 'msteams')?.name + ); + }) + .join(', ') + + ')' + ); + }; let str = ''; if (alert.slack) { str = 'Slack'; - str += alert.slackInput.length > 0 ? getSlackChannels() : ''; + if (alert.slackInput.length > 0) { + str += getSlackChannels(); + } } if (alert.msteams) { str = 'MS Teams' + if (alert.msteamsInput.length > 0) { + str += getMsTeamsChannels(); + } } if (alert.email) { str += (str === '' ? '' : ' and ') + (alert.emailInput.length > 1 ? 'Emails' : 'Email');