mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
AC-209 on inventory page, when user selects inventory node the add group buttons displays the 'create new group' dialog rather than the select dialog.
This commit is contained in:
@@ -43,6 +43,11 @@
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
.btn-inventory-edit {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
.modal-footer .btn-success,
|
||||
.modal-footer .btn-danger,
|
||||
.modal-footer .btn-info,
|
||||
|
||||
@@ -263,7 +263,7 @@ InventoriesAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$lo
|
||||
function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,
|
||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||
RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt,
|
||||
OrganizationList, TreeInit, GetBasePath, GroupsList, GroupsEdit, LoadInventory,
|
||||
OrganizationList, TreeInit, GetBasePath, GroupsList, GroupsAdd, GroupsEdit, LoadInventory,
|
||||
GroupsDelete, HostsList, HostsAdd, HostsEdit, HostsDelete, RefreshTree, ParseTypeChange)
|
||||
{
|
||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||
@@ -436,7 +436,7 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
return {
|
||||
addGroup: {
|
||||
label: 'Add Group',
|
||||
action: function(obj) { GroupsList({ "inventory_id": id, group_id: null }); }
|
||||
action: function(obj) { GroupsAdd({ "inventory_id": id, group_id: null }); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -499,7 +499,12 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
});
|
||||
|
||||
scope.addGroup = function() {
|
||||
GroupsList({ "inventory_id": id, group_id: scope.group_id });
|
||||
if (scope.group_id == null) {
|
||||
GroupsAdd({ "inventory_id": id, group_id: null });
|
||||
}
|
||||
else {
|
||||
GroupsList({ "inventory_id": id, group_id: scope.group_id });
|
||||
}
|
||||
}
|
||||
|
||||
scope.editGroup = function() {
|
||||
@@ -545,7 +550,7 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
InventoriesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm',
|
||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt',
|
||||
'OrganizationList', 'TreeInit', 'GetBasePath', 'GroupsList', 'GroupsEdit', 'LoadInventory',
|
||||
'OrganizationList', 'TreeInit', 'GetBasePath', 'GroupsList', 'GroupsAdd', 'GroupsEdit', 'LoadInventory',
|
||||
'GroupsDelete', 'HostsList', 'HostsAdd', 'HostsEdit', 'HostsDelete', 'RefreshTree',
|
||||
'ParseTypeChange'
|
||||
];
|
||||
|
||||
@@ -152,7 +152,8 @@ angular.module('InventoryFormDefinition', [])
|
||||
ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')",
|
||||
icon: 'icon-edit',
|
||||
label: 'Edit',
|
||||
awToolTip: 'Edit host'
|
||||
awToolTip: 'Edit host',
|
||||
'class': 'btn-inventory-edit'
|
||||
},
|
||||
"delete": {
|
||||
ngClick: "deleteHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')",
|
||||
|
||||
@@ -808,8 +808,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
||||
html += "<div class=\"span5\">";
|
||||
html += "<div class=\"inventory-buttons\">";
|
||||
html += "<button ng-click=\"addGroup()\" ng-hide=\"groupAddHide\" id=\"inv-group-add\" " +
|
||||
"class=\"btn btn-mini btn-success\" aw-tool-tip=\"Add existing groups or create a new group\" " +
|
||||
"data-placement=\"bottom\"><i class=\"icon-plus\"></i> Add Groups</button>";
|
||||
"class=\"btn btn-mini btn-success\" aw-tool-tip=\"Add a new group\" " +
|
||||
"data-placement=\"bottom\"><i class=\"icon-plus\"></i> Add Group</button>";
|
||||
html += "<button ng-click=\"editGroup()\" ng-hide=\"groupEditHide\" id=\"inv-group-edit\" class=\"btn btn-mini btn-success\" " +
|
||||
"aw-tool-tip=\"Edit the selected group\" data-placement=\"bottom\" " +
|
||||
"<i class=\"icon-edit\"></i> Edit Group</button>";
|
||||
|
||||
Reference in New Issue
Block a user