Compare commits

..

17 Commits

Author SHA1 Message Date
Andrew Henry
4fd8b2c6ac Fixes for Izmir demo 2022-02-28 10:16:14 -08:00
Jamie V
4e7debabb1 [Notebook] Add active user to entries (#4764)
* if user provider, user added to notebook enntries and snapshot entries, updated code to work with asynnc nature of user api

Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Nikhil <nikhil.k.mandlik@nasa.gov>
2022-02-22 12:37:47 -08:00
Michael Rogers
384e36920c 3175 - Enable listening to clearData action for Imagery (#4733)
* Add clearData listener for imageryData module

* Remove commented out code

* Updated imagery clear data test

* Adjusted telemetry stub to return empty array if data cleared

* Remove forced test

* Restub telemetry before

* Cleanup and reset clear data boolean after

* Remove double blank line

Co-authored-by: Scott Bell <scott@traclabs.com>
Co-authored-by: Andrew Henry <akhenry@gmail.com>
2022-02-18 08:48:48 -06:00
dependabot[bot]
d4429f9686 Bump cross-env from 6.0.3 to 7.0.3 (#4837)
Bumps [cross-env](https://github.com/kentcdodds/cross-env) from 6.0.3 to 7.0.3.
- [Release notes](https://github.com/kentcdodds/cross-env/releases)
- [Changelog](https://github.com/kentcdodds/cross-env/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kentcdodds/cross-env/compare/v6.0.3...v7.0.3)

---
updated-dependencies:
- dependency-name: cross-env
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 10:34:14 -08:00
John Hill
0b2d08078b [CI] Add windows OS and Mac OS to CI testing (#4840)
* Update e2e tests to run on windows and linux

* Add pr-platform to run against all supported archictures

* Update dependabot to run pr:platform

* Update to run in fail-fast false

* remove x86

* Update pr-platform.yml

Co-authored-by: unlikelyzero <jchill2@gmail.com>
2022-02-17 14:52:46 +00:00
John Hill
3bbc9e1582 [CI] Enable Per PR Lighthouse CI Execution, Run nightly (#4817)
* [CI] Add lighthouse to our deps to track with dependabot

lighthouse ci is still actively maintained and will be following a traditional release model. We should continue to use this package until it's functionality is replaced in playwright

* Add lighthouse to dependencies to track with dependabot

* Allow lighthouse to be triggered from PRs

* Update lighthouse.yml

* add lhci scrript

* bump to 16

* remove from deps until node 18

* document steps and add caching. Revert to 14

* ignore exit codes

* add secret for app

* remove env for baseline

Co-authored-by: unlikelyzero <jchill2@gmail.com>
Co-authored-by: Nikhil <nikhil.k.mandlik@nasa.gov>
2022-02-16 17:12:00 -08:00
John Hill
af0420361b [CI] Update playwright to 1.19.1 (#4873)
* [CI] Update playwright to 1.19.1

* Update config.yml
2022-02-16 15:12:09 -08:00
dependabot[bot]
896f0ca3f4 Bump moment from 2.25.3 to 2.29.1 (#4869)
Bumps [moment](https://github.com/moment/moment) from 2.25.3 to 2.29.1.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.25.3...2.29.1)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-16 11:22:51 -08:00
dependabot[bot]
28c5405a01 Bump actions/github-script from 5 to 6 (#4853)
Bumps [actions/github-script](https://github.com/actions/github-script) from 5 to 6.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 15:31:06 -08:00
John Hill
d114353556 [CI] Update PR Cop to run on more events (#4855)
* [CI] Update PR Cop to run on more events

* Update prcop.yml

* Update prcop.yml

* Update e2e PR

* Update e2e-visual.yml
2022-02-15 14:13:52 -08:00
John Hill
f40398807e [CI] Update CI to use node16 by default (#4868)
* Update node versions to 16

* New Line

Co-authored-by: unlikelyzero <jchill2@gmail.com>
2022-02-15 14:08:53 -08:00
John Hill
81f440e1e6 [Docs] Update Github Bug Report Template with envinfo (#4858)
* [Docs] Update Github Bug Report Template with envinfo

* Moving Impact Checklist to bottom so that folks can file and click without markdown x

* Add to npm run scripts
2022-02-15 14:00:37 -08:00
John Hill
c6d6400131 [CI] Bump playwright to 1.19.0 (#4856)
* bump playwright

* remove playwright dependency and leave playwrite/test

Co-authored-by: unlikelyzero <jchill2@gmail.com>
2022-02-15 10:57:24 -06:00
dependabot[bot]
55828af1ec Bump file-saver from 1.3.8 to 2.0.5 (#4830)
* Bump file-saver from 1.3.8 to 2.0.5

Bumps [file-saver](https://github.com/eligrey/FileSaver.js) from 1.3.8 to 2.0.5.
- [Release notes](https://github.com/eligrey/FileSaver.js/releases)
- [Changelog](https://github.com/eligrey/FileSaver.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eligrey/FileSaver.js/commits)

---
updated-dependencies:
- dependency-name: file-saver
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix paths

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Scott Bell <scott@traclabs.com>
2022-02-15 14:07:58 +01:00
Andrew Henry
34b951f4c6 Bumped dependency versions to fix build issues in Node 16 and later (#4866)
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-02-14 17:15:21 -08:00
Shefali Joshi
a7d4006fee Sprint 2.0.1 (#4861)
* Prep for release 1.8.6

* Update version to 2.0.1
2022-02-14 13:00:32 -08:00
Shefali Joshi
a71485f820 Prep for release 1.8.6 (#4859) 2022-02-14 10:13:08 -08:00
27 changed files with 346 additions and 170 deletions

View File

@@ -2,7 +2,7 @@ version: 2.1
executors:
pw-focal-development:
docker:
- image: mcr.microsoft.com/playwright:v1.18.1-focal
- image: mcr.microsoft.com/playwright:v1.19.1-focal
environment:
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
parameters:
@@ -76,7 +76,7 @@ jobs:
node-version: <<parameters.node-version>>
- run: npm audit --audit-level=low
- generate_and_store_version_and_filesystem_artifacts
node14-lint:
lint:
parameters:
node-version:
type: string
@@ -141,8 +141,8 @@ jobs:
workflows:
overall-circleci-commit-status: #These jobs run on every commit
jobs:
- node14-lint:
node-version: lts/fermium
- lint:
node-version: lts/gallium
- unit-test:
name: node12-chrome
node-version: lts/erbium
@@ -152,10 +152,14 @@ workflows:
node-version: lts/fermium
browser: ChromeHeadless
post-steps:
- upload_code_covio
- upload_code_covio
- unit-test:
name: node16-chrome
node-version: lts/gallium
browser: ChromeHeadless
- e2e-test:
name: e2e-ci
node-version: lts/fermium
node-version: lts/gallium
suite: ci
the-nightly: #These jobs do not run on PRs, but against master at night
jobs:
@@ -175,11 +179,15 @@ workflows:
name: node14-chrome-nightly
node-version: lts/fermium
browser: ChromeHeadless
- unit-test:
name: node16-chrome-nightly
node-version: lts/gallium
browser: ChromeHeadless
- npm-audit:
node-version: lts/fermium
node-version: lts/gallium
- e2e-test:
name: e2e-full-nightly
node-version: lts/fermium
node-version: lts/gallium
suite: full
triggers:
- schedule:

View File

@@ -17,15 +17,6 @@ assignees: ''
#### Expected vs Current Behavior
<!--- Tell us what should have happened -->
#### Impact Check List
<!--- Please select from the following options -->
- [ ] Data loss or misrepresented data?
- [ ] Regression? Did this used to work or has it always been broken?
- [ ] Is there a workaround available?
- [ ] Does this impact a critical component?
- [ ] Is this just a visual bug with no functional impact?
#### Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
@@ -35,10 +26,20 @@ assignees: ''
4.
#### Environment
<!--- If encountered on local machine, execute the following:
<!--- npx envinfo --system --browsers --npmPackages --binaries --languages --markdown -->
* Open MCT Version: <!--- date of build, version, or SHA -->
* Deployment Type: <!--- npm dev? VIPER Dev? openmct-yamcs? -->
* OS:
* Browser:
#### Impact Check List
<!--- Please select from the following options -->
- [ ] Data loss or misrepresented data?
- [ ] Regression? Did this used to work or has it always been broken?
- [ ] Is there a workaround available?
- [ ] Does this impact a critical component?
- [ ] Is this just a visual bug with no functional impact?
#### Additional Information
<!--- Include any screenshots, gifs, or logs which will expedite triage -->

View File

@@ -11,6 +11,8 @@ updates:
- "dependencies"
- "pr:e2e"
- "pr:daveit"
- "pr:visual"
- "pr:platform"
- package-ecosystem: "github-actions"
directory: "/"

View File

@@ -2,15 +2,22 @@ name: "e2e-pr"
on:
workflow_dispatch:
pull_request:
types: [ labeled ]
types:
- labeled
- opened
jobs:
e2e-full:
if: ${{ github.event.label.name == 'pr:e2e' }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
- name: Trigger Success
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
@@ -22,7 +29,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'
- run: npx playwright install-deps
- run: npm install
- run: npm run test:e2e:full
@@ -32,7 +39,7 @@ jobs:
path: test-results
- name: Test success
if: ${{ success() }}
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
@@ -43,7 +50,7 @@ jobs:
})
- name: Test failure
if: ${{ failure() }}
uses: actions/github-script@v5
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({

View File

@@ -4,6 +4,7 @@ on:
pull_request:
types:
- labeled
- opened
schedule:
- cron: '28 21 * * 1-5'
@@ -15,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'
- run: npx playwright install-deps
- run: npm install
- name: Run the e2e visual tests

View File

@@ -15,7 +15,7 @@ jobs:
ref: ${{ github.event.inputs.version }}
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'
- run: npm install
- name: Run the e2e tests
run: npm run test:e2e:ci

View File

@@ -5,16 +5,96 @@ on:
version:
description: 'Which branch do you want to test?' # Limited to branch for now
required: false
default: 'master'
default: 'master'
pull_request:
types:
- labeled
schedule:
- cron: '28 21 * * 1-5'
jobs:
lighthouse:
lighthouse-pr:
if: ${{ github.event.label.name == 'pr:lighthouse' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Master for Baseline
uses: actions/checkout@v2
with:
ref: master #explicitly checkout master for baseline
- name: Install Node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
- name: npm install with lighthouse cli
run: npm install && npm install -g @lhci/cli
- name: Run lhci against master to generate baseline and ignore exit codes
run: lhci autorun || true
- name: Perform clean checkout of PR
uses: actions/checkout@v2
with:
clean: true
- name: Install Node version which is compatible with PR
uses: actions/setup-node@v2
- name: npm install with lighthouse cli
run: npm install && npm install -g @lhci/cli
- name: Run lhci with PR
run: lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
lighthouse-nightly:
if: ${{ github.event.schedule }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
- name: npm install with lighthouse cli
run: npm install && npm install -g @lhci/cli
- name: Run lhci against master to generate baseline
run: lhci autorun
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
lighthouse-dispatch:
if: ${{ github.event.workflow_dispatch }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.version }}
- uses: actions/setup-node@v2
- name: Install Node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install && npm install -g @lhci/cli #Don't want to include this in our deps
- run: lhci autorun
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
- name: npm install with lighthouse cli
run: npm install && npm install -g @lhci/cli
- name: Run lhci against master to generate baseline
run: lhci autorun

View File

@@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
- run: npm install
- run: npm test
@@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm publish --access public --tag unstable

34
.github/workflows/pr-platform.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: "pr-platform"
on:
workflow_dispatch:
pull_request:
types: [ labeled ]
jobs:
e2e-full:
if: ${{ github.event.label.name == 'pr:platform' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node_version:
- 12
- 14
- 16
architecture:
- x64
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- run: npm install
- run: npm test
- run: npm run lint

View File

@@ -1,12 +1,15 @@
name: PRcop
name: PRCop
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
- ready_for_review
- review_requested
- review_request_removed
pull_request_review_comment:
types:
- created
@@ -14,7 +17,7 @@ on:
jobs:
prcop:
runs-on: ubuntu-latest
name: PRcop
name: Template Check
steps:
- name: Linting Pull Request
uses: makaroni4/prcop@v1.0.35

View File

@@ -20,18 +20,9 @@ define([
domain: 1
}
},
{
key: "yesterday",
name: "Yesterday",
format: "utc",
hints: {
domain: 2
}
},
{
key: "cos",
name: "Cosine",
unit: "deg",
name: "Value",
formatString: '%0.2f',
hints: {
domain: 3
@@ -49,8 +40,7 @@ define([
// },
{
key: "sin",
name: "Sine",
unit: "Hz",
name: "Value",
formatString: '%0.2f',
hints: {
range: 1
@@ -58,8 +48,7 @@ define([
},
{
key: "cos",
name: "Cosine",
unit: "deg",
name: "Value",
formatString: '%0.2f',
hints: {
range: 2

View File

@@ -26,25 +26,13 @@ define([
) {
var PURPLE = {
sin: 2.2,
cos: 2.2
},
RED = {
sin: 0.9,
cos: 0.9
},
ORANGE = {
sin: 0.7,
cos: 0.7
var RED = {
sin: 12,
cos: 12
},
YELLOW = {
sin: 0.5,
cos: 0.5
},
CYAN = {
sin: 0.45,
cos: 0.45
sin: 10,
cos: 10
},
LIMITS = {
rh: {
@@ -110,17 +98,6 @@ define([
return {
limits: function () {
return Promise.resolve({
WATCH: {
low: {
color: "cyan",
sin: -CYAN.sin,
cos: -CYAN.cos
},
high: {
color: "cyan",
...CYAN
}
},
WARNING: {
low: {
color: "yellow",
@@ -132,17 +109,6 @@ define([
...YELLOW
}
},
DISTRESS: {
low: {
color: "orange",
sin: -ORANGE.sin,
cos: -ORANGE.cos
},
high: {
color: "orange",
...ORANGE
}
},
CRITICAL: {
low: {
color: "red",
@@ -153,17 +119,6 @@ define([
color: "red",
...RED
}
},
SEVERE: {
low: {
color: "purple",
sin: -PURPLE.sin,
cos: -PURPLE.cos
},
high: {
color: "purple",
...PURPLE
}
}
});
}

View File

@@ -190,7 +190,7 @@
openmct.install(openmct.plugins.Filters(['table', 'telemetry.plot.overlay']));
openmct.install(openmct.plugins.ObjectMigration());
openmct.install(openmct.plugins.ClearData(
['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked'],
['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked', 'example.imagery'],
{indicator: true}
));
openmct.install(openmct.plugins.Clock({ enableClockIndicator: true }));

View File

@@ -1,18 +1,18 @@
{
"name": "openmct",
"version": "2.0.0",
"version": "2.0.1-SNAPSHOT",
"description": "The Open MCT core platform",
"devDependencies": {
"@braintree/sanitize-url": "5.0.2",
"@percy/cli": "1.0.0-beta.73",
"@percy/cli": "1.0.0-beta.75",
"@percy/playwright": "1.0.1",
"@playwright/test": "1.18.1",
"allure-playwright": "2.0.0-beta.14",
"@playwright/test": "1.19.1",
"allure-playwright": "2.0.0-beta.15",
"babel-eslint": "10.1.0",
"comma-separated-values": "3.6.4",
"copy-webpack-plugin": "10.2.0",
"core-js": "3.20.3",
"cross-env": "6.0.3",
"cross-env": "7.0.3",
"css-loader": "4.0.0",
"d3-axis": "1.0.x",
"d3-scale": "1.0.x",
@@ -25,7 +25,7 @@
"exports-loader": "0.7.0",
"express": "4.13.1",
"file-loader": "6.1.0",
"file-saver": "1.3.8",
"file-saver": "2.0.5",
"git-rev-sync": "1.4.0",
"html-loader": "0.5.5",
"html2canvas": "1.4.1",
@@ -47,12 +47,11 @@
"location-bar": "^3.0.1",
"lodash": "^4.17.12",
"mini-css-extract-plugin": "2.4.5",
"moment": "2.25.3",
"moment": "2.29.1",
"moment-duration-format": "^2.2.2",
"moment-timezone": "0.5.28",
"node-bourbon": "^4.2.3",
"painterro": "^1.2.56",
"playwright": "^1.18.1",
"plotly.js-basic-dist": "^2.5.0",
"plotly.js-gl2d-dist": "^2.5.0",
"printj": "^1.2.1",
@@ -64,11 +63,11 @@
"sinon": "13.0.1",
"style-loader": "^1.0.1",
"uuid": "^3.3.3",
"vue": "2.5.6",
"vue": "2.6.14",
"vue-eslint-parser": "8.2.0",
"vue-loader": "15.9.8",
"vue-template-compiler": "2.5.6",
"webpack": "5.67.0",
"vue-template-compiler": "2.6.14",
"webpack": "5.68.0",
"webpack-cli": "4.9.2",
"webpack-dev-middleware": "^3.1.3",
"webpack-hot-middleware": "^2.22.3",
@@ -84,6 +83,7 @@
"build:prod": "cross-env webpack --config webpack.prod.js",
"build:dev": "webpack --config webpack.dev.js",
"build:watch": "webpack --config webpack.dev.js --watch",
"info": "npx envinfo --system --browsers --npmPackages --binaries --languages --markdown",
"test": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --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",
@@ -105,7 +105,7 @@
"url": "https://github.com/nasa/openmct.git"
},
"engines": {
"node": ">=12.20.1 <15.0.0"
"node": ">=12.22.0"
},
"author": "",
"license": "Apache-2.0",

View File

@@ -21,7 +21,7 @@
*****************************************************************************/
import CSV from 'comma-separated-values';
import {saveAs} from 'file-saver/FileSaver';
import {saveAs} from 'saveAs';
class CSVExporter {
export(rows, options) {

View File

@@ -31,7 +31,7 @@ function replaceDotsWithUnderscores(filename) {
return filename.replace(regex, '_');
}
import {saveAs} from 'file-saver/FileSaver';
import {saveAs} from 'saveAs';
import html2canvas from 'html2canvas';
import uuid from 'uuid';

View File

@@ -20,7 +20,7 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/
import {saveAs} from 'file-saver/FileSaver';
import {saveAs} from 'saveAs';
class JSONExporter {
export(obj, options) {

View File

@@ -185,10 +185,14 @@ describe('The Clear Data Plugin:', () => {
beforeEach((done) => {
openmct = createOpenMct();
clearDataPlugin = new ClearDataPlugin(
['table', 'telemetry.plot.overlay', 'telemetry.plot.stacked'],
{indicator: true}
);
clearDataPlugin = new ClearDataPlugin([
'table',
'telemetry.plot.overlay',
'telemetry.plot.stacked',
'example.imagery'
], {
indicator: true
});
openmct.install(clearDataPlugin);
appHolder = document.createElement('div');
document.body.appendChild(appHolder);

View File

@@ -30,6 +30,7 @@ export default {
this.timeSystemChange = this.timeSystemChange.bind(this);
this.setDataTimeContext = this.setDataTimeContext.bind(this);
this.setDataTimeContext();
this.openmct.objectViews.on('clearData', this.clearData);
// set
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
@@ -54,6 +55,7 @@ export default {
}
this.stopFollowingDataTimeContext();
this.openmct.objectViews.off('clearData', this.clearData);
},
methods: {
setDataTimeContext() {
@@ -151,6 +153,25 @@ export default {
this.imageHistory = imagery;
}
},
clearData(domainObjectToClear) {
// global clearData button is accepted therefore no truthy check on inputted param
const clearDataForObjectSelected = Boolean(domainObjectToClear);
if (clearDataForObjectSelected) {
const idsEqual = this.openmct.objects.areIdsEqual(
domainObjectToClear.identifier,
this.domainObject.identifier
);
if (!idsEqual) {
return;
}
}
// splice array to encourage garbage collection
this.imageHistory.splice(0, this.imageHistory.length);
// requesting history effectively clears imageHistory array
return this.requestHistory();
},
timeSystemChange() {
this.timeSystem = this.timeContext.timeSystem();
this.timeKey = this.timeSystem.key;

View File

@@ -27,6 +27,7 @@ import {
resetApplicationState,
simulateKeyEvent
} from 'utils/testing';
import ClearDataPlugin from '../clearData/plugin';
const ONE_MINUTE = 1000 * 60;
const TEN_MINUTES = ONE_MINUTE * 10;
@@ -83,6 +84,7 @@ describe("The Imagery View Layouts", () => {
let telemetryPromise;
let telemetryPromiseResolve;
let cleanupFirst;
let isClearDataTriggered;
let openmct;
let parent;
@@ -201,6 +203,10 @@ describe("The Imagery View Layouts", () => {
});
spyOn(openmct.telemetry, 'request').and.callFake(() => {
if (isClearDataTriggered) {
return [];
}
telemetryPromiseResolve(imageTelemetry);
return telemetryPromise;
@@ -323,6 +329,8 @@ describe("The Imagery View Layouts", () => {
let applicableViews;
let imageryViewProvider;
let imageryView;
let clearDataPlugin;
let clearDataAction;
beforeEach(() => {
@@ -330,16 +338,21 @@ describe("The Imagery View Layouts", () => {
imageryViewProvider = applicableViews.find(viewProvider => viewProvider.key === imageryKey);
imageryView = imageryViewProvider.view(imageryObject, [imageryObject]);
imageryView.show(child);
clearDataPlugin = new ClearDataPlugin(
['example.imagery'],
{indicator: true}
);
openmct.install(clearDataPlugin);
clearDataAction = openmct.actions.getAction('clear-data-action');
return Vue.nextTick();
});
// afterEach(() => {
// openmct.time.stopClock();
// openmct.router.removeListener('change:hash', resolveFunction);
//
// imageryView.destroy();
// });
afterEach(() => {
isClearDataTriggered = false;
// openmct.time.stopClock();
// openmct.router.removeListener('change:hash', resolveFunction);
// imageryView.destroy();
});
it("on mount should show the the most recent image", (done) => {
//Looks like we need Vue.nextTick here so that computed properties settle down
@@ -470,6 +483,21 @@ describe("The Imagery View Layouts", () => {
});
});
});
it('clear data action is installed', () => {
expect(clearDataAction).toBeDefined();
});
it('on clearData action should clear data for object is selected', (done) => {
expect(parent.querySelectorAll('.c-imagery__thumb').length).not.toBe(0);
openmct.objectViews.on('clearData', async (_domainObject) => {
await Vue.nextTick();
expect(parent.querySelectorAll('.c-imagery__thumb').length).toBe(0);
done();
});
// stubbed telemetry data will return empty array when true
isClearDataTriggered = true;
clearDataAction.invoke(imageryObject);
});
});
describe("imagery time strip view", () => {

View File

@@ -596,8 +596,9 @@ export default {
this.resetSearch();
const notebookStorage = this.createNotebookStorageObject();
this.updateDefaultNotebook(notebookStorage);
const id = addNotebookEntry(this.openmct, this.domainObject, notebookStorage, embed);
this.focusEntryId = id;
addNotebookEntry(this.openmct, this.domainObject, notebookStorage, embed).then(id => {
this.focusEntryId = id;
});
},
orientationChange() {
this.formatSidebar();

View File

@@ -28,6 +28,9 @@
>
<div class="c-ne__time-and-content">
<div class="c-ne__time">
<template v-if="entry.createdBy">
<span class="c-icon icon-person">{{ entry.createdBy }}</span>
</template>
<span>{{ createdOnDate }}</span>
<span>{{ createdOnTime }}</span>
</div>
@@ -182,7 +185,7 @@ export default {
this.dropOnEntry = this.dropOnEntry.bind(this);
},
methods: {
addNewEmbed(objectPath) {
async addNewEmbed(objectPath) {
const bounds = this.openmct.time.bounds();
const snapshotMeta = {
bounds,
@@ -190,7 +193,7 @@ export default {
objectPath,
openmct: this.openmct
};
const newEmbed = createNewEmbed(snapshotMeta);
const newEmbed = await createNewEmbed(snapshotMeta);
this.entry.embeds.push(newEmbed);
},
cancelEditMode(event) {
@@ -206,7 +209,7 @@ export default {
deleteEntry() {
this.$emit('deleteEntry', this.entry.id);
},
dropOnEntry($event) {
async dropOnEntry($event) {
event.stopImmediatePropagation();
const snapshotId = $event.dataTransfer.getData('openmct/snapshot/id');
@@ -221,7 +224,7 @@ export default {
} else {
const data = $event.dataTransfer.getData('openmct/domain-object-path');
const objectPath = JSON.parse(data);
this.addNewEmbed(objectPath);
await this.addNewEmbed(objectPath);
}
this.$emit('updateEntry', this.entry);

View File

@@ -41,16 +41,17 @@ export default class Snapshot {
fullSizeImageObjectIdentifier: object.identifier,
thumbnailImage
};
const embed = createNewEmbed(snapshotMeta, snapshot);
if (notebookType === NOTEBOOK_DEFAULT) {
const notebookStorage = getDefaultNotebook();
createNewEmbed(snapshotMeta, snapshot).then(embed => {
if (notebookType === NOTEBOOK_DEFAULT) {
const notebookStorage = getDefaultNotebook();
this._saveToDefaultNoteBook(notebookStorage, embed);
const notebookImageDomainObject = updateNamespaceOfDomainObject(object, notebookStorage.identifier.namespace);
saveNotebookImageDomainObject(this.openmct, notebookImageDomainObject);
} else {
this._saveToNotebookSnapshots(object, embed);
}
this._saveToDefaultNoteBook(notebookStorage, embed);
const notebookImageDomainObject = updateNamespaceOfDomainObject(object, notebookStorage.identifier.namespace);
saveNotebookImageDomainObject(this.openmct, notebookImageDomainObject);
} else {
this._saveToNotebookSnapshots(object, embed);
}
});
}
/**
@@ -58,26 +59,26 @@ export default class Snapshot {
*/
_saveToDefaultNoteBook(notebookStorage, embed) {
this.openmct.objects.get(notebookStorage.identifier)
.then(async (domainObject) => {
addNotebookEntry(this.openmct, domainObject, notebookStorage, embed);
.then((domainObject) => {
return addNotebookEntry(this.openmct, domainObject, notebookStorage, embed).then(async () => {
let link = notebookStorage.link;
let link = notebookStorage.link;
// Backwards compatibility fix (old notebook model without link)
if (!link) {
link = await getDefaultNotebookLink(this.openmct, domainObject);
notebookStorage.link = link;
setDefaultNotebook(this.openmct, notebookStorage);
}
// Backwards compatibility fix (old notebook model without link)
if (!link) {
link = await getDefaultNotebookLink(this.openmct, domainObject);
notebookStorage.link = link;
setDefaultNotebook(this.openmct, notebookStorage);
}
const { section, page } = getNotebookSectionAndPage(domainObject, notebookStorage.defaultSectionId, notebookStorage.defaultPageId);
if (!section || !page) {
return;
}
const { section, page } = getNotebookSectionAndPage(domainObject, notebookStorage.defaultSectionId, notebookStorage.defaultPageId);
if (!section || !page) {
return;
}
const defaultPath = `${domainObject.name} - ${section.name} - ${page.name}`;
const msg = `Saved to Notebook ${defaultPath}`;
this._showNotification(msg, link);
const defaultPath = `${domainObject.name} - ${section.name} - ${page.name}`;
const msg = `Saved to Notebook ${defaultPath}`;
this._showNotification(msg, link);
});
});
}

View File

@@ -1,5 +1,17 @@
import objectLink from '../../../ui/mixins/object-link';
async function getUsername(openmct) {
let username = '';
if (openmct.user.hasProvider()) {
const user = await openmct.user.getCurrentUser();
username = user.getName();
}
return username;
}
export const DEFAULT_CLASS = 'notebook-default';
const TIME_BOUNDS = {
START_BOUND: 'tc.startBound',
@@ -61,7 +73,7 @@ export function getHistoricLinkInFixedMode(openmct, bounds, historicLink) {
return params.join('&');
}
export function createNewEmbed(snapshotMeta, snapshot = '') {
export async function createNewEmbed(snapshotMeta, snapshot = '') {
const {
bounds,
link,
@@ -83,10 +95,12 @@ export function createNewEmbed(snapshotMeta, snapshot = '') {
});
const name = domainObject.name;
const type = domainObject.identifier.key;
const createdBy = await getUsername(openmct);
return {
bounds,
createdOn: date,
createdBy,
cssClass,
domainObject,
historicLink,
@@ -97,7 +111,7 @@ export function createNewEmbed(snapshotMeta, snapshot = '') {
};
}
export function addNotebookEntry(openmct, domainObject, notebookStorage, embed = null, entryText = '') {
export async function addNotebookEntry(openmct, domainObject, notebookStorage, embed = null, entryText = '') {
if (!openmct || !domainObject || !notebookStorage) {
return;
}
@@ -109,10 +123,12 @@ export function addNotebookEntry(openmct, domainObject, notebookStorage, embed =
? [embed]
: [];
const createdBy = await getUsername(openmct);
const id = `entry-${date}`;
const entry = {
id,
createdOn: date,
createdBy,
text: entryText,
embeds
};

View File

@@ -127,7 +127,7 @@ describe('Notebook Entries:', () => {
expect(entries.length).toEqual(0);
});
it('addNotebookEntry adds entry', () => {
it('addNotebookEntry adds entry', async () => {
const unlisten = openmct.objects.observe(notebookDomainObject, '*', (object) => {
const entries = NotebookEntries.getNotebookEntries(notebookDomainObject, selectedSection, selectedPage);
@@ -135,17 +135,38 @@ describe('Notebook Entries:', () => {
unlisten();
});
NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
await NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
});
it('getEntryPosById returns valid position', () => {
const entryId1 = NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
it('addNotebookEntry adds active user to entry', async () => {
const USER = 'Timmy';
openmct.user.hasProvider = () => true;
openmct.user.getCurrentUser = () => {
return Promise.resolve({
getName: () => {
return USER;
}
});
};
const unlisten = openmct.objects.observe(notebookDomainObject, '*', (object) => {
const entries = NotebookEntries.getNotebookEntries(notebookDomainObject, selectedSection, selectedPage);
expect(entries[0].createdBy).toEqual(USER);
unlisten();
});
await NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
});
it('getEntryPosById returns valid position', async () => {
const entryId1 = await NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
const position1 = NotebookEntries.getEntryPosById(entryId1, notebookDomainObject, selectedSection, selectedPage);
const entryId2 = NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
const entryId2 = await NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
const position2 = NotebookEntries.getEntryPosById(entryId2, notebookDomainObject, selectedSection, selectedPage);
const entryId3 = NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
const entryId3 = await NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
const position3 = NotebookEntries.getEntryPosById(entryId3, notebookDomainObject, selectedSection, selectedPage);
const success = position1 === 0
@@ -155,9 +176,9 @@ describe('Notebook Entries:', () => {
expect(success).toBe(true);
});
it('deleteNotebookEntries deletes correct page entries', () => {
NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
it('deleteNotebookEntries deletes correct page entries', async () => {
await NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
await NotebookEntries.addNotebookEntry(openmct, notebookDomainObject, notebookStorage);
NotebookEntries.deleteNotebookEntries(openmct, notebookDomainObject, selectedSection, selectedPage);
const afterEntries = NotebookEntries.getNotebookEntries(notebookDomainObject, selectedSection, selectedPage);

View File

@@ -68,6 +68,7 @@ mct-plot {
flex-direction: column;
overflow: hidden;
min-height: $plotMinH;
bottom: 30px;
.c-control-bar {
flex: 0 0 auto;

View File

@@ -6,7 +6,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
const webpack = require('webpack');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const {VueLoaderPlugin} = require('vue-loader');
const gitRevision = require('child_process')
.execSync('git rev-parse HEAD')
.toString().trim();
@@ -37,7 +37,7 @@ const config = {
alias: {
"@": path.join(__dirname, "src"),
"legacyRegistry": path.join(__dirname, "src/legacyRegistry"),
"saveAs": "file-saver",
"saveAs": "file-saver/src/FileSaver.js",
"csv": "comma-separated-values",
"EventEmitter": "eventemitter3",
"bourbon": "bourbon.scss",