diff --git a/.eslintrc.js b/.eslintrc.js index a65219828d..fbd822507c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,8 @@ module.exports = { }, "extends": [ "eslint:recommended", - "plugin:vue/recommended" + "plugin:vue/recommended", + "plugin:you-dont-need-lodash-underscore/compatible" ], "parser": "vue-eslint-parser", "parserOptions": { @@ -23,6 +24,9 @@ module.exports = { } }, "rules": { + "you-dont-need-lodash-underscore/omit": "off", + "you-dont-need-lodash-underscore/throttle": "off", + "you-dont-need-lodash-underscore/flatten": "off", "no-bitwise": "error", "curly": "error", "eqeqeq": "error", diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8605ba3002..9e43f38894 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -103,7 +103,7 @@ the name chosen could not be mistaken for a topic or master branch. ### Merging When development is complete on an issue, the first step toward merging it -back into the master branch is to file a Pull Request. The contributions +back into the master branch is to file a Pull Request (PR). The contributions should meet code, test, and commit message standards as described below, and the pull request should include a completed author checklist, also as described below. Pull requests may be assigned to specific team @@ -114,6 +114,15 @@ request. When the reviewer is satisfied, they should add a comment to the pull request containing the reviewer checklist (from below) and complete the merge back to the master branch. +Additionally: +* Every pull request must link to the issue that it addresses. Eg. “Addresses #1234” or “Closes #1234”. This is the responsibility of the pull request’s __author__. If no issue exists, create one. +* Every __author__ must include testing instructions. These instructions should identify the areas of code affected, and some minimal test steps. If addressing a bug, reproduction steps should be included, if they were not included in the original issue. If reproduction steps were included on the original issue, and are sufficient, refer to them. +* A pull request that closes an issue should say so in the description. Including the text “Closes #1234” will cause the linked issue to be automatically closed when the pull request is merged. This is the responsibility of the pull request’s __author__. +* When a pull request is merged, and the corresponding issue closed, the __reviewer__ must add the tag “unverified” to the original issue. This will indicate that although the issue is closed, it has not been tested yet. +* Every PR must have two reviewers assigned, though only one approval is necessary for merge. +* Changes to API require approval by a senior developer. +* When creating a PR, it is the author's responsibility to apply any priority label from the issue to the PR as well. This helps with prioritization. + ## Standards Contributions to Open MCT are expected to meet the following standards. @@ -299,6 +308,7 @@ checklist). 2. Unit tests included and/or updated with changes? 3. Command line build passes? 4. Changes have been smoke-tested? +5. Testing instructions included? ### Reviewer Checklist @@ -306,3 +316,4 @@ checklist). 2. Appropriate unit tests included? 3. Code style and in-line documentation are appropriate? 4. Commit messages meet standards? +5. Has associated issue been labelled `unverified`? (only applicable if this PR closes the issue) diff --git a/example/generator/GeneratorMetadataProvider.js b/example/generator/GeneratorMetadataProvider.js index b9ddf23c3d..9ca9a08f4c 100644 --- a/example/generator/GeneratorMetadataProvider.js +++ b/example/generator/GeneratorMetadataProvider.js @@ -100,7 +100,7 @@ define([ }; GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) { - return _.extend( + return Object.assign( {}, domainObject.telemetry, METADATA_BY_TYPE[domainObject.type] diff --git a/example/imagery/plugin.js b/example/imagery/plugin.js index 8d3d4211ed..63a351c985 100644 --- a/example/imagery/plugin.js +++ b/example/imagery/plugin.js @@ -52,6 +52,7 @@ define([ return { name: name, utc: Math.floor(timestamp / 5000) * 5000, + local: Math.floor(timestamp / 5000) * 5000, url: IMAGE_SAMPLES[Math.floor(timestamp / 5000) % IMAGE_SAMPLES.length] }; } @@ -78,7 +79,7 @@ define([ }, request: function (domainObject, options) { var start = options.start; - var end = options.end; + var end = Math.min(options.end, Date.now()); var data = []; while (start <= end && data.length < 5000) { data.push(pointForTimestamp(start, domainObject.name)); @@ -118,6 +119,14 @@ define([ name: 'Time', key: 'utc', format: 'utc', + hints: { + domain: 2 + } + }, + { + name: 'Local Time', + key: 'local', + format: 'local-format', hints: { domain: 1 } diff --git a/package.json b/package.json index 707357d7a8..8b6fab4940 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "d3-time-format": "2.1.x", "eslint": "5.2.0", "eslint-plugin-vue": "^6.0.0", + "eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0", "eventemitter3": "^1.2.0", "exports-loader": "^0.7.0", "express": "^4.13.1", @@ -48,7 +49,7 @@ "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^3.0.0", "location-bar": "^3.0.1", - "lodash": "^3.10.1", + "lodash": "^4.17.12", "markdown-toc": "^0.11.7", "marked": "^0.3.5", "mini-css-extract-plugin": "^0.4.1", diff --git a/platform/commonUI/dialog/res/templates/overlay-message-list.html b/platform/commonUI/dialog/res/templates/overlay-message-list.html index 39aa0ca228..caabd7d4bf 100644 --- a/platform/commonUI/dialog/res/templates/overlay-message-list.html +++ b/platform/commonUI/dialog/res/templates/overlay-message-list.html @@ -6,6 +6,12 @@ ng-show="ngModel.dialog.messages.length > 1 || ngModel.dialog.messages.length == 0">s +
- {{dialogAction.label}} + {{ dialogAction.label }}
diff --git a/platform/commonUI/edit/src/policies/EditPersistableObjectsPolicy.js b/platform/commonUI/edit/src/policies/EditPersistableObjectsPolicy.js index 7377aab47b..e384e4970a 100644 --- a/platform/commonUI/edit/src/policies/EditPersistableObjectsPolicy.js +++ b/platform/commonUI/edit/src/policies/EditPersistableObjectsPolicy.js @@ -21,7 +21,7 @@ *****************************************************************************/ define( - ['../../../../../src/api/objects/object-utils'], + ['objectUtils'], function (objectUtils) { /** diff --git a/platform/commonUI/notification/bundle.js b/platform/commonUI/notification/bundle.js index 5410172d84..f8a2a3a566 100644 --- a/platform/commonUI/notification/bundle.js +++ b/platform/commonUI/notification/bundle.js @@ -21,44 +21,15 @@ *****************************************************************************/ define([ - "./src/NotificationIndicatorController", - "./src/NotificationIndicator", - "./src/NotificationService", - "./res/notification-indicator.html" + "./src/NotificationService" ], function ( - NotificationIndicatorController, - NotificationIndicator, - NotificationService, - notificationIndicatorTemplate + NotificationService ) { return { name:"platform/commonUI/notification", definition: { "extensions": { - "templates": [ - { - "key": "notificationIndicatorTemplate", - "template": notificationIndicatorTemplate - } - ], - "controllers": [ - { - "key": "NotificationIndicatorController", - "implementation": NotificationIndicatorController, - "depends": [ - "$scope", - "openmct", - "dialogService" - ] - } - ], - "indicators": [ - { - "implementation": NotificationIndicator, - "priority": "fallback" - } - ], "services": [ { "key": "notificationService", diff --git a/platform/commonUI/notification/res/notification-indicator.html b/platform/commonUI/notification/res/notification-indicator.html deleted file mode 100644 index 75ec9be553..0000000000 --- a/platform/commonUI/notification/res/notification-indicator.html +++ /dev/null @@ -1,8 +0,0 @@ - -
- - - {{notifications.length}} -
diff --git a/platform/commonUI/notification/src/NotificationIndicatorController.js b/platform/commonUI/notification/src/NotificationIndicatorController.js deleted file mode 100644 index ced8b5b87e..0000000000 --- a/platform/commonUI/notification/src/NotificationIndicatorController.js +++ /dev/null @@ -1,73 +0,0 @@ -/***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government - * as represented by the Administrator of the National Aeronautics and Space - * Administration. All rights reserved. - * - * Open MCT is licensed under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * Open MCT includes source code licensed under additional open source - * licenses. See the Open Source Licenses file (LICENSES.md) included with - * this source code distribution or the Licensing information page available - * at runtime from the About dialog for additional information. - *****************************************************************************/ - -define( - [], - function () { - - /** - * Provides an indicator that is visible when there are - * banner notifications that have been minimized. Will also indicate - * the number of notifications. Notifications can be viewed by - * clicking on the indicator to launch a dialog showing a list of - * notifications. - * @param $scope - * @param notificationService - * @param dialogService - * @constructor - */ - function NotificationIndicatorController($scope, openmct, dialogService) { - $scope.notifications = openmct.notifications.notifications; - $scope.highest = openmct.notifications.highest; - - /** - * Launch a dialog showing a list of current notifications. - */ - $scope.showNotificationsList = function () { - let notificationsList = openmct.notifications.notifications.map(notification => { - if (notification.model.severity === 'alert' || notification.model.severity === 'info') { - notification.model.primaryOption = { - label: 'Dismiss', - callback: () => { - let currentIndex = notificationsList.indexOf(notification); - notification.dismiss(); - notificationsList.splice(currentIndex, 1); - } - } - } - return notification; - }) - dialogService.getDialogResponse('overlay-message-list', { - dialog: { - title: "Messages", - //Launch the message list dialog with the models - // from the notifications - messages: notificationsList - } - }); - - }; - } - return NotificationIndicatorController; - } -); - diff --git a/platform/commonUI/notification/test/NotificationIndicatorControllerSpec.js b/platform/commonUI/notification/test/NotificationIndicatorControllerSpec.js deleted file mode 100644 index 9fe5ffb325..0000000000 --- a/platform/commonUI/notification/test/NotificationIndicatorControllerSpec.js +++ /dev/null @@ -1,60 +0,0 @@ -/***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government - * as represented by the Administrator of the National Aeronautics and Space - * Administration. All rights reserved. - * - * Open MCT is licensed under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * Open MCT includes source code licensed under additional open source - * licenses. See the Open Source Licenses file (LICENSES.md) included with - * this source code distribution or the Licensing information page available - * at runtime from the About dialog for additional information. - *****************************************************************************/ - -define( - ['../src/NotificationIndicatorController'], - function (NotificationIndicatorController) { - - xdescribe("The notification indicator controller ", function () { - var mockNotificationService, - mockScope, - mockDialogService, - controller; - - beforeEach(function () { - mockNotificationService = jasmine.createSpy("notificationService"); - mockScope = jasmine.createSpy("$scope"); - mockDialogService = jasmine.createSpyObj( - "dialogService", - ["getDialogResponse","dismiss"] - ); - mockNotificationService.highest = { - severity: "error" - }; - controller = new NotificationIndicatorController(mockScope, mockNotificationService, mockDialogService); - }); - - it("exposes the highest notification severity to the template", function () { - expect(mockScope.highest).toBeTruthy(); - expect(mockScope.highest.severity).toBe("error"); - }); - - it("invokes the dialog service to show list of messages", function () { - expect(mockScope.showNotificationsList).toBeDefined(); - mockScope.showNotificationsList(); - expect(mockDialogService.getDialogResponse).toHaveBeenCalled(); - expect(mockDialogService.getDialogResponse.calls.mostRecent().args[0]).toBe('overlay-message-list'); - expect(mockDialogService.getDialogResponse.calls.mostRecent().args[1].dialog).toBeDefined(); - }); - }); - } -); diff --git a/platform/containment/src/PersistableCompositionPolicy.js b/platform/containment/src/PersistableCompositionPolicy.js index 0a1b3c9aa9..df9d228222 100644 --- a/platform/containment/src/PersistableCompositionPolicy.js +++ b/platform/containment/src/PersistableCompositionPolicy.js @@ -26,7 +26,7 @@ * @namespace platform/containment */ define( - ['../../../src/api/objects/object-utils'], + ['objectUtils'], function (objectUtils) { function PersistableCompositionPolicy(openmct) { diff --git a/platform/core/src/actions/ActionCapability.js b/platform/core/src/actions/ActionCapability.js index 3fa38e3820..0506711959 100644 --- a/platform/core/src/actions/ActionCapability.js +++ b/platform/core/src/actions/ActionCapability.js @@ -81,7 +81,7 @@ define( baseContext = context || {}; } - var actionContext = _.extend({}, baseContext); + var actionContext = Object.assign({}, baseContext); actionContext.domainObject = this.domainObject; return this.actionService.getActions(actionContext); diff --git a/platform/import-export/src/actions/ExportAsJSONAction.js b/platform/import-export/src/actions/ExportAsJSONAction.js index a0b37c054f..48156ebbfd 100644 --- a/platform/import-export/src/actions/ExportAsJSONAction.js +++ b/platform/import-export/src/actions/ExportAsJSONAction.js @@ -121,7 +121,7 @@ define(['lodash'], function (_) { */ ExportAsJSONAction.prototype.rewriteLink = function (child, parent) { this.externalIdentifiers.push(this.getId(child)); - var index = _.findIndex(parent.composition, function (id) { + var index = parent.composition.findIndex(id => { return _.isEqual(child.identifier, id); }); var copyOfChild = this.copyObject(child); diff --git a/platform/import-export/src/actions/ImportAsJSONAction.js b/platform/import-export/src/actions/ImportAsJSONAction.js index 8411d12dad..40dd338e15 100644 --- a/platform/import-export/src/actions/ImportAsJSONAction.js +++ b/platform/import-export/src/actions/ImportAsJSONAction.js @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -define(['zepto', '../../../../src/api/objects/object-utils.js'], function ($, objectUtils) { +define(['zepto', 'objectUtils'], function ($, objectUtils) { /** * The ImportAsJSONAction is available from context menus and allows a user diff --git a/platform/search/src/services/GenericSearchProvider.js b/platform/search/src/services/GenericSearchProvider.js index 5bfebe24e9..1a6399440f 100644 --- a/platform/search/src/services/GenericSearchProvider.js +++ b/platform/search/src/services/GenericSearchProvider.js @@ -25,7 +25,7 @@ * Module defining GenericSearchProvider. Created by shale on 07/16/2015. */ define([ - '../../../../src/api/objects/object-utils', + 'objectUtils', 'lodash' ], function ( objectUtils, @@ -191,7 +191,7 @@ define([ } var domainObject = objectUtils.toNewFormat(model, id); - var composition = _.find(this.openmct.composition.registry, function (p) { + var composition = this.openmct.composition.registry.find(p => { return p.appliesTo(domainObject); }); diff --git a/platform/telemetry/src/TelemetryCapability.js b/platform/telemetry/src/TelemetryCapability.js index c5ac36cd3d..66d4f8cc8a 100644 --- a/platform/telemetry/src/TelemetryCapability.js +++ b/platform/telemetry/src/TelemetryCapability.js @@ -25,7 +25,7 @@ */ define( [ - '../../../src/api/objects/object-utils', + 'objectUtils', 'lodash' ], function ( @@ -235,7 +235,7 @@ define( var defaultRange = metadata.valuesForHints(['range'])[0]; defaultRange = defaultRange ? defaultRange.key : undefined; - var sourceMap = _.indexBy(metadata.values(), 'key'); + var sourceMap = _.keyBy(metadata.values(), 'key'); var isLegacyProvider = telemetryAPI.findRequestProvider(domainObject) === telemetryAPI.legacyProvider; @@ -300,7 +300,7 @@ define( var defaultRange = metadata.valuesForHints(['range'])[0]; defaultRange = defaultRange ? defaultRange.key : undefined; - var sourceMap = _.indexBy(metadata.values(), 'key'); + var sourceMap = _.keyBy(metadata.values(), 'key'); var isLegacyProvider = telemetryAPI.findSubscriptionProvider(domainObject) === telemetryAPI.legacyProvider; diff --git a/report.20200527.134750.93992.001.json b/report.20200527.134750.93992.001.json new file mode 100644 index 0000000000..d9515d66d7 --- /dev/null +++ b/report.20200527.134750.93992.001.json @@ -0,0 +1,621 @@ + +{ + "header": { + "event": "Allocation failed - JavaScript heap out of memory", + "location": "OnFatalError", + "filename": "report.20200527.134750.93992.001.json", + "dumpEventTime": "2020-05-27T13:47:50Z", + "dumpEventTimeStamp": "1590612470877", + "processId": 93992, + "commandLine": [ + "node", + "/Users/dtailor/Desktop/openmct/node_modules/.bin/karma", + "start", + "--single-run" + ], + "nodejsVersion": "v11.9.0", + "wordSize": 64, + "componentVersions": { + "node": "11.9.0", + "v8": "7.0.276.38-node.16", + "uv": "1.25.0", + "zlib": "1.2.11", + "brotli": "1.0.7", + "ares": "1.15.0", + "modules": "67", + "nghttp2": "1.34.0", + "napi": "4", + "llhttp": "1.0.1", + "http_parser": "2.8.0", + "openssl": "1.1.1a", + "cldr": "34.0", + "icu": "63.1", + "tz": "2018e", + "unicode": "11.0", + "arch": "x64", + "platform": "darwin", + "release": "node" + }, + "osVersion": "Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jan 23 06:52:12 PST 2020; root:xnu-4903.278.25~1/RELEASE_X86_64", + "machine": "Darwin 18.7.0 Darwin Kernel Version 18.7.0: Thu Jan 23 06:52:12 PST 2020; root:xnu-4903.278.25~1/RELEASE_X86_64tailor x86_64" + }, + "javascriptStack": { + "message": "No stack.", + "stack": [ + "Unavailable." + ] + }, + "nativeStack": [ + " [pc=0x10013090e] report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::__1::basic_string, std::__1::allocator >, v8::Local) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x100063744] node::OnFatalError(char const*, char const*) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1001a8c47] v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1001a8be4] v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1005add42] v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1005b0273] v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1005ac7a8] v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1005aa965] v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1005b720c] v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1005b728f] v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x100586484] v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x1008389a4] v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node]", + " [pc=0x14acfddcfc7d] " + ], + "javascriptHeap": { + "totalMemory": 1479229440, + "totalCommittedMemory": 1477309024, + "usedMemory": 1445511032, + "availableMemory": 50296592, + "memoryLimit": 1526909922, + "heapSpaces": { + "read_only_space": { + "memorySize": 524288, + "committedMemory": 42224, + "capacity": 515584, + "used": 33520, + "available": 482064 + }, + "new_space": { + "memorySize": 4194304, + "committedMemory": 4194288, + "capacity": 2062336, + "used": 59016, + "available": 2003320 + }, + "old_space": { + "memorySize": 305860608, + "committedMemory": 305138544, + "capacity": 283264904, + "used": 282942208, + "available": 322696 + }, + "code_space": { + "memorySize": 6291456, + "committedMemory": 5687328, + "capacity": 5237152, + "used": 5237152, + "available": 0 + }, + "map_space": { + "memorySize": 5255168, + "committedMemory": 5143024, + "capacity": 2523280, + "used": 2523280, + "available": 0 + }, + "large_object_space": { + "memorySize": 1157103616, + "committedMemory": 1157103616, + "capacity": 1202204368, + "used": 1154715856, + "available": 47488512 + }, + "new_large_object_space": { + "memorySize": 0, + "committedMemory": 0, + "capacity": 0, + "used": 0, + "available": 0 + } + } + }, + "resourceUsage": { + "userCpuSeconds": 43.1616, + "kernelCpuSeconds": 43.1616, + "cpuConsumptionPercent": 5.42705e-06, + "maxRss": 1966080000000, + "pageFaults": { + "IORequired": 245, + "IONotRequired": 832598 + }, + "fsActivity": { + "reads": 0, + "writes": 0 + } + }, + "libuv": [ + ], + "environmentVariables": { + "npm_config_save_dev": "", + "npm_config_legacy_bundling": "", + "npm_config_dry_run": "", + "npm_package_devDependencies_markdown_toc": "^0.11.7", + "npm_config_only": "", + "npm_config_browser": "", + "npm_config_viewer": "man", + "npm_config_commit_hooks": "true", + "npm_package_gitHead": "7126abe7ec1d66d3252f3598fbd6bd27217018bc", + "npm_config_also": "", + "npm_package_scripts_otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'", + "npm_package_devDependencies_minimist": "^1.1.1", + "npm_config_sign_git_commit": "", + "npm_config_rollback": "true", + "npm_package_devDependencies_fast_sass_loader": "1.4.6", + "TERM_PROGRAM": "Apple_Terminal", + "npm_config_usage": "", + "npm_config_audit": "true", + "npm_package_devDependencies_git_rev_sync": "^1.4.0", + "npm_package_devDependencies_file_loader": "^1.1.11", + "npm_package_devDependencies_d3_selection": "1.3.x", + "NODE": "/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node", + "npm_package_homepage": "https://github.com/nasa/openmct#readme", + "INIT_CWD": "/Users/dtailor/Desktop/openmct", + "NVM_CD_FLAGS": "", + "npm_config_globalignorefile": "/Users/dtailor/.nvm/versions/node/v11.9.0/etc/npmignore", + "npm_package_devDependencies_comma_separated_values": "^3.6.4", + "SHELL": "/bin/bash", + "TERM": "xterm-256color", + "npm_config_init_author_url": "", + "npm_config_shell": "/bin/bash", + "npm_config_maxsockets": "50", + "npm_package_devDependencies_vue_template_compiler": "2.5.6", + "npm_package_devDependencies_style_loader": "^1.0.1", + "npm_package_devDependencies_moment_duration_format": "^2.2.2", + "npm_config_parseable": "", + "npm_config_shrinkwrap": "true", + "npm_config_metrics_registry": "https://registry.npmjs.org/", + "TMPDIR": "/var/folders/ks/ytghmh9x4lj3cchr5km5lhkcb7v9y2/T/", + "npm_config_timing": "", + "npm_config_init_license": "ISC", + "npm_package_scripts_lint": "eslint platform example src --ext .js,.vue openmct.js", + "npm_package_devDependencies_d3_array": "1.2.x", + "Apple_PubSub_Socket_Render": "/private/tmp/com.apple.launchd.PsV6Dfq4Tm/Render", + "npm_config_if_present": "", + "npm_package_devDependencies_concurrently": "^3.6.1", + "TERM_PROGRAM_VERSION": "421.2", + "npm_package_scripts_jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api", + "npm_config_sign_git_tag": "", + "npm_config_init_author_email": "", + "npm_config_cache_max": "Infinity", + "npm_config_preid": "", + "npm_config_long": "", + "npm_config_local_address": "", + "npm_config_cert": "", + "npm_config_git_tag_version": "true", + "npm_package_devDependencies_exports_loader": "^0.7.0", + "TERM_SESSION_ID": "0630D2FA-BAC2-48D3-A21D-9AB58A79FB14", + "npm_config_noproxy": "", + "npm_config_registry": "https://registry.npmjs.org/", + "npm_config_fetch_retries": "2", + "npm_package_private": "true", + "npm_package_devDependencies_karma_jasmine": "^1.1.2", + "npm_package_repository_url": "git+https://github.com/nasa/openmct.git", + "npm_config_versions": "", + "npm_config_key": "", + "npm_config_message": "%s", + "npm_package_readmeFilename": "README.md", + "npm_package_devDependencies_painterro": "^0.2.65", + "npm_package_scripts_verify": "concurrently 'npm:test' 'npm:lint'", + "npm_package_devDependencies_webpack": "^4.16.2", + "npm_package_devDependencies_eventemitter3": "^1.2.0", + "npm_package_description": "The Open MCT core platform", + "USER": "dtailor", + "NVM_DIR": "/Users/dtailor/.nvm", + "npm_package_license": "Apache-2.0", + "npm_package_scripts_build_dev": "webpack", + "npm_package_devDependencies_webpack_cli": "^3.1.0", + "npm_package_devDependencies_location_bar": "^3.0.1", + "npm_package_devDependencies_jasmine_core": "^3.1.0", + "npm_config_globalconfig": "/Users/dtailor/.nvm/versions/node/v11.9.0/etc/npmrc", + "npm_package_devDependencies_karma": "^2.0.3", + "npm_config_prefer_online": "", + "npm_config_always_auth": "", + "npm_config_logs_max": "10", + "npm_package_devDependencies_angular": "1.7.9", + "SSH_AUTH_SOCK": "/private/tmp/com.apple.launchd.JH8E4KgH06/Listeners", + "npm_package_devDependencies_request": "^2.69.0", + "npm_package_devDependencies_eslint": "5.2.0", + "__CF_USER_TEXT_ENCODING": "0x167DA7C2:0x0:0x0", + "npm_execpath": "/Users/dtailor/.nvm/versions/node/v11.9.0/lib/node_modules/npm/bin/npm-cli.js", + "npm_config_global_style": "", + "npm_config_cache_lock_retries": "10", + "npm_config_cafile": "", + "npm_config_update_notifier": "true", + "npm_package_scripts_test_debug": "cross-env NODE_ENV=debug karma start --no-single-run", + "npm_package_devDependencies_glob": ">= 3.0.0", + "npm_config_heading": "npm", + "npm_config_audit_level": "low", + "npm_package_devDependencies_mini_css_extract_plugin": "^0.4.1", + "npm_package_devDependencies_copy_webpack_plugin": "^4.5.2", + "npm_config_read_only": "", + "npm_config_offline": "", + "npm_config_searchlimit": "20", + "npm_config_fetch_retry_mintimeout": "10000", + "npm_package_devDependencies_webpack_dev_middleware": "^3.1.3", + "npm_config_json": "", + "npm_config_access": "", + "npm_config_argv": "{\"remain\":[],\"cooked\":[\"run\",\"test\"],\"original\":[\"run\",\"test\"]}", + "npm_package_scripts_lint_fix": "eslint platform example src --ext .js,.vue openmct.js --fix", + "npm_package_devDependencies_uuid": "^3.3.3", + "npm_package_devDependencies_karma_coverage": "^1.1.2", + "PATH": "/Users/dtailor/.nvm/versions/node/v11.9.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/dtailor/Desktop/openmct/node_modules/.bin:/Users/dtailor/.nvm/versions/node/v11.9.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/dtailor/Desktop/openmct/node_modules/.bin:/Users/dtailor/.nvm/versions/node/v11.9.0/bin:/Users/dtailor/.homebrew/bin:/Users/dtailor/local/bin:/Users/dtailor/.homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/dtailor/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/opt/local/bin:/Users/dtailor/.homebrew/bin:/Users/dtailor/.homebrew/bin:/Users/dtailor/.homebrew/bin:/Users/dtailor/local/bin:/Users/dtailor/.homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin", + "npm_config_allow_same_version": "", + "npm_config_https_proxy": "", + "npm_config_engine_strict": "", + "npm_config_description": "true", + "npm_package_devDependencies_html2canvas": "^1.0.0-alpha.12", + "_": "/Users/dtailor/Desktop/openmct/node_modules/.bin/karma", + "npm_config_userconfig": "/Users/dtailor/.npmrc", + "npm_config_init_module": "/Users/dtailor/.npm-init.js", + "npm_package_author": "", + "npm_package_devDependencies_karma_chrome_launcher": "^2.2.0", + "npm_package_devDependencies_d3_scale": "1.0.x", + "npm_config_cidr": "", + "npm_package_devDependencies_printj": "^1.2.1", + "PWD": "/Users/dtailor/Desktop/openmct", + "npm_config_user": "377333698", + "npm_config_node_version": "11.9.0", + "npm_package_bugs_url": "https://github.com/nasa/openmct/issues", + "npm_package_scripts_test_watch": "karma start --no-single-run", + "npm_lifecycle_event": "test", + "npm_package_devDependencies_v8_compile_cache": "^1.1.0", + "npm_config_ignore_prepublish": "", + "npm_config_save": "true", + "npm_config_editor": "vi", + "npm_config_auth_type": "legacy", + "npm_package_repository_type": "git", + "npm_package_devDependencies_vue": "2.5.6", + "npm_package_devDependencies_marked": "^0.3.5", + "npm_package_devDependencies_angular_route": "1.4.14", + "npm_package_name": "openmct", + "LANG": "en_US.UTF-8", + "npm_config_script_shell": "", + "npm_config_tag": "latest", + "npm_config_global": "", + "npm_config_progress": "true", + "npm_package_scripts_start": "node app.js", + "npm_package_devDependencies_karma_coverage_istanbul_reporter": "^2.1.1", + "npm_config_ham_it_up": "", + "npm_config_searchstaleness": "900", + "npm_config_optional": "true", + "npm_package_scripts_docs": "npm run jsdoc ; npm run otherdoc", + "npm_package_devDependencies_istanbul_instrumenter_loader": "^3.0.1", + "XPC_FLAGS": "0x0", + "npm_config_save_prod": "", + "npm_config_force": "", + "npm_config_bin_links": "true", + "npm_package_devDependencies_moment": "2.25.3", + "npm_package_devDependencies_karma_webpack": "^3.0.0", + "npm_package_devDependencies_express": "^4.13.1", + "npm_config_searchopts": "", + "npm_package_devDependencies_d3_time": "1.0.x", + "FORCE_COLOR": "2", + "npm_config_node_gyp": "/Users/dtailor/.nvm/versions/node/v11.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js", + "npm_config_depth": "Infinity", + "npm_package_scripts_build_prod": "cross-env NODE_ENV=production webpack", + "npm_config_sso_poll_frequency": "500", + "npm_config_rebuild_bundle": "true", + "npm_package_version": "1.0.0-snapshot", + "XPC_SERVICE_NAME": "0", + "npm_config_unicode": "true", + "npm_package_devDependencies_jsdoc": "^3.3.2", + "SHLVL": "4", + "HOME": "/Users/dtailor", + "npm_config_fetch_retry_maxtimeout": "60000", + "npm_package_scripts_test": "karma start --single-run", + "npm_package_devDependencies_zepto": "^1.2.0", + "npm_package_devDependencies_eslint_plugin_vue": "^6.0.0", + "npm_config_ca": "", + "npm_config_tag_version_prefix": "v", + "npm_config_strict_ssl": "true", + "npm_config_sso_type": "oauth", + "npm_config_scripts_prepend_node_path": "warn-only", + "npm_config_save_prefix": "^", + "npm_config_loglevel": "notice", + "npm_package_devDependencies_lodash": "^3.10.1", + "npm_package_devDependencies_karma_cli": "^1.0.1", + "npm_package_devDependencies_d3_color": "1.0.x", + "npm_config_save_exact": "", + "npm_config_dev": "", + "npm_config_group": "1286109195", + "npm_config_fetch_retry_factor": "10", + "npm_package_devDependencies_webpack_hot_middleware": "^2.22.3", + "npm_package_devDependencies_cross_env": "^6.0.3", + "npm_package_devDependencies_babel_eslint": "8.2.6", + "HOMEBREW_PREFIX": "/Users/dtailor/.homebrew", + "npm_config_version": "", + "npm_config_prefer_offline": "", + "npm_config_cache_lock_stale": "60000", + "npm_config_otp": "", + "npm_config_cache_min": "10", + "npm_package_devDependencies_vue_loader": "^15.2.6", + "npm_config_searchexclude": "", + "npm_config_cache": "/Users/dtailor/.npm", + "npm_package_scripts_test_coverage": "./scripts/test-coverage.sh", + "npm_package_devDependencies_d3_interpolate": "1.1.x", + "npm_package_devDependencies_d3_format": "1.2.x", + "LOGNAME": "dtailor", + "npm_lifecycle_script": "karma start --single-run", + "npm_config_color": "true", + "npm_package_devDependencies_node_bourbon": "^4.2.3", + "npm_package_devDependencies_karma_sourcemap_loader": "^0.3.7", + "npm_package_devDependencies_karma_html_reporter": "^0.2.7", + "npm_config_proxy": "", + "npm_config_package_lock": "true", + "npm_package_devDependencies_d3_time_format": "2.1.x", + "npm_package_devDependencies_d3_axis": "1.0.x", + "npm_config_package_lock_only": "", + "npm_package_devDependencies_moment_timezone": "0.5.28", + "npm_config_save_optional": "", + "NVM_BIN": "/Users/dtailor/.nvm/versions/node/v11.9.0/bin", + "npm_config_ignore_scripts": "", + "npm_config_user_agent": "npm/6.5.0 node/v11.9.0 darwin x64", + "npm_package_devDependencies_imports_loader": "^0.8.0", + "npm_package_devDependencies_file_saver": "^1.3.8", + "npm_config_cache_lock_wait": "10000", + "npm_config_production": "", + "npm_package_scripts_build_watch": "webpack --watch", + "DISPLAY": "/private/tmp/com.apple.launchd.E3N8oC6RMf/org.macosforge.xquartz:0", + "npm_config_send_metrics": "", + "npm_config_save_bundle": "", + "npm_package_scripts_prepare": "npm run build:prod", + "npm_config_node_options": "", + "npm_config_umask": "0022", + "npm_config_init_version": "1.0.0", + "npm_package_devDependencies_split": "^1.0.0", + "npm_package_devDependencies_raw_loader": "^0.5.1", + "npm_config_init_author_name": "", + "npm_config_git": "git", + "npm_config_scope": "", + "npm_package_scripts_clean": "rm -rf ./dist", + "npm_package_devDependencies_node_sass": "^4.9.2", + "npm_package_devDependencies_css_loader": "^1.0.0", + "DISABLE_UPDATE_CHECK": "1", + "npm_config_onload_script": "", + "npm_config_unsafe_perm": "true", + "npm_config_tmp": "/var/folders/ks/ytghmh9x4lj3cchr5km5lhkcb7v9y2/T", + "npm_package_devDependencies_d3_collection": "1.0.x", + "npm_node_execpath": "/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node", + "npm_config_link": "", + "npm_config_prefix": "/Users/dtailor/.nvm/versions/node/v11.9.0", + "npm_package_devDependencies_html_loader": "^0.5.5" + }, + "userLimits": { + "core_file_size_blocks": { + "soft": 0, + "hard": "unlimited" + }, + "data_seg_size_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "file_size_blocks": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_locked_memory_bytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_memory_size_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "open_files": { + "soft": 24576, + "hard": "unlimited" + }, + "stack_size_bytes": { + "soft": 8388608, + "hard": 67104768 + }, + "cpu_time_seconds": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_user_processes": { + "soft": 1418, + "hard": 2128 + }, + "virtual_memory_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + } + }, + "sharedObjects": [ + "/Users/dtailor/.nvm/versions/node/v11.9.0/bin/node", + "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation", + "/usr/lib/libSystem.B.dylib", + "/usr/lib/libc++.1.dylib", + "/usr/lib/libobjc.A.dylib", + "/usr/lib/libDiagnosticMessagesClient.dylib", + "/usr/lib/libicucore.A.dylib", + "/usr/lib/libz.1.dylib", + "/usr/lib/libc++abi.dylib", + "/usr/lib/system/libcache.dylib", + "/usr/lib/system/libcommonCrypto.dylib", + "/usr/lib/system/libcompiler_rt.dylib", + "/usr/lib/system/libcopyfile.dylib", + "/usr/lib/system/libcorecrypto.dylib", + "/usr/lib/system/libdispatch.dylib", + "/usr/lib/system/libdyld.dylib", + "/usr/lib/system/libkeymgr.dylib", + "/usr/lib/system/liblaunch.dylib", + "/usr/lib/system/libmacho.dylib", + "/usr/lib/system/libquarantine.dylib", + "/usr/lib/system/libremovefile.dylib", + "/usr/lib/system/libsystem_asl.dylib", + "/usr/lib/system/libsystem_blocks.dylib", + "/usr/lib/system/libsystem_c.dylib", + "/usr/lib/system/libsystem_configuration.dylib", + "/usr/lib/system/libsystem_coreservices.dylib", + "/usr/lib/system/libsystem_darwin.dylib", + "/usr/lib/system/libsystem_dnssd.dylib", + "/usr/lib/system/libsystem_info.dylib", + "/usr/lib/system/libsystem_m.dylib", + "/usr/lib/system/libsystem_malloc.dylib", + "/usr/lib/system/libsystem_networkextension.dylib", + "/usr/lib/system/libsystem_notify.dylib", + "/usr/lib/system/libsystem_sandbox.dylib", + "/usr/lib/system/libsystem_secinit.dylib", + "/usr/lib/system/libsystem_kernel.dylib", + "/usr/lib/system/libsystem_platform.dylib", + "/usr/lib/system/libsystem_pthread.dylib", + "/usr/lib/system/libsystem_symptoms.dylib", + "/usr/lib/system/libsystem_trace.dylib", + "/usr/lib/system/libunwind.dylib", + "/usr/lib/system/libxpc.dylib", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices", + "/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics", + "/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText", + "/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO", + "/System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis", + "/System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight", + "/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface", + "/usr/lib/libxml2.2.dylib", + "/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate", + "/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation", + "/usr/lib/libcompression.dylib", + "/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration", + "/System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay", + "/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit", + "/System/Library/Frameworks/Metal.framework/Versions/A/Metal", + "/System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders", + "/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport", + "/System/Library/Frameworks/Security.framework/Versions/A/Security", + "/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore", + "/usr/lib/libbsm.0.dylib", + "/usr/lib/liblzma.5.dylib", + "/usr/lib/libauto.dylib", + "/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration", + "/usr/lib/libarchive.2.dylib", + "/usr/lib/liblangid.dylib", + "/usr/lib/libCRFSuite.dylib", + "/usr/lib/libenergytrace.dylib", + "/usr/lib/system/libkxld.dylib", + "/System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression", + "/usr/lib/libOpenScriptingUtil.dylib", + "/usr/lib/libcoretls.dylib", + "/usr/lib/libcoretls_cfhelpers.dylib", + "/usr/lib/libpam.2.dylib", + "/usr/lib/libsqlite3.dylib", + "/usr/lib/libxar.1.dylib", + "/usr/lib/libbz2.1.0.dylib", + "/usr/lib/libnetwork.dylib", + "/usr/lib/libapple_nghttp2.dylib", + "/usr/lib/libpcap.A.dylib", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices", + "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList", + "/System/Library/Frameworks/NetFS.framework/Versions/A/NetFS", + "/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth", + "/System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport", + "/System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC", + "/System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP", + "/System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities", + "/usr/lib/libmecabra.dylib", + "/usr/lib/libmecab.1.0.0.dylib", + "/usr/lib/libgermantok.dylib", + "/usr/lib/libThaiTokenizer.dylib", + "/usr/lib/libChineseTokenizer.dylib", + "/usr/lib/libiconv.2.dylib", + "/usr/lib/libcharset.1.dylib", + "/System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling", + "/System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji", + "/System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon", + "/System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData", + "/usr/lib/libcmph.dylib", + "/System/Library/Frameworks/CoreData.framework/Versions/A/CoreData", + "/System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory", + "/System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS", + "/usr/lib/libutil.dylib", + "/System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement", + "/System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement", + "/usr/lib/libxslt.1.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib", + "/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib", + "/System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler", + "/System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator", + "/System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment", + "/System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay", + "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib", + "/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Versions/A/MPSCore", + "/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSImage.framework/Versions/A/MPSImage", + "/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork", + "/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix", + "/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector", + "/System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools", + "/System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary", + "/usr/lib/libMobileGestalt.dylib", + "/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage", + "/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo", + "/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL", + "/System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer", + "/System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore", + "/System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL", + "/usr/lib/libFosl_dynamic.dylib", + "/System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib", + "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib", + "/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib", + "/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib", + "/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib", + "/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib", + "/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib", + "/System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib", + "/System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG", + "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib", + "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib", + "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib", + "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib", + "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib", + "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib", + "/usr/lib/libcups.2.dylib", + "/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos", + "/System/Library/Frameworks/GSS.framework/Versions/A/GSS", + "/usr/lib/libresolv.9.dylib", + "/System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal", + "/usr/lib/libheimdal-asn1.dylib", + "/System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory", + "/System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth", + "/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation", + "/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio", + "/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox", + "/System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce", + "/System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices", + "/System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard" + ] +} \ No newline at end of file diff --git a/src/MCT.js b/src/MCT.js index f7eb9db14d..4ea629f5c2 100644 --- a/src/MCT.js +++ b/src/MCT.js @@ -28,7 +28,7 @@ define([ './api/api', './api/overlays/OverlayAPI', './selection/Selection', - './api/objects/object-utils', + 'objectUtils', './plugins/plugins', './adapter/indicators/legacy-indicators-plugin', './plugins/buildInfo/plugin', @@ -249,7 +249,7 @@ define([ this.legacyRegistry = new BundleRegistry(); installDefaultBundles(this.legacyRegistry); - // Plugin's that are installed by default + // Plugins that are installed by default this.install(this.plugins.Plot()); this.install(this.plugins.TelemetryTable()); @@ -266,6 +266,7 @@ define([ this.install(this.plugins.WebPage()); this.install(this.plugins.Condition()); this.install(this.plugins.ConditionWidget()); + this.install(this.plugins.NotificationIndicator()); } MCT.prototype = Object.create(EventEmitter.prototype); @@ -350,17 +351,13 @@ 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) { + MCT.prototype.start = function (domElement = document.body, isHeadlessMode = false) { if (!this.plugins.DisplayLayout._installed) { this.install(this.plugins.DisplayLayout({ showAsView: ['summary-widget'] })); } - if (!domElement) { - domElement = document.body; - } - this.element = domElement; this.legacyExtension('runs', { @@ -400,24 +397,31 @@ define([ // something has depended upon objectService. Cool, right? this.$injector.get('objectService'); - var appLayout = new Vue({ - components: { - 'Layout': Layout.default - }, - provide: { - openmct: this - }, - template: '' - }); - domElement.appendChild(appLayout.$mount().$el); + if (!isHeadlessMode) { + var appLayout = new Vue({ + components: { + 'Layout': Layout.default + }, + provide: { + openmct: this + }, + template: '' + }); + domElement.appendChild(appLayout.$mount().$el); - this.layout = appLayout.$refs.layout; - Browse(this); + this.layout = appLayout.$refs.layout; + Browse(this); + } this.router.start(); this.emit('start'); }.bind(this)); }; + MCT.prototype.startHeadless = function () { + let unreachableNode = document.createElement('div'); + return this.start(unreachableNode, true); + } + /** * Install a plugin in MCT. * diff --git a/src/MCTSpec.js b/src/MCTSpec.js index 4120938629..53417f4314 100644 --- a/src/MCTSpec.js +++ b/src/MCTSpec.js @@ -21,11 +21,11 @@ *****************************************************************************/ define([ - './MCT', './plugins/plugins', - 'legacyRegistry' -], function (MCT, plugins, legacyRegistry) { - xdescribe("MCT", function () { + 'legacyRegistry', + 'testUtils' +], function (plugins, legacyRegistry, testUtils) { + describe("MCT", function () { var openmct; var mockPlugin; var mockPlugin2; @@ -38,7 +38,7 @@ define([ mockListener = jasmine.createSpy('listener'); oldBundles = legacyRegistry.list(); - openmct = new MCT(); + openmct = testUtils.createOpenMct(); openmct.install(mockPlugin); openmct.install(mockPlugin2); @@ -63,8 +63,11 @@ define([ }); describe("start", function () { - beforeEach(function () { - openmct.start(); + let appHolder; + beforeEach(function (done) { + appHolder = document.createElement("div"); + openmct.on('start', done); + openmct.start(appHolder); }); it("calls plugins for configuration", function () { @@ -75,25 +78,51 @@ define([ it("emits a start event", function () { expect(mockListener).toHaveBeenCalled(); }); + + it("Renders the application into the provided container element", function () { + let openMctShellElements = appHolder.querySelectorAll('div.l-shell'); + expect(openMctShellElements.length).toBe(1); + }); + }); + + describe("startHeadless", function () { + beforeEach(function (done) { + openmct.on('start', done); + openmct.startHeadless(); + }); + + it("calls plugins for configuration", function () { + expect(mockPlugin).toHaveBeenCalledWith(openmct); + expect(mockPlugin2).toHaveBeenCalledWith(openmct); + }); + + it("emits a start event", function () { + expect(mockListener).toHaveBeenCalled(); + }); + + it("Does not render Open MCT", function () { + let openMctShellElements = document.body.querySelectorAll('div.l-shell'); + expect(openMctShellElements.length).toBe(0); + }); }); describe("setAssetPath", function () { var testAssetPath; beforeEach(function () { - testAssetPath = "some/path"; openmct.legacyExtension = jasmine.createSpy('legacyExtension'); - openmct.setAssetPath(testAssetPath); }); - it("internally configures the path for assets", function () { - expect(openmct.legacyExtension).toHaveBeenCalledWith( - 'constants', - { - key: "ASSETS_PATH", - value: testAssetPath - } - ); + it("configures the path for assets", function () { + testAssetPath = "some/path/"; + openmct.setAssetPath(testAssetPath); + expect(openmct.getAssetPath()).toBe(testAssetPath); + }); + + it("adds a trailing /", function () { + testAssetPath = "some/path"; + openmct.setAssetPath(testAssetPath); + expect(openmct.getAssetPath()).toBe(testAssetPath + "/"); }); }); }); diff --git a/src/adapter/actions/ActionDialogDecorator.js b/src/adapter/actions/ActionDialogDecorator.js index c4d38b180e..bd6b2d01fb 100644 --- a/src/adapter/actions/ActionDialogDecorator.js +++ b/src/adapter/actions/ActionDialogDecorator.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - '../../api/objects/object-utils' + 'objectUtils' ], function (objectUtils) { function ActionDialogDecorator(mct, actionService) { this.mct = mct; diff --git a/src/adapter/capabilities/AdapterCapability.js b/src/adapter/capabilities/AdapterCapability.js index 70db1d87ad..4e51161123 100644 --- a/src/adapter/capabilities/AdapterCapability.js +++ b/src/adapter/capabilities/AdapterCapability.js @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define(['../../api/objects/object-utils'], function (objectUtils) { +define(['objectUtils'], function (objectUtils) { function AdapterCapability(domainObject) { this.domainObject = domainObject; } diff --git a/src/adapter/capabilities/AlternateCompositionCapability.js b/src/adapter/capabilities/AlternateCompositionCapability.js index a8e3f7d829..7670ae899f 100644 --- a/src/adapter/capabilities/AlternateCompositionCapability.js +++ b/src/adapter/capabilities/AlternateCompositionCapability.js @@ -24,7 +24,7 @@ * Module defining AlternateCompositionCapability. Created by vwoeltje on 11/7/14. */ define([ - '../../api/objects/object-utils', + 'objectUtils', '../../../platform/core/src/capabilities/ContextualDomainObject' ], function (objectUtils, ContextualDomainObject) { function AlternateCompositionCapability($injector, domainObject) { diff --git a/src/adapter/capabilities/patchViewCapability.js b/src/adapter/capabilities/patchViewCapability.js index 48f1081e03..f8f7a13cd2 100644 --- a/src/adapter/capabilities/patchViewCapability.js +++ b/src/adapter/capabilities/patchViewCapability.js @@ -31,6 +31,7 @@ define([ var capability = viewConstructor(domainObject); var oldInvoke = capability.invoke.bind(capability); + /* eslint-disable you-dont-need-lodash-underscore/map */ capability.invoke = function () { var availableViews = oldInvoke(); var newDomainObject = capability @@ -52,6 +53,8 @@ define([ .map('view') .value(); }; + /* eslint-enable you-dont-need-lodash-underscore/map */ + return capability; }; } diff --git a/src/adapter/runs/AlternateCompositionInitializer.js b/src/adapter/runs/AlternateCompositionInitializer.js index e73f33114e..ea4222ed51 100644 --- a/src/adapter/runs/AlternateCompositionInitializer.js +++ b/src/adapter/runs/AlternateCompositionInitializer.js @@ -22,7 +22,7 @@ define([ '../capabilities/AlternateCompositionCapability', - '../../api/objects/object-utils' + 'objectUtils' ], function ( AlternateCompositionCapability, objectUtils diff --git a/src/adapter/runs/LegacyTelemetryProvider.js b/src/adapter/runs/LegacyTelemetryProvider.js index 4387d92f87..5fda222803 100644 --- a/src/adapter/runs/LegacyTelemetryProvider.js +++ b/src/adapter/runs/LegacyTelemetryProvider.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - '../../api/objects/object-utils' + 'objectUtils' ], function ( utils ) { diff --git a/src/adapter/runs/TimeSettingsURLHandler.js b/src/adapter/runs/TimeSettingsURLHandler.js index 34f7ec6986..1806cc66dc 100644 --- a/src/adapter/runs/TimeSettingsURLHandler.js +++ b/src/adapter/runs/TimeSettingsURLHandler.js @@ -78,7 +78,7 @@ define([ }; TimeSettingsURLHandler.prototype.parseQueryParams = function () { - var searchParams = _.pick(this.$location.search(), _.values(SEARCH)); + var searchParams = _.pick(this.$location.search(), Object.values(SEARCH)); var parsedParams = { clock: searchParams[SEARCH.MODE], timeSystem: searchParams[SEARCH.TIME_SYSTEM] diff --git a/src/adapter/services/LegacyObjectAPIInterceptor.js b/src/adapter/services/LegacyObjectAPIInterceptor.js index 5c323c4de5..d71dcd1837 100644 --- a/src/adapter/services/LegacyObjectAPIInterceptor.js +++ b/src/adapter/services/LegacyObjectAPIInterceptor.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - '../../api/objects/object-utils' + 'objectUtils' ], function ( utils ) { diff --git a/src/adapter/services/MissingModelCompatibilityDecorator.js b/src/adapter/services/MissingModelCompatibilityDecorator.js index e9cbd3cb6c..214ebdf1f9 100644 --- a/src/adapter/services/MissingModelCompatibilityDecorator.js +++ b/src/adapter/services/MissingModelCompatibilityDecorator.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - '../../api/objects/object-utils' + 'objectUtils' ], function ( objectUtils ) { diff --git a/src/adapter/views/installLegacyViews.js b/src/adapter/views/installLegacyViews.js index d98796976f..1f8e7639ab 100644 --- a/src/adapter/views/installLegacyViews.js +++ b/src/adapter/views/installLegacyViews.js @@ -1,7 +1,7 @@ define([ './LegacyViewProvider', './TypeInspectorViewProvider', - '../../api/objects/object-utils' + 'objectUtils' ], function ( LegacyViewProvider, TypeInspectorViewProvider, diff --git a/src/api/composition/CompositionAPI.js b/src/api/composition/CompositionAPI.js index ea122c290d..ba3aa55ddf 100644 --- a/src/api/composition/CompositionAPI.js +++ b/src/api/composition/CompositionAPI.js @@ -70,7 +70,7 @@ define([ * @memberof module:openmct.CompositionAPI# */ CompositionAPI.prototype.get = function (domainObject) { - var provider = _.find(this.registry, function (p) { + var provider = this.registry.find(p => { return p.appliesTo(domainObject); }); diff --git a/src/api/composition/CompositionCollection.js b/src/api/composition/CompositionCollection.js index 51c4a986fa..37fc583189 100644 --- a/src/api/composition/CompositionCollection.js +++ b/src/api/composition/CompositionCollection.js @@ -122,7 +122,7 @@ define([ throw new Error('Event not supported by composition: ' + event); } - var index = _.findIndex(this.listeners[event], function (l) { + var index = this.listeners[event].findIndex(l => { return l.callback === callback && l.context === context; }); diff --git a/src/api/composition/DefaultCompositionProvider.js b/src/api/composition/DefaultCompositionProvider.js index ca10ca64b0..bfd8c33a59 100644 --- a/src/api/composition/DefaultCompositionProvider.js +++ b/src/api/composition/DefaultCompositionProvider.js @@ -22,7 +22,7 @@ define([ 'lodash', - '../objects/object-utils' + 'objectUtils' ], function ( _, objectUtils @@ -143,7 +143,7 @@ define([ var keyString = objectUtils.makeKeyString(domainObject.identifier); var objectListeners = this.listeningTo[keyString]; - var index = _.findIndex(objectListeners[event], function (l) { + var index = objectListeners[event].findIndex(l => { return l.callback === callback && l.context === context; }); @@ -196,8 +196,8 @@ define([ * @private */ DefaultCompositionProvider.prototype.includes = function (parent, childId) { - return parent.composition.findIndex(composee => - this.publicAPI.objects.areIdsEqual(composee, childId)) !== -1; + return parent.composition.some(composee => + this.publicAPI.objects.areIdsEqual(composee, childId)); }; DefaultCompositionProvider.prototype.reorder = function (domainObject, oldIndex, newIndex) { diff --git a/src/api/notifications/NotificationAPI.js b/src/api/notifications/NotificationAPI.js index 505af91b47..ec092ec900 100644 --- a/src/api/notifications/NotificationAPI.js +++ b/src/api/notifications/NotificationAPI.js @@ -128,6 +128,11 @@ export default class NotificationAPI extends EventEmitter { return this._notify(notificationModel); } + dismissAllNotifications() { + this.notifications = []; + this.emit('dismiss-all'); + } + /** * Minimize a notification. The notification will still be available * from the notification list. Typically notifications with a diff --git a/src/api/objects/MutableObject.js b/src/api/objects/MutableObject.js index 78feb6fc53..7768b4452f 100644 --- a/src/api/objects/MutableObject.js +++ b/src/api/objects/MutableObject.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - './object-utils.js', + 'objectUtils', 'lodash' ], function ( utils, diff --git a/src/api/objects/ObjectAPI.js b/src/api/objects/ObjectAPI.js index d40b78a4c4..3d874eb295 100644 --- a/src/api/objects/ObjectAPI.js +++ b/src/api/objects/ObjectAPI.js @@ -22,7 +22,7 @@ define([ 'lodash', - './object-utils', + 'objectUtils', './MutableObject', './RootRegistry', './RootObjectProvider', diff --git a/src/api/objects/RootRegistry.js b/src/api/objects/RootRegistry.js index 089cfe9081..90186f2929 100644 --- a/src/api/objects/RootRegistry.js +++ b/src/api/objects/RootRegistry.js @@ -43,7 +43,7 @@ define([ } RootRegistry.prototype.addRoot = function (key) { - if (isKey(key) || (_.isArray(key) && _.every(key, isKey))) { + if (isKey(key) || (Array.isArray(key) && key.every(isKey))) { this.providers.push(function () { return key; }); diff --git a/src/api/objects/test/object-utilsSpec.js b/src/api/objects/test/object-utilsSpec.js index 9a98b246e8..31ed81af79 100644 --- a/src/api/objects/test/object-utilsSpec.js +++ b/src/api/objects/test/object-utilsSpec.js @@ -1,5 +1,5 @@ define([ - '../object-utils' + 'objectUtils' ], function ( objectUtils ) { diff --git a/src/api/telemetry/DefaultMetadataProvider.js b/src/api/telemetry/DefaultMetadataProvider.js index 2f6aa94ed0..a4bb276caf 100644 --- a/src/api/telemetry/DefaultMetadataProvider.js +++ b/src/api/telemetry/DefaultMetadataProvider.js @@ -85,9 +85,9 @@ define([ value: +e.value }; }), 'e.value'); - valueMetadata.values = _.pluck(valueMetadata.enumerations, 'value'); - valueMetadata.max = _.max(valueMetadata.values); - valueMetadata.min = _.min(valueMetadata.values); + valueMetadata.values = valueMetadata.enumerations.map(e => e.value); + valueMetadata.max = Math.max(valueMetadata.values); + valueMetadata.min = Math.min(valueMetadata.values); } valueMetadatas.push(valueMetadata); @@ -103,7 +103,7 @@ define([ var metadata = domainObject.telemetry || {}; if (this.typeHasTelemetry(domainObject)) { var typeMetadata = this.typeService.getType(domainObject.type).typeDef.telemetry; - _.extend(metadata, typeMetadata); + Object.assign(metadata, typeMetadata); if (!metadata.values) { metadata.values = valueMetadatasFromOldFormat(metadata); } diff --git a/src/api/telemetry/TelemetryAPI.js b/src/api/telemetry/TelemetryAPI.js index 9de8638eb3..41c49e4027 100644 --- a/src/api/telemetry/TelemetryAPI.js +++ b/src/api/telemetry/TelemetryAPI.js @@ -24,7 +24,7 @@ define([ './TelemetryMetadataManager', './TelemetryValueFormatter', './DefaultMetadataProvider', - '../objects/object-utils', + 'objectUtils', 'lodash' ], function ( TelemetryMetadataManager, @@ -370,7 +370,7 @@ define([ TelemetryAPI.prototype.commonValuesForHints = function (metadatas, hints) { var options = metadatas.map(function (metadata) { var values = metadata.valuesForHints(hints); - return _.indexBy(values, 'key'); + return _.keyBy(values, 'key'); }).reduce(function (a, b) { var results = {}; Object.keys(a).forEach(function (key) { @@ -383,7 +383,7 @@ define([ var sortKeys = hints.map(function (h) { return 'hints.' + h; }); - return _.sortByAll(options, sortKeys); + return _.sortBy(options, sortKeys); }; /** diff --git a/src/api/telemetry/TelemetryMetadataManager.js b/src/api/telemetry/TelemetryMetadataManager.js index 5b93eee6d6..8e8dcc4c9d 100644 --- a/src/api/telemetry/TelemetryMetadataManager.js +++ b/src/api/telemetry/TelemetryMetadataManager.js @@ -57,13 +57,13 @@ define([ if (valueMetadata.format === 'enum') { if (!valueMetadata.values) { - valueMetadata.values = _.pluck(valueMetadata.enumerations, 'value'); + valueMetadata.values = valueMetadata.enumerations.map(e => e.value); } if (!valueMetadata.hasOwnProperty('max')) { - valueMetadata.max = _.max(valueMetadata.values) + 1; + valueMetadata.max = Math.max(valueMetadata.values) + 1; } if (!valueMetadata.hasOwnProperty('min')) { - valueMetadata.min = _.min(valueMetadata.values) - 1; + valueMetadata.min = Math.min(valueMetadata.values) - 1; } } @@ -121,7 +121,7 @@ define([ return metadata.hints[hint]; } }); - return _.sortByAll(matchingMetadata, ...iteratees); + return _.sortBy(matchingMetadata, ...iteratees); }; TelemetryMetadataManager.prototype.getFilterableValues = function () { diff --git a/src/plugins/LADTable/components/LADTable.vue b/src/plugins/LADTable/components/LADTable.vue index f304603a7b..d163d78932 100644 --- a/src/plugins/LADTable/components/LADTable.vue +++ b/src/plugins/LADTable/components/LADTable.vue @@ -75,7 +75,7 @@ export default { this.items.push(item); }, removeItem(identifier) { - let index = _.findIndex(this.items, (item) => this.openmct.objects.makeKeyString(identifier) === item.key); + let index = this.items.findIndex(item => this.openmct.objects.makeKeyString(identifier) === item.key); this.items.splice(index, 1); }, diff --git a/src/plugins/LADTable/components/LadTableSet.vue b/src/plugins/LADTable/components/LadTableSet.vue index bdb764a5b7..db16fba60e 100644 --- a/src/plugins/LADTable/components/LadTableSet.vue +++ b/src/plugins/LADTable/components/LadTableSet.vue @@ -102,7 +102,7 @@ export default { this.compositions.push({composition, addCallback, removeCallback}); }, removePrimary(identifier) { - let index = _.findIndex(this.primaryTelemetryObjects, (primary) => this.openmct.objects.makeKeyString(identifier) === primary.key), + let index = this.primaryTelemetryObjects.findIndex(primary => this.openmct.objects.makeKeyString(identifier) === primary.key), primary = this.primaryTelemetryObjects[index]; this.$set(this.secondaryTelemetryObjects, primary.key, undefined); @@ -130,7 +130,7 @@ export default { removeSecondary(primary) { return (identifier) => { let array = this.secondaryTelemetryObjects[primary.key], - index = _.findIndex(array, (secondary) => this.openmct.objects.makeKeyString(identifier) === secondary.key); + index = array.findIndex(secondary => this.openmct.objects.makeKeyString(identifier) === secondary.key); array.splice(index, 1); diff --git a/src/plugins/condition/StyleRuleManager.js b/src/plugins/condition/StyleRuleManager.js index fb585455cb..6fe7b38c37 100644 --- a/src/plugins/condition/StyleRuleManager.js +++ b/src/plugins/condition/StyleRuleManager.js @@ -29,6 +29,7 @@ export default class StyleRuleManager extends EventEmitter { this.callback = callback; if (suppressSubscriptionOnEdit) { this.openmct.editor.on('isEditing', this.toggleSubscription.bind(this)); + this.isEditing = this.openmct.editor.editing; } if (styleConfiguration) { this.initialize(styleConfiguration); @@ -156,7 +157,6 @@ export default class StyleRuleManager extends EventEmitter { } delete this.stopProvidingTelemetry; this.conditionSetIdentifier = undefined; - this.isEditing = undefined; } } diff --git a/src/plugins/condition/components/ConditionCollection.vue b/src/plugins/condition/components/ConditionCollection.vue index 4cb042b7b7..54c797d966 100644 --- a/src/plugins/condition/components/ConditionCollection.vue +++ b/src/plugins/condition/components/ConditionCollection.vue @@ -200,7 +200,7 @@ export default { this.$emit('telemetryUpdated', this.telemetryObjs); }, removeTelemetryObject(identifier) { - let index = _.findIndex(this.telemetryObjs, (obj) => { + let index = this.telemetryObjs.findIndex(obj => { let objId = this.openmct.objects.makeKeyString(obj.identifier); let id = this.openmct.objects.makeKeyString(identifier); return objId === id; diff --git a/src/plugins/condition/components/inspector/ConditionalStylesView.vue b/src/plugins/condition/components/inspector/ConditionalStylesView.vue index 0d88d551cc..cd99ea8fb0 100644 --- a/src/plugins/condition/components/inspector/ConditionalStylesView.vue +++ b/src/plugins/condition/components/inspector/ConditionalStylesView.vue @@ -108,6 +108,7 @@ import ConditionError from "@/plugins/condition/components/ConditionError.vue"; import Vue from 'vue'; import PreviewAction from "@/ui/preview/PreviewAction.js"; import {getApplicableStylesForItem} from "@/plugins/condition/utils/styleUtils"; +import isEmpty from 'lodash/isEmpty'; export default { name: 'ConditionalStylesView', @@ -288,7 +289,7 @@ export default { delete domainObjectStyles[this.itemId].conditionSetIdentifier; domainObjectStyles[this.itemId].styles = undefined; delete domainObjectStyles[this.itemId].styles; - if (_.isEmpty(domainObjectStyles[this.itemId])) { + if (isEmpty(domainObjectStyles[this.itemId])) { delete domainObjectStyles[this.itemId]; } } else { @@ -299,7 +300,7 @@ export default { domainObjectStyles.styles = undefined; delete domainObjectStyles.styles; } - if (_.isEmpty(domainObjectStyles)) { + if (isEmpty(domainObjectStyles)) { domainObjectStyles = undefined; } @@ -337,7 +338,7 @@ export default { delete domainObjectStyles[this.itemId]; } }); - if (_.isEmpty(domainObjectStyles)) { + if (isEmpty(domainObjectStyles)) { domainObjectStyles = undefined; } this.persist(domainObjectStyles); diff --git a/src/plugins/condition/components/inspector/MultiSelectStylesView.vue b/src/plugins/condition/components/inspector/MultiSelectStylesView.vue index 2099cfe33a..1a7290e91e 100644 --- a/src/plugins/condition/components/inspector/MultiSelectStylesView.vue +++ b/src/plugins/condition/components/inspector/MultiSelectStylesView.vue @@ -50,6 +50,7 @@ import StyleEditor from "./StyleEditor.vue"; import PreviewAction from "@/ui/preview/PreviewAction.js"; import { getApplicableStylesForItem, getConsolidatedStyleValues, getConditionalStyleForItem } from "@/plugins/condition/utils/styleUtils"; +import isEmpty from 'lodash/isEmpty'; export default { name: 'MultiSelectStylesView', @@ -178,7 +179,7 @@ export default { domainObjectStyles[itemId] = undefined; delete domainObjectStyles[this.itemId]; - if (_.isEmpty(domainObjectStyles)) { + if (isEmpty(domainObjectStyles)) { domainObjectStyles = undefined; } this.persist(this.domainObject, domainObjectStyles); @@ -239,7 +240,7 @@ export default { if (this.isStaticAndConditionalStyles) { this.removeConditionalStyles(domainObjectStyles, item.id); } - if (_.isEmpty(itemStaticStyle)) { + if (isEmpty(itemStaticStyle)) { itemStaticStyle = undefined; domainObjectStyles[item.id] = undefined; } else { diff --git a/src/plugins/condition/components/inspector/StylesView.vue b/src/plugins/condition/components/inspector/StylesView.vue new file mode 100644 index 0000000000..dd783cda8a --- /dev/null +++ b/src/plugins/condition/components/inspector/StylesView.vue @@ -0,0 +1,601 @@ +/***************************************************************************** +* Open MCT, Copyright (c) 2014-2020, 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. +*****************************************************************************/ + + + + diff --git a/src/plugins/condition/pluginSpec.js b/src/plugins/condition/pluginSpec.js index 664082b95e..93a1930bc4 100644 --- a/src/plugins/condition/pluginSpec.js +++ b/src/plugins/condition/pluginSpec.js @@ -20,25 +20,21 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import { createOpenMct } from "testTools"; +import { createOpenMct } from "testUtils"; import ConditionPlugin from "./plugin"; -let openmct = createOpenMct(); -openmct.install(new ConditionPlugin()); - -let conditionSetDefinition; -let mockConditionSetDomainObject; -let element; -let child; - describe('the plugin', function () { + let conditionSetDefinition; + let mockConditionSetDomainObject; + let element; + let child; + let openmct; beforeAll((done) => { + openmct = createOpenMct(); + openmct.install(new ConditionPlugin()); conditionSetDefinition = openmct.types.get('conditionSet').definition; - const appHolder = document.createElement('div'); - appHolder.style.width = '640px'; - appHolder.style.height = '480px'; element = document.createElement('div'); child = document.createElement('div'); @@ -55,7 +51,7 @@ describe('the plugin', function () { conditionSetDefinition.initialize(mockConditionSetDomainObject); openmct.on('start', done); - openmct.start(appHolder); + openmct.startHeadless(); }); let mockConditionSetObject = { diff --git a/src/plugins/condition/utils/operations.js b/src/plugins/condition/utils/operations.js index 51bc010d76..86d67d47d9 100644 --- a/src/plugins/condition/utils/operations.js +++ b/src/plugins/condition/utils/operations.js @@ -20,8 +20,6 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import _ from 'lodash'; - const convertToNumbers = (input) => { let numberInputs = []; input.forEach(inputValue => numberInputs.push(Number(inputValue))); @@ -257,7 +255,7 @@ export const OPERATIONS = [ const lhsValue = input[0] !== undefined ? input[0].toString() : ''; if (input[1]) { const values = input[1].split(','); - return values.find((value) => lhsValue === _.trim(value.toString())); + return values.find((value) => lhsValue === value.toString().trim()); } return false; }, @@ -274,7 +272,7 @@ export const OPERATIONS = [ const lhsValue = input[0] !== undefined ? input[0].toString() : ''; if (input[1]) { const values = input[1].split(','); - const found = values.find((value) => lhsValue === _.trim(value.toString())); + const found = values.find((value) => lhsValue === value.toString().trim()); return !found; } return false; diff --git a/src/plugins/condition/utils/styleUtils.js b/src/plugins/condition/utils/styleUtils.js index 4872d3dacb..03a83d9c2f 100644 --- a/src/plugins/condition/utils/styleUtils.js +++ b/src/plugins/condition/utils/styleUtils.js @@ -19,6 +19,8 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ +import isEmpty from 'lodash/isEmpty'; + const NONE_VALUE = '__no_value'; const styleProps = { @@ -122,12 +124,25 @@ export const getConditionalStyleForItem = (domainObject, id) => { if (domainObjectStyles[id] && domainObjectStyles[id].conditionSetIdentifier) { return domainObjectStyles[id].styles; } - } else if (domainObjectStyles.staticStyle) { + } else if (domainObjectStyles.conditionSetIdentifier) { return domainObjectStyles.styles; } } }; +export const getConditionSetIdentifierForItem = (domainObject, id) => { + let domainObjectStyles = domainObject && domainObject.configuration && domainObject.configuration.objectStyles; + if (domainObjectStyles) { + if (id) { + if (domainObjectStyles[id] && domainObjectStyles[id].conditionSetIdentifier) { + return domainObjectStyles[id].conditionSetIdentifier; + } + } else if (domainObjectStyles.conditionSetIdentifier) { + return domainObjectStyles.conditionSetIdentifier; + } + } +}; + //Returns either existing static styles or uses SVG defaults if available export const getApplicableStylesForItem = (domainObject, item) => { const type = item && item.type; @@ -154,7 +169,7 @@ export const getApplicableStylesForItem = (domainObject, item) => { }; export const getStylesWithoutNoneValue = (style) => { - if (_.isEmpty(style) || !style) { + if (isEmpty(style) || !style) { return; } let styleObj = {}; diff --git a/src/plugins/displayLayout/components/DisplayLayout.vue b/src/plugins/displayLayout/components/DisplayLayout.vue index a247c601a8..f31c232ed0 100644 --- a/src/plugins/displayLayout/components/DisplayLayout.vue +++ b/src/plugins/displayLayout/components/DisplayLayout.vue @@ -68,7 +68,6 @@ diff --git a/src/plugins/notificationIndicator/components/NotificationMessage.vue b/src/plugins/notificationIndicator/components/NotificationMessage.vue new file mode 100644 index 0000000000..96fd02cfc7 --- /dev/null +++ b/src/plugins/notificationIndicator/components/NotificationMessage.vue @@ -0,0 +1,85 @@ + + + diff --git a/src/plugins/notificationIndicator/components/NotificationsList.vue b/src/plugins/notificationIndicator/components/NotificationsList.vue new file mode 100644 index 0000000000..dadbf7074d --- /dev/null +++ b/src/plugins/notificationIndicator/components/NotificationsList.vue @@ -0,0 +1,69 @@ + + + diff --git a/platform/commonUI/notification/src/NotificationIndicator.js b/src/plugins/notificationIndicator/plugin.js similarity index 60% rename from platform/commonUI/notification/src/NotificationIndicator.js rename to src/plugins/notificationIndicator/plugin.js index af399985c9..d870d67c90 100644 --- a/platform/commonUI/notification/src/NotificationIndicator.js +++ b/src/plugins/notificationIndicator/plugin.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2018, United States Government + * Open MCT, Copyright (c) 2014-2020, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,15 +19,25 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ +import Vue from 'vue'; +import NotificationIndicator from './components/NotificationIndicator.vue'; -define( - [], - function () { +export default function plugin() { + return function install(openmct) { + let component = new Vue ({ + provide: { + openmct + }, + components: { + NotificationIndicator: NotificationIndicator + }, + template: '' + }), + indicator = { + key: 'notifications-indicator', + element: component.$mount().$el + }; - function NotificationIndicator() {} - - NotificationIndicator.template = 'notificationIndicatorTemplate'; - - return NotificationIndicator; - } -); + openmct.indicators.add(indicator); + }; +} diff --git a/src/plugins/notificationIndicator/pluginSpec.js b/src/plugins/notificationIndicator/pluginSpec.js new file mode 100644 index 0000000000..61b6efa486 --- /dev/null +++ b/src/plugins/notificationIndicator/pluginSpec.js @@ -0,0 +1,71 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2020, 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 NotificationIndicatorPlugin from './plugin.js'; +import Vue from 'vue'; +import { + createOpenMct +} from 'testUtils'; + +describe('the plugin', () => { + let notificationIndicatorPlugin, + openmct, + indicatorObject, + indicatorElement, + parentElement, + mockMessages = ['error', 'test', 'notifications']; + + beforeEach((done) => { + openmct = createOpenMct(); + + notificationIndicatorPlugin = new NotificationIndicatorPlugin(); + openmct.install(notificationIndicatorPlugin); + + parentElement = document.createElement('div'); + + indicatorObject = openmct.indicators.indicatorObjects.find(indicator => indicator.key === 'notifications-indicator'); + indicatorElement = indicatorObject.element; + + openmct.on('start', () => { + mockMessages.forEach(message => { + openmct.notifications.error(message); + }); + done(); + }); + + openmct.startHeadless(); + }); + + describe('the indicator plugin element', () => { + beforeEach(() => { + parentElement.append(indicatorElement); + return Vue.nextTick(); + }); + + it('notifies the user of the number of notifications', () => { + let notificationCountElement = parentElement.querySelector('.c-indicator__count'); + + expect(notificationCountElement.innerText).toEqual(mockMessages.length.toString()); + }); + }); + +}); diff --git a/src/plugins/plot/src/chart/MCTChartController.js b/src/plugins/plot/src/chart/MCTChartController.js index aa086d412d..83ff610374 100644 --- a/src/plugins/plot/src/chart/MCTChartController.js +++ b/src/plugins/plot/src/chart/MCTChartController.js @@ -152,7 +152,7 @@ function ( MCTChartController.prototype.destroy = function () { this.isDestroyed = true; this.stopListening(); - _.invoke(this.lines, 'destroy'); + this.lines.forEach(line => line.destroy()); DrawLoader.releaseDrawAPI(this.drawAPI); }; diff --git a/src/plugins/plot/src/configuration/Collection.js b/src/plugins/plot/src/configuration/Collection.js index 094dadfdce..164bd1ebd8 100644 --- a/src/plugins/plot/src/configuration/Collection.js +++ b/src/plugins/plot/src/configuration/Collection.js @@ -44,7 +44,7 @@ define([ this.initialize(options); } - _.extend(Collection.prototype, EventEmitter.prototype); + Object.assign(Collection.prototype, EventEmitter.prototype); eventHelpers.extend(Collection.prototype); Collection.extend = extend; @@ -105,12 +105,7 @@ define([ }; Collection.prototype.indexOf = function (model) { - return _.findIndex( - this.models, - function (m) { - return m === model; - } - ); + return this.models.findIndex(m => m === model); }; Collection.prototype.remove = function (model) { diff --git a/src/plugins/plot/src/configuration/Model.js b/src/plugins/plot/src/configuration/Model.js index 683b040a09..7ab57c7be0 100644 --- a/src/plugins/plot/src/configuration/Model.js +++ b/src/plugins/plot/src/configuration/Model.js @@ -49,7 +49,7 @@ define([ this.initialize(options); } - _.extend(Model.prototype, EventEmitter.prototype); + Object.assign(Model.prototype, EventEmitter.prototype); eventHelpers.extend(Model.prototype); Model.extend = extend; diff --git a/src/plugins/plot/src/configuration/PlotSeries.js b/src/plugins/plot/src/configuration/PlotSeries.js index 06f1fa7da0..ea774067e4 100644 --- a/src/plugins/plot/src/configuration/PlotSeries.js +++ b/src/plugins/plot/src/configuration/PlotSeries.js @@ -146,7 +146,7 @@ define([ strategy = 'minmax'; } - options = _.extend({}, { size: 1000, strategy, filters: this.filters }, options || {}); + options = Object.assign({}, { size: 1000, strategy, filters: this.filters }, options || {}); if (!this.unsubscribe) { this.unsubscribe = this.openmct @@ -160,6 +160,7 @@ define([ ); } + /* eslint-disable you-dont-need-lodash-underscore/concat */ return this.openmct .telemetry .request(this.domainObject, options) @@ -171,6 +172,7 @@ define([ .value(); this.reset(newPoints); }.bind(this)); + /* eslint-enable you-dont-need-lodash-underscore/concat */ }, /** * Update x formatter on x change. @@ -270,7 +272,7 @@ define([ * @private */ sortedIndex: function (point) { - return _.sortedIndex(this.data, point, this.getXVal); + return _.sortedIndexBy(this.data, point, this.getXVal); }, /** * Update min/max stats for the series. @@ -322,7 +324,15 @@ define([ * a point to the end without dupe checking. */ add: function (point, appendOnly) { - var insertIndex = this.data.length; + var insertIndex = this.data.length, + currentYVal = this.getYVal(point), + lastYVal = this.getYVal(this.data[insertIndex - 1]); + + if (this.isValueInvalid(currentYVal) && this.isValueInvalid(lastYVal)) { + console.warn('[Plot] Invalid Y Values detected'); + return; + } + if (!appendOnly) { insertIndex = this.sortedIndex(point); if (this.getXVal(this.data[insertIndex]) === this.getXVal(point)) { @@ -332,11 +342,21 @@ define([ return; } } + this.updateStats(point); point.mctLimitState = this.evaluate(point); this.data.splice(insertIndex, 0, point); this.emit('add', point, insertIndex, this); }, + + /** + * + * @private + */ + isValueInvalid: function (val) { + return Number.isNaN(val) || val === undefined; + }, + /** * Remove a point from the data array and notify listeners. * @private diff --git a/src/plugins/plot/src/configuration/SeriesCollection.js b/src/plugins/plot/src/configuration/SeriesCollection.js index 019c354d21..cdcb5aff46 100644 --- a/src/plugins/plot/src/configuration/SeriesCollection.js +++ b/src/plugins/plot/src/configuration/SeriesCollection.js @@ -101,11 +101,11 @@ define([ var plotObject = this.plot.get('domainObject'); if (plotObject.type === 'telemetry.plot.overlay') { - var persistedIndex = _.findIndex(plotObject.configuration.series, function (s) { + var persistedIndex = plotObject.configuration.series.findIndex(s => { return _.isEqual(identifier, s.identifier); }); - var configIndex = _.findIndex(this.models, function (m) { + var configIndex = this.models.findIndex(m => { return _.isEqual(m.domainObject.identifier, identifier); }); diff --git a/src/plugins/plot/src/configuration/YAxisModel.js b/src/plugins/plot/src/configuration/YAxisModel.js index 432b9c7a24..105c1a04f0 100644 --- a/src/plugins/plot/src/configuration/YAxisModel.js +++ b/src/plugins/plot/src/configuration/YAxisModel.js @@ -182,21 +182,6 @@ define([ this.set('format', yFormat.format.bind(yFormat)); this.set('values', yMetadata.values); if (!label) { - var labelUnits = series.map(function (s) { - return s.metadata.value(s.get('yKey')).units; - }).reduce(function (a, b) { - if (a === undefined) { - return b; - } - if (a === b) { - return a; - } - return ''; - }, undefined); - if (labelUnits) { - this.set('label', labelUnits); - return; - } var labelName = series.map(function (s) { return s.metadata.value(s.get('yKey')).name; }).reduce(function (a, b) { @@ -208,7 +193,28 @@ define([ } return ''; }, undefined); - this.set('label', labelName); + + if (labelName) { + this.set('label', labelName); + return; + } + + var labelUnits = series.map(function (s) { + return s.metadata.value(s.get('yKey')).units; + }).reduce(function (a, b) { + if (a === undefined) { + return b; + } + if (a === b) { + return a; + } + return ''; + }, undefined); + + if (labelUnits) { + this.set('label', labelUnits); + return; + } } }, defaults: function (options) { diff --git a/src/plugins/plot/src/draw/Draw2D.js b/src/plugins/plot/src/draw/Draw2D.js index e5141345b3..812a0c7a67 100644 --- a/src/plugins/plot/src/draw/Draw2D.js +++ b/src/plugins/plot/src/draw/Draw2D.js @@ -51,7 +51,7 @@ define([ } } - _.extend(Draw2D.prototype, EventEmitter.prototype); + Object.assign(Draw2D.prototype, EventEmitter.prototype); eventHelpers.extend(Draw2D.prototype); // Convert from logical to physical x coordinates diff --git a/src/plugins/plot/src/draw/DrawWebGL.js b/src/plugins/plot/src/draw/DrawWebGL.js index 2e145b0665..1c5f5128a1 100644 --- a/src/plugins/plot/src/draw/DrawWebGL.js +++ b/src/plugins/plot/src/draw/DrawWebGL.js @@ -78,7 +78,7 @@ define([ this.listenTo(this.canvas, "webglcontextlost", this.onContextLost, this); } - _.extend(DrawWebGL.prototype, EventEmitter.prototype); + Object.assign(DrawWebGL.prototype, EventEmitter.prototype); eventHelpers.extend(DrawWebGL.prototype); DrawWebGL.prototype.onContextLost = function (event) { diff --git a/src/plugins/plot/src/inspector/PlotOptionsController.js b/src/plugins/plot/src/inspector/PlotOptionsController.js index b989bbaca7..776b7ecd94 100644 --- a/src/plugins/plot/src/inspector/PlotOptionsController.js +++ b/src/plugins/plot/src/inspector/PlotOptionsController.js @@ -23,7 +23,7 @@ define([ '../configuration/configStore', '../lib/eventHelpers', - '../../../../api/objects/object-utils', + 'objectUtils', 'lodash' ], function ( configStore, diff --git a/src/plugins/plot/src/inspector/PlotSeriesFormController.js b/src/plugins/plot/src/inspector/PlotSeriesFormController.js index 64a06b351a..d6b815c8f1 100644 --- a/src/plugins/plot/src/inspector/PlotSeriesFormController.js +++ b/src/plugins/plot/src/inspector/PlotSeriesFormController.js @@ -31,7 +31,7 @@ define([ function dynamicPathForKey(key) { return function (object, model) { var modelIdentifier = model.get('identifier'); - var index = _.findIndex(object.configuration.series, function (s) { + var index = object.configuration.series.findIndex(s => { return _.isEqual(s.identifier, modelIdentifier); }); return 'configuration.series[' + index + '].' + key; diff --git a/src/plugins/plot/src/inspector/PlotYAxisFormController.js b/src/plugins/plot/src/inspector/PlotYAxisFormController.js index fa3b2ce231..d1e2b71de0 100644 --- a/src/plugins/plot/src/inspector/PlotYAxisFormController.js +++ b/src/plugins/plot/src/inspector/PlotYAxisFormController.js @@ -73,10 +73,10 @@ define([ if (range.max === '' || range.max === null || typeof range.max === 'undefined') { return 'Must specify Maximum'; } - if (_.isNaN(Number(range.min))) { + if (Number.isNaN(Number(range.min))) { return 'Minimum must be a number.'; } - if (_.isNaN(Number(range.max))) { + if (Number.isNaN(Number(range.max))) { return 'Maximum must be a number.'; } if (Number(range.min) > Number(range.max)) { diff --git a/src/plugins/plot/src/telemetry/StackedPlotController.js b/src/plugins/plot/src/telemetry/StackedPlotController.js index f2be95448a..9d7b27accd 100644 --- a/src/plugins/plot/src/telemetry/StackedPlotController.js +++ b/src/plugins/plot/src/telemetry/StackedPlotController.js @@ -76,7 +76,7 @@ define([ if (childObj) { var index = telemetryObjects.indexOf(childObj); telemetryObjects.splice(index, 1); - $scope.$broadcast('plot:tickWidth', _.max(tickWidthMap)); + $scope.$broadcast('plot:tickWidth', Math.max(...Object.values(tickWidthMap))); } } diff --git a/src/plugins/plugins.js b/src/plugins/plugins.js index ca64422819..d177dcd9a8 100644 --- a/src/plugins/plugins.js +++ b/src/plugins/plugins.js @@ -51,7 +51,8 @@ define([ './conditionWidget/plugin', './themes/espresso', './themes/maelstrom', - './themes/snow' + './themes/snow', + './notificationIndicator/plugin' ], function ( _, UTCTimeSystem, @@ -83,7 +84,8 @@ define([ ConditionWidgetPlugin, Espresso, Maelstrom, - Snow + Snow, + NotificationIndicator ) { var bundleMap = { LocalStorage: 'platform/persistence/local', @@ -192,6 +194,7 @@ define([ plugins.Snow = Snow.default; plugins.Condition = ConditionPlugin.default; plugins.ConditionWidget = ConditionWidgetPlugin.default; + plugins.NotificationIndicator = NotificationIndicator.default; return plugins; }); diff --git a/src/plugins/staticRootPlugin/StaticModelProvider.js b/src/plugins/staticRootPlugin/StaticModelProvider.js index 956df5a58e..a71ab27090 100644 --- a/src/plugins/staticRootPlugin/StaticModelProvider.js +++ b/src/plugins/staticRootPlugin/StaticModelProvider.js @@ -1,5 +1,5 @@ define([ - '../../api/objects/object-utils' + 'objectUtils' ], function ( objectUtils ) { diff --git a/src/plugins/summaryWidget/src/ConditionManager.js b/src/plugins/summaryWidget/src/ConditionManager.js index b5ddf98eaf..889e67af4a 100644 --- a/src/plugins/summaryWidget/src/ConditionManager.js +++ b/src/plugins/summaryWidget/src/ConditionManager.js @@ -1,6 +1,6 @@ define ([ './ConditionEvaluator', - '../../../api/objects/object-utils', + 'objectUtils', 'EventEmitter', 'zepto', 'lodash' @@ -9,7 +9,8 @@ define ([ objectUtils, EventEmitter, $, - _ + _, + ) { /** diff --git a/src/plugins/summaryWidget/src/SummaryWidget.js b/src/plugins/summaryWidget/src/SummaryWidget.js index e0f7df5ddd..aeecd6532a 100644 --- a/src/plugins/summaryWidget/src/SummaryWidget.js +++ b/src/plugins/summaryWidget/src/SummaryWidget.js @@ -5,7 +5,7 @@ define([ './TestDataManager', './WidgetDnD', './eventHelpers', - '../../../api/objects/object-utils', + 'objectUtils', 'lodash', 'zepto' ], function ( diff --git a/src/plugins/summaryWidget/src/input/ObjectSelect.js b/src/plugins/summaryWidget/src/input/ObjectSelect.js index 33af478c76..5e73e08bb8 100644 --- a/src/plugins/summaryWidget/src/input/ObjectSelect.js +++ b/src/plugins/summaryWidget/src/input/ObjectSelect.js @@ -1,6 +1,6 @@ define([ './Select', - '../../../../api/objects/object-utils' + 'objectUtils' ], function ( Select, objectUtils diff --git a/src/plugins/summaryWidget/src/telemetry/EvaluatorPool.js b/src/plugins/summaryWidget/src/telemetry/EvaluatorPool.js index f42ff25893..2226606df7 100644 --- a/src/plugins/summaryWidget/src/telemetry/EvaluatorPool.js +++ b/src/plugins/summaryWidget/src/telemetry/EvaluatorPool.js @@ -22,7 +22,7 @@ define([ './SummaryWidgetEvaluator', - '../../../../api/objects/object-utils' + 'objectUtils' ], function ( SummaryWidgetEvaluator, objectUtils diff --git a/src/plugins/summaryWidget/src/telemetry/SummaryWidgetEvaluator.js b/src/plugins/summaryWidget/src/telemetry/SummaryWidgetEvaluator.js index 7ae94d3e42..8798c21e04 100644 --- a/src/plugins/summaryWidget/src/telemetry/SummaryWidgetEvaluator.js +++ b/src/plugins/summaryWidget/src/telemetry/SummaryWidgetEvaluator.js @@ -23,7 +23,7 @@ define([ './SummaryWidgetRule', '../eventHelpers', - '../../../../api/objects/object-utils', + 'objectUtils', 'lodash' ], function ( SummaryWidgetRule, @@ -80,10 +80,12 @@ define([ } }.bind(this); + /* eslint-disable you-dont-need-lodash-underscore/map */ unsubscribes = _.map( realtimeStates, this.subscribeToObjectState.bind(this, updateCallback) ); + /* eslint-enable you-dont-need-lodash-underscore/map */ }.bind(this)); return function () { @@ -151,11 +153,13 @@ define([ SummaryWidgetEvaluator.prototype.getBaseStateClone = function () { return this.load() .then(function () { + /* eslint-disable you-dont-need-lodash-underscore/values */ return _(this.baseState) .values() .map(_.clone) - .indexBy('id') + .keyBy('id') .value(); + /* eslint-enable you-dont-need-lodash-underscore/values */ }.bind(this)); }; @@ -182,7 +186,7 @@ define([ * @private. */ SummaryWidgetEvaluator.prototype.updateObjectStateFromLAD = function (options, objectState) { - options = _.extend({}, options, { + options = Object.assign({}, options, { strategy: 'latest', size: 1 }); @@ -255,10 +259,12 @@ define([ } } + /* eslint-disable you-dont-need-lodash-underscore/map */ var latestTimestamp = _(state) .map('timestamps') .sortBy(timestampKey) .last(); + /* eslint-enable you-dont-need-lodash-underscore/map */ if (!latestTimestamp) { latestTimestamp = {}; diff --git a/src/plugins/summaryWidget/src/views/SummaryWidgetViewProvider.js b/src/plugins/summaryWidget/src/views/SummaryWidgetViewProvider.js index 4c6b6ec8b2..db569a0e58 100644 --- a/src/plugins/summaryWidget/src/views/SummaryWidgetViewProvider.js +++ b/src/plugins/summaryWidget/src/views/SummaryWidgetViewProvider.js @@ -1,7 +1,7 @@ define([ '../SummaryWidget', './SummaryWidgetView', - '../../../../api/objects/object-utils' + 'objectUtils' ], function ( SummaryWidgetEditView, SummaryWidgetView, diff --git a/src/plugins/telemetryMean/src/MeanTelemetryProvider.js b/src/plugins/telemetryMean/src/MeanTelemetryProvider.js index 561ac44f34..d7f37de0ad 100644 --- a/src/plugins/telemetryMean/src/MeanTelemetryProvider.js +++ b/src/plugins/telemetryMean/src/MeanTelemetryProvider.js @@ -22,7 +22,7 @@ /*jshint latedef: nofunc */ /*global console */ define([ - '../../../api/objects/object-utils', + 'objectUtils', './TelemetryAverager' ], function (objectUtils, TelemetryAverager) { diff --git a/src/plugins/telemetryTable/TableConfigurationViewProvider.js b/src/plugins/telemetryTable/TableConfigurationViewProvider.js index 54e126eba9..a606532d6e 100644 --- a/src/plugins/telemetryTable/TableConfigurationViewProvider.js +++ b/src/plugins/telemetryTable/TableConfigurationViewProvider.js @@ -21,7 +21,7 @@ *****************************************************************************/ define([ - '../../api/objects/object-utils', + 'objectUtils', './components/table-configuration.vue', './TelemetryTableConfiguration', 'vue' diff --git a/src/plugins/telemetryTable/TelemetryTableConfiguration.js b/src/plugins/telemetryTable/TelemetryTableConfiguration.js index 5946779c4d..29d1fd742a 100644 --- a/src/plugins/telemetryTable/TelemetryTableConfiguration.js +++ b/src/plugins/telemetryTable/TelemetryTableConfiguration.js @@ -100,7 +100,7 @@ define([ hasColumnWithKey(columnKey) { return _.flatten(Object.values(this.columns)) - .findIndex(column => column.getKey() === columnKey) !== -1; + .some(column => column.getKey() === columnKey); } getColumns() { @@ -109,9 +109,10 @@ define([ getAllHeaders() { let flattenedColumns = _.flatten(Object.values(this.columns)); + /* eslint-disable you-dont-need-lodash-underscore/uniq */ let headers = _.uniq(flattenedColumns, false, column => column.getKey()) .reduce(fromColumnsToHeadersMap, {}); - + /* eslint-enable you-dont-need-lodash-underscore/uniq */ function fromColumnsToHeadersMap(headersMap, column) { headersMap[column.getKey()] = column.getTitle(); return headersMap; diff --git a/src/plugins/telemetryTable/collections/SortedTableRowCollection.js b/src/plugins/telemetryTable/collections/SortedTableRowCollection.js index 043ac29032..3998b860e9 100644 --- a/src/plugins/telemetryTable/collections/SortedTableRowCollection.js +++ b/src/plugins/telemetryTable/collections/SortedTableRowCollection.js @@ -93,7 +93,7 @@ define( // same time stamp let potentialDupes = this.rows.slice(startIx, endIx + 1); // Search potential dupes for exact dupe - isDuplicate = _.findIndex(potentialDupes, _.isEqual.bind(undefined, row)) > -1; + isDuplicate = potentialDupes.some(_.isEqual.bind(undefined, row)); } if (!isDuplicate) { @@ -120,7 +120,7 @@ define( const firstValue = this.getValueForSortColumn(this.rows[0]); const lastValue = this.getValueForSortColumn(this.rows[this.rows.length - 1]); - lodashFunction = lodashFunction || _.sortedIndex; + lodashFunction = lodashFunction || _.sortedIndexBy; if (this.sortOptions.direction === 'asc') { if (testRowValue > lastValue) { @@ -201,7 +201,7 @@ define( sortBy(sortOptions) { if (arguments.length > 0) { this.sortOptions = sortOptions; - this.rows = _.sortByOrder(this.rows, (row) => row.getParsedValue(sortOptions.key) , sortOptions.direction); + this.rows = _.orderBy(this.rows, (row) => row.getParsedValue(sortOptions.key) , sortOptions.direction); this.emit('sort'); } // Return duplicate to avoid direct modification of underlying object diff --git a/src/plugins/telemetryTable/components/TelemetryFilterIndicator.vue b/src/plugins/telemetryTable/components/TelemetryFilterIndicator.vue index 5a93fd324b..d3fe156ced 100644 --- a/src/plugins/telemetryTable/components/TelemetryFilterIndicator.vue +++ b/src/plugins/telemetryTable/components/TelemetryFilterIndicator.vue @@ -17,6 +17,8 @@