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:
Pea Tyczynska
2020-08-11 15:44:17 +01:00
parent bdfc0adcc0
commit 36c1ffa7be
5 changed files with 51 additions and 10 deletions

View File

@@ -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 = {