mirror of
https://github.com/nasa/openmct.git
synced 2025-06-30 04:33:03 +00:00
Compare commits
28 Commits
troublesho
...
static-roo
Author | SHA1 | Date | |
---|---|---|---|
7a0041b663 | |||
44f5372c31 | |||
2f292fbd07 | |||
205dc67809 | |||
169c23dbcc | |||
457cd42987 | |||
45373c56f7 | |||
91e909bb4a | |||
556f762d20 | |||
e14b7cd0e2 | |||
b1cffd0df3 | |||
09f25bc525 | |||
bd406d1a73 | |||
03380e1846 | |||
dcaad40064 | |||
cf47f7c1b2 | |||
ba2a6030c2 | |||
384af89d4c | |||
324318793d | |||
f211d3fab0 | |||
6aaf4a2c06 | |||
4a9744e916 | |||
05b73bb654 | |||
19b3be7ec0 | |||
c39593b065 | |||
f62d834384 | |||
7a7202f75b | |||
6bcc9bfd84 |
@ -2,7 +2,7 @@ version: 2.1
|
|||||||
executors:
|
executors:
|
||||||
pw-focal-development:
|
pw-focal-development:
|
||||||
docker:
|
docker:
|
||||||
- image: mcr.microsoft.com/playwright:v1.17.2-focal
|
- image: mcr.microsoft.com/playwright:v1.18.0-focal
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
|
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
|
||||||
parameters:
|
parameters:
|
||||||
|
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,3 +1,9 @@
|
|||||||
|
<!--- Note: Please open the PR in draft form until you are ready for active review. -->
|
||||||
|
Closes: <!--- Insert Issue Number(s) this PR addresses. Start by typing # will open a dropdown of recent issues. -->
|
||||||
|
|
||||||
|
### Describe your changes:
|
||||||
|
<!--- Describe your changes and add any comments about your approach either here or inline if code comments aren't added -->
|
||||||
|
|
||||||
### All Submissions:
|
### All Submissions:
|
||||||
|
|
||||||
* [ ] Have you followed the guidelines in our [Contributing document](https://github.com/nasa/openmct/blob/master/CONTRIBUTING.md)?
|
* [ ] Have you followed the guidelines in our [Contributing document](https://github.com/nasa/openmct/blob/master/CONTRIBUTING.md)?
|
||||||
@ -11,3 +17,13 @@
|
|||||||
* [ ] Command line build passes?
|
* [ ] Command line build passes?
|
||||||
* [ ] Has this been smoke tested?
|
* [ ] Has this been smoke tested?
|
||||||
* [ ] Testing instructions included in associated issue?
|
* [ ] Testing instructions included in associated issue?
|
||||||
|
|
||||||
|
### Reviewer Checklist
|
||||||
|
|
||||||
|
* [ ] Changes appear to address issue?
|
||||||
|
* [ ] Changes appear not to be breaking changes?
|
||||||
|
* [ ] Appropriate unit tests included?
|
||||||
|
* [ ] Code style and in-line documentation are appropriate?
|
||||||
|
* [ ] Commit messages meet standards?
|
||||||
|
* [ ] Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
|
||||||
|
* [ ] Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)
|
||||||
|
1
.github/dependabot.yml
vendored
1
.github/dependabot.yml
vendored
@ -25,3 +25,4 @@ updates:
|
|||||||
labels:
|
labels:
|
||||||
- "type:maintenance"
|
- "type:maintenance"
|
||||||
- "dependencies"
|
- "dependencies"
|
||||||
|
- "prcop:disable"
|
||||||
|
1
.github/workflows/e2e-pr.yml
vendored
1
.github/workflows/e2e-pr.yml
vendored
@ -23,6 +23,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14'
|
||||||
|
- run: npx playwright install-deps
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run test:e2e:full
|
- run: npm run test:e2e:full
|
||||||
- name: Archive test results
|
- name: Archive test results
|
||||||
|
1
.github/workflows/e2e-visual.yml
vendored
1
.github/workflows/e2e-visual.yml
vendored
@ -16,6 +16,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14'
|
||||||
|
- run: npx playwright install-deps
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- name: Run the e2e visual tests
|
- name: Run the e2e visual tests
|
||||||
run: npm run test:e2e:visual
|
run: npm run test:e2e:visual
|
||||||
|
19
.github/workflows/prcop-config.json
vendored
Normal file
19
.github/workflows/prcop-config.json
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"linters": [
|
||||||
|
{
|
||||||
|
"name": "descriptionRegexp",
|
||||||
|
"config": {
|
||||||
|
"regexp": "x] Testing instructions",
|
||||||
|
"errorMessage": ":police_officer: PR Description does not confirm that associated issue(s) contain Testing instructions"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "descriptionMinWords",
|
||||||
|
"config": {
|
||||||
|
"minWordsCount": 160,
|
||||||
|
"errorMessage": ":police_officer: Please, be sure to use existing PR template."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"disableWord": "prcop:disable"
|
||||||
|
}
|
23
.github/workflows/prcop.yml
vendored
Normal file
23
.github/workflows/prcop.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: PRcop
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- edited
|
||||||
|
- synchronize
|
||||||
|
- ready_for_review
|
||||||
|
- review_requested
|
||||||
|
pull_request_review_comment:
|
||||||
|
types:
|
||||||
|
- created
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prcop:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: PRcop
|
||||||
|
steps:
|
||||||
|
- name: Linting Pull Request
|
||||||
|
uses: makaroni4/prcop@v1.0.35
|
||||||
|
with:
|
||||||
|
config-file: ".github/workflows/prcop-config.json"
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@ -1,6 +1,6 @@
|
|||||||
# Open MCT License
|
# Open MCT License
|
||||||
|
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All rights reserved.
|
Open MCT, Copyright (c) 2014-2022, 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.
|
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.
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Building and running Open MCT in your local dev environment is very easy. Be sur
|
|||||||
|
|
||||||
`git clone https://github.com/nasa/openmct.git`
|
`git clone https://github.com/nasa/openmct.git`
|
||||||
|
|
||||||
2. Install development dependencies
|
2. Install development dependencies. Note: Check the package.json engine for our tested and supported node versions.
|
||||||
|
|
||||||
`npm install`
|
`npm install`
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#*****************************************************************************
|
#*****************************************************************************
|
||||||
#* Open MCT, Copyright (c) 2014-2021, United States Government
|
#* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
#* as represented by the Administrator of the National Aeronautics and Space
|
#* as represented by the Administrator of the National Aeronautics and Space
|
||||||
#* Administration. All rights reserved.
|
#* Administration. All rights reserved.
|
||||||
#*
|
#*
|
@ -14,8 +14,6 @@ coverage:
|
|||||||
range: "66...100"
|
range: "66...100"
|
||||||
|
|
||||||
ignore:
|
ignore:
|
||||||
- "**/*Spec.js"
|
|
||||||
- "e2e"
|
|
||||||
|
|
||||||
parsers:
|
parsers:
|
||||||
gcov:
|
gcov:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1 +0,0 @@
|
|||||||
## doc dump
|
|
@ -28,11 +28,9 @@ components. Tests are subject to code review along with the actual
|
|||||||
implementation, to ensure that tests are applicable and useful.
|
implementation, to ensure that tests are applicable and useful.
|
||||||
|
|
||||||
Unit tests should meet
|
Unit tests should meet
|
||||||
[test standards](CONTRIBUTING.md#test-standards)
|
[test standards](https://github.com/nasa/openmctweb/blob/master/CONTRIBUTING.md#test-standards)
|
||||||
as described in the contributing guide.
|
as described in the contributing guide.
|
||||||
|
|
||||||
More about unit testing
|
|
||||||
|
|
||||||
### User Testing
|
### User Testing
|
||||||
|
|
||||||
User testing is performed at scheduled times involving target users
|
User testing is performed at scheduled times involving target users
|
||||||
@ -95,7 +93,7 @@ Before changes are merged, the author of the changes must perform:
|
|||||||
|
|
||||||
Changes are not merged until the author has affirmed that both
|
Changes are not merged until the author has affirmed that both
|
||||||
forms of testing have been performed successfully; this is documented
|
forms of testing have been performed successfully; this is documented
|
||||||
by the [Author Checklist](CONTRIBUTING.md#author-checklist).
|
by the [Author Checklist](https://github.com/nasa/openmctweb/blob/master/CONTRIBUTING.md#author-checklist).
|
||||||
|
|
||||||
### Per-sprint Testing
|
### Per-sprint Testing
|
||||||
|
|
||||||
@ -137,7 +135,7 @@ For per-sprint testing, a testathon is typically performed at the beginning of t
|
|||||||
#### Process
|
#### Process
|
||||||
|
|
||||||
1. Prior to the scheduled testathon, a list will be compiled of all issues that are closed and unverified.
|
1. Prior to the scheduled testathon, a list will be compiled of all issues that are closed and unverified.
|
||||||
2. For each issue, testers should review the associated PR for testing instructions. See the contributing guide for instructions on [pull requests](CONTRIBUTING.md#merging).
|
2. For each issue, testers should review the associated PR for testing instructions. See the contributing guide for instructions on [pull requests](https://github.com/nasa/openmct/blob/master/CONTRIBUTING.md#merging).
|
||||||
3. As each issue is verified via testing, any team members testing it should leave a comment on that issue indicating that it has been verified fixed.
|
3. As each issue is verified via testing, any team members testing it should leave a comment on that issue indicating that it has been verified fixed.
|
||||||
4. If a bug is found that relates to an issue being tested, notes should be included on the associated issue, and the issue should be reopened. Bug notes should include reproduction steps.
|
4. If a bug is found that relates to an issue being tested, notes should be included on the associated issue, and the issue should be reopened. Bug notes should include reproduction steps.
|
||||||
5. For any bugs that are not obviously related to any of the issues under test, a new issue should be created with details about the bug, including reproduction steps. If unsure about whether a bug relates to an issue being tested, just create a new issue.
|
5. For any bugs that are not obviously related to any of the issues under test, a new issue should be created with details about the bug, including reproduction steps. If unsure about whether a bug relates to an issue being tested, just create a new issue.
|
||||||
|
5
e2e/.percy.yml
Normal file
5
e2e/.percy.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
version: 2
|
||||||
|
snapshot:
|
||||||
|
widths: [1024, 2000]
|
||||||
|
min-height: 1440 # px
|
||||||
|
|
@ -2,6 +2,8 @@
|
|||||||
// playwright.config.js
|
// playwright.config.js
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
|
const { devices } = require('@playwright/test');
|
||||||
|
|
||||||
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
retries: 2,
|
retries: 2,
|
||||||
@ -15,7 +17,6 @@ const config = {
|
|||||||
},
|
},
|
||||||
workers: 2, //Limit to 2 for CircleCI Agent
|
workers: 2, //Limit to 2 for CircleCI Agent
|
||||||
use: {
|
use: {
|
||||||
browserName: "chromium",
|
|
||||||
baseURL: 'http://localhost:8080/',
|
baseURL: 'http://localhost:8080/',
|
||||||
headless: true,
|
headless: true,
|
||||||
ignoreHTTPSErrors: true,
|
ignoreHTTPSErrors: true,
|
||||||
@ -23,10 +24,37 @@ const config = {
|
|||||||
trace: 'on',
|
trace: 'on',
|
||||||
video: 'on'
|
video: 'on'
|
||||||
},
|
},
|
||||||
|
projects: [
|
||||||
|
{
|
||||||
|
name: 'chrome',
|
||||||
|
use: {
|
||||||
|
browserName: 'chromium',
|
||||||
|
...devices['Desktop Chrome']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'MMOC',
|
||||||
|
use: {
|
||||||
|
browserName: 'chromium',
|
||||||
|
viewport: {
|
||||||
|
width: 2560,
|
||||||
|
height: 1440
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*{
|
||||||
|
name: 'ipad',
|
||||||
|
use: {
|
||||||
|
browserName: 'webkit',
|
||||||
|
...devices['iPad (gen 7) landscape'] // Complete List https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
],
|
||||||
reporter: [
|
reporter: [
|
||||||
['list'],
|
['list'],
|
||||||
['junit', { outputFile: 'test-results/results.xml' }],
|
['junit', { outputFile: 'test-results/results.xml' }],
|
||||||
['allure-playwright']
|
['allure-playwright'],
|
||||||
|
['github']
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
// playwright.config.js
|
// playwright.config.js
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
|
const { devices } = require('@playwright/test');
|
||||||
|
|
||||||
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
||||||
const config = {
|
const config = {
|
||||||
retries: 0,
|
retries: 0,
|
||||||
@ -13,6 +15,7 @@ const config = {
|
|||||||
timeout: 120 * 1000,
|
timeout: 120 * 1000,
|
||||||
reuseExistingServer: !process.env.CI
|
reuseExistingServer: !process.env.CI
|
||||||
},
|
},
|
||||||
|
workers: 1,
|
||||||
use: {
|
use: {
|
||||||
browserName: "chromium",
|
browserName: "chromium",
|
||||||
baseURL: 'http://localhost:8080/',
|
baseURL: 'http://localhost:8080/',
|
||||||
@ -22,6 +25,32 @@ const config = {
|
|||||||
trace: 'on',
|
trace: 'on',
|
||||||
video: 'on'
|
video: 'on'
|
||||||
},
|
},
|
||||||
|
projects: [
|
||||||
|
{
|
||||||
|
name: 'chrome',
|
||||||
|
use: {
|
||||||
|
browserName: 'chromium',
|
||||||
|
...devices['Desktop Chrome']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'MMOC',
|
||||||
|
use: {
|
||||||
|
browserName: 'chromium',
|
||||||
|
viewport: {
|
||||||
|
width: 2560,
|
||||||
|
height: 1440
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*{
|
||||||
|
name: 'ipad',
|
||||||
|
use: {
|
||||||
|
browserName: 'webkit',
|
||||||
|
...devices['iPad (gen 7) landscape'] // Complete List https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
],
|
||||||
reporter: [
|
reporter: [
|
||||||
['list'],
|
['list'],
|
||||||
['allure-playwright']
|
['allure-playwright']
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
64
example/eventGenerator/EventMetadataProvider.js
Normal file
64
example/eventGenerator/EventMetadataProvider.js
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
class EventMetadataProvider {
|
||||||
|
constructor() {
|
||||||
|
this.METADATA_BY_TYPE = {
|
||||||
|
'eventGenerator': {
|
||||||
|
values: [
|
||||||
|
{
|
||||||
|
key: "name",
|
||||||
|
name: "Name",
|
||||||
|
format: "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "utc",
|
||||||
|
name: "Time",
|
||||||
|
format: "utc",
|
||||||
|
hints: {
|
||||||
|
domain: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "message",
|
||||||
|
name: "Message",
|
||||||
|
format: "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
supportsMetadata(domainObject) {
|
||||||
|
return Object.prototype.hasOwnProperty.call(this.METADATA_BY_TYPE, domainObject.type);
|
||||||
|
}
|
||||||
|
|
||||||
|
getMetadata(domainObject) {
|
||||||
|
return Object.assign(
|
||||||
|
{},
|
||||||
|
domainObject.telemetry,
|
||||||
|
this.METADATA_BY_TYPE[domainObject.type]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EventMetadataProvider;
|
96
example/eventGenerator/EventTelemetryProvider.js
Normal file
96
example/eventGenerator/EventTelemetryProvider.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module defining EventTelemetryProvider. Created by chacskaylo on 06/18/2015.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import messages from './transcript.json';
|
||||||
|
|
||||||
|
class EventTelemetryProvider {
|
||||||
|
constructor() {
|
||||||
|
this.defaultSize = 25;
|
||||||
|
}
|
||||||
|
|
||||||
|
generateData(firstObservedTime, count, startTime, duration, name) {
|
||||||
|
const millisecondsSinceStart = startTime - firstObservedTime;
|
||||||
|
const utc = Math.floor(startTime / duration) * duration;
|
||||||
|
const ind = count % messages.length;
|
||||||
|
const message = messages[ind] + " - [" + millisecondsSinceStart + "]";
|
||||||
|
|
||||||
|
return {
|
||||||
|
name,
|
||||||
|
utc,
|
||||||
|
message
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
supportsRequest(domainObject) {
|
||||||
|
return domainObject.type === 'eventGenerator';
|
||||||
|
}
|
||||||
|
|
||||||
|
supportsSubscribe(domainObject) {
|
||||||
|
return domainObject.type === 'eventGenerator';
|
||||||
|
}
|
||||||
|
|
||||||
|
subscribe(domainObject, callback) {
|
||||||
|
const duration = domainObject.telemetry.duration * 1000;
|
||||||
|
const firstObservedTime = Date.now();
|
||||||
|
let count = 0;
|
||||||
|
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
const startTime = Date.now();
|
||||||
|
const datum = this.generateData(firstObservedTime, count, startTime, duration, domainObject.name);
|
||||||
|
count += 1;
|
||||||
|
callback(datum);
|
||||||
|
}, duration);
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
clearInterval(interval);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
request(domainObject, options) {
|
||||||
|
let start = options.start;
|
||||||
|
const end = Math.min(Date.now(), options.end); // no future values
|
||||||
|
const duration = domainObject.telemetry.duration * 1000;
|
||||||
|
const size = options.size ? options.size : this.defaultSize;
|
||||||
|
const data = [];
|
||||||
|
const firstObservedTime = Date.now();
|
||||||
|
let count = 0;
|
||||||
|
|
||||||
|
if (options.strategy === 'latest' || options.size === 1) {
|
||||||
|
start = end;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (start <= end && data.length < size) {
|
||||||
|
const startTime = Date.now() + count;
|
||||||
|
data.push(this.generateData(firstObservedTime, count, startTime, duration, domainObject.name));
|
||||||
|
start += duration;
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.resolve(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EventTelemetryProvider;
|
@ -1,80 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2021, 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/EventTelemetryProvider"
|
|
||||||
], function (
|
|
||||||
EventTelemetryProvider
|
|
||||||
) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
return {
|
|
||||||
name: "example/eventGenerator",
|
|
||||||
definition: {
|
|
||||||
"name": "Event Message Generator",
|
|
||||||
"description": "For development use. Creates sample event message data that mimics a live data stream.",
|
|
||||||
"extensions": {
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"implementation": EventTelemetryProvider,
|
|
||||||
"type": "provider",
|
|
||||||
"provides": "telemetryService",
|
|
||||||
"depends": [
|
|
||||||
"$q",
|
|
||||||
"$timeout"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"types": [
|
|
||||||
{
|
|
||||||
"key": "eventGenerator",
|
|
||||||
"name": "Event Message Generator",
|
|
||||||
"cssClass": "icon-generator-events",
|
|
||||||
"description": "For development use. Creates sample event message data that mimics a live data stream.",
|
|
||||||
"priority": 10,
|
|
||||||
"features": "creation",
|
|
||||||
"model": {
|
|
||||||
"telemetry": {}
|
|
||||||
},
|
|
||||||
"telemetry": {
|
|
||||||
"source": "eventGenerator",
|
|
||||||
"domains": [
|
|
||||||
{
|
|
||||||
"key": "utc",
|
|
||||||
"name": "Timestamp",
|
|
||||||
"format": "utc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"ranges": [
|
|
||||||
{
|
|
||||||
"key": "message",
|
|
||||||
"name": "Message",
|
|
||||||
"format": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
42
example/eventGenerator/plugin.js
Normal file
42
example/eventGenerator/plugin.js
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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 EventTelmetryProvider from './EventTelemetryProvider';
|
||||||
|
import EventMetadataProvider from './EventMetadataProvider';
|
||||||
|
|
||||||
|
export default function EventGeneratorPlugin(options) {
|
||||||
|
return function install(openmct) {
|
||||||
|
openmct.types.addType("eventGenerator", {
|
||||||
|
name: "Event Message Generator",
|
||||||
|
description: "For development use. Creates sample event message data that mimics a live data stream.",
|
||||||
|
cssClass: "icon-generator-events",
|
||||||
|
creatable: true,
|
||||||
|
initialize: function (object) {
|
||||||
|
object.telemetry = {
|
||||||
|
duration: 5
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
openmct.telemetry.addProvider(new EventTelmetryProvider());
|
||||||
|
openmct.telemetry.addProvider(new EventMetadataProvider());
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
69
example/eventGenerator/pluginSpec.js
Normal file
69
example/eventGenerator/pluginSpec.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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 EventMessageGeneratorPlugin from './plugin.js';
|
||||||
|
import {
|
||||||
|
createOpenMct,
|
||||||
|
resetApplicationState
|
||||||
|
} from '../../src/utils/testing';
|
||||||
|
|
||||||
|
describe('the plugin', () => {
|
||||||
|
let openmct;
|
||||||
|
const mockDomainObject = {
|
||||||
|
identifier: {
|
||||||
|
namespace: '',
|
||||||
|
key: 'some-value'
|
||||||
|
},
|
||||||
|
telemetry: {
|
||||||
|
duration: 0
|
||||||
|
},
|
||||||
|
type: 'eventGenerator'
|
||||||
|
};
|
||||||
|
|
||||||
|
beforeEach((done) => {
|
||||||
|
const options = {};
|
||||||
|
openmct = createOpenMct();
|
||||||
|
openmct.install(new EventMessageGeneratorPlugin(options));
|
||||||
|
openmct.on('start', done);
|
||||||
|
openmct.startHeadless();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
|
await resetApplicationState(openmct);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('the plugin', () => {
|
||||||
|
it("supports subscription", (done) => {
|
||||||
|
const unsubscribe = openmct.telemetry.subscribe(mockDomainObject, (telemetry) => {
|
||||||
|
expect(telemetry).not.toEqual(null);
|
||||||
|
expect(telemetry.message).toContain('CC: Eagle, Houston');
|
||||||
|
expect(unsubscribe).not.toEqual(null);
|
||||||
|
unsubscribe();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it("supports requests", async () => {
|
||||||
|
const telemetry = await openmct.telemetry.request(mockDomainObject);
|
||||||
|
expect(telemetry[0].message).toContain('CC: Eagle, Houston');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -1,62 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2021, 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.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining EventTelemetry.
|
|
||||||
* Created by chacskaylo on 06/18/2015.
|
|
||||||
* Modified by shale on 06/23/2015.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
['../data/transcript.json'],
|
|
||||||
function (messages) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var firstObservedTime = Date.now();
|
|
||||||
|
|
||||||
function EventTelemetry(request, interval) {
|
|
||||||
|
|
||||||
var latestObservedTime = Date.now(),
|
|
||||||
count = Math.floor((latestObservedTime - firstObservedTime) / interval),
|
|
||||||
generatorData = {};
|
|
||||||
|
|
||||||
generatorData.getPointCount = function () {
|
|
||||||
return count;
|
|
||||||
};
|
|
||||||
|
|
||||||
generatorData.getDomainValue = function (i, domain) {
|
|
||||||
return i * interval
|
|
||||||
+ (domain !== 'delta' ? firstObservedTime : 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
generatorData.getRangeValue = function (i, range) {
|
|
||||||
var domainDelta = this.getDomainValue(i) - firstObservedTime,
|
|
||||||
ind = i % messages.length;
|
|
||||||
|
|
||||||
return messages[ind] + " - [" + domainDelta.toString() + "]";
|
|
||||||
};
|
|
||||||
|
|
||||||
return generatorData;
|
|
||||||
}
|
|
||||||
|
|
||||||
return EventTelemetry;
|
|
||||||
}
|
|
||||||
);
|
|
@ -1,118 +0,0 @@
|
|||||||
/*****************************************************************************
|
|
||||||
* Open MCT, Copyright (c) 2014-2021, 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.
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Module defining EventTelemetryProvider. Created by chacskaylo on 06/18/2015.
|
|
||||||
*/
|
|
||||||
define(
|
|
||||||
["./EventTelemetry"],
|
|
||||||
function (EventTelemetry) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @constructor
|
|
||||||
*/
|
|
||||||
function EventTelemetryProvider($q, $timeout) {
|
|
||||||
var subscriptions = [],
|
|
||||||
genInterval = 1000,
|
|
||||||
generating = false;
|
|
||||||
|
|
||||||
//
|
|
||||||
function matchesSource(request) {
|
|
||||||
return request.source === "eventGenerator";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Used internally; this will be repacked by doPackage
|
|
||||||
function generateData(request) {
|
|
||||||
return {
|
|
||||||
key: request.key,
|
|
||||||
telemetry: new EventTelemetry(request, genInterval)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
function doPackage(results) {
|
|
||||||
var packaged = {};
|
|
||||||
results.forEach(function (result) {
|
|
||||||
packaged[result.key] = result.telemetry;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Format as expected (sources -> keys -> telemetry)
|
|
||||||
return { eventGenerator: packaged };
|
|
||||||
}
|
|
||||||
|
|
||||||
function requestTelemetry(requests) {
|
|
||||||
return $timeout(function () {
|
|
||||||
return doPackage(requests.filter(matchesSource).map(generateData));
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSubscriptions(timeout) {
|
|
||||||
subscriptions.forEach(function (subscription) {
|
|
||||||
var requests = subscription.requests;
|
|
||||||
subscription.callback(doPackage(
|
|
||||||
requests.filter(matchesSource).map(generateData)
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function startGenerating() {
|
|
||||||
generating = true;
|
|
||||||
$timeout(function () {
|
|
||||||
handleSubscriptions();
|
|
||||||
if (generating && subscriptions.length > 0) {
|
|
||||||
startGenerating();
|
|
||||||
} else {
|
|
||||||
generating = false;
|
|
||||||
}
|
|
||||||
}, genInterval);
|
|
||||||
}
|
|
||||||
|
|
||||||
function subscribe(callback, requests) {
|
|
||||||
var subscription = {
|
|
||||||
callback: callback,
|
|
||||||
requests: requests
|
|
||||||
};
|
|
||||||
function unsubscribe() {
|
|
||||||
subscriptions = subscriptions.filter(function (s) {
|
|
||||||
return s !== subscription;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
subscriptions.push(subscription);
|
|
||||||
if (!generating) {
|
|
||||||
startGenerating();
|
|
||||||
}
|
|
||||||
|
|
||||||
return unsubscribe;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
requestTelemetry: requestTelemetry,
|
|
||||||
subscribe: subscribe
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return EventTelemetryProvider;
|
|
||||||
}
|
|
||||||
);
|
|
110
example/exampleUser/ExampleUserProvider.js
Normal file
110
example/exampleUser/ExampleUserProvider.js
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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 EventEmitter from 'EventEmitter';
|
||||||
|
import uuid from 'uuid';
|
||||||
|
import createExampleUser from './exampleUserCreator';
|
||||||
|
|
||||||
|
export default class ExampleUserProvider extends EventEmitter {
|
||||||
|
constructor(openmct) {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.openmct = openmct;
|
||||||
|
this.user = undefined;
|
||||||
|
this.loggedIn = false;
|
||||||
|
this.autoLoginUser = undefined;
|
||||||
|
|
||||||
|
this.ExampleUser = createExampleUser(this.openmct.user.User);
|
||||||
|
}
|
||||||
|
|
||||||
|
isLoggedIn() {
|
||||||
|
return this.loggedIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
autoLogin(username) {
|
||||||
|
this.autoLoginUser = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
getCurrentUser() {
|
||||||
|
if (this.loggedIn) {
|
||||||
|
return Promise.resolve(this.user);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._login().then(() => this.user);
|
||||||
|
}
|
||||||
|
|
||||||
|
hasRole(roleId) {
|
||||||
|
if (!this.loggedIn) {
|
||||||
|
Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.resolve(this.user.getRoles().includes(roleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
_login() {
|
||||||
|
const id = uuid();
|
||||||
|
|
||||||
|
// for testing purposes, this will skip the form, this wouldn't be used in
|
||||||
|
// a normal authentication process
|
||||||
|
if (this.autoLoginUser) {
|
||||||
|
this.user = new this.ExampleUser(id, this.autoLoginUser, ['example-role']);
|
||||||
|
this.loggedIn = true;
|
||||||
|
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
const formStructure = {
|
||||||
|
title: "Login",
|
||||||
|
sections: [
|
||||||
|
{
|
||||||
|
rows: [
|
||||||
|
{
|
||||||
|
key: "username",
|
||||||
|
control: "textfield",
|
||||||
|
name: "Username",
|
||||||
|
pattern: "\\S+",
|
||||||
|
required: true,
|
||||||
|
cssClass: "l-input-lg",
|
||||||
|
value: ''
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
buttons: {
|
||||||
|
submit: {
|
||||||
|
label: 'Login'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.openmct.forms.showForm(formStructure).then(
|
||||||
|
(info) => {
|
||||||
|
this.user = new this.ExampleUser(id, info.username, ['example-role']);
|
||||||
|
this.loggedIn = true;
|
||||||
|
},
|
||||||
|
() => { // user canceled, setting a default username
|
||||||
|
this.user = new this.ExampleUser(id, 'Pat', ['example-role']);
|
||||||
|
this.loggedIn = true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
36
example/exampleUser/exampleUserCreator.js
Normal file
36
example/exampleUser/exampleUserCreator.js
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
export default function createExampleUser(UserClass) {
|
||||||
|
return class ExampleUser extends UserClass {
|
||||||
|
constructor(id, name, roles) {
|
||||||
|
super(id, name);
|
||||||
|
|
||||||
|
this.roles = roles;
|
||||||
|
this.getRoles = this.getRoles.bind(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
getRoles() {
|
||||||
|
return this.roles;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
29
example/exampleUser/plugin.js
Normal file
29
example/exampleUser/plugin.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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 ExampleUserProvider from './ExampleUserProvider';
|
||||||
|
|
||||||
|
export default function ExampleUserPlugin() {
|
||||||
|
return function install(openmct) {
|
||||||
|
openmct.user.setProvider(new ExampleUserProvider(openmct));
|
||||||
|
};
|
||||||
|
}
|
55
example/exampleUser/pluginSpec.js
Normal file
55
example/exampleUser/pluginSpec.js
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* Open MCT, Copyright (c) 2014-2022, 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 {
|
||||||
|
createOpenMct,
|
||||||
|
resetApplicationState
|
||||||
|
} from '../../src/utils/testing';
|
||||||
|
import ExampleUserProvider from './ExampleUserProvider';
|
||||||
|
|
||||||
|
describe("The Example User Plugin", () => {
|
||||||
|
let openmct;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
openmct = createOpenMct();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
return resetApplicationState(openmct);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('is not installed by default', () => {
|
||||||
|
expect(openmct.user.hasProvider()).toBeFalse();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can be installed', () => {
|
||||||
|
openmct.user.on('providerAdded', (provider) => {
|
||||||
|
expect(provider).toBeInstanceOf(ExampleUserProvider);
|
||||||
|
});
|
||||||
|
openmct.install(openmct.plugins.example.ExampleUser());
|
||||||
|
});
|
||||||
|
|
||||||
|
// The rest of the functionality of the ExampleUser Plugin is
|
||||||
|
// tested in both the UserAPISpec.js and in the UserIndicatorPlugin spec.
|
||||||
|
// If that changes, those tests can be moved here.
|
||||||
|
|
||||||
|
});
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2016, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2016, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2016, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2016, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2016, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2016, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2016, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2016, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2016, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
@ -77,11 +77,13 @@
|
|||||||
|
|
||||||
|
|
||||||
openmct.install(openmct.plugins.LocalStorage());
|
openmct.install(openmct.plugins.LocalStorage());
|
||||||
|
|
||||||
|
openmct.install(openmct.plugins.example.Generator());
|
||||||
|
openmct.install(openmct.plugins.example.EventGeneratorPlugin());
|
||||||
|
openmct.install(openmct.plugins.example.ExampleImagery());
|
||||||
|
|
||||||
openmct.install(openmct.plugins.Espresso());
|
openmct.install(openmct.plugins.Espresso());
|
||||||
openmct.install(openmct.plugins.MyItems());
|
openmct.install(openmct.plugins.MyItems());
|
||||||
openmct.install(openmct.plugins.Generator());
|
|
||||||
openmct.install(openmct.plugins.ExampleImagery());
|
|
||||||
openmct.install(openmct.plugins.PlanLayout());
|
openmct.install(openmct.plugins.PlanLayout());
|
||||||
openmct.install(openmct.plugins.Timeline());
|
openmct.install(openmct.plugins.Timeline());
|
||||||
openmct.install(openmct.plugins.Hyperlink());
|
openmct.install(openmct.plugins.Hyperlink());
|
||||||
@ -193,6 +195,7 @@
|
|||||||
));
|
));
|
||||||
openmct.install(openmct.plugins.Clock({ enableClockIndicator: true }));
|
openmct.install(openmct.plugins.Clock({ enableClockIndicator: true }));
|
||||||
openmct.install(openmct.plugins.Timer());
|
openmct.install(openmct.plugins.Timer());
|
||||||
|
openmct.install(openmct.plugins.StaticRootPlugin('root', './dist/static-root.json'));
|
||||||
openmct.start();
|
openmct.start();
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
const testsContext = require.context('.', true, /\/(src|platform)\/.*Spec.js$/);
|
const testsContext = require.context('.', true, /\/(src|platform|\.\/example)\/.*Spec.js$/);
|
||||||
|
|
||||||
testsContext.keys().forEach(testsContext);
|
testsContext.keys().forEach(testsContext);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -33,11 +33,10 @@ if (coverageEnabled) {
|
|||||||
module.exports = (config) => {
|
module.exports = (config) => {
|
||||||
const webpackConfig = require('./webpack.dev.js');
|
const webpackConfig = require('./webpack.dev.js');
|
||||||
delete webpackConfig.output;
|
delete webpackConfig.output;
|
||||||
|
|
||||||
if (coverageEnabled) {
|
if (coverageEnabled) {
|
||||||
webpackConfig.module.rules.push({
|
webpackConfig.module.rules.push({
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
exclude: /node_modules|example|lib|dist/,
|
exclude: /node_modules|e2e|example|lib|dist|\.*.*Spec\.js/,
|
||||||
use: {
|
use: {
|
||||||
loader: 'istanbul-instrumenter-loader',
|
loader: 'istanbul-instrumenter-loader',
|
||||||
options: {
|
options: {
|
||||||
@ -103,7 +102,7 @@ module.exports = (config) => {
|
|||||||
reports: ['lcovonly', 'text-summary'],
|
reports: ['lcovonly', 'text-summary'],
|
||||||
thresholds: {
|
thresholds: {
|
||||||
global: {
|
global: {
|
||||||
lines: 66
|
lines: 55
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
18
package.json
18
package.json
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "openmct",
|
"name": "openmct",
|
||||||
"version": "1.8.3-SNAPSHOT",
|
"version": "1.8.4",
|
||||||
"description": "The Open MCT core platform",
|
"description": "The Open MCT core platform",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@braintree/sanitize-url": "^5.0.2",
|
"@braintree/sanitize-url": "^5.0.2",
|
||||||
"@percy/cli": "^1.0.0-beta.71",
|
"@percy/cli": "^1.0.0-beta.73",
|
||||||
"@percy/playwright": "^1.0.1",
|
"@percy/playwright": "^1.0.1",
|
||||||
"@playwright/test": "^1.17.2",
|
"@playwright/test": "^1.18.0",
|
||||||
"allure-playwright": "^2.0.0-beta.14",
|
"allure-playwright": "^2.0.0-beta.14",
|
||||||
"angular": ">=1.8.0",
|
"angular": ">=1.8.0",
|
||||||
"angular-route": "1.4.14",
|
"angular-route": "1.4.14",
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"istanbul-instrumenter-loader": "^3.0.1",
|
"istanbul-instrumenter-loader": "^3.0.1",
|
||||||
"jasmine-core": "^4.0.0",
|
"jasmine-core": "^4.0.0",
|
||||||
"jsdoc": "^3.3.2",
|
"jsdoc": "^3.3.2",
|
||||||
"karma": "6.3.10",
|
"karma": "6.3.11",
|
||||||
"karma-chrome-launcher": "3.1.0",
|
"karma-chrome-launcher": "3.1.0",
|
||||||
"karma-cli": "2.0.0",
|
"karma-cli": "2.0.0",
|
||||||
"karma-coverage": "2.1.0",
|
"karma-coverage": "2.1.0",
|
||||||
@ -50,7 +50,7 @@
|
|||||||
"location-bar": "^3.0.1",
|
"location-bar": "^3.0.1",
|
||||||
"lodash": "^4.17.12",
|
"lodash": "^4.17.12",
|
||||||
"markdown-toc": "^0.11.7",
|
"markdown-toc": "^0.11.7",
|
||||||
"marked": "^0.3.5",
|
"marked": "4.0.10",
|
||||||
"mini-css-extract-plugin": "2.4.5",
|
"mini-css-extract-plugin": "2.4.5",
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
"moment": "2.25.3",
|
"moment": "2.25.3",
|
||||||
@ -58,7 +58,7 @@
|
|||||||
"moment-timezone": "0.5.28",
|
"moment-timezone": "0.5.28",
|
||||||
"node-bourbon": "^4.2.3",
|
"node-bourbon": "^4.2.3",
|
||||||
"painterro": "^1.2.56",
|
"painterro": "^1.2.56",
|
||||||
"playwright": "^1.17.2",
|
"playwright": "^1.18.0",
|
||||||
"plotly.js-basic-dist": "^2.5.0",
|
"plotly.js-basic-dist": "^2.5.0",
|
||||||
"plotly.js-gl2d-dist": "^2.5.0",
|
"plotly.js-gl2d-dist": "^2.5.0",
|
||||||
"printj": "^1.2.1",
|
"printj": "^1.2.1",
|
||||||
@ -96,13 +96,15 @@
|
|||||||
"test:debug": "cross-env NODE_ENV=debug karma start --no-single-run",
|
"test:debug": "cross-env NODE_ENV=debug karma start --no-single-run",
|
||||||
"test:coverage": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" COVERAGE=true karma start --single-run",
|
"test:coverage": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" COVERAGE=true karma start --single-run",
|
||||||
"test:coverage:firefox": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run --browsers=FirefoxHeadless",
|
"test:coverage:firefox": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run --browsers=FirefoxHeadless",
|
||||||
"test:e2e:ci": "npx playwright test --config=e2e/playwright-ci.config.js smoke default condition.e2e",
|
"test:e2e:ci": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome smoke default condition.e2e",
|
||||||
"test:e2e:local": "npx playwright test --config=e2e/playwright-local.config.js",
|
"test:e2e:local": "npx playwright test --config=e2e/playwright-local.config.js",
|
||||||
"test:e2e:visual": "percy exec -- npx playwright test --config=e2e/playwright-visual.config.js default",
|
"test:e2e:visual": "percy exec --config ./e2e/.percy.yml -- npx playwright test --config=e2e/playwright-visual.config.js default",
|
||||||
"test:e2e:full": "npx playwright test --config=e2e/playwright-ci.config.js",
|
"test:e2e:full": "npx playwright test --config=e2e/playwright-ci.config.js",
|
||||||
"test:watch": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --no-single-run",
|
"test:watch": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --no-single-run",
|
||||||
"verify": "concurrently 'npm:test' 'npm:lint'",
|
"verify": "concurrently 'npm:test' 'npm:lint'",
|
||||||
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",
|
||||||
|
"update-about-dialog-copyright": "perl -pi -e 's/20\\d\\d\\-202\\d/2014\\-2022/gm' ./src/ui/layout/AboutDialog.vue",
|
||||||
|
"update-copyright-date": "npm run update-about-dialog-copyright && grep -lr --null --include=*.{js,scss,vue,ts,sh,html,md,frag} 'Copyright (c) 20' . | xargs -r0 perl -pi -e 's/Copyright\\s\\(c\\)\\s20\\d\\d\\-20\\d\\d/Copyright \\(c\\)\\ 2014\\-2022/gm'",
|
||||||
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
|
"otherdoc": "node docs/gendocs.js --in docs/src --out dist/docs --suppress-toc 'docs/src/index.md|docs/src/process/index.md'",
|
||||||
"docs": "npm run jsdoc ; npm run otherdoc",
|
"docs": "npm run jsdoc ; npm run otherdoc",
|
||||||
"prepare": "npm run build:prod"
|
"prepare": "npm run build:prod"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Open MCT, Copyright (c) 2014-2021, United States Government
|
Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
as represented by the Administrator of the National Aeronautics and Space
|
as represented by the Administrator of the National Aeronautics and Space
|
||||||
Administration. All rights reserved.
|
Administration. All rights reserved.
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open MCT, Copyright (c) 2014-2021, United States Government
|
* Open MCT, Copyright (c) 2014-2022, United States Government
|
||||||
* as represented by the Administrator of the National Aeronautics and Space
|
* as represented by the Administrator of the National Aeronautics and Space
|
||||||
* Administration. All rights reserved.
|
* Administration. All rights reserved.
|
||||||
*
|
*
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user