feat: AMD -> ES6 (#7029)

* feat: full amd -> es6 conversion

* fix: move MCT to ES6 class

* fix: default drop, correct imports

* fix: correct all imports

* fix: property typo

* fix: avoid anonymous functions

* fix: correct typo

scarily small - can see why this e2e coverage issue is high priority

* fix: use proper uuid format

* style: fmt

* fix: import vue correctly, get correct layout

* fix: createApp without JSON

fixes template issues

* fix: don't use default on InspectorDataVisualization

* fix: remove more .default calls

* Update src/api/api.js

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>

* Update src/plugins/plugins.js

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>

* Update src/plugins/plugins.js

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>

* fix: suggestions

* fix: drop unnecessary this.annotation initialization

* fix: move all initialization calls to constructor

* refactor: move vue dist import to webpack alias

---------

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>
This commit is contained in:
Tristan F
2023-12-27 15:15:51 -05:00
committed by GitHub
parent 715a44864e
commit 2e03bc394c
102 changed files with 11730 additions and 12016 deletions

View File

@ -76,7 +76,8 @@ const config = {
MCT: path.join(projectRootDir, 'src/MCT'),
testUtils: path.join(projectRootDir, 'src/utils/testUtils.js'),
objectUtils: path.join(projectRootDir, 'src/api/objects/object-utils.js'),
utils: path.join(projectRootDir, 'src/utils')
utils: path.join(projectRootDir, 'src/utils'),
vue: 'vue/dist/vue.esm-bundler'
}
},
plugins: [

View File

@ -1,5 +1,4 @@
define(['lodash'], function (_) {
var METADATA_BY_TYPE = {
const METADATA_BY_TYPE = {
generator: {
values: [
{
@ -124,7 +123,7 @@ define(['lodash'], function (_) {
}
};
function GeneratorMetadataProvider() {}
export default function GeneratorMetadataProvider() {}
GeneratorMetadataProvider.prototype.supportsMetadata = function (domainObject) {
return Object.prototype.hasOwnProperty.call(METADATA_BY_TYPE, domainObject.type);
@ -133,6 +132,3 @@ define(['lodash'], function (_) {
GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) {
return Object.assign({}, domainObject.telemetry, METADATA_BY_TYPE[domainObject.type]);
};
return GeneratorMetadataProvider;
});

View File

@ -20,8 +20,9 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./WorkerInterface'], function (WorkerInterface) {
var REQUEST_DEFAULTS = {
import WorkerInterface from './WorkerInterface';
const REQUEST_DEFAULTS = {
amplitude: 1,
period: 10,
offset: 0,
@ -33,7 +34,7 @@ define(['./WorkerInterface'], function (WorkerInterface) {
exceedFloat32: false
};
function GeneratorProvider(openmct, StalenessProvider) {
export default function GeneratorProvider(openmct, StalenessProvider) {
this.openmct = openmct;
this.workerInterface = new WorkerInterface(openmct, StalenessProvider);
}
@ -100,6 +101,3 @@ define(['./WorkerInterface'], function (WorkerInterface) {
return this.workerInterface.subscribe(workerRequest, callback);
};
return GeneratorProvider;
});

View File

@ -20,7 +20,6 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
var PURPLE = {
sin: 2.2,
cos: 2.2
@ -68,7 +67,7 @@ define([], function () {
}
};
function SinewaveLimitProvider() {}
export default function SinewaveLimitProvider() {}
SinewaveLimitProvider.prototype.supportsLimits = function (domainObject) {
return domainObject.type === 'generator';
@ -161,6 +160,3 @@ define([], function () {
}
};
};
return SinewaveLimitProvider;
});

View File

@ -20,8 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
function StateGeneratorProvider() {}
export default function StateGeneratorProvider() {}
function pointForTimestamp(timestamp, duration, name) {
return {
@ -70,6 +69,3 @@ define([], function () {
return Promise.resolve(data);
};
return StateGeneratorProvider;
});

View File

@ -20,8 +20,9 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['uuid'], function ({ v4: uuid }) {
function WorkerInterface(openmct, StalenessProvider) {
import { v4 as uuid } from 'uuid';
export default function WorkerInterface(openmct, StalenessProvider) {
// eslint-disable-next-line no-undef
const workerUrl = `${openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}generatorWorker.js`;
this.StalenessProvider = StalenessProvider;
@ -102,6 +103,3 @@ define(['uuid'], function ({ v4: uuid }) {
delete this.callbacks[messageId];
}.bind(this);
};
return WorkerInterface;
});

View File

@ -75,7 +75,7 @@ if (document.currentScript) {
* @property {OpenMCTComponent[]} components
*/
const MCT = require('./src/MCT');
const { MCT } = require('./src/MCT');
/** @type {OpenMCT} */
const openmct = new MCT();

View File

@ -20,55 +20,46 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
/* eslint-disable no-undef */
define([
'EventEmitter',
'./api/api',
'./api/overlays/OverlayAPI',
'./api/tooltips/ToolTipAPI',
'./selection/Selection',
'./plugins/plugins',
'./ui/registries/ViewRegistry',
'./plugins/imagery/plugin',
'./ui/registries/InspectorViewRegistry',
'./ui/registries/ToolbarRegistry',
'./ui/router/ApplicationRouter',
'./ui/router/Browse',
'./ui/layout/AppLayout.vue',
'./ui/preview/plugin',
'./api/Branding',
'./plugins/licenses/plugin',
'./plugins/remove/plugin',
'./plugins/move/plugin',
'./plugins/linkAction/plugin',
'./plugins/duplicate/plugin',
'./plugins/importFromJSONAction/plugin',
'./plugins/exportAsJSONAction/plugin',
'vue'
], function (
EventEmitter,
api,
OverlayAPI,
ToolTipAPI,
Selection,
plugins,
ViewRegistry,
ImageryPlugin,
InspectorViewRegistry,
ToolbarRegistry,
ApplicationRouter,
Browse,
Layout,
PreviewPlugin,
BrandingAPI,
LicensesPlugin,
RemoveActionPlugin,
MoveActionPlugin,
LinkActionPlugin,
DuplicateActionPlugin,
ImportFromJSONAction,
ExportAsJSONAction,
Vue
) {
import EventEmitter from 'EventEmitter';
import { createApp, markRaw } from 'vue';
import ActionsAPI from './api/actions/ActionsAPI';
import AnnotationAPI from './api/annotation/AnnotationAPI';
import BrandingAPI from './api/Branding';
import CompositionAPI from './api/composition/CompositionAPI';
import EditorAPI from './api/Editor';
import FaultManagementAPI from './api/faultmanagement/FaultManagementAPI';
import FormsAPI from './api/forms/FormsAPI';
import IndicatorAPI from './api/indicators/IndicatorAPI';
import MenuAPI from './api/menu/MenuAPI';
import NotificationAPI from './api/notifications/NotificationAPI';
import ObjectAPI from './api/objects/ObjectAPI';
import OverlayAPI from './api/overlays/OverlayAPI';
import PriorityAPI from './api/priority/PriorityAPI';
import StatusAPI from './api/status/StatusAPI';
import TelemetryAPI from './api/telemetry/TelemetryAPI';
import TimeAPI from './api/time/TimeAPI';
import ToolTipAPI from './api/tooltips/ToolTipAPI';
import TypeRegistry from './api/types/TypeRegistry';
import UserAPI from './api/user/UserAPI';
import DuplicateActionPlugin from './plugins/duplicate/plugin';
import ExportAsJSONAction from './plugins/exportAsJSONAction/plugin';
import ImageryPlugin from './plugins/imagery/plugin';
import ImportFromJSONAction from './plugins/importFromJSONAction/plugin';
import LicensesPlugin from './plugins/licenses/plugin';
import LinkActionPlugin from './plugins/linkAction/plugin';
import MoveActionPlugin from './plugins/move/plugin';
import plugins from './plugins/plugins';
import RemoveActionPlugin from './plugins/remove/plugin';
import Selection from './selection/Selection';
import Layout from './ui/layout/AppLayout.vue';
import PreviewPlugin from './ui/preview/plugin';
import InspectorViewRegistry from './ui/registries/InspectorViewRegistry';
import ToolbarRegistry from './ui/registries/ToolbarRegistry';
import ViewRegistry from './ui/registries/ViewRegistry';
import ApplicationRouter from './ui/router/ApplicationRouter';
import Browse from './ui/router/Browse';
/**
* Open MCT is an extensible web application for building mission
* control user interfaces. This module is itself an instance of
@ -84,8 +75,11 @@ define([
* @constructor
* @memberof module:openmct
*/
function MCT() {
export class MCT extends EventEmitter {
constructor() {
super();
EventEmitter.call(this);
this.buildInfo = {
version: __OPENMCT_VERSION__,
buildDate: __OPENMCT_BUILD_DATE__,
@ -95,12 +89,14 @@ define([
this.destroy = this.destroy.bind(this);
this.defaultClock = 'local';
[
this.plugins = plugins;
/**
* Tracks current selection state of the application.
* @private
*/
['selection', () => new Selection.default(this)],
this.selection = new Selection(this);
/**
* MCT's time conductor, which may be used to synchronize view contents
@ -109,7 +105,7 @@ define([
* @memberof module:openmct.MCT#
* @name conductor
*/
['time', () => new api.TimeAPI(this)],
this.time = new TimeAPI(this);
/**
* An interface for interacting with the composition of domain objects.
@ -124,7 +120,7 @@ define([
* @memberof module:openmct.MCT#
* @name composition
*/
['composition', () => new api.CompositionAPI.default(this)],
this.composition = new CompositionAPI(this);
/**
* Registry for views of domain objects which should appear in the
@ -134,7 +130,7 @@ define([
* @memberof module:openmct.MCT#
* @name objectViews
*/
['objectViews', () => new ViewRegistry()],
this.objectViews = new ViewRegistry();
/**
* Registry for views which should appear in the Inspector area.
@ -144,7 +140,7 @@ define([
* @memberof module:openmct.MCT#
* @name inspectorViews
*/
['inspectorViews', () => new InspectorViewRegistry.default()],
this.inspectorViews = new InspectorViewRegistry();
/**
* Registry for views which should appear in Edit Properties
@ -155,7 +151,7 @@ define([
* @memberof module:openmct.MCT#
* @name propertyEditors
*/
['propertyEditors', () => new ViewRegistry()],
this.propertyEditors = new ViewRegistry();
/**
* Registry for views which should appear in the toolbar area while
@ -165,7 +161,7 @@ define([
* @memberof module:openmct.MCT#
* @name toolbars
*/
['toolbars', () => new ToolbarRegistry()],
this.toolbars = new ToolbarRegistry();
/**
* Registry for domain object types which may exist within this
@ -175,7 +171,7 @@ define([
* @memberof module:openmct.MCT#
* @name types
*/
['types', () => new api.TypeRegistry()],
this.types = new TypeRegistry();
/**
* An interface for interacting with domain objects and the domain
@ -185,7 +181,7 @@ define([
* @memberof module:openmct.MCT#
* @name objects
*/
['objects', () => new api.ObjectAPI.default(this.types, this)],
this.objects = new ObjectAPI(this.types, this);
/**
* An interface for retrieving and interpreting telemetry data associated
@ -195,7 +191,7 @@ define([
* @memberof module:openmct.MCT#
* @name telemetry
*/
['telemetry', () => new api.TelemetryAPI.default(this)],
this.telemetry = new TelemetryAPI(this);
/**
* An interface for creating new indicators and changing them dynamically.
@ -204,7 +200,7 @@ define([
* @memberof module:openmct.MCT#
* @name indicators
*/
['indicators', () => new api.IndicatorAPI(this)],
this.indicators = new IndicatorAPI(this);
/**
* MCT's user awareness management, to enable user and
@ -213,31 +209,20 @@ define([
* @memberof module:openmct.MCT#
* @name user
*/
['user', () => new api.UserAPI(this)],
this.user = new UserAPI(this);
['notifications', () => new api.NotificationAPI()],
['editor', () => new api.EditorAPI.default(this)],
['overlays', () => new OverlayAPI.default()],
['tooltips', () => new ToolTipAPI.default()],
['menus', () => new api.MenuAPI(this)],
['actions', () => new api.ActionsAPI(this)],
['status', () => new api.StatusAPI(this)],
['priority', () => api.PriorityAPI],
['router', () => new ApplicationRouter(this)],
['faults', () => new api.FaultManagementAPI.default(this)],
['forms', () => new api.FormsAPI.default(this)],
['branding', () => BrandingAPI.default],
this.notifications = new NotificationAPI();
this.editor = new EditorAPI(this);
this.overlays = new OverlayAPI();
this.tooltips = new ToolTipAPI();
this.menus = new MenuAPI(this);
this.actions = new ActionsAPI(this);
this.status = new StatusAPI(this);
this.priority = PriorityAPI;
this.router = new ApplicationRouter(this);
this.faults = new FaultManagementAPI(this);
this.forms = new FormsAPI(this);
this.branding = BrandingAPI;
/**
* MCT's annotation API that enables
@ -246,43 +231,23 @@ define([
* @memberof module:openmct.MCT#
* @name annotation
*/
['annotation', () => new api.AnnotationAPI(this)]
].forEach((apiEntry) => {
const apiName = apiEntry[0];
const apiObject = apiEntry[1]();
Object.defineProperty(this, apiName, {
value: apiObject,
enumerable: false,
configurable: false,
writable: true
});
});
/**
* MCT's annotation API that enables
* human-created comments and categorization linked to data products
* @type {module:openmct.AnnotationAPI}
* @memberof module:openmct.MCT#
* @name annotation
*/
this.annotation = new api.AnnotationAPI(this);
this.annotation = new AnnotationAPI(this);
// Plugins that are installed by default
this.install(this.plugins.Plot());
this.install(this.plugins.TelemetryTable.default());
this.install(PreviewPlugin.default());
this.install(LicensesPlugin.default());
this.install(RemoveActionPlugin.default());
this.install(MoveActionPlugin.default());
this.install(LinkActionPlugin.default());
this.install(DuplicateActionPlugin.default());
this.install(ExportAsJSONAction.default());
this.install(ImportFromJSONAction.default());
this.install(this.plugins.FormActions.default());
this.install(this.plugins.TelemetryTable());
this.install(PreviewPlugin());
this.install(LicensesPlugin());
this.install(RemoveActionPlugin());
this.install(MoveActionPlugin());
this.install(LinkActionPlugin());
this.install(DuplicateActionPlugin());
this.install(ExportAsJSONAction());
this.install(ImportFromJSONAction());
this.install(this.plugins.FormActions());
this.install(this.plugins.FolderView());
this.install(this.plugins.Tabs());
this.install(ImageryPlugin.default());
this.install(ImageryPlugin());
this.install(this.plugins.FlexibleLayout());
this.install(this.plugins.GoToOriginalAction());
this.install(this.plugins.OpenInNewTabAction());
@ -300,26 +265,20 @@ define([
this.install(this.plugins.Gauge());
this.install(this.plugins.InspectorViews());
}
MCT.prototype = Object.create(EventEmitter.prototype);
MCT.prototype.MCT = MCT;
/**
* Set path to where assets are hosted. This should be the path to main.js.
* @memberof module:openmct.MCT#
* @method setAssetPath
*/
MCT.prototype.setAssetPath = function (assetPath) {
setAssetPath(assetPath) {
this._assetPath = assetPath;
};
}
/**
* Get path to where assets are hosted.
* @memberof module:openmct.MCT#
* @method getAssetPath
*/
MCT.prototype.getAssetPath = function () {
getAssetPath() {
const assetPathLength = this._assetPath && this._assetPath.length;
if (!assetPathLength) {
return '/';
@ -330,8 +289,7 @@ define([
}
return this._assetPath;
};
}
/**
* Start running Open MCT. This should be called only after any plugins
* have been installed.
@ -341,10 +299,7 @@ define([
* @param {HTMLElement} [domElement] the DOM element in which to run
* MCT; if undefined, MCT will be run in the body of the document
*/
MCT.prototype.start = function (
domElement = document.body.firstElementChild,
isHeadlessMode = false
) {
start(domElement = document.body.firstElementChild, isHeadlessMode = false) {
// Create element to mount Layout if it doesn't exist
if (domElement === null) {
domElement = document.createElement('div');
@ -376,20 +331,12 @@ define([
* @event start
* @memberof module:openmct.MCT~
*/
if (!isHeadlessMode) {
const appLayout = Vue.createApp({
components: {
Layout: Layout.default
},
provide: {
openmct: Vue.markRaw(this)
},
template: '<Layout ref="layout"></Layout>'
});
const appLayout = createApp(Layout);
appLayout.provide('openmct', markRaw(this));
const component = appLayout.mount(domElement);
component.$nextTick(() => {
this.layout = component.$refs.layout;
this.layout = component;
this.app = appLayout;
Browse(this);
window.addEventListener('beforeunload', this.destroy);
@ -402,14 +349,12 @@ define([
this.router.start();
this.emit('start');
}
};
MCT.prototype.startHeadless = function () {
}
startHeadless() {
let unreachableNode = document.createElement('div');
return this.start(unreachableNode, true);
};
}
/**
* Install a plugin in MCT.
*
@ -417,17 +362,13 @@ define([
* invoked with the mct instance.
* @memberof module:openmct.MCT#
*/
MCT.prototype.install = function (plugin) {
install(plugin) {
plugin(this);
};
}
MCT.prototype.destroy = function () {
destroy() {
window.removeEventListener('beforeunload', this.destroy);
this.emit('destroy');
this.router.destroy();
};
MCT.prototype.plugins = plugins;
return MCT;
});
}
}

View File

@ -20,7 +20,10 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./plugins/plugins', 'utils/testing'], function (plugins, testUtils) {
import * as testUtils from 'utils/testing';
import plugins from './plugins/plugins';
describe('MCT', function () {
let openmct;
let mockPlugin;
@ -112,4 +115,3 @@ define(['./plugins/plugins', 'utils/testing'], function (plugins, testUtils) {
});
});
});
});

View File

@ -20,24 +20,24 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
'./actions/ActionsAPI',
'./composition/CompositionAPI',
'./Editor',
'./faultmanagement/FaultManagementAPI',
'./forms/FormsAPI',
'./indicators/IndicatorAPI',
'./menu/MenuAPI',
'./notifications/NotificationAPI',
'./objects/ObjectAPI',
'./priority/PriorityAPI',
'./status/StatusAPI',
'./telemetry/TelemetryAPI',
'./time/TimeAPI',
'./types/TypeRegistry',
'./user/UserAPI',
'./annotation/AnnotationAPI'
], function (
import ActionsAPI from './actions/ActionsAPI';
import AnnotationAPI from './annotation/AnnotationAPI';
import CompositionAPI from './composition/CompositionAPI';
import EditorAPI from './Editor';
import FaultManagementAPI from './faultmanagement/FaultManagementAPI';
import FormsAPI from './forms/FormsAPI';
import IndicatorAPI from './indicators/IndicatorAPI';
import MenuAPI from './menu/MenuAPI';
import NotificationAPI from './notifications/NotificationAPI';
import ObjectAPI from './objects/ObjectAPI';
import PriorityAPI from './priority/PriorityAPI';
import StatusAPI from './status/StatusAPI';
import TelemetryAPI from './telemetry/TelemetryAPI';
import TimeAPI from './time/TimeAPI';
import TypeRegistry from './types/TypeRegistry';
import UserAPI from './user/UserAPI';
export default {
ActionsAPI,
CompositionAPI,
EditorAPI,
@ -54,23 +54,4 @@ define([
TypeRegistry,
UserAPI,
AnnotationAPI
) {
return {
ActionsAPI: ActionsAPI.default,
CompositionAPI: CompositionAPI,
EditorAPI: EditorAPI,
FaultManagementAPI: FaultManagementAPI,
FormsAPI: FormsAPI,
IndicatorAPI: IndicatorAPI.default,
MenuAPI: MenuAPI.default,
NotificationAPI: NotificationAPI.default,
ObjectAPI: ObjectAPI,
PriorityAPI: PriorityAPI.default,
StatusAPI: StatusAPI.default,
TelemetryAPI: TelemetryAPI,
TimeAPI: TimeAPI.default,
TypeRegistry: TypeRegistry.default,
UserAPI: UserAPI.default,
AnnotationAPI: AnnotationAPI.default
};
});

View File

@ -20,7 +20,6 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* Utility for checking if a thing is an Open MCT Identifier.
* @private
@ -169,7 +168,7 @@ define([], function () {
Object.assign(oldObject, newObject);
}
return {
export default {
isIdentifier: isIdentifier,
toOldFormat: toOldFormat,
toNewFormat: toNewFormat,
@ -179,4 +178,3 @@ define([], function () {
identifierEquals: identifierEquals,
refresh: refresh
};
});

View File

@ -1,4 +1,5 @@
define(['objectUtils'], function (objectUtils) {
import objectUtils from 'objectUtils';
describe('objectUtils', function () {
describe('keyString util', function () {
const EXPECTATIONS = {
@ -144,4 +145,3 @@ define(['objectUtils'], function (objectUtils) {
});
});
});
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['lodash'], function (_) {
import _ from 'lodash';
/**
* This is the default metadata provider; for any object with a "telemetry"
* property, this provider will return the value of that property as the
@ -30,7 +31,8 @@ define(['lodash'], function (_) {
* defined on the type. Telemetry metadata definitions on type will be
* depreciated in the future.
*/
function DefaultMetadataProvider(openmct) {
export default class DefaultMetadataProvider {
constructor(openmct) {
this.openmct = openmct;
}
@ -38,9 +40,37 @@ define(['lodash'], function (_) {
* Applies to any domain object with a telemetry property, or whose type
* definition has a telemetry property.
*/
DefaultMetadataProvider.prototype.supportsMetadata = function (domainObject) {
supportsMetadata(domainObject) {
return Boolean(domainObject.telemetry) || Boolean(this.typeHasTelemetry(domainObject));
};
}
/**
* Returns telemetry metadata for a given domain object.
*/
getMetadata(domainObject) {
const metadata = domainObject.telemetry || {};
if (this.typeHasTelemetry(domainObject)) {
const typeMetadata = this.openmct.types.get(domainObject.type).definition.telemetry;
Object.assign(metadata, typeMetadata);
if (!metadata.values) {
metadata.values = valueMetadatasFromOldFormat(metadata);
}
}
return metadata;
}
/**
* @private
*/
typeHasTelemetry(domainObject) {
const type = this.openmct.types.get(domainObject.type);
return Boolean(type.definition.telemetry);
}
}
/**
* Retrieves valueMetadata from legacy metadata.
@ -92,33 +122,3 @@ define(['lodash'], function (_) {
return valueMetadatas;
}
/**
* Returns telemetry metadata for a given domain object.
*/
DefaultMetadataProvider.prototype.getMetadata = function (domainObject) {
const metadata = domainObject.telemetry || {};
if (this.typeHasTelemetry(domainObject)) {
const typeMetadata = this.openmct.types.get(domainObject.type).definition.telemetry;
Object.assign(metadata, typeMetadata);
if (!metadata.values) {
metadata.values = valueMetadatasFromOldFormat(metadata);
}
}
return metadata;
};
/**
* @private
*/
DefaultMetadataProvider.prototype.typeHasTelemetry = function (domainObject) {
const type = this.openmct.types.get(domainObject.type);
return Boolean(type.definition.telemetry);
};
return DefaultMetadataProvider;
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['lodash'], function (_) {
import _ from 'lodash';
function applyReasonableDefaults(valueMetadata, index) {
valueMetadata.source = valueMetadata.source || valueMetadata.key;
valueMetadata.hints = valueMetadata.hints || {};
@ -67,7 +68,7 @@ define(['lodash'], function (_) {
* reasonable defaults to simplify the task of providing metadata, while
* also providing methods for interrogating telemetry metadata.
*/
function TelemetryMetadataManager(metadata) {
export default function TelemetryMetadataManager(metadata) {
this.metadata = metadata;
this.valueMetadatas = this.metadata.values
@ -157,6 +158,3 @@ define(['lodash'], function (_) {
return valueMetadata;
};
return TelemetryMetadataManager;
});

View File

@ -20,7 +20,6 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
// Set of connection states; changing among these states will be
// reflected in the indicator's appearance.
// CONNECTED: Everything nominal, expect to be able to read/write.
@ -35,7 +34,7 @@ define([], function () {
const DISCONNECTED = {
statusClass: 's-status-warning-hi'
};
function URLIndicator(options, simpleIndicator) {
export default function URLIndicator(options, simpleIndicator) {
this.bindMethods();
this.count = 0;
@ -110,6 +109,3 @@ define([], function () {
this.handleError = this.handleError.bind(this);
this.setIndicatorToState = this.setIndicatorToState.bind(this);
};
return URLIndicator;
});

View File

@ -19,8 +19,9 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./URLIndicator'], function URLIndicatorPlugin(URLIndicator) {
return function (opts) {
import URLIndicator from './URLIndicator';
export default function URLIndicatorPlugin(opts) {
return function install(openmct) {
const simpleIndicator = openmct.indicators.simpleIndicator();
const urlIndicator = new URLIndicator(opts, simpleIndicator);
@ -29,5 +30,4 @@ define(['./URLIndicator'], function URLIndicatorPlugin(URLIndicator) {
return urlIndicator;
};
};
});
}

View File

@ -20,12 +20,10 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['utils/testing', './URLIndicator', './URLIndicatorPlugin', '../../MCT'], function (
testingUtils,
URLIndicator,
URLIndicatorPlugin,
MCT
) {
import * as testingUtils from 'utils/testing';
import URLIndicatorPlugin from './URLIndicatorPlugin';
describe('The URLIndicator', function () {
let openmct;
let indicatorElement;
@ -134,4 +132,3 @@ define(['utils/testing', './URLIndicator', './URLIndicatorPlugin', '../../MCT'],
});
});
});
});

View File

@ -20,15 +20,13 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* Constant values used by the Autoflow Tabular View.
*/
return {
export default {
ROW_HEIGHT: 16,
SLIDER_HEIGHT: 10,
INITIAL_COLUMN_WIDTH: 225,
MAX_COLUMN_WIDTH: 525,
COLUMN_WIDTH_STEP: 25
};
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./AutoflowTabularRowController'], function (AutoflowTabularRowController) {
import AutoflowTabularRowController from './AutoflowTabularRowController';
/**
* Controller for an Autoflow Tabular View. Subscribes to telemetry
* associated with children of the domain object and passes that
@ -30,7 +31,7 @@ define(['./AutoflowTabularRowController'], function (AutoflowTabularRowControlle
* @param {*} data the view data
* @param openmct a reference to the openmct application
*/
function AutoflowTabularController(domainObject, data, openmct) {
export default function AutoflowTabularController(domainObject, data, openmct) {
this.composition = openmct.composition.get(domainObject);
this.data = data;
this.openmct = openmct;
@ -118,6 +119,3 @@ define(['./AutoflowTabularRowController'], function (AutoflowTabularRowControlle
this.composition.off('add', this.addRow);
this.composition.off('remove', this.removeRow);
};
return AutoflowTabularController;
});

View File

@ -20,8 +20,9 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./AutoflowTabularView'], function (AutoflowTabularView) {
return function (options) {
import AutoflowTabularView from './AutoflowTabularView';
export default function (options) {
return function (openmct) {
const views = openmct.mainViews || openmct.objectViews;
@ -38,5 +39,4 @@ define(['./AutoflowTabularView'], function (AutoflowTabularView) {
}
});
};
};
});
}

View File

@ -20,7 +20,6 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* Controller for individual rows of an Autoflow Tabular View.
* Subscribes to telemetry and updates row data.
@ -30,7 +29,7 @@ define([], function () {
* @param openmct a reference to the openmct application
* @param {Function} callback a callback to invoke with "last updated" timestamps
*/
function AutoflowTabularRowController(domainObject, data, openmct, callback) {
export default function AutoflowTabularRowController(domainObject, data, openmct, callback) {
this.domainObject = domainObject;
this.data = data;
this.openmct = openmct;
@ -90,6 +89,3 @@ define([], function () {
this.unsubscribe();
}
};
return AutoflowTabularRowController;
});

View File

@ -20,12 +20,11 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
'./AutoflowTabularController',
'./AutoflowTabularConstants',
'./VueView',
'./autoflow-tabular.html'
], function (AutoflowTabularController, AutoflowTabularConstants, VueView, autoflowTemplate) {
import autoflowTemplate from './autoflow-tabular.html';
import AutoflowTabularConstants from './AutoflowTabularConstants';
import AutoflowTabularController from './AutoflowTabularController';
import VueView from './VueView';
const ROW_HEIGHT = AutoflowTabularConstants.ROW_HEIGHT;
const SLIDER_HEIGHT = AutoflowTabularConstants.SLIDER_HEIGHT;
const INITIAL_COLUMN_WIDTH = AutoflowTabularConstants.INITIAL_COLUMN_WIDTH;
@ -35,7 +34,7 @@ define([
/**
* Implements the Autoflow Tabular view of a domain object.
*/
function AutoflowTabularView(domainObject, openmct) {
export default function AutoflowTabularView(domainObject, openmct) {
const data = {
items: [],
columns: [],
@ -109,7 +108,4 @@ define([
});
}
AutoflowTabularView.prototype = Object.create(VueView.default.prototype);
return AutoflowTabularView;
});
AutoflowTabularView.prototype = Object.create(VueView.prototype);

View File

@ -22,13 +22,15 @@
import mount from 'utils/mount';
export default function () {
return function VueView(options) {
class VueView {
constructor(options) {
const { vNode, destroy } = mount(options);
this.show = function (container) {
container.appendChild(vNode.el);
};
this.destroy = destroy;
};
}
}
return VueView;
}

View File

@ -20,8 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
function DOMObserver(element) {
export default function DOMObserver(element) {
this.element = element;
this.observers = [];
}
@ -58,6 +57,3 @@ define([], function () {
}.bind(this)
);
};
return DOMObserver;
});

View File

@ -20,8 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(function () {
function DisplayLayoutType() {
export default function DisplayLayoutType() {
return {
name: 'Display Layout',
creatable: true,
@ -67,6 +66,3 @@ define(function () {
]
};
}
return DisplayLayoutType;
});

View File

@ -20,7 +20,6 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* Handles drag interactions on frames in layouts. This will
* provides new positions/dimensions for frames based on
@ -48,7 +47,7 @@ define([], function () {
* @constructor
* @memberof platform/features/layout
*/
function LayoutDrag(rawPosition, posFactor, dimFactor, gridSize) {
export default function LayoutDrag(rawPosition, posFactor, dimFactor, gridSize) {
this.rawPosition = rawPosition;
this.posFactor = posFactor;
this.dimFactor = dimFactor;
@ -107,6 +106,3 @@ define([], function () {
position: max(add(this.rawPosition.position, multiply(gridDelta, this.posFactor)), [0, 0])
};
};
return LayoutDrag;
});

View File

@ -20,12 +20,12 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./FiltersInspectorViewProvider'], function (FiltersInspectorViewProvider) {
return function plugin(supportedObjectTypesArray) {
import FiltersInspectorViewProvider from './FiltersInspectorViewProvider';
export default function plugin(supportedObjectTypesArray) {
return function install(openmct) {
openmct.inspectorViews.addProvider(
new FiltersInspectorViewProvider.default(openmct, supportedObjectTypesArray)
new FiltersInspectorViewProvider(openmct, supportedObjectTypesArray)
);
};
};
});
}

View File

@ -20,14 +20,13 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./flexibleLayoutViewProvider', './utils/container', './toolbarProvider'], function (
FlexibleLayoutViewProvider,
Container,
ToolBarProvider
) {
return function plugin() {
import FlexibleLayoutViewProvider from './flexibleLayoutViewProvider';
import ToolBarProvider from './toolbarProvider';
import Container from './utils/container';
export default function plugin() {
return function install(openmct) {
openmct.objectViews.addProvider(new FlexibleLayoutViewProvider.default(openmct));
openmct.objectViews.addProvider(new FlexibleLayoutViewProvider(openmct));
openmct.types.addType('flexible-layout', {
name: 'Flexible Layout',
@ -37,16 +36,15 @@ define(['./flexibleLayoutViewProvider', './utils/container', './toolbarProvider'
cssClass: 'icon-flexible-layout',
initialize: function (domainObject) {
domainObject.configuration = {
containers: [new Container.default(50), new Container.default(50)],
containers: [new Container(50), new Container(50)],
rowsLayout: false
};
domainObject.composition = [];
}
});
let toolbar = ToolBarProvider.default(openmct);
let toolbar = ToolBarProvider(openmct);
openmct.toolbars.addProvider(toolbar);
};
};
});
}

View File

@ -20,7 +20,6 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
const helperFunctions = {
listenTo: function (object, event, callback, context) {
if (!this._listeningTo) {
@ -95,5 +94,4 @@ define([], function () {
}
};
return helperFunctions;
});
export default helperFunctions;

View File

@ -20,24 +20,24 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['../../../src/plugins/utcTimeSystem/LocalClock'], function (LocalClock) {
import LocalClock from '../../../src/plugins/utcTimeSystem/LocalClock';
class LADClock extends LocalClock {
/**
* A {@link Clock} that mocks a "latest available data" type tick source.
* This is for testing purposes only, and behaves identically to a local clock.
* It DOES NOT tick on receipt of data.
* @constructor
*/
function LADClock(period) {
LocalClock.call(this, period);
constructor(period) {
super(period);
this.key = 'test-lad';
this.mode = 'lad';
this.cssClass = 'icon-suitcase';
this.name = 'Latest available data';
this.description = 'Updates when when new data is available';
this.description = 'Updates when new data is available';
}
}
LADClock.prototype = Object.create(LocalClock.prototype);
return LADClock;
});
export default LADClock;

View File

@ -20,10 +20,10 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./LADClock'], function (LADClock) {
return function () {
import LADClock from './LADClock';
export default function () {
return function (openmct) {
openmct.time.addClock(new LADClock());
};
};
});
}

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['moment'], function (moment) {
import moment from 'moment';
const DATE_FORMAT = 'YYYY-MM-DD h:mm:ss.SSS a';
const DATE_FORMATS = [DATE_FORMAT, 'YYYY-MM-DD h:mm:ss a', 'YYYY-MM-DD h:mm a', 'YYYY-MM-DD'];
@ -39,7 +40,7 @@ define(['moment'], function (moment) {
* @constructor
* @memberof platform/commonUI/formats
*/
function LocalTimeFormat() {
export default function LocalTimeFormat() {
this.key = 'local-format';
}
@ -63,6 +64,3 @@ define(['moment'], function (moment) {
LocalTimeFormat.prototype.validate = function (text) {
return moment(text, DATE_FORMATS).isValid();
};
return LocalTimeFormat;
});

View File

@ -20,13 +20,13 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* This time system supports UTC dates and provides a ticking clock source.
* @implements TimeSystem
* @constructor
*/
function LocalTimeSystem() {
export default class LocalTimeSystem {
constructor() {
/**
* Some metadata, which will be used to identify the time system in
* the UI
@ -41,6 +41,4 @@ define([], function () {
this.isUTCBased = true;
}
return LocalTimeSystem;
});
}

View File

@ -20,11 +20,12 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./LocalTimeSystem', './LocalTimeFormat'], function (LocalTimeSystem, LocalTimeFormat) {
return function () {
import LocalTimeFormat from './LocalTimeFormat';
import LocalTimeSystem from './LocalTimeSystem';
export default function () {
return function (openmct) {
openmct.time.addTimeSystem(new LocalTimeSystem());
openmct.telemetry.addFormat(new LocalTimeFormat());
};
};
});
}

View File

@ -20,8 +20,9 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['uuid'], function ({ v4: uuid }) {
return function Migrations(openmct) {
import { v4 as uuid } from 'uuid';
export default function Migrations(openmct) {
function getColumnNameKeyMap(domainObject) {
let composition = openmct.composition.get(domainObject);
if (composition) {
@ -275,5 +276,4 @@ define(['uuid'], function ({ v4: uuid }) {
}
}
];
};
});
}

View File

@ -20,158 +20,89 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
'lodash',
'./utcTimeSystem/plugin',
'./remoteClock/plugin',
'./localTimeSystem/plugin',
'./ISOTimeFormat/plugin',
'./myItems/plugin',
'../../example/generator/plugin',
'../../example/eventGenerator/plugin',
'../../example/dataVisualization/plugin',
'./autoflow/AutoflowTabularPlugin',
'./timeConductor/plugin',
'../../example/imagery/plugin',
'../../example/faultManagement/exampleFaultSource',
'./imagery/plugin',
'./summaryWidget/plugin',
'./URLIndicatorPlugin/URLIndicatorPlugin',
'./telemetryMean/plugin',
'./plot/plugin',
'./charts/bar/plugin',
'./charts/scatter/plugin',
'./telemetryTable/plugin',
'./staticRootPlugin/plugin',
'./notebook/plugin',
'./displayLayout/plugin',
'./formActions/plugin',
'./folderView/plugin',
'./flexibleLayout/plugin',
'./tabs/plugin',
'./LADTable/plugin',
'./filters/plugin',
'./objectMigration/plugin',
'./goToOriginalAction/plugin',
'./openInNewTabAction/plugin',
'./clearData/plugin',
'./webPage/plugin',
'./condition/plugin',
'./conditionWidget/plugin',
'./themes/espresso',
'./themes/snow',
'./URLTimeSettingsSynchronizer/plugin',
'./notificationIndicator/plugin',
'./newFolderAction/plugin',
'./persistence/couch/plugin',
'./defaultRootName/plugin',
'./plan/plugin',
'./viewDatumAction/plugin',
'./viewLargeAction/plugin',
'./interceptors/plugin',
'./performanceIndicator/plugin',
'./CouchDBSearchFolder/plugin',
'./timeline/plugin',
'./hyperlink/plugin',
'./clock/plugin',
'./DeviceClassifier/plugin',
'./timer/plugin',
'./userIndicator/plugin',
'../../example/exampleUser/plugin',
'./localStorage/plugin',
'./operatorStatus/plugin',
'./gauge/GaugePlugin',
'./timelist/plugin',
'./faultManagement/FaultManagementPlugin',
'../../example/exampleTags/plugin',
'./inspectorViews/plugin',
'./inspectorDataVisualization/plugin'
], function (
_,
UTCTimeSystem,
RemoteClock,
LocalTimeSystem,
ISOTimeFormat,
MyItems,
GeneratorPlugin,
EventGeneratorPlugin,
ExampleDataVisualizationSourcePlugin,
AutoflowPlugin,
TimeConductorPlugin,
ExampleImagery,
ExampleFaultSource,
ImageryPlugin,
SummaryWidget,
URLIndicatorPlugin,
TelemetryMean,
PlotPlugin,
BarChartPlugin,
ScatterPlotPlugin,
TelemetryTablePlugin,
StaticRootPlugin,
Notebook,
DisplayLayoutPlugin,
FormActions,
FolderView,
FlexibleLayout,
Tabs,
LADTable,
Filters,
ObjectMigration,
GoToOriginalAction,
OpenInNewTabAction,
ClearData,
WebPagePlugin,
ConditionPlugin,
ConditionWidgetPlugin,
Espresso,
Snow,
URLTimeSettingsSynchronizer,
NotificationIndicator,
NewFolderAction,
CouchDBPlugin,
DefaultRootName,
PlanLayout,
ViewDatumAction,
ViewLargeAction,
ObjectInterceptors,
PerformanceIndicator,
CouchDBSearchFolder,
Timeline,
Hyperlink,
Clock,
DeviceClassifier,
Timer,
UserIndicator,
ExampleUser,
LocalStorage,
OperatorStatus,
GaugePlugin,
TimeList,
FaultManagementPlugin,
ExampleTags,
InspectorViews,
InspectorDataVisualization
) {
import ExampleDataVisualizationSourcePlugin from '../../example/dataVisualization/plugin';
import EventGeneratorPlugin from '../../example/eventGenerator/plugin';
import ExampleTags from '../../example/exampleTags/plugin';
import ExampleUser from '../../example/exampleUser/plugin';
import ExampleFaultSource from '../../example/faultManagement/exampleFaultSource';
import GeneratorPlugin from '../../example/generator/plugin';
import ExampleImagery from '../../example/imagery/plugin';
import AutoflowPlugin from './autoflow/AutoflowTabularPlugin';
import BarChartPlugin from './charts/bar/plugin';
import ScatterPlotPlugin from './charts/scatter/plugin';
import ClearData from './clearData/plugin';
import Clock from './clock/plugin';
import ConditionPlugin from './condition/plugin';
import ConditionWidgetPlugin from './conditionWidget/plugin';
import CouchDBSearchFolder from './CouchDBSearchFolder/plugin';
import DefaultRootName from './defaultRootName/plugin';
import DeviceClassifier from './DeviceClassifier/plugin';
import DisplayLayoutPlugin from './displayLayout/plugin';
import FaultManagementPlugin from './faultManagement/FaultManagementPlugin';
import Filters from './filters/plugin';
import FlexibleLayout from './flexibleLayout/plugin';
import FolderView from './folderView/plugin';
import FormActions from './formActions/plugin';
import GaugePlugin from './gauge/GaugePlugin';
import GoToOriginalAction from './goToOriginalAction/plugin';
import Hyperlink from './hyperlink/plugin';
import ImageryPlugin from './imagery/plugin';
import InspectorDataVisualization from './inspectorDataVisualization/plugin';
import InspectorViews from './inspectorViews/plugin';
import ObjectInterceptors from './interceptors/plugin';
import ISOTimeFormat from './ISOTimeFormat/plugin';
import LADTable from './LADTable/plugin';
import LocalStorage from './localStorage/plugin';
import LocalTimeSystem from './localTimeSystem/plugin';
import MyItems from './myItems/plugin';
import NewFolderAction from './newFolderAction/plugin';
import { NotebookPlugin, RestrictedNotebookPlugin } from './notebook/plugin';
import NotificationIndicator from './notificationIndicator/plugin';
import ObjectMigration from './objectMigration/plugin';
import OpenInNewTabAction from './openInNewTabAction/plugin';
import OperatorStatus from './operatorStatus/plugin';
import PerformanceIndicator from './performanceIndicator/plugin';
import CouchDBPlugin from './persistence/couch/plugin';
import PlanLayout from './plan/plugin';
import PlotPlugin from './plot/plugin';
import RemoteClock from './remoteClock/plugin';
import StaticRootPlugin from './staticRootPlugin/plugin';
import SummaryWidget from './summaryWidget/plugin';
import Tabs from './tabs/plugin';
import TelemetryMean from './telemetryMean/plugin';
import TelemetryTablePlugin from './telemetryTable/plugin';
import Espresso from './themes/espresso';
import Snow from './themes/snow';
import TimeConductorPlugin from './timeConductor/plugin';
import Timeline from './timeline/plugin';
import TimeList from './timelist/plugin';
import Timer from './timer/plugin';
import URLIndicatorPlugin from './URLIndicatorPlugin/URLIndicatorPlugin';
import URLTimeSettingsSynchronizer from './URLTimeSettingsSynchronizer/plugin';
import UserIndicator from './userIndicator/plugin';
import UTCTimeSystem from './utcTimeSystem/plugin';
import ViewDatumAction from './viewDatumAction/plugin';
import ViewLargeAction from './viewLargeAction/plugin';
import WebPagePlugin from './webPage/plugin';
const plugins = {};
plugins.example = {};
plugins.example.ExampleUser = ExampleUser.default;
plugins.example.ExampleImagery = ExampleImagery.default;
plugins.example.ExampleFaultSource = ExampleFaultSource.default;
plugins.example.EventGeneratorPlugin = EventGeneratorPlugin.default;
plugins.example.ExampleDataVisualizationSourcePlugin =
ExampleDataVisualizationSourcePlugin.default;
plugins.example.ExampleTags = ExampleTags.default;
plugins.example.Generator = () => GeneratorPlugin.default;
plugins.example.ExampleUser = ExampleUser;
plugins.example.ExampleImagery = ExampleImagery;
plugins.example.ExampleFaultSource = ExampleFaultSource;
plugins.example.EventGeneratorPlugin = EventGeneratorPlugin;
plugins.example.ExampleDataVisualizationSourcePlugin = ExampleDataVisualizationSourcePlugin;
plugins.example.ExampleTags = ExampleTags;
plugins.example.Generator = () => GeneratorPlugin;
plugins.UTCTimeSystem = UTCTimeSystem.default;
plugins.UTCTimeSystem = UTCTimeSystem;
plugins.LocalTimeSystem = LocalTimeSystem;
plugins.RemoteClock = RemoteClock.default;
plugins.RemoteClock = RemoteClock;
plugins.MyItems = MyItems.default;
plugins.MyItems = MyItems;
plugins.StaticRootPlugin = StaticRootPlugin.default;
plugins.StaticRootPlugin = StaticRootPlugin;
/**
* A tabular view showing the latest values of multiple telemetry points at
@ -184,61 +115,60 @@ define([
*/
plugins.AutoflowView = AutoflowPlugin;
plugins.Conductor = TimeConductorPlugin.default;
plugins.Conductor = TimeConductorPlugin;
plugins.CouchDB = CouchDBPlugin.default;
plugins.CouchDB = CouchDBPlugin;
plugins.ImageryPlugin = ImageryPlugin;
plugins.Plot = PlotPlugin.default;
plugins.BarChart = BarChartPlugin.default;
plugins.ScatterPlot = ScatterPlotPlugin.default;
plugins.Plot = PlotPlugin;
plugins.BarChart = BarChartPlugin;
plugins.ScatterPlot = ScatterPlotPlugin;
plugins.TelemetryTable = TelemetryTablePlugin;
plugins.SummaryWidget = SummaryWidget;
plugins.TelemetryMean = TelemetryMean;
plugins.URLIndicator = URLIndicatorPlugin;
plugins.Notebook = Notebook.NotebookPlugin;
plugins.RestrictedNotebook = Notebook.RestrictedNotebookPlugin;
plugins.DisplayLayout = DisplayLayoutPlugin.default;
plugins.FaultManagement = FaultManagementPlugin.default;
plugins.Notebook = NotebookPlugin;
plugins.RestrictedNotebook = RestrictedNotebookPlugin;
plugins.DisplayLayout = DisplayLayoutPlugin;
plugins.FaultManagement = FaultManagementPlugin;
plugins.FormActions = FormActions;
plugins.FolderView = FolderView.default;
plugins.FolderView = FolderView;
plugins.Tabs = Tabs;
plugins.FlexibleLayout = FlexibleLayout;
plugins.LADTable = LADTable.default;
plugins.LADTable = LADTable;
plugins.Filters = Filters;
plugins.ObjectMigration = ObjectMigration.default;
plugins.GoToOriginalAction = GoToOriginalAction.default;
plugins.OpenInNewTabAction = OpenInNewTabAction.default;
plugins.ClearData = ClearData.default;
plugins.WebPage = WebPagePlugin.default;
plugins.Espresso = Espresso.default;
plugins.Snow = Snow.default;
plugins.Condition = ConditionPlugin.default;
plugins.ConditionWidget = ConditionWidgetPlugin.default;
plugins.URLTimeSettingsSynchronizer = URLTimeSettingsSynchronizer.default;
plugins.NotificationIndicator = NotificationIndicator.default;
plugins.NewFolderAction = NewFolderAction.default;
plugins.ISOTimeFormat = ISOTimeFormat.default;
plugins.DefaultRootName = DefaultRootName.default;
plugins.PlanLayout = PlanLayout.default;
plugins.ViewDatumAction = ViewDatumAction.default;
plugins.ViewLargeAction = ViewLargeAction.default;
plugins.ObjectInterceptors = ObjectInterceptors.default;
plugins.PerformanceIndicator = PerformanceIndicator.default;
plugins.CouchDBSearchFolder = CouchDBSearchFolder.default;
plugins.Timeline = Timeline.default;
plugins.Hyperlink = Hyperlink.default;
plugins.Clock = Clock.default;
plugins.Timer = Timer.default;
plugins.DeviceClassifier = DeviceClassifier.default;
plugins.UserIndicator = UserIndicator.default;
plugins.LocalStorage = LocalStorage.default;
plugins.OperatorStatus = OperatorStatus.default;
plugins.Gauge = GaugePlugin.default;
plugins.Timelist = TimeList.default;
plugins.InspectorViews = InspectorViews.default;
plugins.InspectorDataVisualization = InspectorDataVisualization.default;
plugins.ObjectMigration = ObjectMigration;
plugins.GoToOriginalAction = GoToOriginalAction;
plugins.OpenInNewTabAction = OpenInNewTabAction;
plugins.ClearData = ClearData;
plugins.WebPage = WebPagePlugin;
plugins.Espresso = Espresso;
plugins.Snow = Snow;
plugins.Condition = ConditionPlugin;
plugins.ConditionWidget = ConditionWidgetPlugin;
plugins.URLTimeSettingsSynchronizer = URLTimeSettingsSynchronizer;
plugins.NotificationIndicator = NotificationIndicator;
plugins.NewFolderAction = NewFolderAction;
plugins.ISOTimeFormat = ISOTimeFormat;
plugins.DefaultRootName = DefaultRootName;
plugins.PlanLayout = PlanLayout;
plugins.ViewDatumAction = ViewDatumAction;
plugins.ViewLargeAction = ViewLargeAction;
plugins.ObjectInterceptors = ObjectInterceptors;
plugins.PerformanceIndicator = PerformanceIndicator;
plugins.CouchDBSearchFolder = CouchDBSearchFolder;
plugins.Timeline = Timeline;
plugins.Hyperlink = Hyperlink;
plugins.Clock = Clock;
plugins.Timer = Timer;
plugins.DeviceClassifier = DeviceClassifier;
plugins.UserIndicator = UserIndicator;
plugins.LocalStorage = LocalStorage;
plugins.OperatorStatus = OperatorStatus;
plugins.Gauge = GaugePlugin;
plugins.Timelist = TimeList;
plugins.InspectorViews = InspectorViews;
plugins.InspectorDataVisualization = InspectorDataVisualization;
return plugins;
});
export default plugins;

View File

@ -20,12 +20,11 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* Policy determining which views can apply to summary widget. Disables
* any view other than normal summary widget view.
*/
function SummaryWidgetViewPolicy() {}
export default function SummaryWidgetViewPolicy() {}
SummaryWidgetViewPolicy.prototype.allow = function (view, domainObject) {
if (domainObject.getModel().type === 'summary-widget') {
@ -34,6 +33,3 @@ define([], function () {
return true;
};
return SummaryWidgetViewPolicy;
});

View File

@ -20,8 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
function SummaryWidgetsCompositionPolicy(openmct) {
export default function SummaryWidgetsCompositionPolicy(openmct) {
this.openmct = openmct;
}
@ -34,6 +33,3 @@ define([], function () {
return true;
};
return SummaryWidgetsCompositionPolicy;
});

View File

@ -1,17 +1,9 @@
define([
'./SummaryWidgetsCompositionPolicy',
'./src/telemetry/SummaryWidgetMetadataProvider',
'./src/telemetry/SummaryWidgetTelemetryProvider',
'./src/views/SummaryWidgetViewProvider',
'./SummaryWidgetViewPolicy'
], function (
SummaryWidgetsCompositionPolicy,
SummaryWidgetMetadataProvider,
SummaryWidgetTelemetryProvider,
SummaryWidgetViewProvider,
SummaryWidgetViewPolicy
) {
function plugin() {
import SummaryWidgetMetadataProvider from './src/telemetry/SummaryWidgetMetadataProvider';
import SummaryWidgetTelemetryProvider from './src/telemetry/SummaryWidgetTelemetryProvider';
import SummaryWidgetViewProvider from './src/views/SummaryWidgetViewProvider';
import SummaryWidgetsCompositionPolicy from './SummaryWidgetsCompositionPolicy';
export default function plugin() {
const widgetType = {
name: 'Summary Widget',
description: 'A compact status update for collections of telemetry-producing items',
@ -93,6 +85,3 @@ define([
openmct.objectViews.addProvider(new SummaryWidgetViewProvider(openmct));
};
}
return plugin;
});

View File

@ -19,23 +19,16 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
'../res/conditionTemplate.html',
'./input/ObjectSelect',
'./input/KeySelect',
'./input/OperationSelect',
'./eventHelpers',
'../../../utils/template/templateHelpers',
'EventEmitter'
], function (
conditionTemplate,
ObjectSelect,
KeySelect,
OperationSelect,
eventHelpers,
templateHelpers,
EventEmitter
) {
import EventEmitter from 'EventEmitter';
import * as templateHelpers from '../../../utils/template/templateHelpers';
import conditionTemplate from '../res/conditionTemplate.html';
import eventHelpers from './eventHelpers';
import KeySelect from './input/KeySelect';
import ObjectSelect from './input/ObjectSelect';
import OperationSelect from './input/OperationSelect';
/**
* Represents an individual condition for a summary widget rule. Manages the
* associated inputs and view.
@ -46,7 +39,7 @@ define([
* @param {ConditionManager} conditionManager A ConditionManager instance for populating
* selects with configuration data
*/
function Condition(conditionConfig, index, conditionManager) {
export default function Condition(conditionConfig, index, conditionManager) {
eventHelpers.extend(this);
this.config = conditionConfig;
this.index = index;
@ -255,6 +248,3 @@ define([
return fragment;
};
return Condition;
});

View File

@ -1,4 +1,3 @@
define([], function () {
/**
* Responsible for maintaining the possible operations for conditions
* in this widget, and evaluating the boolean value of conditions passed as
@ -10,7 +9,7 @@ define([], function () {
* @param {Object} compositionObjs The current set of composition objects to
* evaluate for 'any' and 'all' conditions
*/
function ConditionEvaluator(subscriptionCache, compositionObjs) {
export default function ConditionEvaluator(subscriptionCache, compositionObjs) {
this.subscriptionCache = subscriptionCache;
this.compositionObjs = compositionObjs;
@ -481,6 +480,3 @@ define([], function () {
ConditionEvaluator.prototype.useTestData = function (useTestCache) {
this.useTestCache = useTestCache;
};
return ConditionEvaluator;
});

View File

@ -1,9 +1,9 @@
define(['./ConditionEvaluator', 'objectUtils', 'EventEmitter', 'lodash'], function (
ConditionEvaluator,
objectUtils,
EventEmitter,
_
) {
import EventEmitter from 'EventEmitter';
import _ from 'lodash';
import objectUtils from 'objectUtils';
import ConditionEvaluator from './ConditionEvaluator';
/**
* Provides a centralized content manager for conditions in the summary widget.
* Loads and caches composition and telemetry subscriptions, and maintains a
@ -12,7 +12,7 @@ define(['./ConditionEvaluator', 'objectUtils', 'EventEmitter', 'lodash'], functi
* @param {Object} domainObject the Summary Widget domain object
* @param {MCT} openmct an MCT instance
*/
function ConditionManager(domainObject, openmct) {
export default function ConditionManager(domainObject, openmct) {
this.domainObject = domainObject;
this.openmct = openmct;
@ -381,6 +381,3 @@ define(['./ConditionEvaluator', 'objectUtils', 'EventEmitter', 'lodash'], functi
this.composition.off('remove', this.onCompositionRemove, this);
this.composition.off('load', this.onCompositionLoad, this);
};
return ConditionManager;
});

View File

@ -1,22 +1,13 @@
define([
'../res/ruleTemplate.html',
'./Condition',
'./input/ColorPalette',
'./input/IconPalette',
'./eventHelpers',
'../../../utils/template/templateHelpers',
'EventEmitter',
'lodash'
], function (
ruleTemplate,
Condition,
ColorPalette,
IconPalette,
eventHelpers,
templateHelpers,
EventEmitter,
_
) {
import EventEmitter from 'EventEmitter';
import _ from 'lodash';
import * as templateHelpers from '../../../utils/template/templateHelpers';
import ruleTemplate from '../res/ruleTemplate.html';
import Condition from './Condition';
import eventHelpers from './eventHelpers';
import ColorPalette from './input/ColorPalette';
import IconPalette from './input/IconPalette';
/**
* An object representing a summary widget rule. Maintains a set of text
* and css properties for output, and a set of conditions for configuring
@ -29,7 +20,14 @@ define([
* @param {WidgetDnD} widgetDnD A WidgetDnD instance to handle dragging and dropping rules
* @param {element} container The DOM element which contains this summary widget
*/
function Rule(ruleConfig, domainObject, openmct, conditionManager, widgetDnD, container) {
export default function Rule(
ruleConfig,
domainObject,
openmct,
conditionManager,
widgetDnD,
container
) {
eventHelpers.extend(this);
const self = this;
const THUMB_ICON_CLASS = 'c-sw__icon js-sw__icon';
@ -164,9 +162,7 @@ define([
function onDragStart(event) {
document.querySelectorAll('.t-drag-indicator').forEach((indicator) => {
// eslint-disable-next-line no-invalid-this
const ruleHeader = self.domElement
.querySelectorAll('.widget-rule-header')[0]
.cloneNode(true);
const ruleHeader = self.domElement.querySelectorAll('.widget-rule-header')[0].cloneNode(true);
indicator.textContent = '';
indicator.appendChild(ruleHeader);
});
@ -532,6 +528,3 @@ define([
this.description.innerText = self.config.description;
this.config.description = description;
};
return Rule;
});

View File

@ -1,26 +1,13 @@
define([
'../res/widgetTemplate.html',
'./Rule',
'./ConditionManager',
'./TestDataManager',
'./WidgetDnD',
'./eventHelpers',
'../../../utils/template/templateHelpers',
'objectUtils',
'lodash',
'@braintree/sanitize-url'
], function (
widgetTemplate,
Rule,
ConditionManager,
TestDataManager,
WidgetDnD,
eventHelpers,
templateHelpers,
objectUtils,
_,
urlSanitizeLib
) {
import * as urlSanitizeLib from '@braintree/sanitize-url';
import * as templateHelpers from '../../../utils/template/templateHelpers';
import widgetTemplate from '../res/widgetTemplate.html';
import ConditionManager from './ConditionManager';
import eventHelpers from './eventHelpers';
import Rule from './Rule';
import TestDataManager from './TestDataManager';
import WidgetDnD from './WidgetDnD';
//default css configuration for new rules
const DEFAULT_PROPS = {
color: '#cccccc',
@ -36,7 +23,7 @@ define([
* @param {Object} domainObject The domain Object represented by this Widget
* @param {MCT} openmct An MCT instance
*/
function SummaryWidget(domainObject, openmct) {
export default function SummaryWidget(domainObject, openmct) {
eventHelpers.extend(this);
this.domainObject = domainObject;
@ -402,12 +389,5 @@ define([
* Mutate this domain object's configuration with the current local configuration
*/
SummaryWidget.prototype.updateDomainObject = function () {
this.openmct.objects.mutate(
this.domainObject,
'configuration',
this.domainObject.configuration
);
this.openmct.objects.mutate(this.domainObject, 'configuration', this.domainObject.configuration);
};
return SummaryWidget;
});

View File

@ -1,11 +1,11 @@
define([
'../res/testDataItemTemplate.html',
'./input/ObjectSelect',
'./input/KeySelect',
'./eventHelpers',
'../../../utils/template/templateHelpers',
'EventEmitter'
], function (itemTemplate, ObjectSelect, KeySelect, eventHelpers, templateHelpers, EventEmitter) {
import EventEmitter from 'EventEmitter';
import * as templateHelpers from '../../../utils/template/templateHelpers';
import itemTemplate from '../res/testDataItemTemplate.html';
import eventHelpers from './eventHelpers';
import KeySelect from './input/KeySelect';
import ObjectSelect from './input/ObjectSelect';
/**
* An object representing a single mock telemetry value
* @param {object} itemConfig the configuration for this item, consisting of
@ -17,7 +17,7 @@ define([
* for populating selects with configuration data
* @constructor
*/
function TestDataItem(itemConfig, index, conditionManager) {
export default function TestDataItem(itemConfig, index, conditionManager) {
eventHelpers.extend(this);
this.config = itemConfig;
this.index = index;
@ -188,6 +188,3 @@ define([
inputArea.append(this.valueInput);
}
};
return TestDataItem;
});

View File

@ -1,10 +1,10 @@
define([
'./eventHelpers',
'../res/testDataTemplate.html',
'./TestDataItem',
'../../../utils/template/templateHelpers',
'lodash'
], function (eventHelpers, testDataTemplate, TestDataItem, templateHelpers, _) {
import _ from 'lodash';
import * as templateHelpers from '../../../utils/template/templateHelpers';
import testDataTemplate from '../res/testDataTemplate.html';
import eventHelpers from './eventHelpers';
import TestDataItem from './TestDataItem';
/**
* Controls the input and usage of test data in the summary widget.
* @constructor
@ -12,7 +12,7 @@ define([
* @param {ConditionManager} conditionManager A conditionManager instance
* @param {MCT} openmct and MCT instance
*/
function TestDataManager(domainObject, conditionManager, openmct) {
export default function TestDataManager(domainObject, conditionManager, openmct) {
eventHelpers.extend(this);
const self = this;
@ -196,6 +196,3 @@ define([
item.remove();
});
};
return TestDataManager;
});

View File

@ -1,15 +1,15 @@
define([
'../res/ruleImageTemplate.html',
'EventEmitter',
'../../../utils/template/templateHelpers'
], function (ruleImageTemplate, EventEmitter, templateHelpers) {
import EventEmitter from 'EventEmitter';
import * as templateHelpers from '../../../utils/template/templateHelpers';
import ruleImageTemplate from '../res/ruleImageTemplate.html';
/**
* Manages the Sortable List interface for reordering rules by drag and drop
* @param {Element} container The DOM element that contains this Summary Widget's view
* @param {string[]} ruleOrder An array of rule IDs representing the current rule order
* @param {Object} rulesById An object mapping rule IDs to rule configurations
*/
function WidgetDnD(container, ruleOrder, rulesById) {
export default function WidgetDnD(container, ruleOrder, rulesById) {
this.container = container;
this.ruleOrder = ruleOrder;
this.rulesById = rulesById;
@ -160,6 +160,3 @@ define([
this.imageContainer.hide();
}
};
return WidgetDnD;
});

View File

@ -20,9 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
const helperFunctions = {
listenTo: function (object, event, callback, context) {
listenTo(object, event, callback, context) {
if (!this._listeningTo) {
this._listeningTo = [];
}
@ -48,7 +47,7 @@ define([], function () {
this._listeningTo.push(listener);
},
stopListening: function (object, event, callback, context) {
stopListening(object, event, callback, context) {
if (!this._listeningTo) {
this._listeningTo = [];
}
@ -95,5 +94,4 @@ define([], function () {
}
};
return helperFunctions;
});
export default helperFunctions;

View File

@ -1,4 +1,5 @@
define(['./Palette'], function (Palette) {
import Palette from './Palette';
// The colors that will be used to instantiate this palette if none are provided
const DEFAULT_COLORS = [
'#000000',
@ -91,7 +92,7 @@ define(['./Palette'], function (Palette) {
* @param {Element} container The view that contains this palette
* @param {string[]} colors (optional) A list of colors that should be used to instantiate this palette
*/
function ColorPalette(cssClass, container, colors) {
export default function ColorPalette(cssClass, container, colors) {
this.colors = colors || DEFAULT_COLORS;
this.palette = new Palette(cssClass, container, this.colors);
@ -123,6 +124,3 @@ define(['./Palette'], function (Palette) {
return this.palette;
}
return ColorPalette;
});

View File

@ -1,4 +1,5 @@
define(['./Palette'], function (Palette) {
import Palette from './Palette';
//The icons that will be used to instantiate this palette if none are provided
const DEFAULT_ICONS = [
'icon-alert-rect',
@ -35,7 +36,7 @@ define(['./Palette'], function (Palette) {
* @param {Element} container The view that contains this palette
* @param {string[]} icons (optional) A list of icons that should be used to instantiate this palette
*/
function IconPalette(cssClass, container, icons) {
export default function IconPalette(cssClass, container, icons) {
this.icons = icons || DEFAULT_ICONS;
this.palette = new Palette(cssClass, container, this.icons);
@ -72,6 +73,3 @@ define(['./Palette'], function (Palette) {
return this.palette;
}
return IconPalette;
});

View File

@ -1,4 +1,5 @@
define(['./Select'], function (Select) {
import Select from './Select';
/**
* Create a {Select} element whose composition is dynamically updated with
* the telemetry fields of a particular domain object
@ -15,7 +16,7 @@ define(['./Select'], function (Select) {
*/
const NULLVALUE = '- Select Field -';
function KeySelect(config, objectSelect, manager, changeCallback) {
export default function KeySelect(config, objectSelect, manager, changeCallback) {
const self = this;
this.config = config;
@ -90,6 +91,3 @@ define(['./Select'], function (Select) {
KeySelect.prototype.destroy = function () {
this.objectSelect.destroy();
};
return KeySelect;
});

View File

@ -1,4 +1,7 @@
define(['./Select', 'objectUtils'], function (Select, objectUtils) {
import objectUtils from 'objectUtils';
import Select from './Select';
/**
* Create a {Select} element whose composition is dynamically updated with
* the current composition of the Summary Widget
@ -10,7 +13,7 @@ define(['./Select', 'objectUtils'], function (Select, objectUtils) {
* @param {string[][]} baseOptions A set of [value, label] keyword pairs to
* display regardless of the composition state
*/
function ObjectSelect(config, manager, baseOptions) {
export default function ObjectSelect(config, manager, baseOptions) {
const self = this;
this.config = config;
@ -81,6 +84,3 @@ define(['./Select', 'objectUtils'], function (Select, objectUtils) {
});
this.select.setOptions(items);
};
return ObjectSelect;
});

View File

@ -1,4 +1,6 @@
define(['./Select', '../eventHelpers'], function (Select, eventHelpers) {
import eventHelpers from '../eventHelpers';
import Select from './Select';
/**
* Create a {Select} element whose composition is dynamically updated with
* the operations applying to a particular telemetry property
@ -15,7 +17,7 @@ define(['./Select', '../eventHelpers'], function (Select, eventHelpers) {
*/
const NULLVALUE = '- Select Comparison -';
function OperationSelect(config, keySelect, manager, changeCallback) {
export default function OperationSelect(config, keySelect, manager, changeCallback) {
eventHelpers.extend(this);
const self = this;
@ -115,6 +117,3 @@ define(['./Select', '../eventHelpers'], function (Select, eventHelpers) {
OperationSelect.prototype.destroy = function () {
this.stopListening();
};
return OperationSelect;
});

View File

@ -1,9 +1,9 @@
define([
'../eventHelpers',
'../../res/input/paletteTemplate.html',
'../../../../utils/template/templateHelpers',
'EventEmitter'
], function (eventHelpers, paletteTemplate, templateHelpers, EventEmitter) {
import EventEmitter from 'EventEmitter';
import * as templateHelpers from '../../../../utils/template/templateHelpers';
import paletteTemplate from '../../res/input/paletteTemplate.html';
import eventHelpers from '../eventHelpers';
/**
* Instantiates a new Open MCT Color Palette input
* @constructor
@ -14,7 +14,7 @@ define([
* palette item in the view; how this data is represented is
* up to the descendent class
*/
function Palette(cssClass, container, items) {
export default function Palette(cssClass, container, items) {
eventHelpers.extend(this);
const self = this;
@ -179,6 +179,3 @@ define([
this.domElement.querySelector('.c-palette__item-none').style.display = 'none';
}
};
return Palette;
});

View File

@ -1,15 +1,15 @@
define([
'../eventHelpers',
'../../res/input/selectTemplate.html',
'../../../../utils/template/templateHelpers',
'EventEmitter'
], function (eventHelpers, selectTemplate, templateHelpers, EventEmitter) {
import EventEmitter from 'EventEmitter';
import * as templateHelpers from '../../../../utils/template/templateHelpers';
import selectTemplate from '../../res/input/selectTemplate.html';
import eventHelpers from '../eventHelpers';
/**
* Wraps an HTML select element, and provides methods for dynamically altering
* its composition from the data model
* @constructor
*/
function Select() {
export default function Select() {
eventHelpers.extend(this);
const self = this;
@ -163,6 +163,3 @@ define([
Select.prototype.destroy = function () {
this.stopListening();
};
return Select;
});

View File

@ -20,8 +20,11 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./SummaryWidgetEvaluator', 'objectUtils'], function (SummaryWidgetEvaluator, objectUtils) {
function EvaluatorPool(openmct) {
import objectUtils from 'objectUtils';
import SummaryWidgetEvaluator from './SummaryWidgetEvaluator';
export default function EvaluatorPool(openmct) {
this.openmct = openmct;
this.byObjectId = {};
this.byEvaluator = new WeakMap();
@ -54,6 +57,3 @@ define(['./SummaryWidgetEvaluator', 'objectUtils'], function (SummaryWidgetEvalu
delete this.byObjectId[poolEntry.objectId];
}
};
return EvaluatorPool;
});

View File

@ -20,10 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./EvaluatorPool', './SummaryWidgetEvaluator'], function (
EvaluatorPool,
SummaryWidgetEvaluator
) {
import EvaluatorPool from './EvaluatorPool';
describe('EvaluatorPool', function () {
let pool;
let openmct;
@ -94,4 +92,3 @@ define(['./EvaluatorPool', './SummaryWidgetEvaluator'], function (
expect(evaluatorA).not.toBe(evaluatorC);
});
});
});

View File

@ -20,8 +20,9 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./operations'], function (OPERATIONS) {
function SummaryWidgetCondition(definition) {
import OPERATIONS from './operations';
export default function SummaryWidgetCondition(definition) {
this.object = definition.object;
this.key = definition.key;
this.values = definition.values;
@ -71,6 +72,3 @@ define(['./operations'], function (OPERATIONS) {
return this.comparator(testValues);
};
return SummaryWidgetCondition;
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./SummaryWidgetCondition'], function (SummaryWidgetCondition) {
import SummaryWidgetCondition from './SummaryWidgetCondition';
describe('SummaryWidgetCondition', function () {
let condition;
let telemetryState;
@ -122,4 +123,3 @@ define(['./SummaryWidgetCondition'], function (SummaryWidgetCondition) {
expect(condition.evaluate(telemetryState)).toBe(true);
});
});
});

View File

@ -20,18 +20,18 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./SummaryWidgetRule', '../eventHelpers', 'objectUtils', 'lodash'], function (
SummaryWidgetRule,
eventHelpers,
objectUtils,
_
) {
import _ from 'lodash';
import objectUtils from 'objectUtils';
import eventHelpers from '../eventHelpers';
import SummaryWidgetRule from './SummaryWidgetRule';
/**
* evaluates rules defined in a summary widget against either lad or
* realtime state.
*
*/
function SummaryWidgetEvaluator(domainObject, openmct) {
export default function SummaryWidgetEvaluator(domainObject, openmct) {
this.openmct = openmct;
this.baseState = {};
@ -69,10 +69,7 @@ define(['./SummaryWidgetRule', '../eventHelpers', 'objectUtils', 'lodash'], func
}.bind(this);
/* eslint-disable you-dont-need-lodash-underscore/map */
unsubscribes = _.map(
realtimeStates,
this.subscribeToObjectState.bind(this, updateCallback)
);
unsubscribes = _.map(realtimeStates, this.subscribeToObjectState.bind(this, updateCallback));
/* eslint-enable you-dont-need-lodash-underscore/map */
}.bind(this)
);
@ -196,8 +193,7 @@ define(['./SummaryWidgetRule', '../eventHelpers', 'objectUtils', 'lodash'], func
SummaryWidgetEvaluator.prototype.getTimestamps = function (childId, datum) {
const timestampedDatum = {};
this.openmct.time.getAllTimeSystems().forEach(function (timeSystem) {
timestampedDatum[timeSystem.key] =
this.baseState[childId].formats[timeSystem.key].parse(datum);
timestampedDatum[timeSystem.key] = this.baseState[childId].formats[timeSystem.key].parse(datum);
}, this);
return timestampedDatum;
@ -265,6 +261,3 @@ define(['./SummaryWidgetRule', '../eventHelpers', 'objectUtils', 'lodash'], func
this.stopListening();
this.removeObserver();
};
return SummaryWidgetEvaluator;
});

View File

@ -20,8 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
function SummaryWidgetMetadataProvider(openmct) {
export default function SummaryWidgetMetadataProvider(openmct) {
this.openmct = openmct;
}
@ -108,6 +107,3 @@ define([], function () {
return metadata;
};
return SummaryWidgetMetadataProvider;
});

View File

@ -20,8 +20,9 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./SummaryWidgetCondition'], function (SummaryWidgetCondition) {
function SummaryWidgetRule(definition) {
import SummaryWidgetCondition from './SummaryWidgetCondition';
export default function SummaryWidgetRule(definition) {
this.name = definition.name;
this.label = definition.label;
this.id = definition.id;
@ -65,6 +66,3 @@ define(['./SummaryWidgetCondition'], function (SummaryWidgetCondition) {
throw new Error('Invalid rule trigger: ' + this.trigger);
}
};
return SummaryWidgetRule;
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./SummaryWidgetRule'], function (SummaryWidgetRule) {
import SummaryWidgetRule from './SummaryWidgetRule';
describe('SummaryWidgetRule', function () {
let rule;
let telemetryState;
@ -150,4 +151,3 @@ define(['./SummaryWidgetRule'], function (SummaryWidgetRule) {
expect(rule.evaluate(telemetryState)).toBe(true);
});
});
});

View File

@ -20,8 +20,9 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./EvaluatorPool'], function (EvaluatorPool) {
function SummaryWidgetTelemetryProvider(openmct) {
import EvaluatorPool from './EvaluatorPool';
export default function SummaryWidgetTelemetryProvider(openmct) {
this.pool = new EvaluatorPool(openmct);
}
@ -58,6 +59,3 @@ define(['./EvaluatorPool'], function (EvaluatorPool) {
unsubscribe();
}.bind(this);
};
return SummaryWidgetTelemetryProvider;
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./SummaryWidgetTelemetryProvider'], function (SummaryWidgetTelemetryProvider) {
import SummaryWidgetTelemetryProvider from './SummaryWidgetTelemetryProvider';
xdescribe('SummaryWidgetTelemetryProvider', function () {
let telemObjectA;
let telemObjectB;
@ -460,4 +461,3 @@ define(['./SummaryWidgetTelemetryProvider'], function (SummaryWidgetTelemetryPro
});
});
});
});

View File

@ -20,7 +20,6 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
const OPERATIONS = {
equalTo: {
operation: function (input) {
@ -211,5 +210,4 @@ define([], function () {
}
};
return OPERATIONS;
});
export default OPERATIONS;

View File

@ -1,13 +1,30 @@
define(['../SummaryWidget', './SummaryWidgetView', 'objectUtils'], function (
SummaryWidgetEditView,
SummaryWidgetView,
objectUtils
) {
const DEFAULT_VIEW_PRIORITY = 100;
/**
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2023, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
*/
function SummaryWidgetViewProvider(openmct) {
* 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 SummaryWidgetEditView from '../SummaryWidget';
import SummaryWidgetView from './SummaryWidgetView';
const DEFAULT_VIEW_PRIORITY = 100;
export default function SummaryWidgetViewProvider(openmct) {
return {
key: 'summary-widget-viewer',
name: 'Summary View',
@ -33,6 +50,3 @@ define(['../SummaryWidget', './SummaryWidgetView', 'objectUtils'], function (
}
};
}
return SummaryWidgetViewProvider;
});

View File

@ -1,4 +1,5 @@
define(['../src/ConditionEvaluator'], function (ConditionEvaluator) {
import ConditionEvaluator from '../src/ConditionEvaluator';
describe('A Summary Widget Rule Evaluator', function () {
let evaluator;
let testEvaluator;
@ -360,4 +361,3 @@ define(['../src/ConditionEvaluator'], function (ConditionEvaluator) {
});
});
});
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['../src/ConditionManager'], function (ConditionManager) {
import ConditionManager from '../src/ConditionManager';
describe('A Summary Widget Condition Manager', function () {
let conditionManager;
let mockDomainObject;
@ -180,12 +181,7 @@ define(['../src/ConditionManager'], function (ConditionManager) {
}
};
mockComposition = jasmine.createSpyObj('composition', [
'on',
'off',
'load',
'triggerCallback'
]);
mockComposition = jasmine.createSpyObj('composition', ['on', 'off', 'load', 'triggerCallback']);
mockComposition.on.and.callFake(function (event, callback, context) {
mockEventCallbacks[event] = callback.bind(context);
});
@ -440,4 +436,3 @@ define(['../src/ConditionManager'], function (ConditionManager) {
expect(telemetryCallbackSpy).toHaveBeenCalled();
});
});
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['../src/Condition'], function (Condition) {
import Condition from '../src/Condition';
describe('A summary widget condition', function () {
let testCondition;
let mockConfig;
@ -202,4 +203,3 @@ define(['../src/Condition'], function (Condition) {
});
});
});
});

View File

@ -1,4 +1,27 @@
define(['../src/Rule'], function (Rule) {
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2023, 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 Rule from '../src/Rule';
describe('A Summary Widget Rule', function () {
let mockRuleConfig;
let mockDomainObject;
@ -290,4 +313,3 @@ define(['../src/Rule'], function (Rule) {
]);
});
});
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['../src/SummaryWidget'], function (SummaryWidget) {
import SummaryWidget from '../src/SummaryWidget';
describe('The Summary Widget', function () {
let summaryWidget;
let mockDomainObject;
@ -189,4 +190,3 @@ define(['../src/SummaryWidget'], function (SummaryWidget) {
expect(widgetButton.target).toEqual('_blank');
});
});
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['../SummaryWidgetViewPolicy'], function (SummaryWidgetViewPolicy) {
import SummaryWidgetViewPolicy from '../SummaryWidgetViewPolicy';
describe('SummaryWidgetViewPolicy', function () {
let policy;
let domainObject;
@ -55,4 +56,3 @@ define(['../SummaryWidgetViewPolicy'], function (SummaryWidgetViewPolicy) {
expect(policy.allow(view, domainObject)).toBe(false);
});
});
});

View File

@ -1,4 +1,5 @@
define(['../src/TestDataItem'], function (TestDataItem) {
import TestDataItem from '../src/TestDataItem';
describe('A summary widget test data item', function () {
let testDataItem;
let mockConfig;
@ -164,4 +165,3 @@ define(['../src/TestDataItem'], function (TestDataItem) {
});
});
});
});

View File

@ -1,4 +1,5 @@
define(['../src/TestDataManager'], function (TestDataManager) {
import TestDataManager from '../src/TestDataManager';
describe('A Summary Widget Rule', function () {
let mockDomainObject;
let mockOpenMCT;
@ -118,9 +119,7 @@ define(['../src/TestDataManager'], function (TestDataManager) {
it('exposes a DOM element to represent itself in the view', function () {
mockContainer.append(testDataManager.getDOM());
expect(mockContainer.querySelectorAll('.t-widget-test-data-content').length).toBeGreaterThan(
0
);
expect(mockContainer.querySelectorAll('.t-widget-test-data-content').length).toBeGreaterThan(0);
});
it('generates a test cache in the format expected by a condition evaluator', function () {
@ -137,10 +136,7 @@ define(['../src/TestDataManager'], function (TestDataManager) {
});
});
it(
'updates its configuration on a item change and provides an updated' +
'cache to the evaluator',
function () {
it('updates its configuration on a item change and provides an updated cache to the evaluator', function () {
testDataManager.onItemChange({
value: 26,
property: 'value',
@ -157,8 +153,7 @@ define(['../src/TestDataManager'], function (TestDataManager) {
property4: 'Text It Is'
}
});
}
);
});
it('allows initializing a new item with a default configuration', function () {
testDataManager.initItem();
@ -247,4 +242,3 @@ define(['../src/TestDataManager'], function (TestDataManager) {
it('exposes a UI element to toggle test data on and off', function () {});
});
});

View File

@ -1,4 +1,5 @@
define(['../../src/input/ColorPalette'], function (ColorPalette) {
import ColorPalette from '../../src/input/ColorPalette';
describe('An Open MCT color palette', function () {
let colorPalette;
let changeCallback;
@ -21,4 +22,3 @@ define(['../../src/input/ColorPalette'], function (ColorPalette) {
expect(colorPalette.getCurrent()).toBeDefined();
});
});
});

View File

@ -1,4 +1,5 @@
define(['../../src/input/IconPalette'], function (IconPalette) {
import IconPalette from '../../src/input/IconPalette';
describe('An Open MCT icon palette', function () {
let iconPalette;
let changeCallback;
@ -21,4 +22,3 @@ define(['../../src/input/IconPalette'], function (IconPalette) {
expect(iconPalette.getCurrent()).toBeDefined();
});
});
});

View File

@ -1,4 +1,5 @@
define(['../../src/input/KeySelect'], function (KeySelect) {
import KeySelect from '../../src/input/KeySelect';
describe('A select for choosing composition object properties', function () {
let mockConfig;
let mockBadConfig;
@ -120,4 +121,3 @@ define(['../../src/input/KeySelect'], function (KeySelect) {
expect(keySelect.getSelected()).toEqual('a');
});
});
});

View File

@ -1,4 +1,27 @@
define(['../../src/input/ObjectSelect'], function (ObjectSelect) {
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2023, 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 ObjectSelect from '../../src/input/ObjectSelect';
describe('A select for choosing composition objects', function () {
let mockConfig;
let mockBadConfig;
@ -109,4 +132,3 @@ define(['../../src/input/ObjectSelect'], function (ObjectSelect) {
expect(objectSelect.getSelected()).not.toEqual('key1');
});
});
});

View File

@ -1,4 +1,27 @@
define(['../../src/input/OperationSelect'], function (OperationSelect) {
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2023, 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 OperationSelect from '../../src/input/OperationSelect';
describe('A select for choosing composition object properties', function () {
let mockConfig;
let mockBadConfig;
@ -140,4 +163,3 @@ define(['../../src/input/OperationSelect'], function (OperationSelect) {
expect(operationSelect.getSelected()).toEqual('operation1');
});
});
});

View File

@ -1,4 +1,5 @@
define(['../../src/input/Palette'], function (Palette) {
import Palette from '../../src/input/Palette';
describe('A generic Open MCT palette input', function () {
let palette;
let callbackSpy1;
@ -41,4 +42,3 @@ define(['../../src/input/Palette'], function (Palette) {
expect(palette.getCurrent()).not.toEqual('foobar');
});
});
});

View File

@ -1,4 +1,5 @@
define(['../../src/input/Select'], function (Select) {
import Select from '../../src/input/Select';
describe('A select wrapper', function () {
let select;
let testOptions;
@ -58,4 +59,3 @@ define(['../../src/input/Select'], function (Select) {
expect(select.getSelected()).not.toEqual('foobar');
});
});
});

View File

@ -19,11 +19,11 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
import Tabs from './tabs';
define(['./tabs'], function (Tabs) {
return function plugin() {
export default function plugin() {
return function install(openmct) {
openmct.objectViews.addProvider(new Tabs.default(openmct));
openmct.objectViews.addProvider(new Tabs(openmct));
openmct.types.addType('tabs', {
name: 'Tabs View',
@ -55,5 +55,4 @@ define(['./tabs'], function (Tabs) {
]
});
};
};
});
}

View File

@ -47,7 +47,7 @@ export default class Tabs {
let component = null;
return {
show: function (element, editMode) {
show(element, editMode) {
const { vNode, destroy } = mount(
{
el: element,

View File

@ -20,10 +20,11 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./src/MeanTelemetryProvider'], function (MeanTelemetryProvider) {
import MeanTelemetryProvider from './src/MeanTelemetryProvider';
const DEFAULT_SAMPLES = 10;
function plugin() {
export default function plugin() {
return function install(openmct) {
openmct.types.addType('telemetry-mean', {
name: 'Telemetry Filter',
@ -73,6 +74,3 @@ define(['./src/MeanTelemetryProvider'], function (MeanTelemetryProvider) {
openmct.telemetry.addProvider(new MeanTelemetryProvider(openmct));
};
}
return plugin;
});

View File

@ -20,8 +20,11 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['objectUtils', './TelemetryAverager'], function (objectUtils, TelemetryAverager) {
function MeanTelemetryProvider(openmct) {
import objectUtils from 'objectUtils';
import TelemetryAverager from './TelemetryAverager';
export default function MeanTelemetryProvider(openmct) {
this.openmct = openmct;
this.telemetryAPI = openmct.telemetry;
this.timeAPI = openmct.time;
@ -128,6 +131,3 @@ define(['objectUtils', './TelemetryAverager'], function (objectUtils, TelemetryA
console.error(error);
}
}
return MeanTelemetryProvider;
});

View File

@ -20,10 +20,10 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
/* eslint-disable no-invalid-this */
define(['./MeanTelemetryProvider', './MockTelemetryApi'], function (
MeanTelemetryProvider,
MockTelemetryApi
) {
import MeanTelemetryProvider from './MeanTelemetryProvider';
import MockTelemetryApi from './MockTelemetryApi';
const RANGE_KEY = 'value';
describe('The Mean Telemetry Provider', function () {
@ -620,4 +620,3 @@ define(['./MeanTelemetryProvider', './MockTelemetryApi'], function (
});
}
});
});

View File

@ -20,8 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
function MockTelemetryApi() {
export default function MockTelemetryApi() {
this.createSpy('subscribe');
this.createSpy('getMetadata');
@ -96,6 +95,3 @@ define([], function () {
spyOn(this, functionName);
this[functionName].and.callThrough();
};
return MockTelemetryApi;
});

View File

@ -20,8 +20,13 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
function TelemetryAverager(telemetryAPI, timeAPI, domainObject, samples, averageDatumCallback) {
export default function TelemetryAverager(
telemetryAPI,
timeAPI,
domainObject,
samples,
averageDatumCallback
) {
this.telemetryAPI = telemetryAPI;
this.timeAPI = timeAPI;
@ -114,6 +119,3 @@ define([], function () {
return this.telemetryAPI.getValueFormatter(valueMetadata);
};
return TelemetryAverager;
});

View File

@ -20,28 +20,18 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([
'EventEmitter',
'lodash',
'./collections/TableRowCollection',
'./TelemetryTableRow',
'./TelemetryTableNameColumn',
'./TelemetryTableColumn',
'./TelemetryTableUnitColumn',
'./TelemetryTableConfiguration',
'../../utils/staleness'
], function (
EventEmitter,
_,
TableRowCollection,
TelemetryTableRow,
TelemetryTableNameColumn,
TelemetryTableColumn,
TelemetryTableUnitColumn,
TelemetryTableConfiguration,
StalenessUtils
) {
class TelemetryTable extends EventEmitter {
import EventEmitter from 'EventEmitter';
import _ from 'lodash';
import StalenessUtils from '../../utils/staleness';
import TableRowCollection from './collections/TableRowCollection';
import TelemetryTableColumn from './TelemetryTableColumn';
import TelemetryTableConfiguration from './TelemetryTableConfiguration';
import TelemetryTableNameColumn from './TelemetryTableNameColumn';
import TelemetryTableRow from './TelemetryTableRow';
import TelemetryTableUnitColumn from './TelemetryTableUnitColumn';
export default class TelemetryTable extends EventEmitter {
constructor(domainObject, openmct) {
super();
@ -195,7 +185,7 @@ define([
}
this.stalenessSubscription[keyString] = {};
this.stalenessSubscription[keyString].stalenessUtils = new StalenessUtils.default(
this.stalenessSubscription[keyString].stalenessUtils = new StalenessUtils(
this.openmct,
domainObject
);
@ -471,6 +461,3 @@ define([
}
}
}
return TelemetryTable;
});

View File

@ -19,8 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(function () {
class TelemetryTableColumn {
export default class TelemetryTableColumn {
constructor(openmct, metadatum, options = { selectable: false }) {
this.metadatum = metadatum;
this.formatter = openmct.telemetry.getValueFormatter(metadatum);
@ -61,6 +60,3 @@ define(function () {
return this.formatter.parse(telemetryDatum);
}
}
return TelemetryTableColumn;
});

View File

@ -20,8 +20,10 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['lodash', 'EventEmitter'], function (_, EventEmitter) {
class TelemetryTableConfiguration extends EventEmitter {
import EventEmitter from 'EventEmitter';
import _ from 'lodash';
export default class TelemetryTableConfiguration extends EventEmitter {
constructor(domainObject, openmct) {
super();
@ -163,6 +165,3 @@ define(['lodash', 'EventEmitter'], function (_, EventEmitter) {
this.unlistenFromMutation();
}
}
return TelemetryTableConfiguration;
});

View File

@ -19,8 +19,10 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./TelemetryTableColumn.js'], function (TelemetryTableColumn) {
class TelemetryTableNameColumn extends TelemetryTableColumn {
import TelemetryTableColumn from './TelemetryTableColumn';
export default class TelemetryTableNameColumn extends TelemetryTableColumn {
constructor(openmct, telemetryObject, metadatum) {
super(openmct, metadatum);
@ -35,6 +37,3 @@ define(['./TelemetryTableColumn.js'], function (TelemetryTableColumn) {
return this.telemetryObject.name;
}
}
return TelemetryTableNameColumn;
});

View File

@ -20,8 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
class TelemetryTableRow {
export default class TelemetryTableRow {
constructor(datum, columns, objectKeyString, limitEvaluator, inPlaceUpdateKey) {
this.columns = columns;
@ -122,6 +121,3 @@ define([], function () {
return normalizedDatum;
}
return TelemetryTableRow;
});

View File

@ -20,8 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(function () {
return {
export default {
name: 'Telemetry Table',
description:
'Display values for one or more telemetry end points in a scrolling table. Each row is a time-stamped value.',
@ -35,4 +34,3 @@ define(function () {
};
}
};
});

View File

@ -19,7 +19,8 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['./TelemetryTableColumn.js'], function (TelemetryTableColumn) {
import TelemetryTableColumn from './TelemetryTableColumn.js';
class TelemetryTableUnitColumn extends TelemetryTableColumn {
constructor(openmct, metadatum) {
super(openmct, metadatum);
@ -52,5 +53,4 @@ define(['./TelemetryTableColumn.js'], function (TelemetryTableColumn) {
}
}
return TelemetryTableUnitColumn;
});
export default TelemetryTableUnitColumn;

View File

@ -19,12 +19,13 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
import EventEmitter from 'EventEmitter';
import _ from 'lodash';
define(['lodash', 'EventEmitter'], function (_, EventEmitter) {
/**
* @constructor
*/
class TableRowCollection extends EventEmitter {
export default class TableRowCollection extends EventEmitter {
constructor() {
super();
@ -384,6 +385,3 @@ define(['lodash', 'EventEmitter'], function (_, EventEmitter) {
this.removeAllListeners();
}
}
return TableRowCollection;
});

View File

@ -20,17 +20,17 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* This time system supports UTC dates.
* @implements TimeSystem
* @constructor
*/
function UTCTimeSystem() {
class UTCTimeSystem {
/**
* Metadata used to identify the time system in
* the UI
*/
constructor() {
this.key = 'utc';
this.name = 'UTC';
this.cssClass = 'icon-clock';
@ -38,6 +38,6 @@ define([], function () {
this.durationFormat = 'duration';
this.isUTCBased = true;
}
}
return UTCTimeSystem;
});
export default UTCTimeSystem;

View File

@ -20,14 +20,13 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define([], function () {
/**
* A ToolbarRegistry maintains the definitions for toolbars.
*
* @interface ToolbarRegistry
* @memberof module:openmct
*/
function ToolbarRegistry() {
export default function ToolbarRegistry() {
this.providers = {};
}
@ -116,6 +115,3 @@ define([], function () {
* @param {object} selection the selection object
* @returns {Object[]} an array of objects defining controls for the toolbar.
*/
return ToolbarRegistry;
});

View File

@ -20,7 +20,8 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
define(['EventEmitter'], function (EventEmitter) {
import EventEmitter from 'EventEmitter';
const DEFAULT_VIEW_PRIORITY = 100;
/**
@ -29,7 +30,7 @@ define(['EventEmitter'], function (EventEmitter) {
* @interface ViewRegistry
* @memberof module:openmct
*/
function ViewRegistry() {
export default function ViewRegistry() {
EventEmitter.apply(this);
this.providers = {};
}
@ -269,6 +270,3 @@ define(['EventEmitter'], function (EventEmitter) {
* @param {*} object the object to be edit
* @returns {module:openmct.View} an editable view of this domain object
*/
return ViewRegistry;
});

Some files were not shown because too many files have changed in this diff Show More