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
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", name: "inventories.edit.groups.edit.nested_hosts.edit",
url: "/edit/:host_id", url: "/edit/:host_id",
ncyBreadcrumb: { ncyBreadcrumb: {
parent: "inventories.edit.groups.edit", parent: "inventories.edit.groups.edit.nested_hosts",
label: "ASSOCIATED HOSTS" label: "{{breadcrumb.host_name}}"
}, },
views: { views: {
'hostForm@inventories': { '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 // assign the host to current group if not at the root level
if ($stateParams.group_id) { if ($stateParams.group_id) {
HostManageService.associateGroup(res.data, $stateParams.group_id).then(function() { 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 { } else {
$state.go('^.edit', { host_id: res.data.id }, { reload: true }); $state.go('^.edit', { host_id: res.data.id }, { reload: true });

View File

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

View File

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

View File

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