From 5fd0aa34309c0db83867a2f5c7ad0ad23a573b0f Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Thu, 26 May 2016 15:31:24 -0400 Subject: [PATCH] fix adding/editing of HipChat notification templates, resolves #1934 --- .../notificationTemplates.form.js | 24 ++++++++++++++----- .../shared/type-change.service.js | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/awx/ui/client/src/notifications/notificationTemplates.form.js b/awx/ui/client/src/notifications/notificationTemplates.form.js index 356efba43b..bc842d9f7b 100644 --- a/awx/ui/client/src/notifications/notificationTemplates.form.js +++ b/awx/ui/client/src/notifications/notificationTemplates.form.js @@ -141,7 +141,23 @@ export default function() { reqExpression: "channel_required", init: "false" }, - ngShow: "notification_type.value == 'slack' || notification_type.value == 'hipchat'", + ngShow: "notification_type.value == 'slack'", + subForm: 'typeSubForm' + }, + rooms: { + label: 'Destination Channels', + type: 'textarea', + rows: 3, + awPopOver: '

Type an option on each line. The pound symbol (#) is not required.

'+ + '

For example:
engineering
\n #support
\n', + dataTitle: 'Destination Channels', + dataPlacement: 'right', + dataContainer: "body", + awRequiredWhen: { + reqExpression: "room_required", + init: "false" + }, + ngShow: "notification_type.value == 'hipchat'", subForm: 'typeSubForm' }, token: { @@ -264,11 +280,7 @@ export default function() { }, notify: { label: 'Notify Channel', - type: 'text', - awRequiredWhen: { - reqExpression: "hipchat_required", - init: "false" - }, + type: 'checkbox', ngShow: "notification_type.value == 'hipchat' ", subForm: 'typeSubForm' }, 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 1ac44d6f53..b48a4b37f3 100644 --- a/awx/ui/client/src/notifications/shared/type-change.service.js +++ b/awx/ui/client/src/notifications/shared/type-change.service.js @@ -39,7 +39,7 @@ function () { case 'hipchat': obj.tokenLabel = ' Token'; obj.hipchat_required = true; - obj.channel_required = true; + obj.room_required = true; obj.token_required = true; break; case 'twilio':