[Notebook] Clicking new entry does not work as expected #3423 (#3434)

* [Notebook] Clicking new entry does not work as expected #3423

Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
Nikhil
2020-10-08 16:56:37 -07:00
committed by GitHub
parent b6e0208e71
commit b637307de6
3 changed files with 25 additions and 18 deletions

View File

@ -1,5 +1,6 @@
import objectLink from '../../../ui/mixins/object-link';
export const DEFAULT_CLASS = 'is-notebook-default';
const TIME_BOUNDS = {
START_BOUND: 'tc.startBound',
END_BOUND: 'tc.endBound',
@ -128,6 +129,7 @@ export function addNotebookEntry(openmct, domainObject, notebookStorage, embed =
embeds
});
addDefaultClass(domainObject);
openmct.objects.mutate(domainObject, 'configuration.entries', entries);
return id;
@ -193,5 +195,15 @@ export function deleteNotebookEntries(openmct, domainObject, selectedSection, se
}
delete entries[selectedSection.id][selectedPage.id];
openmct.objects.mutate(domainObject, 'configuration.entries', entries);
}
function addDefaultClass(domainObject) {
const classList = domainObject.classList || [];
if (classList.includes(DEFAULT_CLASS)) {
return;
}
classList.push(DEFAULT_CLASS);
}