diff --git a/example/eventGenerator/bundle.js b/example/eventGenerator/bundle.js index af93177764..f620b0559d 100644 --- a/example/eventGenerator/bundle.js +++ b/example/eventGenerator/bundle.js @@ -22,59 +22,60 @@ /*global define*/ define([ - "./src/EventTelemetryProvider", - 'legacyRegistry' + "./src/EventTelemetryProvider" ], function ( - EventTelemetryProvider, - legacyRegistry + EventTelemetryProvider ) { "use strict"; - legacyRegistry.register("example/eventGenerator", { - "name": "Event Message Generator", - "description": "For development use. Creates sample event message data that mimics a live data stream.", - "extensions": { - "components": [ - { - "implementation": EventTelemetryProvider, - "type": "provider", - "provides": "telemetryService", - "depends": [ - "$q", - "$timeout" - ] - } - ], - "types": [ - { - "key": "eventGenerator", - "name": "Event Message Generator", - "cssClass": "icon-generator-events", - "description": "For development use. Creates sample event message data that mimics a live data stream.", - "priority": 10, - "features": "creation", - "model": { - "telemetry": {} - }, - "telemetry": { - "source": "eventGenerator", - "domains": [ - { - "key": "utc", - "name": "Timestamp", - "format": "utc" - } - ], - "ranges": [ - { - "key": "message", - "name": "Message", - "format": "string" - } + return { + name:"example/eventGenerator", + definition: { + "name": "Event Message Generator", + "description": "For development use. Creates sample event message data that mimics a live data stream.", + "extensions": { + "components": [ + { + "implementation": EventTelemetryProvider, + "type": "provider", + "provides": "telemetryService", + "depends": [ + "$q", + "$timeout" ] } - } - ] + ], + "types": [ + { + "key": "eventGenerator", + "name": "Event Message Generator", + "cssClass": "icon-generator-events", + "description": "For development use. Creates sample event message data that mimics a live data stream.", + "priority": 10, + "features": "creation", + "model": { + "telemetry": {} + }, + "telemetry": { + "source": "eventGenerator", + "domains": [ + { + "key": "utc", + "name": "Timestamp", + "format": "utc" + } + ], + "ranges": [ + { + "key": "message", + "name": "Message", + "format": "string" + } + ] + } + } + ] + } } - }); + }; }); diff --git a/example/eventGenerator/src/EventTelemetry.js b/example/eventGenerator/src/EventTelemetry.js index ed6a64ad36..7c011cd2ef 100644 --- a/example/eventGenerator/src/EventTelemetry.js +++ b/example/eventGenerator/src/EventTelemetry.js @@ -48,11 +48,11 @@ define( (domain !== 'delta' ? firstObservedTime : 0); }; - generatorData.getRangeValue = function (i, range) { - var domainDelta = this.getDomainValue(i) - firstObservedTime, + generatorData.getRangeValue = function (i, range) { + var domainDelta = this.getDomainValue(i) - firstObservedTime, ind = i % messages.length; return messages[ind] + " - [" + domainDelta.toString() + "]"; - }; + }; return generatorData; } diff --git a/example/eventGenerator/src/EventTelemetryProvider.js b/example/eventGenerator/src/EventTelemetryProvider.js index 1768984ba0..90a00a5881 100644 --- a/example/eventGenerator/src/EventTelemetryProvider.js +++ b/example/eventGenerator/src/EventTelemetryProvider.js @@ -34,11 +34,9 @@ define( * @constructor */ function EventTelemetryProvider($q, $timeout) { - var - subscriptions = [], - genInterval = 1000, - generating = false, - id = Math.random() * 100000; + var subscriptions = [], + genInterval = 1000, + generating = false; // function matchesSource(request) { @@ -47,7 +45,6 @@ define( // Used internally; this will be repacked by doPackage function generateData(request) { - //console.log("generateData " + (Date.now() - startTime).toString()); return { key: request.key, telemetry: new EventTelemetry(request, genInterval) diff --git a/example/export/ExportTelemetryAsCSVAction.js b/example/export/ExportTelemetryAsCSVAction.js index f638ae7bcd..abdfdecad7 100644 --- a/example/export/ExportTelemetryAsCSVAction.js +++ b/example/export/ExportTelemetryAsCSVAction.js @@ -58,15 +58,15 @@ define([], function () { row, i; - function copyDomainsToRow(row, index) { + function copyDomainsToRow(telemetryRow, index) { domains.forEach(function (domain) { - row[domain.name] = series.getDomainValue(index, domain.key); + telemetryRow[domain.name] = series.getDomainValue(index, domain.key); }); } - function copyRangesToRow(row, index) { + function copyRangesToRow(telemetryRow, index) { ranges.forEach(function (range) { - row[range.name] = series.getRangeValue(index, range.key); + telemetryRow[range.name] = series.getRangeValue(index, range.key); }); } diff --git a/example/export/bundle.js b/example/export/bundle.js index 75e1937153..84acd71665 100644 --- a/example/export/bundle.js +++ b/example/export/bundle.js @@ -22,24 +22,26 @@ /*global define*/ define([ - 'legacyRegistry', './ExportTelemetryAsCSVAction' -], function (legacyRegistry, ExportTelemetryAsCSVAction) { +], function (ExportTelemetryAsCSVAction) { "use strict"; - legacyRegistry.register("example/export", { - "name": "Example of using CSV Export", - "extensions": { - "actions": [ - { - "key": "example.export", - "name": "Export Telemetry as CSV", - "implementation": ExportTelemetryAsCSVAction, - "category": "contextual", - "cssClass": "icon-download", - "depends": [ "exportService" ] - } - ] + return { + name:"example/export", + definition: { + "name": "Example of using CSV Export", + "extensions": { + "actions": [ + { + "key": "example.export", + "name": "Export Telemetry as CSV", + "implementation": ExportTelemetryAsCSVAction, + "category": "contextual", + "cssClass": "icon-download", + "depends": ["exportService"] + } + ] + } } - }); + }; }); diff --git a/example/forms/bundle.js b/example/forms/bundle.js index b2c4150fcc..d705837135 100644 --- a/example/forms/bundle.js +++ b/example/forms/bundle.js @@ -22,32 +22,33 @@ /*global define*/ define([ - "./src/ExampleFormController", - 'legacyRegistry' + "./src/ExampleFormController" ], function ( - ExampleFormController, - legacyRegistry + ExampleFormController ) { "use strict"; - legacyRegistry.register("example/forms", { - "name": "Declarative Forms example", - "sources": "src", - "extensions": { - "controllers": [ - { - "key": "ExampleFormController", - "implementation": ExampleFormController, - "depends": [ - "$scope" - ] - } - ], - "routes": [ - { - "templateUrl": "templates/exampleForm.html" - } - ] + return { + name:"example/forms", + definition: { + "name": "Declarative Forms example", + "sources": "src", + "extensions": { + "controllers": [ + { + "key": "ExampleFormController", + "implementation": ExampleFormController, + "depends": [ + "$scope" + ] + } + ], + "routes": [ + { + "templateUrl": "templates/exampleForm.html" + } + ] + } } - }); + }; }); diff --git a/example/generator/GeneratorProvider.js b/example/generator/GeneratorProvider.js index e942391adb..a699b9335d 100644 --- a/example/generator/GeneratorProvider.js +++ b/example/generator/GeneratorProvider.js @@ -52,7 +52,7 @@ define([ 'period', 'offset', 'dataRateInHz', - 'phase', + 'phase' ]; request = request || {}; diff --git a/example/generator/SinewaveLimitProvider.js b/example/generator/SinewaveLimitProvider.js index c1fb39a0df..a7fbd2cb03 100644 --- a/example/generator/SinewaveLimitProvider.js +++ b/example/generator/SinewaveLimitProvider.js @@ -28,7 +28,7 @@ define([ ) { var RED = { - sin: 0.9, + sin: 0.9, cos: 0.9 }, YELLOW = { @@ -74,7 +74,7 @@ define([ return { evaluate: function (datum, valueMetadata) { var range = valueMetadata && valueMetadata.key; - + if (datum[range] > RED[range]) { return LIMITS.rh; } diff --git a/example/generator/WorkerInterface.js b/example/generator/WorkerInterface.js index 9c348da71f..a8af1dc7aa 100644 --- a/example/generator/WorkerInterface.js +++ b/example/generator/WorkerInterface.js @@ -89,7 +89,7 @@ define([ WorkerInterface.prototype.subscribe = function (request, cb) { function callback(message) { cb(message.data); - }; + } var messageId = this.dispatch('subscribe', request, callback); diff --git a/example/generator/generatorWorker.js b/example/generator/generatorWorker.js index 32e9e4c5e1..c1d1918dc5 100644 --- a/example/generator/generatorWorker.js +++ b/example/generator/generatorWorker.js @@ -84,10 +84,10 @@ function onRequest(message) { var request = message.data; - if (request.end == undefined) { + if (request.end === undefined) { request.end = Date.now(); } - if (request.start == undefined){ + if (request.start === undefined) { request.start = request.end - FIFTEEN_MINUTES; } diff --git a/example/generator/plugin.js b/example/generator/plugin.js index 66a7c76d76..2201e9a40a 100644 --- a/example/generator/plugin.js +++ b/example/generator/plugin.js @@ -33,7 +33,7 @@ define([ GeneratorMetadataProvider ) { - return function(openmct){ + return function (openmct) { openmct.types.addType("example.state-generator", { name: "State Generator", diff --git a/example/identity/bundle.js b/example/identity/bundle.js index 6a1fad72bd..44ed78d33f 100644 --- a/example/identity/bundle.js +++ b/example/identity/bundle.js @@ -22,27 +22,28 @@ /*global define*/ define([ - "./src/ExampleIdentityService", - 'legacyRegistry' + "./src/ExampleIdentityService" ], function ( - ExampleIdentityService, - legacyRegistry + ExampleIdentityService ) { "use strict"; - legacyRegistry.register("example/identity", { - "extensions": { - "components": [ - { - "implementation": ExampleIdentityService, - "provides": "identityService", - "type": "provider", - "depends": [ - "dialogService", - "$q" - ] - } - ] + return { + name:"example/identity", + definition: { + "extensions": { + "components": [ + { + "implementation": ExampleIdentityService, + "provides": "identityService", + "type": "provider", + "depends": [ + "dialogService", + "$q" + ] + } + ] + } } - }); + }; }); diff --git a/example/imagery/plugin.js b/example/imagery/plugin.js index 21d2cd7c2c..8d3d4211ed 100644 --- a/example/imagery/plugin.js +++ b/example/imagery/plugin.js @@ -22,31 +22,31 @@ define([ -], function( +], function ( ) { function ImageryPlugin() { var IMAGE_SAMPLES = [ - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18731.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18732.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18733.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18734.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18735.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18736.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18737.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18738.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18739.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18740.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18741.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18742.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18743.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18744.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18745.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18746.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18747.jpg", - "https://www.hq.nasa.gov/alsj/a16/AS16-117-18748.jpg" - ]; + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18731.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18732.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18733.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18734.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18735.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18736.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18737.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18738.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18739.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18740.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18741.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18742.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18743.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18744.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18745.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18746.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18747.jpg", + "https://www.hq.nasa.gov/alsj/a16/AS16-117-18748.jpg" + ]; function pointForTimestamp(timestamp, name) { return { @@ -65,7 +65,7 @@ define([ callback(pointForTimestamp(Date.now(), domainObject.name)); }, 5000); - return function (interval) { + return function () { clearInterval(interval); }; } diff --git a/example/mobile/bundle.js b/example/mobile/bundle.js index 6cf7f8c0d7..8b5dd04988 100644 --- a/example/mobile/bundle.js +++ b/example/mobile/bundle.js @@ -21,25 +21,22 @@ *****************************************************************************/ /*global define*/ -define([ - - 'legacyRegistry' -], function ( - - legacyRegistry -) { +define([], function () { "use strict"; - legacyRegistry.register("example/mobile", { - "name": "Mobile", - "description": "Allows elements with pertinence to mobile usage and development", - "extensions": { - "stylesheets": [ - { - "stylesheetUrl": "css/mobile-example.css", - "priority": "mandatory" - } - ] + return { + name:"example/mobile", + definition: { + "name": "Mobile", + "description": "Allows elements with pertinence to mobile usage and development", + "extensions": { + "stylesheets": [ + { + "stylesheetUrl": "css/mobile-example.css", + "priority": "mandatory" + } + ] + } } - }); + }; }); diff --git a/example/msl/bundle.js b/example/msl/bundle.js index ec212be873..23a8f46d0b 100644 --- a/example/msl/bundle.js +++ b/example/msl/bundle.js @@ -24,92 +24,92 @@ define([ "./src/RemsTelemetryServerAdapter", "./src/RemsTelemetryModelProvider", - "./src/RemsTelemetryProvider", - 'legacyRegistry', - "module" + "./src/RemsTelemetryProvider" ], function ( RemsTelemetryServerAdapter, RemsTelemetryModelProvider, - RemsTelemetryProvider, - legacyRegistry + RemsTelemetryProvider ) { "use strict"; - legacyRegistry.register("example/msl", { - "name" : "Mars Science Laboratory Data Adapter", - "extensions" : { - "types": [ - { - "name":"Mars Science Laboratory", - "key": "msl.curiosity", - "cssClass": "icon-object" - }, - { - "name": "Instrument", - "key": "msl.instrument", - "cssClass": "icon-object", - "model": {"composition": []} - }, - { - "name": "Measurement", - "key": "msl.measurement", - "cssClass": "icon-telemetry", - "model": {"telemetry": {}}, - "telemetry": { - "source": "rems.source", - "domains": [ - { - "name": "Time", - "key": "utc", - "format": "utc" - } - ] + return { + name:"example/msl", + definition: { + "name" : "Mars Science Laboratory Data Adapter", + "extensions" : { + "types": [ + { + "name":"Mars Science Laboratory", + "key": "msl.curiosity", + "cssClass": "icon-object" + }, + { + "name": "Instrument", + "key": "msl.instrument", + "cssClass": "icon-object", + "model": {"composition": []} + }, + { + "name": "Measurement", + "key": "msl.measurement", + "cssClass": "icon-telemetry", + "model": {"telemetry": {}}, + "telemetry": { + "source": "rems.source", + "domains": [ + { + "name": "Time", + "key": "utc", + "format": "utc" + } + ] + } } - } - ], - "constants": [ - { - "key": "REMS_WS_URL", - "value": "/proxyUrl?url=http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php" - } - ], - "roots": [ - { - "id": "msl:curiosity" - } - ], - "models": [ - { - "id": "msl:curiosity", - "priority": "preferred", - "model": { - "type": "msl.curiosity", - "name": "Mars Science Laboratory", - "composition": ["msl_tlm:rems"] + ], + "constants": [ + { + "key": "REMS_WS_URL", + "value": "/proxyUrl?url=http://cab.inta-csic.es/rems/wp-content/plugins/marsweather-widget/api.php" } - } - ], - "services": [ - { - "key":"rems.adapter", - "implementation": RemsTelemetryServerAdapter, - "depends": ["$http", "$log", "REMS_WS_URL"] - } - ], - "components": [ - { - "provides": "modelService", - "type": "provider", - "implementation": RemsTelemetryModelProvider, - "depends": ["rems.adapter"] - }, - { - "provides": "telemetryService", - "type": "provider", - "implementation": RemsTelemetryProvider, - "depends": ["rems.adapter", "$q"] - } - ] + ], + "roots": [ + { + "id": "msl:curiosity" + } + ], + "models": [ + { + "id": "msl:curiosity", + "priority": "preferred", + "model": { + "type": "msl.curiosity", + "name": "Mars Science Laboratory", + "composition": ["msl_tlm:rems"] + } + } + ], + "services": [ + { + "key":"rems.adapter", + "implementation": RemsTelemetryServerAdapter, + "depends": ["$http", "$log", "REMS_WS_URL"] + } + ], + "components": [ + { + "provides": "modelService", + "type": "provider", + "implementation": RemsTelemetryModelProvider, + "depends": ["rems.adapter"] + }, + { + "provides": "telemetryService", + "type": "provider", + "implementation": RemsTelemetryProvider, + "depends": ["rems.adapter", "$q"] + } + ] + } } - }); + }; }); diff --git a/example/msl/src/MSLDataDictionary.js b/example/msl/src/MSLDataDictionary.js index e6b6a08415..f114dae36e 100644 --- a/example/msl/src/MSLDataDictionary.js +++ b/example/msl/src/MSLDataDictionary.js @@ -76,4 +76,4 @@ define( ] }; } -); \ No newline at end of file +); diff --git a/example/msl/src/RemsTelemetryModelProvider.js b/example/msl/src/RemsTelemetryModelProvider.js index 0b55559708..fdaaf8b52d 100644 --- a/example/msl/src/RemsTelemetryModelProvider.js +++ b/example/msl/src/RemsTelemetryModelProvider.js @@ -22,7 +22,7 @@ /*global define*/ define( - function (){ + function () { "use strict"; var PREFIX = "msl_tlm:", @@ -32,20 +32,20 @@ define( string: "string" }; - function RemsTelemetryModelProvider(adapter){ + function RemsTelemetryModelProvider(adapter) { function isRelevant(id) { return id.indexOf(PREFIX) === 0; } - function makeId(element){ + function makeId(element) { return PREFIX + element.identifier; } - function buildTaxonomy(dictionary){ + function buildTaxonomy(dictionary) { var models = {}; - function addMeasurement(measurement, parent){ + function addMeasurement(measurement, parent) { var format = FORMAT_MAPPINGS[measurement.type]; models[makeId(measurement)] = { type: "msl.measurement", @@ -73,12 +73,12 @@ define( location: spacecraftId, composition: measurements.map(makeId) }; - measurements.forEach(function(measurement) { + measurements.forEach(function (measurement) { addMeasurement(measurement, instrumentId); }); } - (dictionary.instruments || []).forEach(function(instrument) { + (dictionary.instruments || []).forEach(function (instrument) { addInstrument(instrument, "msl:curiosity"); }); return models; diff --git a/example/msl/src/RemsTelemetryProvider.js b/example/msl/src/RemsTelemetryProvider.js index fd52879aa6..bc13bf8803 100644 --- a/example/msl/src/RemsTelemetryProvider.js +++ b/example/msl/src/RemsTelemetryProvider.js @@ -72,10 +72,10 @@ define ( * This data source does not support real-time subscriptions */ RemsTelemetryProvider.prototype.subscribe = function (callback, requests) { - return function() {}; + return function () {}; }; RemsTelemetryProvider.prototype.unsubscribe = function (callback, requests) { - return function() {}; + return function () {}; }; return RemsTelemetryProvider; diff --git a/example/msl/src/RemsTelemetrySeries.js b/example/msl/src/RemsTelemetrySeries.js index 127d77a419..5dcd47e3c9 100644 --- a/example/msl/src/RemsTelemetrySeries.js +++ b/example/msl/src/RemsTelemetrySeries.js @@ -54,8 +54,8 @@ define( * @returns {number} A count of the number of data values available in * this series */ - RemsTelemetrySeries.prototype.getPointCount = function() { - return this.data.length; + RemsTelemetrySeries.prototype.getPointCount = function () { + return this.data.length; }; /** * The domain value at the given index. The Rems telemetry data is @@ -64,8 +64,8 @@ define( * @param index * @returns {number} the time value in ms since 1 January 1970 */ - RemsTelemetrySeries.prototype.getDomainValue = function(index) { - return this.data[index].date; + RemsTelemetrySeries.prototype.getDomainValue = function (index) { + return this.data[index].date; }; /** @@ -75,8 +75,8 @@ define( * value of. * @returns {number} A floating point number */ - RemsTelemetrySeries.prototype.getRangeValue = function(index) { - return this.data[index].value; + RemsTelemetrySeries.prototype.getRangeValue = function (index) { + return this.data[index].value; }; return RemsTelemetrySeries; diff --git a/example/msl/src/RemsTelemetryServerAdapter.js b/example/msl/src/RemsTelemetryServerAdapter.js index 6fd05c2289..dce3669da7 100644 --- a/example/msl/src/RemsTelemetryServerAdapter.js +++ b/example/msl/src/RemsTelemetryServerAdapter.js @@ -68,18 +68,18 @@ define( * given request ID. * @private */ - RemsTelemetryServerAdapter.prototype.requestHistory = function(request) { + RemsTelemetryServerAdapter.prototype.requestHistory = function (request) { var self = this, id = request.key; var dataTransforms = this.dataTransforms; - function processResponse(response){ + function processResponse(response) { var data = []; /* * History data is organised by Sol. Iterate over sols... */ - response.data.soles.forEach(function(solData){ + response.data.soles.forEach(function (solData) { /* * Check that valid data exists */ @@ -106,13 +106,13 @@ define( //Filter results to match request parameters function filterResults(results) { - return results.filter(function(result){ + return results.filter(function (result) { return result.date >= (request.start || Number.MIN_VALUE) && result.date <= (request.end || Number.MAX_VALUE); }); } - function packageAndResolve(results){ + function packageAndResolve(results) { return {id: id, values: results}; } @@ -132,7 +132,7 @@ define( * @param id The telemetry data point key to be queried. * @returns {Promise | Array} that resolves with an Array of {@link RemsTelemetryValue} objects for the request data key. */ - RemsTelemetryServerAdapter.prototype.history = function(request) { + RemsTelemetryServerAdapter.prototype.history = function (request) { return this.requestHistory(request); }; diff --git a/example/notifications/bundle.js b/example/notifications/bundle.js index 46ab95978d..ed9ef1b620 100644 --- a/example/notifications/bundle.js +++ b/example/notifications/bundle.js @@ -27,64 +27,65 @@ define([ "./src/DialogLaunchIndicator", "./src/NotificationLaunchIndicator", "./res/dialog-launch.html", - "./res/notification-launch.html", - 'legacyRegistry' + "./res/notification-launch.html" ], function ( DialogLaunchController, NotificationLaunchController, DialogLaunchIndicator, NotificationLaunchIndicator, DialogLaunch, - NotificationLaunch, - legacyRegistry + NotificationLaunch ) { "use strict"; - legacyRegistry.register("example/notifications", { - "extensions": { - "templates": [ - { - "key": "dialogLaunchTemplate", - "template": DialogLaunch - }, - { - "key": "notificationLaunchTemplate", - "template": NotificationLaunch - } - ], - "controllers": [ - { - "key": "DialogLaunchController", - "implementation": DialogLaunchController, - "depends": [ - "$scope", - "$timeout", - "$log", - "dialogService", - "notificationService" - ] - }, - { - "key": "NotificationLaunchController", - "implementation": NotificationLaunchController, - "depends": [ - "$scope", - "$timeout", - "$log", - "notificationService" - ] - } - ], - "indicators": [ - { - "implementation": DialogLaunchIndicator, - "priority": "fallback" - }, - { - "implementation": NotificationLaunchIndicator, - "priority": "fallback" - } - ] + return { + name:"example/notifications", + definition: { + "extensions": { + "templates": [ + { + "key": "dialogLaunchTemplate", + "template": DialogLaunch + }, + { + "key": "notificationLaunchTemplate", + "template": NotificationLaunch + } + ], + "controllers": [ + { + "key": "DialogLaunchController", + "implementation": DialogLaunchController, + "depends": [ + "$scope", + "$timeout", + "$log", + "dialogService", + "notificationService" + ] + }, + { + "key": "NotificationLaunchController", + "implementation": NotificationLaunchController, + "depends": [ + "$scope", + "$timeout", + "$log", + "notificationService" + ] + } + ], + "indicators": [ + { + "implementation": DialogLaunchIndicator, + "priority": "fallback" + }, + { + "implementation": NotificationLaunchIndicator, + "priority": "fallback" + } + ] + } } - }); + }; }); diff --git a/example/notifications/src/DialogLaunchController.js b/example/notifications/src/DialogLaunchController.js index d42096de6c..674f9a12ce 100644 --- a/example/notifications/src/DialogLaunchController.js +++ b/example/notifications/src/DialogLaunchController.js @@ -137,12 +137,12 @@ define( " attention to an event.", severity: "info", primaryOption: { - label: "OK", - callback: function () { - $log.debug("OK Pressed"); - dialog.dismiss(); - } + label: "OK", + callback: function () { + $log.debug("OK Pressed"); + dialog.dismiss(); } + } }; dialog = dialogService.showBlockingMessage(model); diff --git a/example/persistence/bundle.js b/example/persistence/bundle.js index 4190dd1f95..41bcd58f7c 100644 --- a/example/persistence/bundle.js +++ b/example/persistence/bundle.js @@ -22,33 +22,34 @@ /*global define*/ define([ - "./src/BrowserPersistenceProvider", - 'legacyRegistry' + "./src/BrowserPersistenceProvider" ], function ( - BrowserPersistenceProvider, - legacyRegistry + BrowserPersistenceProvider ) { "use strict"; - legacyRegistry.register("example/persistence", { - "extensions": { - "components": [ - { - "provides": "persistenceService", - "type": "provider", - "implementation": BrowserPersistenceProvider, - "depends": [ - "$q", - "PERSISTENCE_SPACE" - ] - } - ], - "constants": [ - { - "key": "PERSISTENCE_SPACE", - "value": "mct" - } - ] + return { + name:"example/persistence", + definition: { + "extensions": { + "components": [ + { + "provides": "persistenceService", + "type": "provider", + "implementation": BrowserPersistenceProvider, + "depends": [ + "$q", + "PERSISTENCE_SPACE" + ] + } + ], + "constants": [ + { + "key": "PERSISTENCE_SPACE", + "value": "mct" + } + ] + } } - }); + }; }); diff --git a/example/policy/bundle.js b/example/policy/bundle.js index 7b40c1940c..79e4609f65 100644 --- a/example/policy/bundle.js +++ b/example/policy/bundle.js @@ -22,24 +22,25 @@ /*global define*/ define([ - "./src/ExamplePolicy", - 'legacyRegistry' + "./src/ExamplePolicy" ], function ( - ExamplePolicy, - legacyRegistry + ExamplePolicy ) { "use strict"; - legacyRegistry.register("example/policy", { - "name": "Example Policy", - "description": "Provides an example of using policies to prohibit actions.", - "extensions": { - "policies": [ - { - "implementation": ExamplePolicy, - "category": "action" - } - ] + return { + name:"example/policy", + definition: { + "name": "Example Policy", + "description": "Provides an example of using policies to prohibit actions.", + "extensions": { + "policies": [ + { + "implementation": ExamplePolicy, + "category": "action" + } + ] + } } - }); + }; }); diff --git a/example/profiling/bundle.js b/example/profiling/bundle.js index d048cb3299..46c265e65e 100644 --- a/example/profiling/bundle.js +++ b/example/profiling/bundle.js @@ -23,33 +23,34 @@ define([ "./src/WatchIndicator", - "./src/DigestIndicator", - 'legacyRegistry' + "./src/DigestIndicator" ], function ( WatchIndicator, - DigestIndicator, - legacyRegistry + DigestIndicator ) { "use strict"; - legacyRegistry.register("example/profiling", { - "extensions": { - "indicators": [ - { - "implementation": WatchIndicator, - "depends": [ - "$interval", - "$rootScope" - ] - }, - { - "implementation": DigestIndicator, - "depends": [ - "$interval", - "$rootScope" - ] - } - ] + return { + name:"example/profiling", + definition: { + "extensions": { + "indicators": [ + { + "implementation": WatchIndicator, + "depends": [ + "$interval", + "$rootScope" + ] + }, + { + "implementation": DigestIndicator, + "depends": [ + "$interval", + "$rootScope" + ] + } + ] + } } - }); + }; }); diff --git a/example/scratchpad/bundle.js b/example/scratchpad/bundle.js index 4eaa50e80d..7aa4727087 100644 --- a/example/scratchpad/bundle.js +++ b/example/scratchpad/bundle.js @@ -22,42 +22,43 @@ /*global define*/ define([ - "./src/ScratchPersistenceProvider", - 'legacyRegistry' + "./src/ScratchPersistenceProvider" ], function ( - ScratchPersistenceProvider, - legacyRegistry + ScratchPersistenceProvider ) { "use strict"; - legacyRegistry.register("example/scratchpad", { - "extensions": { - "roots": [ - { - "id": "scratch:root" - } - ], - "models": [ - { - "id": "scratch:root", - "model": { - "type": "folder", - "composition": [], - "name": "Scratchpad" - }, - "priority": "preferred" - } - ], - "components": [ - { - "provides": "persistenceService", - "type": "provider", - "implementation": ScratchPersistenceProvider, - "depends": [ - "$q" - ] - } - ] + return { + name:"example/scratchpad", + definition: { + "extensions": { + "roots": [ + { + "id": "scratch:root" + } + ], + "models": [ + { + "id": "scratch:root", + "model": { + "type": "folder", + "composition": [], + "name": "Scratchpad" + }, + "priority": "preferred" + } + ], + "components": [ + { + "provides": "persistenceService", + "type": "provider", + "implementation": ScratchPersistenceProvider, + "depends": [ + "$q" + ] + } + ] + } } - }); + }; }); diff --git a/example/scratchpad/src/ScratchPersistenceProvider.js b/example/scratchpad/src/ScratchPersistenceProvider.js index ed03befe09..17826f4169 100644 --- a/example/scratchpad/src/ScratchPersistenceProvider.js +++ b/example/scratchpad/src/ScratchPersistenceProvider.js @@ -60,7 +60,7 @@ define( ScratchPersistenceProvider.prototype.readObject = function (space, key) { return this.$q.when( (space === 'scratch' && this.table[key]) ? - JSON.parse(this.table[key]) : undefined + JSON.parse(this.table[key]) : undefined ); }; diff --git a/example/simpleVuePlugin/plugin.js b/example/simpleVuePlugin/plugin.js index dbd99ac08b..b8ae10424c 100644 --- a/example/simpleVuePlugin/plugin.js +++ b/example/simpleVuePlugin/plugin.js @@ -1,10 +1,8 @@ import Vue from 'Vue'; import HelloWorld from './HelloWorld.vue'; -function SimpleVuePlugin () { +function SimpleVuePlugin() { return function install(openmct) { - var views = (openmct.mainViews || openmct.objectViews); - openmct.types.addType('hello-world', { name: 'Hello World', description: 'An introduction object', diff --git a/example/styleguide/bundle.js b/example/styleguide/bundle.js index b06fa66676..735a3a1e94 100644 --- a/example/styleguide/bundle.js +++ b/example/styleguide/bundle.js @@ -8,8 +8,7 @@ define([ "./res/templates/glyphs.html", "./res/templates/controls.html", "./res/templates/input.html", - "./res/templates/menus.html", - 'legacyRegistry' + "./res/templates/menus.html" ], function ( ExampleStyleGuideModelProvider, MCTExample, @@ -20,13 +19,14 @@ define([ glyphsTemplate, controlsTemplate, inputTemplate, - menusTemplate, - legacyRegistry + menusTemplate ) { - legacyRegistry.register("example/styleguide", { - "name": "Open MCT Style Guide", - "description": "Examples and documentation illustrating UI styles in use in Open MCT.", - "extensions": + return { + name:"example/styleguide", + definition: { + "name": "Open MCT Style Guide", + "description": "Examples and documentation illustrating UI styles in use in Open MCT.", + "extensions": { "types": [ { "key": "styleguide.intro", "name": "Introduction", "cssClass": "icon-page", "description": "Introduction and overview to the style guide" }, @@ -103,5 +103,6 @@ define([ } ] } - }); + } + }; }); diff --git a/example/styleguide/src/ExampleStyleGuideModelProvider.js b/example/styleguide/src/ExampleStyleGuideModelProvider.js index 98ee8ba6fe..13da02d722 100644 --- a/example/styleguide/src/ExampleStyleGuideModelProvider.js +++ b/example/styleguide/src/ExampleStyleGuideModelProvider.js @@ -30,14 +30,14 @@ define( var pages = {}; // Add pages - pages['intro'] = { name: "Introduction", type: "styleguide.intro", location: "styleguide:home" }; - pages['standards'] = { name: "Standards", type: "styleguide.standards", location: "styleguide:home" }; - pages['colors'] = { name: "Colors", type: "styleguide.colors", location: "styleguide:home" }; - pages['glyphs'] = { name: "Glyphs", type: "styleguide.glyphs", location: "styleguide:home" }; - pages['status'] = { name: "Status Indication", type: "styleguide.status", location: "styleguide:home" }; - pages['controls'] = { name: "Controls", type: "styleguide.controls", location: "styleguide:ui-elements" }; - pages['input'] = { name: "Text Inputs", type: "styleguide.input", location: "styleguide:ui-elements" }; - pages['menus'] = { name: "Menus", type: "styleguide.menus", location: "styleguide:ui-elements" }; + pages.intro = { name: "Introduction", type: "styleguide.intro", location: "styleguide:home" }; + pages.standards = { name: "Standards", type: "styleguide.standards", location: "styleguide:home" }; + pages.colors = { name: "Colors", type: "styleguide.colors", location: "styleguide:home" }; + pages.glyphs = { name: "Glyphs", type: "styleguide.glyphs", location: "styleguide:home" }; + pages.status = { name: "Status Indication", type: "styleguide.status", location: "styleguide:home" }; + pages.controls = { name: "Controls", type: "styleguide.controls", location: "styleguide:ui-elements" }; + pages.input = { name: "Text Inputs", type: "styleguide.input", location: "styleguide:ui-elements" }; + pages.menus = { name: "Menus", type: "styleguide.menus", location: "styleguide:ui-elements" }; return { getModels: function () { @@ -48,4 +48,4 @@ define( return ExampleStyleGuideModelProvider } -); \ No newline at end of file +); diff --git a/package.json b/package.json index c0a3375af6..bfa7141129 100644 --- a/package.json +++ b/package.json @@ -74,8 +74,8 @@ }, "scripts": { "start": "node app.js", - "lint": "eslint platform src openmct.js", - "lint:fix": "eslint platform src openmct.js --fix", + "lint": "eslint platform example src openmct.js", + "lint:fix": "eslint platform example src openmct.js --fix", "build:prod": "NODE_ENV=production webpack", "build:dev": "webpack", "build:watch": "webpack --watch", diff --git a/platform/commonUI/about/bundle.js b/platform/commonUI/about/bundle.js index 1db1575ccf..ac56b658e9 100644 --- a/platform/commonUI/about/bundle.js +++ b/platform/commonUI/about/bundle.js @@ -31,8 +31,7 @@ define([ "./res/templates/license-apache.html", "./res/templates/license-mit.html", "./res/templates/licenses.html", - "./res/templates/licenses-export-md.html", - 'legacyRegistry' + "./res/templates/licenses-export-md.html" ], function ( aboutDialogTemplate, LogoController, @@ -44,137 +43,139 @@ define([ licenseApacheTemplate, licenseMitTemplate, licensesTemplate, - licensesExportMdTemplate, - legacyRegistry + licensesExportMdTemplate ) { - legacyRegistry.register("platform/commonUI/about", { - "name": "About Open MCT", - "extensions": { - "templates": [ - { - "key": "app-logo", - "priority": "optional", - "template": appLogoTemplate - }, - { - "key": "about-logo", - "priority": "preferred", - "template": aboutLogoTemplate - }, - { - "key": "about-dialog", - "template": aboutDialogTemplate - }, - { - "key": "overlay-about", - "template": overlayAboutTemplate - }, - { - "key": "license-apache", - "template": licenseApacheTemplate - }, - { - "key": "license-mit", - "template": licenseMitTemplate - } - ], - "controllers": [ - { - "key": "LogoController", - "depends": [ - "overlayService" - ], - "implementation": LogoController - }, - { - "key": "AboutController", - "depends": [ - "versions[]", - "$window" - ], - "implementation": AboutController - }, - { - "key": "LicenseController", - "depends": [ - "licenses[]" - ], - "implementation": LicenseController - } - ], - "licenses": [ - { - "name": "Json.NET", - "version": "6.0.8", - "author": "Newtonsoft", - "description": "JSON serialization/deserialization", - "website": "http://www.newtonsoft.com/json", - "copyright": "Copyright (c) 2007 James Newton-King", - "license": "license-mit", - "link": "https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md" - }, - { - "name": "Nancy", - "version": "0.23.2", - "author": "Andreas Håkansson, Steven Robbins and contributors", - "description": "Embedded web server", - "website": "http://nancyfx.org/", - "copyright": "Copyright © 2010 Andreas Håkansson, Steven Robbins and contributors", - "license": "license-mit", - "link": "http://www.opensource.org/licenses/mit-license.php" - }, - { - "name": "Nancy.Hosting.Self", - "version": "0.23.2", - "author": "Andreas Håkansson, Steven Robbins and contributors", - "description": "Embedded web server", - "website": "http://nancyfx.org/", - "copyright": "Copyright © 2010 Andreas Håkansson, Steven Robbins and contributors", - "license": "license-mit", - "link": "http://www.opensource.org/licenses/mit-license.php" - }, - { - "name": "SuperSocket", - "version": "0.9.0.2", - "author": " Kerry Jiang", - "description": "Supports SuperWebSocket", - "website": "https://supersocket.codeplex.com/", - "copyright": "Copyright 2010-2014 Kerry Jiang (kerry-jiang@hotmail.com)", - "license": "license-apache", - "link": "https://supersocket.codeplex.com/license" - }, - { - "name": "SuperWebSocket", - "version": "0.9.0.2", - "author": " Kerry Jiang", - "description": "WebSocket implementation for client-server communication", - "website": "https://superwebsocket.codeplex.com/", - "copyright": "Copyright 2010-2014 Kerry Jiang (kerry-jiang@hotmail.com)", - "license": "license-apache", - "link": "https://superwebsocket.codeplex.com/license" - }, - { - "name": "log4net", - "version": "2.0.3", - "author": "Apache Software Foundation", - "description": "Logging", - "website": "http://logging.apache.org/log4net/", - "copyright": "Copyright © 2004-2015 Apache Software Foundation.", - "license": "license-apache", - "link": "http://logging.apache.org/log4net/license.html" - } - ], - "routes": [ - { - "when": "/licenses", - "template": licensesTemplate - }, - { - "when": "/licenses-md", - "template": licensesExportMdTemplate - } - ] + return { + name:"platform/commonUI/about", + definition: { + "name": "About Open MCT", + "extensions": { + "templates": [ + { + "key": "app-logo", + "priority": "optional", + "template": appLogoTemplate + }, + { + "key": "about-logo", + "priority": "preferred", + "template": aboutLogoTemplate + }, + { + "key": "about-dialog", + "template": aboutDialogTemplate + }, + { + "key": "overlay-about", + "template": overlayAboutTemplate + }, + { + "key": "license-apache", + "template": licenseApacheTemplate + }, + { + "key": "license-mit", + "template": licenseMitTemplate + } + ], + "controllers": [ + { + "key": "LogoController", + "depends": [ + "overlayService" + ], + "implementation": LogoController + }, + { + "key": "AboutController", + "depends": [ + "versions[]", + "$window" + ], + "implementation": AboutController + }, + { + "key": "LicenseController", + "depends": [ + "licenses[]" + ], + "implementation": LicenseController + } + ], + "licenses": [ + { + "name": "Json.NET", + "version": "6.0.8", + "author": "Newtonsoft", + "description": "JSON serialization/deserialization", + "website": "http://www.newtonsoft.com/json", + "copyright": "Copyright (c) 2007 James Newton-King", + "license": "license-mit", + "link": "https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md" + }, + { + "name": "Nancy", + "version": "0.23.2", + "author": "Andreas Håkansson, Steven Robbins and contributors", + "description": "Embedded web server", + "website": "http://nancyfx.org/", + "copyright": "Copyright © 2010 Andreas Håkansson, Steven Robbins and contributors", + "license": "license-mit", + "link": "http://www.opensource.org/licenses/mit-license.php" + }, + { + "name": "Nancy.Hosting.Self", + "version": "0.23.2", + "author": "Andreas Håkansson, Steven Robbins and contributors", + "description": "Embedded web server", + "website": "http://nancyfx.org/", + "copyright": "Copyright © 2010 Andreas Håkansson, Steven Robbins and contributors", + "license": "license-mit", + "link": "http://www.opensource.org/licenses/mit-license.php" + }, + { + "name": "SuperSocket", + "version": "0.9.0.2", + "author": " Kerry Jiang", + "description": "Supports SuperWebSocket", + "website": "https://supersocket.codeplex.com/", + "copyright": "Copyright 2010-2014 Kerry Jiang (kerry-jiang@hotmail.com)", + "license": "license-apache", + "link": "https://supersocket.codeplex.com/license" + }, + { + "name": "SuperWebSocket", + "version": "0.9.0.2", + "author": " Kerry Jiang", + "description": "WebSocket implementation for client-server communication", + "website": "https://superwebsocket.codeplex.com/", + "copyright": "Copyright 2010-2014 Kerry Jiang (kerry-jiang@hotmail.com)", + "license": "license-apache", + "link": "https://superwebsocket.codeplex.com/license" + }, + { + "name": "log4net", + "version": "2.0.3", + "author": "Apache Software Foundation", + "description": "Logging", + "website": "http://logging.apache.org/log4net/", + "copyright": "Copyright © 2004-2015 Apache Software Foundation.", + "license": "license-apache", + "link": "http://logging.apache.org/log4net/license.html" + } + ], + "routes": [ + { + "when": "/licenses", + "template": licensesTemplate + }, + { + "when": "/licenses-md", + "template": licensesExportMdTemplate + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/browse/bundle.js b/platform/commonUI/browse/bundle.js index 8c3ad030fa..e9d8b4699a 100644 --- a/platform/commonUI/browse/bundle.js +++ b/platform/commonUI/browse/bundle.js @@ -32,8 +32,7 @@ define([ "./res/templates/menu-arrow.html", "./res/templates/back-arrow.html", "./res/templates/browse/object-properties.html", - "./res/templates/browse/inspector-region.html", - 'legacyRegistry' + "./res/templates/browse/inspector-region.html" ], function ( NavigationService, NavigateAction, @@ -46,131 +45,133 @@ define([ menuArrowTemplate, backArrowTemplate, objectPropertiesTemplate, - inspectorRegionTemplate, - legacyRegistry + inspectorRegionTemplate ) { - legacyRegistry.register("platform/commonUI/browse", { - "extensions": { - "routes": [ - ], - "constants": [ - { - "key": "DEFAULT_PATH", - "value": "mine", - "priority": "fallback" - } - ], - "representations": [ - { - "key": "browse-object", - "template": browseObjectTemplate, - "gestures": [ - "drop" - ], - "uses": [ - "view" - ] - }, - { - "key": "object-header", - "template": objectHeaderTemplate, - "uses": [ - "type" - ] - }, - { - "key": "object-header-frame", - "template": objectHeaderFrameTemplate, - "uses": [ - "type" - ] - }, - { - "key": "menu-arrow", - "template": menuArrowTemplate, - "uses": [ - "action" - ], - "gestures": [ - "menu" - ] - }, - { - "key": "back-arrow", - "uses": [ - "context" - ], - "template": backArrowTemplate - }, - { - "key": "object-properties", - "template": objectPropertiesTemplate - }, - { - "key": "inspector-region", - "template": inspectorRegionTemplate - } - ], - "services": [ - { - "key": "navigationService", - "implementation": NavigationService, - "depends": [ - "$window" - ] - } - ], - "actions": [ - { - "key": "navigate", - "implementation": NavigateAction, - "depends": [ - "navigationService" - ] - }, - { - "key": "window", - "name": "Open In New Tab", - "implementation": NewTabAction, - "description": "Open in a new browser tab", - "category": [ - "view-control", - "contextual" - ], - "depends": [ - "urlService", - "$window" - ], - "group": "windowing", - "cssClass": "icon-new-window", - "priority": "preferred" - } - ], - "runs": [ - { - "implementation": OrphanNavigationHandler, - "depends": [ - "throttle", - "topic", - "navigationService" - ] - } - ], - "templates": [ - { - key: "browseRoot", - template: browseTemplate - }, - { - key: "browseObject", - template: browseObjectTemplate - }, - { - key: "inspectorRegion", - template: inspectorRegionTemplate - } - ] + return { + name:"platform/commonUI/browse", + definition: { + "extensions": { + "routes": [ + ], + "constants": [ + { + "key": "DEFAULT_PATH", + "value": "mine", + "priority": "fallback" + } + ], + "representations": [ + { + "key": "browse-object", + "template": browseObjectTemplate, + "gestures": [ + "drop" + ], + "uses": [ + "view" + ] + }, + { + "key": "object-header", + "template": objectHeaderTemplate, + "uses": [ + "type" + ] + }, + { + "key": "object-header-frame", + "template": objectHeaderFrameTemplate, + "uses": [ + "type" + ] + }, + { + "key": "menu-arrow", + "template": menuArrowTemplate, + "uses": [ + "action" + ], + "gestures": [ + "menu" + ] + }, + { + "key": "back-arrow", + "uses": [ + "context" + ], + "template": backArrowTemplate + }, + { + "key": "object-properties", + "template": objectPropertiesTemplate + }, + { + "key": "inspector-region", + "template": inspectorRegionTemplate + } + ], + "services": [ + { + "key": "navigationService", + "implementation": NavigationService, + "depends": [ + "$window" + ] + } + ], + "actions": [ + { + "key": "navigate", + "implementation": NavigateAction, + "depends": [ + "navigationService" + ] + }, + { + "key": "window", + "name": "Open In New Tab", + "implementation": NewTabAction, + "description": "Open in a new browser tab", + "category": [ + "view-control", + "contextual" + ], + "depends": [ + "urlService", + "$window" + ], + "group": "windowing", + "cssClass": "icon-new-window", + "priority": "preferred" + } + ], + "runs": [ + { + "implementation": OrphanNavigationHandler, + "depends": [ + "throttle", + "topic", + "navigationService" + ] + } + ], + "templates": [ + { + key: "browseRoot", + template: browseTemplate + }, + { + key: "browseObject", + template: browseObjectTemplate + }, + { + key: "inspectorRegion", + template: inspectorRegionTemplate + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/dialog/bundle.js b/platform/commonUI/dialog/bundle.js index da8c89e334..7caf106ec7 100644 --- a/platform/commonUI/dialog/bundle.js +++ b/platform/commonUI/dialog/bundle.js @@ -30,8 +30,7 @@ define([ "./res/templates/message.html", "./res/templates/notification-message.html", "./res/templates/overlay-message-list.html", - "./res/templates/overlay.html", - 'legacyRegistry' + "./res/templates/overlay.html" ], function ( DialogService, OverlayService, @@ -42,70 +41,72 @@ define([ messageTemplate, notificationMessageTemplate, overlayMessageListTemplate, - overlayTemplate, - legacyRegistry + overlayTemplate ) { - legacyRegistry.register("platform/commonUI/dialog", { - "extensions": { - "services": [ - { - "key": "dialogService", - "implementation": DialogService, - "depends": [ - "overlayService", - "$q", - "$log", - "$document" - ] - }, - { - "key": "overlayService", - "implementation": OverlayService, - "depends": [ - "$document", - "$compile", - "$rootScope", - "$timeout" - ] - } - ], - "templates": [ - { - "key": "overlay-dialog", - "template": overlayDialogTemplate - }, - { - "key": "overlay-options", - "template": overlayOptionsTemplate - }, - { - "key": "form-dialog", - "template": dialogTemplate - }, - { - "key": "overlay-blocking-message", - "template": overlayBlockingMessageTemplate - }, - { - "key": "message", - "template": messageTemplate - }, - { - "key": "notification-message", - "template": notificationMessageTemplate - }, - { - "key": "overlay-message-list", - "template": overlayMessageListTemplate - } - ], - "containers": [ - { - "key": "overlay", - "template": overlayTemplate - } - ] + return { + name:"platform/commonUI/dialog", + definition: { + "extensions": { + "services": [ + { + "key": "dialogService", + "implementation": DialogService, + "depends": [ + "overlayService", + "$q", + "$log", + "$document" + ] + }, + { + "key": "overlayService", + "implementation": OverlayService, + "depends": [ + "$document", + "$compile", + "$rootScope", + "$timeout" + ] + } + ], + "templates": [ + { + "key": "overlay-dialog", + "template": overlayDialogTemplate + }, + { + "key": "overlay-options", + "template": overlayOptionsTemplate + }, + { + "key": "form-dialog", + "template": dialogTemplate + }, + { + "key": "overlay-blocking-message", + "template": overlayBlockingMessageTemplate + }, + { + "key": "message", + "template": messageTemplate + }, + { + "key": "notification-message", + "template": notificationMessageTemplate + }, + { + "key": "overlay-message-list", + "template": overlayMessageListTemplate + } + ], + "containers": [ + { + "key": "overlay", + "template": overlayTemplate + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index 2ffbb253f3..24ef914e50 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -48,8 +48,7 @@ define([ "./res/templates/library.html", "./res/templates/edit-object.html", "./res/templates/edit-action-buttons.html", - "./res/templates/topbar-edit.html", - 'legacyRegistry' + "./res/templates/topbar-edit.html" ], function ( EditActionController, EditPanesController, @@ -78,276 +77,277 @@ define([ libraryTemplate, editObjectTemplate, editActionButtonsTemplate, - topbarEditTemplate, - legacyRegistry + topbarEditTemplate ) { - - legacyRegistry.register("platform/commonUI/edit", { - "extensions": { - "controllers": [ - { - "key": "EditActionController", - "implementation": EditActionController, - "depends": [ - "$scope" - ] - }, - { - "key": "EditPanesController", - "implementation": EditPanesController, - "depends": [ - "$scope" - ] - }, - { - "key": "EditObjectController", - "implementation": EditObjectController, - "depends": [ - "$scope", - "$location", - "navigationService" - ] - }, - { - "key": "CreateMenuController", - "implementation": CreateMenuController, - "depends": [ - "$scope" - ] - }, - { - "key": "LocatorController", - "implementation": LocatorController, - "depends": [ - "$scope", - "$timeout", - "objectService" - ] - } - ], - "actions": [ - { - "key": "compose", - "implementation": EditAndComposeAction - }, - { - "key": "edit", - "implementation": EditAction, - "depends": [ - "$location", - "navigationService", - "$log" - ], - "description": "Edit", - "category": "view-control", - "cssClass": "major icon-pencil" - }, - { - "key": "properties", - "category": [ - "contextual", - "view-control" - ], - "implementation": PropertiesAction, - "cssClass": "major icon-pencil", - "name": "Edit Properties...", - "description": "Edit properties of this object.", - "depends": [ - "dialogService" - ] - }, - { - "key": "save-and-stop-editing", - "category": "save", - "implementation": SaveAndStopEditingAction, - "name": "Save and Finish Editing", - "cssClass": "icon-save labeled", - "description": "Save changes made to these objects.", - "depends": [ - "dialogService", - "notificationService" - ] - }, - { - "key": "save", - "category": "save", - "implementation": SaveAction, - "name": "Save and Continue Editing", - "cssClass": "icon-save labeled", - "description": "Save changes made to these objects.", - "depends": [ - "dialogService", - "notificationService" - ] - }, - { - "key": "save-as", - "category": "save", - "implementation": SaveAsAction, - "name": "Save As...", - "cssClass": "icon-save labeled", - "description": "Save changes made to these objects.", - "depends": [ - "$injector", - "dialogService", - "copyService", - "notificationService", - "openmct" - ], - "priority": "mandatory" - }, - { - "key": "cancel", - "category": "conclude-editing", - "implementation": CancelAction, - // Because we use the name as label for edit buttons and mct-control buttons need - // the label to be set to undefined in order to not apply the labeled CSS rule. - "name": undefined, - "cssClass": "icon-x no-label", - "description": "Discard changes made to these objects.", - "depends": [] - } - ], - "policies": [ - { - "category": "action", - "implementation": EditPersistableObjectsPolicy, - "depends": ["openmct"] - }, - { - "implementation": CreationPolicy, - "category": "creation" - } - ], - "templates": [ - { - "key": "edit-library", - "template": libraryTemplate - } - ], - "representations": [ - { - "key": "edit-object", - "template": editObjectTemplate, - "uses": [ - "view" - ], - "gestures": [ - "drop" - ] - }, - { - "key": "edit-action-buttons", - "template": editActionButtonsTemplate, - "uses": [ - "action" - ] - }, - { - "key": "topbar-edit", - "template": topbarEditTemplate - }, - { - "key": "create-button", - "template": createButtonTemplate - }, - { - "key": "create-menu", - "template": createMenuTemplate, - "uses": [ - "action" - ] - } - ], - "components": [ - { - "type": "decorator", - "provides": "capabilityService", - "implementation": TransactionCapabilityDecorator, - "depends": [ - "$q", - "transactionManager" - ], - "priority": "fallback" - }, - { - "type": "provider", - "provides": "transactionService", - "implementation": TransactionService, - "depends": [ - "$q", - "$log", - "cacheService" - ] - }, - { - "key": "CreateActionProvider", - "provides": "actionService", - "type": "provider", - "implementation": CreateActionProvider, - "depends": [ - "typeService", - "policyService" - ] - }, - { - "key": "CreationService", - "provides": "creationService", - "type": "provider", - "implementation": CreationService, - "depends": [ - "$q", - "$log" - ] - } - - ], - "representers": [ - { - "implementation": EditRepresenter, - "depends": [ - "$log" - ] - } - ], - "capabilities": [ - { - "key": "editor", - "name": "Editor Capability", - "description": "Provides transactional editing capabilities", - "implementation": EditorCapability, - "depends": [ - "transactionService", - "openmct" - ] - } - ], - "controls": [ - { - "key": "locator", - "template": locatorTemplate - } - ], - "services": [ - { - "key": "transactionManager", - "implementation": TransactionManager, - "depends": [ - "transactionService" - ] - } - ], - "runs": [ - { - depends: [ - "toolbars[]", - "openmct" - ], - implementation: function (toolbars, openmct) { - toolbars.forEach(openmct.toolbars.addProvider, openmct.toolbars); + return { + name: "platform/commonUI/edit", + definition: { + "extensions": { + "controllers": [ + { + "key": "EditActionController", + "implementation": EditActionController, + "depends": [ + "$scope" + ] + }, + { + "key": "EditPanesController", + "implementation": EditPanesController, + "depends": [ + "$scope" + ] + }, + { + "key": "EditObjectController", + "implementation": EditObjectController, + "depends": [ + "$scope", + "$location", + "navigationService" + ] + }, + { + "key": "CreateMenuController", + "implementation": CreateMenuController, + "depends": [ + "$scope" + ] + }, + { + "key": "LocatorController", + "implementation": LocatorController, + "depends": [ + "$scope", + "$timeout", + "objectService" + ] } - } - ] + ], + "actions": [ + { + "key": "compose", + "implementation": EditAndComposeAction + }, + { + "key": "edit", + "implementation": EditAction, + "depends": [ + "$location", + "navigationService", + "$log" + ], + "description": "Edit", + "category": "view-control", + "cssClass": "major icon-pencil" + }, + { + "key": "properties", + "category": [ + "contextual", + "view-control" + ], + "implementation": PropertiesAction, + "cssClass": "major icon-pencil", + "name": "Edit Properties...", + "description": "Edit properties of this object.", + "depends": [ + "dialogService" + ] + }, + { + "key": "save-and-stop-editing", + "category": "save", + "implementation": SaveAndStopEditingAction, + "name": "Save and Finish Editing", + "cssClass": "icon-save labeled", + "description": "Save changes made to these objects.", + "depends": [ + "dialogService", + "notificationService" + ] + }, + { + "key": "save", + "category": "save", + "implementation": SaveAction, + "name": "Save and Continue Editing", + "cssClass": "icon-save labeled", + "description": "Save changes made to these objects.", + "depends": [ + "dialogService", + "notificationService" + ] + }, + { + "key": "save-as", + "category": "save", + "implementation": SaveAsAction, + "name": "Save As...", + "cssClass": "icon-save labeled", + "description": "Save changes made to these objects.", + "depends": [ + "$injector", + "dialogService", + "copyService", + "notificationService", + "openmct" + ], + "priority": "mandatory" + }, + { + "key": "cancel", + "category": "conclude-editing", + "implementation": CancelAction, + // Because we use the name as label for edit buttons and mct-control buttons need + // the label to be set to undefined in order to not apply the labeled CSS rule. + "name": undefined, + "cssClass": "icon-x no-label", + "description": "Discard changes made to these objects.", + "depends": [] + } + ], + "policies": [ + { + "category": "action", + "implementation": EditPersistableObjectsPolicy, + "depends": ["openmct"] + }, + { + "implementation": CreationPolicy, + "category": "creation" + } + ], + "templates": [ + { + "key": "edit-library", + "template": libraryTemplate + } + ], + "representations": [ + { + "key": "edit-object", + "template": editObjectTemplate, + "uses": [ + "view" + ], + "gestures": [ + "drop" + ] + }, + { + "key": "edit-action-buttons", + "template": editActionButtonsTemplate, + "uses": [ + "action" + ] + }, + { + "key": "topbar-edit", + "template": topbarEditTemplate + }, + { + "key": "create-button", + "template": createButtonTemplate + }, + { + "key": "create-menu", + "template": createMenuTemplate, + "uses": [ + "action" + ] + } + ], + "components": [ + { + "type": "decorator", + "provides": "capabilityService", + "implementation": TransactionCapabilityDecorator, + "depends": [ + "$q", + "transactionManager" + ], + "priority": "fallback" + }, + { + "type": "provider", + "provides": "transactionService", + "implementation": TransactionService, + "depends": [ + "$q", + "$log", + "cacheService" + ] + }, + { + "key": "CreateActionProvider", + "provides": "actionService", + "type": "provider", + "implementation": CreateActionProvider, + "depends": [ + "typeService", + "policyService" + ] + }, + { + "key": "CreationService", + "provides": "creationService", + "type": "provider", + "implementation": CreationService, + "depends": [ + "$q", + "$log" + ] + } + + ], + "representers": [ + { + "implementation": EditRepresenter, + "depends": [ + "$log" + ] + } + ], + "capabilities": [ + { + "key": "editor", + "name": "Editor Capability", + "description": "Provides transactional editing capabilities", + "implementation": EditorCapability, + "depends": [ + "transactionService", + "openmct" + ] + } + ], + "controls": [ + { + "key": "locator", + "template": locatorTemplate + } + ], + "services": [ + { + "key": "transactionManager", + "implementation": TransactionManager, + "depends": [ + "transactionService" + ] + } + ], + "runs": [ + { + depends: [ + "toolbars[]", + "openmct" + ], + implementation: function (toolbars, openmct) { + toolbars.forEach(openmct.toolbars.addProvider, openmct.toolbars); + } + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/formats/bundle.js b/platform/commonUI/formats/bundle.js index 5ced2caab3..14afcf15ab 100644 --- a/platform/commonUI/formats/bundle.js +++ b/platform/commonUI/formats/bundle.js @@ -23,56 +23,57 @@ define([ "./src/FormatProvider", "./src/UTCTimeFormat", - "./src/DurationFormat", - 'legacyRegistry' + "./src/DurationFormat" ], function ( FormatProvider, UTCTimeFormat, - DurationFormat, - legacyRegistry + DurationFormat ) { - legacyRegistry.register("platform/commonUI/formats", { - "name": "Format Registry", - "description": "Provides a registry for formats, which allow parsing and formatting of values.", - "extensions": { - "components": [ - { - "provides": "formatService", - "type": "provider", - "implementation": FormatProvider, - "depends": [ - "formats[]" - ] - } - ], - "formats": [ - { - "key": "utc", - "implementation": UTCTimeFormat - }, - { - "key": "duration", - "implementation": DurationFormat - } - ], - "constants": [ - { - "key": "DEFAULT_TIME_FORMAT", - "value": "utc" - } - ], - "licenses": [ - { - "name": "d3", - "version": "3.0.0", - "description": "Incorporates modified code from d3 Time Scales", - "author": "Mike Bostock", - "copyright": "Copyright 2010-2016 Mike Bostock. " + + return { + name:"platform/commonUI/formats", + definition: { + "name": "Format Registry", + "description": "Provides a registry for formats, which allow parsing and formatting of values.", + "extensions": { + "components": [ + { + "provides": "formatService", + "type": "provider", + "implementation": FormatProvider, + "depends": [ + "formats[]" + ] + } + ], + "formats": [ + { + "key": "utc", + "implementation": UTCTimeFormat + }, + { + "key": "duration", + "implementation": DurationFormat + } + ], + "constants": [ + { + "key": "DEFAULT_TIME_FORMAT", + "value": "utc" + } + ], + "licenses": [ + { + "name": "d3", + "version": "3.0.0", + "description": "Incorporates modified code from d3 Time Scales", + "author": "Mike Bostock", + "copyright": "Copyright 2010-2016 Mike Bostock. " + "All rights reserved.", - "link": "https://github.com/d3/d3/blob/master/LICENSE" - } - ] + "link": "https://github.com/d3/d3/blob/master/LICENSE" + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/general/bundle.js b/platform/commonUI/general/bundle.js index cb50e1976e..76e91953c9 100644 --- a/platform/commonUI/general/bundle.js +++ b/platform/commonUI/general/bundle.js @@ -66,8 +66,7 @@ define([ "./res/templates/object-inspector.html", "./res/templates/controls/selector.html", "./res/templates/controls/datetime-picker.html", - "./res/templates/controls/datetime-field.html", - 'legacyRegistry' + "./res/templates/controls/datetime-field.html" ], function ( UrlService, PopupService, @@ -114,415 +113,417 @@ define([ objectInspectorTemplate, selectorTemplate, datetimePickerTemplate, - datetimeFieldTemplate, - legacyRegistry + datetimeFieldTemplate ) { - legacyRegistry.register("platform/commonUI/general", { - "name": "General UI elements", - "description": "General UI elements, meant to be reused across modes", - "resources": "res", - "extensions": { - "services": [ - { - "key": "urlService", - "implementation": UrlService, - "depends": [ - "$location" - ] - }, - { - "key": "popupService", - "implementation": PopupService, - "depends": [ - "$document", - "$window" - ] - } - ], - "runs": [ - { - "implementation": StyleSheetLoader, - "depends": [ - "stylesheets[]", - "$document", - "THEME", - "ASSETS_PATH" - ] - }, - { - "implementation": SplashScreenManager, - "depends": [ - "$document" - ] - } - ], - "filters": [ - { - "implementation": ReverseFilter, - "key": "reverse" - } - ], - "templates": [ - { - "key": "bottombar", - "template": bottombarTemplate - }, - { - "key": "action-button", - "template": actionButtonTemplate - }, - { - "key": "input-filter", - "template": inputFilterTemplate - }, - { - "key": "indicator", - "template": indicatorTemplate - }, - { - "key": "message-banner", - "template": messageBannerTemplate - }, - { - "key": "progress-bar", - "template": progressBarTemplate - }, - { - "key": "time-controller", - "template": timeControllerTemplate - } - ], - "controllers": [ - { - "key": "TimeRangeController", - "implementation": TimeRangeController, - "depends": [ - "$scope", - "$timeout", - "formatService", - "DEFAULT_TIME_FORMAT", - "now" - ] - }, - { - "key": "DateTimePickerController", - "implementation": DateTimePickerController, - "depends": [ - "$scope", - "now" - ] - }, - { - "key": "DateTimeFieldController", - "implementation": DateTimeFieldController, - "depends": [ - "$scope", - "formatService", - "DEFAULT_TIME_FORMAT" - ] - }, - { - "key": "TreeNodeController", - "implementation": TreeNodeController, - "depends": [ - "$scope", - "$timeout", - "navigationService" - ] - }, - { - "key": "ActionGroupController", - "implementation": ActionGroupController, - "depends": [ - "$scope" - ] - }, - { - "key": "ToggleController", - "implementation": ToggleController - }, - { - "key": "ClickAwayController", - "implementation": ClickAwayController, - "depends": [ - "$document", - "$timeout" - ] - }, - { - "key": "ViewSwitcherController", - "implementation": ViewSwitcherController, - "depends": [ - "$scope", - "$timeout" - ] - }, - { - "key": "GetterSetterController", - "implementation": GetterSetterController, - "depends": [ - "$scope" - ] - }, - { - "key": "SelectorController", - "implementation": SelectorController, - "depends": [ - "objectService", - "$scope" - ] - }, - { - "key": "ObjectInspectorController", - "implementation": ObjectInspectorController, - "depends": [ - "$scope", - "objectService" - ] - }, - { - "key": "BannerController", - "implementation": BannerController, - "depends": [ - "$scope", - "notificationService", - "dialogService" - ] - } - ], - "directives": [ - { - "key": "mctContainer", - "implementation": MCTContainer, - "depends": [ - "containers[]" - ] - }, - { - "key": "mctDrag", - "implementation": MCTDrag, - "depends": [ - "$document", - "agentService" - ] - }, - { - "key": "mctSelectable", - "implementation": MCTSelectable, - "depends": [ - "openmct" - ] - }, - { - "key": "mctClickElsewhere", - "implementation": MCTClickElsewhere, - "depends": [ - "$document" - ] - }, - { - "key": "mctResize", - "implementation": MCTResize, - "depends": [ - "$timeout" - ] - }, - { - "key": "mctPopup", - "implementation": MCTPopup, - "depends": [ - "$compile", - "popupService" - ] - }, - { - "key": "mctScrollX", - "implementation": MCTScroll, - "depends": [ - "$parse", - "MCT_SCROLL_X_PROPERTY", - "MCT_SCROLL_X_ATTRIBUTE" - ] - }, - { - "key": "mctScrollY", - "implementation": MCTScroll, - "depends": [ - "$parse", - "MCT_SCROLL_Y_PROPERTY", - "MCT_SCROLL_Y_ATTRIBUTE" - ] - }, - { - "key": "mctSplitPane", - "implementation": MCTSplitPane, - "depends": [ - "$parse", - "$log", - "$interval", - "$window" - ] - }, - { - "key": "mctSplitter", - "implementation": MCTSplitter - }, - { - "key": "mctTree", - "implementation": MCTTree, - "depends": ['gestureService', 'openmct'] - }, - { - "key": "mctIndicators", - "implementation": MCTIndicators, - "depends": ['openmct'] - } - ], - "constants": [ - { - "key": "MCT_SCROLL_X_PROPERTY", - "value": "scrollLeft" - }, - { - "key": "MCT_SCROLL_X_ATTRIBUTE", - "value": "mctScrollX" - }, - { - "key": "MCT_SCROLL_Y_PROPERTY", - "value": "scrollTop" - }, - { - "key": "MCT_SCROLL_Y_ATTRIBUTE", - "value": "mctScrollY" - }, - { - "key": "THEME", - "value": "unspecified", - "priority": "fallback" - }, - { - "key": "ASSETS_PATH", - "value": ".", - "priority": "fallback" - } - ], - "containers": [ - { - "key": "accordion", - "template": accordionTemplate, - "attributes": [ - "label" - ] - } - ], - "representations": [ - { - "key": "tree", - "template": subtreeTemplate, - "uses": [ - "composition" - ], - "type": "root", - "priority": "preferred" - }, - { - "key": "tree", - "template": treeTemplate - }, - { - "key": "subtree", - "template": subtreeTemplate, - "uses": [ - "composition" - ] - }, - { - "key": "tree-node", - "template": treeNodeTemplate, - "uses": [ - "action" - ] - }, - { - "key": "label", - "template": labelTemplate, - "uses": [ - "type", - "location" - ], - "gestures": [ - "drag", - "menu", - "info" - ] - }, - { - "key": "node", - "template": labelTemplate, - "uses": [ - "type" - ], - "gestures": [ - "drag", - "menu" - ] - }, - { - "key": "action-group", - "template": actionGroupTemplate, - "uses": [ - "action" - ] - }, - { - "key": "switcher", - "template": switcherTemplate, - "uses": [ - "view" - ] - }, - { - "key": "object-inspector", - "template": objectInspectorTemplate - } - ], - "controls": [ - { - "key": "selector", - "template": selectorTemplate - }, - { - "key": "datetime-picker", - "template": datetimePickerTemplate - }, - { - "key": "datetime-field", - "template": datetimeFieldTemplate - } - ], - "licenses": [ - { - "name": "Normalize.css", - "version": "1.1.2", - "description": "Browser style normalization", - "author": "Nicolas Gallagher, Jonathan Neal", - "website": "http://necolas.github.io/normalize.css/", - "copyright": "Copyright (c) Nicolas Gallagher and Jonathan Neal", - "license": "license-mit", - "link": "https://github.com/necolas/normalize.css/blob/v1.1.2/LICENSE.md" - }, - { - "name": "Zepto", - "version": "1.1.6", - "description": "DOM manipulation", - "author": "Thomas Fuchs", - "website": "http://zeptojs.com/", - "copyright": "Copyright (c) 2010-2016 Thomas Fuchs", - "license": "license-mit", - "link": "https://github.com/madrobby/zepto/blob/master/MIT-LICENSE" - } - ] + return { + name:"platform/commonUI/general", + definition: { + "name": "General UI elements", + "description": "General UI elements, meant to be reused across modes", + "resources": "res", + "extensions": { + "services": [ + { + "key": "urlService", + "implementation": UrlService, + "depends": [ + "$location" + ] + }, + { + "key": "popupService", + "implementation": PopupService, + "depends": [ + "$document", + "$window" + ] + } + ], + "runs": [ + { + "implementation": StyleSheetLoader, + "depends": [ + "stylesheets[]", + "$document", + "THEME", + "ASSETS_PATH" + ] + }, + { + "implementation": SplashScreenManager, + "depends": [ + "$document" + ] + } + ], + "filters": [ + { + "implementation": ReverseFilter, + "key": "reverse" + } + ], + "templates": [ + { + "key": "bottombar", + "template": bottombarTemplate + }, + { + "key": "action-button", + "template": actionButtonTemplate + }, + { + "key": "input-filter", + "template": inputFilterTemplate + }, + { + "key": "indicator", + "template": indicatorTemplate + }, + { + "key": "message-banner", + "template": messageBannerTemplate + }, + { + "key": "progress-bar", + "template": progressBarTemplate + }, + { + "key": "time-controller", + "template": timeControllerTemplate + } + ], + "controllers": [ + { + "key": "TimeRangeController", + "implementation": TimeRangeController, + "depends": [ + "$scope", + "$timeout", + "formatService", + "DEFAULT_TIME_FORMAT", + "now" + ] + }, + { + "key": "DateTimePickerController", + "implementation": DateTimePickerController, + "depends": [ + "$scope", + "now" + ] + }, + { + "key": "DateTimeFieldController", + "implementation": DateTimeFieldController, + "depends": [ + "$scope", + "formatService", + "DEFAULT_TIME_FORMAT" + ] + }, + { + "key": "TreeNodeController", + "implementation": TreeNodeController, + "depends": [ + "$scope", + "$timeout", + "navigationService" + ] + }, + { + "key": "ActionGroupController", + "implementation": ActionGroupController, + "depends": [ + "$scope" + ] + }, + { + "key": "ToggleController", + "implementation": ToggleController + }, + { + "key": "ClickAwayController", + "implementation": ClickAwayController, + "depends": [ + "$document", + "$timeout" + ] + }, + { + "key": "ViewSwitcherController", + "implementation": ViewSwitcherController, + "depends": [ + "$scope", + "$timeout" + ] + }, + { + "key": "GetterSetterController", + "implementation": GetterSetterController, + "depends": [ + "$scope" + ] + }, + { + "key": "SelectorController", + "implementation": SelectorController, + "depends": [ + "objectService", + "$scope" + ] + }, + { + "key": "ObjectInspectorController", + "implementation": ObjectInspectorController, + "depends": [ + "$scope", + "objectService" + ] + }, + { + "key": "BannerController", + "implementation": BannerController, + "depends": [ + "$scope", + "notificationService", + "dialogService" + ] + } + ], + "directives": [ + { + "key": "mctContainer", + "implementation": MCTContainer, + "depends": [ + "containers[]" + ] + }, + { + "key": "mctDrag", + "implementation": MCTDrag, + "depends": [ + "$document", + "agentService" + ] + }, + { + "key": "mctSelectable", + "implementation": MCTSelectable, + "depends": [ + "openmct" + ] + }, + { + "key": "mctClickElsewhere", + "implementation": MCTClickElsewhere, + "depends": [ + "$document" + ] + }, + { + "key": "mctResize", + "implementation": MCTResize, + "depends": [ + "$timeout" + ] + }, + { + "key": "mctPopup", + "implementation": MCTPopup, + "depends": [ + "$compile", + "popupService" + ] + }, + { + "key": "mctScrollX", + "implementation": MCTScroll, + "depends": [ + "$parse", + "MCT_SCROLL_X_PROPERTY", + "MCT_SCROLL_X_ATTRIBUTE" + ] + }, + { + "key": "mctScrollY", + "implementation": MCTScroll, + "depends": [ + "$parse", + "MCT_SCROLL_Y_PROPERTY", + "MCT_SCROLL_Y_ATTRIBUTE" + ] + }, + { + "key": "mctSplitPane", + "implementation": MCTSplitPane, + "depends": [ + "$parse", + "$log", + "$interval", + "$window" + ] + }, + { + "key": "mctSplitter", + "implementation": MCTSplitter + }, + { + "key": "mctTree", + "implementation": MCTTree, + "depends": ['gestureService', 'openmct'] + }, + { + "key": "mctIndicators", + "implementation": MCTIndicators, + "depends": ['openmct'] + } + ], + "constants": [ + { + "key": "MCT_SCROLL_X_PROPERTY", + "value": "scrollLeft" + }, + { + "key": "MCT_SCROLL_X_ATTRIBUTE", + "value": "mctScrollX" + }, + { + "key": "MCT_SCROLL_Y_PROPERTY", + "value": "scrollTop" + }, + { + "key": "MCT_SCROLL_Y_ATTRIBUTE", + "value": "mctScrollY" + }, + { + "key": "THEME", + "value": "unspecified", + "priority": "fallback" + }, + { + "key": "ASSETS_PATH", + "value": ".", + "priority": "fallback" + } + ], + "containers": [ + { + "key": "accordion", + "template": accordionTemplate, + "attributes": [ + "label" + ] + } + ], + "representations": [ + { + "key": "tree", + "template": subtreeTemplate, + "uses": [ + "composition" + ], + "type": "root", + "priority": "preferred" + }, + { + "key": "tree", + "template": treeTemplate + }, + { + "key": "subtree", + "template": subtreeTemplate, + "uses": [ + "composition" + ] + }, + { + "key": "tree-node", + "template": treeNodeTemplate, + "uses": [ + "action" + ] + }, + { + "key": "label", + "template": labelTemplate, + "uses": [ + "type", + "location" + ], + "gestures": [ + "drag", + "menu", + "info" + ] + }, + { + "key": "node", + "template": labelTemplate, + "uses": [ + "type" + ], + "gestures": [ + "drag", + "menu" + ] + }, + { + "key": "action-group", + "template": actionGroupTemplate, + "uses": [ + "action" + ] + }, + { + "key": "switcher", + "template": switcherTemplate, + "uses": [ + "view" + ] + }, + { + "key": "object-inspector", + "template": objectInspectorTemplate + } + ], + "controls": [ + { + "key": "selector", + "template": selectorTemplate + }, + { + "key": "datetime-picker", + "template": datetimePickerTemplate + }, + { + "key": "datetime-field", + "template": datetimeFieldTemplate + } + ], + "licenses": [ + { + "name": "Normalize.css", + "version": "1.1.2", + "description": "Browser style normalization", + "author": "Nicolas Gallagher, Jonathan Neal", + "website": "http://necolas.github.io/normalize.css/", + "copyright": "Copyright (c) Nicolas Gallagher and Jonathan Neal", + "license": "license-mit", + "link": "https://github.com/necolas/normalize.css/blob/v1.1.2/LICENSE.md" + }, + { + "name": "Zepto", + "version": "1.1.6", + "description": "DOM manipulation", + "author": "Thomas Fuchs", + "website": "http://zeptojs.com/", + "copyright": "Copyright (c) 2010-2016 Thomas Fuchs", + "license": "license-mit", + "link": "https://github.com/madrobby/zepto/blob/master/MIT-LICENSE" + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/inspect/bundle.js b/platform/commonUI/inspect/bundle.js index 5dbb41f497..cbc3b0c485 100644 --- a/platform/commonUI/inspect/bundle.js +++ b/platform/commonUI/inspect/bundle.js @@ -27,8 +27,7 @@ define([ "./res/info-table.html", "./res/info-bubble.html", "./res/bubble.html", - "./res/templates/info-button.html", - 'legacyRegistry' + "./res/templates/info-button.html" ], function ( InfoGesture, InfoButtonGesture, @@ -36,81 +35,83 @@ define([ infoTableTemplate, infoBubbleTemplate, bubbleTemplate, - infoButtonTemplate, - legacyRegistry + infoButtonTemplate ) { - legacyRegistry.register("platform/commonUI/inspect", { - "extensions": { - "templates": [ - { - "key": "info-table", - "template": infoTableTemplate - }, - { - "key": "info-bubble", - "template": infoBubbleTemplate - } - ], - "containers": [ - { - "key": "bubble", - "template": bubbleTemplate, - "attributes": [ - "bubbleTitle", - "bubbleLayout" - ], - "alias": "bubble" - } - ], - "gestures": [ - { - "key": "info", - "implementation": InfoGesture, - "depends": [ - "$timeout", - "agentService", - "infoService", - "INFO_HOVER_DELAY" - ] - }, - { - "key": "infobutton", - "implementation": InfoButtonGesture, - "depends": [ - "$document", - "agentService", - "infoService" - ] - } - ], - "services": [ - { - "key": "infoService", - "implementation": InfoService, - "depends": [ - "$compile", - "$rootScope", - "popupService", - "agentService" - ] - } - ], - "constants": [ - { - "key": "INFO_HOVER_DELAY", - "value": 2000 - } - ], - "representations": [ - { - "key": "info-button", - "template": infoButtonTemplate, - "gestures": [ - "infobutton" - ] - } - ] + return { + name:"platform/commonUI/inspect", + definition: { + "extensions": { + "templates": [ + { + "key": "info-table", + "template": infoTableTemplate + }, + { + "key": "info-bubble", + "template": infoBubbleTemplate + } + ], + "containers": [ + { + "key": "bubble", + "template": bubbleTemplate, + "attributes": [ + "bubbleTitle", + "bubbleLayout" + ], + "alias": "bubble" + } + ], + "gestures": [ + { + "key": "info", + "implementation": InfoGesture, + "depends": [ + "$timeout", + "agentService", + "infoService", + "INFO_HOVER_DELAY" + ] + }, + { + "key": "infobutton", + "implementation": InfoButtonGesture, + "depends": [ + "$document", + "agentService", + "infoService" + ] + } + ], + "services": [ + { + "key": "infoService", + "implementation": InfoService, + "depends": [ + "$compile", + "$rootScope", + "popupService", + "agentService" + ] + } + ], + "constants": [ + { + "key": "INFO_HOVER_DELAY", + "value": 2000 + } + ], + "representations": [ + { + "key": "info-button", + "template": infoButtonTemplate, + "gestures": [ + "infobutton" + ] + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/mobile/bundle.js b/platform/commonUI/mobile/bundle.js index 678f353d4b..85fa649c37 100644 --- a/platform/commonUI/mobile/bundle.js +++ b/platform/commonUI/mobile/bundle.js @@ -23,44 +23,45 @@ define([ "./src/MCTDevice", "./src/AgentService", - "./src/DeviceClassifier", - 'legacyRegistry' + "./src/DeviceClassifier" ], function ( MCTDevice, AgentService, - DeviceClassifier, - legacyRegistry + DeviceClassifier ) { - legacyRegistry.register("platform/commonUI/mobile", { - "extensions": { - "directives": [ - { - "key": "mctDevice", - "implementation": MCTDevice, - "depends": [ - "agentService" - ] - } - ], - "services": [ - { - "key": "agentService", - "implementation": AgentService, - "depends": [ - "$window" - ] - } - ], - "runs": [ - { - "implementation": DeviceClassifier, - "depends": [ - "agentService", - "$document" - ] - } - ] + return { + name:"platform/commonUI/mobile", + definition: { + "extensions": { + "directives": [ + { + "key": "mctDevice", + "implementation": MCTDevice, + "depends": [ + "agentService" + ] + } + ], + "services": [ + { + "key": "agentService", + "implementation": AgentService, + "depends": [ + "$window" + ] + } + ], + "runs": [ + { + "implementation": DeviceClassifier, + "depends": [ + "agentService", + "$document" + ] + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/notification/bundle.js b/platform/commonUI/notification/bundle.js index 7df0693071..5410172d84 100644 --- a/platform/commonUI/notification/bundle.js +++ b/platform/commonUI/notification/bundle.js @@ -24,52 +24,53 @@ define([ "./src/NotificationIndicatorController", "./src/NotificationIndicator", "./src/NotificationService", - "./res/notification-indicator.html", - 'legacyRegistry' + "./res/notification-indicator.html" ], function ( NotificationIndicatorController, NotificationIndicator, NotificationService, - notificationIndicatorTemplate, - legacyRegistry + notificationIndicatorTemplate ) { - legacyRegistry.register("platform/commonUI/notification", { - "extensions": { - "templates": [ - { - "key": "notificationIndicatorTemplate", - "template": notificationIndicatorTemplate - } - ], - "controllers": [ - { - "key": "NotificationIndicatorController", - "implementation": NotificationIndicatorController, - "depends": [ - "$scope", - "openmct", - "dialogService" - ] - } - ], - "indicators": [ - { - "implementation": NotificationIndicator, - "priority": "fallback" - } - ], - "services": [ - { - "key": "notificationService", - "implementation": function (openmct) { - return new NotificationService.default(openmct); - }, - "depends": [ - "openmct" - ] - } - ] + return { + name:"platform/commonUI/notification", + definition: { + "extensions": { + "templates": [ + { + "key": "notificationIndicatorTemplate", + "template": notificationIndicatorTemplate + } + ], + "controllers": [ + { + "key": "NotificationIndicatorController", + "implementation": NotificationIndicatorController, + "depends": [ + "$scope", + "openmct", + "dialogService" + ] + } + ], + "indicators": [ + { + "implementation": NotificationIndicator, + "priority": "fallback" + } + ], + "services": [ + { + "key": "notificationService", + "implementation": function (openmct) { + return new NotificationService.default(openmct); + }, + "depends": [ + "openmct" + ] + } + ] + } } - }); + }; }); diff --git a/platform/commonUI/regions/bundle.js b/platform/commonUI/regions/bundle.js index 2473e23d11..5ddd72b40e 100644 --- a/platform/commonUI/regions/bundle.js +++ b/platform/commonUI/regions/bundle.js @@ -22,33 +22,34 @@ define([ './src/InspectorController', - './src/EditableRegionPolicy', - 'legacyRegistry' + './src/EditableRegionPolicy' ], function ( InspectorController, - EditableRegionPolicy, - legacyRegistry + EditableRegionPolicy ) { - legacyRegistry.register("platform/commonUI/regions", { - "extensions": { - "controllers": [ - { - "key": "InspectorController", - "implementation": InspectorController, - "depends": [ - "$scope", - "openmct", - "$document" - ] - } - ], - "policies": [ - { - "category": "region", - "implementation": EditableRegionPolicy - } - ] + return { + name:"platform/commonUI/regions", + definition: { + "extensions": { + "controllers": [ + { + "key": "InspectorController", + "implementation": InspectorController, + "depends": [ + "$scope", + "openmct", + "$document" + ] + } + ], + "policies": [ + { + "category": "region", + "implementation": EditableRegionPolicy + } + ] + } } - }); + }; }); diff --git a/platform/containment/bundle.js b/platform/containment/bundle.js index 05585a4268..88b7103261 100644 --- a/platform/containment/bundle.js +++ b/platform/containment/bundle.js @@ -25,51 +25,52 @@ define([ "./src/CompositionMutabilityPolicy", "./src/CompositionModelPolicy", "./src/ComposeActionPolicy", - "./src/PersistableCompositionPolicy", - 'legacyRegistry' + "./src/PersistableCompositionPolicy" ], function ( CompositionPolicy, CompositionMutabilityPolicy, CompositionModelPolicy, ComposeActionPolicy, - PersistableCompositionPolicy, - legacyRegistry + PersistableCompositionPolicy ) { - legacyRegistry.register("platform/containment", { - "extensions": { - "policies": [ - { - "category": "composition", - "implementation": CompositionPolicy, - "message": "Objects of this type cannot contain objects of that type." - }, - { - "category": "composition", - "implementation": CompositionMutabilityPolicy, - "message": "Objects of this type cannot be modified." - }, - { - "category": "composition", - "implementation": CompositionModelPolicy, - "message": "Objects of this type cannot contain other objects." - }, - { - "category": "action", - "implementation": ComposeActionPolicy, - "depends": [ - "$injector", - "openmct" - ], - "message": "Objects of this type cannot contain objects of that type." - }, - { - "category": "composition", - "implementation": PersistableCompositionPolicy, - "depends": ["openmct"], - "message": "Change cannot be made to composition of non-persistable object" - } - ] + return { + name:"platform/containment", + definition: { + "extensions": { + "policies": [ + { + "category": "composition", + "implementation": CompositionPolicy, + "message": "Objects of this type cannot contain objects of that type." + }, + { + "category": "composition", + "implementation": CompositionMutabilityPolicy, + "message": "Objects of this type cannot be modified." + }, + { + "category": "composition", + "implementation": CompositionModelPolicy, + "message": "Objects of this type cannot contain other objects." + }, + { + "category": "action", + "implementation": ComposeActionPolicy, + "depends": [ + "$injector", + "openmct" + ], + "message": "Objects of this type cannot contain objects of that type." + }, + { + "category": "composition", + "implementation": PersistableCompositionPolicy, + "depends": ["openmct"], + "message": "Change cannot be made to composition of non-persistable object" + } + ] + } } - }); + }; }); diff --git a/platform/core/bundle.js b/platform/core/bundle.js index ed4fdcd1db..487a009581 100644 --- a/platform/core/bundle.js +++ b/platform/core/bundle.js @@ -49,8 +49,7 @@ define([ "./src/services/Now", "./src/services/Throttle", "./src/services/Topic", - "./src/services/Instantiate", - 'legacyRegistry' + "./src/services/Instantiate" ], function ( DomainObjectProvider, CoreCapabilityProvider, @@ -80,312 +79,314 @@ define([ Now, Throttle, Topic, - Instantiate, - legacyRegistry + Instantiate ) { - legacyRegistry.register("platform/core", { - "name": "Open MCT Core", - "description": "Defines core concepts of Open MCT.", - "sources": "src", - "configuration": { - "paths": { - "uuid": "uuid" - } - }, - "extensions": { - "components": [ - { - "provides": "objectService", - "type": "provider", - "implementation": DomainObjectProvider, - "depends": [ - "modelService", - "instantiate" - ] - }, - { - "provides": "capabilityService", - "type": "provider", - "implementation": CoreCapabilityProvider, - "depends": [ - "capabilities[]", - "$log" - ] - }, - { - "provides": "modelService", - "type": "provider", - "implementation": StaticModelProvider, - "depends": [ - "models[]", - "$q", - "$log" - ] - }, - { - "provides": "modelService", - "type": "aggregator", - "implementation": ModelAggregator, - "depends": [ - "$q" - ] - }, - { - "provides": "modelService", - "type": "provider", - "implementation": PersistedModelProvider, - "depends": [ - "persistenceService", - "$q", - "now", - "PERSISTENCE_SPACE" - ] - }, - { - "provides": "modelService", - "type": "decorator", - "implementation": CachingModelDecorator, - "depends": [ - "cacheService" - ] - }, - { - "provides": "modelService", - "type": "decorator", - "priority": "fallback", - "implementation": MissingModelDecorator - }, - { - "provides": "typeService", - "type": "provider", - "implementation": TypeProvider, - "depends": [ - "types[]" - ] - }, - { - "provides": "actionService", - "type": "provider", - "implementation": ActionProvider, - "depends": [ - "actions[]", - "$log" - ] - }, - { - "provides": "actionService", - "type": "aggregator", - "implementation": ActionAggregator - }, - { - "provides": "actionService", - "type": "decorator", - "implementation": LoggingActionDecorator, - "depends": [ - "$log" - ] - }, - { - "provides": "viewService", - "type": "provider", - "implementation": ViewProvider, - "depends": [ - "views[]", - "$log" - ] - }, - { - "provides": "identifierService", - "type": "provider", - "implementation": IdentifierProvider, - "depends": [ - "PERSISTENCE_SPACE" - ] + return { + name:"platform/core", + definition: { + "name": "Open MCT Core", + "description": "Defines core concepts of Open MCT.", + "sources": "src", + "configuration": { + "paths": { + "uuid": "uuid" } - ], - "types": [ - { - "properties": [ - { - "control": "textfield", - "name": "Title", - "key": "name", - "property": "name", - "pattern": "\\S+", - "required": true, - "cssClass": "l-input-lg" - }, - { - "name": "Notes", - "key": "notes", - "property": "notes", - "control": "textarea", - "required": false, - "cssClass": "l-textarea-sm" - } - ] - }, - { - "key": "root", - "name": "Root", - "cssClass": "icon-folder" - }, - { - "key": "folder", - "name": "Folder", - "cssClass": "icon-folder", - "features": "creation", - "description": "Create folders to organize other objects or links to objects.", - "priority": 1000, - "model": { - "composition": [] + }, + "extensions": { + "components": [ + { + "provides": "objectService", + "type": "provider", + "implementation": DomainObjectProvider, + "depends": [ + "modelService", + "instantiate" + ] + }, + { + "provides": "capabilityService", + "type": "provider", + "implementation": CoreCapabilityProvider, + "depends": [ + "capabilities[]", + "$log" + ] + }, + { + "provides": "modelService", + "type": "provider", + "implementation": StaticModelProvider, + "depends": [ + "models[]", + "$q", + "$log" + ] + }, + { + "provides": "modelService", + "type": "aggregator", + "implementation": ModelAggregator, + "depends": [ + "$q" + ] + }, + { + "provides": "modelService", + "type": "provider", + "implementation": PersistedModelProvider, + "depends": [ + "persistenceService", + "$q", + "now", + "PERSISTENCE_SPACE" + ] + }, + { + "provides": "modelService", + "type": "decorator", + "implementation": CachingModelDecorator, + "depends": [ + "cacheService" + ] + }, + { + "provides": "modelService", + "type": "decorator", + "priority": "fallback", + "implementation": MissingModelDecorator + }, + { + "provides": "typeService", + "type": "provider", + "implementation": TypeProvider, + "depends": [ + "types[]" + ] + }, + { + "provides": "actionService", + "type": "provider", + "implementation": ActionProvider, + "depends": [ + "actions[]", + "$log" + ] + }, + { + "provides": "actionService", + "type": "aggregator", + "implementation": ActionAggregator + }, + { + "provides": "actionService", + "type": "decorator", + "implementation": LoggingActionDecorator, + "depends": [ + "$log" + ] + }, + { + "provides": "viewService", + "type": "provider", + "implementation": ViewProvider, + "depends": [ + "views[]", + "$log" + ] + }, + { + "provides": "identifierService", + "type": "provider", + "implementation": IdentifierProvider, + "depends": [ + "PERSISTENCE_SPACE" + ] } - }, - { - "key": "unknown", - "name": "Unknown Type", - "cssClass": "icon-object-unknown" - }, - { - "name": "Unknown Type", - "cssClass": "icon-object-unknown" - } - ], - "capabilities": [ - { - "key": "composition", - "implementation": CompositionCapability, - "depends": [ - "$injector" - ] - }, - { - "key": "relationship", - "implementation": RelationshipCapability, - "depends": [ - "$injector" - ] - }, - { - "key": "type", - "implementation": TypeCapability, - "depends": [ - "typeService" - ] - }, - { - "key": "action", - "implementation": ActionCapability, - "depends": [ - "$q", - "actionService" - ] - }, - { - "key": "view", - "implementation": ViewCapability, - "depends": [ - "viewService" - ] - }, - { - "key": "persistence", - "implementation": PersistenceCapability, - "depends": [ - "cacheService", - "persistenceService", - "identifierService", - "notificationService", - "$q" - ] - }, - { - "key": "metadata", - "implementation": MetadataCapability - }, - { - "key": "mutation", - "implementation": MutationCapability, - "depends": [ - "topic", - "now" - ] - }, - { - "key": "delegation", - "implementation": DelegationCapability, - "depends": [ - "$q" - ] - }, - { - "key": "instantiation", - "implementation": InstantiationCapability, - "depends": [ - "$injector", - "identifierService", - "now" - ] - } - ], - "services": [ - { - "key": "cacheService", - "implementation": ModelCacheService - }, - { - "key": "now", - "implementation": Now - }, - { - "key": "throttle", - "implementation": Throttle, - "depends": [ - "$timeout" - ] - }, - { - "key": "topic", - "implementation": Topic, - "depends": [ - "$log" - ] - }, - { - "key": "instantiate", - "implementation": Instantiate, - "depends": [ - "capabilityService", - "identifierService", - "cacheService" - ] - } - ], - "runs": [ - { - "implementation": TransactingMutationListener, - "depends": ["topic", "transactionService", "cacheService"] - } - ], - "constants": [ - { - "key": "PERSISTENCE_SPACE", - "value": "mct" - } - ], - "licenses": [ - { - "name": "Math.uuid.js", - "version": "1.4.7", - "description": "Unique identifer generation (code adapted.)", - "author": "Robert Kieffer", - "website": "https://github.com/broofa/node-uuid", - "copyright": "Copyright (c) 2010-2012 Robert Kieffer", - "license": "license-mit", - "link": "http://opensource.org/licenses/MIT" - } - ] + ], + "types": [ + { + "properties": [ + { + "control": "textfield", + "name": "Title", + "key": "name", + "property": "name", + "pattern": "\\S+", + "required": true, + "cssClass": "l-input-lg" + }, + { + "name": "Notes", + "key": "notes", + "property": "notes", + "control": "textarea", + "required": false, + "cssClass": "l-textarea-sm" + } + ] + }, + { + "key": "root", + "name": "Root", + "cssClass": "icon-folder" + }, + { + "key": "folder", + "name": "Folder", + "cssClass": "icon-folder", + "features": "creation", + "description": "Create folders to organize other objects or links to objects.", + "priority": 1000, + "model": { + "composition": [] + } + }, + { + "key": "unknown", + "name": "Unknown Type", + "cssClass": "icon-object-unknown" + }, + { + "name": "Unknown Type", + "cssClass": "icon-object-unknown" + } + ], + "capabilities": [ + { + "key": "composition", + "implementation": CompositionCapability, + "depends": [ + "$injector" + ] + }, + { + "key": "relationship", + "implementation": RelationshipCapability, + "depends": [ + "$injector" + ] + }, + { + "key": "type", + "implementation": TypeCapability, + "depends": [ + "typeService" + ] + }, + { + "key": "action", + "implementation": ActionCapability, + "depends": [ + "$q", + "actionService" + ] + }, + { + "key": "view", + "implementation": ViewCapability, + "depends": [ + "viewService" + ] + }, + { + "key": "persistence", + "implementation": PersistenceCapability, + "depends": [ + "cacheService", + "persistenceService", + "identifierService", + "notificationService", + "$q" + ] + }, + { + "key": "metadata", + "implementation": MetadataCapability + }, + { + "key": "mutation", + "implementation": MutationCapability, + "depends": [ + "topic", + "now" + ] + }, + { + "key": "delegation", + "implementation": DelegationCapability, + "depends": [ + "$q" + ] + }, + { + "key": "instantiation", + "implementation": InstantiationCapability, + "depends": [ + "$injector", + "identifierService", + "now" + ] + } + ], + "services": [ + { + "key": "cacheService", + "implementation": ModelCacheService + }, + { + "key": "now", + "implementation": Now + }, + { + "key": "throttle", + "implementation": Throttle, + "depends": [ + "$timeout" + ] + }, + { + "key": "topic", + "implementation": Topic, + "depends": [ + "$log" + ] + }, + { + "key": "instantiate", + "implementation": Instantiate, + "depends": [ + "capabilityService", + "identifierService", + "cacheService" + ] + } + ], + "runs": [ + { + "implementation": TransactingMutationListener, + "depends": ["topic", "transactionService", "cacheService"] + } + ], + "constants": [ + { + "key": "PERSISTENCE_SPACE", + "value": "mct" + } + ], + "licenses": [ + { + "name": "Math.uuid.js", + "version": "1.4.7", + "description": "Unique identifer generation (code adapted.)", + "author": "Robert Kieffer", + "website": "https://github.com/broofa/node-uuid", + "copyright": "Copyright (c) 2010-2012 Robert Kieffer", + "license": "license-mit", + "link": "http://opensource.org/licenses/MIT" + } + ] + } } - }); + }; }); diff --git a/platform/entanglement/bundle.js b/platform/entanglement/bundle.js index 2525c2aad2..b159729c27 100644 --- a/platform/entanglement/bundle.js +++ b/platform/entanglement/bundle.js @@ -34,8 +34,7 @@ define([ "./src/services/MoveService", "./src/services/LinkService", "./src/services/CopyService", - "./src/services/LocationService", - 'legacyRegistry' + "./src/services/LocationService" ], function ( MoveAction, CopyAction, @@ -50,152 +49,154 @@ define([ MoveService, LinkService, CopyService, - LocationService, - legacyRegistry + LocationService ) { - legacyRegistry.register("platform/entanglement", { - "name": "Entanglement", - "description": "Tools to assist you in entangling the world of WARP.", - "configuration": {}, - "extensions": { - "actions": [ - { - "key": "move", - "name": "Move", - "description": "Move object to another location.", - "cssClass": "icon-move", - "category": "contextual", - "implementation": MoveAction, - "depends": [ - "policyService", - "locationService", - "moveService" - ] - }, - { - "key": "copy", - "name": "Duplicate", - "description": "Duplicate object to another location.", - "cssClass": "icon-duplicate", - "category": "contextual", - "implementation": CopyAction, - "depends": [ - "$log", - "policyService", - "locationService", - "copyService", - "dialogService", - "notificationService" - ] - }, - { - "key": "link", - "name": "Create Link", - "description": "Create Link to object in another location.", - "cssClass": "icon-link", - "category": "contextual", - "implementation": LinkAction, - "depends": [ - "policyService", - "locationService", - "linkService" - ] - }, - { - "key": "locate", - "name": "Set Primary Location", - "description": "Set a domain object's primary location.", - "cssClass": "", - "category": "contextual", - "implementation": SetPrimaryLocationAction - } - ], - "components": [ - { - "type": "decorator", - "provides": "creationService", - "implementation": LocatingCreationDecorator - }, - { - "type": "decorator", - "provides": "objectService", - "implementation": LocatingObjectDecorator, - "depends": [ - "$q", - "$log" - ] - } - ], - "policies": [ - { - "category": "action", - "implementation": CrossSpacePolicy - }, - { - "category": "action", - "implementation": CopyPolicy - }, - { - "category": "action", - "implementation": MovePolicy - } - ], - "capabilities": [ - { - "key": "location", - "name": "Location Capability", - "description": "Provides a capability for retrieving the location of an object based upon it's context.", - "implementation": LocationCapability, - "depends": [ - "$q", - "$injector" - ] - } - ], - "services": [ - { - "key": "moveService", - "name": "Move Service", - "description": "Provides a service for moving objects", - "implementation": MoveService, - "depends": [ - "openmct", - "linkService", - "$q" - ] - }, - { - "key": "linkService", - "name": "Link Service", - "description": "Provides a service for linking objects", - "implementation": LinkService, - "depends": [ - "openmct" - ] - }, - { - "key": "copyService", - "name": "Copy Service", - "description": "Provides a service for copying objects", - "implementation": CopyService, - "depends": [ - "$q", - "policyService", - "openmct" - ] - }, - { - "key": "locationService", - "name": "Location Service", - "description": "Provides a service for prompting a user for locations.", - "implementation": LocationService, - "depends": [ - "dialogService" - ] - } - ], - "licenses": [] + return { + name:"platform/entanglement", + definition: { + "name": "Entanglement", + "description": "Tools to assist you in entangling the world of WARP.", + "configuration": {}, + "extensions": { + "actions": [ + { + "key": "move", + "name": "Move", + "description": "Move object to another location.", + "cssClass": "icon-move", + "category": "contextual", + "implementation": MoveAction, + "depends": [ + "policyService", + "locationService", + "moveService" + ] + }, + { + "key": "copy", + "name": "Duplicate", + "description": "Duplicate object to another location.", + "cssClass": "icon-duplicate", + "category": "contextual", + "implementation": CopyAction, + "depends": [ + "$log", + "policyService", + "locationService", + "copyService", + "dialogService", + "notificationService" + ] + }, + { + "key": "link", + "name": "Create Link", + "description": "Create Link to object in another location.", + "cssClass": "icon-link", + "category": "contextual", + "implementation": LinkAction, + "depends": [ + "policyService", + "locationService", + "linkService" + ] + }, + { + "key": "locate", + "name": "Set Primary Location", + "description": "Set a domain object's primary location.", + "cssClass": "", + "category": "contextual", + "implementation": SetPrimaryLocationAction + } + ], + "components": [ + { + "type": "decorator", + "provides": "creationService", + "implementation": LocatingCreationDecorator + }, + { + "type": "decorator", + "provides": "objectService", + "implementation": LocatingObjectDecorator, + "depends": [ + "$q", + "$log" + ] + } + ], + "policies": [ + { + "category": "action", + "implementation": CrossSpacePolicy + }, + { + "category": "action", + "implementation": CopyPolicy + }, + { + "category": "action", + "implementation": MovePolicy + } + ], + "capabilities": [ + { + "key": "location", + "name": "Location Capability", + "description": "Provides a capability for retrieving the location of an object based upon it's context.", + "implementation": LocationCapability, + "depends": [ + "$q", + "$injector" + ] + } + ], + "services": [ + { + "key": "moveService", + "name": "Move Service", + "description": "Provides a service for moving objects", + "implementation": MoveService, + "depends": [ + "openmct", + "linkService", + "$q" + ] + }, + { + "key": "linkService", + "name": "Link Service", + "description": "Provides a service for linking objects", + "implementation": LinkService, + "depends": [ + "openmct" + ] + }, + { + "key": "copyService", + "name": "Copy Service", + "description": "Provides a service for copying objects", + "implementation": CopyService, + "depends": [ + "$q", + "policyService", + "openmct" + ] + }, + { + "key": "locationService", + "name": "Location Service", + "description": "Provides a service for prompting a user for locations.", + "implementation": LocationService, + "depends": [ + "dialogService" + ] + } + ], + "licenses": [] + } } - }); + }; }); diff --git a/platform/execution/bundle.js b/platform/execution/bundle.js index 67f66b8128..9f78429959 100644 --- a/platform/execution/bundle.js +++ b/platform/execution/bundle.js @@ -21,25 +21,26 @@ *****************************************************************************/ define([ - "./src/WorkerService", - 'legacyRegistry' + "./src/WorkerService" ], function ( - WorkerService, - legacyRegistry + WorkerService ) { - legacyRegistry.register("platform/execution", { - "extensions": { - "services": [ - { - "key": "workerService", - "implementation": WorkerService, - "depends": [ - "$window", - "workers[]" - ] - } - ] + return { + name:"platform/execution", + definition: { + "extensions": { + "services": [ + { + "key": "workerService", + "implementation": WorkerService, + "depends": [ + "$window", + "workers[]" + ] + } + ] + } } - }); + }; }); diff --git a/platform/exporters/bundle.js b/platform/exporters/bundle.js index e6c83815d5..bcfd8f5f8e 100644 --- a/platform/exporters/bundle.js +++ b/platform/exporters/bundle.js @@ -22,42 +22,44 @@ define([ "./ExportService", - "saveAs", - "legacyRegistry" -], function (ExportService, saveAs, legacyRegistry) { + "saveAs" +], function (ExportService, saveAs) { - legacyRegistry.register("platform/exporters", { - extensions: { - services: [ - { - key: "exportService", - implementation: function () { - return new ExportService(saveAs.saveAs); + return { + name:"platform/exporters", + definition: { + extensions: { + services: [ + { + key: "exportService", + implementation: function () { + return new ExportService(saveAs.saveAs); + } } - } - ], - licenses: [ - { - "name": "CSV.js", - "version": "3.6.4", - "author": "Kash Nouroozi", - "description": "Encoder for CSV (comma separated values) export", - "website": "https://github.com/knrz/CSV.js", - "copyright": "Copyright (c) 2014 Kash Nouroozi", - "license": "license-mit", - "link": "https://github.com/knrz/CSV.js/blob/3.6.4/LICENSE" - }, - { - "name": "FileSaver.js", - "version": "0.0.2", - "author": "Eli Grey", - "description": "File download initiator (for file exports)", - "website": "https://github.com/eligrey/FileSaver.js/", - "copyright": "Copyright © 2015 Eli Grey.", - "license": "license-mit", - "link": "https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md" - } - ] + ], + licenses: [ + { + "name": "CSV.js", + "version": "3.6.4", + "author": "Kash Nouroozi", + "description": "Encoder for CSV (comma separated values) export", + "website": "https://github.com/knrz/CSV.js", + "copyright": "Copyright (c) 2014 Kash Nouroozi", + "license": "license-mit", + "link": "https://github.com/knrz/CSV.js/blob/3.6.4/LICENSE" + }, + { + "name": "FileSaver.js", + "version": "0.0.2", + "author": "Eli Grey", + "description": "File download initiator (for file exports)", + "website": "https://github.com/eligrey/FileSaver.js/", + "copyright": "Copyright © 2015 Eli Grey.", + "license": "license-mit", + "link": "https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md" + } + ] + } } - }); + }; }); diff --git a/platform/features/clock/bundle.js b/platform/features/clock/bundle.js index 513632c93e..4d20c88f6c 100644 --- a/platform/features/clock/bundle.js +++ b/platform/features/clock/bundle.js @@ -35,8 +35,7 @@ define([ "./src/actions/StopTimerAction", "./src/actions/PauseTimerAction", "./res/templates/clock.html", - "./res/templates/timer.html", - 'legacyRegistry' + "./res/templates/timer.html" ], function ( MomentTimezone, ClockIndicator, @@ -52,269 +51,271 @@ define([ StopTimerAction, PauseTimerAction, clockTemplate, - timerTemplate, - legacyRegistry + timerTemplate ) { - legacyRegistry.register("platform/features/clock", { - "name": "Clocks/Timers", - "descriptions": "Domain objects for displaying current & relative times.", - "configuration": { - "paths": { - "moment-duration-format": "moment-duration-format" + return { + name:"platform/features/clock", + definition: { + "name": "Clocks/Timers", + "descriptions": "Domain objects for displaying current & relative times.", + "configuration": { + "paths": { + "moment-duration-format": "moment-duration-format" + }, + "shim": { + "moment-duration-format": { + "deps": [ + "moment" + ] + } + } }, - "shim": { - "moment-duration-format": { - "deps": [ - "moment" - ] - } - } - }, - "extensions": { - "constants": [ - { - "key": "CLOCK_INDICATOR_FORMAT", - "value": "YYYY/MM/DD HH:mm:ss" - } - ], - "indicators": [ - { - "implementation": ClockIndicator, - "depends": [ - "tickerService", - "CLOCK_INDICATOR_FORMAT" - ], - "priority": "preferred" - } - ], - "services": [ - { - "key": "tickerService", - "implementation": TickerService, - "depends": [ - "$timeout", - "now" - ] - }, - { - "key": "timerService", - "implementation": TimerService, - "depends": ["openmct"] - } - ], - "controllers": [ - { - "key": "ClockController", - "implementation": ClockController, - "depends": [ - "$scope", - "tickerService" - ] - }, - { - "key": "TimerController", - "implementation": TimerController, - "depends": [ - "$scope", - "$window", - "now" - ] - }, - { - "key": "RefreshingController", - "implementation": RefreshingController, - "depends": [ - "$scope", - "tickerService" - ] - } - ], - "views": [ - { - "key": "clock", - "type": "clock", - "editable": false, - "template": clockTemplate - }, - { - "key": "timer", - "type": "timer", - "editable": false, - "template": timerTemplate - } - ], - "actions": [ - { - "key": "timer.follow", - "implementation": FollowTimerAction, - "depends": ["timerService"], - "category": "contextual", - "name": "Follow Timer", - "cssClass": "icon-clock", - "priority": "optional" - }, - { - "key": "timer.start", - "implementation": StartTimerAction, - "depends": [ - "now" - ], - "category": "contextual", - "name": "Start", - "cssClass": "icon-play", - "priority": "preferred" - }, - { - "key": "timer.pause", - "implementation": PauseTimerAction, - "depends": [ - "now" - ], - "category": "contextual", - "name": "Pause", - "cssClass": "icon-pause", - "priority": "preferred" - }, - { - "key": "timer.restart", - "implementation": RestartTimerAction, - "depends": [ - "now" - ], - "category": "contextual", - "name": "Restart at 0", - "cssClass": "icon-refresh", - "priority": "preferred" - }, - { - "key": "timer.stop", - "implementation": StopTimerAction, - "depends": [ - "now" - ], - "category": "contextual", - "name": "Stop", - "cssClass": "icon-box", - "priority": "preferred" - } - ], - "types": [ - { - "key": "clock", - "name": "Clock", - "cssClass": "icon-clock", - "description": "A UTC-based clock that supports a variety of display formats. Clocks can be added to Display Layouts.", - "priority": 101, - "features": [ - "creation" - ], - "properties": [ - { - "key": "clockFormat", - "name": "Display Format", - "control": "composite", - "items": [ - { - "control": "select", - "options": [ - { - "value": "YYYY/MM/DD hh:mm:ss", - "name": "YYYY/MM/DD hh:mm:ss" - }, - { - "value": "YYYY/DDD hh:mm:ss", - "name": "YYYY/DDD hh:mm:ss" - }, - { - "value": "hh:mm:ss", - "name": "hh:mm:ss" - } - ], - "cssClass": "l-inline" - }, - { - "control": "select", - "options": [ - { - "value": "clock12", - "name": "12hr" - }, - { - "value": "clock24", - "name": "24hr" - } - ], - "cssClass": "l-inline" - } - ] - }, - { - "key": "timezone", - "name": "Timezone", - "control": "autocomplete", - "options": MomentTimezone.tz.names() - } - ], - "model": { - "clockFormat": [ - "YYYY/MM/DD hh:mm:ss", - "clock12" + "extensions": { + "constants": [ + { + "key": "CLOCK_INDICATOR_FORMAT", + "value": "YYYY/MM/DD HH:mm:ss" + } + ], + "indicators": [ + { + "implementation": ClockIndicator, + "depends": [ + "tickerService", + "CLOCK_INDICATOR_FORMAT" ], - "timezone": "UTC" + "priority": "preferred" } - }, - { - "key": "timer", - "name": "Timer", - "cssClass": "icon-timer", - "description": "A timer that counts up or down to a datetime. Timers can be started, stopped and reset whenever needed, and support a variety of display formats. Each Timer displays the same value to all users. Timers can be added to Display Layouts.", - "priority": 100, - "features": [ - "creation" - ], - "properties": [ - { - "key": "timestamp", - "control": "datetime", - "name": "Target" - }, - { - "key": "timerFormat", - "control": "select", - "name": "Display Format", - "options": [ - { - "value": "long", - "name": "DDD hh:mm:ss" - }, - { - "value": "short", - "name": "hh:mm:ss" - } - ] + ], + "services": [ + { + "key": "tickerService", + "implementation": TickerService, + "depends": [ + "$timeout", + "now" + ] + }, + { + "key": "timerService", + "implementation": TimerService, + "depends": ["openmct"] + } + ], + "controllers": [ + { + "key": "ClockController", + "implementation": ClockController, + "depends": [ + "$scope", + "tickerService" + ] + }, + { + "key": "TimerController", + "implementation": TimerController, + "depends": [ + "$scope", + "$window", + "now" + ] + }, + { + "key": "RefreshingController", + "implementation": RefreshingController, + "depends": [ + "$scope", + "tickerService" + ] + } + ], + "views": [ + { + "key": "clock", + "type": "clock", + "editable": false, + "template": clockTemplate + }, + { + "key": "timer", + "type": "timer", + "editable": false, + "template": timerTemplate + } + ], + "actions": [ + { + "key": "timer.follow", + "implementation": FollowTimerAction, + "depends": ["timerService"], + "category": "contextual", + "name": "Follow Timer", + "cssClass": "icon-clock", + "priority": "optional" + }, + { + "key": "timer.start", + "implementation": StartTimerAction, + "depends": [ + "now" + ], + "category": "contextual", + "name": "Start", + "cssClass": "icon-play", + "priority": "preferred" + }, + { + "key": "timer.pause", + "implementation": PauseTimerAction, + "depends": [ + "now" + ], + "category": "contextual", + "name": "Pause", + "cssClass": "icon-pause", + "priority": "preferred" + }, + { + "key": "timer.restart", + "implementation": RestartTimerAction, + "depends": [ + "now" + ], + "category": "contextual", + "name": "Restart at 0", + "cssClass": "icon-refresh", + "priority": "preferred" + }, + { + "key": "timer.stop", + "implementation": StopTimerAction, + "depends": [ + "now" + ], + "category": "contextual", + "name": "Stop", + "cssClass": "icon-box", + "priority": "preferred" + } + ], + "types": [ + { + "key": "clock", + "name": "Clock", + "cssClass": "icon-clock", + "description": "A UTC-based clock that supports a variety of display formats. Clocks can be added to Display Layouts.", + "priority": 101, + "features": [ + "creation" + ], + "properties": [ + { + "key": "clockFormat", + "name": "Display Format", + "control": "composite", + "items": [ + { + "control": "select", + "options": [ + { + "value": "YYYY/MM/DD hh:mm:ss", + "name": "YYYY/MM/DD hh:mm:ss" + }, + { + "value": "YYYY/DDD hh:mm:ss", + "name": "YYYY/DDD hh:mm:ss" + }, + { + "value": "hh:mm:ss", + "name": "hh:mm:ss" + } + ], + "cssClass": "l-inline" + }, + { + "control": "select", + "options": [ + { + "value": "clock12", + "name": "12hr" + }, + { + "value": "clock24", + "name": "24hr" + } + ], + "cssClass": "l-inline" + } + ] + }, + { + "key": "timezone", + "name": "Timezone", + "control": "autocomplete", + "options": MomentTimezone.tz.names() + } + ], + "model": { + "clockFormat": [ + "YYYY/MM/DD hh:mm:ss", + "clock12" + ], + "timezone": "UTC" + } + }, + { + "key": "timer", + "name": "Timer", + "cssClass": "icon-timer", + "description": "A timer that counts up or down to a datetime. Timers can be started, stopped and reset whenever needed, and support a variety of display formats. Each Timer displays the same value to all users. Timers can be added to Display Layouts.", + "priority": 100, + "features": [ + "creation" + ], + "properties": [ + { + "key": "timestamp", + "control": "datetime", + "name": "Target" + }, + { + "key": "timerFormat", + "control": "select", + "name": "Display Format", + "options": [ + { + "value": "long", + "name": "DDD hh:mm:ss" + }, + { + "value": "short", + "name": "hh:mm:ss" + } + ] + } + ], + "model": { + "timerFormat": "DDD hh:mm:ss" } - ], - "model": { - "timerFormat": "DDD hh:mm:ss" } - } - ], - "runs": [{ - "implementation": FollowIndicator, - "depends": ["openmct", "timerService"] - }], - "licenses": [ - { - "name": "moment-duration-format", - "version": "1.3.0", - "author": "John Madhavan-Reese", - "description": "Duration parsing/formatting", - "website": "https://github.com/jsmreese/moment-duration-format", - "copyright": "Copyright 2014 John Madhavan-Reese", - "license": "license-mit", - "link": "https://github.com/jsmreese/moment-duration-format/blob/master/LICENSE" - } - ] + ], + "runs": [{ + "implementation": FollowIndicator, + "depends": ["openmct", "timerService"] + }], + "licenses": [ + { + "name": "moment-duration-format", + "version": "1.3.0", + "author": "John Madhavan-Reese", + "description": "Duration parsing/formatting", + "website": "https://github.com/jsmreese/moment-duration-format", + "copyright": "Copyright 2014 John Madhavan-Reese", + "license": "license-mit", + "link": "https://github.com/jsmreese/moment-duration-format/blob/master/LICENSE" + } + ] + } } - }); + }; }); diff --git a/platform/features/hyperlink/bundle.js b/platform/features/hyperlink/bundle.js index 2705426adc..1f3f4dab09 100644 --- a/platform/features/hyperlink/bundle.js +++ b/platform/features/hyperlink/bundle.js @@ -22,98 +22,99 @@ define([ './src/HyperlinkController', - 'legacyRegistry', './res/templates/hyperlink.html' ], function ( HyperlinkController, - legacyRegistry, hyperlinkTemplate ) { - legacyRegistry.register("platform/features/hyperlink", { - "name": "Hyperlink", - "description": "Insert a hyperlink to reference a link", - "extensions": { - "types": [ - { - "key": "hyperlink", - "name": "Hyperlink", - "cssClass": "icon-chain-links", - "description": "A hyperlink to redirect to a different link", - "features": ["creation"], - "properties": [ - { - "key": "url", - "name": "URL", - "control": "textfield", - "required": true, - "cssClass": "l-input-lg" - }, + return { + name:"platform/features/hyperlink", + definition: { + "name": "Hyperlink", + "description": "Insert a hyperlink to reference a link", + "extensions": { + "types": [ + { + "key": "hyperlink", + "name": "Hyperlink", + "cssClass": "icon-chain-links", + "description": "A hyperlink to redirect to a different link", + "features": ["creation"], + "properties": [ + { + "key": "url", + "name": "URL", + "control": "textfield", + "required": true, + "cssClass": "l-input-lg" + }, - { - "key": "displayText", - "name": "Text to Display", - "control": "textfield", - "required": true, - "cssClass": "l-input-lg" - }, - { - "key": "displayFormat", - "name": "Display Format", - "control": "select", - "options": [ - { - "name": "Link", - "value": "link" - }, - { - "value": "button", - "name": "Button" - } - ], - "cssClass": "l-inline" - }, - { - "key": "openNewTab", - "name": "Tab to Open Hyperlink", - "control": "select", - "options": [ - { - "name": "Open in this tab", - "value": "thisTab" - }, - { - "value": "newTab", - "name": "Open in a new tab" - } - ], - "cssClass": "l-inline" + { + "key": "displayText", + "name": "Text to Display", + "control": "textfield", + "required": true, + "cssClass": "l-input-lg" + }, + { + "key": "displayFormat", + "name": "Display Format", + "control": "select", + "options": [ + { + "name": "Link", + "value": "link" + }, + { + "value": "button", + "name": "Button" + } + ], + "cssClass": "l-inline" + }, + { + "key": "openNewTab", + "name": "Tab to Open Hyperlink", + "control": "select", + "options": [ + { + "name": "Open in this tab", + "value": "thisTab" + }, + { + "value": "newTab", + "name": "Open in a new tab" + } + ], + "cssClass": "l-inline" + } + ], + "model": { + "displayFormat": "link", + "openNewTab": "thisTab", + "removeTitle": true } - ], - "model": { - "displayFormat": "link", - "openNewTab": "thisTab", - "removeTitle": true - } - } - ], - "views": [ - { - "key": "hyperlink", - "type": "hyperlink", - "name": "Hyperlink Display", - "template": hyperlinkTemplate, - "editable": false - } - ], - "controllers": [ - { - "key": "HyperlinkController", - "implementation": HyperlinkController, - "depends": ["$scope"] - } - ] + } + ], + "views": [ + { + "key": "hyperlink", + "type": "hyperlink", + "name": "Hyperlink Display", + "template": hyperlinkTemplate, + "editable": false + } + ], + "controllers": [ + { + "key": "HyperlinkController", + "implementation": HyperlinkController, + "depends": ["$scope"] + } + ] + } } - }); + }; }); diff --git a/platform/features/imagery/bundle.js b/platform/features/imagery/bundle.js index a4f19934fb..ce0745519f 100644 --- a/platform/features/imagery/bundle.js +++ b/platform/features/imagery/bundle.js @@ -24,62 +24,63 @@ define([ "./src/policies/ImageryViewPolicy", "./src/controllers/ImageryController", "./src/directives/MCTBackgroundImage", - "./res/templates/imagery.html", - 'legacyRegistry' + "./res/templates/imagery.html" ], function ( ImageryViewPolicy, ImageryController, MCTBackgroundImage, - imageryTemplate, - legacyRegistry + imageryTemplate ) { - legacyRegistry.register("platform/features/imagery", { - "name": "Plot view for telemetry", - "extensions": { - "views": [ - { - "name": "Imagery", - "key": "imagery", - "cssClass": "icon-image", - "template": imageryTemplate, - "priority": "preferred", - "needs": [ - "telemetry" - ], - "editable": false - } - ], - "policies": [ - { - "category": "view", - "implementation": ImageryViewPolicy, - "depends": [ - "openmct" - ] - } - ], - "controllers": [ - { - "key": "ImageryController", - "implementation": ImageryController, - "depends": [ - "$scope", - "$window", - "$element", - "openmct" - ] - } - ], - "directives": [ - { - "key": "mctBackgroundImage", - "implementation": MCTBackgroundImage, - "depends": [ - "$document" - ] - } - ] + return { + name:"platform/features/imagery", + definition: { + "name": "Plot view for telemetry", + "extensions": { + "views": [ + { + "name": "Imagery", + "key": "imagery", + "cssClass": "icon-image", + "template": imageryTemplate, + "priority": "preferred", + "needs": [ + "telemetry" + ], + "editable": false + } + ], + "policies": [ + { + "category": "view", + "implementation": ImageryViewPolicy, + "depends": [ + "openmct" + ] + } + ], + "controllers": [ + { + "key": "ImageryController", + "implementation": ImageryController, + "depends": [ + "$scope", + "$window", + "$element", + "openmct" + ] + } + ], + "directives": [ + { + "key": "mctBackgroundImage", + "implementation": MCTBackgroundImage, + "depends": [ + "$document" + ] + } + ] + } } - }); + }; }); diff --git a/platform/features/my-items/bundle.js b/platform/features/my-items/bundle.js index 511eba81f6..2c46e1a5a1 100644 --- a/platform/features/my-items/bundle.js +++ b/platform/features/my-items/bundle.js @@ -20,32 +20,30 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define([ - 'legacyRegistry' -], function ( - legacyRegistry -) { - - legacyRegistry.register("platform/features/my-items", { - "name": "My Items", - "description": "Defines a root named My Items", - "extensions": { - "roots": [ - { - "id": "mine" - } - ], - "models": [ - { - "id": "mine", - "model": { - "name": "My Items", - "type": "folder", - "composition": [], - "location": "ROOT" +define([], function () { + return { + name:"platform/features/my-items", + definition: { + "name": "My Items", + "description": "Defines a root named My Items", + "extensions": { + "roots": [ + { + "id": "mine" } - } - ] + ], + "models": [ + { + "id": "mine", + "model": { + "name": "My Items", + "type": "folder", + "composition": [], + "location": "ROOT" + } + } + ] + } } - }); + }; }); diff --git a/platform/features/pages/bundle.js b/platform/features/pages/bundle.js index 184f65e14c..0a623b71fc 100644 --- a/platform/features/pages/bundle.js +++ b/platform/features/pages/bundle.js @@ -22,55 +22,56 @@ define([ "./src/EmbeddedPageController", - "./res/iframe.html", - 'legacyRegistry' + "./res/iframe.html" ], function ( EmbeddedPageController, - iframeTemplate, - legacyRegistry + iframeTemplate ) { - legacyRegistry.register("platform/features/pages", { - "extensions": { - "types": [ - { - "key": "example.page", - "name": "Web Page", - "cssClass": "icon-page", - "description": "Embed a web page or web-based image in a resizeable window component. Can be added to Display Layouts. Note that the URL being embedded must allow iframing.", - "priority": 50, - "features": [ - "creation" - ], - "properties": [ - { - "key": "url", - "name": "URL", - "control": "textfield", - "required": true, - "cssClass": "l-input-lg" - } - ] - } - ], - "views": [ - { - "template": iframeTemplate, - "name": "Page", - "type": "example.page", - "key": "example.page", - "editable": false - } - ], - "controllers": [ - { - "key": "EmbeddedPageController", - "implementation": EmbeddedPageController, - "depends": [ - "$sce" - ] - } - ] + return { + name:"platform/features/pages", + definition: { + "extensions": { + "types": [ + { + "key": "example.page", + "name": "Web Page", + "cssClass": "icon-page", + "description": "Embed a web page or web-based image in a resizeable window component. Can be added to Display Layouts. Note that the URL being embedded must allow iframing.", + "priority": 50, + "features": [ + "creation" + ], + "properties": [ + { + "key": "url", + "name": "URL", + "control": "textfield", + "required": true, + "cssClass": "l-input-lg" + } + ] + } + ], + "views": [ + { + "template": iframeTemplate, + "name": "Page", + "type": "example.page", + "key": "example.page", + "editable": false + } + ], + "controllers": [ + { + "key": "EmbeddedPageController", + "implementation": EmbeddedPageController, + "depends": [ + "$sce" + ] + } + ] + } } - }); + }; }); diff --git a/platform/features/static-markup/bundle.js b/platform/features/static-markup/bundle.js index b633de36fe..f31aca8071 100644 --- a/platform/features/static-markup/bundle.js +++ b/platform/features/static-markup/bundle.js @@ -22,35 +22,35 @@ define([ - "./res/markup.html", - 'legacyRegistry' + "./res/markup.html" ], function ( - - markupTemplate, - legacyRegistry + markupTemplate ) { - legacyRegistry.register("platform/features/static-markup", { - "extensions": { - "types": [ - { - "key": "static.markup", - "name": "Static Markup", - "cssClass": "icon-pencil", - "description": "Static markup sandbox", - "features": [ - "creation" - ] - } - ], - "views": [ - { - "template": markupTemplate, - "name": "Static Markup", - "type": "static.markup", - "key": "static.markup" - } - ] + return { + name:"platform/features/static-markup", + definition: { + "extensions": { + "types": [ + { + "key": "static.markup", + "name": "Static Markup", + "cssClass": "icon-pencil", + "description": "Static markup sandbox", + "features": [ + "creation" + ] + } + ], + "views": [ + { + "template": markupTemplate, + "name": "Static Markup", + "type": "static.markup", + "key": "static.markup" + } + ] + } } - }); + }; }); diff --git a/platform/features/timeline/bundle.js b/platform/features/timeline/bundle.js index 4bc363edb3..5f2f83dbdf 100644 --- a/platform/features/timeline/bundle.js +++ b/platform/features/timeline/bundle.js @@ -21,31 +21,32 @@ *****************************************************************************/ define([ - "./res/templates/deprecated-timeline-message.html", - 'legacyRegistry' + "./res/templates/deprecated-timeline-message.html" ], function ( - deprecatedTimelineMessage, - legacyRegistry + deprecatedTimelineMessage ) { - legacyRegistry.register('platform/features/timeline', { - extensions: { - types: [ - { - key: "timeline", - name: "Timeline", - description: "Timeline, Activity and Activity Mode objects have been deprecated and will no longer be supported. (07/18/2018)", - priority: 502 - } - ], - views: [ - { - key: "timeline", - name: "Timeline", - type: "timeline", - description: "Timeline, Activity and Activity Mode objects have been deprecated and will no longer be supported. (07/18/2018)", - template: deprecatedTimelineMessage - } - ] + return { + name: 'platform/features/timeline', + definition: { + extensions: { + types: [ + { + key: "timeline", + name: "Timeline", + description: "Timeline, Activity and Activity Mode objects have been deprecated and will no longer be supported. (07/18/2018)", + priority: 502 + } + ], + views: [ + { + key: "timeline", + name: "Timeline", + type: "timeline", + description: "Timeline, Activity and Activity Mode objects have been deprecated and will no longer be supported. (07/18/2018)", + template: deprecatedTimelineMessage + } + ] + } } - }); + }; }); diff --git a/platform/forms/bundle.js b/platform/forms/bundle.js index 193d84963f..4bf9ef688a 100644 --- a/platform/forms/bundle.js +++ b/platform/forms/bundle.js @@ -45,8 +45,7 @@ define([ "./res/templates/controls/dialog.html", "./res/templates/controls/radio.html", "./res/templates/controls/file-input.html", - "./res/templates/controls/snap-view.html", - 'legacyRegistry' + "./res/templates/controls/snap-view.html" ], function ( MCTForm, MCTControl, @@ -72,146 +71,148 @@ define([ dialogTemplate, radioTemplate, fileInputTemplate, - snapViewTemplate, - legacyRegistry + snapViewTemplate ) { - legacyRegistry.register("platform/forms", { - "name": "MCT Forms", - "description": "Form generator; includes directive and some controls.", - "extensions": { - "directives": [ - { - "key": "mctForm", - "implementation": MCTForm - }, - { - "key": "mctControl", - "implementation": MCTControl, - "depends": [ - "templateLinker", - "controls[]" - ] - }, - { - "key": "mctFileInput", - "implementation": MCTFileInput, - "depends": [ - "fileInputService" - ] - } - ], - "controls": [ - { - "key": "autocomplete", - "template": autocompleteTemplate - }, - { - "key": "checkbox", - "template": checkboxTemplate - }, - { - "key": "radio", - "template": radioTemplate - }, - { - "key": "datetime", - "template": datetimeTemplate - }, - { - "key": "select", - "template": selectTemplate - }, - { - "key": "textfield", - "template": textfieldTemplate - }, - { - "key": "numberfield", - "template": numberfieldTemplate - }, - { - "key": "textarea", - "template": textareaTemplate - }, - { - "key": "button", - "template": buttonTemplate - }, - { - "key": "color", - "template": colorTemplate - }, - { - "key": "composite", - "template": compositeTemplate - }, - { - "key": "menu-button", - "template": menuButtonTemplate - }, - { - "key": "dialog-button", - "template": dialogTemplate - }, - { - "key": "file-input", - "template": fileInputTemplate - }, - { - "key": "snap-view", - "template": snapViewTemplate - } - ], - "controllers": [ - { - "key": "AutocompleteController", - "implementation": AutocompleteController, - "depends": [ - "$scope", - "$element" - ] - }, - { - "key": "DateTimeController", - "implementation": DateTimeController, - "depends": [ - "$scope" - ] - }, - { - "key": "CompositeController", - "implementation": CompositeController - }, - { - "key": "ColorController", - "implementation": ColorController - }, - { - "key": "DialogButtonController", - "implementation": DialogButtonController, - "depends": [ - "$scope", - "dialogService" - ] - }, - { - "key": "SnapshotPreviewController", - "implementation": SnapshotPreviewController, - "depends": [ - "$scope", - "openmct" - ] - } - ], - "components": [ - { - "provides": "fileInputService", - "type": "provider", - "implementation": FileInputService - } + return { + name:"platform/forms", + definition: { + "name": "MCT Forms", + "description": "Form generator; includes directive and some controls.", + "extensions": { + "directives": [ + { + "key": "mctForm", + "implementation": MCTForm + }, + { + "key": "mctControl", + "implementation": MCTControl, + "depends": [ + "templateLinker", + "controls[]" + ] + }, + { + "key": "mctFileInput", + "implementation": MCTFileInput, + "depends": [ + "fileInputService" + ] + } + ], + "controls": [ + { + "key": "autocomplete", + "template": autocompleteTemplate + }, + { + "key": "checkbox", + "template": checkboxTemplate + }, + { + "key": "radio", + "template": radioTemplate + }, + { + "key": "datetime", + "template": datetimeTemplate + }, + { + "key": "select", + "template": selectTemplate + }, + { + "key": "textfield", + "template": textfieldTemplate + }, + { + "key": "numberfield", + "template": numberfieldTemplate + }, + { + "key": "textarea", + "template": textareaTemplate + }, + { + "key": "button", + "template": buttonTemplate + }, + { + "key": "color", + "template": colorTemplate + }, + { + "key": "composite", + "template": compositeTemplate + }, + { + "key": "menu-button", + "template": menuButtonTemplate + }, + { + "key": "dialog-button", + "template": dialogTemplate + }, + { + "key": "file-input", + "template": fileInputTemplate + }, + { + "key": "snap-view", + "template": snapViewTemplate + } + ], + "controllers": [ + { + "key": "AutocompleteController", + "implementation": AutocompleteController, + "depends": [ + "$scope", + "$element" + ] + }, + { + "key": "DateTimeController", + "implementation": DateTimeController, + "depends": [ + "$scope" + ] + }, + { + "key": "CompositeController", + "implementation": CompositeController + }, + { + "key": "ColorController", + "implementation": ColorController + }, + { + "key": "DialogButtonController", + "implementation": DialogButtonController, + "depends": [ + "$scope", + "dialogService" + ] + }, + { + "key": "SnapshotPreviewController", + "implementation": SnapshotPreviewController, + "depends": [ + "$scope", + "openmct" + ] + } + ], + "components": [ + { + "provides": "fileInputService", + "type": "provider", + "implementation": FileInputService + } - ] + ] + } } - }); + }; }); diff --git a/platform/framework/bundle.js b/platform/framework/bundle.js index cd548142da..988d8564f1 100644 --- a/platform/framework/bundle.js +++ b/platform/framework/bundle.js @@ -20,91 +20,88 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define([ +define([], function () { - 'legacyRegistry' -], function ( - - legacyRegistry -) { - - legacyRegistry.register("platform/framework", { - "name": "Open MCT Framework Component", - "description": "Framework layer for Open MCT; interprets bundle definitions and serves as an intermediary between Require and Angular", - "libraries": "lib", - "configuration": { - "paths": { - "angular": "angular.min" + return { + name:"platform/framework", + definition: { + "name": "Open MCT Framework Component", + "description": "Framework layer for Open MCT; interprets bundle definitions and serves as an intermediary between Require and Angular", + "libraries": "lib", + "configuration": { + "paths": { + "angular": "angular.min" + }, + "shim": { + "angular": { + "exports": "angular" + } + } }, - "shim": { - "angular": { - "exports": "angular" - } + "extensions": { + "licenses": [ + { + "name": "Blanket.js", + "version": "1.1.5", + "description": "Code coverage measurement and reporting", + "author": "Alex Seville", + "website": "http://blanketjs.org/", + "copyright": "Copyright (c) 2013 Alex Seville", + "license": "license-mit", + "link": "http://opensource.org/licenses/MIT" + }, + { + "name": "Jasmine", + "version": "1.3.1", + "description": "Unit testing", + "author": "Pivotal Labs", + "website": "http://jasmine.github.io/", + "copyright": "Copyright (c) 2008-2011 Pivotal Labs", + "license": "license-mit", + "link": "http://opensource.org/licenses/MIT" + }, + { + "name": "RequireJS", + "version": "2.1.22", + "description": "Script loader", + "author": "The Dojo Foundation", + "website": "http://requirejs.org/", + "copyright": "Copyright (c) 2010-2015, The Dojo Foundation", + "license": "license-mit", + "link": "https://github.com/jrburke/requirejs/blob/master/LICENSE" + }, + { + "name": "AngularJS", + "version": "1.4.4", + "description": "Client-side web application framework", + "author": "Google", + "website": "http://angularjs.org/", + "copyright": "Copyright (c) 2010-2015 Google, Inc. http://angularjs.org", + "license": "license-mit", + "link": "https://github.com/angular/angular.js/blob/v1.4.4/LICENSE" + }, + { + "name": "Angular-Route", + "version": "1.4.4", + "description": "Client-side view routing", + "author": "Google", + "website": "http://angularjs.org/", + "copyright": "Copyright (c) 2010-2015 Google, Inc. http://angularjs.org", + "license": "license-mit", + "link": "https://github.com/angular/angular.js/blob/v1.4.4/LICENSE" + }, + { + "name": "ES6-Promise", + "version": "3.0.2", + "description": "Promise polyfill for pre-ECMAScript 6 browsers", + "author": "Yehuda Katz, Tom Dale, Stefan Penner and contributors", + "website": "https://github.com/jakearchibald/es6-promise", + "copyright": "Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors", + "license": "license-mit", + "link": "https://github.com/jakearchibald/es6-promise/blob/master/LICENSE" + } + ] } - }, - "extensions": { - "licenses": [ - { - "name": "Blanket.js", - "version": "1.1.5", - "description": "Code coverage measurement and reporting", - "author": "Alex Seville", - "website": "http://blanketjs.org/", - "copyright": "Copyright (c) 2013 Alex Seville", - "license": "license-mit", - "link": "http://opensource.org/licenses/MIT" - }, - { - "name": "Jasmine", - "version": "1.3.1", - "description": "Unit testing", - "author": "Pivotal Labs", - "website": "http://jasmine.github.io/", - "copyright": "Copyright (c) 2008-2011 Pivotal Labs", - "license": "license-mit", - "link": "http://opensource.org/licenses/MIT" - }, - { - "name": "RequireJS", - "version": "2.1.22", - "description": "Script loader", - "author": "The Dojo Foundation", - "website": "http://requirejs.org/", - "copyright": "Copyright (c) 2010-2015, The Dojo Foundation", - "license": "license-mit", - "link": "https://github.com/jrburke/requirejs/blob/master/LICENSE" - }, - { - "name": "AngularJS", - "version": "1.4.4", - "description": "Client-side web application framework", - "author": "Google", - "website": "http://angularjs.org/", - "copyright": "Copyright (c) 2010-2015 Google, Inc. http://angularjs.org", - "license": "license-mit", - "link": "https://github.com/angular/angular.js/blob/v1.4.4/LICENSE" - }, - { - "name": "Angular-Route", - "version": "1.4.4", - "description": "Client-side view routing", - "author": "Google", - "website": "http://angularjs.org/", - "copyright": "Copyright (c) 2010-2015 Google, Inc. http://angularjs.org", - "license": "license-mit", - "link": "https://github.com/angular/angular.js/blob/v1.4.4/LICENSE" - }, - { - "name": "ES6-Promise", - "version": "3.0.2", - "description": "Promise polyfill for pre-ECMAScript 6 browsers", - "author": "Yehuda Katz, Tom Dale, Stefan Penner and contributors", - "website": "https://github.com/jakearchibald/es6-promise", - "copyright": "Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors", - "license": "license-mit", - "link": "https://github.com/jakearchibald/es6-promise/blob/master/LICENSE" - } - ] } - }); + }; }); diff --git a/platform/identity/bundle.js b/platform/identity/bundle.js index 0b6a4a85de..c9b6536076 100644 --- a/platform/identity/bundle.js +++ b/platform/identity/bundle.js @@ -24,63 +24,64 @@ define([ "./src/IdentityAggregator", "./src/IdentityProvider", "./src/IdentityCreationDecorator", - "./src/IdentityIndicator", - 'legacyRegistry' + "./src/IdentityIndicator" ], function ( IdentityAggregator, IdentityProvider, IdentityCreationDecorator, - IdentityIndicator, - legacyRegistry + IdentityIndicator ) { - legacyRegistry.register("platform/identity", { - "extensions": { - "components": [ - { - "implementation": IdentityAggregator, - "type": "aggregator", - "provides": "identityService", - "depends": [ - "$q" - ] - }, - { - "implementation": IdentityProvider, - "type": "provider", - "provides": "identityService", - "depends": [ - "$q" - ], - "priority": "fallback" - }, - { - "type": "decorator", - "provides": "creationService", - "implementation": IdentityCreationDecorator, - "depends": [ - "identityService" - ] - } - ], - "indicators": [ - { - "implementation": IdentityIndicator, - "depends": [ - "identityService" - ] - } - ], - "types": [ - { - "properties": [ - { - "key": "creator", - "name": "Creator" - } - ] - } - ] + return { + name:"platform/identity", + definition: { + "extensions": { + "components": [ + { + "implementation": IdentityAggregator, + "type": "aggregator", + "provides": "identityService", + "depends": [ + "$q" + ] + }, + { + "implementation": IdentityProvider, + "type": "provider", + "provides": "identityService", + "depends": [ + "$q" + ], + "priority": "fallback" + }, + { + "type": "decorator", + "provides": "creationService", + "implementation": IdentityCreationDecorator, + "depends": [ + "identityService" + ] + } + ], + "indicators": [ + { + "implementation": IdentityIndicator, + "depends": [ + "identityService" + ] + } + ], + "types": [ + { + "properties": [ + { + "key": "creator", + "name": "Creator" + } + ] + } + ] + } } - }); + }; }); diff --git a/platform/persistence/aggregator/bundle.js b/platform/persistence/aggregator/bundle.js index 2880b15984..27829090a0 100644 --- a/platform/persistence/aggregator/bundle.js +++ b/platform/persistence/aggregator/bundle.js @@ -21,25 +21,26 @@ *****************************************************************************/ define([ - "./src/PersistenceAggregator", - 'legacyRegistry' + "./src/PersistenceAggregator" ], function ( - PersistenceAggregator, - legacyRegistry + PersistenceAggregator ) { - legacyRegistry.register("platform/persistence/aggregator", { - "extensions": { - "components": [ - { - "provides": "persistenceService", - "type": "aggregator", - "depends": [ - "$q" - ], - "implementation": PersistenceAggregator - } - ] + return { + name:"platform/persistence/aggregator", + definition: { + "extensions": { + "components": [ + { + "provides": "persistenceService", + "type": "aggregator", + "depends": [ + "$q" + ], + "implementation": PersistenceAggregator + } + ] + } } - }); + }; }); diff --git a/platform/persistence/couch/bundle.js b/platform/persistence/couch/bundle.js index 0b35e9f0ca..b66f1c8e70 100644 --- a/platform/persistence/couch/bundle.js +++ b/platform/persistence/couch/bundle.js @@ -22,56 +22,57 @@ define([ "./src/CouchPersistenceProvider", - "./src/CouchIndicator", - 'legacyRegistry' + "./src/CouchIndicator" ], function ( CouchPersistenceProvider, - CouchIndicator, - legacyRegistry + CouchIndicator ) { - legacyRegistry.register("platform/persistence/couch", { - "name": "Couch Persistence", - "description": "Adapter to read and write objects using a CouchDB instance.", - "extensions": { - "components": [ - { - "provides": "persistenceService", - "type": "provider", - "implementation": CouchPersistenceProvider, - "depends": [ - "$http", - "$q", - "PERSISTENCE_SPACE", - "COUCHDB_PATH" - ] - } - ], - "constants": [ - { - "key": "PERSISTENCE_SPACE", - "value": "mct" - }, - { - "key": "COUCHDB_PATH", - "value": "/couch/openmct" - }, - { - "key": "COUCHDB_INDICATOR_INTERVAL", - "value": 15000 - } - ], - "indicators": [ - { - "implementation": CouchIndicator, - "depends": [ - "$http", - "$interval", - "COUCHDB_PATH", - "COUCHDB_INDICATOR_INTERVAL" - ] - } - ] + return { + name:"platform/persistence/couch", + definition: { + "name": "Couch Persistence", + "description": "Adapter to read and write objects using a CouchDB instance.", + "extensions": { + "components": [ + { + "provides": "persistenceService", + "type": "provider", + "implementation": CouchPersistenceProvider, + "depends": [ + "$http", + "$q", + "PERSISTENCE_SPACE", + "COUCHDB_PATH" + ] + } + ], + "constants": [ + { + "key": "PERSISTENCE_SPACE", + "value": "mct" + }, + { + "key": "COUCHDB_PATH", + "value": "/couch/openmct" + }, + { + "key": "COUCHDB_INDICATOR_INTERVAL", + "value": 15000 + } + ], + "indicators": [ + { + "implementation": CouchIndicator, + "depends": [ + "$http", + "$interval", + "COUCHDB_PATH", + "COUCHDB_INDICATOR_INTERVAL" + ] + } + ] + } } - }); + }; }); diff --git a/platform/persistence/elastic/bundle.js b/platform/persistence/elastic/bundle.js index da6b21f6a4..ed1a1fca4b 100644 --- a/platform/persistence/elastic/bundle.js +++ b/platform/persistence/elastic/bundle.js @@ -23,74 +23,75 @@ define([ "./src/ElasticPersistenceProvider", "./src/ElasticSearchProvider", - "./src/ElasticIndicator", - 'legacyRegistry' + "./src/ElasticIndicator" ], function ( ElasticPersistenceProvider, ElasticSearchProvider, - ElasticIndicator, - legacyRegistry + ElasticIndicator ) { - legacyRegistry.register("platform/persistence/elastic", { - "name": "ElasticSearch Persistence", - "description": "Adapter to read and write objects using an ElasticSearch instance.", - "extensions": { - "components": [ - { - "provides": "persistenceService", - "type": "provider", - "implementation": ElasticPersistenceProvider, - "depends": [ - "$http", - "$q", - "PERSISTENCE_SPACE", - "ELASTIC_ROOT", - "ELASTIC_PATH" - ] - }, - { - "provides": "searchService", - "type": "provider", - "implementation": ElasticSearchProvider, - "depends": [ - "$http", - "ELASTIC_ROOT" - ] - } - ], - "constants": [ - { - "key": "PERSISTENCE_SPACE", - "value": "mct" - }, - { - "key": "ELASTIC_ROOT", - "value": "http://localhost:9200", - "priority": "fallback" - }, - { - "key": "ELASTIC_PATH", - "value": "mct/domain_object", - "priority": "fallback" - }, - { - "key": "ELASTIC_INDICATOR_INTERVAL", - "value": 15000, - "priority": "fallback" - } - ], - "indicators": [ - { - "implementation": ElasticIndicator, - "depends": [ - "$http", - "$interval", - "ELASTIC_ROOT", - "ELASTIC_INDICATOR_INTERVAL" - ] - } - ] + return { + name:"platform/persistence/elastic", + definition: { + "name": "ElasticSearch Persistence", + "description": "Adapter to read and write objects using an ElasticSearch instance.", + "extensions": { + "components": [ + { + "provides": "persistenceService", + "type": "provider", + "implementation": ElasticPersistenceProvider, + "depends": [ + "$http", + "$q", + "PERSISTENCE_SPACE", + "ELASTIC_ROOT", + "ELASTIC_PATH" + ] + }, + { + "provides": "searchService", + "type": "provider", + "implementation": ElasticSearchProvider, + "depends": [ + "$http", + "ELASTIC_ROOT" + ] + } + ], + "constants": [ + { + "key": "PERSISTENCE_SPACE", + "value": "mct" + }, + { + "key": "ELASTIC_ROOT", + "value": "http://localhost:9200", + "priority": "fallback" + }, + { + "key": "ELASTIC_PATH", + "value": "mct/domain_object", + "priority": "fallback" + }, + { + "key": "ELASTIC_INDICATOR_INTERVAL", + "value": 15000, + "priority": "fallback" + } + ], + "indicators": [ + { + "implementation": ElasticIndicator, + "depends": [ + "$http", + "$interval", + "ELASTIC_ROOT", + "ELASTIC_INDICATOR_INTERVAL" + ] + } + ] + } } - }); + }; }); diff --git a/platform/persistence/local/bundle.js b/platform/persistence/local/bundle.js index 29d4207a26..c6afd9575a 100644 --- a/platform/persistence/local/bundle.js +++ b/platform/persistence/local/bundle.js @@ -22,39 +22,40 @@ define([ "./src/LocalStoragePersistenceProvider", - "./src/LocalStorageIndicator", - 'legacyRegistry' + "./src/LocalStorageIndicator" ], function ( LocalStoragePersistenceProvider, - LocalStorageIndicator, - legacyRegistry + LocalStorageIndicator ) { - legacyRegistry.register("platform/persistence/local", { - "extensions": { - "components": [ - { - "provides": "persistenceService", - "type": "provider", - "implementation": LocalStoragePersistenceProvider, - "depends": [ - "$window", - "$q", - "PERSISTENCE_SPACE" - ] - } - ], - "constants": [ - { - "key": "PERSISTENCE_SPACE", - "value": "mct" - } - ], - "indicators": [ - { - "implementation": LocalStorageIndicator - } - ] + return { + name:"platform/persistence/local", + definition: { + "extensions": { + "components": [ + { + "provides": "persistenceService", + "type": "provider", + "implementation": LocalStoragePersistenceProvider, + "depends": [ + "$window", + "$q", + "PERSISTENCE_SPACE" + ] + } + ], + "constants": [ + { + "key": "PERSISTENCE_SPACE", + "value": "mct" + } + ], + "indicators": [ + { + "implementation": LocalStorageIndicator + } + ] + } } - }); + }; }); diff --git a/platform/persistence/queue/bundle.js b/platform/persistence/queue/bundle.js index 1906328adc..7fcf98124a 100644 --- a/platform/persistence/queue/bundle.js +++ b/platform/persistence/queue/bundle.js @@ -24,58 +24,59 @@ define([ "./src/QueuingPersistenceCapabilityDecorator", "./src/PersistenceQueue", "./src/PersistenceFailureController", - "./res/templates/persistence-failure-dialog.html", - 'legacyRegistry' + "./res/templates/persistence-failure-dialog.html" ], function ( QueuingPersistenceCapabilityDecorator, PersistenceQueue, PersistenceFailureController, - persistenceFailureDialogTemplate, - legacyRegistry + persistenceFailureDialogTemplate ) { - legacyRegistry.register("platform/persistence/queue", { - "extensions": { - "components": [ - { - "type": "decorator", - "provides": "capabilityService", - "implementation": QueuingPersistenceCapabilityDecorator, - "depends": [ - "persistenceQueue" - ] - } - ], - "services": [ - { - "key": "persistenceQueue", - "implementation": PersistenceQueue, - "depends": [ - "$q", - "$timeout", - "dialogService", - "PERSISTENCE_QUEUE_DELAY" - ] - } - ], - "constants": [ - { - "key": "PERSISTENCE_QUEUE_DELAY", - "value": 5 - } - ], - "templates": [ - { - "key": "persistence-failure-dialog", - "template": persistenceFailureDialogTemplate - } - ], - "controllers": [ - { - "key": "PersistenceFailureController", - "implementation": PersistenceFailureController - } - ] + return { + name:"platform/persistence/queue", + definition: { + "extensions": { + "components": [ + { + "type": "decorator", + "provides": "capabilityService", + "implementation": QueuingPersistenceCapabilityDecorator, + "depends": [ + "persistenceQueue" + ] + } + ], + "services": [ + { + "key": "persistenceQueue", + "implementation": PersistenceQueue, + "depends": [ + "$q", + "$timeout", + "dialogService", + "PERSISTENCE_QUEUE_DELAY" + ] + } + ], + "constants": [ + { + "key": "PERSISTENCE_QUEUE_DELAY", + "value": 5 + } + ], + "templates": [ + { + "key": "persistence-failure-dialog", + "template": persistenceFailureDialogTemplate + } + ], + "controllers": [ + { + "key": "PersistenceFailureController", + "implementation": PersistenceFailureController + } + ] + } } - }); + }; }); diff --git a/platform/policy/bundle.js b/platform/policy/bundle.js index 13090a37ac..8d7a61fa4f 100644 --- a/platform/policy/bundle.js +++ b/platform/policy/bundle.js @@ -23,46 +23,47 @@ define([ "./src/PolicyActionDecorator", "./src/PolicyViewDecorator", - "./src/PolicyProvider", - 'legacyRegistry' + "./src/PolicyProvider" ], function ( PolicyActionDecorator, PolicyViewDecorator, - PolicyProvider, - legacyRegistry + PolicyProvider ) { - legacyRegistry.register("platform/policy", { - "name": "Policy Service", - "description": "Provides support for extension-driven decisions.", - "sources": "src", - "extensions": { - "components": [ - { - "type": "decorator", - "provides": "actionService", - "implementation": PolicyActionDecorator, - "depends": [ - "policyService" - ] - }, - { - "type": "decorator", - "provides": "viewService", - "implementation": PolicyViewDecorator, - "depends": [ - "policyService" - ] - }, - { - "type": "provider", - "provides": "policyService", - "implementation": PolicyProvider, - "depends": [ - "policies[]" - ] - } - ] + return { + name:"platform/policy", + definition: { + "name": "Policy Service", + "description": "Provides support for extension-driven decisions.", + "sources": "src", + "extensions": { + "components": [ + { + "type": "decorator", + "provides": "actionService", + "implementation": PolicyActionDecorator, + "depends": [ + "policyService" + ] + }, + { + "type": "decorator", + "provides": "viewService", + "implementation": PolicyViewDecorator, + "depends": [ + "policyService" + ] + }, + { + "type": "provider", + "provides": "policyService", + "implementation": PolicyProvider, + "depends": [ + "policies[]" + ] + } + ] + } } - }); + }; }); diff --git a/platform/representation/bundle.js b/platform/representation/bundle.js index b967ef9b86..37c4b4af4f 100644 --- a/platform/representation/bundle.js +++ b/platform/representation/bundle.js @@ -29,8 +29,7 @@ define([ "./src/gestures/GestureRepresenter", "./src/services/DndService", "./src/TemplateLinker", - "./src/TemplatePrefetcher", - 'legacyRegistry' + "./src/TemplatePrefetcher" ], function ( MCTInclude, MCTRepresentation, @@ -40,104 +39,106 @@ define([ GestureRepresenter, DndService, TemplateLinker, - TemplatePrefetcher, - legacyRegistry + TemplatePrefetcher ) { - legacyRegistry.register("platform/representation", { - "extensions": { - "directives": [ - { - "key": "mctInclude", - "implementation": MCTInclude, - "depends": [ - "templates[]", - "templateLinker" - ] - }, - { - "key": "mctRepresentation", - "implementation": MCTRepresentation, - "depends": [ - "representations[]", - "views[]", - "representers[]", - "$q", - "templateLinker", - "$log" - ] - } - ], - "gestures": [ - { - "key": "drag", - "implementation": DragGesture, - "depends": [ - "$log", - "dndService" - ] - }, - { - "key": "drop", - "implementation": DropGesture, - "depends": [ - "dndService", - "$q" - ] - } - ], - "components": [ - { - "provides": "gestureService", - "type": "provider", - "implementation": GestureProvider, - "depends": [ - "gestures[]" - ] - } - ], - "representers": [ - { - "implementation": GestureRepresenter, - "depends": [ - "gestureService" - ] - } - ], - "services": [ - { - "key": "dndService", - "implementation": DndService, - "depends": [ - "$log" - ] - }, - { - "key": "templateLinker", - "implementation": TemplateLinker, - "depends": [ - "$templateRequest", - "$sce", - "$compile", - "$log" - ], - "comment": "For internal use by mct-include and mct-representation." - } - ], - "runs": [ - { - "priority": "mandatory", - "implementation": TemplatePrefetcher, - "depends": [ - "templateLinker", - "templates[]", - "views[]", - "representations[]", - "controls[]", - "containers[]" - ] - } - ] + return { + name:"platform/representation", + definition: { + "extensions": { + "directives": [ + { + "key": "mctInclude", + "implementation": MCTInclude, + "depends": [ + "templates[]", + "templateLinker" + ] + }, + { + "key": "mctRepresentation", + "implementation": MCTRepresentation, + "depends": [ + "representations[]", + "views[]", + "representers[]", + "$q", + "templateLinker", + "$log" + ] + } + ], + "gestures": [ + { + "key": "drag", + "implementation": DragGesture, + "depends": [ + "$log", + "dndService" + ] + }, + { + "key": "drop", + "implementation": DropGesture, + "depends": [ + "dndService", + "$q" + ] + } + ], + "components": [ + { + "provides": "gestureService", + "type": "provider", + "implementation": GestureProvider, + "depends": [ + "gestures[]" + ] + } + ], + "representers": [ + { + "implementation": GestureRepresenter, + "depends": [ + "gestureService" + ] + } + ], + "services": [ + { + "key": "dndService", + "implementation": DndService, + "depends": [ + "$log" + ] + }, + { + "key": "templateLinker", + "implementation": TemplateLinker, + "depends": [ + "$templateRequest", + "$sce", + "$compile", + "$log" + ], + "comment": "For internal use by mct-include and mct-representation." + } + ], + "runs": [ + { + "priority": "mandatory", + "implementation": TemplatePrefetcher, + "depends": [ + "templateLinker", + "templates[]", + "views[]", + "representations[]", + "controls[]", + "containers[]" + ] + } + ] + } } - }); + }; }); diff --git a/platform/search/bundle.js b/platform/search/bundle.js index 02bc333168..93cd600967 100644 --- a/platform/search/bundle.js +++ b/platform/search/bundle.js @@ -29,8 +29,7 @@ define([ "./res/templates/search.html", "./res/templates/search-menu.html", "raw-loader!./src/services/GenericSearchWorker.js", - "raw-loader!./src/services/BareBonesSearchWorker.js", - 'legacyRegistry' + "raw-loader!./src/services/BareBonesSearchWorker.js" ], function ( SearchController, SearchMenuController, @@ -40,98 +39,100 @@ define([ searchTemplate, searchMenuTemplate, searchWorkerText, - BareBonesSearchWorkerText, - legacyRegistry + BareBonesSearchWorkerText ) { - legacyRegistry.register("platform/search", { - "name": "Search", - "description": "Allows the user to search through the file tree.", - "extensions": { - "constants": [ - { - "key": "GENERIC_SEARCH_ROOTS", - "value": [ - "ROOT" - ], - "priority": "fallback" - }, - { - "key": "USE_LEGACY_INDEXER", - "value": false, - "priority": 2 - } - ], - "controllers": [ - { - "key": "SearchController", - "implementation": SearchController, - "depends": [ - "$scope", - "searchService" - ] - }, - { - "key": "SearchMenuController", - "implementation": SearchMenuController, - "depends": [ - "$scope", - "types[]" - ] - } - ], - "representations": [ - { - "key": "search-item", - "template": searchItemTemplate - } - ], - "templates": [ - { - "key": "search", - "template": searchTemplate - }, - { - "key": "search-menu", - "template": searchMenuTemplate - } - ], - "components": [ - { - "provides": "searchService", - "type": "provider", - "implementation": GenericSearchProvider, - "depends": [ - "$q", - "$log", - "modelService", - "workerService", - "topic", - "GENERIC_SEARCH_ROOTS", - "USE_LEGACY_INDEXER", - "openmct" - ] - }, - { - "provides": "searchService", - "type": "aggregator", - "implementation": SearchAggregator, - "depends": [ - "$q", - "objectService" - ] - } - ], - "workers": [ - { - "key": "bareBonesSearchWorker", - "scriptText": BareBonesSearchWorkerText - }, - { - "key": "genericSearchWorker", - "scriptText": searchWorkerText - } - ] + return { + name:"platform/search", + definition: { + "name": "Search", + "description": "Allows the user to search through the file tree.", + "extensions": { + "constants": [ + { + "key": "GENERIC_SEARCH_ROOTS", + "value": [ + "ROOT" + ], + "priority": "fallback" + }, + { + "key": "USE_LEGACY_INDEXER", + "value": false, + "priority": 2 + } + ], + "controllers": [ + { + "key": "SearchController", + "implementation": SearchController, + "depends": [ + "$scope", + "searchService" + ] + }, + { + "key": "SearchMenuController", + "implementation": SearchMenuController, + "depends": [ + "$scope", + "types[]" + ] + } + ], + "representations": [ + { + "key": "search-item", + "template": searchItemTemplate + } + ], + "templates": [ + { + "key": "search", + "template": searchTemplate + }, + { + "key": "search-menu", + "template": searchMenuTemplate + } + ], + "components": [ + { + "provides": "searchService", + "type": "provider", + "implementation": GenericSearchProvider, + "depends": [ + "$q", + "$log", + "modelService", + "workerService", + "topic", + "GENERIC_SEARCH_ROOTS", + "USE_LEGACY_INDEXER", + "openmct" + ] + }, + { + "provides": "searchService", + "type": "aggregator", + "implementation": SearchAggregator, + "depends": [ + "$q", + "objectService" + ] + } + ], + "workers": [ + { + "key": "bareBonesSearchWorker", + "scriptText": BareBonesSearchWorkerText + }, + { + "key": "genericSearchWorker", + "scriptText": searchWorkerText + } + ] + } } - }); + }; }); diff --git a/platform/status/bundle.js b/platform/status/bundle.js index 8780c7965d..3207f74917 100644 --- a/platform/status/bundle.js +++ b/platform/status/bundle.js @@ -23,40 +23,41 @@ define([ "./src/StatusRepresenter", "./src/StatusCapability", - "./src/StatusService", - 'legacyRegistry' + "./src/StatusService" ], function ( StatusRepresenter, StatusCapability, - StatusService, - legacyRegistry + StatusService ) { - legacyRegistry.register("platform/status", { - "extensions": { - "representers": [ - { - "implementation": StatusRepresenter - } - ], - "capabilities": [ - { - "key": "status", - "implementation": StatusCapability, - "depends": [ - "statusService" - ] - } - ], - "services": [ - { - "key": "statusService", - "implementation": StatusService, - "depends": [ - "topic" - ] - } - ] + return { + name:"platform/status", + definition: { + "extensions": { + "representers": [ + { + "implementation": StatusRepresenter + } + ], + "capabilities": [ + { + "key": "status", + "implementation": StatusCapability, + "depends": [ + "statusService" + ] + } + ], + "services": [ + { + "key": "statusService", + "implementation": StatusService, + "depends": [ + "topic" + ] + } + ] + } } - }); + }; }); diff --git a/platform/telemetry/bundle.js b/platform/telemetry/bundle.js index 2f9be30333..f8f93a0ed3 100644 --- a/platform/telemetry/bundle.js +++ b/platform/telemetry/bundle.js @@ -26,104 +26,105 @@ define([ "./src/TelemetryCapability", "./src/TelemetryFormatter", "./src/TelemetrySubscriber", - "./src/TelemetryHandler", - 'legacyRegistry' + "./src/TelemetryHandler" ], function ( TelemetryAggregator, TelemetryController, TelemetryCapability, TelemetryFormatter, TelemetrySubscriber, - TelemetryHandler, - legacyRegistry + TelemetryHandler ) { - legacyRegistry.register("platform/telemetry", { - "name": "Data bundle", - "description": "Interfaces and infrastructure for real-time and historical data", - "configuration": { - "paths": { - "moment": "moment.min" + return { + name:"platform/telemetry", + definition: { + "name": "Data bundle", + "description": "Interfaces and infrastructure for real-time and historical data", + "configuration": { + "paths": { + "moment": "moment.min" + }, + "shim": { + "moment": { + "exports": "moment" + } + } }, - "shim": { - "moment": { - "exports": "moment" - } + "extensions": { + "components": [ + { + "provides": "telemetryService", + "type": "aggregator", + "implementation": TelemetryAggregator, + "depends": [ + "$q" + ] + } + ], + "controllers": [ + { + "key": "TelemetryController", + "implementation": TelemetryController, + "depends": [ + "$scope", + "$q", + "$timeout", + "$log" + ] + } + ], + "capabilities": [ + { + "key": "telemetry", + "implementation": TelemetryCapability, + "depends": [ + "openmct", + "$injector", + "$q", + "$log" + ] + } + ], + "services": [ + { + "key": "telemetryFormatter", + "implementation": TelemetryFormatter, + "depends": [ + "formatService", + "DEFAULT_TIME_FORMAT" + ] + }, + { + "key": "telemetrySubscriber", + "implementation": TelemetrySubscriber, + "depends": [ + "$q", + "$timeout" + ] + }, + { + "key": "telemetryHandler", + "implementation": TelemetryHandler, + "depends": [ + "$q", + "telemetrySubscriber" + ] + } + ], + "licenses": [ + { + "name": "Moment.js", + "version": "2.11.1", + "author": "Tim Wood, Iskren Chernev, Moment.js contributors", + "description": "Time/date parsing/formatting", + "website": "http://momentjs.com", + "copyright": "Copyright (c) 2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors", + "license": "license-mit", + "link": "https://raw.githubusercontent.com/moment/moment/develop/LICENSE" + } + ] } - }, - "extensions": { - "components": [ - { - "provides": "telemetryService", - "type": "aggregator", - "implementation": TelemetryAggregator, - "depends": [ - "$q" - ] - } - ], - "controllers": [ - { - "key": "TelemetryController", - "implementation": TelemetryController, - "depends": [ - "$scope", - "$q", - "$timeout", - "$log" - ] - } - ], - "capabilities": [ - { - "key": "telemetry", - "implementation": TelemetryCapability, - "depends": [ - "openmct", - "$injector", - "$q", - "$log" - ] - } - ], - "services": [ - { - "key": "telemetryFormatter", - "implementation": TelemetryFormatter, - "depends": [ - "formatService", - "DEFAULT_TIME_FORMAT" - ] - }, - { - "key": "telemetrySubscriber", - "implementation": TelemetrySubscriber, - "depends": [ - "$q", - "$timeout" - ] - }, - { - "key": "telemetryHandler", - "implementation": TelemetryHandler, - "depends": [ - "$q", - "telemetrySubscriber" - ] - } - ], - "licenses": [ - { - "name": "Moment.js", - "version": "2.11.1", - "author": "Tim Wood, Iskren Chernev, Moment.js contributors", - "description": "Time/date parsing/formatting", - "website": "http://momentjs.com", - "copyright": "Copyright (c) 2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors", - "license": "license-mit", - "link": "https://raw.githubusercontent.com/moment/moment/develop/LICENSE" - } - ] } - }); + }; }); diff --git a/src/MCT.js b/src/MCT.js index 753039e462..9d8459ddd3 100644 --- a/src/MCT.js +++ b/src/MCT.js @@ -22,9 +22,9 @@ define([ 'EventEmitter', - 'legacyRegistry', 'uuid', - './defaultRegistry', + './BundleRegistry', + './installDefaultBundles', './api/api', './api/overlays/OverlayAPI', './selection/Selection', @@ -50,9 +50,9 @@ define([ 'vue' ], function ( EventEmitter, - legacyRegistry, uuid, - defaultRegistry, + BundleRegistry, + installDefaultBundles, api, OverlayAPI, Selection, @@ -248,7 +248,8 @@ define([ this.branding = BrandingAPI.default; - this.legacyRegistry = defaultRegistry; + this.legacyRegistry = new BundleRegistry(); + installDefaultBundles(this.legacyRegistry); // Plugin's that are installed by default @@ -258,7 +259,6 @@ define([ this.install(LegacyIndicatorsPlugin()); this.install(LicensesPlugin.default()); this.install(RemoveActionPlugin.default()); - this.install(this.plugins.ImportExport()); this.install(this.plugins.FolderView()); this.install(this.plugins.Tabs()); this.install(this.plugins.FlexibleLayout()); @@ -361,8 +361,8 @@ define([ this.legacyExtension('types', legacyDefinition); }.bind(this)); - legacyRegistry.register('adapter', this.legacyBundle); - legacyRegistry.enable('adapter'); + this.legacyRegistry.register('adapter', this.legacyBundle); + this.legacyRegistry.enable('adapter'); this.router.route(/^\/$/, () => { this.router.setPath('/browse/'); diff --git a/src/adapter/bundle.js b/src/adapter/bundle.js index 88aecd4cdf..94b1c73823 100644 --- a/src/adapter/bundle.js +++ b/src/adapter/bundle.js @@ -21,7 +21,6 @@ *****************************************************************************/ define([ - 'legacyRegistry', './actions/ActionDialogDecorator', './capabilities/AdapterCapability', './directives/MCTView', @@ -39,7 +38,6 @@ define([ './policies/LegacyCompositionPolicyAdapter', './actions/LegacyActionAdapter' ], function ( - legacyRegistry, ActionDialogDecorator, AdapterCapability, MCTView, @@ -57,161 +55,164 @@ define([ legacyCompositionPolicyAdapter, LegacyActionAdapter ) { - legacyRegistry.register('src/adapter', { - "extensions": { - "directives": [ - { - key: "mctView", - implementation: MCTView, - depends: ["openmct"] - } - ], - capabilities: [ - { - key: "adapter", - implementation: AdapterCapability - } - ], - services: [ - { - key: "instantiate", - priority: "mandatory", - implementation: Instantiate, - depends: [ - "capabilityService", - "identifierService", - "cacheService" - ] - } - ], - components: [ - { - type: "decorator", - provides: "capabilityService", - implementation: APICapabilityDecorator, - depends: [ - "$injector" - ] - }, - { - type: "decorator", - provides: "actionService", - implementation: ActionDialogDecorator, - depends: ["openmct"] - }, - { - type: "decorator", - provides: "modelService", - implementation: MissingModelCompatibilityDecorator, - depends: ["openmct"] - }, - { - provides: "objectService", - type: "decorator", - priority: "mandatory", - implementation: LegacyObjectAPIInterceptor, - depends: [ - "openmct", - "roots[]", - "instantiate", - "topic" - ] - } - ], - policies: [ - { - category: "view", - implementation: AdaptedViewPolicy, - depends: ["openmct"] - } - ], - runs: [ - { - implementation: TypeDeprecationChecker, - depends: ["types[]"] - }, - { - implementation: AlternateCompositionInitializer, - depends: ["openmct"] - }, - { - implementation: function (openmct, $location, $rootScope) { - return new TimeSettingsURLHandler( - openmct.time, - $location, - $rootScope - ); + return { + name: 'src/adapter', + definition: { + "extensions": { + "directives": [ + { + key: "mctView", + implementation: MCTView, + depends: ["openmct"] + } + ], + capabilities: [ + { + key: "adapter", + implementation: AdapterCapability + } + ], + services: [ + { + key: "instantiate", + priority: "mandatory", + implementation: Instantiate, + depends: [ + "capabilityService", + "identifierService", + "cacheService" + ] + } + ], + components: [ + { + type: "decorator", + provides: "capabilityService", + implementation: APICapabilityDecorator, + depends: [ + "$injector" + ] }, - depends: ["openmct", "$location", "$rootScope"] - }, - { - implementation: LegacyTelemetryProvider, - depends: [ - "openmct", - "instantiate" - ] - }, - { - implementation: installLegacyViews, - depends: [ - "openmct", - "views[]", - "instantiate" - ] - }, - { - implementation: RegisterLegacyTypes, - depends: [ - "types[]", - "openmct" - ] - }, - { - implementation: legacyCompositionPolicyAdapter.default, - depends: [ - "openmct" - ] - }, - { - implementation: LegacyActionAdapter.default, - depends: [ - "openmct", - "actions[]" - ] - } - ], - licenses: [ - { - "name": "almond", - "version": "0.3.3", - "description": "Lightweight RequireJS replacement for builds", - "author": "jQuery Foundation", - "website": "https://github.com/requirejs/almond", - "copyright": "Copyright jQuery Foundation and other contributors, https://jquery.org/", - "license": "license-mit", - "link": "https://github.com/requirejs/almond/blob/master/LICENSE" - }, - { - "name": "lodash", - "version": "3.10.1", - "description": "Utility functions", - "author": "Dojo Foundation", - "website": "https://lodash.com", - "copyright": "Copyright 2012-2015 The Dojo Foundation", - "license": "license-mit", - "link": "https://raw.githubusercontent.com/lodash/lodash/3.10.1/LICENSE" - }, - { - "name": "EventEmitter3", - "version": "1.2.0", - "description": "Event-driven programming support", - "author": "Arnout Kazemier", - "website": "https://github.com/primus/eventemitter3", - "copyright": "Copyright (c) 2014 Arnout Kazemier", - "license": "license-mit", - "link": "https://github.com/primus/eventemitter3/blob/1.2.0/LICENSE" - } - ] + { + type: "decorator", + provides: "actionService", + implementation: ActionDialogDecorator, + depends: ["openmct"] + }, + { + type: "decorator", + provides: "modelService", + implementation: MissingModelCompatibilityDecorator, + depends: ["openmct"] + }, + { + provides: "objectService", + type: "decorator", + priority: "mandatory", + implementation: LegacyObjectAPIInterceptor, + depends: [ + "openmct", + "roots[]", + "instantiate", + "topic" + ] + } + ], + policies: [ + { + category: "view", + implementation: AdaptedViewPolicy, + depends: ["openmct"] + } + ], + runs: [ + { + implementation: TypeDeprecationChecker, + depends: ["types[]"] + }, + { + implementation: AlternateCompositionInitializer, + depends: ["openmct"] + }, + { + implementation: function (openmct, $location, $rootScope) { + return new TimeSettingsURLHandler( + openmct.time, + $location, + $rootScope + ); + }, + depends: ["openmct", "$location", "$rootScope"] + }, + { + implementation: LegacyTelemetryProvider, + depends: [ + "openmct", + "instantiate" + ] + }, + { + implementation: installLegacyViews, + depends: [ + "openmct", + "views[]", + "instantiate" + ] + }, + { + implementation: RegisterLegacyTypes, + depends: [ + "types[]", + "openmct" + ] + }, + { + implementation: legacyCompositionPolicyAdapter.default, + depends: [ + "openmct" + ] + }, + { + implementation: LegacyActionAdapter.default, + depends: [ + "openmct", + "actions[]" + ] + } + ], + licenses: [ + { + "name": "almond", + "version": "0.3.3", + "description": "Lightweight RequireJS replacement for builds", + "author": "jQuery Foundation", + "website": "https://github.com/requirejs/almond", + "copyright": "Copyright jQuery Foundation and other contributors, https://jquery.org/", + "license": "license-mit", + "link": "https://github.com/requirejs/almond/blob/master/LICENSE" + }, + { + "name": "lodash", + "version": "3.10.1", + "description": "Utility functions", + "author": "Dojo Foundation", + "website": "https://lodash.com", + "copyright": "Copyright 2012-2015 The Dojo Foundation", + "license": "license-mit", + "link": "https://raw.githubusercontent.com/lodash/lodash/3.10.1/LICENSE" + }, + { + "name": "EventEmitter3", + "version": "1.2.0", + "description": "Event-driven programming support", + "author": "Arnout Kazemier", + "website": "https://github.com/primus/eventemitter3", + "copyright": "Copyright (c) 2014 Arnout Kazemier", + "license": "license-mit", + "link": "https://github.com/primus/eventemitter3/blob/1.2.0/LICENSE" + } + ] + } } - }); + } }); diff --git a/src/defaultRegistry.js b/src/installDefaultBundles.js similarity index 67% rename from src/defaultRegistry.js rename to src/installDefaultBundles.js index 8ee2aa2c6d..35c0024b94 100644 --- a/src/defaultRegistry.js +++ b/src/installDefaultBundles.js @@ -19,10 +19,41 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ +const DEFAULTS = [ + 'src/adapter', + 'platform/framework', + 'platform/core', + 'platform/representation', + 'platform/commonUI/about', + 'platform/commonUI/browse', + 'platform/commonUI/edit', + 'platform/commonUI/dialog', + 'platform/commonUI/formats', + 'platform/commonUI/general', + 'platform/commonUI/inspect', + 'platform/commonUI/mobile', + 'platform/commonUI/notification', + 'platform/containment', + 'platform/execution', + 'platform/exporters', + 'platform/telemetry', + 'platform/features/clock', + 'platform/features/imagery', + 'platform/features/pages', + 'platform/features/hyperlink', + 'platform/features/timeline', + 'platform/forms', + 'platform/identity', + 'platform/persistence/aggregator', + 'platform/persistence/queue', + 'platform/policy', + 'platform/entanglement', + 'platform/search', + 'platform/status', + 'platform/commonUI/regions' +]; define([ - 'legacyRegistry', - '../src/adapter/bundle', '../example/eventGenerator/bundle', @@ -74,45 +105,23 @@ define([ '../platform/search/bundle', '../platform/status/bundle', '../platform/telemetry/bundle' -], function (legacyRegistry) { +], function () { + const LEGACY_BUNDLES = Array.from(arguments); - var DEFAULTS = [ - 'src/adapter', - 'platform/framework', - 'platform/core', - 'platform/representation', - 'platform/commonUI/about', - 'platform/commonUI/browse', - 'platform/commonUI/edit', - 'platform/commonUI/dialog', - 'platform/commonUI/formats', - 'platform/commonUI/general', - 'platform/commonUI/inspect', - 'platform/commonUI/mobile', - 'platform/commonUI/notification', - 'platform/containment', - 'platform/execution', - 'platform/exporters', - 'platform/telemetry', - 'platform/features/clock', - 'platform/features/imagery', - 'platform/features/pages', - 'platform/features/hyperlink', - 'platform/features/timeline', - 'platform/forms', - 'platform/identity', - 'platform/persistence/aggregator', - 'platform/persistence/queue', - 'platform/policy', - 'platform/entanglement', - 'platform/search', - 'platform/status', - 'platform/commonUI/regions' - ]; + return function installDefaultBundles(bundleRegistry) { + registerLegacyBundles(LEGACY_BUNDLES); + enableDefaultBundles(); - DEFAULTS.forEach(function (bundlePath) { - legacyRegistry.enable(bundlePath); - }); + function registerLegacyBundles(bundles) { + bundles.forEach((bundle, i) => { + bundleRegistry.register(bundle.name, bundle.definition); + }); + } - return legacyRegistry; + function enableDefaultBundles() { + DEFAULTS.forEach(function (bundlePath) { + bundleRegistry.enable(bundlePath); + }); + } + } }); diff --git a/src/plugins/telemetryTable/components/table.vue b/src/plugins/telemetryTable/components/table.vue index 897c3631e6..08f55c2cfb 100644 --- a/src/plugins/telemetryTable/components/table.vue +++ b/src/plugins/telemetryTable/components/table.vue @@ -822,6 +822,7 @@ export default { this.filterChanged = _.debounce(this.filterChanged, 500); }, mounted() { + console.log("Table mounted"); this.csvExporter = new CSVExporter(); this.rowsAdded = _.throttle(this.rowsAdded, 200); this.rowsRemoved = _.throttle(this.rowsRemoved, 200); diff --git a/src/plugins/telemetryTable/pluginSpec.js b/src/plugins/telemetryTable/pluginSpec.js new file mode 100644 index 0000000000..c784030200 --- /dev/null +++ b/src/plugins/telemetryTable/pluginSpec.js @@ -0,0 +1,145 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2018, United States Government + * as represented by the Administrator of the National Aeronautics and Space + * Administration. All rights reserved. + * + * Open MCT is licensed under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * Open MCT includes source code licensed under additional open source + * licenses. See the Open Source Licenses file (LICENSES.md) included with + * this source code distribution or the Licensing information page available + * at runtime from the About dialog for additional information. + *****************************************************************************/ +import TablePlugin from './plugin.js'; +import Vue from 'vue'; +import { + createOpenMct, + createMouseEvent +} from 'testTools'; + +let openmct; +let tablePlugin; +let element; +let child; + +describe("the plugin", () => { + beforeEach((done) => { + const appHolder = document.createElement('div'); + appHolder.style.width = '640px'; + appHolder.style.height = '480px'; + + openmct = createOpenMct(); + + element = document.createElement('div'); + child = document.createElement('div'); + element.appendChild(child); + + tablePlugin = new TablePlugin(); + openmct.install(tablePlugin); + + spyOn(openmct.telemetry, 'request').and.returnValue(Promise.resolve([])); + + openmct.on('start', done); + openmct.start(appHolder); + }); + + it("provides a table view for objects with telemetry", () => { + const testTelemetryObject = { + id:"test-object", + type: "test-object", + telemetry: { + values: [{ + key: "some-key" + }] + } + }; + + const applicableViews = openmct.objectViews.get(testTelemetryObject); + let tableView = applicableViews.find((viewProvider) => viewProvider.key === 'table'); + expect(tableView).toBeDefined(); + }); + + describe("The table view", () => { + let testTelemetryObject; + let applicableViews; + let tableViewProvider; + let tableView; + + beforeEach(() => { + testTelemetryObject = { + identifier:{ namespace: "", key: "test-object"}, + type: "test-object", + name: "Test Object", + telemetry: { + values: [{ + key: "some-key", + name: "Some attribute", + hints: { + domain: 1 + } + }, { + key: "some-other-key", + name: "Another attribute", + hints: { + range: 1 + } + }] + } + }; + applicableViews = openmct.objectViews.get(testTelemetryObject); + tableViewProvider = applicableViews.find((viewProvider) => viewProvider.key === 'table'); + tableView = tableViewProvider.view(testTelemetryObject, true, [testTelemetryObject]); + tableView.show(child, true); + return Vue.nextTick(); + }); + + it("Renders a column for every item in telemetry metadata",() => { + let headers = element.querySelectorAll('span.c-telemetry-table__headers__label'); + expect(headers.length).toBe(2); + expect(headers[0].innerText).toBe('Some attribute'); + expect(headers[1].innerText).toBe('Another attribute'); + }); + + it("Supports column reordering via drag and drop",() => { + let columns = element.querySelectorAll('tr.c-telemetry-table__headers__labels th'); + let fromColumn = columns[0]; + let toColumn = columns[1]; + let fromColumnText = fromColumn.querySelector('span.c-telemetry-table__headers__label').innerText; + let toColumnText = toColumn.querySelector('span.c-telemetry-table__headers__label').innerText; + + let dragStartEvent = createMouseEvent('dragstart'); + let dragOverEvent = createMouseEvent('dragover'); + let dropEvent = createMouseEvent('drop'); + + dragStartEvent.dataTransfer = + dragOverEvent.dataTransfer = + dropEvent.dataTransfer = new DataTransfer(); + + fromColumn.dispatchEvent(dragStartEvent); + toColumn.dispatchEvent(dragOverEvent); + toColumn.dispatchEvent(dropEvent); + + return Vue.nextTick().then(() => { + columns = element.querySelectorAll('tr.c-telemetry-table__headers__labels th'); + let firstColumn = columns[0]; + let secondColumn = columns[1]; + let firstColumnText = firstColumn.querySelector('span.c-telemetry-table__headers__label').innerText; + let secondColumnText = secondColumn.querySelector('span.c-telemetry-table__headers__label').innerText; + + expect(fromColumnText).not.toEqual(firstColumnText); + expect(fromColumnText).toEqual(secondColumnText); + expect(toColumnText).not.toEqual(secondColumnText); + expect(toColumnText).toEqual(firstColumnText); + }); + }); + }); +}); diff --git a/src/testTools.js b/src/testTools.js new file mode 100644 index 0000000000..03b2f192dd --- /dev/null +++ b/src/testTools.js @@ -0,0 +1,18 @@ +import MCT from 'MCT'; + +export function createOpenMct() { + const openmct = new MCT(); + openmct.install(openmct.plugins.LocalStorage()); + openmct.install(openmct.plugins.UTCTimeSystem()); + openmct.time.timeSystem('utc', {start: 0, end: 1}); + + return openmct; +} + +export function createMouseEvent(eventName) { + return new MouseEvent(eventName, { + bubbles: true, + cancelable: true, + view: window + }); +} diff --git a/webpack.config.js b/webpack.config.js index e625ffab2e..edc594f21b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -37,7 +37,9 @@ const webpackConfig = { "vue": path.join(__dirname, "node_modules/vue/dist/vue.js"), "d3-scale": path.join(__dirname, "node_modules/d3-scale/build/d3-scale.min.js"), "printj": path.join(__dirname, "node_modules/printj/dist/printj.min.js"), - "styles": path.join(__dirname, "src/styles") + "styles": path.join(__dirname, "src/styles"), + "MCT": path.join(__dirname, "src/MCT"), + "testTools": path.join(__dirname, "src/testTools.js") } }, devtool: devMode ? 'eval-source-map' : 'source-map',