Skip to content

Commit 5696d31

Browse files
Merge pull request #26 from matomo-org/PG-5045-separate-alert-message
Separate alert message for Custom Alerts screen
2 parents ffa8714 + 92da4c0 commit 5696d31

4 files changed

Lines changed: 9 additions & 2 deletions

File tree

MicrosoftTeams.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public function addJsGlobalVariables(&$out)
100100
}
101101

102102
$out .= 'var msTeamsShouldShowWebhookNotification = ' . json_encode($shouldShowNotification) . ';';
103+
$out .= 'var msTeamsAlertModule = ' . json_encode($module) . ';';
103104
}
104105

105106
public function getClientSideTranslationKeys(&$translationKeys)
@@ -115,6 +116,7 @@ public function getClientSideTranslationKeys(&$translationKeys)
115116
$translationKeys[] = 'MicrosoftTeams_TenantIdDescription';
116117
$translationKeys[] = 'MicrosoftTeams_TeamsEnterYourWebhookUrlText';
117118
$translationKeys[] = 'MicrosoftTeams_MicrosoftTeamsWebhookUrlDeprecatedNoticeText';
119+
$translationKeys[] = 'MicrosoftTeams_MicrosoftTeamsWebhookUrlDeprecatedNoticeTextCustomAlerts';
118120
}
119121

120122
/**

javascripts/alertNotification.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ $(function () {
55
if (window.msTeamsShouldShowWebhookNotification) {
66
var UI = require('piwik/UI');
77
var notification = new UI.Notification();
8-
var message = _pk_translate('MicrosoftTeams_MicrosoftTeamsWebhookUrlDeprecatedNoticeText', ['<a href="https://matomo.org/faq/reports/how-to-get-microsoft-teams-webhook-url/" target="_blank" rel="noreferrer noopener">', '</a>'])
8+
var translationKey = 'MicrosoftTeams_MicrosoftTeamsWebhookUrlDeprecatedNoticeText';
9+
if (window.msTeamsAlertModule && window.msTeamsAlertModule === 'CustomAlerts') {
10+
translationKey = 'MicrosoftTeams_MicrosoftTeamsWebhookUrlDeprecatedNoticeTextCustomAlerts';
11+
}
12+
var message = _pk_translate(translationKey, ['<a href="https://matomo.org/faq/reports/how-to-get-microsoft-teams-webhook-url/" target="_blank" rel="noreferrer noopener">', '</a>'])
913
notification.show(message,{
1014
context: 'warning',
1115
id: 'msTeamsDeprecatedNotification'

lang/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"PleaseFindYourReport": "Here is your %1$s report for %2$s.",
2020
"MicrosoftTeamsAlertContent": "%1$s has been triggered for website %2$s as the metric %3$s in report %4$s %5$s.",
2121
"ClientSecretExpiryNote": "%1$sNote:%2$s The client secret is scheduled to expire on %3$s. Please generate a new token and update it in Matomo to ensure uninterrupted scheduled reports.",
22-
"MicrosoftTeamsWebhookUrlDeprecatedNoticeText": "Your Microsoft Teams report is using an outdated webhook URL. Follow this %1$sguide%2$s to create a new one."
22+
"MicrosoftTeamsWebhookUrlDeprecatedNoticeText": "Your Microsoft Teams report is using an outdated webhook URL. Follow this %1$sguide%2$s to create a new one.",
23+
"MicrosoftTeamsWebhookUrlDeprecatedNoticeTextCustomAlerts": "Your Microsoft Teams alert is using an outdated webhook URL. Follow this %1$sguide%2$s to create a new one."
2324
}
2425
}
-82 Bytes
Loading

0 commit comments

Comments
 (0)