[Notebook] Do not persist notebook objects in notebook Local Storage (#3295)

* [Notebook] Do not persist domain objects on notebooks or snapshots #3291
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
This commit is contained in:
Nikhil
2021-01-06 15:30:57 -08:00
committed by GitHub
parent b0fa955914
commit 23aba14dfe
5 changed files with 47 additions and 49 deletions

View File

@ -225,14 +225,12 @@ export default {
},
createNotebookStorageObject() {
const notebookMeta = {
name: this.internalDomainObject.name,
identifier: this.internalDomainObject.identifier
};
const page = this.getSelectedPage();
const section = this.getSelectedSection();
return {
domainObject: this.internalDomainObject,
notebookMeta,
section,
page
@ -442,10 +440,10 @@ export default {
async updateDefaultNotebook(notebookStorage) {
const defaultNotebookObject = await this.getDefaultNotebookObject();
if (!defaultNotebookObject) {
setDefaultNotebook(this.openmct, notebookStorage);
setDefaultNotebook(this.openmct, notebookStorage, this.internalDomainObject);
} else if (objectUtils.makeKeyString(defaultNotebookObject.identifier) !== objectUtils.makeKeyString(notebookStorage.notebookMeta.identifier)) {
this.removeDefaultClass(defaultNotebookObject);
setDefaultNotebook(this.openmct, notebookStorage);
setDefaultNotebook(this.openmct, notebookStorage, this.internalDomainObject);
}
if (this.defaultSectionId && this.defaultSectionId.length === 0 || this.defaultSectionId !== notebookStorage.section.id) {