diff --git a/.circleci/config.yml b/.circleci/config.yml index 3dfa1d6569..edb7bb1c49 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,23 +2,23 @@ version: 2.1 executors: pw-focal-development: docker: - - image: mcr.microsoft.com/playwright:v1.36.2-focal + - image: mcr.microsoft.com/playwright:v1.39.0-focal environment: NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed - PERCY_POSTINSTALL_BROWSER: 'true' # Needed to store the percy browser in cache deps - PERCY_LOGLEVEL: 'debug' # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742) + PERCY_POSTINSTALL_BROWSER: "true" # Needed to store the percy browser in cache deps + PERCY_LOGLEVEL: "debug" # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742) ubuntu: machine: image: ubuntu-2204:current docker_layer_caching: true parameters: BUST_CACHE: - description: 'Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!' + description: "Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!" default: false type: boolean commands: build_and_install: - description: 'All steps used to build and install. Will use cache if found' + description: "All steps used to build and install. Will use cache if found" parameters: node-version: type: string @@ -30,7 +30,7 @@ commands: node-version: << parameters.node-version >> - run: npm install --no-audit --progress=false restore_cache_cmd: - description: 'Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache' + description: "Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache" parameters: node-version: type: string @@ -42,7 +42,7 @@ commands: - restore_cache: key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }} save_cache_cmd: - description: 'Custom command for saving cache.' + description: "Custom command for saving cache." parameters: node-version: type: string @@ -53,7 +53,7 @@ commands: - ~/.npm - node_modules generate_and_store_version_and_filesystem_artifacts: - description: 'Track important packages and files' + description: "Track important packages and files" steps: - run: | [[ $EUID -ne 0 ]] && (sudo mkdir -p /tmp/artifacts && sudo chmod 777 /tmp/artifacts) || (mkdir -p /tmp/artifacts && chmod 777 /tmp/artifacts) @@ -64,7 +64,7 @@ commands: - store_artifacts: path: /tmp/artifacts/ generate_e2e_code_cov_report: - description: 'Generate e2e code coverage artifacts and publish to codecov.io. Needed to that we can ignore the exit code status of the npm run test' + description: "Generate e2e code coverage artifacts and publish to codecov.io. Needed to that we can ignore the exit code status of the npm run test" parameters: suite: type: string @@ -105,7 +105,11 @@ jobs: node-version: <> - browser-tools/install-chrome: replace-existing: false - - run: npm run test + - run: + command: | + mkdir -p dist/reports/tests/ + TESTFILES=$(circleci tests glob "src/**/*Spec.js") + echo "$TESTFILES" | circleci tests run --command="xargs npm run test" --verbose - run: npm run cov:unit:publish - save_cache_cmd: node-version: <> @@ -120,21 +124,23 @@ jobs: - generate_and_store_version_and_filesystem_artifacts e2e-test: parameters: - node-version: - type: string suite: #stable or full type: string executor: pw-focal-development - parallelism: 4 + parallelism: 7 steps: - build_and_install: - node-version: <> + node-version: lts/hydrogen - when: #Only install chrome-beta when running the 'full' suite to save $$$ condition: - equal: ['full', <>] + equal: ["full", <>] steps: - run: npx playwright install chrome-beta - - run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npm run test:e2e:<> -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL} + - run: + command: | + mkdir test-results + TESTFILES=$(circleci tests glob "e2e/**/*.spec.js") + echo "$TESTFILES" | circleci tests run --command="xargs npm run test:e2e:<>" --verbose --split-by=timings - when: condition: equal: [42, 42] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2 @@ -155,14 +161,11 @@ jobs: steps: - generate_and_store_version_and_filesystem_artifacts e2e-couchdb: - parameters: - node-version: - type: string executor: ubuntu steps: - build_and_install: - node-version: <> - - run: npx playwright@1.36.2 install #Necessary for bare ubuntu machine + node-version: lts/hydrogen + - run: npx playwright@1.39.0 install #Necessary for bare ubuntu machine - run: | export $(cat src/plugins/persistence/couch/.env.ci | xargs) docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach @@ -189,15 +192,28 @@ jobs: equal: [42, 42] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2 steps: - generate_and_store_version_and_filesystem_artifacts - perf-test: - parameters: - node-version: - type: string + mem-test: executor: pw-focal-development steps: - build_and_install: - node-version: <> + node-version: lts/hydrogen - run: npm run test:perf:memory + - store_test_results: + path: test-results/results.xml + - store_artifacts: + path: test-results + - store_artifacts: + path: html-test-results + - when: + condition: + equal: [42, 42] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2 + steps: + - generate_and_store_version_and_filesystem_artifacts + perf-test: + executor: pw-focal-development + steps: + - build_and_install: + node-version: lts/hydrogen - run: npm run test:perf:localhost - run: npm run test:perf:contract - store_test_results: @@ -211,16 +227,14 @@ jobs: equal: [42, 42] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2 steps: - generate_and_store_version_and_filesystem_artifacts - visual-test: + visual-a11y-tests: parameters: - node-version: - type: string suite: type: string # ci or full executor: pw-focal-development steps: - build_and_install: - node-version: <> + node-version: lts/hydrogen - run: npm run test:e2e:visual:<> - store_test_results: path: test-results/results.xml @@ -233,31 +247,28 @@ jobs: equal: [42, 42] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2 steps: - generate_and_store_version_and_filesystem_artifacts + workflows: overall-circleci-commit-status: #These jobs run on every commit jobs: - lint: - name: node16-lint - node-version: lts/gallium + name: node20-lint + node-version: lts/iron - unit-test: name: node18-chrome node-version: lts/hydrogen - e2e-test: name: e2e-stable - node-version: lts/hydrogen suite: stable - - perf-test: - node-version: lts/hydrogen - - visual-test: + - visual-a11y-tests: name: visual-test-ci suite: ci - node-version: lts/hydrogen the-nightly: #These jobs do not run on PRs, but against master at night jobs: - unit-test: - name: node16-chrome-nightly - node-version: lts/gallium + name: node20-chrome-nightly + node-version: lts/iron - unit-test: name: node18-chrome node-version: lts/hydrogen @@ -265,19 +276,16 @@ workflows: node-version: lts/hydrogen - e2e-test: name: e2e-full-nightly - node-version: lts/hydrogen suite: full - - perf-test: - node-version: lts/hydrogen - - visual-test: + - mem-test + - perf-test + - visual-a11y-tests: name: visual-test-nightly suite: full - node-version: lts/hydrogen - - e2e-couchdb: - node-version: lts/hydrogen + - e2e-couchdb triggers: - schedule: - cron: '0 0 * * *' + cron: "0 0 * * *" filters: branches: only: diff --git a/.cspell.json b/.cspell.json index 3716e48fea..9afde5db7c 100644 --- a/.cspell.json +++ b/.cspell.json @@ -43,7 +43,6 @@ "sharded", "perfromance", "MMOC", - "deploysentinel", "codegen", "Unfortuantely", "viewports", @@ -487,9 +486,20 @@ "blockquote", "blockquotes", "Blockquote", - "Blockquotes" + "Blockquotes", + "oger", + "lcovonly", + "gcov", + "WCAG", + "stackedplot", + "Andale", + "unnormalized", + "checksnapshots", + "specced", + "composables", + "countup" ], - "dictionaries": ["npm", "softwareTerms", "node", "html", "css", "bash", "en_US"], + "dictionaries": ["npm", "softwareTerms", "node", "html", "css", "bash", "en_US", "en-gb", "misc"], "ignorePaths": [ "package.json", "dist/**", @@ -500,4 +510,4 @@ "html-test-results", "test-results" ] -} \ No newline at end of file +} diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 6aa1fd0665..839df6c0f9 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -4,6 +4,10 @@ # Requires Git > 2.23 # See https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt +# vue-eslint update 2019 +14a0f84c1bcd56886d7c9e4e6afa8f7d292734e5 +# eslint changes 2022 +d80b6923541704ab925abf0047cbbc58735c27e2 # Copyright year update 2022 4a9744e916d24122a81092f6b7950054048ba860 # Copyright year update 2023 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f6728a7d26..563e893376 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,14 +8,16 @@ Closes + + + + diff --git a/example/dataVisualization/plugin.js b/example/dataVisualization/plugin.js new file mode 100644 index 0000000000..c10a11d176 --- /dev/null +++ b/example/dataVisualization/plugin.js @@ -0,0 +1,46 @@ +/***************************************************************************** + * Open MCT, Copyright (c) 2014-2024, 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 ExampleDataVisualizationSourceViewProvider from './ExampleDataVisualizationSourceViewProvider.js'; + +export default function () { + return function install(openmct) { + openmct.objectViews.addProvider(new ExampleDataVisualizationSourceViewProvider(openmct)); + + openmct.types.addType('exampleDataVisualizationSource', { + name: 'Example Data Visualization Source', + creatable: true, + description: 'An example data visualization source to be used with an inspector.', + cssClass: 'icon-telemetry', + initialize(domainObject) { + domainObject.composition = []; + } + }); + + openmct.composition.addPolicy((parent, child) => { + if (parent.type === 'exampleDataVisualizationSource') { + return Object.prototype.hasOwnProperty.call(child, 'telemetry'); + } else { + return true; + } + }); + }; +} diff --git a/example/eventGenerator/EventMetadataProvider.js b/example/eventGenerator/EventMetadataProvider.js index e234062bfd..c50f1fc9b3 100644 --- a/example/eventGenerator/EventMetadataProvider.js +++ b/example/eventGenerator/EventMetadataProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * diff --git a/example/eventGenerator/EventTelemetryProvider.js b/example/eventGenerator/EventTelemetryProvider.js index 701c32bcb6..2822a6a435 100644 --- a/example/eventGenerator/EventTelemetryProvider.js +++ b/example/eventGenerator/EventTelemetryProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * diff --git a/example/eventGenerator/plugin.js b/example/eventGenerator/plugin.js index 6da2c9c670..a8c051f6d0 100644 --- a/example/eventGenerator/plugin.js +++ b/example/eventGenerator/plugin.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,8 +19,8 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -import EventMetadataProvider from './EventMetadataProvider'; -import EventTelemetryProvider from './EventTelemetryProvider'; +import EventMetadataProvider from './EventMetadataProvider.js'; +import EventTelemetryProvider from './EventTelemetryProvider.js'; export default function EventGeneratorPlugin(options) { return function install(openmct) { diff --git a/example/eventGenerator/pluginSpec.js b/example/eventGenerator/pluginSpec.js index 2e4caee272..03ab637366 100644 --- a/example/eventGenerator/pluginSpec.js +++ b/example/eventGenerator/pluginSpec.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -19,7 +19,7 @@ * this source code distribution or the Licensing information page available * at runtime from the About dialog for additional information. *****************************************************************************/ -import { createOpenMct, resetApplicationState } from '../../src/utils/testing'; +import { createOpenMct, resetApplicationState } from '../../src/utils/testing.js'; import EventMessageGeneratorPlugin from './plugin.js'; describe('the plugin', () => { diff --git a/example/exampleTags/plugin.js b/example/exampleTags/plugin.js index 10b72274c0..2e2cd48060 100644 --- a/example/exampleTags/plugin.js +++ b/example/exampleTags/plugin.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * diff --git a/example/exampleUser/ExampleUserProvider.js b/example/exampleUser/ExampleUserProvider.js index 89f87d0e9c..d80735abd0 100644 --- a/example/exampleUser/ExampleUserProvider.js +++ b/example/exampleUser/ExampleUserProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -23,7 +23,7 @@ import EventEmitter from 'EventEmitter'; import { v4 as uuid } from 'uuid'; -import createExampleUser from './exampleUserCreator'; +import createExampleUser from './exampleUserCreator.js'; const STATUSES = [ { @@ -60,10 +60,22 @@ const STATUSES = [ statusFgColor: '#fff' } ]; + +const MISSION_STATUSES = [ + { + key: 0, + label: 'NO GO' + }, + { + key: 1, + label: 'GO' + } +]; /** * @implements {StatusUserProvider} */ export default class ExampleUserProvider extends EventEmitter { + #actionToStatusMap; constructor( openmct, { statusRoles } = { @@ -73,6 +85,11 @@ export default class ExampleUserProvider extends EventEmitter { super(); this.openmct = openmct; + this.#actionToStatusMap = { + Imagery: MISSION_STATUSES[0], + Commanding: MISSION_STATUSES[0], + Driving: MISSION_STATUSES[0] + }; this.user = undefined; this.loggedIn = false; this.autoLoginUser = undefined; @@ -110,6 +127,11 @@ export default class ExampleUserProvider extends EventEmitter { canSetPollQuestion() { return Promise.resolve(true); } + + canSetMissionStatus() { + return Promise.resolve(true); + } + hasRole(roleId) { if (!this.loggedIn) { Promise.resolve(undefined); @@ -122,6 +144,28 @@ export default class ExampleUserProvider extends EventEmitter { return this.user.getRoles(); } + getPossibleMissionActions() { + return Promise.resolve(Object.keys(this.#actionToStatusMap)); + } + + getPossibleMissionActionStatuses() { + return Promise.resolve(MISSION_STATUSES); + } + + getStatusForMissionAction(action) { + return Promise.resolve(this.#actionToStatusMap[action]); + } + + setStatusForMissionAction(action, status) { + this.#actionToStatusMap[action] = status; + this.emit('missionStatusChange', { + action, + status + }); + + return true; + } + getAllStatusRoles() { return Promise.resolve(this.statusRoles); } diff --git a/example/exampleUser/exampleUserCreator.js b/example/exampleUser/exampleUserCreator.js index 581ea10b7e..67d52d524c 100644 --- a/example/exampleUser/exampleUserCreator.js +++ b/example/exampleUser/exampleUserCreator.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * diff --git a/example/exampleUser/plugin.js b/example/exampleUser/plugin.js index ffbcae08ba..cd0469e2ed 100644 --- a/example/exampleUser/plugin.js +++ b/example/exampleUser/plugin.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import ExampleUserProvider from './ExampleUserProvider'; +import ExampleUserProvider from './ExampleUserProvider.js'; const AUTO_LOGIN_USER = 'mct-user'; const STATUS_ROLES = ['flight', 'driver']; diff --git a/example/exampleUser/pluginSpec.js b/example/exampleUser/pluginSpec.js index 0beddf32b9..199f7d00e8 100644 --- a/example/exampleUser/pluginSpec.js +++ b/example/exampleUser/pluginSpec.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,8 +20,8 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import { createOpenMct, resetApplicationState } from '../../src/utils/testing'; -import ExampleUserProvider from './ExampleUserProvider'; +import { createOpenMct, resetApplicationState } from '../../src/utils/testing.js'; +import ExampleUserProvider from './ExampleUserProvider.js'; describe('The Example User Plugin', () => { let openmct; diff --git a/example/faultManagement/exampleFaultSource.js b/example/faultManagement/exampleFaultSource.js index 20002b5221..1215549eb9 100644 --- a/example/faultManagement/exampleFaultSource.js +++ b/example/faultManagement/exampleFaultSource.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import utils from './utils'; +import utils from './utils.js'; export default function (staticFaults = false) { return function install(openmct) { diff --git a/example/faultManagement/pluginSpec.js b/example/faultManagement/pluginSpec.js index fa5e698ea8..e7751fee11 100644 --- a/example/faultManagement/pluginSpec.js +++ b/example/faultManagement/pluginSpec.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,7 +20,7 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import { createOpenMct, resetApplicationState } from '../../src/utils/testing'; +import { createOpenMct, resetApplicationState } from '../../src/utils/testing.js'; describe('The Example Fault Source Plugin', () => { let openmct; diff --git a/example/generator/GeneratorMetadataProvider.js b/example/generator/GeneratorMetadataProvider.js index fd12a1a7d0..51ec3cc88c 100644 --- a/example/generator/GeneratorMetadataProvider.js +++ b/example/generator/GeneratorMetadataProvider.js @@ -1,138 +1,134 @@ -define(['lodash'], function (_) { - var METADATA_BY_TYPE = { - generator: { - values: [ - { - key: 'name', - name: 'Name', - format: 'string' - }, - { - key: 'utc', - name: 'Time', - format: 'utc', - hints: { - domain: 1 - } - }, - { - key: 'yesterday', - name: 'Yesterday', - format: 'utc', - hints: { - domain: 2 - } - }, - { - key: 'wavelengths', - name: 'Wavelength', - unit: 'nm', - format: 'string[]', - hints: { - range: 4 - } - }, - // Need to enable "LocalTimeSystem" plugin to make use of this - // { - // key: "local", - // name: "Time", - // format: "local-format", - // source: "utc", - // hints: { - // domain: 3 - // } - // }, - { - key: 'sin', - name: 'Sine', - unit: 'Hz', - formatString: '%0.2f', - hints: { - range: 1 - } - }, - { - key: 'cos', - name: 'Cosine', - unit: 'deg', - formatString: '%0.2f', - hints: { - range: 2 - } - }, - { - key: 'intensities', - name: 'Intensities', - format: 'number[]', - hints: { - range: 3 - } +const METADATA_BY_TYPE = { + generator: { + values: [ + { + key: 'name', + name: 'Name', + format: 'string' + }, + { + key: 'utc', + name: 'Time', + format: 'utc', + hints: { + domain: 1 } - ] - }, - 'example.state-generator': { - values: [ - { - key: 'name', - name: 'Name', - format: 'string' - }, - { - key: 'utc', - name: 'Time', - format: 'utc', - hints: { - domain: 1 - } - }, - { - key: 'local', - name: 'Time', - format: 'utc', - source: 'utc', - hints: { - domain: 2 - } - }, - { - key: 'state', - source: 'value', - name: 'State', - format: 'enum', - enumerations: [ - { - value: 0, - string: 'OFF' - }, - { - value: 1, - string: 'ON' - } - ], - hints: { - range: 1 - } - }, - { - key: 'value', - name: 'Value', - hints: { - range: 2 - } + }, + { + key: 'yesterday', + name: 'Yesterday', + format: 'utc', + hints: { + domain: 2 } - ] - } - }; + }, + { + key: 'wavelengths', + name: 'Wavelength', + unit: 'nm', + format: 'string[]', + hints: { + range: 4 + } + }, + // Need to enable "LocalTimeSystem" plugin to make use of this + // { + // key: "local", + // name: "Time", + // format: "local-format", + // source: "utc", + // hints: { + // domain: 3 + // } + // }, + { + key: 'sin', + name: 'Sine', + unit: 'Hz', + formatString: '%0.2f', + hints: { + range: 1 + } + }, + { + key: 'cos', + name: 'Cosine', + unit: 'deg', + formatString: '%0.2f', + hints: { + range: 2 + } + }, + { + key: 'intensities', + name: 'Intensities', + format: 'number[]', + hints: { + range: 3 + } + } + ] + }, + 'example.state-generator': { + values: [ + { + key: 'name', + name: 'Name', + format: 'string' + }, + { + key: 'utc', + name: 'Time', + format: 'utc', + hints: { + domain: 1 + } + }, + { + key: 'local', + name: 'Time', + format: 'utc', + source: 'utc', + hints: { + domain: 2 + } + }, + { + key: 'state', + source: 'value', + name: 'State', + format: 'enum', + enumerations: [ + { + value: 0, + string: 'OFF' + }, + { + value: 1, + string: 'ON' + } + ], + hints: { + range: 1 + } + }, + { + key: 'value', + name: 'Value', + hints: { + range: 2 + } + } + ] + } +}; - function GeneratorMetadataProvider() {} +export default function GeneratorMetadataProvider() {} - GeneratorMetadataProvider.prototype.supportsMetadata = function (domainObject) { - return Object.prototype.hasOwnProperty.call(METADATA_BY_TYPE, domainObject.type); - }; +GeneratorMetadataProvider.prototype.supportsMetadata = function (domainObject) { + return Object.prototype.hasOwnProperty.call(METADATA_BY_TYPE, domainObject.type); +}; - GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) { - return Object.assign({}, domainObject.telemetry, METADATA_BY_TYPE[domainObject.type]); - }; - - return GeneratorMetadataProvider; -}); +GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) { + return Object.assign({}, domainObject.telemetry, METADATA_BY_TYPE[domainObject.type]); +}; diff --git a/example/generator/GeneratorProvider.js b/example/generator/GeneratorProvider.js index 2aeee687a2..42289e8cc9 100644 --- a/example/generator/GeneratorProvider.js +++ b/example/generator/GeneratorProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,86 +20,86 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define(['./WorkerInterface'], function (WorkerInterface) { - var REQUEST_DEFAULTS = { - amplitude: 1, - period: 10, - offset: 0, - dataRateInHz: 1, - randomness: 0, - phase: 0, - loadDelay: 0, - infinityValues: false, - exceedFloat32: false - }; +import WorkerInterface from './WorkerInterface.js'; - function GeneratorProvider(openmct, StalenessProvider) { - this.openmct = openmct; - this.workerInterface = new WorkerInterface(openmct, StalenessProvider); - } +const REQUEST_DEFAULTS = { + amplitude: 1, + period: 10, + offset: 0, + dataRateInHz: 1, + randomness: 0, + phase: 0, + loadDelay: 0, + infinityValues: false, + exceedFloat32: false +}; - GeneratorProvider.prototype.canProvideTelemetry = function (domainObject) { - return domainObject.type === 'generator'; - }; +export default function GeneratorProvider(openmct, StalenessProvider) { + this.openmct = openmct; + this.workerInterface = new WorkerInterface(openmct, StalenessProvider); +} - GeneratorProvider.prototype.supportsRequest = GeneratorProvider.prototype.supportsSubscribe = - GeneratorProvider.prototype.canProvideTelemetry; +GeneratorProvider.prototype.canProvideTelemetry = function (domainObject) { + return domainObject.type === 'generator'; +}; - GeneratorProvider.prototype.makeWorkerRequest = function (domainObject, request) { - var props = [ - 'amplitude', - 'period', - 'offset', - 'dataRateInHz', - 'randomness', - 'phase', - 'loadDelay', - 'infinityValues', - 'exceedFloat32' - ]; +GeneratorProvider.prototype.supportsRequest = GeneratorProvider.prototype.supportsSubscribe = + GeneratorProvider.prototype.canProvideTelemetry; - request = request || {}; +GeneratorProvider.prototype.makeWorkerRequest = function (domainObject, request) { + var props = [ + 'amplitude', + 'period', + 'offset', + 'dataRateInHz', + 'randomness', + 'phase', + 'loadDelay', + 'infinityValues', + 'exceedFloat32' + ]; - var workerRequest = {}; + request = request || {}; - props.forEach(function (prop) { - if ( - domainObject.telemetry && - Object.prototype.hasOwnProperty.call(domainObject.telemetry, prop) - ) { - workerRequest[prop] = domainObject.telemetry[prop]; - } + var workerRequest = {}; - if (request && Object.prototype.hasOwnProperty.call(request, prop)) { - workerRequest[prop] = request[prop]; - } + props.forEach(function (prop) { + if ( + domainObject.telemetry && + Object.prototype.hasOwnProperty.call(domainObject.telemetry, prop) + ) { + workerRequest[prop] = domainObject.telemetry[prop]; + } - if (!Object.prototype.hasOwnProperty.call(workerRequest, prop)) { - workerRequest[prop] = REQUEST_DEFAULTS[prop]; - } + if (request && Object.prototype.hasOwnProperty.call(request, prop)) { + workerRequest[prop] = request[prop]; + } - workerRequest[prop] = Number(workerRequest[prop]); - }); + if (!Object.prototype.hasOwnProperty.call(workerRequest, prop)) { + workerRequest[prop] = REQUEST_DEFAULTS[prop]; + } - workerRequest.id = this.openmct.objects.makeKeyString(domainObject.identifier); - workerRequest.name = domainObject.name; + workerRequest[prop] = Number(workerRequest[prop]); + }); - return workerRequest; - }; + workerRequest.id = this.openmct.objects.makeKeyString(domainObject.identifier); + workerRequest.name = domainObject.name; - GeneratorProvider.prototype.request = function (domainObject, request) { - var workerRequest = this.makeWorkerRequest(domainObject, request); - workerRequest.start = request.start; - workerRequest.end = request.end; + return workerRequest; +}; - return this.workerInterface.request(workerRequest); - }; +GeneratorProvider.prototype.request = function (domainObject, request) { + var workerRequest = this.makeWorkerRequest(domainObject, request); + workerRequest.start = request.start; + workerRequest.end = request.end; + workerRequest.size = request.size; + workerRequest.strategy = request.strategy; - GeneratorProvider.prototype.subscribe = function (domainObject, callback) { - var workerRequest = this.makeWorkerRequest(domainObject, {}); + return this.workerInterface.request(workerRequest); +}; - return this.workerInterface.subscribe(workerRequest, callback); - }; +GeneratorProvider.prototype.subscribe = function (domainObject, callback) { + var workerRequest = this.makeWorkerRequest(domainObject, {}); - return GeneratorProvider; -}); + return this.workerInterface.subscribe(workerRequest, callback); +}; diff --git a/example/generator/SinewaveLimitProvider.js b/example/generator/SinewaveLimitProvider.js index 3f71747f8f..961955ee2d 100644 --- a/example/generator/SinewaveLimitProvider.js +++ b/example/generator/SinewaveLimitProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,147 +20,143 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define([], function () { - var PURPLE = { - sin: 2.2, - cos: 2.2 +var PURPLE = { + sin: 2.2, + cos: 2.2 + }, + RED = { + sin: 0.9, + cos: 0.9 + }, + ORANGE = { + sin: 0.7, + cos: 0.7 + }, + YELLOW = { + sin: 0.5, + cos: 0.5 + }, + CYAN = { + sin: 0.45, + cos: 0.45 + }, + LIMITS = { + rh: { + cssClass: 'is-limit--upr is-limit--red', + low: RED, + high: Number.POSITIVE_INFINITY, + name: 'Red High' }, - RED = { - sin: 0.9, - cos: 0.9 + rl: { + cssClass: 'is-limit--lwr is-limit--red', + high: -RED, + low: Number.NEGATIVE_INFINITY, + name: 'Red Low' }, - ORANGE = { - sin: 0.7, - cos: 0.7 + yh: { + cssClass: 'is-limit--upr is-limit--yellow', + low: YELLOW, + high: RED, + name: 'Yellow High' }, - YELLOW = { - sin: 0.5, - cos: 0.5 - }, - CYAN = { - sin: 0.45, - cos: 0.45 - }, - LIMITS = { - rh: { - cssClass: 'is-limit--upr is-limit--red', - low: RED, - high: Number.POSITIVE_INFINITY, - name: 'Red High' - }, - rl: { - cssClass: 'is-limit--lwr is-limit--red', - high: -RED, - low: Number.NEGATIVE_INFINITY, - name: 'Red Low' - }, - yh: { - cssClass: 'is-limit--upr is-limit--yellow', - low: YELLOW, - high: RED, - name: 'Yellow High' - }, - yl: { - cssClass: 'is-limit--lwr is-limit--yellow', - low: -RED, - high: -YELLOW, - name: 'Yellow Low' - } - }; - - function SinewaveLimitProvider() {} - - SinewaveLimitProvider.prototype.supportsLimits = function (domainObject) { - return domainObject.type === 'generator'; + yl: { + cssClass: 'is-limit--lwr is-limit--yellow', + low: -RED, + high: -YELLOW, + name: 'Yellow Low' + } }; - SinewaveLimitProvider.prototype.getLimitEvaluator = function (domainObject) { - return { - evaluate: function (datum, valueMetadata) { - var range = valueMetadata && valueMetadata.key; +export default function SinewaveLimitProvider() {} - if (datum[range] > RED[range]) { - return LIMITS.rh; - } +SinewaveLimitProvider.prototype.supportsLimits = function (domainObject) { + return domainObject.type === 'generator'; +}; - if (datum[range] < -RED[range]) { - return LIMITS.rl; - } +SinewaveLimitProvider.prototype.getLimitEvaluator = function (domainObject) { + return { + evaluate: function (datum, valueMetadata) { + var range = valueMetadata && valueMetadata.key; - if (datum[range] > YELLOW[range]) { - return LIMITS.yh; - } - - if (datum[range] < -YELLOW[range]) { - return LIMITS.yl; - } + if (datum[range] > RED[range]) { + return LIMITS.rh; } - }; - }; - SinewaveLimitProvider.prototype.getLimits = function (domainObject) { - return { - limits: function () { - return Promise.resolve({ - WATCH: { - low: { - color: 'cyan', - sin: -CYAN.sin, - cos: -CYAN.cos - }, - high: { - color: 'cyan', - ...CYAN - } + if (datum[range] < -RED[range]) { + return LIMITS.rl; + } + + if (datum[range] > YELLOW[range]) { + return LIMITS.yh; + } + + if (datum[range] < -YELLOW[range]) { + return LIMITS.yl; + } + } + }; +}; + +SinewaveLimitProvider.prototype.getLimits = function (domainObject) { + return { + limits: function () { + return Promise.resolve({ + WATCH: { + low: { + color: 'cyan', + sin: -CYAN.sin, + cos: -CYAN.cos }, - WARNING: { - low: { - color: 'yellow', - sin: -YELLOW.sin, - cos: -YELLOW.cos - }, - high: { - color: 'yellow', - ...YELLOW - } - }, - DISTRESS: { - low: { - color: 'orange', - sin: -ORANGE.sin, - cos: -ORANGE.cos - }, - high: { - color: 'orange', - ...ORANGE - } - }, - CRITICAL: { - low: { - color: 'red', - sin: -RED.sin, - cos: -RED.cos - }, - high: { - color: 'red', - ...RED - } - }, - SEVERE: { - low: { - color: 'purple', - sin: -PURPLE.sin, - cos: -PURPLE.cos - }, - high: { - color: 'purple', - ...PURPLE - } + high: { + color: 'cyan', + ...CYAN } - }); - } - }; + }, + WARNING: { + low: { + color: 'yellow', + sin: -YELLOW.sin, + cos: -YELLOW.cos + }, + high: { + color: 'yellow', + ...YELLOW + } + }, + DISTRESS: { + low: { + color: 'orange', + sin: -ORANGE.sin, + cos: -ORANGE.cos + }, + high: { + color: 'orange', + ...ORANGE + } + }, + CRITICAL: { + low: { + color: 'red', + sin: -RED.sin, + cos: -RED.cos + }, + high: { + color: 'red', + ...RED + } + }, + SEVERE: { + low: { + color: 'purple', + sin: -PURPLE.sin, + cos: -PURPLE.cos + }, + high: { + color: 'purple', + ...PURPLE + } + } + }); + } }; - - return SinewaveLimitProvider; -}); +}; diff --git a/example/generator/SinewaveStalenessProvider.js b/example/generator/SinewaveStalenessProvider.js index 8819ae28ca..27f6ce96d4 100644 --- a/example/generator/SinewaveStalenessProvider.js +++ b/example/generator/SinewaveStalenessProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * diff --git a/example/generator/StateGeneratorProvider.js b/example/generator/StateGeneratorProvider.js index c840e6bb99..5da3b650c5 100644 --- a/example/generator/StateGeneratorProvider.js +++ b/example/generator/StateGeneratorProvider.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,56 +20,52 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define([], function () { - function StateGeneratorProvider() {} +export default function StateGeneratorProvider() {} - function pointForTimestamp(timestamp, duration, name) { - return { - name: name, - utc: Math.floor(timestamp / duration) * duration, - value: Math.floor(timestamp / duration) % 2 - }; +function pointForTimestamp(timestamp, duration, name) { + return { + name: name, + utc: Math.floor(timestamp / duration) * duration, + value: Math.floor(timestamp / duration) % 2 + }; +} + +StateGeneratorProvider.prototype.supportsSubscribe = function (domainObject) { + return domainObject.type === 'example.state-generator'; +}; + +StateGeneratorProvider.prototype.subscribe = function (domainObject, callback) { + var duration = domainObject.telemetry.duration * 1000; + + var interval = setInterval(function () { + var now = Date.now(); + var datum = pointForTimestamp(now, duration, domainObject.name); + datum.value = String(datum.value); + callback(datum); + }, duration); + + return function () { + clearInterval(interval); + }; +}; + +StateGeneratorProvider.prototype.supportsRequest = function (domainObject, options) { + return domainObject.type === 'example.state-generator'; +}; + +StateGeneratorProvider.prototype.request = function (domainObject, options) { + var start = options.start; + var end = Math.min(Date.now(), options.end); // no future values + var duration = domainObject.telemetry.duration * 1000; + if (options.strategy === 'latest' || options.size === 1) { + start = end; } - StateGeneratorProvider.prototype.supportsSubscribe = function (domainObject) { - return domainObject.type === 'example.state-generator'; - }; + var data = []; + while (start <= end && data.length < 5000) { + data.push(pointForTimestamp(start, duration, domainObject.name)); + start += duration; + } - StateGeneratorProvider.prototype.subscribe = function (domainObject, callback) { - var duration = domainObject.telemetry.duration * 1000; - - var interval = setInterval(function () { - var now = Date.now(); - var datum = pointForTimestamp(now, duration, domainObject.name); - datum.value = String(datum.value); - callback(datum); - }, duration); - - return function () { - clearInterval(interval); - }; - }; - - StateGeneratorProvider.prototype.supportsRequest = function (domainObject, options) { - return domainObject.type === 'example.state-generator'; - }; - - StateGeneratorProvider.prototype.request = function (domainObject, options) { - var start = options.start; - var end = Math.min(Date.now(), options.end); // no future values - var duration = domainObject.telemetry.duration * 1000; - if (options.strategy === 'latest' || options.size === 1) { - start = end; - } - - var data = []; - while (start <= end && data.length < 5000) { - data.push(pointForTimestamp(start, duration, domainObject.name)); - start += duration; - } - - return Promise.resolve(data); - }; - - return StateGeneratorProvider; -}); + return Promise.resolve(data); +}; diff --git a/example/generator/WorkerInterface.js b/example/generator/WorkerInterface.js index d02546d34a..c5b8e85d61 100644 --- a/example/generator/WorkerInterface.js +++ b/example/generator/WorkerInterface.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,88 +20,86 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -define(['uuid'], function ({ v4: uuid }) { - function WorkerInterface(openmct, StalenessProvider) { - // eslint-disable-next-line no-undef - const workerUrl = `${openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}generatorWorker.js`; - this.StalenessProvider = StalenessProvider; - this.worker = new Worker(workerUrl); - this.worker.onmessage = this.onMessage.bind(this); - this.callbacks = {}; - this.staleTelemetryIds = {}; +import { v4 as uuid } from 'uuid'; - this.watchStaleness(); +export default function WorkerInterface(openmct, StalenessProvider) { + // eslint-disable-next-line no-undef + const workerUrl = `${openmct.getAssetPath()}${__OPENMCT_ROOT_RELATIVE__}generatorWorker.js`; + this.StalenessProvider = StalenessProvider; + this.worker = new Worker(workerUrl); + this.worker.onmessage = this.onMessage.bind(this); + this.callbacks = {}; + this.staleTelemetryIds = {}; + + this.watchStaleness(); +} + +WorkerInterface.prototype.watchStaleness = function () { + this.StalenessProvider.on('stalenessEvent', ({ id, isStale }) => { + this.staleTelemetryIds[id] = isStale; + }); +}; + +WorkerInterface.prototype.onMessage = function (message) { + message = message.data; + var callback = this.callbacks[message.id]; + if (callback) { + callback(message); + } +}; + +WorkerInterface.prototype.dispatch = function (request, data, callback) { + var message = { + request: request, + data: data, + id: uuid() + }; + + if (callback) { + this.callbacks[message.id] = callback; } - WorkerInterface.prototype.watchStaleness = function () { - this.StalenessProvider.on('stalenessEvent', ({ id, isStale }) => { - this.staleTelemetryIds[id] = isStale; - }); - }; + this.worker.postMessage(message); - WorkerInterface.prototype.onMessage = function (message) { - message = message.data; - var callback = this.callbacks[message.id]; - if (callback) { - callback(message); - } - }; + return message.id; +}; - WorkerInterface.prototype.dispatch = function (request, data, callback) { - var message = { - request: request, - data: data, - id: uuid() - }; +WorkerInterface.prototype.request = function (request) { + var deferred = {}; + var promise = new Promise(function (resolve, reject) { + deferred.resolve = resolve; + deferred.reject = reject; + }); + var messageId; - if (callback) { - this.callbacks[message.id] = callback; + let self = this; + function callback(message) { + if (message.error) { + deferred.reject(message.error); + } else { + deferred.resolve(message.data); } - this.worker.postMessage(message); + delete self.callbacks[messageId]; + } - return message.id; - }; + messageId = this.dispatch('request', request, callback.bind(this)); - WorkerInterface.prototype.request = function (request) { - var deferred = {}; - var promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }); - var messageId; + return promise; +}; - let self = this; - function callback(message) { - if (message.error) { - deferred.reject(message.error); - } else { - deferred.resolve(message.data); - } - - delete self.callbacks[messageId]; +WorkerInterface.prototype.subscribe = function (request, cb) { + const { id, loadDelay } = request; + const messageId = this.dispatch('subscribe', request, (message) => { + if (!this.staleTelemetryIds[id]) { + setTimeout(() => cb(message.data), Math.max(loadDelay, 0)); } + }); - messageId = this.dispatch('request', request, callback.bind(this)); - - return promise; - }; - - WorkerInterface.prototype.subscribe = function (request, cb) { - const { id, loadDelay } = request; - const messageId = this.dispatch('subscribe', request, (message) => { - if (!this.staleTelemetryIds[id]) { - setTimeout(() => cb(message.data), Math.max(loadDelay, 0)); - } + return function () { + this.dispatch('unsubscribe', { + id: messageId }); - - return function () { - this.dispatch('unsubscribe', { - id: messageId - }); - delete this.callbacks[messageId]; - }.bind(this); - }; - - return WorkerInterface; -}); + delete this.callbacks[messageId]; + }.bind(this); +}; diff --git a/example/generator/generatorWorker.js b/example/generator/generatorWorker.js index 024f54032d..d103a25895 100644 --- a/example/generator/generatorWorker.js +++ b/example/generator/generatorWorker.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -130,48 +130,37 @@ var now = Date.now(); var start = request.start; var end = request.end > now ? now : request.end; - var amplitude = request.amplitude; var period = request.period; - var offset = request.offset; var dataRateInHz = request.dataRateInHz; - var phase = request.phase; - var randomness = request.randomness; var loadDelay = Math.max(request.loadDelay, 0); - var infinityValues = request.infinityValues; - var exceedFloat32 = request.exceedFloat32; - + var size = request.size; + var duration = end - start; var step = 1000 / dataRateInHz; + var maxPoints = Math.floor(duration / step); var nextStep = start - (start % step) + step; var data = []; - for (; nextStep < end && data.length < 5000; nextStep += step) { - data.push({ - utc: nextStep, - yesterday: nextStep - 60 * 60 * 24 * 1000, - sin: sin( - nextStep, - period, - amplitude, - offset, - phase, - randomness, - infinityValues, - exceedFloat32 - ), - wavelengths: wavelengths(), - intensities: intensities(), - cos: cos( - nextStep, - period, - amplitude, - offset, - phase, - randomness, - infinityValues, - exceedFloat32 - ) - }); + if (request.strategy === 'minmax' && size) { + // Calculate the number of cycles to include based on size (2 points per cycle) + var totalCycles = Math.min(Math.floor(size / 2), Math.floor(duration / period)); + + for (let cycle = 0; cycle < totalCycles; cycle++) { + // Distribute cycles evenly across the time range + let cycleStart = start + (duration / totalCycles) * cycle; + let minPointTime = cycleStart; // Assuming min at the start of the cycle + let maxPointTime = cycleStart + period / 2; // Assuming max at the halfway of the cycle + + data.push(createDataPoint(minPointTime, request), createDataPoint(maxPointTime, request)); + } + } else { + for (let i = 0; i < maxPoints && nextStep < end; i++, nextStep += step) { + data.push(createDataPoint(nextStep, request)); + } + } + + if (request.strategy !== 'minmax' && size) { + data = data.slice(-size); } if (loadDelay === 0) { @@ -181,6 +170,35 @@ } } + function createDataPoint(time, request) { + return { + utc: time, + yesterday: time - 60 * 60 * 24 * 1000, + sin: sin( + time, + request.period, + request.amplitude, + request.offset, + request.phase, + request.randomness, + request.infinityValues, + request.exceedFloat32 + ), + wavelengths: wavelengths(), + intensities: intensities(), + cos: cos( + time, + request.period, + request.amplitude, + request.offset, + request.phase, + request.randomness, + request.infinityValues, + request.exceedFloat32 + ) + }; + } + function postOnRequest(message, request, data) { self.postMessage({ id: message.id, diff --git a/example/generator/plugin.js b/example/generator/plugin.js index 6f60cd83d4..175bda4150 100644 --- a/example/generator/plugin.js +++ b/example/generator/plugin.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -20,11 +20,11 @@ * at runtime from the About dialog for additional information. *****************************************************************************/ -import GeneratorMetadataProvider from './GeneratorMetadataProvider'; -import GeneratorProvider from './GeneratorProvider'; -import SinewaveLimitProvider from './SinewaveLimitProvider'; -import SinewaveStalenessProvider from './SinewaveStalenessProvider'; -import StateGeneratorProvider from './StateGeneratorProvider'; +import GeneratorMetadataProvider from './GeneratorMetadataProvider.js'; +import GeneratorProvider from './GeneratorProvider.js'; +import SinewaveLimitProvider from './SinewaveLimitProvider.js'; +import SinewaveStalenessProvider from './SinewaveStalenessProvider.js'; +import StateGeneratorProvider from './StateGeneratorProvider.js'; export default function (openmct) { openmct.types.addType('example.state-generator', { diff --git a/example/imagery/plugin.js b/example/imagery/plugin.js index ee2fe33f8c..9d37bbc925 100644 --- a/example/imagery/plugin.js +++ b/example/imagery/plugin.js @@ -1,5 +1,5 @@ /***************************************************************************** - * Open MCT, Copyright (c) 2014-2023, United States Government + * Open MCT, Copyright (c) 2014-2024, United States Government * as represented by the Administrator of the National Aeronautics and Space * Administration. All rights reserved. * @@ -21,24 +21,24 @@ *****************************************************************************/ const DEFAULT_IMAGE_SAMPLES = [ - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18731.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18732.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18733.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18734.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18735.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18736.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18737.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18738.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18739.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18740.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18741.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18742.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18743.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18744.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18745.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18746.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18747.jpg', - 'https://www.hq.nasa.gov/alsj/a16/AS16-117-18748.jpg' + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18731.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18732.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18733.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18734.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18735.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18736.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18737.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18738.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18739.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18740.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18741.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18742.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18743.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18744.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18745.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18746.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18747.jpg', + 'https://www.nasa.gov/wp-content/uploads/static/history/alsj/a16/AS16-117-18748.jpg' ]; const DEFAULT_IMAGE_LOAD_DELAY_IN_MILLISECONDS = 20000; const MIN_IMAGE_LOAD_DELAY_IN_MILLISECONDS = 5000; diff --git a/index-test.js b/index-test.cjs similarity index 100% rename from index-test.js rename to index-test.cjs diff --git a/index.html b/index.html index 9233eadfbd..e3dfda5228 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ + Open MCT @@ -91,157 +89,157 @@ width: 100px; } +
- diff --git a/karma.conf.js b/karma.conf.cjs similarity index 92% rename from karma.conf.js rename to karma.conf.cjs index b169af51dd..33e11e3eda 100644 --- a/karma.conf.js +++ b/karma.conf.cjs @@ -22,17 +22,17 @@ /*global module,process*/ -module.exports = (config) => { +module.exports = async (config) => { let webpackConfig; let browsers; let singleRun; if (process.env.KARMA_DEBUG) { - webpackConfig = require('./.webpack/webpack.dev.js'); + webpackConfig = (await import('./.webpack/webpack.dev.js')).default; browsers = ['ChromeDebugging']; singleRun = false; } else { - webpackConfig = require('./.webpack/webpack.coverage.js'); + webpackConfig = (await import('./.webpack/webpack.coverage.js')).default; browsers = ['ChromeHeadless']; singleRun = true; } @@ -45,7 +45,7 @@ module.exports = (config) => { basePath: '', frameworks: ['jasmine', 'webpack'], files: [ - 'index-test.js', + 'index-test.cjs', // included means: should the files be included in the browser using diff --git a/src/api/menu/components/SuperMenu.vue b/src/api/menu/components/SuperMenu.vue index 808750d8ca..1bbdaf940e 100644 --- a/src/api/menu/components/SuperMenu.vue +++ b/src/api/menu/components/SuperMenu.vue @@ -1,5 +1,5 @@ diff --git a/src/plugins/folderView/components/ListItem.vue b/src/plugins/folderView/components/ListItem.vue index 72044a1968..c9332487a9 100644 --- a/src/plugins/folderView/components/ListItem.vue +++ b/src/plugins/folderView/components/ListItem.vue @@ -1,5 +1,5 @@