Skip to content

Commit

Permalink
Merge pull request #949 from 2000rosser/notification-test
Browse files Browse the repository at this point in the history
Add ability to test notification publishers
  • Loading branch information
nscuro authored Aug 15, 2024
2 parents 55be860 + 7d8c918 commit 86ee63f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/views/administration/notifications/Alerts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export default {
</div>
</b-form-group>
<div style="text-align:right">
<b-button variant="outline-primary" @click="testNotification">{{ $t('admin.perform_test') }}</b-button>
<b-toggleable-display-button variant="outline-primary" :label="$t('admin.limit_to')"
v-permission="PERMISSIONS.VIEW_PORTFOLIO" v-on:toggle="limitToVisible = !limitToVisible"
v-if="this.scope === 'PORTFOLIO'" />
Expand Down Expand Up @@ -395,6 +396,26 @@ export default {
this.$toastr.w(this.$t('condition.unsuccessful_action'));
});
},
testNotification: function () {
let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/${this.uuid}`;
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++) {
Expand Down

0 comments on commit 86ee63f

Please sign in to comment.