Merge pull request #2524 from mabashian/inventory-sync-schedule-breadcrumb

Added breadcrumb for inventory sync schedule state
This commit is contained in:
Michael Abashian 2016-06-21 13:09:29 -04:00 committed by GitHub
commit b080749350
3 changed files with 9 additions and 5 deletions

View File

@ -14,8 +14,8 @@ export default
$scope.inventory = inventoryData;
$scope.state = $state;
// slices the group stack at $index to supply new group params to $state.go()
$scope.goToGroup = function($index){
var group = $stateParams.group.slice(0, $index);
$scope.goToGroup = function(index){
var group = $stateParams.group.slice(0, index);
$state.go('inventoryManage', {group: group}, {reload: true});
};
$scope.isRootState = function(){
@ -24,4 +24,4 @@ export default
$scope.goToInventory = function(){
$state.go('inventoryManage', {group: undefined}, {reload: true});
};
}];
}];

View File

@ -17,7 +17,7 @@
<span ng-if="!isRootState()">
<li class="BreadCrumb-item"></li>
<li ng-repeat="group in groups track by $index" class="BreadCrumb-item">
<a href ng-click="goToGroup($index)">{{group.name}}</a>
<a href ng-click="goToGroup($index+1)">{{group.name}}</a>
</li>
<li class="BreadCrumb-item"></li>
</span>

View File

@ -112,7 +112,11 @@
$state.go('inventoryManage', {failed: true}, {reload: true});
};
$scope.scheduleGroup = function(id) {
$state.go('inventoryManage.schedules', {id: id});
// Add this group's id to the array of group id's so that it gets
// added to the breadcrumb trail
var groupsArr = $stateParams.group ? $stateParams.group : [];
groupsArr.push(id);
$state.go('inventoryManage.schedules', {id: id, group: groupsArr}, {reload: true});
};
// $scope.$parent governed by InventoryManageController, for unified multiSelect options
$scope.$on('multiSelectList.selectionChanged', (event, selection) => {