mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 10:54:11 -04:00
New template button takes user to new template page
for all services that only allow sending one type of notifications
This commit is contained in:
@@ -153,19 +153,20 @@
|
||||
return changed;
|
||||
};
|
||||
|
||||
this.$broadcastService = (document.querySelector('div[id=add_new_template_form]')).getAttribute("data-broadcast")
|
||||
this.$singleNotificationChannel = (document.querySelector('div[id=add_new_template_form]')).getAttribute("data-channel");
|
||||
this.$singleChannelService = (document.querySelector('div[id=add_new_template_form]')).getAttribute("data-service");
|
||||
|
||||
this.actionButtonClicked = function(event) {
|
||||
event.preventDefault();
|
||||
this.currentState = $(event.currentTarget).val();
|
||||
|
||||
if (event.currentTarget.value === 'add-new-template' && this.$broadcastService) {
|
||||
return window.location = "/services/" + this.$broadcastService + "/templates/add-broadcast";
|
||||
if (event.currentTarget.value === 'add-new-template' && this.$singleNotificationChannel) {
|
||||
window.location = "/services/" + this.$singleChannelService + "/templates/add-" + this.$singleNotificationChannel;
|
||||
} else {
|
||||
if (this.stateChanged()) {
|
||||
this.render();
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.selectionStatus = {
|
||||
|
||||
Reference in New Issue
Block a user