Compare commits

...

51 Commits

Author SHA1 Message Date
Syed Tasnim Ahmed
cf5edf2db0 [clock] Timezone dropdown will collapse when clicked outside or on dropdown icon again (#4956)
* Fix timezone dropdown collapse issue

* Dropdown should collapse when click outside

* Fix Lint error

* add e2e test for autocomplete

* updates based of code review

* Typo fixed

* Modification based on review

Co-authored-by: Scott Bell <scott@traclabs.com>
2022-03-24 13:10:32 +01:00
Joe Pea
0705d321da invert npmignore to include what we want (#4605)
* invert npmignore to include what we want
* remove line for no-longer-existent src/**/*.spec.js files from npmignore
* cleanup npmignore comments
* remove platform dirs from npmignore, they were removed from the repo
* remove one more platform reference from npmignore
* publish example/ and app.js, at least for now

Co-authored-by: John Hill <john.c.hill@nasa.gov>
Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
2022-03-23 22:37:36 +00:00
Shefali Joshi
dad0768d57 Prepare for sprint 2.0.2 (#4990)
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-03-23 22:32:37 +00:00
dependabot[bot]
9643dbe918 Bump @percy/cli from 1.0.0-beta.75 to 1.0.0-beta.76 (#4989)
Bumps [@percy/cli](https://github.com/percy/cli/tree/HEAD/packages/cli) from 1.0.0-beta.75 to 1.0.0-beta.76.
- [Release notes](https://github.com/percy/cli/releases)
- [Commits](https://github.com/percy/cli/commits/v1.0.0-beta.76/packages/cli)

---
updated-dependencies:
- dependency-name: "@percy/cli"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-03-23 22:00:32 +00:00
Shefali Joshi
594f9d3e9a 2.0.1 release merged into master (#4971)
* Correctly use creatable attribute and persistability when working with domainObjects (#4898) (#4936)

* making move action location check persistability

* adding persistence check instead of creatability for styles

* added check for link action to make sure parent is persistable

* debug

* adding parent to link action and move action form location controls so they can be used in the form

* adding parent persistability check for duplicate

* updating multilple actions appliesTo methods to check for persistability

* updated the tree to not require an initial selection if being used in a form

* remove noneditable folder plugin

* added persistence check for the parent, in the create wizard

* minor name change

* removing noneditabl folder from default plugins as well

* checking the correct parent for persistability in create wizard

* importing file-saver correctly

* updated tests for import as json

* changes addressing PR review: using consts, removing comments, removing unneccessary code

Co-authored-by: Scott Bell <scott@traclabs.com>

Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
Co-authored-by: Scott Bell <scott@traclabs.com>

* Fix display layout items getting cut off on the bottom (like plots) (#4903)

* Fix display layout items getting cut off on the bottom (like plots)
Also fix Vue warnings

* Add partial e2e test for this bug fix. WIP.

* Address review comments

Co-authored-by: John Hill <john.c.hill@nasa.gov>

* Link action fix (#4945)

* handling edge case for linking a root item

* added location to viper plans (couch search folder) set to ROOT, added a check to remove action for alias (so you can remove linked nonpersistable items)

* added check for no parent in remove action (which means it is a root item)

* updating test

* Update time conductor inputs realtime (#4877)

* Update time conductor inputs realtime

* Update moveObjects.e2e.spec.js

* Update importAsJson.e2e.spec.js

* Update default.spec.js

Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
Co-authored-by: Scott Bell <scott@traclabs.com>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-03-23 14:53:39 -07:00
Michael Rogers
0f9e727675 34 - Image Pan and Zoom (#4736) 2022-03-23 21:10:50 +00:00
dependabot[bot]
0cf30940c8 Bump karma-chrome-launcher from 3.1.0 to 3.1.1 (#4987)
Bumps [karma-chrome-launcher](https://github.com/karma-runner/karma-chrome-launcher) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/karma-runner/karma-chrome-launcher/releases)
- [Changelog](https://github.com/karma-runner/karma-chrome-launcher/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma-chrome-launcher/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: karma-chrome-launcher
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-03-23 19:37:49 +00:00
dependabot[bot]
3a2381b90b Bump webpack-hot-middleware from 2.22.3 to 2.25.1 (#4969)
Bumps [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) from 2.22.3 to 2.25.1.
- [Release notes](https://github.com/webpack-contrib/webpack-hot-middleware/releases)
- [Commits](https://github.com/webpack-contrib/webpack-hot-middleware/compare/v2.22.3...v2.25.1)

---
updated-dependencies:
- dependency-name: webpack-hot-middleware
  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-03-23 18:30:55 +00:00
dependabot[bot]
94def56bcb Bump request from 2.69.0 to 2.88.2 (#4982)
Bumps [request](https://github.com/request/request) from 2.69.0 to 2.88.2.
- [Release notes](https://github.com/request/request/releases)
- [Changelog](https://github.com/request/request/blob/master/CHANGELOG.md)
- [Commits](https://github.com/request/request/commits)

---
updated-dependencies:
- dependency-name: request
  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>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-03-23 16:21:04 +00:00
dependabot[bot]
93a796353d Bump printj from 1.2.1 to 1.3.1 (#4981)
Bumps [printj](https://github.com/SheetJS/printj) from 1.2.1 to 1.3.1.
- [Release notes](https://github.com/SheetJS/printj/releases)
- [Commits](https://github.com/SheetJS/printj/commits)

---
updated-dependencies:
- dependency-name: printj
  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-03-23 08:03:37 -07:00
dependabot[bot]
18ff16052a Bump jasmine-core from 4.0.0 to 4.0.1 (#4980)
Bumps [jasmine-core](https://github.com/jasmine/jasmine) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/jasmine/jasmine/releases)
- [Changelog](https://github.com/jasmine/jasmine/blob/main/RELEASE.md)
- [Commits](https://github.com/jasmine/jasmine/compare/v4.0.0...v4.0.1)

---
updated-dependencies:
- dependency-name: jasmine-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-22 21:00:28 -07:00
dependabot[bot]
f1c7fa337d Bump raw-loader from 0.5.1 to 4.0.2 (#4978)
Bumps [raw-loader](https://github.com/webpack-contrib/raw-loader) from 0.5.1 to 4.0.2.
- [Release notes](https://github.com/webpack-contrib/raw-loader/releases)
- [Changelog](https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/raw-loader/commits/v4.0.2)

---
updated-dependencies:
- dependency-name: raw-loader
  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>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-03-23 03:29:04 +00:00
John Hill
557f29f9bb bump git-rev-sync and add tests (#4959)
Co-authored-by: unlikelyzero <jchill2@gmail.com>
2022-03-22 20:20:39 -07:00
dependabot[bot]
255ebc9a37 Bump core-js from 3.20.3 to 3.21.1 (#4970)
Bumps [core-js](https://github.com/zloirock/core-js) from 3.20.3 to 3.21.1.
- [Release notes](https://github.com/zloirock/core-js/releases)
- [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zloirock/core-js/compare/v3.20.3...v3.21.1)

---
updated-dependencies:
- dependency-name: core-js
  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-03-22 18:03:09 -07:00
Joe Pea
ca7fbe58e3 code coverage with babel istanbul (#4649)
* WIP add instanbul code coverage to vue files

* move webpack coverage config to a separate file for test:coverage, pin dependencies, remove istanbul-instrumenter-loader

* dont include node_modules in babel config, it breaks istanbul for some reason

* ignore spec files from coverage

* document coverage files, remove unused karma config

* use test instead of test:coverage in config.yml, disable code and link to issue to enable coverage in Vue <template>s
2022-03-22 16:04:23 -07:00
dependabot[bot]
b347f35892 Bump file-loader from 6.1.0 to 6.2.0 (#4834)
Bumps [file-loader](https://github.com/webpack-contrib/file-loader) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/webpack-contrib/file-loader/releases)
- [Changelog](https://github.com/webpack-contrib/file-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/file-loader/compare/v6.1.0...v6.2.0)

---
updated-dependencies:
- dependency-name: file-loader
  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>
Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
2022-03-22 13:33:02 -07:00
Scott Bell
28d5d72834 Event Generator now shows data in fixed time mode (#4883)
* fixed issue and added tests
* exclude leaky test
* ignore case when looking for testing instructions
2022-03-21 15:37:49 -07:00
Jamie V
0df33730f7 on route change, calling showTab (#4955) 2022-03-21 16:29:47 -05:00
John Hill
7b2ff8fa15 [Docs] add browserlist and linting capability (#4811)
* add browserlist to package.json

* add browserlist linting

* add eslint compat package

* Add blurb about browser support

* add ios safari

* remove node

* add comment and simple disable

Co-authored-by: unlikelyzero <jchill2@gmail.com>
Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
Co-authored-by: Scott Bell <scott@traclabs.com>
2022-03-21 20:27:18 +01:00
Joe Pea
d80b692354 Update eslint (#4554)
Bumps [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) from 7.20.0 to 8.0.3.
- [Release notes](https://github.com/vuejs/eslint-plugin-vue/releases)
- [Commits](https://github.com/vuejs/eslint-plugin-vue/compare/v7.20.0...v8.0.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-vue
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
* bump eslint to 8.11.0
* bump eslint-plugin-vue to 8.5.0
* disable eslint rule for multi-word component names. TODO enable it and follow conventions

Co-authored-by: Nikhil Mandlik <nikhil.k.mandlik@nasa.gov>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
Co-authored-by: unlikelyzero <jchill2@gmail.com>
Co-authored-by: Andrew Henry <akhenry@gmail.com>
2022-03-21 11:40:35 -07:00
Scott Bell
4205abdc80 Add Example Generator end to end test (#4949)
* add test

* added name to test and changed comment
2022-03-18 06:57:50 -07:00
Jamie V
492ff2fa64 [e2e] Persistence tests (#4943)
* initial setup for createButton e2e test

* insignificant change

* export as json

* import tests

* added first of two tests

* add stub

* fixme

* move objects

* added test for menu options for non persistable items

* removing "only" for debuggin test

* removing debug code

* soft assertion for multiple expects

Co-authored-by: unlikelyzero <jchill2@gmail.com>
2022-03-17 14:30:45 -07:00
John Hill
93a81a1369 [CI] Update GHA to include a specific playwright dependency version (#4944)
* Update e2e-pr.yml

* Update e2e-pr.yml

* Update e2e-pr.yml

* visual

Co-authored-by: Nikhil <nikhil.k.mandlik@nasa.gov>
2022-03-16 22:05:50 +00:00
Nikhil
482d8f392c Domain object properties validation not working always (#4893)
* Domain object properties validation not working always #4849

* stub of a test

* set local execution to chrome

* skip visual test

* use input event for changes and throttle update.

* moved file to correct location

* fixed e2e tests.

Co-authored-by: unlikelyzero <jchill2@gmail.com>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-03-16 21:53:58 +00:00
John Hill
67234c70a4 [Build] 🐰🐰🐰 Remove the last carrots 🐰🐰🐰 (#4941)
* [Build] 🐰🐰🐰 Remove the last carrots 🐰🐰🐰

* Update package.json

Co-authored-by: Khalid Adil <khalidadil29@gmail.com>
2022-03-16 21:44:41 +00:00
Nikhil
e9680e975f Form validation error messages are not being displayed properly (#4887)
* Form validation error messages are not being displayed properly #4697

* e2e Tests

* fixed element.checkValidity test

* remove comment

* adding timeconductor tests

* rename

Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
Co-authored-by: unlikelyzero <jchill2@gmail.com>
2022-03-16 13:54:46 -07:00
Jamie V
e691a89682 Correctly use creatable attribute and persistability when working with domainObjects (#4898)
* making move action location check persistability

* adding persistence check instead of creatability for styles

* added check for link action to make sure parent is persistable

* debug

* adding parent to link action and move action form location controls so they can be used in the form

* adding parent persistability check for duplicate

* updating multilple actions appliesTo methods to check for persistability

* updated the tree to not require an initial selection if being used in a form

* remove noneditable folder plugin

* added persistence check for the parent, in the create wizard

* minor name change

* removing noneditabl folder from default plugins as well

* checking the correct parent for persistability in create wizard

* importing file-saver correctly

* updated tests for import as json

* changes addressing PR review: using consts, removing comments, removing unneccessary code

Co-authored-by: Scott Bell <scott@traclabs.com>
2022-03-14 21:20:06 +01:00
Shefali Joshi
bcd668594d Add source maps to map plan properties to expected properties (#4933) 2022-03-11 10:40:05 -08:00
dependabot[bot]
5471e13d9e Bump @braintree/sanitize-url from 5.0.2 to 6.0.0 (#4928)
Bumps [@braintree/sanitize-url](https://github.com/braintree/sanitize-url) from 5.0.2 to 6.0.0.
- [Release notes](https://github.com/braintree/sanitize-url/releases)
- [Changelog](https://github.com/braintree/sanitize-url/blob/main/CHANGELOG.md)
- [Commits](https://github.com/braintree/sanitize-url/compare/v5.0.2...v6.0.0)

---
updated-dependencies:
- dependency-name: "@braintree/sanitize-url"
  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-03-09 19:53:39 -08:00
John Hill
dae446808e Update with CRUD Operation (#4930)
Co-authored-by: unlikelyzero <jchill2@gmail.com>
2022-03-09 06:45:10 -08:00
dependabot[bot]
ee9e47f487 Bump @playwright/test from 1.19.1 to 1.19.2 (#4905)
Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.19.1 to 1.19.2.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.19.1...v1.19.2)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Hill <john.c.hill@nasa.gov>
2022-03-08 18:49:48 -08:00
dependabot[bot]
003b1ffede Bump actions/setup-node from 2 to 3 (#4900)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2 to 3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-node
  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-03-07 18:33:18 -08:00
John Hill
16cb5f3911 [CI] Remove warning output for eslint on platform workflow (#4906) 2022-03-03 14:07:54 -08:00
dependabot[bot]
74b83903c9 Bump actions/checkout from 2 to 3 (#4904)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  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-03-02 09:59:13 -08:00
Khalid Adil
6a470fba1a Static root plugin not loading after namespace/key changes in OpenMCT #4684
Static root plugin not loading after namespace/key changes in OpenMCT
2022-02-28 11:51:34 -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
167 changed files with 4642 additions and 2173 deletions

View File

@@ -2,7 +2,7 @@ version: 2.1
executors: executors:
pw-focal-development: pw-focal-development:
docker: docker:
- image: mcr.microsoft.com/playwright:v1.18.1-focal - image: mcr.microsoft.com/playwright:v1.19.1-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:
@@ -76,7 +76,7 @@ jobs:
node-version: <<parameters.node-version>> node-version: <<parameters.node-version>>
- run: npm audit --audit-level=low - run: npm audit --audit-level=low
- generate_and_store_version_and_filesystem_artifacts - generate_and_store_version_and_filesystem_artifacts
node14-lint: lint:
parameters: parameters:
node-version: node-version:
type: string type: string
@@ -113,7 +113,7 @@ jobs:
steps: steps:
- browser-tools/install-chrome: - browser-tools/install-chrome:
replace-existing: false replace-existing: false
- run: npm run test:coverage -- --browsers=<<parameters.browser>> - run: npm run test -- --browsers=<<parameters.browser>>
- save_cache_cmd: - save_cache_cmd:
node-version: <<parameters.node-version>> node-version: <<parameters.node-version>>
- store_test_results: - store_test_results:
@@ -141,8 +141,8 @@ jobs:
workflows: workflows:
overall-circleci-commit-status: #These jobs run on every commit overall-circleci-commit-status: #These jobs run on every commit
jobs: jobs:
- node14-lint: - lint:
node-version: lts/fermium node-version: lts/gallium
- unit-test: - unit-test:
name: node12-chrome name: node12-chrome
node-version: lts/erbium node-version: lts/erbium
@@ -152,10 +152,14 @@ workflows:
node-version: lts/fermium node-version: lts/fermium
browser: ChromeHeadless browser: ChromeHeadless
post-steps: post-steps:
- upload_code_covio - upload_code_covio
- unit-test:
name: node16-chrome
node-version: lts/gallium
browser: ChromeHeadless
- e2e-test: - e2e-test:
name: e2e-ci name: e2e-ci
node-version: lts/fermium node-version: lts/gallium
suite: ci suite: ci
the-nightly: #These jobs do not run on PRs, but against master at night the-nightly: #These jobs do not run on PRs, but against master at night
jobs: jobs:
@@ -175,11 +179,15 @@ workflows:
name: node14-chrome-nightly name: node14-chrome-nightly
node-version: lts/fermium node-version: lts/fermium
browser: ChromeHeadless browser: ChromeHeadless
- unit-test:
name: node16-chrome-nightly
node-version: lts/gallium
browser: ChromeHeadless
- npm-audit: - npm-audit:
node-version: lts/fermium node-version: lts/gallium
- e2e-test: - e2e-test:
name: e2e-full-nightly name: e2e-full-nightly
node-version: lts/fermium node-version: lts/gallium
suite: full suite: full
triggers: triggers:
- schedule: - schedule:

View File

@@ -11,12 +11,14 @@ module.exports = {
}, },
"extends": [ "extends": [
"eslint:recommended", "eslint:recommended",
"plugin:compat/recommended",
"plugin:vue/recommended", "plugin:vue/recommended",
"plugin:you-dont-need-lodash-underscore/compatible" "plugin:you-dont-need-lodash-underscore/compatible"
], ],
"parser": "vue-eslint-parser", "parser": "vue-eslint-parser",
"parserOptions": { "parserOptions": {
"parser": "babel-eslint", "parser": "@babel/eslint-parser",
"requireConfigFile": false,
"allowImportExportEverywhere": true, "allowImportExportEverywhere": true,
"ecmaVersion": 2015, "ecmaVersion": 2015,
"ecmaFeatures": { "ecmaFeatures": {
@@ -35,7 +37,6 @@ module.exports = {
"no-inner-declarations": "off", "no-inner-declarations": "off",
"no-use-before-define": ["error", "nofunc"], "no-use-before-define": ["error", "nofunc"],
"no-caller": "error", "no-caller": "error",
"no-sequences": "error",
"no-irregular-whitespace": "error", "no-irregular-whitespace": "error",
"no-new": "error", "no-new": "error",
"no-shadow": "error", "no-shadow": "error",
@@ -239,13 +240,12 @@ module.exports = {
], ],
"vue/max-attributes-per-line": ["error", { "vue/max-attributes-per-line": ["error", {
"singleline": 1, "singleline": 1,
"multiline": { "multiline": 1,
"max": 1,
"allowFirstLine": true
}
}], }],
"vue/first-attribute-linebreak": "error",
"vue/multiline-html-element-content-newline": "off", "vue/multiline-html-element-content-newline": "off",
"vue/singleline-html-element-content-newline": "off", "vue/singleline-html-element-content-newline": "off",
"vue/multi-word-component-names": "off", // TODO enable, align with conventions
"vue/no-mutating-props": "off" "vue/no-mutating-props": "off"
}, },

View File

@@ -17,15 +17,6 @@ assignees: ''
#### Expected vs Current Behavior #### Expected vs Current Behavior
<!--- Tell us what should have happened --> <!--- 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 #### Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant --> <!--- reproduce this bug. Include code to reproduce, if relevant -->
@@ -35,10 +26,20 @@ assignees: ''
4. 4.
#### Environment #### 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 --> * Open MCT Version: <!--- date of build, version, or SHA -->
* Deployment Type: <!--- npm dev? VIPER Dev? openmct-yamcs? --> * Deployment Type: <!--- npm dev? VIPER Dev? openmct-yamcs? -->
* OS: * OS:
* Browser: * 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 #### Additional Information
<!--- Include any screenshots, gifs, or logs which will expedite triage --> <!--- Include any screenshots, gifs, or logs which will expedite triage -->

View File

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

View File

@@ -28,7 +28,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL

View File

@@ -2,15 +2,22 @@ name: "e2e-pr"
on: on:
workflow_dispatch: workflow_dispatch:
pull_request: pull_request:
types: [ labeled ] types:
- labeled
- opened
jobs: jobs:
e2e-full: e2e-full:
if: ${{ github.event.label.name == 'pr:e2e' }} if: ${{ github.event.label.name == 'pr:e2e' }}
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
steps: steps:
- name: Trigger Success - name: Trigger Success
uses: actions/github-script@v5 uses: actions/github-script@v6
with: with:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({
@@ -19,11 +26,11 @@ jobs:
repo: "openmct", repo: "openmct",
body: 'Started e2e Run. Follow along: https://github.com/nasa/openmct/actions/runs/' + context.runId body: 'Started e2e Run. Follow along: https://github.com/nasa/openmct/actions/runs/' + context.runId
}) })
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2 - uses: actions/setup-node@v3
with: with:
node-version: '14' node-version: '16'
- run: npx playwright install-deps - run: npx playwright@1.19.2 install
- 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
@@ -32,7 +39,7 @@ jobs:
path: test-results path: test-results
- name: Test success - name: Test success
if: ${{ success() }} if: ${{ success() }}
uses: actions/github-script@v5 uses: actions/github-script@v6
with: with:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({
@@ -43,7 +50,7 @@ jobs:
}) })
- name: Test failure - name: Test failure
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/github-script@v5 uses: actions/github-script@v6
with: with:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({

View File

@@ -4,6 +4,7 @@ on:
pull_request: pull_request:
types: types:
- labeled - labeled
- opened
schedule: schedule:
- cron: '28 21 * * 1-5' - cron: '28 21 * * 1-5'
@@ -12,11 +13,11 @@ jobs:
if: ${{ github.event.label.name == 'pr:visual' }} || ${{ github.event.workflow_dispatch }} || ${{ github.event.schedule }} if: ${{ github.event.label.name == 'pr:visual' }} || ${{ github.event.workflow_dispatch }} || ${{ github.event.schedule }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2 - uses: actions/setup-node@v3
with: with:
node-version: '14' node-version: '16'
- run: npx playwright install-deps - run: npx playwright@1.19.2 install
- 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

View File

@@ -10,12 +10,12 @@ jobs:
e2e: e2e:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
ref: ${{ github.event.inputs.version }} ref: ${{ github.event.inputs.version }}
- uses: actions/setup-node@v2 - uses: actions/setup-node@v3
with: with:
node-version: '14' node-version: '16'
- run: npm install - run: npm install
- name: Run the e2e tests - name: Run the e2e tests
run: npm run test:e2e:ci run: npm run test:e2e:ci

View File

@@ -5,16 +5,96 @@ on:
version: version:
description: 'Which branch do you want to test?' # Limited to branch for now description: 'Which branch do you want to test?' # Limited to branch for now
required: false required: false
default: 'master' default: 'master'
pull_request:
types:
- labeled
schedule:
- cron: '28 21 * * 1-5'
jobs: jobs:
lighthouse: lighthouse-pr:
if: ${{ github.event.label.name == 'pr:lighthouse' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Checkout Master for Baseline
uses: actions/checkout@v3
with: with:
ref: ${{ github.event.inputs.version }} ref: master #explicitly checkout master for baseline
- uses: actions/setup-node@v2 - name: Install Node 14
uses: actions/setup-node@v3
with: with:
node-version: '14' node-version: '14'
- run: npm install && npm install -g @lhci/cli #Don't want to include this in our deps - name: Cache node modules
- run: lhci autorun 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@v3
with:
clean: true
- name: Install Node version which is compatible with PR
uses: actions/setup-node@v3
- 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@v3
- name: Install Node 14
uses: actions/setup-node@v3
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@v3
with:
ref: ${{ github.event.inputs.version }}
- name: Install Node 14
uses: actions/setup-node@v3
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

View File

@@ -11,10 +11,10 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2 - uses: actions/setup-node@v3
with: with:
node-version: 14 node-version: 16
- run: npm install - run: npm install
- run: npm test - run: npm test
@@ -22,10 +22,10 @@ jobs:
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v2 - uses: actions/setup-node@v3
with: with:
node-version: 14 node-version: 16
registry-url: https://registry.npmjs.org/ registry-url: https://registry.npmjs.org/
- run: npm install - run: npm install
- run: npm publish --access public --tag unstable - 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@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- run: npm install
- run: npm test
- run: npm run lint -- --quiet

View File

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

View File

@@ -1,44 +1,27 @@
*.scssc # Ignore everything first (will not ignore special files like LICENSE.md,
*.zip # README.md, and package.json)...
*.gzip /**/*
*.tgz
*.DS_Store
*.sass-cache # ...but include these folders...
*COMPILE.css !/dist/**/*
!/src/**/*
# Intellij project configuration files # We might be able to remove this if it is not imported by any project directly.
*.idea # https://github.com/nasa/openmct/issues/4992
*.iml !/example/**/*
# External dependencies # We will remove this in https://github.com/nasa/openmct/issues/4922
!/app.js
# Build output # ...except for these files in the above folders.
target /src/**/*Spec.js
/src/**/test/
# TODO move test utils into test/ folders
/src/utils/testing.js
# Mac OS X Finder # Also include these special top-level files.
.DS_Store !copyright-notice.js
!copyright-notice.html
# Closed source libraries !index.html
closed-lib !openmct.js
!SECURITY.md
# Node, Bower dependencies
node_modules
bower_components
Procfile
# Protractor logs
protractor/logs
# npm-debug log
npm-debug.log
# Infra and tests
.circleci
.github
e2e
codecov.yml
lighthouserc.yml
*.Spec.js
karma.conf.js

5
.npmrc
View File

@@ -1,9 +1,4 @@
loglevel=warn loglevel=warn
# Temporary: istanbul-instrumenter-loader is working with webpack 5, but states
# webpack 4 being the latest version it supports, so this legacy-peer-deps
# allows us to install it anyway.
legacy-peer-deps=true
#Prevent folks from ignoring an important error when building from source #Prevent folks from ignoring an important error when building from source
engine-strict=true engine-strict=true

View File

@@ -65,6 +65,12 @@ Open MCT is built using [`npm`](http://npmjs.com/) and [`webpack`](https://webpa
See our documentation for a guide on [building Applications with Open MCT](https://github.com/nasa/openmct/blob/master/API.md#starting-an-open-mct-application). See our documentation for a guide on [building Applications with Open MCT](https://github.com/nasa/openmct/blob/master/API.md#starting-an-open-mct-application).
## Compatibility
This is a fast moving project and we do our best to test and support the widest possible range of browsers, operating systems, and nodejs APIs. We have a published list of support available in our package.json's `browserslist` key.
If you encounter an issue with a particular browser, OS, or nodejs API, please file a [GitHub issue](https://github.com/nasa/openmct/issues/new/choose)
## Plugins ## Plugins
Open MCT can be extended via plugins that make calls to the Open MCT API. A plugin is a group Open MCT can be extended via plugins that make calls to the Open MCT API. A plugin is a group

9
babel.coverage.js Normal file
View File

@@ -0,0 +1,9 @@
// This is a Babel config that webpack.coverage.js uses in order to instrument
// code with coverage instrumentation.
const babelConfig = {
plugins: [['babel-plugin-istanbul', {
extension: ['.js', '.vue']
}]]
};
module.exports = babelConfig;

View File

@@ -0,0 +1,62 @@
/*****************************************************************************
* 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.
*****************************************************************************/
/*
This test suite is dedicated to tests which verify branding related components.
*/
const { test, expect } = require('@playwright/test');
test.describe('Branding tests', () => {
test('About Modal launches with basic branding properties', async ({ page }) => {
// Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
// Click About button
await page.click('.l-shell__app-logo');
// Verify that the NASA Logo Appears
await expect(await page.locator('.c-about__image')).toBeVisible();
// Modify the Build information in 'about' Modal
const versionInformationLocator = page.locator('ul.t-info.l-info.s-info');
await expect(versionInformationLocator).toBeEnabled();
await expect.soft(versionInformationLocator).toContainText(/Version: \d/);
await expect.soft(versionInformationLocator).toContainText(/Build Date: ((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun))/);
await expect.soft(versionInformationLocator).toContainText(/Revision: \b[0-9a-f]{5,40}\b/);
await expect.soft(versionInformationLocator).toContainText(/Branch: ./);
});
test('Verify Links in About Modal', async ({ page }) => {
// Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
// Click About button
await page.click('.l-shell__app-logo');
// Verify that clicking on the third party licenses information opens up another tab on licenses url
const [page2] = await Promise.all([
page.waitForEvent('popup'),
page.locator('text=click here for third party licensing information').click()
]);
expect(page2.waitForURL('**\/licenses**')).toBeTruthy();
});
});

View File

@@ -0,0 +1,62 @@
/*****************************************************************************
* 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.
*****************************************************************************/
/*
This test suite is dedicated to tests which verify the basic operations surrounding the example event generator.
*/
const { test, expect } = require('@playwright/test');
test.describe('Example Event Generator Operations', () => {
test('Can create example event generator with a name', async ({ page }) => {
//Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
// let's make an event generator
await page.locator('button:has-text("Create")').click();
// Click li:has-text("Event Message Generator")
await page.locator('li:has-text("Event Message Generator")').click();
// Click text=Properties Title Notes >> input[type="text"]
await page.locator('text=Properties Title Notes >> input[type="text"]').click();
// Fill text=Properties Title Notes >> input[type="text"]
await page.locator('text=Properties Title Notes >> input[type="text"]').fill('Test Event Generator');
// Press Enter
await page.locator('text=Properties Title Notes >> input[type="text"]').press('Enter');
// Click text=OK
await Promise.all([
page.waitForNavigation({ url: /.*&view=table/ }),
page.locator('text=OK').click()
]);
await expect(page.locator('.l-browse-bar__object-name')).toContainText('Test Event Generator');
// Click button:has-text("Fixed Timespan")
await page.locator('button:has-text("Fixed Timespan")').click();
});
test.fixme('telemetry is coming in for test event', async ({ page }) => {
// Go to object created in step one
// Verify the telemetry table is filled with > 1 row
});
test.fixme('telemetry is sorted by time ascending', async ({ page }) => {
// Go to object created in step one
// Verify the telemetry table has a class with "is-sorting asc"
});
});

View File

@@ -0,0 +1,66 @@
/*****************************************************************************
* 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.
*****************************************************************************/
/*
This test suite is dedicated to tests which verify the basic operations surrounding Clock.
*/
const { test, expect } = require('@playwright/test');
test.describe('Clock Generator', () => {
test('Timezone dropdown will collapse when clicked outside or on dropdown icon again', async ({ page }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/nasa/openmct/issues/4878'
});
//Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
//Click the Create button
await page.click('button:has-text("Create")');
// Click Clock
await page.click('text=Clock');
// Click .icon-arrow-down
await page.locator('.icon-arrow-down').click();
//verify if the autocomplete dropdown is visible
await expect(page.locator(".optionPreSelected")).toBeVisible();
// Click .icon-arrow-down
await page.locator('.icon-arrow-down').click();
// Verify clicking on the autocomplete arrow collapses the dropdown
await expect(page.locator(".optionPreSelected")).not.toBeVisible();
// Click timezone input to open dropdown
await page.locator('.autocompleteInput').click();
//verify if the autocomplete dropdown is visible
await expect(page.locator(".optionPreSelected")).toBeVisible();
// Verify clicking outside the autocomplete dropdown collapses it
await page.locator('text=Timezone').click();
// Verify clicking on the autocomplete arrow collapses the dropdown
await expect(page.locator(".optionPreSelected")).not.toBeVisible();
});
});

View File

@@ -0,0 +1,161 @@
/*****************************************************************************
* 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.
*****************************************************************************/
/*
This test suite is dedicated to tests which verify the basic operations surrounding conditionSets.
*/
const { test, expect } = require('@playwright/test');
test.describe('Sine Wave Generator', () => {
test('Create new Sine Wave Generator Object and validate create Form Logic', async ({ page }) => {
//Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
//Click the Create button
await page.click('button:has-text("Create")');
// Click Sine Wave Generator
await page.click('text=Sine Wave Generator');
// Verify that the each required field has required indicator
// Title
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(['c-form-row__state-indicator req']);
// Verify that the Notes row does not have a required indicator
await expect(page.locator('.c-form__section div:nth-child(3) .form-row .c-form-row__state-indicator')).not.toContain('.req');
// Period
await expect(page.locator('.c-form__section div:nth-child(4) .form-row .c-form-row__state-indicator')).toHaveClass(['c-form-row__state-indicator req']);
// Amplitude
await expect(page.locator('.c-form__section div:nth-child(5) .form-row .c-form-row__state-indicator')).toHaveClass(['c-form-row__state-indicator req']);
// Offset
await expect(page.locator('.c-form__section div:nth-child(6) .form-row .c-form-row__state-indicator')).toHaveClass(['c-form-row__state-indicator req']);
// Data Rate
await expect(page.locator('.c-form__section div:nth-child(7) .form-row .c-form-row__state-indicator')).toHaveClass(['c-form-row__state-indicator req']);
// Phase
await expect(page.locator('.c-form__section div:nth-child(8) .form-row .c-form-row__state-indicator')).toHaveClass(['c-form-row__state-indicator req']);
// Randomness
await expect(page.locator('.c-form__section div:nth-child(9) .form-row .c-form-row__state-indicator')).toHaveClass(['c-form-row__state-indicator req']);
// Verify that by removing value from required text field shows invalid indicator
await page.locator('text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]').fill('');
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(['c-form-row__state-indicator req invalid']);
// Verify that by adding value to empty required text field changes invalid to valid indicator
await page.locator('text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]').fill('non empty');
await expect(page.locator('.c-form-row__state-indicator').first()).toHaveClass(['c-form-row__state-indicator req valid']);
// Verify that by removing value from required number field shows invalid indicator
await page.locator('.field.control.l-input-sm input').first().fill('');
await expect(page.locator('.c-form__section div:nth-child(4) .form-row .c-form-row__state-indicator')).toHaveClass(['c-form-row__state-indicator req invalid']);
// Verify that by adding value to empty required number field changes invalid to valid indicator
await page.locator('.field.control.l-input-sm input').first().fill('3');
await expect(page.locator('.c-form__section div:nth-child(4) .form-row .c-form-row__state-indicator')).toHaveClass(['c-form-row__state-indicator req valid']);
// Verify that can change value of number field by up/down arrows keys
// Click .field.control.l-input-sm input >> nth=0
await page.locator('.field.control.l-input-sm input').first().click();
// Press ArrowUp 3 times to change value from 3 to 6
await page.locator('.field.control.l-input-sm input').first().press('ArrowUp');
await page.locator('.field.control.l-input-sm input').first().press('ArrowUp');
await page.locator('.field.control.l-input-sm input').first().press('ArrowUp');
const value = await page.locator('.field.control.l-input-sm input').first().inputValue();
await expect(value).toBe('6');
// Click .c-form-row__state-indicator.grows
await page.locator('.c-form-row__state-indicator.grows').click();
// Click text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]
await page.locator('text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]').click();
// Click .c-form-row__state-indicator >> nth=0
await page.locator('.c-form-row__state-indicator').first().click();
// Fill text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]
await page.locator('text=Properties Title Notes Period Amplitude Offset Data Rate (hz) Phase (radians) Ra >> input[type="text"]').fill('New Sine Wave Generator');
// Double click div:nth-child(4) .form-row .c-form-row__controls
await page.locator('div:nth-child(4) .form-row .c-form-row__controls').dblclick();
// Click .field.control.l-input-sm input >> nth=0
await page.locator('.field.control.l-input-sm input').first().click();
// Click div:nth-child(4) .form-row .c-form-row__state-indicator
await page.locator('div:nth-child(4) .form-row .c-form-row__state-indicator').click();
// Click .field.control.l-input-sm input >> nth=0
await page.locator('.field.control.l-input-sm input').first().click();
// Click .field.control.l-input-sm input >> nth=0
await page.locator('.field.control.l-input-sm input').first().click();
// Click div:nth-child(5) .form-row .c-form-row__controls .form-control .field input
await page.locator('div:nth-child(5) .form-row .c-form-row__controls .form-control .field input').click();
// Click div:nth-child(5) .form-row .c-form-row__controls .form-control .field input
await page.locator('div:nth-child(5) .form-row .c-form-row__controls .form-control .field input').click();
// Click div:nth-child(5) .form-row .c-form-row__controls .form-control .field input
await page.locator('div:nth-child(5) .form-row .c-form-row__controls .form-control .field input').click();
// Click div:nth-child(6) .form-row .c-form-row__controls .form-control .field input
await page.locator('div:nth-child(6) .form-row .c-form-row__controls .form-control .field input').click();
// Double click div:nth-child(7) .form-row .c-form-row__controls .form-control .field input
await page.locator('div:nth-child(7) .form-row .c-form-row__controls .form-control .field input').dblclick();
// Click div:nth-child(7) .form-row .c-form-row__state-indicator
await page.locator('div:nth-child(7) .form-row .c-form-row__state-indicator').click();
// Click div:nth-child(7) .form-row .c-form-row__controls .form-control .field input
await page.locator('div:nth-child(7) .form-row .c-form-row__controls .form-control .field input').click();
// Fill div:nth-child(7) .form-row .c-form-row__controls .form-control .field input
await page.locator('div:nth-child(7) .form-row .c-form-row__controls .form-control .field input').fill('3');
//Click text=OK
await Promise.all([
page.waitForNavigation(),
page.click('text=OK')
]);
// Verify that the Sine Wave Generator is displayed and correct
// Verify object properties
await expect(page.locator('.l-browse-bar__object-name')).toContainText('New Sine Wave Generator');
// Verify canvas rendered
await page.locator('canvas').nth(1).click({
position: {
x: 341,
y: 28
}
});
});
});

View File

@@ -1,50 +1,42 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2022, 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.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * 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. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
import {
createOpenMct, /*
resetApplicationState This test suite is dedicated to tests which verify the basic operations surrounding moving objects.
} from 'utils/testing'; */
describe("the plugin", () => { const { test, expect } = require('@playwright/test');
const NON_EDITABLE_FOLDER_KEY = 'noneditable.folder';
let openmct; test.describe('Move item tests', () => {
test.fixme('Create a basic object and verify that it can be moved to another Folder', async ({ page }) => {
beforeEach((done) => { //Create and save Folder
openmct = createOpenMct(); //Create and save Domain Object
openmct.install(openmct.plugins.NonEditableFolder()); //Verify that the newly created domain object can be moved to Folder from Step 1.
//Verify that newly moved object appears in the correct point in Tree
openmct.on('start', done); //Verify that newly moved object appears correctly in Inspector panel
openmct.startHeadless(); });
}); test.fixme('Create a basic object and verify that it cannot be moved to object without Composition Provider', async ({ page }) => {
//Create and save Telemetry Object
afterEach(() => { //Create and save Domain Object
return resetApplicationState(openmct); //Verify that the newly created domain object cannot be moved to Telemetry Object from step 1.
}); });
});
it('adds the new non-editable folder type', () => {
const type = openmct.types.get(NON_EDITABLE_FOLDER_KEY);
expect(type).toBeDefined();
expect(type.definition.creatable).toBeFalse();
});
});

View File

@@ -0,0 +1,27 @@
(function () {
document.addEventListener('DOMContentLoaded', () => {
const PERSISTENCE_KEY = 'persistence-tests';
const openmct = window.openmct;
openmct.objects.addRoot({
namespace: PERSISTENCE_KEY,
key: PERSISTENCE_KEY
});
openmct.objects.addProvider(PERSISTENCE_KEY, {
get(identifier) {
if (identifier.key !== PERSISTENCE_KEY) {
return undefined;
} else {
return Promise.resolve({
identifier,
type: 'folder',
name: 'Persistence Testing',
location: 'ROOT',
composition: []
});
}
}
});
});
}());

View File

@@ -0,0 +1,77 @@
/*****************************************************************************
* 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.
*****************************************************************************/
/*
This test suite is dedicated to tests which verify the basic operations surrounding conditionSets.
*/
const { test, expect } = require('@playwright/test');
const path = require('path');
// https://github.com/nasa/openmct/issues/4323#issuecomment-1067282651
test.describe('Persistence operations', () => {
// add non persistable root item
test.beforeEach(async ({ page }) => {
// eslint-disable-next-line no-undef
await page.addInitScript({ path: path.join(__dirname, 'addNoneditableObject.js') });
});
test('Persistability should be respected in the create form location field', async ({ page }) => {
// Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
// Click the Create button
await page.click('button:has-text("Create")');
// Click text=Condition Set
await page.click('text=Condition Set');
// Click form[name="mctForm"] >> text=Persistence Testing
await page.locator('form[name="mctForm"] >> text=Persistence Testing').click();
// Check that "OK" button is disabled
const okButton = page.locator('button:has-text("OK")');
await expect(okButton).toBeDisabled();
});
test('Non-persistable objects should not show persistence related actions', async ({ page }) => {
// Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
// Click text=Persistence Testing >> nth=0
await page.locator('text=Persistence Testing').first().click({
button: 'right'
});
const menuOptions = page.locator('.c-menu ul');
await expect.soft(menuOptions).toContainText(['Open In New Tab', 'View', 'Create Link']);
await expect(menuOptions).not.toContainText(['Move', 'Duplicate', 'Remove', 'Add New Folder', 'Edit Properties...', 'Export as JSON', 'Import from JSON']);
});
test.fixme('Cannot move a previously created domain object to non-peristable boject in Move Modal', async ({ page }) => {
//Create a domain object
//Save Domain object
//Move Object and verify that cannot select non-persistable object
//Move Object to My Items
//Verify successful move
});
});

View File

@@ -0,0 +1,48 @@
/*****************************************************************************
* 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.
*****************************************************************************/
/*
This test suite is dedicated to tests which verify the basic operations surrounding exportAsJSON.
*/
const { test, expect } = require('@playwright/test');
test.describe('ExportAsJSON', () => {
test.fixme('Create a basic object and verify that it can be exported as JSON from Tree', async ({ page }) => {
//Create domain object
//Save Domain Object
//Verify that the newly created domain object can be exported as JSON from the Tree
});
test.fixme('Create a basic object and verify that it can be exported as JSON from 3 dot menu', async ({ page }) => {
//Create domain object
//Save Domain Object
//Verify that the newly created domain object can be exported as JSON from the 3 dot menu
});
test.fixme('Verify that a nested Object can be exported as JSON', async ({ page }) => {
// Create 2 objects with hierarchy
// Export as JSON
// Verify Hiearchy
});
test.fixme('Verify that the ExportAsJSON dropdown does not appear for the item X', async ({ page }) => {
// Other than non-persistible objects
});
});

View File

@@ -1,33 +1,46 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2022, 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.
* *
* Open MCT is licensed under the Apache License, Version 2.0 (the * 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. * "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0. * http://www.apache.org/licenses/LICENSE-2.0.
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations * License for the specific language governing permissions and limitations
* under the License. * under the License.
* *
* Open MCT includes source code licensed under additional open source * Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with * licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available * this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information. * at runtime from the About dialog for additional information.
*****************************************************************************/ *****************************************************************************/
export default function () { /*
return function (openmct) { This test suite is dedicated to tests which verify the basic operations surrounding importAsJSON.
openmct.types.addType("noneditable.folder", { */
name: "Non-Editable Folder",
key: "noneditable.folder", const { test, expect } = require('@playwright/test');
description: "Create folders to organize other objects or links to objects without the ability to edit it's properties.",
cssClass: "icon-folder", test.describe('ExportAsJSON', () => {
creatable: false test.fixme('Verify that domain object can be importAsJSON from Tree', async ({ page }) => {
}); //Verify that an testdata JSON file can be imported from Tree
}; //Verify correctness of imported domain object
} });
test.fixme('Verify that domain object can be importAsJSON from 3 dot menu on folder', async ({ page }) => {
//Verify that an testdata JSON file can be imported from 3 dot menu on folder domain object
//Verify correctness of imported domain object
});
test.fixme('Verify that a nested Objects can be importAsJSON', async ({ page }) => {
// Testdata with hierarchy
// ImportAsJSON on Tree
// Verify Hierarchy
});
test.fixme('Verify that the ImportAsJSON dropdown does not appear for the item X', async ({ page }) => {
// Other than non-persistible objects
});
});

View File

@@ -26,8 +26,8 @@ This test suite is dedicated to tests which verify the basic operations surround
const { test, expect } = require('@playwright/test'); const { test, expect } = require('@playwright/test');
test.describe('condition set', () => { test.describe('Condition Set Operations', () => {
test('create new button `condition set` creates new condition object', async ({ page }) => { test('Create new button `condition set` creates new condition object', async ({ page }) => {
//Go to baseURL //Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' }); await page.goto('/', { waitUntil: 'networkidle' });
@@ -45,4 +45,21 @@ test.describe('condition set', () => {
await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set'); await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Condition Set');
}); });
test.fixme('condition set object properties exist', async ({ page }) => {
//Go to object created in step one
//Verify the Condition Set properties persist on Save
//Verify the Condition Set properties persist on page.reload()
});
test.fixme('condition set object can be modified', async ({ page }) => {
//Go to object created in step one
//Update the Condition Set properties
//Verify the Condition Set properties persist on Save
//Verify the Condition Set properties persist on page.reload()
});
test.fixme('condition set object can be deleted', async ({ page }) => {
//Go to object created in step one
//Verify that Condition Set object can be deleted
//Verify the Condition Set object does not exist in Tree
//Verify the Condition Set object does not exist with direct navigation to object's URL
});
}); });

View File

@@ -0,0 +1,217 @@
/*****************************************************************************
* 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.
*****************************************************************************/
/*
This test suite is dedicated to tests which verify the basic operations surrounding imagery,
but only assume that example imagery is present.
*/
const { test, expect } = require('@playwright/test');
test.describe('Example Imagery', () => {
test.beforeEach(async ({ page }) => {
page.on('console', msg => console.log(msg.text()))
//Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
//Click the Create button
await page.click('button:has-text("Create")');
// Click text=Example Imagery
await page.click('text=Example Imagery');
// Click text=OK
await Promise.all([
page.waitForNavigation(/*{ url: 'http://localhost:8080/#/browse/mine/dab945d4-5a84-480e-8180-222b4aa730fa?tc.mode=fixed&tc.startBound=1639696164435&tc.endBound=1639697964435&tc.timeSystem=utc&view=conditionSet.view' }*/),
page.click('text=OK')
]);
await expect(page.locator('.l-browse-bar__object-name')).toContainText('Unnamed Example Imagery');
});
const backgroundImageSelector = '.c-imagery__main-image__background-image';
test('Can use Mouse Wheel to zoom in and out of latest image', async ({ page }) => {
const bgImageLocator = await page.locator(backgroundImageSelector);
const deltaYStep = 100; //equivalent to 1x zoom
await bgImageLocator.hover();
const originalImageDimensions = await page.locator(backgroundImageSelector).boundingBox();
// zoom in
await bgImageLocator.hover();
await page.mouse.wheel(0, deltaYStep * 2);
// wait for zoom animation to finish
await bgImageLocator.hover();
const imageMouseZoomedIn = await page.locator(backgroundImageSelector).boundingBox();
// zoom out
await bgImageLocator.hover();
await page.mouse.wheel(0, -deltaYStep);
// wait for zoom animation to finish
await bgImageLocator.hover();
const imageMouseZoomedOut = await page.locator(backgroundImageSelector).boundingBox();
expect(imageMouseZoomedIn.height).toBeGreaterThan(originalImageDimensions.height);
expect(imageMouseZoomedIn.width).toBeGreaterThan(originalImageDimensions.width);
expect(imageMouseZoomedOut.height).toBeLessThan(imageMouseZoomedIn.height);
expect(imageMouseZoomedOut.width).toBeLessThan(imageMouseZoomedIn.width);
});
test('Can use alt+drag to move around image once zoomed in', async ({ page }) => {
const deltaYStep = 100; //equivalent to 1x zoom
const bgImageLocator = await page.locator(backgroundImageSelector);
await bgImageLocator.hover();
// zoom in
await page.mouse.wheel(0, deltaYStep * 2);
await bgImageLocator.hover();
const zoomedBoundingBox = await bgImageLocator.boundingBox();
const imageCenterX = zoomedBoundingBox.x + zoomedBoundingBox.width / 2;
const imageCenterY = zoomedBoundingBox.y + zoomedBoundingBox.height / 2;
// move to the right
// center the mouse pointer
await page.mouse.move(imageCenterX, imageCenterY);
// pan right
await page.keyboard.down('Alt');
await page.mouse.down();
await page.mouse.move(imageCenterX - 200, imageCenterY, 10);
await page.mouse.up();
await page.keyboard.up('Alt');
const afterRightPanBoundingBox = await bgImageLocator.boundingBox();
expect(zoomedBoundingBox.x).toBeGreaterThan(afterRightPanBoundingBox.x);
// pan left
await page.keyboard.down('Alt');
await page.mouse.down();
await page.mouse.move(imageCenterX, imageCenterY, 10);
await page.mouse.up();
await page.keyboard.up('Alt');
const afterLeftPanBoundingBox = await bgImageLocator.boundingBox();
expect(afterRightPanBoundingBox.x).toBeLessThan(afterLeftPanBoundingBox.x);
// pan up
await page.mouse.move(imageCenterX, imageCenterY);
await page.keyboard.down('Alt');
await page.mouse.down();
await page.mouse.move(imageCenterX, imageCenterY + 200, 10);
await page.mouse.up();
await page.keyboard.up('Alt');
const afterUpPanBoundingBox = await bgImageLocator.boundingBox();
expect(afterUpPanBoundingBox.y).toBeGreaterThan(afterLeftPanBoundingBox.y);
// pan down
await page.keyboard.down('Alt');
await page.mouse.down();
await page.mouse.move(imageCenterX, imageCenterY - 200, 10);
await page.mouse.up();
await page.keyboard.up('Alt');
const afterDownPanBoundingBox = await bgImageLocator.boundingBox();
expect(afterDownPanBoundingBox.y).toBeLessThan(afterUpPanBoundingBox.y);
});
test('Can use + - buttons to zoom on the image', async ({ page }) => {
const bgImageLocator = await page.locator(backgroundImageSelector);
await bgImageLocator.hover();
const zoomInBtn = await page.locator('.t-btn-zoom-in');
const zoomOutBtn = await page.locator('.t-btn-zoom-out');
const initialBoundingBox = await bgImageLocator.boundingBox();
await zoomInBtn.click();
await zoomInBtn.click();
// wait for zoom animation to finish
await bgImageLocator.hover();
const zoomedInBoundingBox = await bgImageLocator.boundingBox();
expect(zoomedInBoundingBox.height).toBeGreaterThan(initialBoundingBox.height);
expect(zoomedInBoundingBox.width).toBeGreaterThan(initialBoundingBox.width);
await zoomOutBtn.click();
// wait for zoom animation to finish
await bgImageLocator.hover();
const zoomedOutBoundingBox = await bgImageLocator.boundingBox();
expect(zoomedOutBoundingBox.height).toBeLessThan(zoomedInBoundingBox.height);
expect(zoomedOutBoundingBox.width).toBeLessThan(zoomedInBoundingBox.width);
});
test('Can use the reset button to reset the image', async ({ page }) => {
const bgImageLocator = await page.locator(backgroundImageSelector);
await bgImageLocator.hover();
const zoomInBtn = await page.locator('.t-btn-zoom-in');
const zoomResetBtn = await page.locator('.t-btn-zoom-reset');
const initialBoundingBox = await bgImageLocator.boundingBox();
await zoomInBtn.click();
await zoomInBtn.click();
// wait for zoom animation to finish
await bgImageLocator.hover();
const zoomedInBoundingBox = await bgImageLocator.boundingBox();
expect(zoomedInBoundingBox.height).toBeGreaterThan(initialBoundingBox.height);
expect(zoomedInBoundingBox.width).toBeGreaterThan(initialBoundingBox.width);
await zoomResetBtn.click();
await bgImageLocator.hover();
const resetBoundingBox = await bgImageLocator.boundingBox();
expect(resetBoundingBox.height).toBeLessThan(zoomedInBoundingBox.height);
expect(resetBoundingBox.width).toBeLessThan(zoomedInBoundingBox.width);
expect(resetBoundingBox.height).toEqual(initialBoundingBox.height);
expect(resetBoundingBox.width).toEqual(initialBoundingBox.width);
});
//test('Can use Mouse Wheel to zoom in and out of previous image');
//test('Can zoom into the latest image and the real-time/fixed-time imagery will pause');
//test.skip('Can zoom into a previous image from thumbstrip in real-time or fixed-time');
//test.skip('Clicking on the left arrow should pause the imagery and go to previous image');
//test.skip('If the imagery view is in pause mode, it should not be updated when new images come in');
//test.skip('If the imagery view is not in pause mode, it should be updated when new images come in');
});
test.describe('Example Imagery in Display layout', () => {
test.skip('Can use Mouse Wheel to zoom in and out of previous image');
test.skip('Can use alt+drag to move around image once zoomed in');
test.skip('Can zoom into the latest image and the real-time/fixed-time imagery will pause');
test.skip('Clicking on the left arrow should pause the imagery and go to previous image');
test.skip('If the imagery view is in pause mode, it should not be updated when new images come in');
test.skip('If the imagery view is not in pause mode, it should be updated when new images come in');
});
test.describe('Example Imagery in Flexible layout', () => {
test.skip('Can use Mouse Wheel to zoom in and out of previous image');
test.skip('Can use alt+drag to move around image once zoomed in');
test.skip('Can zoom into the latest image and the real-time/fixed-time imagery will pause');
test.skip('Clicking on the left arrow should pause the imagery and go to previous image');
test.skip('If the imagery view is in pause mode, it should not be updated when new images come in');
test.skip('If the imagery view is not in pause mode, it should be updated when new images come in');
});
test.describe('Example Imagery in Tabs view', () => {
test.skip('Can use Mouse Wheel to zoom in and out of previous image');
test.skip('Can use alt+drag to move around image once zoomed in');
test.skip('Can zoom into the latest image and the real-time/fixed-time imagery will pause');
test.skip('Can zoom into a previous image from thumbstrip in real-time or fixed-time');
test.skip('Clicking on the left arrow should pause the imagery and go to previous image');
test.skip('If the imagery view is in pause mode, it should not be updated when new images come in');
test.skip('If the imagery view is not in pause mode, it should be updated when new images come in');
});

View 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.
*****************************************************************************/
const { test, expect } = require('@playwright/test');
test.describe('Time counductor operations', () => {
test('validate start time does not exceeds end time', async ({ page }) => {
//Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
const year = new Date().getFullYear();
let startDate = 'xxxx-01-01 01:00:00.000Z';
startDate = year + startDate.substring(4);
let endDate = 'xxxx-01-01 02:00:00.000Z';
endDate = year + endDate.substring(4);
const startTimeLocator = page.locator('input[type="text"]').first();
const endTimeLocator = page.locator('input[type="text"]').nth(1);
// Click start time
await startTimeLocator.click();
// Click end time
await endTimeLocator.click();
await endTimeLocator.fill(endDate.toString());
await startTimeLocator.fill(startDate.toString());
// invalid start date
startDate = (year + 1) + startDate.substring(4);
await startTimeLocator.fill(startDate.toString());
await endTimeLocator.click();
const startDateValidityStatus = await startTimeLocator.evaluate((element) => element.checkValidity());
expect(startDateValidityStatus).not.toBeTruthy();
// fix to valid start date
startDate = (year - 1) + startDate.substring(4);
await startTimeLocator.fill(startDate.toString());
// invalid end date
endDate = (year - 2) + endDate.substring(4);
await endTimeLocator.fill(endDate.toString());
await startTimeLocator.click();
const endDateValidityStatus = await endTimeLocator.evaluate((element) => element.checkValidity());
expect(endDateValidityStatus).not.toBeTruthy();
});
});

View File

@@ -22,14 +22,14 @@
/* /*
Collection of Visual Tests set to run in a default context. The tests within this suite Collection of Visual Tests set to run in a default context. The tests within this suite
are only meant to run against openmct's app.js started by `npm run start` within the are only meant to run against openmct's app.js started by `npm run start` within the
`./e2e/playwright-visual.config.js` file. `./e2e/playwright-visual.config.js` file.
These should only use functional expect statements to verify assumptions about the state These should only use functional expect statements to verify assumptions about the state
in a test and not for functional verification of correctness. Visual tests are not supposed in a test and not for functional verification of correctness. Visual tests are not supposed
to "fail" on assertions. Instead, they should be used to detect changes between builds or branches. to "fail" on assertions. Instead, they should be used to detect changes between builds or branches.
Note: Larger testsuite sizes are OK due to the setup time associated with these tests. Note: Larger testsuite sizes are OK due to the setup time associated with these tests.
*/ */
const { test, expect } = require('@playwright/test'); const { test, expect } = require('@playwright/test');
@@ -111,3 +111,63 @@ test('Visual - Default Condition Widget', async ({ page }) => {
await page.waitForTimeout(VISUAL_GRACE_PERIOD); await page.waitForTimeout(VISUAL_GRACE_PERIOD);
await percySnapshot(page, 'Default Condition Widget'); await percySnapshot(page, 'Default Condition Widget');
}); });
test('Visual - Time Conductor start time is less than end time', async ({ page }) => {
//Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
const year = new Date().getFullYear();
let startDate = 'xxxx-01-01 01:00:00.000Z';
startDate = year + startDate.substring(4);
let endDate = 'xxxx-01-01 02:00:00.000Z';
endDate = year + endDate.substring(4);
await page.locator('input[type="text"]').nth(1).fill(endDate.toString());
await page.locator('input[type="text"]').first().fill(startDate.toString());
// verify no error msg
await page.waitForTimeout(VISUAL_GRACE_PERIOD);
await percySnapshot(page, 'Default Time conductor');
startDate = (year + 1) + startDate.substring(4);
await page.locator('input[type="text"]').first().fill(startDate.toString());
await page.locator('input[type="text"]').nth(1).click();
// verify error msg for start time (unable to capture snapshot of popup)
await page.waitForTimeout(VISUAL_GRACE_PERIOD);
await percySnapshot(page, 'Start time error');
startDate = (year - 1) + startDate.substring(4);
await page.locator('input[type="text"]').first().fill(startDate.toString());
endDate = (year - 2) + endDate.substring(4);
await page.locator('input[type="text"]').nth(1).fill(endDate.toString());
await page.locator('input[type="text"]').first().click();
// verify error msg for end time (unable to capture snapshot of popup)
await page.waitForTimeout(VISUAL_GRACE_PERIOD);
await percySnapshot(page, 'End time error');
});
test('Visual - Sine Wave Generator Form', async ({ page }) => {
//Go to baseURL
await page.goto('/', { waitUntil: 'networkidle' });
//Click the Create button
await page.click('button:has-text("Create")');
// Click text=Sine Wave Generator
await page.click('text=Sine Wave Generator');
await page.waitForTimeout(VISUAL_GRACE_PERIOD);
await percySnapshot(page, 'Default Sine Wave Generator Form');
await page.locator('.field.control.l-input-sm input').first().click();
await page.locator('.field.control.l-input-sm input').first().fill('');
// Validate red x mark
await page.waitForTimeout(VISUAL_GRACE_PERIOD);
await percySnapshot(page, 'removed amplitude property value');
});

View File

@@ -33,7 +33,7 @@ class EventTelemetryProvider {
generateData(firstObservedTime, count, startTime, duration, name) { generateData(firstObservedTime, count, startTime, duration, name) {
const millisecondsSinceStart = startTime - firstObservedTime; const millisecondsSinceStart = startTime - firstObservedTime;
const utc = Math.floor(startTime / duration) * duration; const utc = startTime + (count * duration);
const ind = count % messages.length; const ind = count % messages.length;
const message = messages[ind] + " - [" + millisecondsSinceStart + "]"; const message = messages[ind] + " - [" + millisecondsSinceStart + "]";
@@ -75,7 +75,7 @@ class EventTelemetryProvider {
const duration = domainObject.telemetry.duration * 1000; const duration = domainObject.telemetry.duration * 1000;
const size = options.size ? options.size : this.defaultSize; const size = options.size ? options.size : this.defaultSize;
const data = []; const data = [];
const firstObservedTime = Date.now(); const firstObservedTime = options.start;
let count = 0; let count = 0;
if (options.strategy === 'latest' || options.size === 1) { if (options.strategy === 'latest' || options.size === 1) {
@@ -83,7 +83,7 @@ class EventTelemetryProvider {
} }
while (start <= end && data.length < size) { while (start <= end && data.length < size) {
const startTime = Date.now() + count; const startTime = options.start + count;
data.push(this.generateData(firstObservedTime, count, startTime, duration, domainObject.name)); data.push(this.generateData(firstObservedTime, count, startTime, duration, domainObject.name));
start += duration; start += duration;
count += 1; count += 1;

View File

@@ -35,6 +35,7 @@ describe('the plugin', () => {
telemetry: { telemetry: {
duration: 0 duration: 0
}, },
options: {},
type: 'eventGenerator' type: 'eventGenerator'
}; };
@@ -61,7 +62,13 @@ describe('the plugin', () => {
}); });
}); });
it("supports requests", async () => { it("supports requests without start/end defined", async () => {
const telemetry = await openmct.telemetry.request(mockDomainObject);
expect(telemetry[0].message).toContain('CC: Eagle, Houston');
});
it("supports requests with arbitrary start time in the past", async () => {
mockDomainObject.options.start = 100000000000; // Mar 03 1973
const telemetry = await openmct.telemetry.request(mockDomainObject); const telemetry = await openmct.telemetry.request(mockDomainObject);
expect(telemetry[0].message).toContain('CC: Eagle, Houston'); expect(telemetry[0].message).toContain('CC: Eagle, Houston');
}); });

View File

@@ -26,7 +26,7 @@ import {
} from '../../src/utils/testing'; } from '../../src/utils/testing';
import ExampleUserProvider from './ExampleUserProvider'; import ExampleUserProvider from './ExampleUserProvider';
describe("The Example User Plugin", () => { xdescribe("The Example User Plugin", () => {
let openmct; let openmct;
beforeEach(() => { beforeEach(() => {

View File

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

View File

@@ -1,3 +1,2 @@
const testsContext = require.context('.', true, /\/(src|platform|\.\/example)\/.*Spec.js$/); const testsContext = require.context('.', true, /^\.\/(src|example)\/.*Spec.js$/);
testsContext.keys().forEach(testsContext); testsContext.keys().forEach(testsContext);

View File

@@ -22,29 +22,9 @@
/*global module,process*/ /*global module,process*/
const browsers = [process.env.NODE_ENV === 'debug' ? 'ChromeDebugging' : 'ChromeHeadless'];
const coverageEnabled = process.env.COVERAGE === 'true';
const reporters = ['spec', 'junit'];
if (coverageEnabled) {
reporters.push('coverage-istanbul');
}
module.exports = (config) => { module.exports = (config) => {
const webpackConfig = require('./webpack.dev.js'); const webpackConfig = require('./webpack.coverage.js');
delete webpackConfig.output; delete webpackConfig.output;
if (coverageEnabled) {
webpackConfig.module.rules.push({
test: /\.js$/,
exclude: /node_modules|e2e|example|lib|dist|\.*.*Spec\.js/,
use: {
loader: 'istanbul-instrumenter-loader',
options: {
esModules: true
}
}
});
}
config.set({ config.set({
basePath: '', basePath: '',
@@ -61,8 +41,8 @@ module.exports = (config) => {
} }
], ],
port: 9876, port: 9876,
reporters: reporters, reporters: ['spec', 'junit', 'coverage-istanbul'],
browsers: browsers, browsers: [process.env.NODE_ENV === 'debug' ? 'ChromeDebugging' : 'ChromeHeadless'],
client: { client: {
jasmine: { jasmine: {
random: false, random: false,
@@ -83,12 +63,6 @@ module.exports = (config) => {
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
autoWatch: true, autoWatch: true,
// HTML test reporting.
// htmlReporter: {
// outputDir: "dist/reports/tests",
// preserveDescribeNesting: true,
// foldAll: false
// },
junitReporter: { junitReporter: {
outputDir: "dist/reports/tests", outputDir: "dist/reports/tests",
outputFile: "test-results.xml", outputFile: "test-results.xml",
@@ -96,9 +70,7 @@ module.exports = (config) => {
}, },
coverageIstanbulReporter: { coverageIstanbulReporter: {
fixWebpackSourcePaths: true, fixWebpackSourcePaths: true,
dir: process.env.CIRCLE_ARTIFACTS dir: "dist/reports/coverage",
? process.env.CIRCLE_ARTIFACTS + '/coverage'
: "dist/reports/coverage",
reports: ['lcovonly', 'text-summary'], reports: ['lcovonly', 'text-summary'],
thresholds: { thresholds: {
global: { global: {

View File

@@ -1,40 +1,42 @@
{ {
"name": "openmct", "name": "openmct",
"version": "1.8.5-SNAPSHOT", "version": "2.0.2-SNAPSHOT",
"description": "The Open MCT core platform", "description": "The Open MCT core platform",
"devDependencies": { "devDependencies": {
"@braintree/sanitize-url": "5.0.2", "@babel/eslint-parser": "7.16.3",
"@percy/cli": "1.0.0-beta.73", "@braintree/sanitize-url": "6.0.0",
"@percy/cli": "1.0.0-beta.76",
"@percy/playwright": "1.0.1", "@percy/playwright": "1.0.1",
"@playwright/test": "1.18.1", "@playwright/test": "1.19.2",
"allure-playwright": "2.0.0-beta.14", "allure-playwright": "2.0.0-beta.15",
"babel-eslint": "10.1.0", "babel-loader": "8.2.3",
"babel-plugin-istanbul": "6.1.1",
"comma-separated-values": "3.6.4", "comma-separated-values": "3.6.4",
"copy-webpack-plugin": "10.2.0", "copy-webpack-plugin": "10.2.0",
"core-js": "3.20.3", "core-js": "3.21.1",
"cross-env": "6.0.3", "cross-env": "7.0.3",
"css-loader": "4.0.0", "css-loader": "4.0.0",
"d3-axis": "1.0.x", "d3-axis": "1.0.x",
"d3-scale": "1.0.x", "d3-scale": "1.0.x",
"d3-selection": "1.3.x", "d3-selection": "1.3.x",
"eslint": "7.0.0", "eslint": "8.11.0",
"eslint-plugin-compat": "4.0.2",
"eslint-plugin-playwright": "0.8.0", "eslint-plugin-playwright": "0.8.0",
"eslint-plugin-vue": "7.5.0", "eslint-plugin-vue": "8.5.0",
"eslint-plugin-you-dont-need-lodash-underscore": "6.12.0", "eslint-plugin-you-dont-need-lodash-underscore": "6.12.0",
"eventemitter3": "1.2.0", "eventemitter3": "1.2.0",
"exports-loader": "0.7.0", "exports-loader": "0.7.0",
"express": "4.13.1", "express": "4.13.1",
"file-loader": "6.1.0", "file-loader": "6.2.0",
"file-saver": "1.3.8", "file-saver": "2.0.5",
"git-rev-sync": "1.4.0", "git-rev-sync": "3.0.2",
"html-loader": "0.5.5", "html-loader": "0.5.5",
"html2canvas": "1.4.1", "html2canvas": "1.4.1",
"imports-loader": "0.8.0", "imports-loader": "0.8.0",
"istanbul-instrumenter-loader": "^3.0.1", "jasmine-core": "4.0.1",
"jasmine-core": "4.0.0",
"jsdoc": "3.5.5", "jsdoc": "3.5.5",
"karma": "6.3.15", "karma": "6.3.15",
"karma-chrome-launcher": "3.1.0", "karma-chrome-launcher": "3.1.1",
"karma-cli": "2.0.0", "karma-cli": "2.0.0",
"karma-coverage": "2.1.1", "karma-coverage": "2.1.1",
"karma-coverage-istanbul-reporter": "3.0.3", "karma-coverage-istanbul-reporter": "3.0.3",
@@ -43,37 +45,36 @@
"karma-junit-reporter": "2.0.1", "karma-junit-reporter": "2.0.1",
"karma-sourcemap-loader": "0.3.8", "karma-sourcemap-loader": "0.3.8",
"karma-spec-reporter": "0.0.33", "karma-spec-reporter": "0.0.33",
"karma-webpack": "^5.0.0", "karma-webpack": "5.0.0",
"location-bar": "^3.0.1", "location-bar": "3.0.1",
"lodash": "^4.17.12", "lodash": "4.17.12",
"mini-css-extract-plugin": "2.4.5", "mini-css-extract-plugin": "2.4.5",
"moment": "2.25.3", "moment": "2.29.1",
"moment-duration-format": "^2.2.2", "moment-duration-format": "2.2.2",
"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.18.1", "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.3.1",
"printj": "^1.2.1", "raw-loader": "4.0.2",
"raw-loader": "^0.5.1", "request": "2.88.2",
"request": "^2.69.0",
"resolve-url-loader": "4.0.0", "resolve-url-loader": "4.0.0",
"sass": "1.49.0", "sass": "1.49.0",
"sass-loader": "12.4.0", "sass-loader": "12.4.0",
"sinon": "13.0.1", "sinon": "13.0.1",
"style-loader": "^1.0.1", "style-loader": "^1.0.1",
"uuid": "^3.3.3", "uuid": "3.3.3",
"vue": "2.5.6", "vue": "2.6.14",
"vue-eslint-parser": "8.2.0", "vue-eslint-parser": "8.2.0",
"vue-loader": "15.9.8", "vue-loader": "15.9.8",
"vue-template-compiler": "2.5.6", "vue-template-compiler": "2.6.14",
"webpack": "5.67.0", "webpack": "5.68.0",
"webpack-cli": "4.9.2", "webpack-cli": "4.9.2",
"webpack-dev-middleware": "^3.1.3", "webpack-dev-middleware": "3.7.3",
"webpack-hot-middleware": "^2.22.3", "webpack-hot-middleware": "2.25.1",
"webpack-merge": "5.8.0", "webpack-merge": "5.8.0",
"zepto": "^1.2.0" "zepto": "1.2.0"
}, },
"scripts": { "scripts": {
"clean": "rm -rf ./dist ./node_modules; rm package-lock.json", "clean": "rm -rf ./dist ./node_modules; rm package-lock.json",
@@ -83,13 +84,14 @@
"lint:fix": "eslint example src --ext .js,.vue openmct.js --fix", "lint:fix": "eslint example src --ext .js,.vue openmct.js --fix",
"build:prod": "cross-env webpack --config webpack.prod.js", "build:prod": "cross-env webpack --config webpack.prod.js",
"build:dev": "webpack --config webpack.dev.js", "build:dev": "webpack --config webpack.dev.js",
"build:coverage": "webpack --config webpack.coverage.js",
"build:watch": "webpack --config webpack.dev.js --watch", "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": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run",
"test:firefox": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run --browsers=FirefoxHeadless",
"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:e2e:ci": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome smoke default condition timeConductor",
"test:coverage:firefox": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" karma start --single-run --browsers=FirefoxHeadless", "test:e2e:local": "npx playwright test --config=e2e/playwright-local.config.js --project=chrome",
"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:visual": "percy exec --config ./e2e/.percy.yml -- 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",
@@ -105,8 +107,15 @@
"url": "https://github.com/nasa/openmct.git" "url": "https://github.com/nasa/openmct.git"
}, },
"engines": { "engines": {
"node": ">=12.20.1 <15.0.0" "node": ">=12.22.0"
}, },
"browserslist": [
"Firefox ESR",
"not IE 11",
"last 2 Chrome versions",
"unreleased Chrome versions",
"ios_saf > 15"
],
"author": "", "author": "",
"license": "Apache-2.0", "license": "Apache-2.0",
"private": true "private": true

View File

@@ -269,7 +269,6 @@ define([
this.install(this.plugins.ViewDatumAction()); this.install(this.plugins.ViewDatumAction());
this.install(this.plugins.ViewLargeAction()); this.install(this.plugins.ViewLargeAction());
this.install(this.plugins.ObjectInterceptors()); this.install(this.plugins.ObjectInterceptors());
this.install(this.plugins.NonEditableFolder());
this.install(this.plugins.DeviceClassifier()); this.install(this.plugins.DeviceClassifier());
this.install(this.plugins.UserIndicator()); this.install(this.plugins.UserIndicator());
} }

View File

@@ -65,10 +65,11 @@ export default class FormControl {
*/ */
_getControlViewProvider(control) { _getControlViewProvider(control) {
const self = this; const self = this;
let rowComponent;
return { return {
show(element, model, onChange) { show(element, model, onChange) {
const rowComponent = new Vue({ rowComponent = new Vue({
el: element, el: element,
components: { components: {
FormControlComponent: DEFAULT_CONTROLS_MAP[control] FormControlComponent: DEFAULT_CONTROLS_MAP[control]
@@ -86,6 +87,9 @@ export default class FormControl {
}); });
return rowComponent; return rowComponent;
},
destroy() {
rowComponent.$destroy();
} }
}; };
} }

View File

@@ -26,45 +26,52 @@
<div class="c-overlay__dialog-title">{{ model.title }}</div> <div class="c-overlay__dialog-title">{{ model.title }}</div>
<div class="c-overlay__dialog-hint hint">All fields marked <span class="req icon-asterisk"></span> are required.</div> <div class="c-overlay__dialog-hint hint">All fields marked <span class="req icon-asterisk"></span> are required.</div>
</div> </div>
<form name="mctForm" <form
class="c-form__contents" name="mctForm"
autocomplete="off" class="c-form__contents"
@submit.prevent autocomplete="off"
@submit.prevent
> >
<div v-for="section in formSections" <div
:key="section.id" v-for="section in formSections"
class="c-form__section" :key="section.id"
:class="section.cssClass" class="c-form__section"
:class="section.cssClass"
> >
<h2 v-if="section.name" <h2
v-if="section.name"
class="c-form__section-header" class="c-form__section-header"
> >
{{ section.name }} {{ section.name }}
</h2> </h2>
<div v-for="(row, index) in section.rows" <div
:key="row.id" v-for="(row, index) in section.rows"
class="u-contents" :key="row.id"
class="u-contents"
> >
<FormRow :css-class="section.cssClass" <FormRow
:first="index < 1" :css-class="section.cssClass"
:row="row" :first="index < 1"
@onChange="onChange" :row="row"
@onChange="onChange"
/> />
</div> </div>
</div> </div>
</form> </form>
<div class="mct-form__controls c-overlay__button-bar c-form__bottom-bar"> <div class="mct-form__controls c-overlay__button-bar c-form__bottom-bar">
<button tabindex="0" <button
:disabled="isInvalid" tabindex="0"
class="c-button c-button--major" :disabled="isInvalid"
@click="onSave" class="c-button c-button--major"
@click="onSave"
> >
{{ submitLabel }} {{ submitLabel }}
</button> </button>
<button tabindex="0" <button
class="c-button" tabindex="0"
@click="onDismiss" class="c-button"
@click="onDismiss"
> >
{{ cancelLabel }} {{ cancelLabel }}
</button> </button>

View File

@@ -21,21 +21,25 @@
*****************************************************************************/ *****************************************************************************/
<template> <template>
<div class="form-row c-form__row" <div
:class="[{ 'first': first }]" class="form-row c-form__row"
@onChange="onChange" :class="[{ 'first': first }]"
@onChange="onChange"
> >
<div class="c-form-row__label" <div
:title="row.description" class="c-form-row__label"
:title="row.description"
> >
{{ row.name }} {{ row.name }}
</div> </div>
<div class="c-form-row__state-indicator" <div
:class="rowClass" class="c-form-row__state-indicator"
:class="rowClass"
> >
</div> </div>
<div v-if="row.control" <div
class="c-form-row__controls" v-if="row.control"
class="c-form-row__controls"
> >
<div ref="rowElement"></div> <div ref="rowElement"></div>
</div> </div>

View File

@@ -22,20 +22,26 @@
<template> <template>
<div class="form-control autocomplete"> <div class="form-control autocomplete">
<input v-model="field" <span class="autocompleteInputAndArrow">
class="autocompleteInput" <input
type="text" v-model="field"
@click="inputClicked()" class="autocompleteInput"
@keydown="keyDown($event)" type="text"
> @click="inputClicked()"
<span class="icon-arrow-down" @keydown="keyDown($event)"
@click="arrowClicked()" >
></span> <span
<div class="autocompleteOptions" class="icon-arrow-down"
@blur="hideOptions = true" @click="arrowClicked()"
></span>
</span>
<div
class="autocompleteOptions"
@blur="hideOptions = true"
> >
<ul v-if="!hideOptions"> <ul v-if="!hideOptions">
<li v-for="opt in filteredOptions" <li
v-for="opt in filteredOptions"
:key="opt.optionId" :key="opt.optionId"
:class="{'optionPreSelected': optionIndex === opt.optionId}" :class="{'optionPreSelected': optionIndex === opt.optionId}"
@click="fillInputWithString(opt.name)" @click="fillInputWithString(opt.name)"
@@ -104,10 +110,21 @@ export default {
this.$emit('onChange', data); this.$emit('onChange', data);
} }
},
hideOptions(newValue) {
if (!newValue) {
// adding a event listener when the hideOpntions is false (dropdown is visible)
// handleoutsideclick can collapse the dropdown when clicked outside autocomplete
document.body.addEventListener('click', this.handleOutsideClick);
} else {
//removing event listener when hideOptions become true (dropdown is collapsed)
document.body.removeEventListener('click', this.handleOutsideClick);
}
} }
}, },
mounted() { mounted() {
this.options = this.model.options; this.options = this.model.options;
this.autocompleteInputAndArrow = this.$el.getElementsByClassName('autocompleteInputAndArrow')[0];
this.autocompleteInputElement = this.$el.getElementsByClassName('autocompleteInput')[0]; this.autocompleteInputElement = this.$el.getElementsByClassName('autocompleteInput')[0];
if (this.options[0].name) { if (this.options[0].name) {
// If "options" include name, value pair // If "options" include name, value pair
@@ -119,6 +136,9 @@ export default {
this.optionNames = this.options; this.optionNames = this.options;
} }
}, },
destroyed() {
document.body.removeEventListener('click', this.handleOutsideClick);
},
methods: { methods: {
decrementOptionIndex() { decrementOptionIndex() {
if (this.optionIndex === 0) { if (this.optionIndex === 0) {
@@ -172,7 +192,21 @@ export default {
// to show them all the options // to show them all the options
this.showFilteredOptions = false; this.showFilteredOptions = false;
this.autocompleteInputElement.select(); this.autocompleteInputElement.select();
this.showOptions();
if (this.hideOptions) {
this.showOptions();
} else {
this.hideOptions = true;
}
},
handleOutsideClick(event) {
// if click event is detected outside autocomplete (both input & arrow) while the
// dropdown is visible, this will collapse the dropdown.
const clickedInsideAutocomplete = this.autocompleteInputAndArrow.contains(event.target);
if (!clickedInsideAutocomplete && !this.hideOptions) {
this.hideOptions = true;
}
}, },
optionMouseover(optionId) { optionMouseover(optionId) {
this.optionIndex = optionId; this.optionIndex = optionId;

View File

@@ -22,10 +22,11 @@
<template> <template>
<div class="c-form-control--clock-display-format-fields"> <div class="c-form-control--clock-display-format-fields">
<SelectField v-for="item in items" <SelectField
:key="item.key" v-for="item in items"
:model="item" :key="item.key"
@onChange="onChange" :model="item"
@onChange="onChange"
/> />
</div> </div>
</template> </template>

View File

@@ -22,12 +22,13 @@
<template> <template>
<span> <span>
<CompositeItem v-for="(item, index) in model.items" <CompositeItem
:key="item.name" v-for="(item, index) in model.items"
:first="index < 1" :key="item.name"
:value="JSON.stringify(model.value[index])" :first="index < 1"
:item="item" :value="JSON.stringify(model.value[index])"
@onChange="onChange" :item="item"
@onChange="onChange"
/> />
</span> </span>
</template> </template>

View File

@@ -22,10 +22,11 @@
<template> <template>
<div :class="compositeCssClass"> <div :class="compositeCssClass">
<FormRow :css-class="item.cssClass" <FormRow
:first="first" :css-class="item.cssClass"
:row="row" :first="first"
@onChange="onChange" :row="row"
@onChange="onChange"
/> />
<span class="composite-control-label"> <span class="composite-control-label">
{{ item.name }} {{ item.name }}

View File

@@ -27,50 +27,55 @@
<div class="hint time sm">Min</div> <div class="hint time sm">Min</div>
<div class="hint time sm">Sec</div> <div class="hint time sm">Sec</div>
<div class="hint timezone">Timezone</div> <div class="hint timezone">Timezone</div>
<form ref="dateTimeForm" <form
prevent ref="dateTimeForm"
class="u-contents" prevent
class="u-contents"
> >
<div class="field control date"> <div class="field control date">
<input v-model="date" <input
:pattern="/\d{4}-\d{2}-\d{2}/" v-model="date"
:placeholder="format" :pattern="/\d{4}-\d{2}-\d{2}/"
type="date" :placeholder="format"
name="date" type="date"
@change="onChange" name="date"
@change="onChange"
> >
</div> </div>
<div class="field control hour sm"> <div class="field control hour sm">
<input v-model="hour" <input
:pattern="/\d+/" v-model="hour"
type="number" :pattern="/\d+/"
name="hour" type="number"
maxlength="10" name="hour"
min="0" maxlength="10"
max="23" min="0"
@change="onChange" max="23"
@change="onChange"
> >
</div> </div>
<div class="field control min sm"> <div class="field control min sm">
<input v-model="min" <input
:pattern="/\d+/" v-model="min"
type="number" :pattern="/\d+/"
name="min" type="number"
maxlength="2" name="min"
min="0" maxlength="2"
max="59" min="0"
@change="onChange" max="59"
@change="onChange"
> >
</div> </div>
<div class="field control sec sm"> <div class="field control sec sm">
<input v-model="sec" <input
:pattern="/\d+/" v-model="sec"
type="number" :pattern="/\d+/"
name="sec" type="number"
maxlength="2" name="sec"
min="0" maxlength="2"
max="59" min="0"
@change="onChange" max="59"
@change="onChange"
> >
</div> </div>
<div class="field control timezone"> <div class="field control timezone">

View File

@@ -22,18 +22,21 @@
<template> <template>
<span class="form-control shell"> <span class="form-control shell">
<span class="field control" <span
:class="model.cssClass" class="field control"
:class="model.cssClass"
> >
<input id="fileElem" <input
ref="fileInput" id="fileElem"
type="file" ref="fileInput"
accept=".json" type="file"
style="display:none" accept=".json"
style="display:none"
> >
<button id="fileSelect" <button
class="c-button" id="fileSelect"
@click="selectFile" class="c-button"
@click="selectFile"
> >
{{ name }} {{ name }}
</button> </button>

View File

@@ -22,21 +22,25 @@
<template> <template>
<span class="form-control shell"> <span class="form-control shell">
<span class="field control" <span
:class="model.cssClass" class="field control"
:class="model.cssClass"
> >
<input v-model="field" <input
type="number" v-model="field"
:min="model.min" type="number"
:max="model.max" :min="model.min"
:step="model.step" :max="model.max"
@blur="blur()" :step="model.step"
@input="updateText()"
> >
</span> </span>
</span> </span>
</template> </template>
<script> <script>
import { throttle } from 'lodash';
export default { export default {
props: { props: {
model: { model: {
@@ -49,8 +53,12 @@ export default {
field: this.model.value field: this.model.value
}; };
}, },
mounted() {
this.updateText = throttle(this.updateText.bind(this), 200);
},
methods: { methods: {
blur() { updateText() {
console.log('updateText', this.field);
const data = { const data = {
model: this.model, model: this.model,
value: this.field value: this.field

View File

@@ -22,14 +22,16 @@
<template> <template>
<div class="form-control select-field"> <div class="form-control select-field">
<select v-model="selected" <select
required="model.required" v-model="selected"
name="mctControl" required="model.required"
@change="onChange($event)" name="mctControl"
@change="onChange($event)"
> >
<option v-for="option in model.options" <option
:key="option.name" v-for="option in model.options"
:value="option.value" :key="option.name"
:value="option.value"
> >
{{ option.name }} {{ option.name }}
</option> </option>

View File

@@ -22,13 +22,15 @@
<template> <template>
<span class="form-control shell"> <span class="form-control shell">
<span class="field control" <span
:class="model.cssClass" class="field control"
:class="model.cssClass"
> >
<textarea v-model="field" <textarea
type="text" v-model="field"
:size="model.size" type="text"
@blur="blur()" :size="model.size"
@input="updateText()"
> >
</textarea> </textarea>
</span> </span>
@@ -36,6 +38,8 @@
</template> </template>
<script> <script>
import { throttle } from 'lodash';
export default { export default {
props: { props: {
model: { model: {
@@ -48,8 +52,11 @@ export default {
field: this.model.value field: this.model.value
}; };
}, },
mounted() {
this.updateText = throttle(this.updateText.bind(this), 500);
},
methods: { methods: {
blur() { updateText() {
const data = { const data = {
model: this.model, model: this.model,
value: this.field value: this.field

View File

@@ -22,19 +22,23 @@
<template> <template>
<span class="form-control shell"> <span class="form-control shell">
<span class="field control" <span
:class="model.cssClass" class="field control"
:class="model.cssClass"
> >
<input v-model="field" <input
type="text" v-model="field"
:size="model.size" type="text"
@blur="blur()" :size="model.size"
@input="updateText()"
> >
</span> </span>
</span> </span>
</template> </template>
<script> <script>
import { throttle } from 'lodash';
export default { export default {
props: { props: {
model: { model: {
@@ -47,8 +51,11 @@ export default {
field: this.model.value field: this.model.value
}; };
}, },
mounted() {
this.updateText = throttle(this.updateText.bind(this), 500);
},
methods: { methods: {
blur() { updateText() {
const data = { const data = {
model: this.model, model: this.model,
value: this.field value: this.field

View File

@@ -1,6 +1,7 @@
<template> <template>
<div class="c-menu" <div
:class="options.menuClass" class="c-menu"
:class="options.menuClass"
> >
<ul v-if="options.actions.length && options.actions[0].length"> <ul v-if="options.actions.length && options.actions[0].length">
<template <template

View File

@@ -1,8 +1,10 @@
<template> <template>
<div class="c-menu" <div
:class="[options.menuClass, 'c-super-menu']" class="c-menu"
:class="[options.menuClass, 'c-super-menu']"
> >
<ul v-if="options.actions.length && options.actions[0].length" <ul
v-if="options.actions.length && options.actions[0].length"
class="c-super-menu__menu" class="c-super-menu__menu"
> >
<template <template
@@ -34,7 +36,8 @@
</template> </template>
</ul> </ul>
<ul v-else <ul
v-else
class="c-super-menu__menu" class="c-super-menu__menu"
> >
<li <li

View File

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

View File

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

View File

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

View File

@@ -15,7 +15,8 @@ export default function (folderName, couchPlugin, searchFilter) {
return Promise.resolve({ return Promise.resolve({
identifier, identifier,
type: 'folder', type: 'folder',
name: folderName || "CouchDB Documents" name: folderName || "CouchDB Documents",
location: 'ROOT'
}); });
} }
} }

View File

@@ -85,7 +85,8 @@ describe('the plugin', function () {
expect(object).toEqual({ expect(object).toEqual({
identifier, identifier,
type: 'folder', type: 'folder',
name: "CouchDB Documents" name: 'CouchDB Documents',
location: 'ROOT'
}); });
}); });
}); });

View File

@@ -1,28 +1,34 @@
<template> <template>
<div ref="plotWrapper" <div
class="has-local-controls" ref="plotWrapper"
:class="{ 's-unsynced' : isZoomed }" class="has-local-controls"
:class="{ 's-unsynced' : isZoomed }"
> >
<div v-if="isZoomed" <div
class="l-state-indicators" v-if="isZoomed"
class="l-state-indicators"
> >
<span class="l-state-indicators__alert-no-lad t-object-alert t-alert-unsynced icon-alert-triangle" <span
title="This plot is not currently displaying the latest data. Reset pan/zoom to view latest data." class="l-state-indicators__alert-no-lad t-object-alert t-alert-unsynced icon-alert-triangle"
title="This plot is not currently displaying the latest data. Reset pan/zoom to view latest data."
></span> ></span>
</div> </div>
<div ref="plot" <div
class="c-bar-chart" ref="plot"
@plotly_relayout="zoom" class="c-bar-chart"
@plotly_relayout="zoom"
></div> ></div>
<div v-if="false" <div
ref="localControl" v-if="false"
class="gl-plot__local-controls h-local-controls h-local-controls--overlay-content c-local-controls--show-on-hover" ref="localControl"
class="gl-plot__local-controls h-local-controls h-local-controls--overlay-content c-local-controls--show-on-hover"
> >
<button v-if="data.length" <button
class="c-button icon-reset" v-if="data.length"
:disabled="!isZoomed" class="c-button icon-reset"
title="Reset pan/zoom" :disabled="!isZoomed"
@click="reset()" title="Reset pan/zoom"
@click="reset()"
> >
</button> </button>
</div> </div>

View File

@@ -21,12 +21,13 @@
--> -->
<template> <template>
<BarGraph ref="barGraph" <BarGraph
class="c-plot c-bar-chart-view" ref="barGraph"
:data="trace" class="c-plot c-bar-chart-view"
:plot-axis-title="plotAxisTitle" :data="trace"
@subscribe="subscribeToAll" :plot-axis-title="plotAxisTitle"
@unsubscribe="removeAllSubscriptions" @subscribe="subscribeToAll"
@unsubscribe="removeAllSubscriptions"
/> />
</template> </template>

View File

@@ -22,11 +22,13 @@
<template> <template>
<ul class="c-tree c-bar-graph-options"> <ul class="c-tree c-bar-graph-options">
<h2 title="Display properties for this object">Bar Graph Series</h2> <h2 title="Display properties for this object">Bar Graph Series</h2>
<li v-for="series in domainObject.composition" <li
v-for="series in domainObject.composition"
:key="series.key" :key="series.key"
> >
<series-options :item="series" <series-options
:color-palette="colorPalette" :item="series"
:color-palette="colorPalette"
/> />
</li> </li>
</ul> </ul>

View File

@@ -21,12 +21,14 @@
--> -->
<template> <template>
<ul> <ul>
<li class="c-tree__item menus-to-left" <li
class="c-tree__item menus-to-left"
:class="aliasCss" :class="aliasCss"
> >
<span class="c-disclosure-triangle is-enabled flex-elem" <span
:class="expandedCssClass" class="c-disclosure-triangle is-enabled flex-elem"
@click="expanded = !expanded" :class="expandedCssClass"
@click="expanded = !expanded"
> >
</span> </span>
@@ -36,14 +38,15 @@
<div class="c-object-label__name">{{ name }}</div> <div class="c-object-label__name">{{ name }}</div>
</div> </div>
</li> </li>
<ColorSwatch v-if="expanded" <ColorSwatch
:current-color="currentColor" v-if="expanded"
title="Manually set the color for this bar graph series." :current-color="currentColor"
edit-title="Manually set the color for this bar graph series" title="Manually set the color for this bar graph series."
view-title="The color for this bar graph series." edit-title="Manually set the color for this bar graph series"
short-label="Color" view-title="The color for this bar graph series."
class="grid-properties" short-label="Color"
@colorSet="setColor" class="grid-properties"
@colorSet="setColor"
/> />
</ul> </ul>
</template> </template>

View File

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

View File

@@ -21,31 +21,35 @@
*****************************************************************************/ *****************************************************************************/
<template> <template>
<div class="c-condition-h" <div
:class="{ 'is-drag-target': draggingOver }" class="c-condition-h"
@dragover.prevent :class="{ 'is-drag-target': draggingOver }"
@drop.prevent="dropCondition($event, conditionIndex)" @dragover.prevent
@dragenter="dragEnter($event, conditionIndex)" @drop.prevent="dropCondition($event, conditionIndex)"
@dragleave="dragLeave($event, conditionIndex)" @dragenter="dragEnter($event, conditionIndex)"
@dragleave="dragLeave($event, conditionIndex)"
> >
<div class="c-condition-h__drop-target"></div> <div class="c-condition-h__drop-target"></div>
<div v-if="isEditing" <div
:class="{'is-current': condition.id === currentConditionId}" v-if="isEditing"
class="c-condition c-condition--edit" :class="{'is-current': condition.id === currentConditionId}"
class="c-condition c-condition--edit"
> >
<!-- Edit view --> <!-- Edit view -->
<div class="c-condition__header"> <div class="c-condition__header">
<span class="c-condition__drag-grippy c-grippy c-grippy--vertical-drag" <span
title="Drag to reorder conditions" class="c-condition__drag-grippy c-grippy c-grippy--vertical-drag"
:class="[{ 'is-enabled': !condition.isDefault }, { 'hide-nice': condition.isDefault }]" title="Drag to reorder conditions"
:draggable="!condition.isDefault" :class="[{ 'is-enabled': !condition.isDefault }, { 'hide-nice': condition.isDefault }]"
@dragstart="dragStart" :draggable="!condition.isDefault"
@dragend="dragEnd" @dragstart="dragStart"
@dragend="dragEnd"
></span> ></span>
<span class="c-condition__disclosure c-disclosure-triangle c-tree__item__view-control is-enabled" <span
:class="{ 'c-disclosure-triangle--expanded': expanded }" class="c-condition__disclosure c-disclosure-triangle c-tree__item__view-control is-enabled"
@click="expanded = !expanded" :class="{ 'c-disclosure-triangle--expanded': expanded }"
@click="expanded = !expanded"
></span> ></span>
<span class="c-condition__name">{{ condition.configuration.name }}</span> <span class="c-condition__name">{{ condition.configuration.name }}</span>
@@ -54,107 +58,123 @@
Define criteria Define criteria
</template> </template>
<span v-else> <span v-else>
<condition-description :show-label="false" <condition-description
:condition="condition" :show-label="false"
:condition="condition"
/> />
</span> </span>
</span> </span>
<div class="c-condition__buttons"> <div class="c-condition__buttons">
<button v-if="!condition.isDefault" <button
class="c-click-icon c-condition__duplicate-button icon-duplicate" v-if="!condition.isDefault"
title="Duplicate this condition" class="c-click-icon c-condition__duplicate-button icon-duplicate"
@click="cloneCondition" title="Duplicate this condition"
@click="cloneCondition"
></button> ></button>
<button v-if="!condition.isDefault" <button
class="c-click-icon c-condition__delete-button icon-trash" v-if="!condition.isDefault"
title="Delete this condition" class="c-click-icon c-condition__delete-button icon-trash"
@click="removeCondition" title="Delete this condition"
@click="removeCondition"
></button> ></button>
</div> </div>
</div> </div>
<div v-if="expanded" <div
class="c-condition__definition c-cdef" v-if="expanded"
class="c-condition__definition c-cdef"
> >
<span class="c-cdef__separator c-row-separator"></span> <span class="c-cdef__separator c-row-separator"></span>
<span class="c-cdef__label">Condition Name</span> <span class="c-cdef__label">Condition Name</span>
<span class="c-cdef__controls"> <span class="c-cdef__controls">
<input v-model="condition.configuration.name" <input
class="t-condition-input__name" v-model="condition.configuration.name"
type="text" class="t-condition-input__name"
@change="persist" type="text"
@change="persist"
> >
</span> </span>
<span class="c-cdef__label">Output</span> <span class="c-cdef__label">Output</span>
<span class="c-cdef__controls"> <span class="c-cdef__controls">
<span class="c-cdef__control"> <span class="c-cdef__control">
<select v-model="selectedOutputSelection" <select
@change="setOutputValue" v-model="selectedOutputSelection"
@change="setOutputValue"
> >
<option v-for="option in outputOptions" <option
:key="option" v-for="option in outputOptions"
:value="option" :key="option"
:value="option"
> >
{{ initCap(option) }} {{ initCap(option) }}
</option> </option>
</select> </select>
</span> </span>
<span class="c-cdef__control"> <span class="c-cdef__control">
<input v-if="selectedOutputSelection === outputOptions[2]" <input
v-model="condition.configuration.output" v-if="selectedOutputSelection === outputOptions[2]"
class="t-condition-name-input" v-model="condition.configuration.output"
type="text" class="t-condition-name-input"
@change="persist" type="text"
@change="persist"
> >
</span> </span>
</span> </span>
<div v-if="!condition.isDefault" <div
class="c-cdef__match-and-criteria" v-if="!condition.isDefault"
class="c-cdef__match-and-criteria"
> >
<span class="c-cdef__separator c-row-separator"></span> <span class="c-cdef__separator c-row-separator"></span>
<span class="c-cdef__label">Match</span> <span class="c-cdef__label">Match</span>
<span class="c-cdef__controls"> <span class="c-cdef__controls">
<select v-model="condition.configuration.trigger" <select
@change="persist" v-model="condition.configuration.trigger"
@change="persist"
> >
<option v-for="option in triggers" <option
:key="option.value" v-for="option in triggers"
:value="option.value" :key="option.value"
:value="option.value"
> {{ option.label }}</option> > {{ option.label }}</option>
</select> </select>
</span> </span>
<template v-if="telemetry.length || condition.configuration.criteria.length"> <template v-if="telemetry.length || condition.configuration.criteria.length">
<div v-for="(criterion, index) in condition.configuration.criteria" <div
:key="criterion.id" v-for="(criterion, index) in condition.configuration.criteria"
class="c-cdef__criteria" :key="criterion.id"
class="c-cdef__criteria"
> >
<Criterion :telemetry="telemetry" <Criterion
:criterion="criterion" :telemetry="telemetry"
:index="index" :criterion="criterion"
:trigger="condition.configuration.trigger" :index="index"
:is-default="condition.configuration.criteria.length === 1" :trigger="condition.configuration.trigger"
@persist="persist" :is-default="condition.configuration.criteria.length === 1"
@persist="persist"
/> />
<div class="c-cdef__criteria__buttons"> <div class="c-cdef__criteria__buttons">
<button class="c-click-icon c-cdef__criteria-duplicate-button icon-duplicate" <button
title="Duplicate this criteria" class="c-click-icon c-cdef__criteria-duplicate-button icon-duplicate"
@click="cloneCriterion(index)" title="Duplicate this criteria"
@click="cloneCriterion(index)"
></button> ></button>
<button v-if="!(condition.configuration.criteria.length === 1)" <button
class="c-click-icon c-cdef__criteria-duplicate-button icon-trash" v-if="!(condition.configuration.criteria.length === 1)"
title="Delete this criteria" class="c-click-icon c-cdef__criteria-duplicate-button icon-trash"
@click="removeCriterion(index)" title="Delete this criteria"
@click="removeCriterion(index)"
></button> ></button>
</div> </div>
</div> </div>
</template> </template>
<div class="c-cdef__separator c-row-separator"></div> <div class="c-cdef__separator c-row-separator"></div>
<div class="c-cdef__controls" <div
:disabled="!telemetry.length" class="c-cdef__controls"
:disabled="!telemetry.length"
> >
<button <button
class="c-cdef__add-criteria-button c-button c-button--labeled icon-plus" class="c-cdef__add-criteria-button c-button c-button--labeled icon-plus"
@@ -166,9 +186,10 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else <div
class="c-condition c-condition--browse" v-else
:class="{'is-current': condition.id === currentConditionId}" class="c-condition c-condition--browse"
:class="{'is-current': condition.id === currentConditionId}"
> >
<!-- Browse view --> <!-- Browse view -->
<div class="c-condition__header"> <div class="c-condition__header">
@@ -180,8 +201,9 @@
</span> </span>
</div> </div>
<div class="c-condition__summary"> <div class="c-condition__summary">
<condition-description :show-label="false" <condition-description
:condition="condition" :show-label="false"
:condition="condition"
/> />
</div> </div>
</div> </div>

View File

@@ -21,8 +21,9 @@
*****************************************************************************/ *****************************************************************************/
<template> <template>
<section id="conditionCollection" <section
:class="{ 'is-expanded': expanded }" id="conditionCollection"
:class="{ 'is-expanded': expanded }"
> >
<div class="c-cs__header c-section__header"> <div class="c-cs__header c-section__header">
<span <span
@@ -32,12 +33,14 @@
></span> ></span>
<div class="c-cs__header-label c-section__label">Conditions</div> <div class="c-cs__header-label c-section__label">Conditions</div>
</div> </div>
<div v-if="expanded" <div
class="c-cs__content" v-if="expanded"
class="c-cs__content"
> >
<div v-show="isEditing" <div
class="hint" v-show="isEditing"
:class="{ 's-status-icon-warning-lo': !telemetryObjs.length }" class="hint"
:class="{ 's-status-icon-warning-lo': !telemetryObjs.length }"
> >
<template v-if="!telemetryObjs.length">Drag telemetry into this Condition Set to configure Conditions and add criteria.</template> <template v-if="!telemetryObjs.length">Drag telemetry into this Condition Set to configure Conditions and add criteria.</template>
<template v-else>The first condition to match is the one that is applied. Drag conditions to reorder.</template> <template v-else>The first condition to match is the one that is applied. Drag conditions to reorder.</template>
@@ -52,24 +55,26 @@
<span class="c-cs-button__label">Add Condition</span> <span class="c-cs-button__label">Add Condition</span>
</button> </button>
<div class="c-cs__conditions-h" <div
:class="{ 'is-active-dragging': isDragging }" class="c-cs__conditions-h"
:class="{ 'is-active-dragging': isDragging }"
> >
<Condition v-for="(condition, index) in conditionCollection" <Condition
:key="condition.id" v-for="(condition, index) in conditionCollection"
:condition="condition" :key="condition.id"
:current-condition-id="currentConditionId" :condition="condition"
:condition-index="index" :current-condition-id="currentConditionId"
:telemetry="telemetryObjs" :condition-index="index"
:is-editing="isEditing" :telemetry="telemetryObjs"
:move-index="moveIndex" :is-editing="isEditing"
:is-dragging="isDragging" :move-index="moveIndex"
@updateCondition="updateCondition" :is-dragging="isDragging"
@removeCondition="removeCondition" @updateCondition="updateCondition"
@cloneCondition="cloneCondition" @removeCondition="removeCondition"
@setMoveIndex="setMoveIndex" @cloneCondition="cloneCondition"
@dragComplete="dragComplete" @setMoveIndex="setMoveIndex"
@dropCondition="dropCondition" @dragComplete="dragComplete"
@dropCondition="dropCondition"
/> />
</div> </div>
</div> </div>

View File

@@ -22,18 +22,21 @@
<template> <template>
<div class="c-style__condition-desc"> <div class="c-style__condition-desc">
<span v-if="showLabel && condition" <span
class="c-style__condition-desc__name c-condition__name" v-if="showLabel && condition"
class="c-style__condition-desc__name c-condition__name"
> >
{{ condition.configuration.name }} {{ condition.configuration.name }}
</span> </span>
<span v-if="!condition.isDefault" <span
class="c-style__condition-desc__text" v-if="!condition.isDefault"
class="c-style__condition-desc__text"
> >
{{ description }} {{ description }}
</span> </span>
<span v-else <span
class="c-style__condition-desc__text" v-else
class="c-style__condition-desc__text"
> >
Match if no other condition is matched Match if no other condition is matched
</span> </span>

View File

@@ -21,12 +21,14 @@
*****************************************************************************/ *****************************************************************************/
<template> <template>
<div v-if="conditionErrors.length" <div
class="c-condition__errors" v-if="conditionErrors.length"
class="c-condition__errors"
> >
<div v-for="(error, index) in conditionErrors" <div
:key="index" v-for="(error, index) in conditionErrors"
class="u-alert u-alert--block u-alert--with-icon" :key="index"
class="u-alert u-alert--block u-alert--with-icon"
>{{ error.message.errorText }} {{ error.additionalInfo }} >{{ error.message.errorText }} {{ error.additionalInfo }}
</div> </div>
</div> </div>

View File

@@ -36,18 +36,20 @@
</div> </div>
</section> </section>
<div class="c-cs__test-data-and-conditions-w"> <div class="c-cs__test-data-and-conditions-w">
<TestData class="c-cs__test-data" <TestData
:is-editing="isEditing" class="c-cs__test-data"
:test-data="testData" :is-editing="isEditing"
:telemetry="telemetryObjs" :test-data="testData"
@updateTestData="updateTestData" :telemetry="telemetryObjs"
@updateTestData="updateTestData"
/> />
<ConditionCollection class="c-cs__conditions" <ConditionCollection
:is-editing="isEditing" class="c-cs__conditions"
:test-data="testData" :is-editing="isEditing"
@conditionSetResultUpdated="updateCurrentOutput" :test-data="testData"
@updateDefaultOutput="updateDefaultOutput" @conditionSetResultUpdated="updateCurrentOutput"
@telemetryUpdated="updateTelemetry" @updateDefaultOutput="updateDefaultOutput"
@telemetryUpdated="updateTelemetry"
/> />
</div> </div>
</div> </div>

View File

@@ -26,76 +26,89 @@
<span class="c-cdef__label">{{ setRowLabel }}</span> <span class="c-cdef__label">{{ setRowLabel }}</span>
<span class="c-cdef__controls"> <span class="c-cdef__controls">
<span class="c-cdef__control"> <span class="c-cdef__control">
<select ref="telemetrySelect" <select
v-model="criterion.telemetry" ref="telemetrySelect"
@change="updateMetadataOptions" v-model="criterion.telemetry"
@change="updateMetadataOptions"
> >
<option value="">- Select Telemetry -</option> <option value="">- Select Telemetry -</option>
<option value="all">all telemetry</option> <option value="all">all telemetry</option>
<option value="any">any telemetry</option> <option value="any">any telemetry</option>
<option v-for="telemetryOption in telemetry" <option
:key="telemetryOption.identifier.key" v-for="telemetryOption in telemetry"
:value="telemetryOption.identifier" :key="telemetryOption.identifier.key"
:value="telemetryOption.identifier"
> >
{{ telemetryOption.name }} {{ telemetryOption.name }}
</option> </option>
</select> </select>
</span> </span>
<span v-if="criterion.telemetry" <span
class="c-cdef__control" v-if="criterion.telemetry"
class="c-cdef__control"
> >
<select ref="metadataSelect" <select
v-model="criterion.metadata" ref="metadataSelect"
@change="updateOperations" v-model="criterion.metadata"
@change="updateOperations"
> >
<option value="">- Select Field -</option> <option value="">- Select Field -</option>
<option v-for="option in telemetryMetadataOptions" <option
:key="option.key" v-for="option in telemetryMetadataOptions"
:value="option.key" :key="option.key"
:value="option.key"
> >
{{ option.name }} {{ option.name }}
</option> </option>
<option value="dataReceived">any data received</option> <option value="dataReceived">any data received</option>
</select> </select>
</span> </span>
<span v-if="criterion.telemetry && criterion.metadata" <span
class="c-cdef__control" v-if="criterion.telemetry && criterion.metadata"
class="c-cdef__control"
> >
<select v-model="criterion.operation" <select
@change="updateInputVisibilityAndValues" v-model="criterion.operation"
@change="updateInputVisibilityAndValues"
> >
<option value="">- Select Comparison -</option> <option value="">- Select Comparison -</option>
<option v-for="option in filteredOps" <option
:key="option.name" v-for="option in filteredOps"
:value="option.name" :key="option.name"
:value="option.name"
> >
{{ option.text }} {{ option.text }}
</option> </option>
</select> </select>
<template v-if="!enumerations.length"> <template v-if="!enumerations.length">
<span v-for="(item, inputIndex) in inputCount" <span
:key="inputIndex" v-for="(item, inputIndex) in inputCount"
class="c-cdef__control__inputs" :key="inputIndex"
class="c-cdef__control__inputs"
> >
<input v-model="criterion.input[inputIndex]" <input
class="c-cdef__control__input" v-model="criterion.input[inputIndex]"
:type="setInputType" class="c-cdef__control__input"
@change="persist" :type="setInputType"
@change="persist"
> >
<span v-if="inputIndex < inputCount-1">and</span> <span v-if="inputIndex < inputCount-1">and</span>
</span> </span>
<span v-if="criterion.metadata === 'dataReceived'">seconds</span> <span v-if="criterion.metadata === 'dataReceived'">seconds</span>
</template> </template>
<span v-else> <span v-else>
<span v-if="inputCount && criterion.operation" <span
class="c-cdef__control" v-if="inputCount && criterion.operation"
class="c-cdef__control"
> >
<select v-model="criterion.input[0]" <select
@change="persist" v-model="criterion.input[0]"
@change="persist"
> >
<option v-for="option in enumerations" <option
:key="option.string" v-for="option in enumerations"
:value="option.value.toString()" :key="option.string"
:value="option.value.toString()"
> >
{{ option.string }} {{ option.string }}
</option> </option>

View File

@@ -21,9 +21,10 @@
*****************************************************************************/ *****************************************************************************/
<template> <template>
<section v-show="isEditing" <section
id="test-data" v-show="isEditing"
:class="{ 'is-expanded': expanded }" id="test-data"
:class="{ 'is-expanded': expanded }"
> >
<div class="c-cs__header c-section__header"> <div class="c-cs__header c-section__header">
<span <span
@@ -33,11 +34,13 @@
></span> ></span>
<div class="c-cs__header-label c-section__label">Test Data</div> <div class="c-cs__header-label c-section__label">Test Data</div>
</div> </div>
<div v-if="expanded" <div
class="c-cs__content" v-if="expanded"
class="c-cs__content"
> >
<div class="c-cs__test-data__controls c-cdef__controls" <div
:disabled="!telemetry.length" class="c-cs__test-data__controls c-cdef__controls"
:disabled="!telemetry.length"
> >
<label class="c-toggle-switch"> <label class="c-toggle-switch">
<input <input
@@ -50,59 +53,69 @@
</label> </label>
</div> </div>
<div class="c-cs-tests"> <div class="c-cs-tests">
<span v-for="(testInput, tIndex) in testInputs" <span
:key="tIndex" v-for="(testInput, tIndex) in testInputs"
class="c-test-datum c-cs-test" :key="tIndex"
class="c-test-datum c-cs-test"
> >
<span class="c-cs-test__label">Set</span> <span class="c-cs-test__label">Set</span>
<span class="c-cs-test__controls"> <span class="c-cs-test__controls">
<span class="c-cdef__control"> <span class="c-cdef__control">
<select v-model="testInput.telemetry" <select
@change="updateMetadata(testInput)" v-model="testInput.telemetry"
@change="updateMetadata(testInput)"
> >
<option value="">- Select Telemetry -</option> <option value="">- Select Telemetry -</option>
<option v-for="(telemetryOption, index) in telemetry" <option
:key="index" v-for="(telemetryOption, index) in telemetry"
:value="telemetryOption.identifier" :key="index"
:value="telemetryOption.identifier"
> >
{{ telemetryOption.name }} {{ telemetryOption.name }}
</option> </option>
</select> </select>
</span> </span>
<span v-if="testInput.telemetry" <span
class="c-cdef__control" v-if="testInput.telemetry"
class="c-cdef__control"
> >
<select v-model="testInput.metadata" <select
@change="updateTestData" v-model="testInput.metadata"
@change="updateTestData"
> >
<option value="">- Select Field -</option> <option value="">- Select Field -</option>
<option v-for="(option, index) in telemetryMetadataOptions[getId(testInput.telemetry)]" <option
:key="index" v-for="(option, index) in telemetryMetadataOptions[getId(testInput.telemetry)]"
:value="option.key" :key="index"
:value="option.key"
> >
{{ option.name }} {{ option.name }}
</option> </option>
</select> </select>
</span> </span>
<span v-if="testInput.metadata" <span
class="c-cdef__control__inputs" v-if="testInput.metadata"
class="c-cdef__control__inputs"
> >
<input v-model="testInput.value" <input
placeholder="Enter test input" v-model="testInput.value"
type="text" placeholder="Enter test input"
class="c-cdef__control__input" type="text"
@change="updateTestData" class="c-cdef__control__input"
@change="updateTestData"
> >
</span> </span>
</span> </span>
<div class="c-cs-test__buttons"> <div class="c-cs-test__buttons">
<button class="c-click-icon c-test-data__duplicate-button icon-duplicate" <button
title="Duplicate this test datum" class="c-click-icon c-test-data__duplicate-button icon-duplicate"
@click="addTestInput(testInput)" title="Duplicate this test datum"
@click="addTestInput(testInput)"
></button> ></button>
<button class="c-click-icon c-test-data__delete-button icon-trash" <button
title="Delete this test datum" class="c-click-icon c-test-data__delete-button icon-trash"
@click="removeTestInput(tIndex)" title="Delete this test datum"
@click="removeTestInput(tIndex)"
></button> ></button>
</div> </div>
</span> </span>

View File

@@ -23,52 +23,60 @@
<template> <template>
<div class="c-style has-local-controls c-toolbar"> <div class="c-style has-local-controls c-toolbar">
<div class="c-style__controls"> <div class="c-style__controls">
<div :class="[ <div
{ 'is-style-invisible': styleItem.style && styleItem.style.isStyleInvisible }, :class="[
{ 'c-style-thumb--mixed': mixedStyles.indexOf('backgroundColor') > -1 } { 'is-style-invisible': styleItem.style && styleItem.style.isStyleInvisible },
]" { 'c-style-thumb--mixed': mixedStyles.indexOf('backgroundColor') > -1 }
:style="[styleItem.style.imageUrl ? { backgroundImage:'url(' + styleItem.style.imageUrl + ')'} : itemStyle ]" ]"
class="c-style-thumb" :style="[styleItem.style.imageUrl ? { backgroundImage:'url(' + styleItem.style.imageUrl + ')'} : itemStyle ]"
class="c-style-thumb"
> >
<span class="c-style-thumb__text" <span
:class="{ 'hide-nice': !hasProperty(styleItem.style.color) }" class="c-style-thumb__text"
:class="{ 'hide-nice': !hasProperty(styleItem.style.color) }"
> >
ABC ABC
</span> </span>
</div> </div>
<toolbar-color-picker v-if="hasProperty(styleItem.style.border)" <toolbar-color-picker
class="c-style__toolbar-button--border-color u-menu-to--center" v-if="hasProperty(styleItem.style.border)"
:options="borderColorOption" class="c-style__toolbar-button--border-color u-menu-to--center"
@change="updateStyleValue" :options="borderColorOption"
@change="updateStyleValue"
/> />
<toolbar-color-picker v-if="hasProperty(styleItem.style.backgroundColor)" <toolbar-color-picker
class="c-style__toolbar-button--background-color u-menu-to--center" v-if="hasProperty(styleItem.style.backgroundColor)"
:options="backgroundColorOption" class="c-style__toolbar-button--background-color u-menu-to--center"
@change="updateStyleValue" :options="backgroundColorOption"
@change="updateStyleValue"
/> />
<toolbar-color-picker v-if="hasProperty(styleItem.style.color)" <toolbar-color-picker
class="c-style__toolbar-button--color u-menu-to--center" v-if="hasProperty(styleItem.style.color)"
:options="colorOption" class="c-style__toolbar-button--color u-menu-to--center"
@change="updateStyleValue" :options="colorOption"
@change="updateStyleValue"
/> />
<toolbar-button v-if="hasProperty(styleItem.style.imageUrl)" <toolbar-button
class="c-style__toolbar-button--image-url" v-if="hasProperty(styleItem.style.imageUrl)"
:options="imageUrlOption" class="c-style__toolbar-button--image-url"
@change="updateStyleValue" :options="imageUrlOption"
@change="updateStyleValue"
/> />
<toolbar-toggle-button v-if="hasProperty(styleItem.style.isStyleInvisible)" <toolbar-toggle-button
class="c-style__toolbar-button--toggle-visible" v-if="hasProperty(styleItem.style.isStyleInvisible)"
:options="isStyleInvisibleOption" class="c-style__toolbar-button--toggle-visible"
@change="updateStyleValue" :options="isStyleInvisibleOption"
@change="updateStyleValue"
/> />
</div> </div>
<!-- Save Styles --> <!-- Save Styles -->
<toolbar-button v-if="canSaveStyle" <toolbar-button
class="c-style__toolbar-button--save c-local-controls--show-on-hover c-icon-button c-icon-button--major" v-if="canSaveStyle"
:options="saveOptions" class="c-style__toolbar-button--save c-local-controls--show-on-hover c-icon-button c-icon-button--major"
@click="saveItemStyle()" :options="saveOptions"
@click="saveItemStyle()"
/> />
</div> </div>
</template> </template>

View File

@@ -22,8 +22,9 @@
<template> <template>
<div class="c-inspector__styles c-inspect-styles"> <div class="c-inspector__styles c-inspect-styles">
<div v-if="isStaticAndConditionalStyles" <div
class="c-inspect-styles__mixed-static-and-conditional u-alert u-alert--block u-alert--with-icon" v-if="isStaticAndConditionalStyles"
class="c-inspect-styles__mixed-static-and-conditional u-alert u-alert--block u-alert--with-icon"
> >
Your selection includes one or more items that use Conditional Styling. Applying a static style below will replace any Conditional Styling with the new choice. Your selection includes one or more items that use Conditional Styling. Applying a static style below will replace any Conditional Styling with the new choice.
</div> </div>
@@ -37,16 +38,18 @@
@set-font-property="setFontProperty" @set-font-property="setFontProperty"
/> />
<div class="c-inspect-styles__content"> <div class="c-inspect-styles__content">
<div v-if="staticStyle" <div
class="c-inspect-styles__style" v-if="staticStyle"
class="c-inspect-styles__style"
> >
<StyleEditor class="c-inspect-styles__editor" <StyleEditor
:style-item="staticStyle" class="c-inspect-styles__editor"
:is-editing="allowEditing" :style-item="staticStyle"
:mixed-styles="mixedStyles" :is-editing="allowEditing"
:non-specific-font-properties="nonSpecificFontProperties" :mixed-styles="mixedStyles"
@persist="updateStaticStyle" :non-specific-font-properties="nonSpecificFontProperties"
@save-style="saveStyle" @persist="updateStaticStyle"
@save-style="saveStyle"
/> />
</div> </div>
<button <button
@@ -64,9 +67,10 @@
Conditional Object Styles Conditional Object Styles
</div> </div>
<div class="c-inspect-styles__content c-inspect-styles__condition-set c-inspect-styles__elem"> <div class="c-inspect-styles__content c-inspect-styles__condition-set c-inspect-styles__elem">
<a v-if="conditionSetDomainObject" <a
class="c-object-label" v-if="conditionSetDomainObject"
@click="navigateOrPreview" class="c-object-label"
@click="navigateOrPreview"
> >
<span class="c-object-label__type-icon icon-conditional"></span> <span class="c-object-label__type-icon icon-conditional"></span>
<span class="c-object-label__name">{{ conditionSetDomainObject.name }}</span> <span class="c-object-label__name">{{ conditionSetDomainObject.name }}</span>
@@ -80,15 +84,17 @@
<span class="c-button__label">Change...</span> <span class="c-button__label">Change...</span>
</button> </button>
<button class="c-click-icon icon-x" <button
title="Remove conditional styles" class="c-click-icon icon-x"
@click="removeConditionSet" title="Remove conditional styles"
@click="removeConditionSet"
></button> ></button>
</template> </template>
</div> </div>
<div v-if="isConditionWidget && allowEditing" <div
class="c-inspect-styles__elem c-inspect-styles__output-label-toggle" v-if="isConditionWidget && allowEditing"
class="c-inspect-styles__elem c-inspect-styles__output-label-toggle"
> >
<label class="c-toggle-switch"> <label class="c-toggle-switch">
<input <input
@@ -100,8 +106,9 @@
<span class="c-toggle-switch__label">Use Condition Set output as label</span> <span class="c-toggle-switch__label">Use Condition Set output as label</span>
</label> </label>
</div> </div>
<div v-if="isConditionWidget && !allowEditing" <div
class="c-inspect-styles__elem" v-if="isConditionWidget && !allowEditing"
class="c-inspect-styles__elem"
> >
<span class="c-toggle-switch__label">Condition Set output as label: <span class="c-toggle-switch__label">Condition Set output as label:
<span v-if="useConditionSetOutputAsLabel"> Yes</span><span v-else> No</span> <span v-if="useConditionSetOutputAsLabel"> Yes</span><span v-else> No</span>
@@ -114,27 +121,32 @@
@set-font-property="setFontProperty" @set-font-property="setFontProperty"
/> />
<div v-if="conditionsLoaded" <div
class="c-inspect-styles__conditions" v-if="conditionsLoaded"
class="c-inspect-styles__conditions"
> >
<div v-for="(conditionStyle, index) in conditionalStyles" <div
:key="index" v-for="(conditionStyle, index) in conditionalStyles"
class="c-inspect-styles__condition" :key="index"
:class="{'is-current': conditionStyle.conditionId === selectedConditionId}" class="c-inspect-styles__condition"
@click="applySelectedConditionStyle(conditionStyle.conditionId)" :class="{'is-current': conditionStyle.conditionId === selectedConditionId}"
@click="applySelectedConditionStyle(conditionStyle.conditionId)"
> >
<condition-error :show-label="true" <condition-error
:condition="getCondition(conditionStyle.conditionId)" :show-label="true"
:condition="getCondition(conditionStyle.conditionId)"
/> />
<condition-description :show-label="true" <condition-description
:condition="getCondition(conditionStyle.conditionId)" :show-label="true"
:condition="getCondition(conditionStyle.conditionId)"
/> />
<StyleEditor class="c-inspect-styles__editor" <StyleEditor
:style-item="conditionStyle" class="c-inspect-styles__editor"
:non-specific-font-properties="nonSpecificFontProperties" :style-item="conditionStyle"
:is-editing="allowEditing" :non-specific-font-properties="nonSpecificFontProperties"
@persist="updateConditionalStyle" :is-editing="allowEditing"
@save-style="saveStyle" @persist="updateConditionalStyle"
@save-style="saveStyle"
/> />
</div> </div>
</div> </div>
@@ -325,16 +337,7 @@ export default {
return item && (item.type === type); return item && (item.type === type);
}, },
canPersistObject(item) { canPersistObject(item) {
// for now the only way to tell if an object can be persisted is if it is creatable. return this.openmct.objects.isPersistable(item.identifier);
let creatable = false;
if (item) {
const type = this.openmct.types.get(item.type);
if (type && type.definition) {
creatable = (type.definition.creatable !== undefined && (type.definition.creatable === 'true' || type.definition.creatable === true));
}
}
return creatable;
}, },
hasConditionalStyle(domainObject, layoutItem) { hasConditionalStyle(domainObject, layoutItem) {
const id = layoutItem ? layoutItem.id : undefined; const id = layoutItem ? layoutItem.id : undefined;

View File

@@ -21,9 +21,10 @@
*****************************************************************************/ *****************************************************************************/
<template> <template>
<component :is="urlDefined ? 'a' : 'span'" <component
class="c-condition-widget u-style-receiver js-style-receiver" :is="urlDefined ? 'a' : 'span'"
:href="url" class="c-condition-widget u-style-receiver js-style-receiver"
:href="url"
> >
<div class="c-condition-widget__label"> <div class="c-condition-widget__label">
{{ internalDomainObject.conditionalLabel || internalDomainObject.label }} {{ internalDomainObject.conditionalLabel || internalDomainObject.label }}

View File

@@ -166,7 +166,7 @@ export default {
}, },
computed: { computed: {
gridSize() { gridSize() {
return this.domainObject.configuration.layoutGrid; return this.domainObject.configuration.layoutGrid.map(Number);
}, },
layoutItems() { layoutItems() {
return this.domainObject.configuration.items; return this.domainObject.configuration.items;

View File

@@ -37,8 +37,9 @@
:data-font="item.font" :data-font="item.font"
@contextmenu.prevent="showContextMenu" @contextmenu.prevent="showContextMenu"
> >
<div class="is-status__indicator" <div
:title="`This item is ${status}`" class="is-status__indicator"
:title="`This item is ${status}`"
></div> ></div>
<div <div
v-if="showLabel" v-if="showLabel"

View File

@@ -97,13 +97,16 @@ export default class DuplicateAction {
validate(currentParent) { validate(currentParent) {
return (data) => { return (data) => {
const parentCandidatePath = data.value; const parentCandidate = data.value[0];
const parentCandidate = parentCandidatePath[0];
let currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier); let currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier);
let parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier); let parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier);
let objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier); let objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier);
if (!this.openmct.objects.isPersistable(parentCandidate.identifier)) {
return false;
}
if (!parentCandidateKeystring || !currentParentKeystring) { if (!parentCandidateKeystring || !currentParentKeystring) {
return false; return false;
} }
@@ -122,13 +125,14 @@ export default class DuplicateAction {
} }
appliesTo(objectPath) { appliesTo(objectPath) {
let parent = objectPath[1]; const parent = objectPath[1];
let parentType = parent && this.openmct.types.get(parent.type); const parentType = parent && this.openmct.types.get(parent.type);
let child = objectPath[0]; const child = objectPath[0];
let childType = child && this.openmct.types.get(child.type); const childType = child && this.openmct.types.get(child.type);
let locked = child.locked ? child.locked : parent && parent.locked; const locked = child.locked ? child.locked : parent && parent.locked;
const isPersistable = this.openmct.objects.isPersistable(child.identifier);
if (locked) { if (locked || !isPersistable) {
return false; return false;
} }

View File

@@ -52,7 +52,7 @@ export default class ExportAsJSONAction {
appliesTo(objectPath) { appliesTo(objectPath) {
let domainObject = objectPath[0]; let domainObject = objectPath[0];
return this._isCreatable(domainObject); return this._isCreatableAndPersistable(domainObject);
} }
/** /**
* *
@@ -80,10 +80,11 @@ export default class ExportAsJSONAction {
* @param {object} domainObject * @param {object} domainObject
* @returns {boolean} * @returns {boolean}
*/ */
_isCreatable(domainObject) { _isCreatableAndPersistable(domainObject) {
const type = this.openmct.types.get(domainObject.type); const type = this.openmct.types.get(domainObject.type);
const isPersistable = this.openmct.objects.isPersistable(domainObject.identifier);
return type && type.definition.creatable; return type && type.definition.creatable && isPersistable;
} }
/** /**
* @private * @private
@@ -170,7 +171,7 @@ export default class ExportAsJSONAction {
.then((children) => { .then((children) => {
children.forEach((child, index) => { children.forEach((child, index) => {
// Only export if object is creatable // Only export if object is creatable
if (this._isCreatable(child)) { if (this._isCreatableAndPersistable(child)) {
// Prevents infinite export of self-contained objs // Prevents infinite export of self-contained objs
if (!Object.prototype.hasOwnProperty.call(this.tree, this._getId(child))) { if (!Object.prototype.hasOwnProperty.call(this.tree, this._getId(child))) {
// If object is a link to something absent from // If object is a link to something absent from

View File

@@ -27,6 +27,10 @@ describe('Export as JSON plugin', () => {
it('ExportAsJSONAction applies to folder', () => { it('ExportAsJSONAction applies to folder', () => {
domainObject = { domainObject = {
identifier: {
key: 'export-testing',
namespace: ''
},
composition: [], composition: [],
location: 'mine', location: 'mine',
modified: 1640115501237, modified: 1640115501237,
@@ -40,6 +44,10 @@ describe('Export as JSON plugin', () => {
it('ExportAsJSONAction applies to telemetry.plot.overlay', () => { it('ExportAsJSONAction applies to telemetry.plot.overlay', () => {
domainObject = { domainObject = {
identifier: {
key: 'export-testing',
namespace: ''
},
composition: [], composition: [],
location: 'mine', location: 'mine',
modified: 1640115501237, modified: 1640115501237,
@@ -53,6 +61,10 @@ describe('Export as JSON plugin', () => {
it('ExportAsJSONAction applies to telemetry.plot.stacked', () => { it('ExportAsJSONAction applies to telemetry.plot.stacked', () => {
domainObject = { domainObject = {
identifier: {
key: 'export-testing',
namespace: ''
},
composition: [], composition: [],
location: 'mine', location: 'mine',
modified: 1640115501237, modified: 1640115501237,
@@ -64,16 +76,24 @@ describe('Export as JSON plugin', () => {
expect(exportAsJSONAction.appliesTo([domainObject])).toEqual(true); expect(exportAsJSONAction.appliesTo([domainObject])).toEqual(true);
}); });
it('ExportAsJSONAction applies does not applies to non-creatable objects', () => { it('ExportAsJSONAction does not applie to non-persistable objects', () => {
domainObject = { domainObject = {
identifier: {
key: 'export-testing',
namespace: ''
},
composition: [], composition: [],
location: 'mine', location: 'mine',
modified: 1640115501237, modified: 1640115501237,
name: 'Non Editable Folder', name: 'Non Editable Folder',
persisted: 1640115501237, persisted: 1640115501237,
type: 'noneditable.folder' type: 'folder'
}; };
spyOn(openmct.objects, 'getProvider').and.callFake(() => {
return { get: () => domainObject };
});
expect(exportAsJSONAction.appliesTo([domainObject])).toEqual(false); expect(exportAsJSONAction.appliesTo([domainObject])).toEqual(false);
}); });

View File

@@ -43,7 +43,7 @@
<template v-for="(container, index) in containers"> <template v-for="(container, index) in containers">
<drop-hint <drop-hint
v-if="index === 0 && containers.length > 1" v-if="index === 0 && containers.length > 1"
:key="index" :key="`hint-top-${container.id}`"
class="c-fl-frame__drop-hint" class="c-fl-frame__drop-hint"
:index="-1" :index="-1"
:allow-drop="allowContainerDrop" :allow-drop="allowContainerDrop"
@@ -51,7 +51,7 @@
/> />
<container-component <container-component
:key="container.id" :key="`component-${container.id}`"
class="c-fl__container" class="c-fl__container"
:index="index" :index="index"
:container="container" :container="container"
@@ -66,7 +66,7 @@
<resize-handle <resize-handle
v-if="index !== (containers.length - 1)" v-if="index !== (containers.length - 1)"
:key="index" :key="`handle-${container.id}`"
:index="index" :index="index"
:orientation="rowsLayout ? 'vertical' : 'horizontal'" :orientation="rowsLayout ? 'vertical' : 'horizontal'"
:is-editing="isEditing" :is-editing="isEditing"
@@ -77,7 +77,7 @@
<drop-hint <drop-hint
v-if="containers.length > 1" v-if="containers.length > 1"
:key="index" :key="`hint-bottom-${container.id}`"
class="c-fl-frame__drop-hint" class="c-fl-frame__drop-hint"
:index="index" :index="index"
:allow-drop="allowContainerDrop" :allow-drop="allowContainerDrop"

View File

@@ -26,8 +26,9 @@
</div> </div>
</div> </div>
<div class="c-grid-item__controls"> <div class="c-grid-item__controls">
<div class="is-status__indicator" <div
:title="`This item is ${status}`" class="is-status__indicator"
:title="`This item is ${status}`"
></div> ></div>
<div <div
class="icon-people" class="icon-people"

View File

@@ -17,8 +17,9 @@
class="c-object-label__type-icon c-list-item__name__type-icon" class="c-object-label__type-icon c-list-item__name__type-icon"
:class="item.type.cssClass" :class="item.type.cssClass"
> >
<span class="is-status__indicator" <span
:title="`This item is ${status}`" class="is-status__indicator"
:title="`This item is ${status}`"
></span> ></span>
</div> </div>
<div class="c-object-label__name c-list-item__name__name">{{ item.model.name }}</div> <div class="c-object-label__name c-list-item__name__name">{{ item.model.name }}</div>

View File

@@ -101,7 +101,10 @@ export default class CreateWizard {
// Ensure there is always a 'save in' section // Ensure there is always a 'save in' section
if (includeLocation) { if (includeLocation) {
function validateLocation(data) { function validateLocation(data) {
return self.openmct.composition.checkPolicy(data.value[0], domainObject); const policyCheck = self.openmct.composition.checkPolicy(data.value[0], domainObject);
const parentIsPersistable = self.openmct.objects.isPersistable(data.value[0].identifier);
return policyCheck && parentIsPersistable;
} }
sections.push({ sections.push({

View File

@@ -22,12 +22,13 @@
<template> <template>
<a class="c-hyperlink" <a
:class="{ class="c-hyperlink"
'c-hyperlink--button' : isButton :class="{
}" 'c-hyperlink--button' : isButton
:target="domainObject.linkTarget" }"
:href="url" :target="domainObject.linkTarget"
:href="url"
> >
<span class="c-hyperlink__label">{{ domainObject.displayText }}</span> <span class="c-hyperlink__label">{{ domainObject.displayText }}</span>
</a> </a>

View File

@@ -21,124 +21,144 @@
*****************************************************************************/ *****************************************************************************/
<template> <template>
<div ref="compassRoseWrapper" <div
class="w-direction-rose" ref="compassRoseWrapper"
:class="compassRoseSizingClasses" class="w-direction-rose"
@click="toggleLockCompass" :class="compassRoseSizingClasses"
@click="toggleLockCompass"
> >
<svg ref="compassRoseSvg" <svg
class="c-compass-rose-svg" ref="compassRoseSvg"
viewBox="0 0 100 100" class="c-compass-rose-svg"
viewBox="0 0 100 100"
> >
<mask id="mask0" <mask
mask-type="alpha" id="mask0"
maskUnits="userSpaceOnUse" mask-type="alpha"
x="0" maskUnits="userSpaceOnUse"
y="0" x="0"
width="100" y="0"
height="100" width="100"
height="100"
> >
<circle cx="50" <circle
cy="50" cx="50"
r="50" cy="50"
fill="black" r="50"
fill="black"
/> />
</mask> </mask>
<g class="c-cr__compass-wrapper"> <g class="c-cr__compass-wrapper">
<g class="c-cr__compass-main" <g
mask="url(#mask0)" class="c-cr__compass-main"
mask="url(#mask0)"
> >
<!-- Background and clipped elements --> <!-- Background and clipped elements -->
<rect class="c-cr__bg" <rect
width="100" class="c-cr__bg"
height="100" width="100"
fill="black" height="100"
fill="black"
/> />
<rect class="c-cr__edge" <rect
width="100" class="c-cr__edge"
height="100" width="100"
fill="url(#paint0_radial)" height="100"
fill="url(#paint0_radial)"
/> />
<rect v-if="hasSunHeading" <rect
class="c-cr__sun" v-if="hasSunHeading"
width="100" class="c-cr__sun"
height="100" width="100"
fill="url(#paint1_radial)" height="100"
:style="sunHeadingStyle" fill="url(#paint1_radial)"
:style="sunHeadingStyle"
/> />
<!-- Camera FOV --> <!-- Camera FOV -->
<mask id="mask2" <mask
class="c-cr__cam-fov-l-mask" id="mask2"
mask-type="alpha" class="c-cr__cam-fov-l-mask"
maskUnits="userSpaceOnUse" mask-type="alpha"
x="0" maskUnits="userSpaceOnUse"
y="0" x="0"
width="50" y="0"
height="100" width="50"
height="100"
> >
<rect width="51" <rect
height="100" width="51"
height="100"
/> />
</mask> </mask>
<mask id="mask1" <mask
class="c-cr__cam-fov-r-mask" id="mask1"
mask-type="alpha" class="c-cr__cam-fov-r-mask"
maskUnits="userSpaceOnUse" mask-type="alpha"
x="50" maskUnits="userSpaceOnUse"
y="0" x="50"
width="50" y="0"
height="100" width="50"
height="100"
> >
<rect x="49" <rect
width="51" x="49"
height="100" width="51"
height="100"
/> />
</mask> </mask>
<g class="c-cr__cam-fov" <g
:style="cameraPanStyle" class="c-cr__cam-fov"
:style="cameraPanStyle"
> >
<g mask="url(#mask2)"> <g mask="url(#mask2)">
<rect class="c-cr__cam-fov-r" <rect
x="49" class="c-cr__cam-fov-r"
width="51" x="49"
height="100" width="51"
:style="cameraFOVStyleRightHalf" height="100"
:style="cameraFOVStyleRightHalf"
/> />
</g> </g>
<g mask="url(#mask1)"> <g mask="url(#mask1)">
<rect class="c-cr__cam-fov-l" <rect
width="51" class="c-cr__cam-fov-l"
height="100" width="51"
:style="cameraFOVStyleLeftHalf" height="100"
:style="cameraFOVStyleLeftHalf"
/> />
</g> </g>
</g> </g>
</g> </g>
<!-- Spacecraft body --> <!-- Spacecraft body -->
<path v-if="hasHeading" <path
class="c-cr__spacecraft-body" v-if="hasHeading"
fill-rule="evenodd" class="c-cr__spacecraft-body"
clip-rule="evenodd" fill-rule="evenodd"
d="M37 49C35.3431 49 34 50.3431 34 52V82C34 83.6569 35.3431 85 37 85H63C64.6569 85 66 83.6569 66 82V52C66 50.3431 64.6569 49 63 49H37ZM50 52L58 60H55V67H45V60H42L50 52Z" clip-rule="evenodd"
:style="headingStyle" d="M37 49C35.3431 49 34 50.3431 34 52V82C34 83.6569 35.3431 85 37 85H63C64.6569 85 66 83.6569 66 82V52C66 50.3431 64.6569 49 63 49H37ZM50 52L58 60H55V67H45V60H42L50 52Z"
:style="headingStyle"
/> />
<!-- NSEW and ticks --> <!-- NSEW and ticks -->
<g class="c-cr__nsew" <g
:style="compassRoseStyle" class="c-cr__nsew"
:style="compassRoseStyle"
> >
<g class="c-cr__ticks-major"> <g class="c-cr__ticks-major">
<path d="M50 3L43 10H57L50 3Z" /> <path d="M50 3L43 10H57L50 3Z" />
<path d="M4 51V49H10V51H4Z" <path
class="--hide-min" d="M4 51V49H10V51H4Z"
class="--hide-min"
/> />
<path d="M49 96V90H51V96H49Z" <path
class="--hide-min" d="M49 96V90H51V96H49Z"
class="--hide-min"
/> />
<path d="M90 49V51H96V49H90Z" <path
class="--hide-min" d="M90 49V51H96V49H90Z"
class="--hide-min"
/> />
</g> </g>
<g class="c-cr__ticks-minor --hide-small"> <g class="c-cr__ticks-minor --hide-small">
@@ -148,53 +168,63 @@
<path d="M51 10L49 10V4L51 4V10Z" /> <path d="M51 10L49 10V4L51 4V10Z" />
</g> </g>
<g class="c-cr__nsew-text"> <g class="c-cr__nsew-text">
<path :style="cardinalTextRotateW" <path
class="c-cr__nsew-w --hide-small" :style="cardinalTextRotateW"
d="M56.7418 45.004H54.1378L52.7238 52.312H52.6958L51.2258 45.004H48.7758L47.3058 52.312H47.2778L45.8638 45.004H43.2598L45.9618 55H48.6078L49.9798 48.112H50.0078L51.3798 55H53.9838L56.7418 45.004Z" class="c-cr__nsew-w --hide-small"
d="M56.7418 45.004H54.1378L52.7238 52.312H52.6958L51.2258 45.004H48.7758L47.3058 52.312H47.2778L45.8638 45.004H43.2598L45.9618 55H48.6078L49.9798 48.112H50.0078L51.3798 55H53.9838L56.7418 45.004Z"
/> />
<path :style="cardinalTextRotateE" <path
class="c-cr__nsew-e --hide-small" :style="cardinalTextRotateE"
d="M46.104 55H54.21V52.76H48.708V50.856H53.608V48.84H48.708V47.09H54.07V45.004H46.104V55Z" class="c-cr__nsew-e --hide-small"
d="M46.104 55H54.21V52.76H48.708V50.856H53.608V48.84H48.708V47.09H54.07V45.004H46.104V55Z"
/> />
<path :style="cardinalTextRotateS" <path
class="c-cr__nsew-s --hide-small" :style="cardinalTextRotateS"
d="M45.6531 51.64C45.6671 54.202 47.6971 55.21 49.9931 55.21C52.1911 55.21 54.3471 54.398 54.3471 51.864C54.3471 50.058 52.8911 49.386 51.4491 48.98C49.9931 48.574 48.5511 48.434 48.5511 47.664C48.5511 47.006 49.2511 46.81 49.8111 46.81C50.6091 46.81 51.4631 47.104 51.4211 48.014H54.0251C54.0111 45.76 52.0091 44.794 50.0211 44.794C48.1451 44.794 45.9471 45.648 45.9471 47.832C45.9471 49.666 47.4451 50.31 48.8731 50.716C50.3151 51.122 51.7431 51.29 51.7431 52.172C51.7431 52.914 50.9311 53.194 50.1471 53.194C49.0411 53.194 48.3131 52.816 48.2571 51.64H45.6531Z" class="c-cr__nsew-s --hide-small"
d="M45.6531 51.64C45.6671 54.202 47.6971 55.21 49.9931 55.21C52.1911 55.21 54.3471 54.398 54.3471 51.864C54.3471 50.058 52.8911 49.386 51.4491 48.98C49.9931 48.574 48.5511 48.434 48.5511 47.664C48.5511 47.006 49.2511 46.81 49.8111 46.81C50.6091 46.81 51.4631 47.104 51.4211 48.014H54.0251C54.0111 45.76 52.0091 44.794 50.0211 44.794C48.1451 44.794 45.9471 45.648 45.9471 47.832C45.9471 49.666 47.4451 50.31 48.8731 50.716C50.3151 51.122 51.7431 51.29 51.7431 52.172C51.7431 52.914 50.9311 53.194 50.1471 53.194C49.0411 53.194 48.3131 52.816 48.2571 51.64H45.6531Z"
/> />
<path :style="cardinalTextRotateN" <path
class="c-cr__nsew-n" :style="cardinalTextRotateN"
d="M42.5935 60H46.7935V49.32H46.8415L52.7935 60H57.3775V42.864H53.1775V53.424H53.1295L47.1775 42.864H42.5935V60Z" class="c-cr__nsew-n"
d="M42.5935 60H46.7935V49.32H46.8415L52.7935 60H57.3775V42.864H53.1775V53.424H53.1295L47.1775 42.864H42.5935V60Z"
/> />
</g> </g>
</g> </g>
</g> </g>
<defs> <defs>
<radialGradient id="paint0_radial" <radialGradient
cx="0" id="paint0_radial"
cy="0" cx="0"
r="1" cy="0"
gradientUnits="userSpaceOnUse" r="1"
gradientTransform="translate(50 50) rotate(90) scale(50)" gradientUnits="userSpaceOnUse"
gradientTransform="translate(50 50) rotate(90) scale(50)"
> >
<stop offset="0.751387" <stop
stop-opacity="0" offset="0.751387"
stop-opacity="0"
/> />
<stop offset="1" <stop
stop-color="white" offset="1"
stop-color="white"
/> />
</radialGradient> </radialGradient>
<radialGradient id="paint1_radial" <radialGradient
cx="0" id="paint1_radial"
cy="0" cx="0"
r="1" cy="0"
gradientUnits="userSpaceOnUse" r="1"
gradientTransform="translate(50 -7) rotate(-90) scale(18.5)" gradientUnits="userSpaceOnUse"
gradientTransform="translate(50 -7) rotate(-90) scale(18.5)"
> >
<stop offset="0.716377" <stop
stop-color="#FFCC00" offset="0.716377"
stop-color="#FFCC00"
/> />
<stop offset="1" <stop
stop-color="#FF9900" offset="1"
stop-opacity="0" stop-color="#FF9900"
stop-opacity="0"
/> />
</radialGradient> </radialGradient>
</defs> </defs>

View File

@@ -0,0 +1,273 @@
/*****************************************************************************
* 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.
*****************************************************************************/
<template>
<div class="h-local-controls h-local-controls--overlay-content c-local-controls--show-on-hover c-image-controls__controls">
<div class="c-image-controls__control c-image-controls__zoom icon-magnify">
<div class="c-button-set c-button-set--strip-h">
<button
class="c-button t-btn-zoom-out icon-minus"
title="Zoom out"
@click="zoomOut"
></button>
<button
class="c-button t-btn-zoom-in icon-plus"
title="Zoom in"
@click="zoomIn"
></button>
</div>
<button
class="c-button t-btn-zoom-lock"
title="Lock current zoom and pan across all images"
:class="{'icon-unlocked': !panZoomLocked, 'icon-lock': panZoomLocked}"
@click="toggleZoomLock"
></button>
<button
class="c-button icon-reset t-btn-zoom-reset"
title="Remove zoom and pan"
@click="handleResetImage"
></button>
<span class="c-image-controls__zoom-factor">x{{ formattedZoomFactor }}</span>
</div>
<div class="c-image-controls__control c-image-controls__brightness-contrast">
<span
class="c-image-controls__sliders"
draggable="true"
@dragstart.stop.prevent
>
<div class="c-image-controls__input icon-brightness">
<input
v-model="filters.contrast"
type="range"
min="0"
max="500"
@change="notifyFiltersChanged"
>
</div>
<div class="c-image-controls__input icon-contrast">
<input
v-model="filters.brightness"
type="range"
min="0"
max="500"
@change="notifyFiltersChanged"
>
</div>
</span>
<span class="t-reset-btn-holder c-imagery__lc__reset-btn c-image-controls__btn-reset">
<button
class="c-icon-link icon-reset t-btn-reset"
@click="handleResetFilters"
></button>
</span>
</div>
</div>
</template>
<script>
import _ from 'lodash';
const DEFAULT_FILTER_VALUES = {
brightness: '100',
contrast: '100'
};
const ZOOM_LIMITS_MAX_DEFAULT = 20;
const ZOOM_LIMITS_MIN_DEFAULT = 1;
const ZOOM_STEP = 1;
const ZOOM_WHEEL_SENSITIVITY_REDUCTION = 0.01;
export default {
inject: ['openmct', 'domainObject'],
props: {
zoomFactor: {
type: Number,
required: true
},
imageUrl: String
},
data() {
return {
altPressed: false,
shiftPressed: false,
metaPressed: false,
panZoomLocked: false,
wheelZooming: false,
filters: {
brightness: 100,
contrast: 100
}
};
},
computed: {
formattedZoomFactor() {
return Number.parseFloat(this.zoomFactor).toPrecision(2);
},
cursorStates() {
const isPannable = this.altPressed && this.zoomFactor > 1;
const showCursorZoomIn = this.metaPressed && !this.shiftPressed;
const showCursorZoomOut = this.metaPressed && this.shiftPressed;
const modifierKeyPressed = Boolean(this.metaPressed || this.shiftPressed || this.altPressed);
return {
isPannable,
showCursorZoomIn,
showCursorZoomOut,
modifierKeyPressed
};
}
},
watch: {
imageUrl(newUrl, oldUrl) {
// reset image pan/zoom if newUrl only if not locked
if (newUrl && !this.panZoomLocked) {
this.$emit('resetImage');
}
},
cursorStates(states) {
this.$emit('cursorsUpdated', states);
}
},
mounted() {
document.addEventListener('keydown', this.handleKeyDown);
document.addEventListener('keyup', this.handleKeyUp);
this.clearWheelZoom = _.debounce(this.clearWheelZoom, 600);
},
beforeDestroy() {
document.removeEventListener('keydown', this.handleKeyDown);
document.removeEventListener('keyup', this.handleKeyUp);
},
methods: {
handleResetImage() {
this.$emit('resetImage');
},
handleUpdatePanZoom(options) {
this.$emit('panZoomUpdated', options);
},
toggleZoomLock() {
this.panZoomLocked = !this.panZoomLocked;
},
notifyFiltersChanged() {
this.$emit('filtersUpdated', this.filters);
},
handleResetFilters() {
this.filters = DEFAULT_FILTER_VALUES;
this.notifyFiltersChanged();
},
limitZoomRange(factor) {
return Math.min(Math.max(ZOOM_LIMITS_MIN_DEFAULT, factor), ZOOM_LIMITS_MAX_DEFAULT);
},
// used to increment the zoom without knowledge of current level
processZoom(increment, userCoordX, userCoordY) {
const newFactor = this.limitZoomRange(this.zoomFactor + increment);
this.zoomImage(newFactor, userCoordX, userCoordY);
},
zoomImage(newScaleFactor, screenClientX, screenClientY) {
if (!(newScaleFactor || Number.isInteger(newScaleFactor))) {
console.error('Scale factor provided is invalid');
return;
}
if (newScaleFactor > ZOOM_LIMITS_MAX_DEFAULT) {
newScaleFactor = ZOOM_LIMITS_MAX_DEFAULT;
}
if (newScaleFactor <= 0 || newScaleFactor <= ZOOM_LIMITS_MIN_DEFAULT) {
return this.handleResetImage();
}
this.handleUpdatePanZoom({
newScaleFactor,
screenClientX,
screenClientY
});
},
wheelZoom(e) {
// only use x,y coordinates on scrolling in
if (this.wheelZooming === false && e.deltaY > 0) {
this.wheelZooming = true;
// grab first x,y coordinates
this.processZoom(e.deltaY * ZOOM_WHEEL_SENSITIVITY_REDUCTION, e.clientX, e.clientY);
} else {
// ignore subsequent event x,y so scroll drift doesn't occur
this.processZoom(e.deltaY * ZOOM_WHEEL_SENSITIVITY_REDUCTION);
}
// debounced method that will only fire after the scroll series is complete
this.clearWheelZoom();
},
/* debounced method so that wheelZooming state will
** remain true through a zoom event series
*/
clearWheelZoom() {
this.wheelZooming = false;
},
handleKeyDown(event) {
if (event.key === 'Alt') {
this.altPressed = true;
}
if (event.metaKey) {
this.metaPressed = true;
}
if (event.shiftKey) {
this.shiftPressed = true;
}
},
handleKeyUp(event) {
if (event.key === 'Alt') {
this.altPressed = false;
}
this.shiftPressed = false;
if (!event.metaKey) {
this.metaPressed = false;
}
},
zoomIn() {
this.processZoom(ZOOM_STEP);
},
zoomOut() {
this.processZoom(-ZOOM_STEP);
},
// attached to onClick listener in ImageryView
handlePanZoomClick(e) {
if (this.altPressed) {
return this.$emit('startPan', e);
}
if (!(this.metaPressed && e.button === 0)) {
return;
}
const newScaleFactor = this.zoomFactor + (this.shiftPressed ? -ZOOM_STEP : ZOOM_STEP);
this.zoomImage(newScaleFactor, e.clientX, e.clientY);
}
}
};
</script>

View File

@@ -21,11 +21,13 @@
--> -->
<template> <template>
<div ref="imagery" <div
class="c-imagery-tsv c-timeline-holder" ref="imagery"
class="c-imagery-tsv c-timeline-holder"
> >
<div ref="imageryHolder" <div
class="c-imagery-tsv__contents u-contents" ref="imageryHolder"
class="c-imagery-tsv__contents u-contents"
> >
</div> </div>
</div> </div>

View File

@@ -29,52 +29,78 @@
@mouseover="focusElement" @mouseover="focusElement"
> >
<div class="c-imagery__main-image-wrapper has-local-controls"> <div class="c-imagery__main-image-wrapper has-local-controls">
<div class="h-local-controls h-local-controls--overlay-content c-local-controls--show-on-hover c-image-controls__controls"> <ImageControls
<span class="c-image-controls__sliders" ref="imageControls"
draggable="true" :zoom-factor="zoomFactor"
@dragstart="startDrag" :image-url="imageUrl"
> @resetImage="resetImage"
<div class="c-image-controls__slider-wrapper icon-brightness"> @panZoomUpdated="handlePanZoomUpdate"
<input v-model="filters.brightness" @filtersUpdated="setFilters"
type="range" @cursorsUpdated="setCursorStates"
min="0" @startPan="startPan"
max="500" />
>
</div> <div
<div class="c-image-controls__slider-wrapper icon-contrast"> ref="imageBG"
<input v-model="filters.contrast" class="c-imagery__main-image__bg"
type="range" :class="{
min="0" 'paused unnsynced': isPaused && !isFixed,
max="500" 'stale': false,
> 'pannable': cursorStates.isPannable,
</div> 'cursor-zoom-in': cursorStates.showCursorZoomIn,
</span> 'cursor-zoom-out': cursorStates.showCursorZoomOut
<span class="t-reset-btn-holder c-imagery__lc__reset-btn c-image-controls__btn-reset"> }"
<a class="s-icon-button icon-reset t-btn-reset" @click="expand"
@click="filters={brightness: 100, contrast: 100}"
></a>
</span>
</div>
<div ref="imageBG"
class="c-imagery__main-image__bg"
:class="{'paused unnsynced': isPaused && !isFixed,'stale':false }"
@click="expand"
> >
<div class="image-wrapper" <div
:style="{ v-if="zoomFactor > 1"
'width': `${sizedImageDimensions.width}px`, class="c-imagery__hints"
'height': `${sizedImageDimensions.height}px` >Alt-drag to pan</div>
}" <div
ref="focusedImageWrapper"
class="image-wrapper"
:style="{
'width': `${sizedImageWidth}px`,
'height': `${sizedImageHeight}px`
}"
@mousedown="handlePanZoomClick"
> >
<img ref="focusedImage" <img
class="c-imagery__main-image__image js-imageryView-image" ref="focusedImage"
:src="imageUrl" class="c-imagery__main-image__image js-imageryView-image "
:style="{ :src="imageUrl"
'filter': `brightness(${filters.brightness}%) contrast(${filters.contrast}%)` :draggable="!isSelectable"
}" :style="{
:data-openmct-image-timestamp="time" 'filter': `brightness(${filters.brightness}%) contrast(${filters.contrast}%)`
:data-openmct-object-keystring="keyString" }"
:data-openmct-image-timestamp="time"
:data-openmct-object-keystring="keyString"
> >
<div
v-if="imageUrl"
ref="focusedImageElement"
class="c-imagery__main-image__background-image"
:draggable="!isSelectable"
:style="{
'filter': `brightness(${filters.brightness}%) contrast(${filters.contrast}%)`,
'background-image':
`${imageUrl ? (
`url(${imageUrl}),
repeating-linear-gradient(
45deg,
transparent,
transparent 4px,
rgba(125,125,125,.2) 4px,
rgba(125,125,125,.2) 8px
)`
) : ''}`,
'transform': `scale(${zoomFactor}) translate(${imageTranslateX}px, ${imageTranslateY}px)`,
'transition': `${!pan && animateZoom ? 'transform 250ms ease-in' : 'initial'}`,
'width': `${sizedImageWidth}px`,
'height': `${sizedImageHeight}px`,
}"
></div>
<Compass <Compass
v-if="shouldDisplayCompass" v-if="shouldDisplayCompass"
:compass-rose-sizing-classes="compassRoseSizingClasses" :compass-rose-sizing-classes="compassRoseSizingClasses"
@@ -85,16 +111,18 @@
</div> </div>
</div> </div>
<button class="c-local-controls c-local-controls--show-on-hover c-imagery__prev-next-button c-nav c-nav--prev" <button
title="Previous image" class="c-local-controls c-local-controls--show-on-hover c-imagery__prev-next-button c-nav c-nav--prev"
:disabled="isPrevDisabled" title="Previous image"
@click="prevImage()" :disabled="isPrevDisabled"
@click="prevImage()"
></button> ></button>
<button class="c-local-controls c-local-controls--show-on-hover c-imagery__prev-next-button c-nav c-nav--next" <button
title="Next image" class="c-local-controls c-local-controls--show-on-hover c-imagery__prev-next-button c-nav c-nav--next"
:disabled="isNextDisabled" title="Next image"
@click="nextImage()" :disabled="isNextDisabled"
@click="nextImage()"
></button> ></button>
<div class="c-imagery__control-bar"> <div class="c-imagery__control-bar">
@@ -125,34 +153,38 @@
v-if="!isFixed" v-if="!isFixed"
class="c-button icon-pause pause-play" class="c-button icon-pause pause-play"
:class="{'is-paused': isPaused}" :class="{'is-paused': isPaused}"
@click="paused(!isPaused, 'button')" @click="paused(!isPaused)"
></button> ></button>
</div> </div>
</div> </div>
</div> </div>
<div class="c-imagery__thumbs-wrapper" <div
:class="[ class="c-imagery__thumbs-wrapper"
{ 'is-paused': isPaused && !isFixed }, :class="[
{ 'is-autoscroll-off': !resizingWindow && !autoScroll && !isPaused } { 'is-paused': isPaused && !isFixed },
]" { 'is-autoscroll-off': !resizingWindow && !autoScroll && !isPaused }
]"
> >
<div <div
ref="thumbsWrapper" ref="thumbsWrapper"
class="c-imagery__thumbs-scroll-area" class="c-imagery__thumbs-scroll-area"
@scroll="handleScroll" @scroll="handleScroll"
> >
<div v-for="(image, index) in imageHistory" <div
:key="image.url + image.time" v-for="(image, index) in imageHistory"
class="c-imagery__thumb c-thumb" :key="image.url + image.time"
:class="{ selected: focusedImageIndex === index && isPaused }" class="c-imagery__thumb c-thumb"
@click="setFocusedImage(index, thumbnailClick)" :class="{ selected: focusedImageIndex === index && isPaused }"
@click="thumbnailClicked(index)"
> >
<a href="" <a
:download="image.imageDownloadName" href=""
@click.prevent :download="image.imageDownloadName"
@click.prevent
> >
<img class="c-thumb__image" <img
:src="image.url" class="c-thumb__image"
:src="image.url"
> >
</a> </a>
<div class="c-thumb__timestamp">{{ image.formattedTime }}</div> <div class="c-thumb__timestamp">{{ image.formattedTime }}</div>
@@ -169,12 +201,13 @@
</template> </template>
<script> <script>
import eventHelpers from '../lib/eventHelpers';
import _ from 'lodash'; import _ from 'lodash';
import moment from 'moment'; import moment from 'moment';
import RelatedTelemetry from './RelatedTelemetry/RelatedTelemetry'; import RelatedTelemetry from './RelatedTelemetry/RelatedTelemetry';
import Compass from './Compass/Compass.vue'; import Compass from './Compass/Compass.vue';
import ImageControls from './ImageControls.vue';
import imageryData from "../../imagery/mixins/imageryData"; import imageryData from "../../imagery/mixins/imageryData";
const REFRESH_CSS_MS = 500; const REFRESH_CSS_MS = 500;
@@ -194,9 +227,12 @@ const ARROW_LEFT = 37;
const SCROLL_LATENCY = 250; const SCROLL_LATENCY = 250;
const ZOOM_SCALE_DEFAULT = 1;
export default { export default {
components: { components: {
Compass Compass,
ImageControls
}, },
mixins: [imageryData], mixins: [imageryData],
inject: ['openmct', 'domainObject', 'objectPath', 'currentView'], inject: ['openmct', 'domainObject', 'objectPath', 'currentView'],
@@ -219,10 +255,6 @@ export default {
timeSystem: timeSystem, timeSystem: timeSystem,
keyString: undefined, keyString: undefined,
autoScroll: true, autoScroll: true,
filters: {
brightness: 100,
contrast: 100
},
thumbnailClick: THUMBNAIL_CLICKED, thumbnailClick: THUMBNAIL_CLICKED,
isPaused: false, isPaused: false,
refreshCSS: false, refreshCSS: false,
@@ -234,19 +266,37 @@ export default {
focusedImageNaturalAspectRatio: undefined, focusedImageNaturalAspectRatio: undefined,
imageContainerWidth: undefined, imageContainerWidth: undefined,
imageContainerHeight: undefined, imageContainerHeight: undefined,
sizedImageWidth: 0,
sizedImageHeight: 0,
lockCompass: true, lockCompass: true,
resizingWindow: false, resizingWindow: false,
timeContext: undefined timeContext: undefined,
zoomFactor: ZOOM_SCALE_DEFAULT,
filters: {
brightness: 100,
contrast: 100
},
cursorStates: {
isPannable: false,
showCursorZoomIn: false,
showCursorZoomOut: false,
modifierKeyPressed: false
},
imageTranslateX: 0,
imageTranslateY: 0,
pan: undefined,
animateZoom: true,
imagePanned: false
}; };
}, },
computed: { computed: {
compassRoseSizingClasses() { compassRoseSizingClasses() {
let compassRoseSizingClasses = ''; let compassRoseSizingClasses = '';
if (this.sizedImageDimensions.width < 300) { if (this.sizedImageWidth < 300) {
compassRoseSizingClasses = '--rose-small --rose-min'; compassRoseSizingClasses = '--rose-small --rose-min';
} else if (this.sizedImageDimensions.width < 500) { } else if (this.sizedImageWidth < 500) {
compassRoseSizingClasses = '--rose-small'; compassRoseSizingClasses = '--rose-small';
} else if (this.sizedImageDimensions.width > 1000) { } else if (this.sizedImageWidth > 1000) {
compassRoseSizingClasses = '--rose-max'; compassRoseSizingClasses = '--rose-max';
} }
@@ -315,10 +365,18 @@ export default {
return result; return result;
}, },
shouldDisplayCompass() { shouldDisplayCompass() {
return this.focusedImage !== undefined const imageHeightAndWidth = this.sizedImageHeight !== 0
&& this.sizedImageWidth !== 0;
const display = this.focusedImage !== undefined
&& this.focusedImageNaturalAspectRatio !== undefined && this.focusedImageNaturalAspectRatio !== undefined
&& this.imageContainerWidth !== undefined && this.imageContainerWidth !== undefined
&& this.imageContainerHeight !== undefined; && this.imageContainerHeight !== undefined
&& imageHeightAndWidth
&& this.zoomFactor === 1
&& this.imagePanned !== true;
return display;
}, },
isSpacecraftPositionFresh() { isSpacecraftPositionFresh() {
let isFresh = undefined; let isFresh = undefined;
@@ -380,20 +438,6 @@ export default {
return isFresh; return isFresh;
}, },
sizedImageDimensions() {
let sizedImageDimensions = {};
if ((this.imageContainerWidth / this.imageContainerHeight) > this.focusedImageNaturalAspectRatio) {
// container is wider than image
sizedImageDimensions.width = this.imageContainerHeight * this.focusedImageNaturalAspectRatio;
sizedImageDimensions.height = this.imageContainerHeight;
} else {
// container is taller than image
sizedImageDimensions.width = this.imageContainerWidth;
sizedImageDimensions.height = this.imageContainerWidth / this.focusedImageNaturalAspectRatio;
}
return sizedImageDimensions;
},
isFixed() { isFixed() {
let clock; let clock;
if (this.timeContext) { if (this.timeContext) {
@@ -403,6 +447,16 @@ export default {
} }
return clock === undefined; return clock === undefined;
},
isSelectable() {
return true;
},
sizedImageDimensions() {
return {
width: this.sizedImageWidth,
height: this.sizedImageHeight
};
} }
}, },
watch: { watch: {
@@ -411,16 +465,35 @@ export default {
const newSize = newHistory.length; const newSize = newHistory.length;
let imageIndex; let imageIndex;
if (this.focusedImageTimestamp !== undefined) { if (this.focusedImageTimestamp !== undefined) {
const foundImageIndex = this.imageHistory.findIndex(image => { const foundImageIndex = newHistory.findIndex(img => img.time === this.focusedImageTimestamp);
return image.time === this.focusedImageTimestamp; imageIndex = foundImageIndex > -1
}); ? foundImageIndex
imageIndex = foundImageIndex > -1 ? foundImageIndex : newSize - 1; : newSize - 1;
} else { } else {
imageIndex = newSize > 0 ? newSize - 1 : undefined; imageIndex = newSize > 0
? newSize - 1
: undefined;
} }
this.setFocusedImage(imageIndex, false); this.nextImageIndex = imageIndex;
this.scrollToRight();
if (this.previousFocusedImage && newHistory.length) {
const matchIndex = this.matchIndexOfPreviousImage(
this.previousFocusedImage,
newHistory
);
if (matchIndex > -1) {
this.setFocusedImage(matchIndex);
} else {
this.paused();
}
}
if (!this.isPaused) {
this.setFocusedImage(imageIndex);
this.scrollToRight();
}
}, },
deep: true deep: true
}, },
@@ -432,6 +505,10 @@ export default {
} }
}, },
async mounted() { async mounted() {
eventHelpers.extend(this);
this.focusedImageWrapper = this.$refs.focusedImageWrapper;
this.focusedImageElement = this.$refs.focusedImageElement;
//We only need to use this till the user focuses an image manually //We only need to use this till the user focuses an image manually
if (this.focusedImageTimestamp !== undefined) { if (this.focusedImageTimestamp !== undefined) {
this.isPaused = true; this.isPaused = true;
@@ -472,6 +549,7 @@ export default {
this.thumbWrapperResizeObserver.observe(this.$refs.thumbsWrapper); this.thumbWrapperResizeObserver.observe(this.$refs.thumbsWrapper);
} }
this.listenTo(this.focusedImageWrapper, 'wheel', this.wheelZoom, this);
}, },
beforeDestroy() { beforeDestroy() {
this.stopFollowingTimeContext(); this.stopFollowingTimeContext();
@@ -496,6 +574,9 @@ export default {
} }
} }
} }
this.stopListening(this.focusedImageWrapper, 'wheel', this.wheelZoom, this);
}, },
methods: { methods: {
setTimeContext() { setTimeContext() {
@@ -512,6 +593,11 @@ export default {
} }
}, },
expand() { expand() {
// check for modifier keys so it doesnt interfere with the layout
if (this.cursorStates.modifierKeyPressed) {
return;
}
const actionCollection = this.openmct.actions.getActionsCollection(this.objectPath, this.currentView); const actionCollection = this.openmct.actions.getActionsCollection(this.objectPath, this.currentView);
const visibleActions = actionCollection.getVisibleActions(); const visibleActions = actionCollection.getVisibleActions();
const viewLargeAction = visibleActions const viewLargeAction = visibleActions
@@ -617,6 +703,7 @@ export default {
focusElement() { focusElement() {
this.$el.focus(); this.$el.focus();
}, },
handleScroll() { handleScroll() {
const thumbsWrapper = this.$refs.thumbsWrapper; const thumbsWrapper = this.$refs.thumbsWrapper;
if (!thumbsWrapper || this.resizingWindow) { if (!thumbsWrapper || this.resizingWindow) {
@@ -627,20 +714,15 @@ export default {
const disableScroll = scrollWidth > Math.ceil(scrollLeft + clientWidth); const disableScroll = scrollWidth > Math.ceil(scrollLeft + clientWidth);
this.autoScroll = !disableScroll; this.autoScroll = !disableScroll;
}, },
paused(state, type) { paused(state) {
this.isPaused = state; this.isPaused = Boolean(state);
if (type === 'button') { if (!state) {
this.setFocusedImage(this.imageHistory.length - 1); this.previousFocusedImage = null;
}
if (this.nextImageIndex) {
this.setFocusedImage(this.nextImageIndex); this.setFocusedImage(this.nextImageIndex);
delete this.nextImageIndex; this.autoScroll = true;
this.scrollToRight();
} }
this.autoScroll = true;
this.scrollToRight();
}, },
scrollToFocused() { scrollToFocused() {
const thumbsWrapper = this.$refs.thumbsWrapper; const thumbsWrapper = this.$refs.thumbsWrapper;
@@ -679,51 +761,24 @@ export default {
&& x.time === previous.time && x.time === previous.time
)); ));
}, },
setFocusedImage(index, thumbnailClick = false) { thumbnailClicked(index) {
let focusedIndex = index; this.setFocusedImage(index);
this.paused(true);
this.setPreviousFocusedImage(index);
},
setPreviousFocusedImage(index) {
this.focusedImageTimestamp = undefined;
this.previousFocusedImage = this.imageHistory[index]
? JSON.parse(JSON.stringify(this.imageHistory[index]))
: undefined;
},
setFocusedImage(index) {
if (!(Number.isInteger(index) && index > -1)) { if (!(Number.isInteger(index) && index > -1)) {
return; return;
} }
if (thumbnailClick) { this.focusedImageIndex = index;
//We use the props till the user changes what they want to see
this.focusedImageTimestamp = undefined;
//set the previousFocusedImage when a user chooses an image
this.previousFocusedImage = this.imageHistory[focusedIndex] ? JSON.parse(JSON.stringify(this.imageHistory[focusedIndex])) : undefined;
}
if (this.previousFocusedImage) {
// determine if the previous image exists in the new bounds of imageHistory
if (!thumbnailClick) {
const matchIndex = this.matchIndexOfPreviousImage(
this.previousFocusedImage,
this.imageHistory
);
focusedIndex = matchIndex > -1 ? matchIndex : this.imageHistory.length - 1;
}
if (!(this.isPaused || thumbnailClick)
|| focusedIndex === this.imageHistory.length - 1) {
delete this.previousFocusedImage;
}
}
this.focusedImageIndex = focusedIndex;
//TODO: do we even need this anymore?
if (this.isPaused && !thumbnailClick && this.focusedImageTimestamp === undefined) {
this.nextImageIndex = focusedIndex;
//this could happen if bounds changes
if (this.focusedImageIndex > this.imageHistory.length - 1) {
this.focusedImageIndex = focusedIndex;
}
return;
}
if (thumbnailClick && !this.isPaused) {
this.paused(true);
}
}, },
trackDuration() { trackDuration() {
if (this.canTrackDuration) { if (this.canTrackDuration) {
@@ -761,7 +816,7 @@ export default {
let index = this.focusedImageIndex; let index = this.focusedImageIndex;
this.setFocusedImage(++index, THUMBNAIL_CLICKED); this.thumbnailClicked(++index);
if (index === this.imageHistory.length - 1) { if (index === this.imageHistory.length - 1) {
this.paused(false); this.paused(false);
} }
@@ -774,14 +829,50 @@ export default {
let index = this.focusedImageIndex; let index = this.focusedImageIndex;
if (index === this.imageHistory.length - 1) { if (index === this.imageHistory.length - 1) {
this.setFocusedImage(this.imageHistory.length - 2, THUMBNAIL_CLICKED); this.thumbnailClicked(this.imageHistory.length - 2);
} else { } else {
this.setFocusedImage(--index, THUMBNAIL_CLICKED); this.thumbnailClicked(--index);
} }
}, },
startDrag(e) { resetImage() {
e.preventDefault(); this.imagePanned = false;
e.stopPropagation(); this.zoomFactor = ZOOM_SCALE_DEFAULT;
this.imageTranslateX = 0;
this.imageTranslateY = 0;
},
handlePanZoomUpdate({ newScaleFactor, screenClientX, screenClientY }) {
if (!this.isPaused) {
this.paused(true);
}
if (!(screenClientX || screenClientY)) {
return this.updatePanZoom(newScaleFactor, 0, 0);
}
// handle mouse events
const imageRect = this.focusedImageWrapper.getBoundingClientRect();
const imageContainerX = screenClientX - imageRect.left;
const imageContainerY = screenClientY - imageRect.top;
const offsetFromCenterX = (imageRect.width / 2) - imageContainerX;
const offsetFromCenterY = (imageRect.height / 2) - imageContainerY;
this.updatePanZoom(newScaleFactor, offsetFromCenterX, offsetFromCenterY);
},
updatePanZoom(newScaleFactor, offsetFromCenterX, offsetFromCenterY) {
const currentScale = this.zoomFactor;
const previousTranslateX = this.imageTranslateX;
const previousTranslateY = this.imageTranslateY;
const offsetXInOriginalScale = offsetFromCenterX / currentScale;
const offsetYInOriginalScale = offsetFromCenterY / currentScale;
const translateX = offsetXInOriginalScale + previousTranslateX;
const translateY = offsetYInOriginalScale + previousTranslateY;
this.imageTranslateX = translateX;
this.imageTranslateY = translateY;
this.zoomFactor = newScaleFactor;
},
handlePanZoomClick(e) {
this.$refs.imageControls.handlePanZoomClick(e);
}, },
arrowDownHandler(event) { arrowDownHandler(event) {
let key = event.keyCode; let key = event.keyCode;
@@ -844,7 +935,7 @@ export default {
// TODO - should probably cache this // TODO - should probably cache this
img.addEventListener('load', () => { img.addEventListener('load', () => {
this.focusedImageNaturalAspectRatio = img.naturalWidth / img.naturalHeight; this.setSizedImageDimensions();
}, { once: true }); }, { once: true });
}, },
resizeImageContainer() { resizeImageContainer() {
@@ -859,6 +950,21 @@ export default {
if (this.$refs.imageBG.clientHeight !== this.imageContainerHeight) { if (this.$refs.imageBG.clientHeight !== this.imageContainerHeight) {
this.imageContainerHeight = this.$refs.imageBG.clientHeight; this.imageContainerHeight = this.$refs.imageBG.clientHeight;
} }
this.setSizedImageDimensions();
},
setSizedImageDimensions() {
this.focusedImageNaturalAspectRatio = this.$refs.focusedImage.naturalWidth / this.$refs.focusedImage.naturalHeight;
if ((this.imageContainerWidth / this.imageContainerHeight) > this.focusedImageNaturalAspectRatio) {
// container is wider than image
this.sizedImageWidth = this.imageContainerHeight * this.focusedImageNaturalAspectRatio;
this.sizedImageHeight = this.imageContainerHeight;
} else {
// container is taller than image
this.sizedImageWidth = this.imageContainerWidth;
this.sizedImageHeight = this.imageContainerWidth / this.focusedImageNaturalAspectRatio;
}
}, },
handleThumbWindowResizeStart() { handleThumbWindowResizeStart() {
if (!this.autoScroll) { if (!this.autoScroll) {
@@ -877,6 +983,73 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.resizingWindow = false; this.resizingWindow = false;
}); });
},
// debounced method
clearWheelZoom() {
this.$refs.imageControls.clearWheelZoom();
},
wheelZoom(e) {
e.preventDefault();
if (!this.isPaused) {
this.paused(true);
}
this.$refs.imageControls.wheelZoom(e);
},
startPan(e) {
e.preventDefault();
if (!this.pan && this.zoomFactor > 1) {
this.animateZoom = false;
this.imagePanned = true;
this.pan = {
x: e.clientX,
y: e.clientY
};
this.listenTo(window, 'mouseup', this.onMouseUp, this);
this.listenTo(window, 'mousemove', this.trackMousePosition, this);
}
return false;
},
trackMousePosition(e) {
if (!e.altKey) {
return this.onMouseUp(e);
}
this.updatePan(e);
e.preventDefault();
},
updatePan(e) {
if (!this.pan) {
return;
}
const dX = e.clientX - this.pan.x;
const dY = e.clientY - this.pan.y;
this.pan = {
x: e.clientX,
y: e.clientY
};
this.updatePanZoom(this.zoomFactor, dX, dY);
},
endPan() {
this.pan = undefined;
this.animateZoom = true;
},
onMouseUp(event) {
this.stopListening(window, 'mouseup', this.onMouseUp, this);
this.stopListening(window, 'mousemove', this.trackMousePosition, this);
if (this.pan) {
return this.endPan(event);
}
},
setFilters(filtersObj) {
this.filters = filtersObj;
},
setCursorStates(states) {
this.cursorStates = states;
} }
} }
}; };

View File

@@ -18,6 +18,11 @@
flex: 1 1 auto; flex: 1 1 auto;
} }
.image-wrapper {
overflow: visible clip;
background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(125, 125, 125, 0.2) 4px, rgba(125, 125, 125, 0.2) 8px);
}
&__main-image { &__main-image {
&__bg { &__bg {
background-color: $colorPlotBg; background-color: $colorPlotBg;
@@ -27,18 +32,46 @@
justify-content: center; justify-content: center;
flex: 1 1 auto; flex: 1 1 auto;
height: 0; height: 0;
overflow: hidden;
&.unnsynced{ &.unnsynced{
@include sUnsynced(); @include sUnsynced();
} }
} &.cursor-zoom-in {
cursor: zoom-in;
}
&.cursor-zoom-out {
cursor: zoom-out;
}
&.pannable {
@include cursorGrab();
}
}
&__background-image {
background-position: center;
background-repeat: no-repeat;
background-size: contain;
}
&__image { &__image {
height: 100%; height: 100%;
width: 100%; width: 100%;
visibility: hidden;
display: contents;
} }
} }
&__hints {
$m: $interiorMargin;
background: rgba(black, 0.2);
border-radius: $smallCr;
padding: 2px $interiorMargin;
position: absolute;
right: $m;
top: $m;
opacity: 0.9;
z-index: 2;
}
&__control-bar, &__control-bar,
&__time { &__time {
display: flex; display: flex;
@@ -177,8 +210,8 @@
z-index: 2; z-index: 2;
background: $colorLocalControlOvrBg; background: $colorLocalControlOvrBg;
border-radius: $basicCr; border-radius: $basicCr;
max-width: 200px; max-width: 250px;
min-width: 70px; min-width: 170px;
width: 35%; width: 35%;
align-items: center; align-items: center;
padding: $interiorMargin $interiorMarginLg; padding: $interiorMargin $interiorMarginLg;
@@ -202,6 +235,7 @@
&__lc { &__lc {
&__reset-btn { &__reset-btn {
// Span that holds bracket graphics and button
$bc: $scrollbarTrackColorBg; $bc: $scrollbarTrackColorBg;
&:before, &:before,
@@ -222,18 +256,50 @@
border-bottom: 1px solid $bc; border-bottom: 1px solid $bc;
margin-top: 2px; margin-top: 2px;
} }
.c-icon-link {
color: $colorBtnFg;
}
} }
} }
} }
.c-image-controls { .c-image-controls {
// Brightness/contrast
&__controls { &__controls {
// Sliders and reset element display: flex;
align-items: stretch;
flex-direction: column;
> * + * {
margin-top: $interiorMargin;
}
[class*='c-button'] { flex: 0 0 auto; }
}
&__control,
&__input {
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: $interiorMargin; // Need some extra space due to proximity to close button width: 100%;
&:before {
color: rgba($colorMenuFg, 0.5);
margin-right: $interiorMarginSm;
}
}
&__input {
// A wrapper is needed to add the type icon to left of each control
input[type='range'] {
//width: 100%; // Do we need this?
}
}
&__zoom {
> * + * { margin-left: $interiorMargin; }
} }
&__sliders { &__sliders {
@@ -246,21 +312,6 @@
} }
} }
&__slider-wrapper {
// A wrapper is needed to add the type icon to left of each range input
display: flex;
align-items: center;
&:before {
color: rgba($colorMenuFg, 0.5);
margin-right: $interiorMarginSm;
}
input[type='range'] {
width: 100px;
}
}
&__btn-reset { &__btn-reset {
flex: 0 0 auto; flex: 0 0 auto;
} }

View File

@@ -0,0 +1,98 @@
/*****************************************************************************
* 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([], function () {
const helperFunctions = {
listenTo: function (object, event, callback, context) {
if (!this._listeningTo) {
this._listeningTo = [];
}
const listener = {
object: object,
event: event,
callback: callback,
context: context,
_cb: context ? callback.bind(context) : callback
};
if (object.$watch && event.indexOf('change:') === 0) {
const scopePath = event.replace('change:', '');
listener.unlisten = object.$watch(scopePath, listener._cb, true);
} else if (object.$on) {
listener.unlisten = object.$on(event, listener._cb);
} else if (object.addEventListener) {
object.addEventListener(event, listener._cb);
} else {
object.on(event, listener._cb);
}
this._listeningTo.push(listener);
},
stopListening: function (object, event, callback, context) {
if (!this._listeningTo) {
this._listeningTo = [];
}
this._listeningTo.filter(function (listener) {
if (object && object !== listener.object) {
return false;
}
if (event && event !== listener.event) {
return false;
}
if (callback && callback !== listener.callback) {
return false;
}
if (context && context !== listener.context) {
return false;
}
return true;
})
.map(function (listener) {
if (listener.unlisten) {
listener.unlisten();
} else if (listener.object.removeEventListener) {
listener.object.removeEventListener(listener.event, listener._cb);
} else {
listener.object.off(listener.event, listener._cb);
}
return listener;
})
.forEach(function (listener) {
this._listeningTo.splice(this._listeningTo.indexOf(listener), 1);
}, this);
},
extend: function (object) {
object.listenTo = helperFunctions.listenTo;
object.stopListening = helperFunctions.stopListening;
}
};
return helperFunctions;
});

View File

@@ -30,6 +30,7 @@ export default {
this.timeSystemChange = this.timeSystemChange.bind(this); this.timeSystemChange = this.timeSystemChange.bind(this);
this.setDataTimeContext = this.setDataTimeContext.bind(this); this.setDataTimeContext = this.setDataTimeContext.bind(this);
this.setDataTimeContext(); this.setDataTimeContext();
this.openmct.objectViews.on('clearData', this.clearData);
// set // set
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier); this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
@@ -54,6 +55,7 @@ export default {
} }
this.stopFollowingDataTimeContext(); this.stopFollowingDataTimeContext();
this.openmct.objectViews.off('clearData', this.clearData);
}, },
methods: { methods: {
setDataTimeContext() { setDataTimeContext() {
@@ -151,6 +153,25 @@ export default {
this.imageHistory = imagery; 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() { timeSystemChange() {
this.timeSystem = this.timeContext.timeSystem(); this.timeSystem = this.timeContext.timeSystem();
this.timeKey = this.timeSystem.key; this.timeKey = this.timeSystem.key;

View File

@@ -27,6 +27,7 @@ import {
resetApplicationState, resetApplicationState,
simulateKeyEvent simulateKeyEvent
} from 'utils/testing'; } from 'utils/testing';
import ClearDataPlugin from '../clearData/plugin';
const ONE_MINUTE = 1000 * 60; const ONE_MINUTE = 1000 * 60;
const TEN_MINUTES = ONE_MINUTE * 10; const TEN_MINUTES = ONE_MINUTE * 10;
@@ -83,6 +84,7 @@ describe("The Imagery View Layouts", () => {
let telemetryPromise; let telemetryPromise;
let telemetryPromiseResolve; let telemetryPromiseResolve;
let cleanupFirst; let cleanupFirst;
let isClearDataTriggered;
let openmct; let openmct;
let parent; let parent;
@@ -201,6 +203,10 @@ describe("The Imagery View Layouts", () => {
}); });
spyOn(openmct.telemetry, 'request').and.callFake(() => { spyOn(openmct.telemetry, 'request').and.callFake(() => {
if (isClearDataTriggered) {
return [];
}
telemetryPromiseResolve(imageTelemetry); telemetryPromiseResolve(imageTelemetry);
return telemetryPromise; return telemetryPromise;
@@ -323,6 +329,8 @@ describe("The Imagery View Layouts", () => {
let applicableViews; let applicableViews;
let imageryViewProvider; let imageryViewProvider;
let imageryView; let imageryView;
let clearDataPlugin;
let clearDataAction;
beforeEach(() => { beforeEach(() => {
@@ -330,16 +338,21 @@ describe("The Imagery View Layouts", () => {
imageryViewProvider = applicableViews.find(viewProvider => viewProvider.key === imageryKey); imageryViewProvider = applicableViews.find(viewProvider => viewProvider.key === imageryKey);
imageryView = imageryViewProvider.view(imageryObject, [imageryObject]); imageryView = imageryViewProvider.view(imageryObject, [imageryObject]);
imageryView.show(child); imageryView.show(child);
clearDataPlugin = new ClearDataPlugin(
['example.imagery'],
{indicator: true}
);
openmct.install(clearDataPlugin);
clearDataAction = openmct.actions.getAction('clear-data-action');
return Vue.nextTick(); return Vue.nextTick();
}); });
afterEach(() => {
// afterEach(() => { isClearDataTriggered = false;
// openmct.time.stopClock(); // openmct.time.stopClock();
// openmct.router.removeListener('change:hash', resolveFunction); // openmct.router.removeListener('change:hash', resolveFunction);
// // imageryView.destroy();
// imageryView.destroy(); });
// });
it("on mount should show the the most recent image", (done) => { it("on mount should show the the most recent image", (done) => {
//Looks like we need Vue.nextTick here so that computed properties settle down //Looks like we need Vue.nextTick here so that computed properties settle down
@@ -470,6 +483,57 @@ describe("The Imagery View Layouts", () => {
}); });
}); });
}); });
xit('should change the image zoom factor when using the zoom buttons', async (done) => {
await Vue.nextTick();
let imageSizeBefore;
let imageSizeAfter;
// test clicking the zoom in button
imageSizeBefore = parent.querySelector('.c-imagery_main-image_background-image').getBoundingClientRect();
parent.querySelector('.t-btn-zoom-in').click();
await Vue.nextTick();
imageSizeAfter = parent.querySelector('.c-imagery_main-image_background-image').getBoundingClientRect();
expect(imageSizeAfter.height).toBeGreaterThan(imageSizeBefore.height);
expect(imageSizeAfter.width).toBeGreaterThan(imageSizeBefore.width);
// test clicking the zoom out button
imageSizeBefore = parent.querySelector('.c-imagery_main-image_background-image').getBoundingClientRect();
parent.querySelector('.t-btn-zoom-out').click();
await Vue.nextTick();
imageSizeAfter = parent.querySelector('.c-imagery_main-image_background-image').getBoundingClientRect();
expect(imageSizeAfter.height).toBeLessThan(imageSizeBefore.height);
expect(imageSizeAfter.width).toBeLessThan(imageSizeBefore.width);
done();
});
xit('should reset the zoom factor on the image when clicking the zoom button', async (done) => {
await Vue.nextTick();
// test clicking the zoom reset button
// zoom in to scale up the image dimensions
parent.querySelector('.t-btn-zoom-in').click();
await Vue.nextTick();
let imageSizeBefore = parent.querySelector('.c-imagery_main-image_background-image').getBoundingClientRect();
await Vue.nextTick();
parent.querySelector('.t-btn-zoom-reset').click();
let imageSizeAfter = parent.querySelector('.c-imagery_main-image_background-image').getBoundingClientRect();
expect(imageSizeAfter.height).toBeLessThan(imageSizeBefore.height);
expect(imageSizeAfter.width).toBeLessThan(imageSizeBefore.width);
done();
});
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", () => { describe("imagery time strip view", () => {

View File

@@ -33,10 +33,7 @@ export default class LinkAction {
} }
appliesTo(objectPath) { appliesTo(objectPath) {
let domainObject = objectPath[0]; return true; // link away!
let type = domainObject && this.openmct.types.get(domainObject.type);
return type && type.definition.creatable;
} }
invoke(objectPath) { invoke(objectPath) {
@@ -77,6 +74,7 @@ export default class LinkAction {
{ {
name: "location", name: "location",
control: "locator", control: "locator",
parent: parentDomainObject,
required: true, required: true,
validate: this.validate(parentDomainObject), validate: this.validate(parentDomainObject),
key: 'location' key: 'location'
@@ -92,11 +90,26 @@ export default class LinkAction {
validate(currentParent) { validate(currentParent) {
return (data) => { return (data) => {
// default current parent to ROOT, if it's undefined, then it's a root level item
if (currentParent === undefined) {
currentParent = {
identifier: {
key: 'ROOT',
namespace: ''
}
};
}
const parentCandidate = data.value[0]; const parentCandidate = data.value[0];
const currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier); const currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier);
const parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier); const parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier);
const objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier); const objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier);
if (!this.openmct.objects.isPersistable(parentCandidate.identifier)) {
return false;
}
if (!parentCandidateKeystring || !currentParentKeystring) { if (!parentCandidateKeystring || !currentParentKeystring) {
return false; return false;
} }

View File

@@ -126,6 +126,7 @@ export default class MoveAction {
{ {
name: "Location", name: "Location",
control: "locator", control: "locator",
parent: parentDomainObject,
required: true, required: true,
validate: this.validate(parentDomainObject), validate: this.validate(parentDomainObject),
key: 'location' key: 'location'
@@ -144,6 +145,10 @@ export default class MoveAction {
const parentCandidatePath = data.value; const parentCandidatePath = data.value;
const parentCandidate = parentCandidatePath[0]; const parentCandidate = parentCandidatePath[0];
if (!this.openmct.objects.isPersistable(parentCandidate.identifier)) {
return false;
}
let currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier); let currentParentKeystring = this.openmct.objects.makeKeyString(currentParent.identifier);
let parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier); let parentCandidateKeystring = this.openmct.objects.makeKeyString(parentCandidate.identifier);
let objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier); let objectKeystring = this.openmct.objects.makeKeyString(this.object.identifier);
@@ -174,8 +179,9 @@ export default class MoveAction {
let parentType = parent && this.openmct.types.get(parent.type); let parentType = parent && this.openmct.types.get(parent.type);
let child = objectPath[0]; let child = objectPath[0];
let childType = child && this.openmct.types.get(child.type); let childType = child && this.openmct.types.get(child.type);
let isPersistable = this.openmct.objects.isPersistable(child.identifier);
if (child.locked || (parent && parent.locked)) { if (child.locked || (parent && parent.locked) || !isPersistable) {
return false; return false;
} }

View File

@@ -23,46 +23,51 @@
<template> <template>
<div class="c-notebook"> <div class="c-notebook">
<div class="c-notebook__head"> <div class="c-notebook__head">
<Search class="c-notebook__search" <Search
:value="search" class="c-notebook__search"
@input="search = $event" :value="search"
@clear="resetSearch()" @input="search = $event"
@clear="resetSearch()"
/> />
</div> </div>
<SearchResults v-if="search.length" <SearchResults
ref="searchResults" v-if="search.length"
:domain-object="domainObject" ref="searchResults"
:results="searchResults" :domain-object="domainObject"
@changeSectionPage="changeSelectedSection" :results="searchResults"
@updateEntries="updateEntries" @changeSectionPage="changeSelectedSection"
@updateEntries="updateEntries"
/> />
<div v-if="!search.length" <div
class="c-notebook__body" v-if="!search.length"
class="c-notebook__body"
> >
<Sidebar ref="sidebar" <Sidebar
class="c-notebook__nav c-sidebar c-drawer c-drawer--align-left" ref="sidebar"
:class="[{'is-expanded': showNav}, {'c-drawer--push': !sidebarCoversEntries}, {'c-drawer--overlays': sidebarCoversEntries}]" class="c-notebook__nav c-sidebar c-drawer c-drawer--align-left"
:default-page-id="defaultPageId" :class="[{'is-expanded': showNav}, {'c-drawer--push': !sidebarCoversEntries}, {'c-drawer--overlays': sidebarCoversEntries}]"
:selected-page-id="getSelectedPageId()" :default-page-id="defaultPageId"
:default-section-id="defaultSectionId" :selected-page-id="getSelectedPageId()"
:selected-section-id="getSelectedSectionId()" :default-section-id="defaultSectionId"
:domain-object="domainObject" :selected-section-id="getSelectedSectionId()"
:page-title="domainObject.configuration.pageTitle" :domain-object="domainObject"
:section-title="domainObject.configuration.sectionTitle" :page-title="domainObject.configuration.pageTitle"
:sections="sections" :section-title="domainObject.configuration.sectionTitle"
:sidebar-covers-entries="sidebarCoversEntries" :sections="sections"
@defaultPageDeleted="cleanupDefaultNotebook" :sidebar-covers-entries="sidebarCoversEntries"
@defaultSectionDeleted="cleanupDefaultNotebook" @defaultPageDeleted="cleanupDefaultNotebook"
@pagesChanged="pagesChanged" @defaultSectionDeleted="cleanupDefaultNotebook"
@selectPage="selectPage" @pagesChanged="pagesChanged"
@sectionsChanged="sectionsChanged" @selectPage="selectPage"
@selectSection="selectSection" @sectionsChanged="sectionsChanged"
@toggleNav="toggleNav" @selectSection="selectSection"
@toggleNav="toggleNav"
/> />
<div class="c-notebook__page-view"> <div class="c-notebook__page-view">
<div class="c-notebook__page-view__header"> <div class="c-notebook__page-view__header">
<button class="c-notebook__toggle-nav-button c-icon-button c-icon-button--major icon-menu-hamburger" <button
@click="toggleNav" class="c-notebook__toggle-nav-button c-icon-button c-icon-button--major icon-menu-hamburger"
@click="toggleNav"
></button> ></button>
<div class="c-notebook__page-view__path c-path"> <div class="c-notebook__page-view__path c-path">
<span class="c-notebook__path__section c-path__item"> <span class="c-notebook__path__section c-path__item">
@@ -73,59 +78,70 @@
</span> </span>
</div> </div>
<div class="c-notebook__page-view__controls"> <div class="c-notebook__page-view__controls">
<select v-model="showTime" <select
class="c-notebook__controls__time" v-model="showTime"
class="c-notebook__controls__time"
> >
<option value="0" <option
:selected="showTime === 0" value="0"
:selected="showTime === 0"
> >
Show all Show all
</option> </option>
<option value="1" <option
:selected="showTime === 1" value="1"
:selected="showTime === 1"
>Last hour</option> >Last hour</option>
<option value="8" <option
:selected="showTime === 8" value="8"
:selected="showTime === 8"
>Last 8 hours</option> >Last 8 hours</option>
<option value="24" <option
:selected="showTime === 24" value="24"
:selected="showTime === 24"
>Last 24 hours</option> >Last 24 hours</option>
</select> </select>
<select v-model="defaultSort" <select
class="c-notebook__controls__time" v-model="defaultSort"
class="c-notebook__controls__time"
> >
<option value="newest" <option
:selected="defaultSort === 'newest'" value="newest"
:selected="defaultSort === 'newest'"
>Newest first</option> >Newest first</option>
<option value="oldest" <option
:selected="defaultSort === 'oldest'" value="oldest"
:selected="defaultSort === 'oldest'"
>Oldest first</option> >Oldest first</option>
</select> </select>
</div> </div>
</div> </div>
<div class="c-notebook__drag-area icon-plus" <div
@click="newEntry()" class="c-notebook__drag-area icon-plus"
@dragover="dragOver" @click="newEntry()"
@drop.capture="dropCapture" @dragover="dragOver"
@drop="dropOnEntry($event)" @drop.capture="dropCapture"
@drop="dropOnEntry($event)"
> >
<span class="c-notebook__drag-area__label"> <span class="c-notebook__drag-area__label">
To start a new entry, click here or drag and drop any object To start a new entry, click here or drag and drop any object
</span> </span>
</div> </div>
<div v-if="selectedSection && selectedPage" <div
ref="notebookEntries" v-if="selectedSection && selectedPage"
class="c-notebook__entries" ref="notebookEntries"
class="c-notebook__entries"
> >
<NotebookEntry v-for="entry in filteredAndSortedEntries" <NotebookEntry
:key="entry.id" v-for="entry in filteredAndSortedEntries"
:entry="entry" :key="entry.id"
:domain-object="domainObject" :entry="entry"
:selected-page="selectedPage" :domain-object="domainObject"
:selected-section="selectedSection" :selected-page="selectedPage"
:read-only="false" :selected-section="selectedSection"
@deleteEntry="deleteEntry" :read-only="false"
@updateEntry="updateEntry" @deleteEntry="deleteEntry"
@updateEntry="updateEntry"
/> />
</div> </div>
</div> </div>
@@ -438,6 +454,8 @@ export default {
const classList = document.querySelector('body').classList; const classList = document.querySelector('body').classList;
const isPhone = Array.from(classList).includes('phone'); const isPhone = Array.from(classList).includes('phone');
const isTablet = Array.from(classList).includes('tablet'); const isTablet = Array.from(classList).includes('tablet');
// address in https://github.com/nasa/openmct/issues/4875
// eslint-disable-next-line compat/compat
const isPortrait = window.screen.orientation.type.includes('portrait'); const isPortrait = window.screen.orientation.type.includes('portrait');
const isInLayout = Boolean(this.$el.closest('.c-so-view')); const isInLayout = Boolean(this.$el.closest('.c-so-view'));
const sidebarCoversEntries = (isPhone || (isTablet && isPortrait) || isInLayout); const sidebarCoversEntries = (isPhone || (isTablet && isPortrait) || isInLayout);
@@ -596,8 +614,9 @@ export default {
this.resetSearch(); this.resetSearch();
const notebookStorage = this.createNotebookStorageObject(); const notebookStorage = this.createNotebookStorageObject();
this.updateDefaultNotebook(notebookStorage); this.updateDefaultNotebook(notebookStorage);
const id = addNotebookEntry(this.openmct, this.domainObject, notebookStorage, embed); addNotebookEntry(this.openmct, this.domainObject, notebookStorage, embed).then(id => {
this.focusEntryId = id; this.focusEntryId = id;
});
}, },
orientationChange() { orientationChange() {
this.formatSidebar(); this.formatSidebar();

View File

@@ -1,21 +1,24 @@
<template> <template>
<div class="c-snapshot c-ne__embed"> <div class="c-snapshot c-ne__embed">
<div v-if="embed.snapshot" <div
class="c-ne__embed__snap-thumb" v-if="embed.snapshot"
@click="openSnapshot()" class="c-ne__embed__snap-thumb"
@click="openSnapshot()"
> >
<img :src="thumbnailImage"> <img :src="thumbnailImage">
</div> </div>
<div class="c-ne__embed__info"> <div class="c-ne__embed__info">
<div class="c-ne__embed__name"> <div class="c-ne__embed__name">
<a class="c-ne__embed__link" <a
:class="embed.cssClass" class="c-ne__embed__link"
@click="changeLocation" :class="embed.cssClass"
@click="changeLocation"
>{{ embed.name }}</a> >{{ embed.name }}</a>
<PopupMenu :popup-menu-items="popupMenuItems" /> <PopupMenu :popup-menu-items="popupMenuItems" />
</div> </div>
<div v-if="embed.snapshot" <div
class="c-ne__embed__time" v-if="embed.snapshot"
class="c-ne__embed__time"
> >
{{ createdOn }} {{ createdOn }}
</div> </div>

View File

@@ -21,13 +21,17 @@
*****************************************************************************/ *****************************************************************************/
<template> <template>
<div class="c-notebook__entry c-ne has-local-controls" <div
@dragover="changeCursor" class="c-notebook__entry c-ne has-local-controls"
@drop.capture="cancelEditMode" @dragover="changeCursor"
@drop.prevent="dropOnEntry" @drop.capture="cancelEditMode"
@drop.prevent="dropOnEntry"
> >
<div class="c-ne__time-and-content"> <div class="c-ne__time-and-content">
<div class="c-ne__time"> <div class="c-ne__time">
<template v-if="entry.createdBy">
<span class="c-icon icon-person">{{ entry.createdBy }}</span>
</template>
<span>{{ createdOnDate }}</span> <span>{{ createdOnDate }}</span>
<span>{{ createdOnTime }}</span> <span>{{ createdOnTime }}</span>
</div> </div>
@@ -59,27 +63,31 @@
</div> </div>
</template> </template>
<div class="c-snapshots c-ne__embeds"> <div class="c-snapshots c-ne__embeds">
<NotebookEmbed v-for="embed in entry.embeds" <NotebookEmbed
:key="embed.id" v-for="embed in entry.embeds"
:embed="embed" :key="embed.id"
@removeEmbed="removeEmbed" :embed="embed"
@updateEmbed="updateEmbed" @removeEmbed="removeEmbed"
@updateEmbed="updateEmbed"
/> />
</div> </div>
</div> </div>
</div> </div>
<div v-if="!readOnly" <div
class="c-ne__local-controls--hidden" v-if="!readOnly"
class="c-ne__local-controls--hidden"
> >
<button class="c-icon-button c-icon-button--major icon-trash" <button
title="Delete this entry" class="c-icon-button c-icon-button--major icon-trash"
tabindex="-1" title="Delete this entry"
@click="deleteEntry" tabindex="-1"
@click="deleteEntry"
> >
</button> </button>
</div> </div>
<div v-if="readOnly" <div
class="c-ne__section-and-page" v-if="readOnly"
class="c-ne__section-and-page"
> >
<a <a
class="c-click-link" class="c-click-link"
@@ -182,7 +190,7 @@ export default {
this.dropOnEntry = this.dropOnEntry.bind(this); this.dropOnEntry = this.dropOnEntry.bind(this);
}, },
methods: { methods: {
addNewEmbed(objectPath) { async addNewEmbed(objectPath) {
const bounds = this.openmct.time.bounds(); const bounds = this.openmct.time.bounds();
const snapshotMeta = { const snapshotMeta = {
bounds, bounds,
@@ -190,7 +198,7 @@ export default {
objectPath, objectPath,
openmct: this.openmct openmct: this.openmct
}; };
const newEmbed = createNewEmbed(snapshotMeta); const newEmbed = await createNewEmbed(snapshotMeta);
this.entry.embeds.push(newEmbed); this.entry.embeds.push(newEmbed);
}, },
cancelEditMode(event) { cancelEditMode(event) {
@@ -206,7 +214,7 @@ export default {
deleteEntry() { deleteEntry() {
this.$emit('deleteEntry', this.entry.id); this.$emit('deleteEntry', this.entry.id);
}, },
dropOnEntry($event) { async dropOnEntry($event) {
event.stopImmediatePropagation(); event.stopImmediatePropagation();
const snapshotId = $event.dataTransfer.getData('openmct/snapshot/id'); const snapshotId = $event.dataTransfer.getData('openmct/snapshot/id');
@@ -221,7 +229,7 @@ export default {
} else { } else {
const data = $event.dataTransfer.getData('openmct/domain-object-path'); const data = $event.dataTransfer.getData('openmct/domain-object-path');
const objectPath = JSON.parse(data); const objectPath = JSON.parse(data);
this.addNewEmbed(objectPath); await this.addNewEmbed(objectPath);
} }
this.$emit('updateEntry', this.entry); this.$emit('updateEntry', this.entry);

View File

@@ -8,39 +8,45 @@
<div class="c-object-label__name"> <div class="c-object-label__name">
Notebook Snapshots Notebook Snapshots
</div> </div>
<div v-if="snapshots.length" <div
class="l-browse-bar__object-details" v-if="snapshots.length"
class="l-browse-bar__object-details"
>{{ snapshots.length }} of {{ getNotebookSnapshotMaxCount() }} >{{ snapshots.length }} of {{ getNotebookSnapshotMaxCount() }}
</div> </div>
</div> </div>
<PopupMenu v-if="snapshots.length > 0" <PopupMenu
:popup-menu-items="popupMenuItems" v-if="snapshots.length > 0"
:popup-menu-items="popupMenuItems"
/> />
</div> </div>
</div> </div>
<div class="l-browse-bar__end"> <div class="l-browse-bar__end">
<button class="c-click-icon c-click-icon--major icon-x" <button
@click="close" class="c-click-icon c-click-icon--major icon-x"
@click="close"
></button> ></button>
</div> </div>
</div><!-- closes l-browse-bar --> </div><!-- closes l-browse-bar -->
<div class="c-snapshots"> <div class="c-snapshots">
<span v-for="snapshot in snapshots" <span
:key="snapshot.embedObject.id" v-for="snapshot in snapshots"
draggable="true" :key="snapshot.embedObject.id"
@dragstart="startEmbedDrag(snapshot, $event)" draggable="true"
@dragstart="startEmbedDrag(snapshot, $event)"
> >
<NotebookEmbed ref="notebookEmbed" <NotebookEmbed
:key="snapshot.embedObject.id" ref="notebookEmbed"
:embed="snapshot.embedObject" :key="snapshot.embedObject.id"
:is-snapshot-container="true" :embed="snapshot.embedObject"
:remove-action-string="'Delete Snapshot'" :is-snapshot-container="true"
@removeEmbed="removeSnapshot" :remove-action-string="'Delete Snapshot'"
@removeEmbed="removeSnapshot"
/> />
</span> </span>
<div v-if="!snapshots.length > 0" <div
class="hint" v-if="!snapshots.length > 0"
class="hint"
> >
There are no Notebook Snapshots currently. There are no Notebook Snapshots currently.
</div> </div>

View File

@@ -1,11 +1,12 @@
<template> <template>
<div class="c-indicator c-indicator--clickable icon-camera" <div
:class="[ class="c-indicator c-indicator--clickable icon-camera"
{ 's-status-off': snapshotCount === 0 }, :class="[
{ 's-status-on': snapshotCount > 0 }, { 's-status-off': snapshotCount === 0 },
{ 's-status-caution': snapshotCount === snapshotMaxCount }, { 's-status-on': snapshotCount > 0 },
{ 'has-new-snapshot': flashIndicator } { 's-status-caution': snapshotCount === snapshotMaxCount },
]" { 'has-new-snapshot': flashIndicator }
]"
> >
<span class="label c-indicator__label"> <span class="label c-indicator__label">
{{ indicatorTitle }} {{ indicatorTitle }}

View File

@@ -1,17 +1,19 @@
<template> <template>
<ul class="c-list"> <ul class="c-list">
<li v-for="page in pages" <li
v-for="page in pages"
:key="page.id" :key="page.id"
class="c-list__item-h" class="c-list__item-h"
> >
<Page ref="pageComponent" <Page
:default-page-id="defaultPageId" ref="pageComponent"
:selected-page-id="selectedPageId" :default-page-id="defaultPageId"
:page="page" :selected-page-id="selectedPageId"
:page-title="pageTitle" :page="page"
@deletePage="deletePage" :page-title="pageTitle"
@renamePage="updatePage" @deletePage="deletePage"
@selectPage="selectPage" @renamePage="updatePage"
@selectPage="selectPage"
/> />
</li> </li>
</ul> </ul>

View File

@@ -1,13 +1,15 @@
<template> <template>
<div class="c-list__item js-list__item" <div
:class="[{ 'is-selected': isSelected, 'is-notebook-default' : (defaultPageId === page.id) }]" class="c-list__item js-list__item"
:data-id="page.id" :class="[{ 'is-selected': isSelected, 'is-notebook-default' : (defaultPageId === page.id) }]"
@click="selectPage" :data-id="page.id"
@click="selectPage"
> >
<span class="c-list__item__name js-list__item__name" <span
:data-id="page.id" class="c-list__item__name js-list__item__name"
@keydown.enter="updateName" :data-id="page.id"
@blur="updateName" @keydown.enter="updateName"
@blur="updateName"
>{{ page.name.length ? page.name : `Unnamed ${pageTitle}` }}</span> >{{ page.name.length ? page.name : `Unnamed ${pageTitle}` }}</span>
<PopupMenu :popup-menu-items="popupMenuItems" /> <PopupMenu :popup-menu-items="popupMenuItems" />
</div> </div>

View File

@@ -24,16 +24,17 @@
<div class="c-notebook__search-results"> <div class="c-notebook__search-results">
<div class="c-notebook__search-results__header">Search Results ({{ results.length }})</div> <div class="c-notebook__search-results__header">Search Results ({{ results.length }})</div>
<div class="c-notebook__entries"> <div class="c-notebook__entries">
<NotebookEntry v-for="(result, index) in results" <NotebookEntry
:key="index" v-for="(result, index) in results"
:domain-object="domainObject" :key="index"
:result="result" :domain-object="domainObject"
:entry="result.entry" :result="result"
:read-only="true" :entry="result.entry"
:selected-page="result.page" :read-only="true"
:selected-section="result.section" :selected-page="result.page"
@changeSectionPage="changeSectionPage" :selected-section="result.section"
@updateEntries="updateEntries" @changeSectionPage="changeSectionPage"
@updateEntries="updateEntries"
/> />
</div> </div>
</div> </div>

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