From 885c5050a0e12712634cf631b382e8d87f6516d7 Mon Sep 17 00:00:00 2001 From: Keith Grant Date: Mon, 1 Jul 2019 15:01:57 -0700 Subject: [PATCH] re-init message templates on notification type change --- awx/ui/client/src/notifications/add/add.controller.js | 7 +++++++ awx/ui/client/src/notifications/edit/edit.controller.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/awx/ui/client/src/notifications/add/add.controller.js b/awx/ui/client/src/notifications/add/add.controller.js index 4716eb8a0c..e42b2dcf1f 100644 --- a/awx/ui/client/src/notifications/add/add.controller.js +++ b/awx/ui/client/src/notifications/add/add.controller.js @@ -164,6 +164,13 @@ export default ['Rest', 'Wait', 'NotificationsFormObject', }); } }); + $scope.$watch('notification_type', (value) => { + if (value) { + $scope.$broadcast('reset-code-mirror', { + customize_messages: $scope.customize_messages, + }); + } + }); $scope.emailOptionsChange = function () { if ($scope.email_options === 'use_ssl') { diff --git a/awx/ui/client/src/notifications/edit/edit.controller.js b/awx/ui/client/src/notifications/edit/edit.controller.js index 49c2c6a953..30c449b63d 100644 --- a/awx/ui/client/src/notifications/edit/edit.controller.js +++ b/awx/ui/client/src/notifications/edit/edit.controller.js @@ -258,6 +258,13 @@ export default ['Rest', 'Wait', }); } }); + $scope.$watch('notification_type', (value) => { + if (value) { + $scope.$broadcast('reset-code-mirror', { + customize_messages: $scope.customize_messages, + }); + } + }); $scope.emailOptionsChange = function () { if ($scope.email_options === 'use_ssl') {