diff --git a/awx/ui/client/lib/components/code-mirror/code-mirror.directive.js b/awx/ui/client/lib/components/code-mirror/code-mirror.directive.js index 9d8a0fcfca..4ca2af09f2 100644 --- a/awx/ui/client/lib/components/code-mirror/code-mirror.directive.js +++ b/awx/ui/client/lib/components/code-mirror/code-mirror.directive.js @@ -73,6 +73,9 @@ function atCodeMirrorController ( return true; } + if (typeof str === 'undefined') { + return '---'; + } if (typeof str !== 'string') { const yamlStr = jsyaml.safeDump(str); // jsyaml.safeDump doesn't process an empty object correctly diff --git a/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js b/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js index 219cee0b07..e32e1d5374 100644 --- a/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js +++ b/awx/ui/client/src/inventories-hosts/hosts/edit/host-edit.controller.js @@ -5,8 +5,8 @@ *************************************************/ export default - ['$scope', '$state', '$stateParams', 'GenerateForm', 'ParseTypeChange', 'HostsService', 'host', '$rootScope', - function($scope, $state, $stateParams, GenerateForm, ParseTypeChange, HostsService, host, $rootScope){ + ['$scope', '$state', '$stateParams', 'GenerateForm', 'HostsService', 'host', '$rootScope', + function($scope, $state, $stateParams, GenerateForm, HostsService, host, $rootScope){ $scope.parseType = 'yaml'; $scope.formCancel = function(){ $state.go('^', null, {reload: true}); diff --git a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/add/host-add.controller.js b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/add/host-add.controller.js index 3513652a98..80105c6eaa 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/related/hosts/add/host-add.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/related/hosts/add/host-add.controller.js @@ -4,26 +4,18 @@ * All Rights Reserved *************************************************/ -export default ['$state', '$stateParams', '$scope', 'RelatedHostsFormDefinition', 'ParseTypeChange', +export default ['$state', '$stateParams', '$scope', 'RelatedHostsFormDefinition', 'GenerateForm', 'HostsService', 'GetBasePath', 'ToJSON', 'canAdd', - function($state, $stateParams, $scope, RelatedHostsFormDefinition, ParseTypeChange, + function($state, $stateParams, $scope, RelatedHostsFormDefinition, GenerateForm, HostsService, GetBasePath, ToJSON, canAdd) { init(); function init() { $scope.canAdd = canAdd; - $scope.parseType = 'yaml'; $scope.host = { enabled: true }; // apply form definition's default field values GenerateForm.applyDefaults(RelatedHostsFormDefinition, $scope); - - ParseTypeChange({ - scope: $scope, - field_id: 'host_host_variables', - variable: 'host_variables', - parse_variable: 'parseType' - }); } $scope.formCancel = function() { $state.go('^'); diff --git a/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/add/inventory-add.controller.js b/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/add/inventory-add.controller.js index 5d332b80f0..469a976dc2 100644 --- a/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/add/inventory-add.controller.js +++ b/awx/ui/client/src/inventories-hosts/inventories/standard-inventory/add/inventory-add.controller.js @@ -30,14 +30,6 @@ function InventoriesAdd($scope, $location, // apply form definition's default field values GenerateForm.applyDefaults(form, $scope); - - $scope.parseType = 'yaml'; - ParseTypeChange({ - scope: $scope, - variable: 'inventory_variables', - parse_variable: 'parseType', - field_id: 'inventory_inventory_variables' - }); } // Save diff --git a/awx/ui/client/src/workflow-results/workflow-results.controller.js b/awx/ui/client/src/workflow-results/workflow-results.controller.js index 83b9ba5d32..13856a430c 100644 --- a/awx/ui/client/src/workflow-results/workflow-results.controller.js +++ b/awx/ui/client/src/workflow-results/workflow-results.controller.js @@ -1,8 +1,8 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions', - 'jobLabels', 'workflowNodes', '$scope', 'ParseTypeChange', + 'jobLabels', 'workflowNodes', '$scope', 'ParseVariableString', 'count', '$state', 'i18n', 'WorkflowChartService', '$filter', 'moment', function(workflowData, workflowResultsService, - workflowDataOptions, jobLabels, workflowNodes, $scope, ParseTypeChange, + workflowDataOptions, jobLabels, workflowNodes, $scope, ParseVariableString, count, $state, i18n, WorkflowChartService, $filter, moment) { let nodeRef; @@ -167,7 +167,6 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions', // set up a read only code mirror for extra vars $scope.variables = ParseVariableString($scope.workflow.extra_vars); - $scope.parseType = 'yaml'; $scope.varsTooltip= i18n._('Read only view of extra variables added to the workflow.'); $scope.varsLabel = i18n._('Extra Variables'); $scope.varsName = 'extra_vars'; diff --git a/awx/ui/client/src/workflow-results/workflow-results.partial.html b/awx/ui/client/src/workflow-results/workflow-results.partial.html index fed1af57d0..c90435ec33 100644 --- a/awx/ui/client/src/workflow-results/workflow-results.partial.html +++ b/awx/ui/client/src/workflow-results/workflow-results.partial.html @@ -220,12 +220,12 @@ + disabled="true">