diff --git a/awx/ui/client/src/notifications/notificationTemplates.list.js b/awx/ui/client/src/notifications/notificationTemplates.list.js index a19795946c..7f3780f959 100644 --- a/awx/ui/client/src/notifications/notificationTemplates.list.js +++ b/awx/ui/client/src/notifications/notificationTemplates.list.js @@ -3,8 +3,10 @@ * * All Rights Reserved *************************************************/ - - + /** + * This is the list definition for the notification templates list + * off of the settings page + */ export default function(){ return { diff --git a/awx/ui/client/src/notifications/notifications.list.js b/awx/ui/client/src/notifications/notifications.list.js index a9514f3071..553d125656 100644 --- a/awx/ui/client/src/notifications/notifications.list.js +++ b/awx/ui/client/src/notifications/notifications.list.js @@ -3,6 +3,10 @@ * * All Rights Reserved *************************************************/ + /** + * This is the list definition for the notification templates list + * used in the related tabs + */ export default function(){ return { @@ -53,6 +57,16 @@ export default function(){ searchable: false, nosort: true, } + }, + actions: { + add: { + label: 'Add Notification', + mode: 'all', // One of: edit, select, all + ngClick: 'addNotificationTemplate()', + awToolTip: 'Create a new notification template', + actionClass: 'btn List-buttonSubmit', + buttonContent: '+ ADD NOTIFICATION TEMPLATE' + } } }; diff --git a/awx/ui/client/src/notifications/shared/notification-list-init.factory.js b/awx/ui/client/src/notifications/shared/notification-list-init.factory.js index fa072c701c..fec995dd70 100644 --- a/awx/ui/client/src/notifications/shared/notification-list-init.factory.js +++ b/awx/ui/client/src/notifications/shared/notification-list-init.factory.js @@ -15,12 +15,17 @@ */ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', 'GetChoices', - function(Wait, GetBasePath, ProcessErrors, Rest, GetChoices) { + '$state', + function(Wait, GetBasePath, ProcessErrors, Rest, GetChoices, $state) { return function(params) { var scope = params.scope, url = params.url, id = params.id; + scope.addNotificationTemplate = function(){ + $state.go('notifications.add'); + } + if (scope.relatednotificationsRemove) { scope.relatednotificationsRemove(); }