From cbb3f32d1eba6f39a58c41ce48917b6e251d3a00 Mon Sep 17 00:00:00 2001 From: Shefali Joshi Date: Tue, 29 Jun 2021 09:40:30 -0700 Subject: [PATCH] 1.7.4 into master (#3985) catching any errors from a user canceling from dialog (#3968) Fix navigation errors (#3970) Only add listeners to observables on creation Do not double destroy mutable objects Disallow pause and play in time strip view for plots. (#3972) Update version Co-authored-by: Jamie V Co-authored-by: Andrew Henry --- package.json | 2 +- src/api/objects/ObjectAPI.js | 34 ++++++++++++------------ src/plugins/duplicate/DuplicateAction.js | 10 ++++++- src/plugins/plot/MctPlot.vue | 2 +- src/ui/router/Browse.js | 19 ++----------- 5 files changed, 30 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 7907d3ae25..4f89c064d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openmct", - "version": "1.7.4-SNAPSHOT", + "version": "1.7.4", "description": "The Open MCT core platform", "dependencies": {}, "devDependencies": { diff --git a/src/api/objects/ObjectAPI.js b/src/api/objects/ObjectAPI.js index a9a6eca150..e3c20ee104 100644 --- a/src/api/objects/ObjectAPI.js +++ b/src/api/objects/ObjectAPI.js @@ -399,25 +399,25 @@ ObjectAPI.prototype._toMutable = function (object) { mutableObject = object; } else { mutableObject = MutableDomainObject.createMutable(object, this.eventEmitter); - } - // Check if provider supports realtime updates - let identifier = utils.parseKeyString(mutableObject.identifier); - let provider = this.getProvider(identifier); + // Check if provider supports realtime updates + let identifier = utils.parseKeyString(mutableObject.identifier); + let provider = this.getProvider(identifier); - if (provider !== undefined - && provider.observe !== undefined - && this.SYNCHRONIZED_OBJECT_TYPES.includes(object.type)) { - let unobserve = provider.observe(identifier, (updatedModel) => { - if (updatedModel.persisted > mutableObject.modified) { - //Don't replace with a stale model. This can happen on slow connections when multiple mutations happen - //in rapid succession and intermediate persistence states are returned by the observe function. - mutableObject.$refresh(updatedModel); - } - }); - mutableObject.$on('$_destroy', () => { - unobserve(); - }); + if (provider !== undefined + && provider.observe !== undefined + && this.SYNCHRONIZED_OBJECT_TYPES.includes(object.type)) { + let unobserve = provider.observe(identifier, (updatedModel) => { + if (updatedModel.persisted > mutableObject.modified) { + //Don't replace with a stale model. This can happen on slow connections when multiple mutations happen + //in rapid succession and intermediate persistence states are returned by the observe function. + mutableObject.$refresh(updatedModel); + } + }); + mutableObject.$on('$_destroy', () => { + unobserve(); + }); + } } return mutableObject; diff --git a/src/plugins/duplicate/DuplicateAction.js b/src/plugins/duplicate/DuplicateAction.js index daf44862b6..6e9d2875bb 100644 --- a/src/plugins/duplicate/DuplicateAction.js +++ b/src/plugins/duplicate/DuplicateAction.js @@ -37,7 +37,15 @@ export default class DuplicateAction { let duplicationTask = new DuplicateTask(this.openmct); let originalObject = objectPath[0]; let parent = objectPath[1]; - let userInput = await this.getUserInput(originalObject, parent); + let userInput; + + try { + userInput = await this.getUserInput(originalObject, parent); + } catch (error) { + // user most likely canceled + return; + } + let newParent = userInput.location; let inNavigationPath = this.inNavigationPath(originalObject); diff --git a/src/plugins/plot/MctPlot.vue b/src/plugins/plot/MctPlot.vue index f66b922f55..beb016377b 100644 --- a/src/plugins/plot/MctPlot.vue +++ b/src/plugins/plot/MctPlot.vue @@ -102,7 +102,7 @@ > -