[Time Conductor] Fixing bugs found in smoke testing. Fixes #933

This commit is contained in:
Henry 2016-09-09 16:39:21 -07:00
parent fbab890081
commit e639e056ba
13 changed files with 44 additions and 45 deletions

View File

@ -30,7 +30,7 @@ define(['../../../platform/features/conductor-v2/conductor/src/timeSystems/Local
this.metadata = { this.metadata = {
key: 'test-lad', key: 'test-lad',
mode: 'LAD', mode: 'lad',
cssclass: 'icon-clock', cssclass: 'icon-clock',
label: 'Latest Available Data', label: 'Latest Available Data',
name: 'Latest available data', name: 'Latest available data',

View File

@ -25,9 +25,7 @@ define([
'../../../platform/features/conductor-v2/conductor/src/timeSystems/LocalClock', '../../../platform/features/conductor-v2/conductor/src/timeSystems/LocalClock',
'./LADTickSource' './LADTickSource'
], function (TimeSystem, LocalClock, LADTickSource) { ], function (TimeSystem, LocalClock, LADTickSource) {
var FIFTEEN_MINUTES = 15 * 60 * 1000, var THIRTY_MINUTES = 30 * 60 * 1000,
THIRTY_MINUTES = 30 * 60 * 1000,
ONE_HOUR = 60 * 60 * 1000,
DEFAULT_PERIOD = 1000; DEFAULT_PERIOD = 1000;
/** /**
@ -49,14 +47,14 @@ define([
'glyph': '\u0043' 'glyph': '\u0043'
}; };
this._formats = ['local-format']; this.fmts = ['local-format'];
this._tickSources = [new LocalClock($timeout, DEFAULT_PERIOD), new LADTickSource($timeout, DEFAULT_PERIOD)]; this.sources = [new LocalClock($timeout, DEFAULT_PERIOD), new LADTickSource($timeout, DEFAULT_PERIOD)];
} }
LocalTimeSystem.prototype = Object.create(TimeSystem.prototype); LocalTimeSystem.prototype = Object.create(TimeSystem.prototype);
LocalTimeSystem.prototype.formats = function () { LocalTimeSystem.prototype.formats = function () {
return this._formats; return this.fmts;
}; };
LocalTimeSystem.prototype.deltaFormat = function () { LocalTimeSystem.prototype.deltaFormat = function () {
@ -64,7 +62,7 @@ define([
}; };
LocalTimeSystem.prototype.tickSources = function () { LocalTimeSystem.prototype.tickSources = function () {
return this._tickSources; return this.sources;
}; };
LocalTimeSystem.prototype.defaults = function (key) { LocalTimeSystem.prototype.defaults = function (key) {

12
main.js
View File

@ -91,10 +91,14 @@ define([
'./platform/features/pages/bundle', './platform/features/pages/bundle',
'./platform/features/plot/bundle', './platform/features/plot/bundle',
'./platform/features/timeline/bundle', './platform/features/timeline/bundle',
// Old time conductor
//'./platform/features/conductor/bundle', //'./platform/features/conductor/bundle',
'./platform/features/conductor-v2/conductor/bundle',
'./platform/features/conductor-v2/compatibility/bundle', // New time conductor
'./platform/features/conductor-v2/utcTimeSystem/bundle', //'./platform/features/conductor-v2/conductor/bundle',
//'./platform/features/conductor-v2/compatibility/bundle',
//'./platform/features/conductor-v2/utcTimeSystem/bundle',
'./platform/features/table/bundle', './platform/features/table/bundle',
'./platform/forms/bundle', './platform/forms/bundle',
'./platform/identity/bundle', './platform/identity/bundle',
@ -106,7 +110,7 @@ define([
'./platform/search/bundle', './platform/search/bundle',
'./platform/status/bundle', './platform/status/bundle',
'./platform/commonUI/regions/bundle' './platform/commonUI/regions/bundle'
//'./example/localTimeSystem/bundle'
], function (Main, legacyRegistry) { ], function (Main, legacyRegistry) {
return { return {

View File

@ -59,9 +59,5 @@
</mct-representation> </mct-representation>
</div> </div>
</div> </div>
<mct-include key="'time-conductor'" class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder"></mct-include> <mct-include key="'conductor'" class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder"></mct-include>
<!-- <mct-representation mct-object="domainObject"
key="'time-conductor'"
class="abs holder flex-elem flex-fixed l-flex-row l-time-conductor-holder">
</mct-representation> -->
</div> </div>

View File

@ -116,6 +116,7 @@ $colorProgressBarAmt: $colorKey;
$progressBarHOverlay: 15px; $progressBarHOverlay: 15px;
$progressBarStripeW: 20px; $progressBarStripeW: 20px;
$shdwStatusIc: rgba(black, 0.4) 0 1px 2px; $shdwStatusIc: rgba(black, 0.4) 0 1px 2px;
$animPausedPulseDur: 500ms;
// Selects // Selects
$colorSelectBg: $colorBtnBg; $colorSelectBg: $colorBtnBg;

View File

@ -116,6 +116,7 @@ $colorProgressBarAmt: #0a0;
$progressBarHOverlay: 15px; $progressBarHOverlay: 15px;
$progressBarStripeW: 20px; $progressBarStripeW: 20px;
$shdwStatusIc: rgba(white, 0.8) 0 0px 5px; $shdwStatusIc: rgba(white, 0.8) 0 0px 5px;
$animPausedPulseDur: 1s;
// Selects // Selects
$colorSelectBg: $colorBtnBg; $colorSelectBg: $colorBtnBg;

View File

@ -93,22 +93,22 @@ define([
], ],
"templates": [ "templates": [
{ {
"key": "time-conductor", "key": "conductor",
"template": timeConductorTemplate "template": timeConductorTemplate
},
{
"key": "mode-menu",
"template": modeMenuTemplate
},
{
"key": "mode-selector",
"template": modeSelectorTemplate
} }
], ],
"representations": [ "representations": [
{ {
"key": "time-conductor", "key": "time-conductor",
"template": timeConductorTemplate "template": timeConductorTemplate
},
{
"key": "mode-selector",
"template": modeSelectorTemplate
},
{
"key": "mode-menu",
"template": modeMenuTemplate
} }
], ],
"formats": [ "formats": [

View File

@ -233,7 +233,7 @@
// Real-time, latest modes // Real-time, latest modes
&.realtime-mode, &.realtime-mode,
&.latest-mode { &.lad-mode {
.time-conductor-icon { .time-conductor-icon {
&:before { color: $colorTimeCondKeyBg; } &:before { color: $colorTimeCondKeyBg; }
div[class*="hand"] { div[class*="hand"] {
@ -318,7 +318,7 @@
} }
// LAD mode // LAD mode
&.latest-mode { &.lad-mode {
$i: $glyph-icon-database; $i: $glyph-icon-database;
.time-conductor-icon div[class*="hand"] { .time-conductor-icon div[class*="hand"] {
@include animation-name(clock-hands-sticky); @include animation-name(clock-hands-sticky);
@ -411,7 +411,7 @@
// Real-time, latest modes // Real-time, latest modes
&.realtime-mode, &.realtime-mode,
&.latest-mode { &.lad-mode {
.l-time-conductor-inputs-and-ticks { .l-time-conductor-inputs-and-ticks {
.l-time-range-w { .l-time-range-w {
&.start-w { &.start-w {

View File

@ -24,8 +24,8 @@
<ul> <ul>
<li ng-repeat="(key, metadata) in ngModel.options" <li ng-repeat="(key, metadata) in ngModel.options"
ng-click="ngModel.selectedKey=key"> ng-click="ngModel.selectedKey=key">
<a ng-mouseover="representation.activeMetadata = metadata" <a ng-mouseover="ngModel.activeMetadata = metadata"
ng-mouseleave="representation.activeMetadata = undefined" ng-mouseleave="ngModel.activeMetadata = undefined"
class="menu-item-a {{metadata.cssclass}}"> class="menu-item-a {{metadata.cssclass}}">
{{metadata.name}} {{metadata.name}}
</a> </a>
@ -33,12 +33,13 @@
</ul> </ul>
</div> </div>
<div class="pane right menu-item-description"> <div class="pane right menu-item-description">
<div class="desc-area ui-symbol icon type-icon {{representation.activeMetadata.cssclass}}"></div> <div
class="desc-area ui-symbol icon type-icon {{ngModel.activeMetadata.cssclass}}"></div>
<div class="desc-area title"> <div class="desc-area title">
{{representation.activeMetadata.name}} {{ngModel.activeMetadata.name}}
</div> </div>
<div class="desc-area description"> <div class="desc-area description">
{{representation.activeMetadata.description}} {{ngModel.activeMetadata.description}}
</div> </div>
</div> </div>
</div> </div>

View File

@ -27,9 +27,8 @@
</div> </div>
<div class="menu super-menu mini mode-selector-menu" <div class="menu super-menu mini mode-selector-menu"
ng-show="modeController.isActive()"> ng-show="modeController.isActive()">
<mct-representation mct-object="domainObject" <mct-include key="'mode-menu'"
key="'mode-menu'"
ng-model="ngModel"> ng-model="ngModel">
</mct-representation> </mct-include>
</div> </div>
</span> </span>

View File

@ -83,12 +83,11 @@
<!-- Holds time system and session selectors, and zoom control --> <!-- Holds time system and session selectors, and zoom control -->
<div class="l-time-conductor-controls l-row-elem l-flex-row flex-elem"> <div class="l-time-conductor-controls l-row-elem l-flex-row flex-elem">
<mct-representation <mct-include
key="'mode-selector'" key="'mode-selector'"
mct-object="domainObject"
ng-model="modeModel" ng-model="modeModel"
class="holder flex-elem menus-up mode-selector"> class="holder flex-elem menus-up mode-selector">
</mct-representation> </mct-include>
<mct-control <mct-control
key="'menu-button'" key="'menu-button'"
class="holder flex-elem menus-up time-system" class="holder flex-elem menus-up time-system"

View File

@ -85,9 +85,9 @@ define(
} }
//Only show 'LAD mode' if appropriate time systems available //Only show 'LAD mode' if appropriate time systems available
if (timeSystemsForMode('LAD').length > 0) { if (timeSystemsForMode('lad').length > 0) {
var ladMode = { var ladMode = {
key: 'LAD', key: 'lad',
cssclass: 'icon-database', cssclass: 'icon-database',
label: 'LAD', label: 'LAD',
name: 'LAD Mode', name: 'LAD Mode',

View File

@ -112,7 +112,7 @@ define(['./TimeConductorViewService'], function (TimeConductorViewService) {
var mockTimeSystems = [mockConstructor(tickingTimeSystem)]; var mockTimeSystems = [mockConstructor(tickingTimeSystem)];
var mockLADTickSource = { var mockLADTickSource = {
metadata: { metadata: {
mode: 'LAD' mode: 'lad'
} }
}; };
tickingTimeSystem.tickSources.andReturn([mockLADTickSource]); tickingTimeSystem.tickSources.andReturn([mockLADTickSource]);
@ -120,7 +120,7 @@ define(['./TimeConductorViewService'], function (TimeConductorViewService) {
viewService = new TimeConductorViewService(mockTimeConductor, mockTimeSystems); viewService = new TimeConductorViewService(mockTimeConductor, mockTimeSystems);
var availableModes = viewService.availableModes(); var availableModes = viewService.availableModes();
expect(availableModes.LAD).toBeDefined(); expect(availableModes.lad).toBeDefined();
}); });
describe("when mode is changed", function () { describe("when mode is changed", function () {