diff --git a/awx/ui/client/src/forms/Groups.js b/awx/ui/client/src/forms/Groups.js index a2a88ae6d8..b43783ce0f 100644 --- a/awx/ui/client/src/forms/Groups.js +++ b/awx/ui/client/src/forms/Groups.js @@ -312,7 +312,7 @@ export default return { notifications: { iterator: 'notification', - url: 'api/v1/notifiers/' + url: 'api/v1/notification_templates/' } }; } diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index fd3afd5b52..9ae3bea98f 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -383,7 +383,7 @@ export default }, notifications: { iterator: 'notification', - url: '/api/v1/notifiers/' + url: '/api/v1/notification_templates/' } }; } diff --git a/awx/ui/client/src/forms/Organizations.js b/awx/ui/client/src/forms/Organizations.js index 218b39f76b..5de0570ae6 100644 --- a/awx/ui/client/src/forms/Organizations.js +++ b/awx/ui/client/src/forms/Organizations.js @@ -92,7 +92,7 @@ export default }, notifications: { iterator: 'notification', - url: '/api/v1/notifiers/' + url: '/api/v1/notification_templates/' } }; } diff --git a/awx/ui/client/src/forms/Projects.js b/awx/ui/client/src/forms/Projects.js index 5599683b06..b18e2f60f2 100644 --- a/awx/ui/client/src/forms/Projects.js +++ b/awx/ui/client/src/forms/Projects.js @@ -277,7 +277,7 @@ angular.module('ProjectFormDefinition', ['SchedulesListDefinition']) }, notifications: { iterator: 'notification', - url: '/api/v1/notifiers/' + url: '/api/v1/notification_templates/' } }; } diff --git a/awx/ui/client/src/management-jobs/notifications/notification.controller.js b/awx/ui/client/src/management-jobs/notifications/notification.controller.js index 7cd1d8ea00..89734ed6f5 100644 --- a/awx/ui/client/src/management-jobs/notifications/notification.controller.js +++ b/awx/ui/client/src/management-jobs/notifications/notification.controller.js @@ -17,7 +17,7 @@ export default $compile, $filter, ToggleNotification, NotificationsListInit, $stateParams, management_job) { var scope = $rootScope.$new(), - url = GetBasePath('notifiers'), + url = GetBasePath('notification_templates'), defaultUrl = GetBasePath('system_job_templates'), list = NotificationsList, view = GenerateList, diff --git a/awx/ui/client/src/notifications/add/add.controller.js b/awx/ui/client/src/notifications/add/add.controller.js index 35511adf44..ec7f1fdb24 100644 --- a/awx/ui/client/src/notifications/add/add.controller.js +++ b/awx/ui/client/src/notifications/add/add.controller.js @@ -19,7 +19,7 @@ export default ) { var generator = GenerateForm, form = NotificationsFormObject, - url = GetBasePath('notifiers'); + url = GetBasePath('notification_templates'); generator.inject(form, { mode: 'add' , @@ -40,7 +40,7 @@ export default } } CreateSelect2({ - element: '#notifier_notification_type', + element: '#notification_template_notification_type', multiple: false }); }); @@ -66,7 +66,7 @@ export default for(var fld in form.fields){ if(form.fields[fld] && form.fields[fld].subForm){ $scope[fld] = null; - $scope.notifier_form[fld].$setPristine(); + $scope.notification_template_form[fld].$setPristine(); } } diff --git a/awx/ui/client/src/notifications/add/add.route.js b/awx/ui/client/src/notifications/add/add.route.js index 7b464e2edb..a6270d5412 100644 --- a/awx/ui/client/src/notifications/add/add.route.js +++ b/awx/ui/client/src/notifications/add/add.route.js @@ -18,6 +18,6 @@ export default { }, ncyBreadcrumb: { parent: 'notifications', - label: 'Create Notifier' + label: 'Create Notification Template' } }; diff --git a/awx/ui/client/src/notifications/edit/edit.controller.js b/awx/ui/client/src/notifications/edit/edit.controller.js index 2e500b4b94..8a0577f14c 100644 --- a/awx/ui/client/src/notifications/edit/edit.controller.js +++ b/awx/ui/client/src/notifications/edit/edit.controller.js @@ -8,24 +8,24 @@ export default [ 'Rest', 'Wait', 'NotificationsFormObject', 'ProcessErrors', 'GetBasePath', 'GenerateForm', 'SearchInit' , 'PaginateInit', - 'LookUpInit', 'OrganizationList', 'notifier', + 'LookUpInit', 'OrganizationList', 'notification_template', '$scope', '$state', 'GetChoices', 'CreateSelect2', 'Empty', '$rootScope', 'NotificationsTypeChange', function( Rest, Wait, NotificationsFormObject, ProcessErrors, GetBasePath, GenerateForm, SearchInit, PaginateInit, - LookUpInit, OrganizationList, notifier, + LookUpInit, OrganizationList, notification_template, $scope, $state, GetChoices, CreateSelect2, Empty, $rootScope, NotificationsTypeChange ) { var generator = GenerateForm, - id = notifier.id, + id = notification_template.id, form = NotificationsFormObject, master = {}, - url = GetBasePath('notifiers'); + url = GetBasePath('notification_templates'); - $scope.notifier = notifier; + $scope.notification_template = notification_template; generator.inject(form, { mode: 'edit' , scope:$scope, @@ -81,7 +81,7 @@ export default master.notification_type = $scope.notification_type; CreateSelect2({ - element: '#notifier_notification_type', + element: '#notification_template_notification_typex', multiple: false }); NotificationsTypeChange.getDetailFields($scope.notification_type.value).forEach(function(field) { @@ -115,7 +115,7 @@ export default for(var fld in form.fields){ if(form.fields[fld] && form.fields[fld].subForm){ $scope[fld] = null; - $scope.notifier_form[fld].$setPristine(); + $scope.notification_template_form[fld].$setPristine(); } } @@ -162,7 +162,7 @@ export default }) .error(function (data, status) { ProcessErrors($scope, data, status, form, { hdr: 'Error!', - msg: 'Failed to add new notifier. POST returned status: ' + status }); + msg: 'Failed to add new notification template. POST returned status: ' + status }); }); }; diff --git a/awx/ui/client/src/notifications/edit/edit.route.js b/awx/ui/client/src/notifications/edit/edit.route.js index 7c2954f7d3..40071d6e40 100644 --- a/awx/ui/client/src/notifications/edit/edit.route.js +++ b/awx/ui/client/src/notifications/edit/edit.route.js @@ -8,11 +8,11 @@ import {templateUrl} from '../../shared/template-url/template-url.factory'; export default { name: 'notifications.edit', - route: '/:notifier_id', + route: '/:notification_template_id', templateUrl: templateUrl('notifications/edit/edit'), controller: 'notificationsEditController', resolve: { - notifier: + notification_template: [ '$state', '$stateParams', '$q', @@ -20,13 +20,13 @@ export default { 'GetBasePath', 'ProcessErrors', function($state, $stateParams, $q, rest, getBasePath, ProcessErrors) { - if ($stateParams.notifier) { - return $q.when($stateParams.notifier); + if ($stateParams.notification_template) { + return $q.when($stateParams.notification_template); } - var notifierId = $stateParams.notifier_id; + var notificationTemplateId = $stateParams.notification_template_id; - var url = getBasePath('notifiers') + notifierId + '/'; + var url = getBasePath('notification_templates') + notificationTemplateId + '/'; rest.setUrl(url); return rest.get() .then(function(data) { @@ -43,6 +43,6 @@ export default { }, ncyBreadcrumb: { parent: 'notifications', - label: 'Edit Notifier' + label: 'Edit Notification Template' } }; diff --git a/awx/ui/client/src/notifications/notification-templates-list/list.controller.js b/awx/ui/client/src/notifications/notification-templates-list/list.controller.js index fb1004cb27..6c6aefb133 100644 --- a/awx/ui/client/src/notifications/notification-templates-list/list.controller.js +++ b/awx/ui/client/src/notifications/notification-templates-list/list.controller.js @@ -15,7 +15,7 @@ export default ProcessErrors, Prompt, $state, GetChoices, Empty, Find, ngToast, $compile, $filter) { var scope = $rootScope.$new(), - defaultUrl = GetBasePath('notifiers'), + defaultUrl = GetBasePath('notification_templates'), list = NotificationTemplatesList, view = GenerateList; @@ -30,12 +30,12 @@ export default } scope.removePostRefresh = scope.$on('PostRefresh', function () { Wait('stop'); - if (scope.notifiers) { - scope.notifiers.forEach(function(notifier, i) { + if (scope.notification_templates) { + scope.notification_templates.forEach(function(notification_template, i) { scope.notification_type_options.forEach(function(type) { - if (type.value === notifier.notification_type) { - scope.notifiers[i].notification_type = type.label; - scope.notifiers[i].status = notifier.summary_fields.recent_notifications[0].status; + if (type.value === notification_template.notification_type) { + scope.notification_templates[i].notification_type = type.label; + scope.notification_templates[i].status = notification_template.summary_fields.recent_notifications[0].status; } }); }); @@ -50,7 +50,7 @@ export default SearchInit({ scope: scope, - set: 'notifiers', + set: 'notification_templates', list: list, url: defaultUrl }); @@ -117,9 +117,9 @@ export default var recent_notifications, html, title = "Recent Notifications"; - scope.notifiers.forEach(function(notifier){ - if(notifier.id === id){ - recent_notifications = notifier.summary_fields.recent_notifications; + scope.notification_templates.forEach(function(notification_template){ + if(notification_template.id === id){ + recent_notifications = notification_template.summary_fields.recent_notifications; } }); Wait('stop'); @@ -150,8 +150,8 @@ export default }; scope.testNotification = function(){ - var name = this.notifier.name; - Rest.setUrl(defaultUrl + this.notifier.id +'/test/'); + var name = this.notification_template.name; + Rest.setUrl(defaultUrl + this.notification_template.id +'/test/'); Rest.post({}) .then(function () { ngToast.success({ @@ -172,8 +172,8 @@ export default scope.editNotification = function(){ $state.transitionTo('notifications.edit',{ - notifier_id: this.notifier.id, - notifier: this.notifier + notification_template_id: this.notification_template.id, + notification_template: this.notification_templates }); }; diff --git a/awx/ui/client/src/notifications/notificationTemplates.form.js b/awx/ui/client/src/notifications/notificationTemplates.form.js index 926671bf54..89abfb36a4 100644 --- a/awx/ui/client/src/notifications/notificationTemplates.form.js +++ b/awx/ui/client/src/notifications/notificationTemplates.form.js @@ -15,7 +15,7 @@ export default function() { addTitle: 'New Notification Template', editTitle: '{{ name }}', - name: 'notifier', + name: 'notification_template', showActions: true, subFormTitles: { typeSubForm: 'Type Details', diff --git a/awx/ui/client/src/notifications/notificationTemplates.list.js b/awx/ui/client/src/notifications/notificationTemplates.list.js index a7ed5fa751..3d90e237b5 100644 --- a/awx/ui/client/src/notifications/notificationTemplates.list.js +++ b/awx/ui/client/src/notifications/notificationTemplates.list.js @@ -8,9 +8,9 @@ export default function(){ return { - name: 'notifiers' , + name: 'notification_templates' , listTitle: 'Notification Templates', - iterator: 'notifier', + iterator: 'notification_template', index: false, hover: false, @@ -24,10 +24,10 @@ export default function(){ iconOnly: true, excludeModal: true, icons: [{ - icon: "{{ 'icon-job-' + notifier.status }}", + icon: "{{ 'icon-job-' + notification_template.status }}", awToolTip: "Click for recent notifications", awTipPlacement: "right", - ngClick: "showSummary($event, notifier.id)", + ngClick: "showSummary($event, notification_templates.id)", ngClass: "" }] }, @@ -35,7 +35,7 @@ export default function(){ key: true, label: 'Name', columnClass: 'col-md-3 col-sm-9 col-xs-9', - linkTo: '/#/notifications/{{notifier.id}}' + linkTo: '/#/notifications/{{notification_template.id}}' }, notification_type: { label: 'Type', @@ -60,7 +60,7 @@ export default function(){ columnClass: 'col-md-2 col-sm-3 col-xs-3', test: { - ngClick: "testNotification(notification.id)", + ngClick: "testNotification(notification_template.id)", icon: 'fa-bell-o', label: 'Edit', "class": 'btn-sm', @@ -68,7 +68,7 @@ export default function(){ dataPlacement: 'top' }, edit: { - ngClick: "editNotification(notification.id)", + ngClick: "editNotification(notification_template.id)", icon: 'fa-edit', label: 'Edit', "class": 'btn-sm', @@ -76,7 +76,7 @@ export default function(){ dataPlacement: 'top' }, "delete": { - ngClick: "deleteNotification(notifier.id, notifier.name)", + ngClick: "deleteNotification(notification_template.id, notification_template.name)", icon: 'fa-trash', label: 'Delete', "class": 'btn-sm', diff --git a/awx/ui/client/src/notifications/notifications.list.js b/awx/ui/client/src/notifications/notifications.list.js index b2943d8efc..e61e2e9007 100644 --- a/awx/ui/client/src/notifications/notifications.list.js +++ b/awx/ui/client/src/notifications/notifications.list.js @@ -26,23 +26,23 @@ export default function(){ excludeModal: true, columnClass: 'col-md-4 hidden-sm hidden-xs' }, - notifiers_success: { + notification_templates_success: { label: 'Successful', - flag: 'notifiers_success', + flag: 'notification_templates_success', type: "toggle", - ngClick: "toggleNotification($event, notification.id, \"notifiers_success\")", + ngClick: "toggleNotification($event, notification.id, \"notification_templates_success\")", awToolTip: "{{ schedule.play_tip }}", dataTipWatch: "schedule.play_tip", dataPlacement: "right", searchable: false, nosort: true, }, - notifiers_error: { + notification_templates_error: { label: 'Failed', columnClass: 'NotifierList-lastColumn', - flag: 'notifiers_error', + flag: 'notification_templates_error', type: "toggle", - ngClick: "toggleNotification($event, notification.id, \"notifiers_error\")", + ngClick: "toggleNotification($event, notification.id, \"notification_templates_error\")", awToolTip: "{{ schedule.play_tip }}", dataTipWatch: "schedule.play_tip", dataPlacement: "right", 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 55935f6f2e..2de46870c0 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 @@ -25,14 +25,14 @@ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', scope.relatednotificationsRemove(); } scope.relatednotificationsRemove = scope.$on('relatednotifications', function () { - var columns = ['/notifiers_success/', '/notifiers_error/']; + var columns = ['/notification_templates_success/', '/notification_templates_error/']; _.map(columns, function(column){ var notifier_url = url + id + column; Rest.setUrl(notifier_url); Rest.get() .success( function(data, i, j, obj) { - var type = (obj.url.indexOf('success')>0) ? "notifiers_success" : "notifiers_error"; + var type = (obj.url.indexOf('success')>0) ? "notification_templates_success" : "notification_templates_error"; if (data.results) { _.forEach(data.results, function(result){ _.forEach(scope.notifications, function(notification){ diff --git a/awx/ui/client/src/notifications/shared/toggle-notification.factory.js b/awx/ui/client/src/notifications/shared/toggle-notification.factory.js index 85d8c41822..2bbe8e2ff5 100644 --- a/awx/ui/client/src/notifications/shared/toggle-notification.factory.js +++ b/awx/ui/client/src/notifications/shared/toggle-notification.factory.js @@ -22,7 +22,7 @@ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', id = params.id, notifier_id = params.notifier.id, callback = params.callback, - column = params.column, // notifiers_success/notifiers_error + column = params.column, // notification_template_success/notification_template__error url = params.url+ id+ "/"+ column + '/'; if(!notifier[column]){