From e7615edd911dcb1e69a1a81837bfadc150176c78 Mon Sep 17 00:00:00 2001 From: Leigh Johnson Date: Thu, 23 Jun 2016 09:52:05 -0400 Subject: [PATCH] fix CodeMirror vars in host add/edit view, resolves #2518 (#2590) --- .../src/inventories/manage/hosts/hosts-add.controller.js | 4 +--- .../src/inventories/manage/hosts/hosts-edit.controller.js | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/awx/ui/client/src/inventories/manage/hosts/hosts-add.controller.js b/awx/ui/client/src/inventories/manage/hosts/hosts-add.controller.js index 3b620fb950..d0dd6c3c86 100644 --- a/awx/ui/client/src/inventories/manage/hosts/hosts-add.controller.js +++ b/awx/ui/client/src/inventories/manage/hosts/hosts-add.controller.js @@ -10,7 +10,6 @@ var generator = GenerateForm, form = HostForm; $scope.parseType = 'yaml'; - $scope.extraVars = '---'; $scope.formCancel = function(){ $state.go('^'); }; @@ -19,7 +18,7 @@ }; $scope.formSave = function(){ var params = { - variables: $scope.extraVars === '---' || $scope.extraVars === '{}' ? null : $scope.extraVars, + variables: $scope.variables === '---' || $scope.variables === '{}' ? null : $scope.variables, name: $scope.name, description: $scope.description, enabled: $scope.host.enabled, @@ -43,7 +42,6 @@ ParseTypeChange({ scope: $scope, field_id: 'host_variables', - variable: 'extraVars', }); }; init(); diff --git a/awx/ui/client/src/inventories/manage/hosts/hosts-edit.controller.js b/awx/ui/client/src/inventories/manage/hosts/hosts-edit.controller.js index 7241cc6069..9098e53333 100644 --- a/awx/ui/client/src/inventories/manage/hosts/hosts-edit.controller.js +++ b/awx/ui/client/src/inventories/manage/hosts/hosts-edit.controller.js @@ -19,7 +19,7 @@ $scope.formSave = function(){ var host = { id: $scope.host.id, - variables: $scope.extraVars === '---' || $scope.extraVars === '{}' ? null : $scope.extraVars, + variables: $scope.variables === '---' || $scope.variables === '{}' ? null : $scope.variables, name: $scope.name, description: $scope.description, enabled: $scope.host.enabled @@ -30,15 +30,13 @@ }; var init = function(){ $scope.host = host; - $scope.extraVars = host.variables === '' ? '---' : host.variables; generator.inject(form, {mode: 'edit', related: false, id: 'Inventory-hostManage--panel', scope: $scope}); - $scope.extraVars = $scope.host.variables === '' ? '---' : $scope.host.variables; + $scope.variables = host.variables === '' ? '---' : host.variables; $scope.name = host.name; $scope.description = host.description; ParseTypeChange({ scope: $scope, field_id: 'host_variables', - variable: 'extraVars', }); }; init();