Add breadcrumbs to system tracking page

This commit is contained in:
Joe Fiorini 2015-05-28 09:42:01 -04:00
parent 0507fd74b9
commit 657b41510c
5 changed files with 27 additions and 10 deletions

View File

@ -11,10 +11,11 @@ export default
$scope.breadcrumbs = [];
this.addBreadcrumb = function(title, path) {
this.addBreadcrumb = function(title, path, isCurrent) {
var breadcrumb =
{ title: title,
path: path
path: path,
isCurrent: isCurrent
};
if ($rootScope.enteredPath === path) {

View File

@ -4,10 +4,16 @@
* All Rights Reserved
*************************************************/
import {wrapDelegate} from './route-params.decorator';
export default
[ '$rootScope',
'$routeParams',
function($rootScope, $routeParams) {
$rootScope.$on('$routeChangeStart', function(e, newRoute) {
wrapDelegate(newRoute.params);
});
$rootScope.$on('$routeChangeSuccess', function(e, newRoute) {
if (angular.isUndefined(newRoute.model)) {
var keys = Object.keys(newRoute.params);

View File

@ -19,6 +19,10 @@ function controller($rootScope,
_) {
// var inventoryId = $routeParams.id;
var hostIds = $routeParams.hosts.split(',');
var hosts = $routeParams.model.hosts;
$scope.hostIds = $routeParams.hosts;
$scope.inventory = $routeParams.model.inventory;
$scope.factModulePickersLabelLeft = "Compare facts collected on";
$scope.factModulePickersLabelRight = "To facts collected on";
@ -68,8 +72,8 @@ function controller($rootScope,
$scope.comparisonLeftHeader = $scope.leftDate;
$scope.comparisonRightHeader = $scope.rightDate;
} else {
$scope.comparisonLeftHeader = hostIds[0];
$scope.comparisonRightHeader = hostIds[1];
$scope.comparisonLeftHeader = hosts[0].name;
$scope.comparisonRightHeader = hosts[1].name;
}
}

View File

@ -1,3 +1,9 @@
<breadcrumbs>
<breadcrumb path="/inventories" title="Inventories"></breadcrumb>
<breadcrumb path="/inventories/{{inventory.id}}/manage" title="{{inventory.name}}"></breadcrumb>
<breadcrumb path="/inventories/{{inventory.id}}/system-tracking/{{hostIds}}" title="System Tracking" current="true"></breadcrumb>
</breadcrumbs>
<div class="FactModulePickers">
<div class="FactModulePickers-dateContainer FactModulePickers-dateContainer--left">
<span class="FactModulePickers-label">{{ factModulePickersLabelLeft }}</span>

View File

@ -48,8 +48,8 @@ export default {
'Rest',
'GetBasePath',
function($route, $q, rest, getBasePath) {
if ($route.current.params.inventory) {
return $q.when(true);
if ($route.current.params.hasModelKey('inventory')) {
return $q.when($route.current.params.model.inventory);
}
var inventoryId = $route.current.params.inventory;
@ -62,17 +62,17 @@ export default {
});
}
],
filters:
hosts:
[ '$route',
'$q',
'Rest',
'GetBasePath',
function($route, $q, rest, getBasePath) {
if ($route.current.params.hosts) {
return $q.when(true);
if ($route.current.params.hasModelKey('hosts')) {
return $q.when($route.current.params.model.hosts);
}
var hostIds = $route.current.params.filters.split(',');
var hostIds = $route.current.params.hosts.split(',');
var hosts =
hostIds.map(function(hostId) {