mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 13:18:15 +00:00
* Added NotebookMenuSwitcher in preview header * Use preview component inside viewLargeAction * Added autoHide flag to overlay API that allows developers to specify whether an overlay should remain visible if other overlays are subsequently triggered (eg. the snapshot overlay) * When in edit mode, disable navigation link to notebook entry. Co-authored-by: Andrew Henry <akhenry@gmail.com>
32 lines
1.2 KiB
JavaScript
32 lines
1.2 KiB
JavaScript
import { getDefaultNotebook, getNotebookSectionAndPage } from './notebook-storage';
|
|
|
|
export async function getMenuItems(openmct, menuItemOptions) {
|
|
const notebookTypes = [];
|
|
|
|
const defaultNotebook = getDefaultNotebook();
|
|
const defaultNotebookObject = defaultNotebook && await openmct.objects.get(defaultNotebook.identifier);
|
|
if (defaultNotebookObject) {
|
|
const { section, page } = getNotebookSectionAndPage(defaultNotebookObject, defaultNotebook.defaultSectionId, defaultNotebook.defaultPageId);
|
|
if (section && page) {
|
|
const name = defaultNotebookObject.name;
|
|
const sectionName = section.name;
|
|
const pageName = page.name;
|
|
const defaultPath = `${name} - ${sectionName} - ${pageName}`;
|
|
|
|
notebookTypes.push({
|
|
cssClass: menuItemOptions.default.cssClass,
|
|
name: `${menuItemOptions.default.name} ${defaultPath}`,
|
|
onItemClicked: menuItemOptions.default.onItemClicked
|
|
});
|
|
}
|
|
}
|
|
|
|
notebookTypes.push({
|
|
cssClass: menuItemOptions.snapshot.cssClass,
|
|
name: menuItemOptions.snapshot.name,
|
|
onItemClicked: menuItemOptions.snapshot.onItemClicked
|
|
});
|
|
|
|
return notebookTypes;
|
|
}
|