From 2196b03330fbce7b04c91f5ba41e6d439ccb1a02 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Wed, 1 Jun 2016 14:41:44 -0400 Subject: [PATCH] Fixed empty notification status as well as an issue with the form which prevented you from creating a notification due to a rogue required field. --- .../notification-templates-list/list.controller.js | 3 ++- awx/ui/client/src/notifications/shared/type-change.service.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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 90642e7f36..5c64299c70 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 @@ -31,7 +31,8 @@ export default scope.notification_type_options.forEach(function(type) { 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; + var recent_notifications = notification_template.summary_fields.recent_notifications; + scope.notification_templates[i].status = recent_notifications && recent_notifications.length > 0 ? recent_notifications[0].status : "none"; } }); }); diff --git a/awx/ui/client/src/notifications/shared/type-change.service.js b/awx/ui/client/src/notifications/shared/type-change.service.js index b48a4b37f3..e0f0d44d81 100644 --- a/awx/ui/client/src/notifications/shared/type-change.service.js +++ b/awx/ui/client/src/notifications/shared/type-change.service.js @@ -21,6 +21,7 @@ function () { obj.port_required = false; obj.password_required = false; obj.channel_required = false; + obj.room_required = false; switch (type) { case 'email': obj.portLabel = ' Port';