
This re-adds the Tempest timeline view as a set of Angular directives. This includes related functionality, such as the Dstat parser and some array utilities. The timeline view consists of a timeline component, which includes the d3 chart, and a separate details component, which shows additional information for tests when selected in the timeline. Change-Id: Ifaaeda91b0617e8cf7a60d30728005f5c8d00546
45 lines
922 B
JavaScript
45 lines
922 B
JavaScript
'use strict';
|
|
|
|
var directivesModule = require('./_index.js');
|
|
|
|
/**
|
|
* @ngInject
|
|
*/
|
|
function timelineDetails() {
|
|
var controller = function($scope) {
|
|
$scope.item = null;
|
|
|
|
$scope.$watch('hoveredItem', function(value) {
|
|
if (value && !$scope.selectedItem) {
|
|
$scope.item = value;
|
|
} else if (!value && !$scope.selectedItem) {
|
|
$scope.item = null;
|
|
}
|
|
});
|
|
|
|
$scope.$watch('selectedItem', function(value) {
|
|
if (value) {
|
|
$scope.item = value;
|
|
} else {
|
|
if ($scope.hoveredItem) {
|
|
$scope.item = $scope.hoveredItem;
|
|
} else {
|
|
$scope.item = null;
|
|
}
|
|
}
|
|
});
|
|
};
|
|
|
|
return {
|
|
restrict: 'EA',
|
|
scope: {
|
|
'hoveredItem': '=',
|
|
'selectedItem': '='
|
|
},
|
|
controller: controller,
|
|
templateUrl: 'directives/timeline-details.html'
|
|
};
|
|
}
|
|
|
|
directivesModule.directive('timelineDetails', timelineDetails);
|