mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 13:48:12 +00:00
View Large overlay doesn't allow taking Snapshots (#4091)
* 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>
This commit is contained in:
31
src/plugins/notebook/utils/notebook-snapshot-menu.js
Normal file
31
src/plugins/notebook/utils/notebook-snapshot-menu.js
Normal file
@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user