mirror of
https://github.com/nasa/openmct.git
synced 2025-05-08 03:28:33 +00:00
Cancel editing bug (#2355)
* WIP * Refresh view with object from persistence
This commit is contained in:
parent
baf410a364
commit
964c326535
@ -79,9 +79,11 @@ export default class Editor extends EventEmitter {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
cancel() {
|
cancel() {
|
||||||
this.getTransactionService().cancel();
|
let cancelPromise = this.getTransactionService().cancel();
|
||||||
this.editing = false;
|
this.editing = false;
|
||||||
this.emit('isEditing', false);
|
this.emit('isEditing', false);
|
||||||
|
|
||||||
|
return cancelPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -119,7 +119,10 @@ const PLACEHOLDER_OBJECT = {};
|
|||||||
label: 'Ok',
|
label: 'Ok',
|
||||||
emphasis: true,
|
emphasis: true,
|
||||||
callback: () => {
|
callback: () => {
|
||||||
this.openmct.editor.cancel();
|
this.openmct.editor.cancel().then(() => {
|
||||||
|
//refresh object view
|
||||||
|
this.openmct.layout.$refs.browseObject.show(this.domainObject, this.viewKey, false);
|
||||||
|
});
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -228,7 +231,20 @@ const PLACEHOLDER_OBJECT = {};
|
|||||||
this.isEditing = isEditing;
|
this.isEditing = isEditing;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
domainObject() {
|
||||||
|
if (this.mutationObserver) {
|
||||||
|
this.mutationObserver();
|
||||||
|
}
|
||||||
|
this.mutationObserver = this.openmct.objects.observe(this.domainObject, '*', (domainObject) => {
|
||||||
|
this.domainObject = domainObject;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
beforeDestroy: function () {
|
beforeDestroy: function () {
|
||||||
|
if (this.mutationObserver) {
|
||||||
|
this.mutationObserver();
|
||||||
|
}
|
||||||
document.removeEventListener('click', this.closeViewAndSaveMenu);
|
document.removeEventListener('click', this.closeViewAndSaveMenu);
|
||||||
window.removeEventListener('click', this.promptUserbeforeNavigatingAway);
|
window.removeEventListener('click', this.promptUserbeforeNavigatingAway);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user