From 90ae15f3baa06c642211f15044ec300c878655c7 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Thu, 12 Jun 2014 15:35:23 -0400 Subject: [PATCH] AC-1286 host config key dialog Now the dialog only appears on job template save when the host config key or URL actually change. Before the dialog always appeared when allow callbacks was enabled. --- awx/ui/static/js/controllers/JobTemplates.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js index 41174bc068..d00993c5bc 100644 --- a/awx/ui/static/js/controllers/JobTemplates.js +++ b/awx/ui/static/js/controllers/JobTemplates.js @@ -710,10 +710,19 @@ function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, $routeP } $scope.removeTemplateSaveSuccess = $scope.$on('templateSaveSuccess', function(e, data) { Wait('stop'); - if (data.related && data.related.callback) { - Alert('Callback URL', '

Host callbacks are enabled for this template. The callback URL is:

'+ - '

' + $scope.callback_server_path + data.related.callback + '

'+ - '

The host configuration key is: ' + data.host_config_key + '

', 'alert-info', saveCompleted); + if ($scope.allow_callbacks && ($scope.host_config_key !== master.host_config_key || $scope.callback_url !== master.callback_url)) { + console.log('host_config_key: ' + $scope.host_config_key); + console.log('master_host_config_key: ' + master.host_config_key); + console.log('callback_url: ' + $scope.callback_url); + console.log('master_callback_url: ' + master.callback_url); + if (data.related && data.related.callback) { + Alert('Callback URL', '

Host callbacks are enabled for this template. The callback URL is:

'+ + '

' + $scope.callback_server_path + data.related.callback + '

'+ + '

The host configuration key is: ' + data.host_config_key + '

', 'alert-info', saveCompleted); + } + else { + saveCompleted(); + } } else { saveCompleted();