mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -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;
|
padding-bottom: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-inventory-edit {
|
||||||
|
padding-top: 2px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
.modal-footer .btn-success,
|
.modal-footer .btn-success,
|
||||||
.modal-footer .btn-danger,
|
.modal-footer .btn-danger,
|
||||||
.modal-footer .btn-info,
|
.modal-footer .btn-info,
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ InventoriesAdd.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$lo
|
|||||||
function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,
|
function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, InventoryForm,
|
||||||
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
GenerateForm, Rest, Alert, ProcessErrors, LoadBreadCrumbs, RelatedSearchInit,
|
||||||
RelatedPaginateInit, ReturnToCaller, ClearScope, LookUpInit, Prompt,
|
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)
|
GroupsDelete, HostsList, HostsAdd, HostsEdit, HostsDelete, RefreshTree, ParseTypeChange)
|
||||||
{
|
{
|
||||||
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
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 {
|
return {
|
||||||
addGroup: {
|
addGroup: {
|
||||||
label: 'Add Group',
|
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() {
|
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() {
|
scope.editGroup = function() {
|
||||||
@@ -545,7 +550,7 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
|||||||
InventoriesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm',
|
InventoriesEdit.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryForm',
|
||||||
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'RelatedSearchInit',
|
||||||
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt',
|
'RelatedPaginateInit', 'ReturnToCaller', 'ClearScope', 'LookUpInit', 'Prompt',
|
||||||
'OrganizationList', 'TreeInit', 'GetBasePath', 'GroupsList', 'GroupsEdit', 'LoadInventory',
|
'OrganizationList', 'TreeInit', 'GetBasePath', 'GroupsList', 'GroupsAdd', 'GroupsEdit', 'LoadInventory',
|
||||||
'GroupsDelete', 'HostsList', 'HostsAdd', 'HostsEdit', 'HostsDelete', 'RefreshTree',
|
'GroupsDelete', 'HostsList', 'HostsAdd', 'HostsEdit', 'HostsDelete', 'RefreshTree',
|
||||||
'ParseTypeChange'
|
'ParseTypeChange'
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -152,7 +152,8 @@ angular.module('InventoryFormDefinition', [])
|
|||||||
ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')",
|
ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')",
|
||||||
icon: 'icon-edit',
|
icon: 'icon-edit',
|
||||||
label: 'Edit',
|
label: 'Edit',
|
||||||
awToolTip: 'Edit host'
|
awToolTip: 'Edit host',
|
||||||
|
'class': 'btn-inventory-edit'
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
ngClick: "deleteHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')",
|
ngClick: "deleteHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')",
|
||||||
|
|||||||
@@ -808,8 +808,8 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
html += "<div class=\"span5\">";
|
html += "<div class=\"span5\">";
|
||||||
html += "<div class=\"inventory-buttons\">";
|
html += "<div class=\"inventory-buttons\">";
|
||||||
html += "<button ng-click=\"addGroup()\" ng-hide=\"groupAddHide\" id=\"inv-group-add\" " +
|
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\" " +
|
"class=\"btn btn-mini btn-success\" aw-tool-tip=\"Add a new group\" " +
|
||||||
"data-placement=\"bottom\"><i class=\"icon-plus\"></i> Add Groups</button>";
|
"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\" " +
|
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\" " +
|
"aw-tool-tip=\"Edit the selected group\" data-placement=\"bottom\" " +
|
||||||
"<i class=\"icon-edit\"></i> Edit Group</button>";
|
"<i class=\"icon-edit\"></i> Edit Group</button>";
|
||||||
|
|||||||
Reference in New Issue
Block a user