diff --git a/awx/ui/static/js/controllers/Groups.js b/awx/ui/static/js/controllers/Groups.js index aba3b95414..82e5352a31 100644 --- a/awx/ui/static/js/controllers/Groups.js +++ b/awx/ui/static/js/controllers/Groups.js @@ -10,7 +10,7 @@ function InventoryGroups ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryGroupsForm, GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, ReturnToCaller, ClearScope, Prompt, TreeInit, GetBasePath, GroupsList, GroupsAdd, GroupsEdit, LoadInventory, - GroupsDelete, RefreshGroupName, EditInventory) + GroupsDelete, RefreshGroupName, EditInventory, SetShowGroupHelp) { ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior //scope. @@ -18,6 +18,7 @@ function InventoryGroups ($scope, $rootScope, $compile, $location, $log, $routeP var generator = GenerateForm; var form = InventoryGroupsForm; var defaultUrl=GetBasePath('inventory'); + $('#tree-view').empty(); var scope = generator.inject(form, { mode: 'edit', related: true, buildTree: true }); var base = $location.path().replace(/^\//,'').split('/')[0]; var id = $routeParams.inventory_id; @@ -31,6 +32,7 @@ function InventoryGroups ($scope, $rootScope, $compile, $location, $log, $routeP scope.inventoryLoadedRemove = scope.$on('inventoryLoaded', function() { LoadBreadCrumbs({ path: '/inventories/' + id, title: scope.inventory_name }); TreeInit(scope.TreeParams); + SetShowGroupHelp({ scope: scope }); if (!scope.$$phase) { scope.$digest(); } @@ -179,12 +181,15 @@ function InventoryGroups ($scope, $rootScope, $compile, $location, $log, $routeP scope.deleteGroup = function() { GroupsDelete({ scope: scope, "inventory_id": id, group_id: scope.group_id }); } - + + scope.editHosts = function() { + $location.path('/inventories/' + scope.inventory_id + '/hosts'); + } } InventoryGroups.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryGroupsForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'Prompt', 'TreeInit', 'GetBasePath', 'GroupsList', 'GroupsAdd', 'GroupsEdit', 'LoadInventory', - 'GroupsDelete', 'RefreshGroupName', 'EditInventory' + 'GroupsDelete', 'RefreshGroupName', 'EditInventory', 'SetShowGroupHelp' ]; \ No newline at end of file diff --git a/awx/ui/static/js/controllers/Hosts.js b/awx/ui/static/js/controllers/Hosts.js index e25282cfc2..384d139a2f 100644 --- a/awx/ui/static/js/controllers/Hosts.js +++ b/awx/ui/static/js/controllers/Hosts.js @@ -13,7 +13,7 @@ function InventoryHosts ($scope, $rootScope, $compile, $location, $log, $routePa GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit, RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt, GetBasePath, HostsList, HostsAdd, HostsEdit, HostsDelete, - HostsReload, LoadSearchTree, EditHostGroups) + HostsReload, LoadSearchTree, EditHostGroups, SetShowGroupHelp) { ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior //scope. @@ -35,6 +35,7 @@ function InventoryHosts ($scope, $rootScope, $compile, $location, $log, $routePa } scope.loadBreadCrumbsRemove = scope.$on('buildAllGroups', function(e, inventory_name) { LoadBreadCrumbs({ path: '/inventories/' + id, title: inventory_name }); + SetShowGroupHelp({ scope: scope }); }); // Sets up the search tree and loads All Hosts for the inventory @@ -66,6 +67,10 @@ function InventoryHosts ($scope, $rootScope, $compile, $location, $log, $routePa scope.editHost = function(host_id, host_name) { HostsEdit({ scope: scope, "inventory_id": id, group_id: scope.group_id, host_id: host_id, host_name: host_name }); } + + scope.editGroups = function() { + $location.path('/inventories/' + scope.inventory_id + '/groups'); + } scope.editHostGroups = function(host_id) { EditHostGroups({ inventory_id: id, host_id: host_id }); @@ -120,6 +125,6 @@ InventoryHosts.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$lo 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit', 'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt', 'GetBasePath', 'HostsList', 'HostsAdd', 'HostsEdit', 'HostsDelete', - 'HostsReload', 'LoadSearchTree', 'EditHostGroups' + 'HostsReload', 'LoadSearchTree', 'EditHostGroups', 'SetShowGroupHelp' ]; diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index ded335d844..c1383c9231 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -165,7 +165,7 @@ function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routePa Rest.setUrl(data.related.variable_data); Rest.put(json_data) .success( function(data, status, headers, config) { - $location.path('/inventories/' + inventory_id); + $location.path('/inventories/' + inventory_id + '/groups'); }) .error( function(data, status, headers, config) { ProcessErrors(scope, data, status, form, @@ -173,7 +173,7 @@ function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routePa }); } else { - $location.path('/inventories/' + inventory_id); + $location.path('/inventories/' + inventory_id + '/groups'); } }) .error( function(data, status, headers, config) { diff --git a/awx/ui/static/js/controllers/Projects.js b/awx/ui/static/js/controllers/Projects.js index 3540ac2c98..38b3514470 100644 --- a/awx/ui/static/js/controllers/Projects.js +++ b/awx/ui/static/js/controllers/Projects.js @@ -122,6 +122,9 @@ function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParam for (var fld in form.fields) { data[fld] = scope[fld]; } + if (scope.scm_type) { + data.scm_type = scope.scm_type.value; + } var url = (base == 'teams') ? GetBasePath('teams') + $routeParams.team_id + '/projects/' : defaultUrl; Rest.setUrl(url); Rest.post(data) diff --git a/awx/ui/static/js/forms/Groups.js b/awx/ui/static/js/forms/Groups.js index 4a2063c651..d18d8d5865 100644 --- a/awx/ui/static/js/forms/Groups.js +++ b/awx/ui/static/js/forms/Groups.js @@ -18,14 +18,14 @@ angular.module('GroupFormDefinition', []) formFieldSize: 'col-lg-9', fields: { - has_active_failures: { + /*has_active_failures: { label: 'Status', control: '
' + ' Contains hosts with failed jobs
', type: 'custom', ngShow: 'has_active_failures', readonly: true - }, + },*/ name: { label: 'Name', type: 'text', diff --git a/awx/ui/static/js/forms/InventoryHosts.js b/awx/ui/static/js/forms/InventoryHosts.js index 1e766a9ae3..50c05907c3 100644 --- a/awx/ui/static/js/forms/InventoryHosts.js +++ b/awx/ui/static/js/forms/InventoryHosts.js @@ -35,7 +35,7 @@ angular.module('InventoryHostsFormDefinition', []) type: 'DropDown', searchable: false, nosort: true, - label: 'View Jobs', + label: 'View', "class": "btn-sm", //ngDisabled: 'host.last_job == null', options: [ diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 70da23765b..52607e6b5d 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -380,8 +380,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' }; //Force binds to work. Not working usual way. $('#prompt-header').text('Delete Group'); - $('#prompt-body').text('Are you sure you want to remove group ' + $(obj).attr('name') + - ' from ' + $(parent).attr('name') + '?'); + $('#prompt-body').html('

Are you sure you want to permanently delete group ' + $(obj).attr('name') + '?

'); $('#prompt-action-btn').addClass('btn-danger'); scope.promptAction = action_to_take; // for some reason this binds? $('#prompt-modal').modal({ diff --git a/awx/ui/static/js/helpers/Hosts.js b/awx/ui/static/js/helpers/Hosts.js index f858f8553a..ec6649e623 100644 --- a/awx/ui/static/js/helpers/Hosts.js +++ b/awx/ui/static/js/helpers/Hosts.js @@ -636,7 +636,7 @@ angular.module('HostsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', 'H Rest.setUrl (GetBasePath('inventory') + inventory_id + '/'); Rest.get() .success( function(data, status, headers, config) { - html += "
Group Selector:
\n" + + html += "
Group Selector:
\n" + "