From 4c3c4ad1b40e5c259a1d889f7e4319b661bda9e2 Mon Sep 17 00:00:00 2001 From: Ross Murphy Date: Tue, 16 Jul 2024 17:05:38 +0100 Subject: [PATCH 1/3] add ability to test notification publishers Signed-off-by: Ross Murphy --- .../EmailTestConfigurationModal.vue | 2 +- .../administration/notifications/Alerts.vue | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/views/administration/configuration/EmailTestConfigurationModal.vue b/src/views/administration/configuration/EmailTestConfigurationModal.vue index 605e5df3f..d14682570 100644 --- a/src/views/administration/configuration/EmailTestConfigurationModal.vue +++ b/src/views/administration/configuration/EmailTestConfigurationModal.vue @@ -47,7 +47,7 @@ export default { }, methods: { testConfiguration: function () { - let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/smtp`; + let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/email`; const params = new URLSearchParams(); params.append('destination', this.emailAddress); this.axios diff --git a/src/views/administration/notifications/Alerts.vue b/src/views/administration/notifications/Alerts.vue index dd8cc3556..0d17d5586 100644 --- a/src/views/administration/notifications/Alerts.vue +++ b/src/views/administration/notifications/Alerts.vue @@ -208,6 +208,7 @@ export default {
+ {{ $t('admin.perform_test') }} @@ -395,6 +396,27 @@ export default { this.$toastr.w(this.$t('condition.unsuccessful_action')); }); }, + testNotification: function () { + let publisherName = row.publisher.name; + let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/${publisherName.toLowerCase().replace(/ /g, '_')}`; + + let params = new URLSearchParams(); + params.append('destination', this.destination); + + this.axios + .post(url, params, { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + }) + .then((response) => { + this.alert = response.data; + this.$toastr.s(this.$t('admin.test_notification_queued')); + }) + .catch((error) => { + this.$toastr.w(this.$t('condition.unsuccessful_action')); + }); + }, updateProjectSelection: function (selections) { this.$root.$emit('bv::hide::modal', 'selectProjectModal'); for (let i = 0; i < selections.length; i++) { From 17f44da18676063e8ba0cf90728cd9dd07c1b0ef Mon Sep 17 00:00:00 2001 From: Ross Murphy Date: Tue, 16 Jul 2024 19:25:53 +0100 Subject: [PATCH 2/3] change button style Signed-off-by: Ross Murphy --- src/views/administration/notifications/Alerts.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/administration/notifications/Alerts.vue b/src/views/administration/notifications/Alerts.vue index 0d17d5586..de43d1c61 100644 --- a/src/views/administration/notifications/Alerts.vue +++ b/src/views/administration/notifications/Alerts.vue @@ -208,7 +208,7 @@ export default {
- {{ $t('admin.perform_test') }} + {{ $t('admin.perform_test') }} From 7d8c918d2143e7c3a433aae1232716ec1a921cbe Mon Sep 17 00:00:00 2001 From: Ross Murphy Date: Tue, 13 Aug 2024 01:42:54 +0100 Subject: [PATCH 3/3] revert smtp and add /test/uuid to alert Signed-off-by: Ross Murphy --- .../configuration/EmailTestConfigurationModal.vue | 2 +- src/views/administration/notifications/Alerts.vue | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/views/administration/configuration/EmailTestConfigurationModal.vue b/src/views/administration/configuration/EmailTestConfigurationModal.vue index d14682570..605e5df3f 100644 --- a/src/views/administration/configuration/EmailTestConfigurationModal.vue +++ b/src/views/administration/configuration/EmailTestConfigurationModal.vue @@ -47,7 +47,7 @@ export default { }, methods: { testConfiguration: function () { - let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/email`; + let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/smtp`; const params = new URLSearchParams(); params.append('destination', this.emailAddress); this.axios diff --git a/src/views/administration/notifications/Alerts.vue b/src/views/administration/notifications/Alerts.vue index de43d1c61..a5c2ae75d 100644 --- a/src/views/administration/notifications/Alerts.vue +++ b/src/views/administration/notifications/Alerts.vue @@ -397,8 +397,7 @@ export default { }); }, testNotification: function () { - let publisherName = row.publisher.name; - let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/${publisherName.toLowerCase().replace(/ /g, '_')}`; + let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/${this.uuid}`; let params = new URLSearchParams(); params.append('destination', this.destination);