mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 14:27:42 -02:30
fix parseTypeChange params in Projects, Inventory Source, Job Templates extra vars fields, resolves #2866 (#2878)
This commit is contained in:
@@ -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
|
// extra_data field is not manifested in the UI when scheduling a Management Job
|
||||||
if ($state.current.name === 'jobTemplateSchedules.add'){
|
if ($state.current.name === 'jobTemplateSchedules.add'){
|
||||||
$scope.parseType = 'yaml';
|
$scope.parseType = 'yaml';
|
||||||
|
// grab any existing extra_vars from parent job_template
|
||||||
var defaultUrl = GetBasePath('job_templates') + $stateParams.id + '/';
|
var defaultUrl = GetBasePath('job_templates') + $stateParams.id + '/';
|
||||||
Rest.setUrl(defaultUrl);
|
Rest.setUrl(defaultUrl);
|
||||||
Rest.get().then(function(res){
|
Rest.get().then(function(res){
|
||||||
// sanitize
|
var data = res.data.extra_vars;
|
||||||
var data = JSON.parse(JSON.stringify(res.data.extra_vars));
|
|
||||||
$scope.extraVars = data === '' ? '---' : data;
|
$scope.extraVars = data === '' ? '---' : data;
|
||||||
ParseTypeChange({
|
ParseTypeChange({
|
||||||
scope: $scope,
|
scope: $scope,
|
||||||
|
|||||||
@@ -630,8 +630,8 @@
|
|||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="parse-selection">
|
<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('parseType', 'extraVars')" 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="json"> <span class="parse-label">JSON</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user