diff --git a/awx/ui/client/src/inventories/groups/add/groups-add.controller.js b/awx/ui/client/src/inventories/groups/add/groups-add.controller.js index 2afb50be49..e8b8426c03 100644 --- a/awx/ui/client/src/inventories/groups/add/groups-add.controller.js +++ b/awx/ui/client/src/inventories/groups/add/groups-add.controller.js @@ -49,8 +49,8 @@ export default ['$state', '$stateParams', '$scope', 'GroupForm', }; GroupManageService.post(group).then(res => { - if ($stateParams.group) { - return GroupManageService.associateGroup(res.data, _.last($stateParams.group)) + if ($stateParams.group_id) { + return GroupManageService.associateGroup(res.data, $stateParams.group_id) .then(() => $state.go('^', null, { reload: true })); } else { $state.go('^.edit', { group_id: res.data.id }, { reload: true }); diff --git a/awx/ui/client/src/inventories/groups/nested-groups/main.js b/awx/ui/client/src/inventories/groups/nested-groups/main.js index 4d322b4270..0c02775e75 100644 --- a/awx/ui/client/src/inventories/groups/nested-groups/main.js +++ b/awx/ui/client/src/inventories/groups/nested-groups/main.js @@ -5,6 +5,7 @@ *************************************************/ import nestedGroupListState from './nested-groups-list-state.factory'; +import nestedGroupAddState from './nested-groups-add-state.factory'; import nestedGroupListDefinition from './nested-groups.list'; import nestedGroupFormDefinition from './nested-groups.form'; import controller from './nested-groups-list.controller'; @@ -12,6 +13,7 @@ import controller from './nested-groups-list.controller'; export default angular.module('nestedGroups', []) .factory('nestedGroupListState', nestedGroupListState) + .factory('nestedGroupAddState', nestedGroupAddState) .value('NestedGroupListDefinition', nestedGroupListDefinition) .factory('NestedGroupFormDefinition', nestedGroupFormDefinition) .controller('NestedGroupsListController', controller); diff --git a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list.controller.js b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list.controller.js index 31e55fa992..94b0d05a4f 100644 --- a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list.controller.js +++ b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups-list.controller.js @@ -64,7 +64,7 @@ } $scope.createGroup = function(){ - $state.go('inventories.edit.groups.add'); + $state.go('inventories.edit.groups.edit.nested_groups.add'); }; $scope.editGroup = function(id){ $state.go('inventories.edit.groups.edit', {group_id: id}); diff --git a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.form.js b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.form.js index 9d4645018d..d39759bc25 100644 --- a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.form.js +++ b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.form.js @@ -88,9 +88,7 @@ function(i18n, nestedGroupListState){ includeForm: "RelatedGroupFormDefinition", title: i18n._('Groups'), iterator: 'related_group', - listState: nestedGroupListState, - // addState: buildGroupsAddState, - // editState: buildGroupsEditState + listState: nestedGroupListState }, } diff --git a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.list.js b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.list.js index ba958b0175..8987130a59 100644 --- a/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.list.js +++ b/awx/ui/client/src/inventories/groups/nested-groups/nested-groups.list.js @@ -22,10 +22,10 @@ export default { nosort: true, mode: 'all', iconOnly: true, - awToolTip: "{{ group.hosts_status_tip }}", + awToolTip: "{{ nested_group.hosts_status_tip }}", dataPlacement: "top", - ngClick: "showFailedHosts(group)", - icon: "{{ 'fa icon-job-' + group.hosts_status_class }}", + ngClick: "showFailedHosts(nested_group)", + icon: "{{ 'fa icon-job-' + nested_group.hosts_status_class }}", columnClass: 'status-column List-staticColumn--smallStatus' }, name: { @@ -33,7 +33,7 @@ export default { key: true, // ngClick: "groupSelect(group.id)", - ngClick: "editGroup(group.id)", + ngClick: "editGroup(nested_group.id)", columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6', class: 'InventoryManage-breakWord', } @@ -104,7 +104,7 @@ export default { // }, copy: { mode: 'all', - ngClick: "copyMoveGroup(group.id)", + ngClick: "copyMoveGroup(nested_group.id)", awToolTip: 'Copy or move group', ngShow: "group.id > 0 && group.summary_fields.user_capabilities.copy", dataPlacement: "top" @@ -120,23 +120,23 @@ export default { edit: { //label: 'Edit', mode: 'all', - ngClick: "editGroup(group.id)", + ngClick: "editGroup(nested_group.id)", awToolTip: 'Edit group', dataPlacement: "top", - ngShow: "group.summary_fields.user_capabilities.edit" + ngShow: "nested_group.summary_fields.user_capabilities.edit" }, view: { //label: 'Edit', mode: 'all', - ngClick: "editGroup(group.id)", + ngClick: "editGroup(nested_group.id)", awToolTip: 'View group', dataPlacement: "top", - ngShow: "!group.summary_fields.user_capabilities.edit" + ngShow: "!nested_group.summary_fields.user_capabilities.edit" }, "delete": { //label: 'Delete', mode: 'all', - ngClick: "deleteGroup(group)", + ngClick: "deleteGroup(nested_group)", awToolTip: 'Delete group', dataPlacement: "top", ngShow: "group.summary_fields.user_capabilities.delete" diff --git a/awx/ui/client/src/inventories/inventories.partial.html b/awx/ui/client/src/inventories/inventories.partial.html index e9cbce9432..ae2f1df601 100644 --- a/awx/ui/client/src/inventories/inventories.partial.html +++ b/awx/ui/client/src/inventories/inventories.partial.html @@ -2,6 +2,7 @@
+