diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index ffe729895f..d6c09b439a 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -55,10 +55,7 @@ import {ProjectsList, ProjectsAdd, ProjectsEdit} from './controllers/Projects'; import OrganizationsList from './organizations/list/organizations-list.controller'; import OrganizationsAdd from './organizations/add/organizations-add.controller'; import OrganizationsEdit from './organizations/edit/organizations-edit.controller'; -import InventoriesAdd from './inventories/add/inventory-add.controller'; -import InventoriesEdit from './inventories/edit/inventory-edit.controller'; -import InventoriesList from './inventories/list/inventory-list.controller'; -import InventoriesManage from './inventories/manage/inventory-manage.controller'; +import {InventoriesAdd, InventoriesEdit, InventoriesList, InventoriesManage} from './inventories/main'; import {AdminsList} from './controllers/Admins'; import {UsersList, UsersAdd, UsersEdit} from './controllers/Users'; import {TeamsList, TeamsAdd, TeamsEdit} from './controllers/Teams'; diff --git a/awx/ui/client/src/inventories/add/inventory-add.controller.js b/awx/ui/client/src/inventories/add/inventory-add.controller.js index befcc1d14e..bd3cde3041 100644 --- a/awx/ui/client/src/inventories/add/inventory-add.controller.js +++ b/awx/ui/client/src/inventories/add/inventory-add.controller.js @@ -10,8 +10,6 @@ * @description This controller's for the Inventory page */ -import '../../job-templates/main'; - function InventoriesAdd($scope, $rootScope, $compile, $location, $log, $stateParams, InventoryForm, GenerateForm, Rest, Alert, ProcessErrors, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, @@ -25,7 +23,6 @@ function InventoriesAdd($scope, $rootScope, $compile, $location, $log, form = InventoryForm(), generator = GenerateForm; - form.well = true; form.formLabelSize = null; form.formFieldSize = null; diff --git a/awx/ui/client/src/inventories/edit/inventory-edit.controller.js b/awx/ui/client/src/inventories/edit/inventory-edit.controller.js index 3876f67c20..f7cb6f2601 100644 --- a/awx/ui/client/src/inventories/edit/inventory-edit.controller.js +++ b/awx/ui/client/src/inventories/edit/inventory-edit.controller.js @@ -10,8 +10,6 @@ * @description This controller's for the Inventory page */ -import '../../job-templates/main'; - function InventoriesEdit($scope, $rootScope, $compile, $location, $log, $stateParams, InventoryForm, GenerateForm, Rest, Alert, ProcessErrors, ReturnToCaller, ClearScope, generateList, OrganizationList, SearchInit, @@ -30,7 +28,6 @@ function InventoriesEdit($scope, $rootScope, $compile, $location, fld, json_data, data, relatedSets = {}; - form.well = true; form.formLabelSize = null; form.formFieldSize = null; $scope.inventory_id = inventory_id; diff --git a/awx/ui/client/src/inventories/list/inventory-list.controller.js b/awx/ui/client/src/inventories/list/inventory-list.controller.js index a55529491c..947b1c0341 100644 --- a/awx/ui/client/src/inventories/list/inventory-list.controller.js +++ b/awx/ui/client/src/inventories/list/inventory-list.controller.js @@ -14,7 +14,7 @@ function InventoriesList($scope, $rootScope, $location, $log, $stateParams, $compile, $filter, sanitizeFilter, Rest, Alert, InventoryList, generateList, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, - EditInventoryProperties, Find, Empty, $state) { + Find, Empty, $state) { var list = InventoryList, defaultUrl = GetBasePath('inventory'), @@ -301,10 +301,6 @@ function InventoriesList($scope, $rootScope, $location, $log, }; - $scope.editInventoryProperties = function (inventory_id) { - EditInventoryProperties({ scope: $scope, inventory_id: inventory_id }); - }; - $scope.addInventory = function () { $state.go('inventories.add'); }; @@ -365,5 +361,4 @@ function InventoriesList($scope, $rootScope, $location, $log, export default ['$scope', '$rootScope', '$location', '$log', '$stateParams', '$compile', '$filter', 'sanitizeFilter', 'Rest', 'Alert', 'InventoryList', 'generateList', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', - 'ClearScope', 'ProcessErrors', 'GetBasePath', 'Wait', - 'EditInventoryProperties', 'Find', 'Empty', '$state', InventoriesList]; + 'ClearScope', 'ProcessErrors', 'GetBasePath', 'Wait', 'Find', 'Empty', '$state', InventoriesList]; diff --git a/awx/ui/client/src/inventories/manage/inventory-manage.controller.js b/awx/ui/client/src/inventories/manage/inventory-manage.controller.js index a5c215bb0a..508a74d4c2 100644 --- a/awx/ui/client/src/inventories/manage/inventory-manage.controller.js +++ b/awx/ui/client/src/inventories/manage/inventory-manage.controller.js @@ -335,12 +335,6 @@ function InventoriesManage($log, $scope, $rootScope, $location, $scope.createGroup = function () { PreviousSearchParams = Store('group_current_search_params'); - // GroupsEdit({ - // scope: $scope, - // inventory_id: $scope.inventory.id, - // group_id: $scope.selected_group_id, - // mode: 'add' - // }); var params = { scope: $scope, inventory_id: $scope.inventory.id, @@ -353,12 +347,6 @@ function InventoriesManage($log, $scope, $rootScope, $location, $scope.editGroup = function (id) { PreviousSearchParams = Store('group_current_search_params'); - // GroupsEdit({ - // scope: $scope, - // inventory_id: $scope.inventory.id, - // group_id: id, - // mode: 'edit' - // }); var params = { scope: $scope, inventory_id: $scope.inventory.id, @@ -432,15 +420,6 @@ function InventoriesManage($log, $scope, $rootScope, $location, }; hostScope.createHost = function () { - // HostsEdit({ - // host_scope: hostScope, - // group_scope: $scope, - // mode: 'add', - // host_id: null, - // selected_group_id: $scope.selected_group_id, - // inventory_id: $scope.inventory.id - // }); - var params = { host_scope: hostScope, group_scope: $scope, @@ -454,13 +433,6 @@ function InventoriesManage($log, $scope, $rootScope, $location, }; hostScope.editHost = function (host_id) { - // HostsEdit({ - // host_scope: hostScope, - // group_scope: $scope, - // mode: 'edit', - // host_id: host_id, - // inventory_id: $scope.inventory.id - // }); var params = { host_scope: hostScope, group_scope: $scope, @@ -490,19 +462,6 @@ function InventoriesManage($log, $scope, $rootScope, $location, }); }; - /*hostScope.restoreSearch = function() { - SearchInit({ - scope: hostScope, - set: PreviousSearchParams.set, - list: PreviousSearchParams.list, - url: PreviousSearchParams.defaultUrl, - iterator: PreviousSearchParams.iterator, - sort_order: PreviousSearchParams.sort_order, - setWidgets: false - }); - hostScope.search('host'); - };*/ - hostScope.toggleHostEnabled = function (host_id, external_source) { ToggleHostEnabled({ parent_scope: $scope, diff --git a/awx/ui/client/src/inventories/manage/manage-groups/directive/manage-groups.directive.controller.js b/awx/ui/client/src/inventories/manage/manage-groups/directive/manage-groups.directive.controller.js index 37405a5eab..158d6653ec 100644 --- a/awx/ui/client/src/inventories/manage/manage-groups/directive/manage-groups.directive.controller.js +++ b/awx/ui/client/src/inventories/manage/manage-groups/directive/manage-groups.directive.controller.js @@ -68,13 +68,15 @@ function manageGroupsDirectiveController($filter, $rootScope, $location, $log, $ elem = document.getElementById('group-manage-panel'); $compile(elem)(modal_scope); + $scope.parseType = 'yaml'; + var form_scope = generator.inject(GroupForm, { mode: mode, id: 'properties-tab', related: false, scope: properties_scope, - cancelButton: false + cancelButton: false, }); var source_form_scope = generator.inject(SourceForm, { @@ -114,6 +116,13 @@ function manageGroupsDirectiveController($filter, $rootScope, $location, $log, $ modal_scope.removeLoadSourceData(); } modal_scope.removeLoadSourceData = modal_scope.$on('LoadSourceData', function() { + ParseTypeChange({ + scope: form_scope, + variable: 'variables', + parse_variable: 'parseType', + field_id: 'group_variables' + }); + if (sources_scope.source_url) { // get source data Rest.setUrl(sources_scope.source_url); @@ -239,6 +248,7 @@ function manageGroupsDirectiveController($filter, $rootScope, $location, $log, $ opts: opts }); } + sources_scope.group_update_url = data.related.update; }) .error(function(data, status) { diff --git a/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js b/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js index 5fde6e3991..90190143f3 100644 --- a/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js +++ b/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js @@ -40,9 +40,16 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam cancelButton: false }); generator.reset(); + console.info(angular.element(document.getElementById('host_variables'))); + $scope.parseType = 'yaml'; + ParseTypeChange({ + scope: form_scope, + variable: 'variables', + parse_variable: 'parseType', + field_id: 'host_variables' + }); - scope.parseType = 'yaml'; // Retrieve detail record and prepopulate the form if (mode === 'edit') { @@ -171,8 +178,6 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam $state.go('inventoryManage'); }; - - angular.extend(vm, { cancelPanel: cancelPanel, saveHost: saveHost, diff --git a/awx/ui/client/src/inventories/manage/manage.block.less b/awx/ui/client/src/inventories/manage/manage.block.less index 15b41dfd53..772423c2e4 100644 --- a/awx/ui/client/src/inventories/manage/manage.block.less +++ b/awx/ui/client/src/inventories/manage/manage.block.less @@ -1,12 +1,18 @@ -#Inventory-groupManage--panel, #Inventory-hostManage--panel { - .ui-dialog-buttonpane.ui-widget-content { - border: none; - text-align: right; - } +#Inventory-groupManage--panel, +#Inventory-hostManage--panel { + .ui-dialog-buttonpane.ui-widget-content { + border: none; + text-align: right; + } - #host-panel-form, #properties-tab { - .Form-header { - margin-top: -20px; - } - } + #host-panel-form, + #properties-tab { + .Form-header { + margin-top: -20px; + } + } + + .Form-textArea { + width: 100%; + } }