Skip to content

Commit

Permalink
Merge pull request #147 from DependencyTrack/port-notification-test
Browse files Browse the repository at this point in the history
Port : Add ability to test notification publishers
  • Loading branch information
nscuro authored Sep 26, 2024
2 parents f20bada + 75c74a7 commit c93d1c8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/views/administration/notifications/Alerts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,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 @@ -412,6 +413,24 @@ 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 c93d1c8

Please sign in to comment.