mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 01:42:31 +00:00
[Notebook] Fix link formatting on load, remove duplicate snapshot indicator (#6317)
* adding urlWhitelist to data so when/if it is updated it triggers link formatting * removing dupe notebook and restricted notebook checks and just moving it to base notebook functionality install checks * nullthing to see here
This commit is contained in:
parent
672cb7e621
commit
e3a69c8856
@ -235,7 +235,8 @@ export default {
|
||||
return {
|
||||
editMode: false,
|
||||
canEdit: true,
|
||||
enableEmbedsWrapperScroll: false
|
||||
enableEmbedsWrapperScroll: false,
|
||||
urlWhitelist: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -6,8 +6,7 @@ export const NOTEBOOK_DEFAULT = 'DEFAULT';
|
||||
export const NOTEBOOK_SNAPSHOT = 'SNAPSHOT';
|
||||
export const NOTEBOOK_VIEW_TYPE = 'notebook-vue';
|
||||
export const RESTRICTED_NOTEBOOK_VIEW_TYPE = 'restricted-notebook-vue';
|
||||
export const NOTEBOOK_INSTALLED_KEY = '_NOTEBOOK_PLUGIN_INSTALLED';
|
||||
export const RESTRICTED_NOTEBOOK_INSTALLED_KEY = '_RESTRICTED_NOTEBOOK_PLUGIN_INSTALLED';
|
||||
export const NOTEBOOK_BASE_INSTALLED = '_NOTEBOOK_BASE_FUNCTIONALITY_INSTALLED';
|
||||
|
||||
// these only deals with constants, figured this could skip going into a utils file
|
||||
export function isNotebookOrAnnotationType(domainObject) {
|
||||
|
@ -33,8 +33,7 @@ import {
|
||||
RESTRICTED_NOTEBOOK_TYPE,
|
||||
NOTEBOOK_VIEW_TYPE,
|
||||
RESTRICTED_NOTEBOOK_VIEW_TYPE,
|
||||
NOTEBOOK_INSTALLED_KEY,
|
||||
RESTRICTED_NOTEBOOK_INSTALLED_KEY
|
||||
NOTEBOOK_BASE_INSTALLED
|
||||
} from './notebook-constants';
|
||||
|
||||
import Vue from 'vue';
|
||||
@ -63,7 +62,7 @@ function addLegacyNotebookGetInterceptor(openmct) {
|
||||
|
||||
function installBaseNotebookFunctionality(openmct) {
|
||||
// only need to do this once
|
||||
if (openmct[NOTEBOOK_INSTALLED_KEY] || openmct[RESTRICTED_NOTEBOOK_INSTALLED_KEY]) {
|
||||
if (openmct[NOTEBOOK_BASE_INSTALLED]) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -101,6 +100,8 @@ function installBaseNotebookFunctionality(openmct) {
|
||||
openmct.indicators.add(indicator);
|
||||
|
||||
monkeyPatchObjectAPIForNotebooks(openmct);
|
||||
|
||||
openmct[NOTEBOOK_BASE_INSTALLED] = true;
|
||||
}
|
||||
|
||||
function NotebookPlugin(name = 'Notebook', entryUrlWhitelist = []) {
|
||||
@ -123,10 +124,6 @@ function NotebookPlugin(name = 'Notebook', entryUrlWhitelist = []) {
|
||||
|
||||
function RestrictedNotebookPlugin(name = 'Notebook Shift Log', entryUrlWhitelist = []) {
|
||||
return function install(openmct) {
|
||||
if (openmct[RESTRICTED_NOTEBOOK_INSTALLED_KEY]) {
|
||||
return;
|
||||
}
|
||||
|
||||
const icon = 'icon-notebook-shift-log';
|
||||
const description = 'Create and save timestamped notes with embedded object snapshots with the ability to commit and lock pages.';
|
||||
const snapshotContainer = getSnapshotContainer(openmct);
|
||||
@ -138,8 +135,6 @@ function RestrictedNotebookPlugin(name = 'Notebook Shift Log', entryUrlWhitelist
|
||||
openmct.objectViews.addProvider(notebookView, entryUrlWhitelist);
|
||||
|
||||
installBaseNotebookFunctionality(openmct);
|
||||
|
||||
openmct[RESTRICTED_NOTEBOOK_INSTALLED_KEY] = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user