1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

fix parseTypeChange params in Projects, Inventory Source, Job Templates extra vars fields, resolves #2866 (#2878)

This commit is contained in:
Leigh Johnson 2016-07-11 09:48:12 -04:00 committed by GitHub
parent 5599b3fd1e
commit 34523d59a2
2 changed files with 4 additions and 4 deletions

View File

@ -78,11 +78,11 @@ export default ['$compile', '$filter', '$state', '$stateParams', 'AddSchedule',
// extra_data field is not manifested in the UI when scheduling a Management Job
if ($state.current.name === 'jobTemplateSchedules.add'){
$scope.parseType = 'yaml';
// grab any existing extra_vars from parent job_template
var defaultUrl = GetBasePath('job_templates') + $stateParams.id + '/';
Rest.setUrl(defaultUrl);
Rest.get().then(function(res){
// sanitize
var data = JSON.parse(JSON.stringify(res.data.extra_vars));
var data = res.data.extra_vars;
$scope.extraVars = data === '' ? '---' : data;
ParseTypeChange({
scope: $scope,

View File

@ -630,8 +630,8 @@
</a>
<div class="parse-selection">
<input type="radio" ng-model="parseType" ng-change="parseTypeChange()" value="yaml"><span class="parse-label">YAML</span>
<input type="radio" ng-model="parseType" ng-change="parseTypeChange()" value="json"> <span class="parse-label">JSON</span>
<input type="radio" ng-model="parseType" ng-change="parseTypeChange('parseType', 'extraVars')" value="yaml"><span class="parse-label">YAML</span>
<input type="radio" ng-model="parseType" ng-change="parseTypeChange('parseType', 'extraVars')" value="json"> <span class="parse-label">JSON</span>
</div>
</label>