mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 16:47:45 -02:30
fixing add/edit for a related group
This commit is contained in:
@@ -49,8 +49,8 @@ export default ['$state', '$stateParams', '$scope', 'GroupForm',
|
|||||||
};
|
};
|
||||||
|
|
||||||
GroupManageService.post(group).then(res => {
|
GroupManageService.post(group).then(res => {
|
||||||
if ($stateParams.group) {
|
if ($stateParams.group_id) {
|
||||||
return GroupManageService.associateGroup(res.data, _.last($stateParams.group))
|
return GroupManageService.associateGroup(res.data, $stateParams.group_id)
|
||||||
.then(() => $state.go('^', null, { reload: true }));
|
.then(() => $state.go('^', null, { reload: true }));
|
||||||
} else {
|
} else {
|
||||||
$state.go('^.edit', { group_id: res.data.id }, { reload: true });
|
$state.go('^.edit', { group_id: res.data.id }, { reload: true });
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
import nestedGroupListState from './nested-groups-list-state.factory';
|
import nestedGroupListState from './nested-groups-list-state.factory';
|
||||||
|
import nestedGroupAddState from './nested-groups-add-state.factory';
|
||||||
import nestedGroupListDefinition from './nested-groups.list';
|
import nestedGroupListDefinition from './nested-groups.list';
|
||||||
import nestedGroupFormDefinition from './nested-groups.form';
|
import nestedGroupFormDefinition from './nested-groups.form';
|
||||||
import controller from './nested-groups-list.controller';
|
import controller from './nested-groups-list.controller';
|
||||||
@@ -12,6 +13,7 @@ import controller from './nested-groups-list.controller';
|
|||||||
export default
|
export default
|
||||||
angular.module('nestedGroups', [])
|
angular.module('nestedGroups', [])
|
||||||
.factory('nestedGroupListState', nestedGroupListState)
|
.factory('nestedGroupListState', nestedGroupListState)
|
||||||
|
.factory('nestedGroupAddState', nestedGroupAddState)
|
||||||
.value('NestedGroupListDefinition', nestedGroupListDefinition)
|
.value('NestedGroupListDefinition', nestedGroupListDefinition)
|
||||||
.factory('NestedGroupFormDefinition', nestedGroupFormDefinition)
|
.factory('NestedGroupFormDefinition', nestedGroupFormDefinition)
|
||||||
.controller('NestedGroupsListController', controller);
|
.controller('NestedGroupsListController', controller);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.createGroup = function(){
|
$scope.createGroup = function(){
|
||||||
$state.go('inventories.edit.groups.add');
|
$state.go('inventories.edit.groups.edit.nested_groups.add');
|
||||||
};
|
};
|
||||||
$scope.editGroup = function(id){
|
$scope.editGroup = function(id){
|
||||||
$state.go('inventories.edit.groups.edit', {group_id: id});
|
$state.go('inventories.edit.groups.edit', {group_id: id});
|
||||||
|
|||||||
@@ -88,9 +88,7 @@ function(i18n, nestedGroupListState){
|
|||||||
includeForm: "RelatedGroupFormDefinition",
|
includeForm: "RelatedGroupFormDefinition",
|
||||||
title: i18n._('Groups'),
|
title: i18n._('Groups'),
|
||||||
iterator: 'related_group',
|
iterator: 'related_group',
|
||||||
listState: nestedGroupListState,
|
listState: nestedGroupListState
|
||||||
// addState: buildGroupsAddState,
|
|
||||||
// editState: buildGroupsEditState
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ export default {
|
|||||||
nosort: true,
|
nosort: true,
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
iconOnly: true,
|
iconOnly: true,
|
||||||
awToolTip: "{{ group.hosts_status_tip }}",
|
awToolTip: "{{ nested_group.hosts_status_tip }}",
|
||||||
dataPlacement: "top",
|
dataPlacement: "top",
|
||||||
ngClick: "showFailedHosts(group)",
|
ngClick: "showFailedHosts(nested_group)",
|
||||||
icon: "{{ 'fa icon-job-' + group.hosts_status_class }}",
|
icon: "{{ 'fa icon-job-' + nested_group.hosts_status_class }}",
|
||||||
columnClass: 'status-column List-staticColumn--smallStatus'
|
columnClass: 'status-column List-staticColumn--smallStatus'
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
@@ -33,7 +33,7 @@ export default {
|
|||||||
key: true,
|
key: true,
|
||||||
|
|
||||||
// ngClick: "groupSelect(group.id)",
|
// 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',
|
columnClass: 'col-lg-6 col-md-6 col-sm-6 col-xs-6',
|
||||||
class: 'InventoryManage-breakWord',
|
class: 'InventoryManage-breakWord',
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,7 @@ export default {
|
|||||||
// },
|
// },
|
||||||
copy: {
|
copy: {
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngClick: "copyMoveGroup(group.id)",
|
ngClick: "copyMoveGroup(nested_group.id)",
|
||||||
awToolTip: 'Copy or move group',
|
awToolTip: 'Copy or move group',
|
||||||
ngShow: "group.id > 0 && group.summary_fields.user_capabilities.copy",
|
ngShow: "group.id > 0 && group.summary_fields.user_capabilities.copy",
|
||||||
dataPlacement: "top"
|
dataPlacement: "top"
|
||||||
@@ -120,23 +120,23 @@ export default {
|
|||||||
edit: {
|
edit: {
|
||||||
//label: 'Edit',
|
//label: 'Edit',
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngClick: "editGroup(group.id)",
|
ngClick: "editGroup(nested_group.id)",
|
||||||
awToolTip: 'Edit group',
|
awToolTip: 'Edit group',
|
||||||
dataPlacement: "top",
|
dataPlacement: "top",
|
||||||
ngShow: "group.summary_fields.user_capabilities.edit"
|
ngShow: "nested_group.summary_fields.user_capabilities.edit"
|
||||||
},
|
},
|
||||||
view: {
|
view: {
|
||||||
//label: 'Edit',
|
//label: 'Edit',
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngClick: "editGroup(group.id)",
|
ngClick: "editGroup(nested_group.id)",
|
||||||
awToolTip: 'View group',
|
awToolTip: 'View group',
|
||||||
dataPlacement: "top",
|
dataPlacement: "top",
|
||||||
ngShow: "!group.summary_fields.user_capabilities.edit"
|
ngShow: "!nested_group.summary_fields.user_capabilities.edit"
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
//label: 'Delete',
|
//label: 'Delete',
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngClick: "deleteGroup(group)",
|
ngClick: "deleteGroup(nested_group)",
|
||||||
awToolTip: 'Delete group',
|
awToolTip: 'Delete group',
|
||||||
dataPlacement: "top",
|
dataPlacement: "top",
|
||||||
ngShow: "group.summary_fields.user_capabilities.delete"
|
ngShow: "group.summary_fields.user_capabilities.delete"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<div ui-view="copyMove"></div>
|
<div ui-view="copyMove"></div>
|
||||||
<div ui-view="adhocForm"></div>
|
<div ui-view="adhocForm"></div>
|
||||||
<div ui-view="hostForm"></div>
|
<div ui-view="hostForm"></div>
|
||||||
|
<div ui-view="nestedGroupForm"></div>
|
||||||
<div ui-view="groupForm"></div>
|
<div ui-view="groupForm"></div>
|
||||||
<div ui-view="sourcesForm"></div>
|
<div ui-view="sourcesForm"></div>
|
||||||
<div ui-view="form"></div>
|
<div ui-view="form"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user