From 4740b21f66bcc5378af68b8893f21555e7a37601 Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Mon, 30 Nov 2015 09:24:34 -0500 Subject: [PATCH] Wrapped the SourceChange call in a function so that it can be called without clearing the credential. This fixes a bug where the credential was not showing up in the initial edit dialog even though the data was sent properly via the API. --- awx/ui/client/src/helpers/Groups.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/helpers/Groups.js b/awx/ui/client/src/helpers/Groups.js index 4d7fb0487c..6c2bd6a6c5 100644 --- a/awx/ui/client/src/helpers/Groups.js +++ b/awx/ui/client/src/helpers/Groups.js @@ -790,6 +790,11 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name ParseTypeChange({ scope: properties_scope, field_id: textareaID, onReady: waitStop }); } + function initSourceChange() { + parent_scope.showSchedulesTab = (mode === 'edit' && sources_scope.source && sources_scope.source.value!=="manual") ? true : false; + SourceChange({ scope: sources_scope, form: SourceForm }); + } + // Set modal dimensions based on viewport width ww = $(document).width(); wh = $('body').height(); @@ -1058,7 +1063,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name } } - sources_scope.sourceChange(); //set defaults that rely on source value + initSourceChange(); if (data.source_regions) { if (data.source === 'ec2' || @@ -1470,8 +1475,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', listGenerator.name if (sources_scope.credential_name_api_error) { delete sources_scope.credential_name_api_error; } - parent_scope.showSchedulesTab = (mode === 'edit' && sources_scope.source && sources_scope.source.value!=="manual") ? true : false; - SourceChange({ scope: sources_scope, form: SourceForm }); + initSourceChange(); }; };