Compare commits

...

16 Commits

Author SHA1 Message Date
388e73157e test 2022-02-02 13:35:07 -08:00
e434b294b9 Bump karma from 6.3.11 to 6.3.13 (#4816)
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.11 to 6.3.13.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.11...v6.3.13)

---
updated-dependencies:
- dependency-name: karma
  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-02-01 12:15:09 -08:00
48b66e0af2 [CI] Update playwright to 1.18.1 (#4805)
* Update package.json
* Update config.yml
2022-01-31 16:19:41 -08:00
54ef9a830e Show all options when clicking arrow in autocomplete form - Mct4578 (#4708)
Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Nikhil <nikhil.k.mandlik@nasa.gov>
Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
2022-01-28 13:24:04 -08:00
cd38545267 [Build]npm run clean uses absolute node_modules directory instead of relative (#4801) 2022-01-27 11:00:01 -08:00
8aed21d670 [CI] Update github actions automation to work across forks (#4799)
* Update e2e-pr.yml

* Update e2e-pr.yml
2022-01-27 08:41:33 -08:00
b27f24cc30 Merge release 1.8.4 into master (#4797)
* Update version number (#4759)

* update copyright (#4775)

* Observe changes to sub-objects in flexible layouts. (#4780)

* Get child of flex layout as mutable if possible

* Fix bug when no default notebook defined

* Follow domain object changes for Independent time conductor (#4783)

* Track if domain object changes when independent time conductor is in use.

* fix typo when using fallback template (#4784)

Co-authored-by: Scott Bell <scott@traclabs.com>
Co-authored-by: Andrew Henry <akhenry@gmail.com>
2022-01-27 06:32:47 -08:00
a7df8bf168 Bump eslint-plugin-playwright from 0.7.1 to 0.8.0 (#4792)
Bumps [eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright) from 0.7.1 to 0.8.0.
- [Release notes](https://github.com/playwright-community/eslint-plugin-playwright/releases)
- [Commits](https://github.com/playwright-community/eslint-plugin-playwright/compare/v0.7.1...v0.8.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-playwright
  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-01-26 12:34:39 -08:00
ff269ac390 [Docs] Update PR Template warning (#4791)
* [Docs] Update PR Template warning
2022-01-26 19:55:55 +00:00
cdee5e8102 [CI] Update PR Template to remove the colon from Closes (#4785) 2022-01-26 11:34:07 -08:00
159457a52d [Build] Update minimum node12 version (#4779) 2022-01-25 14:06:15 -08:00
d637420da1 Mct4467 (#4468)
* dynamic grid display
* add one more guard
2022-01-25 12:56:51 -08:00
eb4da293c6 [CI]Update dependabot rules again (#4762)
* Update dependabot rules again

* update safeword

Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
2022-01-25 14:10:00 +00:00
738fac64b8 Bump vue-eslint-parser from 8.1.0 to 8.2.0 (#4770)
Bumps [vue-eslint-parser](https://github.com/vuejs/vue-eslint-parser) from 8.1.0 to 8.2.0.
- [Release notes](https://github.com/vuejs/vue-eslint-parser/releases)
- [Commits](https://github.com/vuejs/vue-eslint-parser/compare/v8.1.0...v8.2.0)

---
updated-dependencies:
- dependency-name: vue-eslint-parser
  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-01-24 15:57:30 -08:00
7703ec0a61 Bump vue-eslint-parser from 8.0.1 to 8.1.0 (#4761)
Bumps [vue-eslint-parser](https://github.com/vuejs/vue-eslint-parser) from 8.0.1 to 8.1.0.
- [Release notes](https://github.com/vuejs/vue-eslint-parser/releases)
- [Commits](https://github.com/vuejs/vue-eslint-parser/compare/v8.0.1...v8.1.0)

---
updated-dependencies:
- dependency-name: vue-eslint-parser
  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-01-21 13:36:26 -08:00
52466999b8 Prepare for sprint 1.8.5 (#4760) 2022-01-20 18:57:29 -08:00
27 changed files with 149 additions and 87 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.0-focal - image: mcr.microsoft.com/playwright:v1.18.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:

View File

@ -1,5 +1,5 @@
<!--- Note: Please open the PR in draft form until you are ready for active review. --> <!--- Note: Please open the PR in draft form until you are ready for active review. -->
Closes: <!--- Insert Issue Number(s) this PR addresses. Start by typing # will open a dropdown of recent issues. --> Closes <!--- Insert Issue Number(s) this PR addresses. Start by typing # will open a dropdown of recent issues. Note: this does not work on PRs which target release branches -->
### Describe your changes: ### Describe your changes:
<!--- Describe your changes and add any comments about your approach either here or inline if code comments aren't added --> <!--- Describe your changes and add any comments about your approach either here or inline if code comments aren't added -->

View File

@ -10,6 +10,7 @@ updates:
- "type:maintenance" - "type:maintenance"
- "dependencies" - "dependencies"
- "pr:e2e" - "pr:e2e"
- "pr:daveit"
allow: allow:
- dependency-name: "*eslint*" - dependency-name: "*eslint*"
- dependency-name: "*karma*" - dependency-name: "*karma*"
@ -25,4 +26,4 @@ updates:
labels: labels:
- "type:maintenance" - "type:maintenance"
- "dependencies" - "dependencies"
- "prcop:disable" - "pr:daveit"

View File

@ -15,8 +15,8 @@ jobs:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({
issue_number: context.issue.number, issue_number: context.issue.number,
owner: context.repo.owner, owner: "nasa",
repo: context.repo.repo, 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@v2
@ -37,8 +37,8 @@ jobs:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({
issue_number: context.issue.number, issue_number: context.issue.number,
owner: context.repo.owner, owner: "nasa",
repo: context.repo.repo, repo: "openmct",
body: 'Success ✅ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId body: 'Success ✅ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId
}) })
- name: Test failure - name: Test failure
@ -48,7 +48,7 @@ jobs:
script: | script: |
github.rest.issues.createComment({ github.rest.issues.createComment({
issue_number: context.issue.number, issue_number: context.issue.number,
owner: context.repo.owner, owner: "nasa",
repo: context.repo.repo, repo: "openmct",
body: 'Failure ❌ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId body: 'Failure ❌ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId
}) })

View File

@ -15,5 +15,5 @@
} }
} }
], ],
"disableWord": "prcop:disable" "disableWord": "pr:daveit"
} }

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,12 +1,12 @@
{ {
"name": "openmct", "name": "openmct",
"version": "1.8.4-SNAPSHOT", "version": "1.8.5-SNAPSHOT",
"description": "The Open MCT core platform", "description": "The Open MCT core platform",
"devDependencies": { "devDependencies": {
"@braintree/sanitize-url": "^5.0.2", "@braintree/sanitize-url": "^5.0.2",
"@percy/cli": "^1.0.0-beta.73", "@percy/cli": "^1.0.0-beta.73",
"@percy/playwright": "^1.0.1", "@percy/playwright": "^1.0.1",
"@playwright/test": "^1.18.0", "@playwright/test": "^1.18.1",
"allure-playwright": "^2.0.0-beta.14", "allure-playwright": "^2.0.0-beta.14",
"angular": ">=1.8.0", "angular": ">=1.8.0",
"angular-route": "1.4.14", "angular-route": "1.4.14",
@ -20,7 +20,7 @@
"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": "7.0.0",
"eslint-plugin-playwright": "0.7.1", "eslint-plugin-playwright": "0.8.0",
"eslint-plugin-vue": "^7.5.0", "eslint-plugin-vue": "^7.5.0",
"eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0", "eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0",
"eventemitter3": "^1.2.0", "eventemitter3": "^1.2.0",
@ -36,7 +36,7 @@
"istanbul-instrumenter-loader": "^3.0.1", "istanbul-instrumenter-loader": "^3.0.1",
"jasmine-core": "^4.0.0", "jasmine-core": "^4.0.0",
"jsdoc": "^3.3.2", "jsdoc": "^3.3.2",
"karma": "6.3.11", "karma": "6.3.13",
"karma-chrome-launcher": "3.1.0", "karma-chrome-launcher": "3.1.0",
"karma-cli": "2.0.0", "karma-cli": "2.0.0",
"karma-coverage": "2.1.0", "karma-coverage": "2.1.0",
@ -58,7 +58,7 @@
"moment-timezone": "0.5.28", "moment-timezone": "0.5.28",
"node-bourbon": "^4.2.3", "node-bourbon": "^4.2.3",
"painterro": "^1.2.56", "painterro": "^1.2.56",
"playwright": "^1.18.0", "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.2.1", "printj": "^1.2.1",
@ -73,7 +73,7 @@
"uuid": "^3.3.3", "uuid": "^3.3.3",
"v8-compile-cache": "^1.1.0", "v8-compile-cache": "^1.1.0",
"vue": "2.5.6", "vue": "2.5.6",
"vue-eslint-parser": "8.0.1", "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.5.6",
"webpack": "^5.65.0", "webpack": "^5.65.0",
@ -84,8 +84,8 @@
"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",
"clean-test-lint": "npm run clean; npm install ; npm run test; npm run lint", "clean-test-lint": "npm run clean; npm install; npm run test; npm run lint",
"start": "node app.js", "start": "node app.js",
"lint": "eslint platform example src --ext .js,.vue openmct.js", "lint": "eslint platform example src --ext .js,.vue openmct.js",
"lint:fix": "eslint platform example src --ext .js,.vue openmct.js --fix", "lint:fix": "eslint platform example src --ext .js,.vue openmct.js --fix",
@ -114,7 +114,7 @@
"url": "https://github.com/nasa/openmct.git" "url": "https://github.com/nasa/openmct.git"
}, },
"engines": { "engines": {
"node": ">=12.0.1 <15.0.0" "node": ">=12.20.1 <15.0.0"
}, },
"author": "", "author": "",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@ -65,6 +65,7 @@ export default {
data() { data() {
return { return {
hideOptions: true, hideOptions: true,
showFilteredOptions: false,
optionIndex: 0, optionIndex: 0,
field: this.model.value field: this.model.value
}; };
@ -72,16 +73,24 @@ export default {
computed: { computed: {
filteredOptions() { filteredOptions() {
const options = this.optionNames || []; const options = this.optionNames || [];
if (this.showFilteredOptions) {
return options
.filter(option => {
return option.toLowerCase().indexOf(this.field.toLowerCase()) >= 0;
}).map((option, index) => {
return {
optionId: index,
name: option
};
});
}
return options return options.map((option, index) => {
.filter(option => { return {
return option.toLowerCase().indexOf(this.field.toLowerCase()) >= 0; optionId: index,
}).map((option, index) => { name: option
return { };
optionId: index, });
name: option
};
});
} }
}, },
watch: { watch: {
@ -131,11 +140,12 @@ export default {
this.hideOptions = true; this.hideOptions = true;
this.field = string; this.field = string;
}, },
showOptions(string) { showOptions() {
this.hideOptions = false; this.hideOptions = false;
this.optionIndex = 0; this.optionIndex = 0;
}, },
keyDown($event) { keyDown($event) {
this.showFilteredOptions = true;
if (this.filteredOptions) { if (this.filteredOptions) {
let keyCode = $event.keyCode; let keyCode = $event.keyCode;
switch (keyCode) { switch (keyCode) {
@ -155,11 +165,14 @@ export default {
}, },
inputClicked() { inputClicked() {
this.autocompleteInputElement.select(); this.autocompleteInputElement.select();
this.showOptions(this.autocompleteInputElement.value); this.showOptions();
}, },
arrowClicked() { arrowClicked() {
// if the user clicked the arrow, we want
// to show them all the options
this.showFilteredOptions = false;
this.autocompleteInputElement.select(); this.autocompleteInputElement.select();
this.showOptions(''); this.showOptions();
}, },
optionMouseover(optionId) { optionMouseover(optionId) {
this.optionIndex = optionId; this.optionIndex = optionId;

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -209,18 +209,7 @@ export default {
}, },
layoutItems: { layoutItems: {
handler(value) { handler(value) {
let wMax = this.$el.clientWidth / this.gridSize[0]; this.updateGrid();
let hMax = this.$el.clientHeight / this.gridSize[1];
value.forEach(item => {
if (item.x + item.width > wMax) {
wMax = item.x + item.width + 2;
}
if (item.y + item.height > hMax) {
hMax = item.y + item.height + 2;
}
});
this.gridDimensions = [wMax * this.gridSize[0], hMax * this.gridSize[1]];
}, },
deep: true deep: true
} }
@ -233,6 +222,8 @@ export default {
this.composition.on('remove', this.removeChild); this.composition.on('remove', this.removeChild);
this.composition.load(); this.composition.load();
this.gridDimensions = [this.$el.offsetWidth, this.$el.scrollHeight]; this.gridDimensions = [this.$el.offsetWidth, this.$el.scrollHeight];
this.watchDisplayResize();
}, },
destroyed: function () { destroyed: function () {
this.openmct.selection.off('change', this.setSelection); this.openmct.selection.off('change', this.setSelection);
@ -240,6 +231,25 @@ export default {
this.composition.off('remove', this.removeChild); this.composition.off('remove', this.removeChild);
}, },
methods: { methods: {
updateGrid() {
let wMax = this.$el.clientWidth / this.gridSize[0];
let hMax = this.$el.clientHeight / this.gridSize[1];
this.layoutItems.forEach(item => {
if (item.x + item.width > wMax) {
wMax = item.x + item.width + 2;
}
if (item.y + item.height > hMax) {
hMax = item.y + item.height + 2;
}
});
this.gridDimensions = [wMax * this.gridSize[0], hMax * this.gridSize[1]];
},
watchDisplayResize() {
const resizeObserver = new ResizeObserver(() => this.updateGrid());
resizeObserver.observe(this.$el);
},
addElement(itemType, element) { addElement(itemType, element) {
this.addItem(itemType + '-view', element); this.addItem(itemType + '-view', element);
}, },
@ -404,8 +414,12 @@ export default {
} }
}, },
containsObject(identifier) { containsObject(identifier) {
return _.get(this.domainObject, 'composition') if ('composition' in this.domainObject) {
.some(childId => this.openmct.objects.areIdsEqual(childId, identifier)); return this.domainObject.composition
.some(childId => this.openmct.objects.areIdsEqual(childId, identifier));
}
return false;
}, },
handleDragOver($event) { handleDragOver($event) {
if (this.domainObject.locked) { if (this.domainObject.locked) {
@ -494,7 +508,7 @@ export default {
} }
}, },
removeFromComposition(keyString) { removeFromComposition(keyString) {
let composition = _.get(this.domainObject, 'composition'); let composition = this.domainObject.composition ? this.domainObject.composition : [];
composition = composition.filter(identifier => { composition = composition.filter(identifier => {
return this.openmct.objects.makeKeyString(identifier) !== keyString; return this.openmct.objects.makeKeyString(identifier) !== keyString;
}); });

View File

@ -97,7 +97,14 @@ export default {
}, },
mounted() { mounted() {
if (this.frame.domainObjectIdentifier) { if (this.frame.domainObjectIdentifier) {
this.openmct.objects.get(this.frame.domainObjectIdentifier).then((object) => { let domainObjectPromise;
if (this.openmct.objects.supportsMutation(this.frame.domainObjectIdentifier)) {
domainObjectPromise = this.openmct.objects.getMutable(this.frame.domainObjectIdentifier);
} else {
domainObjectPromise = this.openmct.objects.get(this.frame.domainObjectIdentifier);
}
domainObjectPromise.then((object) => {
this.setDomainObject(object); this.setDomainObject(object);
}); });
} }
@ -105,6 +112,10 @@ export default {
this.dragGhost = document.getElementById('js-fl-drag-ghost'); this.dragGhost = document.getElementById('js-fl-drag-ghost');
}, },
beforeDestroy() { beforeDestroy() {
if (this.domainObject.isMutable) {
this.openmct.objects.destroyMutable(this.domainObject);
}
if (this.unsubscribeSelection) { if (this.unsubscribeSelection) {
this.unsubscribeSelection(); this.unsubscribeSelection();
} }

View File

@ -702,12 +702,15 @@ export default {
focusedIndex = matchIndex > -1 ? matchIndex : this.imageHistory.length - 1; focusedIndex = matchIndex > -1 ? matchIndex : this.imageHistory.length - 1;
} }
if (!(this.isPaused || thumbnailClick) const isLastImageFocused = focusedIndex === this.imageHistory.length - 1;
|| focusedIndex === this.imageHistory.length - 1) { if (!(this.isPaused || thumbnailClick) && isLastImageFocused) {
delete this.previousFocusedImage; delete this.previousFocusedImage;
} }
} }
console.log('old index', this.focusedImageIndex);
console.log('new index', focusedIndex);
this.focusedImageIndex = focusedIndex; this.focusedImageIndex = focusedIndex;
//TODO: do we even need this anymore? //TODO: do we even need this anymore?
@ -715,6 +718,9 @@ export default {
this.nextImageIndex = focusedIndex; this.nextImageIndex = focusedIndex;
//this could happen if bounds changes //this could happen if bounds changes
if (this.focusedImageIndex > this.imageHistory.length - 1) { if (this.focusedImageIndex > this.imageHistory.length - 1) {
console.log('why this?');
console.log('old index', this.focusedImageIndex);
console.log('new index', focusedIndex);
this.focusedImageIndex = focusedIndex; this.focusedImageIndex = focusedIndex;
} }

View File

@ -632,7 +632,8 @@ export default {
updateDefaultNotebook(updatedNotebookStorageObject) { updateDefaultNotebook(updatedNotebookStorageObject) {
if (!this.isDefaultNotebook()) { if (!this.isDefaultNotebook()) {
const persistedNotebookStorageObject = getDefaultNotebook(); const persistedNotebookStorageObject = getDefaultNotebook();
if (persistedNotebookStorageObject.identifier !== undefined) { if (persistedNotebookStorageObject
&& persistedNotebookStorageObject.identifier !== undefined) {
this.removeDefaultClass(persistedNotebookStorageObject.identifier); this.removeDefaultClass(persistedNotebookStorageObject.identifier);
} }

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -278,7 +278,7 @@ export default {
// Have to throw away the old canvas elements and replace with new // Have to throw away the old canvas elements and replace with new
// canvas elements in order to get new drawing contexts. // canvas elements in order to get new drawing contexts.
const div = document.createElement('div'); const div = document.createElement('div');
div.innerHTML = this.TEMPLATE; div.innerHTML = this.canvasTemplate + this.canvasTemplate;
const mainCanvas = div.querySelectorAll("canvas")[1]; const mainCanvas = div.querySelectorAll("canvas")[1];
const overlayCanvas = div.querySelectorAll("canvas")[0]; const overlayCanvas = div.querySelectorAll("canvas")[0];
this.canvas.parentNode.replaceChild(mainCanvas, this.canvas); this.canvas.parentNode.replaceChild(mainCanvas, this.canvas);

View File

@ -95,6 +95,11 @@ export default {
isUTCBased: timeSystem.isUTCBased isUTCBased: timeSystem.isUTCBased
}; };
}, },
watch: {
keyString() {
this.setTimeContext();
}
},
mounted() { mounted() {
this.handleNewBounds = _.throttle(this.handleNewBounds, 300); this.handleNewBounds = _.throttle(this.handleNewBounds, 300);
this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.timeSystem()))); this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.timeSystem())));

View File

@ -115,6 +115,11 @@ export default {
isUTCBased: timeSystem.isUTCBased isUTCBased: timeSystem.isUTCBased
}; };
}, },
watch: {
keyString() {
this.setTimeContext();
}
},
mounted() { mounted() {
this.handleNewBounds = _.throttle(this.handleNewBounds, 300); this.handleNewBounds = _.throttle(this.handleNewBounds, 300);
this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.timeSystem()))); this.setTimeSystem(JSON.parse(JSON.stringify(this.openmct.time.timeSystem())));

View File

@ -105,42 +105,49 @@ export default {
watch: { watch: {
domainObject: { domainObject: {
handler(domainObject) { handler(domainObject) {
this.independentTCEnabled = domainObject.configuration.useIndependentTime === true; const key = this.openmct.objects.makeKeyString(domainObject.identifier);
if (key !== this.keyString) {
if (!domainObject.configuration.timeOptions || !this.independentTCEnabled) { //domain object has changed
this.destroyIndependentTime(); this.destroyIndependentTime();
return; this.independentTCEnabled = domainObject.configuration.useIndependentTime === true;
} this.timeOptions = domainObject.configuration.timeOptions || {
clockOffsets: this.openmct.time.clockOffsets(),
fixedOffsets: this.openmct.time.bounds()
};
if (this.timeOptions.start !== domainObject.configuration.timeOptions.start this.initialize();
|| this.timeOptions.end !== domainObject.configuration.timeOptions.end) {
this.timeOptions = domainObject.configuration.timeOptions;
this.destroyIndependentTime();
this.registerIndependentTimeOffsets();
} }
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
this.setTimeContext(); this.initialize();
if (this.timeOptions.mode) {
this.mode = this.timeOptions.mode;
} else {
this.timeOptions.mode = this.mode = this.timeContext.clock() === undefined ? { key: 'fixed' } : { key: Object.create(this.timeContext.clock()).key};
}
if (this.independentTCEnabled) {
this.registerIndependentTimeOffsets();
}
}, },
beforeDestroy() { beforeDestroy() {
this.stopFollowingTimeContext(); this.stopFollowingTimeContext();
this.destroyIndependentTime(); this.destroyIndependentTime();
}, },
methods: { methods: {
initialize() {
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
this.setTimeContext();
if (this.timeOptions.mode) {
this.mode = this.timeOptions.mode;
} else {
if (this.timeContext.clock() === undefined) {
this.timeOptions.mode = this.mode = { key: 'fixed' };
} else {
this.timeOptions.mode = this.mode = { key: Object.create(this.timeContext.clock()).key};
}
}
if (this.independentTCEnabled) {
this.registerIndependentTimeOffsets();
}
},
toggleIndependentTC() { toggleIndependentTC() {
this.independentTCEnabled = !this.independentTCEnabled; this.independentTCEnabled = !this.independentTCEnabled;
if (this.independentTCEnabled) { if (this.independentTCEnabled) {
@ -213,10 +220,9 @@ export default {
offsets = this.timeOptions.clockOffsets; offsets = this.timeOptions.clockOffsets;
} }
const key = this.openmct.objects.makeKeyString(this.domainObject.identifier); const timeContext = this.openmct.time.getIndependentContext(this.keyString);
const timeContext = this.openmct.time.getIndependentContext(key);
if (!timeContext.hasOwnContext()) { if (!timeContext.hasOwnContext()) {
this.unregisterIndependentTime = this.openmct.time.addIndependentContext(key, offsets, this.isFixed ? undefined : this.mode.key); this.unregisterIndependentTime = this.openmct.time.addIndependentContext(this.keyString, offsets, this.isFixed ? undefined : this.mode.key);
} else { } else {
if (this.isFixed) { if (this.isFixed) {
timeContext.stopClock(); timeContext.stopClock();

View File

@ -1,5 +1,5 @@
<!-- <!--
Open MCT, Copyright (c) 2014-2021, United States Government Open MCT, Copyright (c) 2014-2022, United States Government
as represented by the Administrator of the National Aeronautics and Space as represented by the Administrator of the National Aeronautics and Space
Administration. All rights reserved. Administration. All rights reserved.

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *

View File

@ -1,5 +1,5 @@
/***************************************************************************** /*****************************************************************************
* Open MCT, Copyright (c) 2014-2021, United States Government * Open MCT, Copyright (c) 2014-2022, United States Government
* as represented by the Administrator of the National Aeronautics and Space * as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved. * Administration. All rights reserved.
* *