Merge pull request #6261 from mabashian/inventory-bug-fixes

Fixed inventory limit panels bug, breadcrumb and redirect bugs
This commit is contained in:
Michael Abashian 2017-05-16 08:27:10 -04:00 committed by GitHub
commit ee0ac72c89
5 changed files with 10 additions and 6 deletions

View File

@ -2,8 +2,8 @@ export default {
name: "inventories.edit.groups.edit.nested_hosts.edit",
url: "/edit/:host_id",
ncyBreadcrumb: {
parent: "inventories.edit.groups.edit",
label: "ASSOCIATED HOSTS"
parent: "inventories.edit.groups.edit.nested_hosts",
label: "{{breadcrumb.host_name}}"
},
views: {
'hostForm@inventories': {

View File

@ -52,7 +52,7 @@ export default ['$state', '$stateParams', '$scope', 'RelatedHostsFormDefinition'
// assign the host to current group if not at the root level
if ($stateParams.group_id) {
HostManageService.associateGroup(res.data, $stateParams.group_id).then(function() {
$state.go('inventories.edit.groups.edit.nested_hosts', { group_id: $stateParams.group_id }, { reload: true });
$state.go('^.edit', { group_id: $stateParams.group_id, host_id: res.data.id }, { reload: true });
});
} else {
$state.go('^.edit', { host_id: res.data.id }, { reload: true });

View File

@ -5,8 +5,8 @@
*************************************************/
export default
['$scope', '$state', '$stateParams', 'DashboardHostsForm', 'GenerateForm', 'ParseTypeChange', 'DashboardHostService', 'host',
function($scope, $state, $stateParams, DashboardHostsForm, GenerateForm, ParseTypeChange, DashboardHostService, host){
['$scope', '$state', '$stateParams', 'DashboardHostsForm', 'GenerateForm', 'ParseTypeChange', 'DashboardHostService', 'host', '$rootScope',
function($scope, $state, $stateParams, DashboardHostsForm, GenerateForm, ParseTypeChange, DashboardHostService, host, $rootScope){
$scope.parseType = 'yaml';
$scope.formCancel = function(){
$state.go('^', null, {reload: true});
@ -36,6 +36,7 @@
var init = function(){
$scope.host = host;
$scope.name = host.name;
$rootScope.breadcrumb.host_name = host.name;
$scope.description = host.description;
$scope.variables = getVars(host.variables);
ParseTypeChange({

View File

@ -3,7 +3,7 @@ export default {
url: "/edit/:host_id",
ncyBreadcrumb: {
parent: "inventories.edit.hosts",
label: "HOSTS"
label: "{{breadcrumb.host_name}}"
},
views: {
'hostForm@inventories': {

View File

@ -18,6 +18,9 @@ export default ['$rootScope', function($rootScope) {
if(index+1 > scope.maxPanels) {
$(this).addClass('Panel-hidden');
}
else {
$(this).removeClass('Panel-hidden');
}
});
}
else {