From 344a325cb5c6cc38a8534cd54eded33d9473d935 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 12:27:52 -0700 Subject: [PATCH 01/10] [Time] Tick when clock set Update time API to tick immediately after setting a clock using the currentValue of the clock. This ensures that bounds will be set when the clock is set, instead of waiting for the next tick to occur. fixes https://github.com/nasa/openmct/issues/1582 --- src/api/time/TimeAPI.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/time/TimeAPI.js b/src/api/time/TimeAPI.js index aea887e756..8d73a99722 100644 --- a/src/api/time/TimeAPI.js +++ b/src/api/time/TimeAPI.js @@ -366,11 +366,6 @@ define(['EventEmitter'], function (EventEmitter) { this.activeClock = clock; - if (this.activeClock !== undefined) { - this.offsets = offsets; - this.activeClock.on("tick", this.tick); - } - /** * The active clock has changed. Clock can be unset by calling {@link stopClock} * @event clock @@ -380,6 +375,11 @@ define(['EventEmitter'], function (EventEmitter) { */ this.emit("clock", this.activeClock); + if (this.activeClock !== undefined) { + this.clockOffsets(offsets); + this.activeClock.on("tick", this.tick); + } + } else if (arguments.length === 1) { throw "When setting the clock, clock offsets must also be provided"; } From fbf736aaf708058e83a9251ba569f7a69fa7060e Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 13:07:17 -0700 Subject: [PATCH 02/10] [Conductor] improve validation, properly set defaults Update conductor validation logic to trigger easier-to-understand error messages for bad configurations. Update default-setting-behavior to properly set clock and offsets when the default option is clock-based menu option. Only set defaults when timeSystem has not already been configured. fixes https://github.com/nasa/openmct/issues/1580 --- src/plugins/timeConductor/plugin.js | 120 ++++++++++++++++++---------- 1 file changed, 76 insertions(+), 44 deletions(-) diff --git a/src/plugins/timeConductor/plugin.js b/src/plugins/timeConductor/plugin.js index 3485ae4004..ad8a716781 100644 --- a/src/plugins/timeConductor/plugin.js +++ b/src/plugins/timeConductor/plugin.js @@ -22,28 +22,75 @@ define([], function () { + function validateMenuOption(menuOption, index) { + if (menuOption.clock && !menuOption.clockOffsets) { + return "clock-based menuOption at index " + index + " is " + + "missing required property 'clockOffsets'."; + } + if (!menuOption.timeSystem) { + return "menuOption at index " + index + " is missing " + + "required property 'timeSystem'."; + } + if (!menuOption.bounds && !menuOption.clock) { + return "fixed-bounds menuOption at index " + index + " is " + + "missing required property 'bounds'"; + } + } + + function validateConfiguration(config) { + if (config === undefined || + config.menuOptions === undefined || + config.menuOptions.length === 0) { + return "You must specify one or more 'menuOptions'."; + } + if (config.menuOptions.some(validateMenuOption)) { + return config.menuOptions.map(validateMenuOption) + .filter(function (err) { return !!err; }) + .join('\n'); + } + return undefined; + } + + function validateRuntimeConfiguration(config, openmct) { + var systems = openmct.time.getAllTimeSystems() + .reduce(function (m, ts) { + m[ts.key] = ts; + return m; + }, {}); + var clocks = openmct.time.getAllClocks() + .reduce(function (m, c) { + m[c.key] = c; + return m; + }, {}); + + return config.menuOptions.map(function (menuOption, index) { + if (menuOption.timeSystem && !systems[menuOption.timeSystem]) { + return "menuOption at index " + index + " specifies a " + + "timeSystem that does not exist: " + menuOption.timeSystem; + } + if (menuOption.clock && !clocks[menuOption.clock]) { + return "menuOption at index " + index + " specifies a " + + "clock that does not exist: " + menuOption.clock; + } + }) + .filter(function (err) { return !!err; }) + .join('\n'); + } + + function throwConfigErrorIfExists(error) { + if (error) { + throw new Error("Invalid Time Conductor Configuration: \n" + + error + '\n' + + "https://github.com/nasa/openmct/blob/master/API.md#the-time-conductor"); + } + } + return function (config) { - function validateConfiguration() { - if (config === undefined || config.menuOptions === undefined || config.menuOptions.length === 0) { - return "Please provide some configuration for the time conductor. https://github.com/nasa/openmct/blob/master/API.md#the-time-conductor"; - } - return undefined; - } + throwConfigErrorIfExists(validateConfiguration(config)); return function (openmct) { - function getTimeSystem(key) { - return openmct.time.getAllTimeSystems().filter(function (timeSystem) { - return timeSystem.key === key; - })[0]; - } - - var validationError = validateConfiguration(); - if (validationError) { - throw validationError; - } - openmct.legacyExtension('constants', { key: 'CONDUCTOR_CONFIG', value: config, @@ -54,39 +101,24 @@ define([], function () { openmct.legacyRegistry.enable('platform/features/conductor/compatibility'); openmct.on('start', function () { + + throwConfigErrorIfExists(validateRuntimeConfiguration(config, openmct)); + /* - On app startup, default the conductor + On app startup, default the conductor if not already set. */ - var timeSystem = openmct.time.timeSystem(); - var clock = openmct.time.clock(); - - if (timeSystem === undefined) { - timeSystem = getTimeSystem(config.menuOptions[0].timeSystem); - if (timeSystem === undefined) { - throw 'Please install and configure at least one time system'; - } + if (openmct.time.timeSystem() !== undefined) { + return; } - var configForTimeSystem = config.menuOptions.filter(function (menuOption) { - return menuOption.timeSystem === timeSystem.key && menuOption.clock === (clock && clock.key); - })[0]; - - if (configForTimeSystem !== undefined) { - var bounds; - if (clock === undefined) { - bounds = configForTimeSystem.bounds; - } else { - var clockOffsets = configForTimeSystem.clockOffsets; - - bounds = { - start: clock.currentValue() + clockOffsets.start, - end: clock.currentValue() + clockOffsets.end - }; - } - openmct.time.timeSystem(timeSystem, bounds); + var defaults = config.menuOptions[0]; + if (defaults.clock) { + openmct.time.clock(defaults.clock, defaults.clockOffsets); + openmct.time.timeSystem(defaults.timeSystem, openmct.time.bounds()); } else { - throw 'Invalid time conductor configuration. Please define defaults for time system "' + timeSystem.key + '"'; + openmct.time.timeSystem(defaults.timeSystem, defaults.bounds); } + }); }; }; From 9f32b4b9cd06eb41423430f84fab025c1bf0ae08 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 13:49:12 -0700 Subject: [PATCH 03/10] [Spec] Update spec for new usage Add a test for new bounds setting behavior, update other tests to provide correct mocks for new usage of APIs. https://github.com/nasa/openmct/issues/1582 --- src/api/time/TimeAPISpec.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/api/time/TimeAPISpec.js b/src/api/time/TimeAPISpec.js index e7d15b3f5a..1ea7c4b219 100644 --- a/src/api/time/TimeAPISpec.js +++ b/src/api/time/TimeAPISpec.js @@ -136,26 +136,35 @@ define(['./TimeAPI'], function (TimeAPI) { var anotherMockTickSource; var mockOffsets = { start: 0, - end: 0 + end: 1 }; beforeEach(function () { mockTickSource = jasmine.createSpyObj("clock", [ "on", - "off" + "off", + "currentValue" ]); + mockTickSource.currentValue.andReturn(10); mockTickSource.key = "mts"; anotherMockTickSource = jasmine.createSpyObj("clock", [ "on", - "off" + "off", + "currentValue" ]); anotherMockTickSource.key = "amts"; + anotherMockTickSource.currentValue.andReturn(10); api.addClock(mockTickSource); api.addClock(anotherMockTickSource); }); + it("sets bounds based on current value", function () { + api.clock("mts", mockOffsets); + expect(api.bounds()).toEqual({start: 10, end: 11}); + }); + it("a new tick listener is registered", function () { api.clock("mts", mockOffsets); expect(mockTickSource.on).toHaveBeenCalledWith("tick", jasmine.any(Function)); @@ -180,8 +189,10 @@ define(['./TimeAPI'], function (TimeAPI) { it("on tick, observes offsets, and indicates tick in bounds callback", function () { var mockTickSource = jasmine.createSpyObj("clock", [ "on", - "off" + "off", + "currentValue" ]); + mockTickSource.currentValue.andReturn(100); var tickCallback; var boundsCallback = jasmine.createSpy("boundsCallback"); var clockOffsets = { From b8ae741969ea177e88a23f1eb89a97a9def9eeaa Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 14:13:08 -0700 Subject: [PATCH 04/10] [Conductor] remove misleading error When a menu option that specified an invalid time system with a clock, the time conductor controller would log an error claiming that the clock was unknown when in fact the time system is the culprit. Remove the error message as the plugin handles this validation already. Also removed some unused code. https://github.com/nasa/openmct/issues/1580 --- .../core/src/ui/TimeConductorController.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/platform/features/conductor/core/src/ui/TimeConductorController.js b/platform/features/conductor/core/src/ui/TimeConductorController.js index 6b9296916b..0d339fe3e2 100644 --- a/platform/features/conductor/core/src/ui/TimeConductorController.js +++ b/platform/features/conductor/core/src/ui/TimeConductorController.js @@ -98,7 +98,6 @@ define( this.validation = new TimeConductorValidation(this.timeAPI); this.formatService = formatService; this.config = config; - this.clocksForTimeSystem = {}; this.timeSystemsForClocks = {}; this.$scope.timeSystemModel = {}; this.$scope.boundsModel = {}; @@ -209,28 +208,17 @@ define( cssClass: 'icon-calendar' }]; var clocks = {}; - var clocksForTimeSystem = this.clocksForTimeSystem; var timeSystemsForClocks = this.timeSystemsForClocks; (config.menuOptions || []).forEach(function (menuOption) { - var clock = this.getClock(menuOption.clock); var clockKey = menuOption.clock || 'fixed'; var timeSystem = this.timeSystems[menuOption.timeSystem]; if (timeSystem !== undefined) { - if (clock !== undefined) { - // Use an associative array to built a set of unique - // clocks - clocks[clock.key] = clock; - clocksForTimeSystem[timeSystem.key] = clocksForTimeSystem[timeSystem.key] || []; - clocksForTimeSystem[timeSystem.key].push(clock); - } timeSystemsForClocks[clockKey] = timeSystemsForClocks[clockKey] || []; timeSystemsForClocks[clockKey].push(timeSystem); - } else if (menuOption.clock !== undefined) { - console.error('Unknown clock "' + clockKey + '", has it been registered?'); } - }.bind(this)); + }, this); /* * Populate the clocks menu with metadata from the available clocks From b70501a7ed264845e259ffdc82fe7c0efe184fc2 Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 14:31:20 -0700 Subject: [PATCH 05/10] [Time] conditional timeSystem change without bounds Allow timeSystem to be changed without specifying bounds when a clock is present and can provide bounds. This simplifies bootstrap code. https://github.com/nasa/openmct/issues/1581 --- src/api/time/TimeAPI.js | 14 ++++++++++---- src/api/time/TimeAPISpec.js | 28 +++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/api/time/TimeAPI.js b/src/api/time/TimeAPI.js index 8d73a99722..18c26fc99d 100644 --- a/src/api/time/TimeAPI.js +++ b/src/api/time/TimeAPI.js @@ -239,7 +239,13 @@ define(['EventEmitter'], function (EventEmitter) { * @method timeSystem */ TimeAPI.prototype.timeSystem = function (timeSystemOrKey, bounds) { - if (arguments.length >= 2) { + if (arguments.length >= 1) { + if (arguments.length === 1 && !this.activeClock) { + throw new Error( + "Must specify bounds when changing time system without " + + "an active clock." + ); + } var timeSystem; if (timeSystemOrKey === undefined) { @@ -274,10 +280,10 @@ define(['EventEmitter'], function (EventEmitter) { * Time System * */ this.emit('timeSystem', this.system); - this.bounds(bounds); + if (bounds) { + this.bounds(bounds); + } - } else if (arguments.length === 1) { - throw new Error('Must set bounds when changing time system'); } return this.system; diff --git a/src/api/time/TimeAPISpec.js b/src/api/time/TimeAPISpec.js index 1ea7c4b219..6efbbfd490 100644 --- a/src/api/time/TimeAPISpec.js +++ b/src/api/time/TimeAPISpec.js @@ -25,6 +25,8 @@ define(['./TimeAPI'], function (TimeAPI) { var api, timeSystemKey, timeSystem, + clockKey, + clock, bounds, eventListener, toi; @@ -33,7 +35,15 @@ define(['./TimeAPI'], function (TimeAPI) { api = new TimeAPI(); timeSystemKey = "timeSystemKey"; timeSystem = {key: timeSystemKey}; - bounds = {start: 0, end: 0}; + clockKey = "someClockKey"; + clock = jasmine.createSpyObj("clock", [ + "on", + "off", + "currentValue" + ]); + clock.currentValue.andReturn(100); + clock.key = clockKey; + bounds = {start: 0, end: 1}; eventListener = jasmine.createSpy("eventListener"); toi = 111; }); @@ -74,11 +84,23 @@ define(['./TimeAPI'], function (TimeAPI) { it("Disallows setting of time system without bounds", function () { api.addTimeSystem(timeSystem); - expect(api.timeSystem()).not.toBe(timeSystemKey); + expect(api.timeSystem()).not.toBe(timeSystem); expect(function () { api.timeSystem(timeSystemKey); }).toThrow(); - expect(api.timeSystem()).not.toBe(timeSystemKey); + expect(api.timeSystem()).not.toBe(timeSystem); + }); + + it("allows setting of timesystem without bounds with clock", function () { + api.addTimeSystem(timeSystem); + api.addClock(clock); + api.clock(clockKey, {start: 0, end: 1}) + expect(api.timeSystem()).not.toBe(timeSystem); + expect(function () { + api.timeSystem(timeSystemKey); + }).not.toThrow(); + expect(api.timeSystem()).toBe(timeSystem); + }); it("Emits an event when time system changes", function () { From 749a2ba08803744480c46da910f18e4f46f8bd9b Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 14:56:56 -0700 Subject: [PATCH 06/10] [Docs] Update Time API docs Update time API docs to accurately reflect usage of the time API. --- API.md | 106 +++++++++++++++++++++++++-------------------------------- 1 file changed, 47 insertions(+), 59 deletions(-) diff --git a/API.md b/API.md index 052f4257ea..882c80b946 100644 --- a/API.md +++ b/API.md @@ -547,29 +547,24 @@ numbers in UTC terrestrial time. #### Getting and Setting the Active Time System -Once registered, a time system can be activated using a key, or an instance of -the time system itself. +Once registered, a time system can be activated by calling `timeSystem` with +the timeSystem `key` or an instance of the time system. If you are not using a +[clock](#clocks), you must also specify valid [bounds](#time-bounds) for the +timeSystem. ```javascript -openmct.time.timeSystem('utc'); +openmct.time.timeSystem('utc', bounds); ``` -A time system can be immediately activated upon registration: +A time system can be immediately activated after registration: ```javascript -var utcTimeSystem = { - key: 'utc', - name: 'UTC Time', - cssClass = 'icon-clock', - timeFormat = 'utc', - durationFormat = 'duration', - isUTCBased = true -}; openmct.time.addTimeSystem(utcTimeSystem); -openmct.time.timeSystem(utcTimeSystem); +openmct.time.timeSystem(utcTimeSystem, bounds); ``` -Setting the active time system will trigger a [time system event](#time-events). +Setting the active time system will trigger a [`'timeSystem'`](#time-events) +event. If you supplied bounds, a [`'bounds'`](#time-events) event will be triggered afterwards with your newly supplied bounds. ### Time Bounds @@ -592,8 +587,8 @@ let now = Date.now(); openmct.time.bounds({start: now - ONE_HOUR, now); ``` -To respond to bounds change events, simply register a callback against the `bounds` -event. For more information on the bounds event, please see the section on [Time Events](#time-events). +To respond to bounds change events, listen for the [`'bounds'`](#time-events) +event. ## Clocks @@ -673,14 +668,16 @@ An example clock implementation is provided in the form of the [LocalClock](http Once registered a clock can be activated by calling the `clock` function on the Time API passing in the key or instance of a registered clock. Only one clock may be active at once, so activating a clock will deactivate any currently -active clock. Setting the clock will also trigger a ['clock' event](#time-events). +active clock. [`clockOffsets`](#clock-offsets) must be specified when changing a clock. + +Setting the clock triggers a [`'clock'`](#time-events) event, followed by a [`'clockOffsets'`](#time-events) event, and then a [`'bounds'`](#time-events) event as the offsets are applied to the clock's currentValue(). + ``` -openmct.time.clock(someClock); +openmct.time.clock(someClock, clockOffsets); ``` -Upon being activated, a clock's `on` function will be immediately called to subscribe -to `tick` events. +Upon being activated, the time API will listen for tick events on the clock by calling `clock.on`. The currently active clock (if any) can be retrieved by calling the same function without any arguments. @@ -707,7 +704,7 @@ relative time spans. Offsets are defined as an object with two properties: * `start`: A `number` that must be < 0 and which is used to calculate the start bounds on each clock tick. The start offset will be calculated relative to the value provided by a clock's tick callback, or its `currentValue()` function. -* `end`: A `number` that must be >=0 and which is used to calculate the end +* `end`: A `number` that must be >= 0 and which is used to calculate the end bounds on each clock tick. The `clockOffsets` function can be used to get or set clock offsets. For example, @@ -728,16 +725,9 @@ Clock offsets are only relevant when a clock source is active. ## Time Events -The time API supports the registration of listeners that will be invoked when the -application's temporal state changes. Events listeners can be registered using -the `on` function. They can be deregistered using the `off` function. The arguments -accepted by the `on` and `off` functions are: +The Time API is a standard event emitter; you can register callbacks for events using the `on` method and remove callbacks for events with the `off` method. -* `event`: A `string` naming the event to subscribe to. Event names correspond to -the property of the Time API you're interested in. A [full list of time events](#list-of-time-events) -is provided later. - -As an example, the code to listen to bounds change events looks like: +For example: ``` javascript openmct.time.on('bounds', function callback (newBounds, tick) { @@ -747,40 +737,38 @@ openmct.time.on('bounds', function callback (newBounds, tick) { #### List of Time Events -The events supported by the Time API are: +The events emitted by the Time API are: -* `bounds`: Listen for changes to current bounds. The callback will be invoked -with two arguments: - * `bounds`: A [bounds](#getting-and-setting-bounds) bounds object representing - a new time period bound by the specified start and send times. - * `tick`: A `boolean` indicating whether or not this bounds change is due to a - "tick" from a [clock source](#clocks). This information can be useful when - determining a strategy for fetching telemetry data in response to a bounds - change event. For example, if the bounds change was automatic, and is due - to a tick then it's unlikely that you would need to perform a historical - data query. It should be sufficient to just show any new telemetry received - via subscription since the last tick, and optionally to discard any older - data that now falls outside of the currently set bounds. If `tick` is false, - then the bounds change was not due to an automatic tick, and a query for - historical data may be necessary, depending on your data caching strategy, - and how significantly the start bound has changed. -* `timeSystem`: Listen for changes to the active [time system](#defining-and-registering-time-systems). -The callback will be invoked with a single argument - the newly active time system. - * `timeSystem`: The newly active [time system](#defining-and-registering-time-systems) object. -* `clock`: Listen for changes to the active clock. When invoked, the callback -will be provided with the new clock. - * `clock`: The newly active [clock](#clocks), or `undefined` if an active clock - has been deactivated. -* `clockOffsets`: Listen for changes to active clock offsets. When invoked the -callback will be provided with the new clock offsets. - * `clockOffsets`: A [clock offsets](#clock-offsets) object. +* `bounds`: emitted whenever the bounds change. The callback will be invoked + with two arguments: + * `bounds`: A [bounds](#getting-and-setting-bounds) bounds object + representing a new time period bound by the specified start and send times. + * `tick`: A `boolean` indicating whether or not this bounds change is due to + a "tick" from a [clock source](#clocks). This information can be useful + when determining a strategy for fetching telemetry data in response to a + bounds change event. For example, if the bounds change was automatic, and + is due to a tick then it's unlikely that you would need to perform a + historical data query. It should be sufficient to just show any new + telemetry received via subscription since the last tick, and optionally to + discard any older data that now falls outside of the currently set bounds. + If `tick` is false,then the bounds change was not due to an automatic tick, + and a query for historical data may be necessary, depending on your data + caching strategy, and how significantly the start bound has changed. +* `timeSystem`: emitted whenever the active time system changes. The callback will be invoked with a single argument: + * `timeSystem`: The newly active [time system](#defining-and-registering-time-systems). +* `clock`: emitted whenever the clock changes. The callback will be invoked + with a single argument: + * `clock`: The newly active [clock](#clocks), or `undefined` if an active + clock has been deactivated. +* `clockOffsets`: emitted whenever the active clock offsets change. The + callback will be invoked with a single argument: + * `clockOffsets`: The new [clock offsets](#clock-offsets). ## The Time Conductor -The Time Conductor provides a user interface for managing time bounds in Open MCT. -It allows a user to select from configured time systems and clocks, and to set bounds -and clock offsets. +The Time Conductor provides a user interface for managing time bounds in Open +MCT. It allows a user to select from configured time systems and clocks, and to set bounds and clock offsets. If activated, the time conductor must be provided with configuration options, detailed below. From e2f9a0c9cdd7621e91d0591df954e10b264f3e2f Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 14:58:46 -0700 Subject: [PATCH 07/10] [dev] proper realtime in dev environment In dev environment, use proper realtime with a clock. --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 4efabc1771..9b6f732346 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,8 @@ openmct.install(openmct.plugins.Espresso()); openmct.install(openmct.plugins.Generator()); openmct.install(openmct.plugins.UTCTimeSystem()); - openmct.time.timeSystem("utc", {start: Date.now() - THIRTY_MINUTES, end: Date.now()}); + openmct.time.clock('local', {start: -THIRTY_MINUTES, end: 0}); + openmct.time.timeSystem('utc'); openmct.start(); }); From 6e4abcfed8d5d430612307c13d43a6962ee41e5a Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 15:08:05 -0700 Subject: [PATCH 08/10] [Style] Fix style --- src/plugins/timeConductor/plugin.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/timeConductor/plugin.js b/src/plugins/timeConductor/plugin.js index ad8a716781..7213ab024d 100644 --- a/src/plugins/timeConductor/plugin.js +++ b/src/plugins/timeConductor/plugin.js @@ -22,6 +22,10 @@ define([], function () { + function isTruthy(a) { + return !!a; + } + function validateMenuOption(menuOption, index) { if (menuOption.clock && !menuOption.clockOffsets) { return "clock-based menuOption at index " + index + " is " + @@ -45,7 +49,7 @@ define([], function () { } if (config.menuOptions.some(validateMenuOption)) { return config.menuOptions.map(validateMenuOption) - .filter(function (err) { return !!err; }) + .filter(isTruthy) .join('\n'); } return undefined; @@ -69,11 +73,11 @@ define([], function () { "timeSystem that does not exist: " + menuOption.timeSystem; } if (menuOption.clock && !clocks[menuOption.clock]) { - return "menuOption at index " + index + " specifies a " + - "clock that does not exist: " + menuOption.clock; + return "menuOption at index " + index + " specifies a " + + "clock that does not exist: " + menuOption.clock; } }) - .filter(function (err) { return !!err; }) + .filter(isTruthy) .join('\n'); } From 0dc65f5dfb37651a3321bae3a5a7e288e53702cf Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 15:12:37 -0700 Subject: [PATCH 09/10] [Style] Remove trailing commas Remove trailing commas that snuck through in #1564. --- src/adapter/directives/MCTView.js | 2 +- src/api/composition/CompositionCollection.js | 2 +- src/api/telemetry/TelemetryAPI.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/adapter/directives/MCTView.js b/src/adapter/directives/MCTView.js index 1fa1c986d2..4fcc674155 100644 --- a/src/adapter/directives/MCTView.js +++ b/src/adapter/directives/MCTView.js @@ -22,7 +22,7 @@ define([ 'angular', - './Region', + './Region' ], function ( angular, Region diff --git a/src/api/composition/CompositionCollection.js b/src/api/composition/CompositionCollection.js index e1ba70497c..6d7adf5f4b 100644 --- a/src/api/composition/CompositionCollection.js +++ b/src/api/composition/CompositionCollection.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - 'lodash', + 'lodash' ], function ( _ ) { diff --git a/src/api/telemetry/TelemetryAPI.js b/src/api/telemetry/TelemetryAPI.js index 43e756d324..9161e8d4a2 100644 --- a/src/api/telemetry/TelemetryAPI.js +++ b/src/api/telemetry/TelemetryAPI.js @@ -23,7 +23,7 @@ define([ './TelemetryMetadataManager', './TelemetryValueFormatter', - 'lodash', + 'lodash' ], function ( TelemetryMetadataManager, TelemetryValueFormatter, From f4df84bfa115002e099aefbb0aede2b9061bdfaf Mon Sep 17 00:00:00 2001 From: Pete Richards Date: Tue, 16 May 2017 17:26:29 -0700 Subject: [PATCH 10/10] [Style] correct style --- .../features/conductor/core/src/ui/TimeConductorController.js | 1 - src/api/time/TimeAPISpec.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/platform/features/conductor/core/src/ui/TimeConductorController.js b/platform/features/conductor/core/src/ui/TimeConductorController.js index 0d339fe3e2..9233cebdb0 100644 --- a/platform/features/conductor/core/src/ui/TimeConductorController.js +++ b/platform/features/conductor/core/src/ui/TimeConductorController.js @@ -19,7 +19,6 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -/* global console*/ define( [ diff --git a/src/api/time/TimeAPISpec.js b/src/api/time/TimeAPISpec.js index 6efbbfd490..a786dcaaf3 100644 --- a/src/api/time/TimeAPISpec.js +++ b/src/api/time/TimeAPISpec.js @@ -94,7 +94,7 @@ define(['./TimeAPI'], function (TimeAPI) { it("allows setting of timesystem without bounds with clock", function () { api.addTimeSystem(timeSystem); api.addClock(clock); - api.clock(clockKey, {start: 0, end: 1}) + api.clock(clockKey, {start: 0, end: 1}); expect(api.timeSystem()).not.toBe(timeSystem); expect(function () { api.timeSystem(timeSystemKey);