diff --git a/src/plugins/CouchDBSearchFolder/plugin.js b/src/plugins/CouchDBSearchFolder/plugin.js index 002daf8d11..aa0bad48ed 100644 --- a/src/plugins/CouchDBSearchFolder/plugin.js +++ b/src/plugins/CouchDBSearchFolder/plugin.js @@ -1,21 +1,26 @@ export default function (folderName, couchPlugin, searchFilter) { + const DEFAULT_NAME = 'CouchDB Documents'; + return function install(openmct) { const couchProvider = couchPlugin.couchProvider; + //replace any non-letter/non-number with a hyphen + const couchSearchId = (folderName || DEFAULT_NAME).replace(/[^a-zA-Z0-9]/g, '-'); + const couchSearchName = `couch-search-${couchSearchId}`; openmct.objects.addRoot({ - namespace: 'couch-search', - key: 'couch-search' + namespace: couchSearchName, + key: couchSearchName }); - openmct.objects.addProvider('couch-search', { + openmct.objects.addProvider(couchSearchName, { get(identifier) { - if (identifier.key !== 'couch-search') { + if (identifier.key !== couchSearchName) { return undefined; } else { return Promise.resolve({ identifier, type: 'folder', - name: folderName || 'CouchDB Documents', + name: folderName || DEFAULT_NAME, location: 'ROOT' }); } @@ -25,8 +30,8 @@ export default function (folderName, couchPlugin, searchFilter) { openmct.composition.addProvider({ appliesTo(domainObject) { return ( - domainObject.identifier.namespace === 'couch-search' && - domainObject.identifier.key === 'couch-search' + domainObject.identifier.namespace === couchSearchName && + domainObject.identifier.key === couchSearchName ); }, load() { diff --git a/src/plugins/CouchDBSearchFolder/pluginSpec.js b/src/plugins/CouchDBSearchFolder/pluginSpec.js index 4f702ae2a5..7dae5bfd0f 100644 --- a/src/plugins/CouchDBSearchFolder/pluginSpec.js +++ b/src/plugins/CouchDBSearchFolder/pluginSpec.js @@ -25,8 +25,8 @@ import CouchDBSearchFolderPlugin from './plugin'; describe('the plugin', function () { let identifier = { - namespace: 'couch-search', - key: 'couch-search' + namespace: 'couch-search-CouchDB-Documents', + key: 'couch-search-CouchDB-Documents' }; let testPath = '/test/db'; let openmct; diff --git a/src/plugins/viewLargeAction/viewLargeAction.js b/src/plugins/viewLargeAction/viewLargeAction.js index 30f6e647db..5b07376d81 100644 --- a/src/plugins/viewLargeAction/viewLargeAction.js +++ b/src/plugins/viewLargeAction/viewLargeAction.js @@ -54,7 +54,7 @@ export default class ViewLargeAction { return ( childElement && - !childElement.classList.contains('js-main-container') && + !childElement?.classList.contains('js-main-container') && !this.openmct.router.isNavigatedObject(objectPath) ); } diff --git a/src/ui/components/components.js b/src/ui/components/components.js index 998919c711..0ffc2b8c01 100644 --- a/src/ui/components/components.js +++ b/src/ui/components/components.js @@ -23,9 +23,11 @@ import ObjectView from './ObjectView.vue'; import StackedPlot from '../../plugins/plot/stackedPlot/StackedPlot.vue'; import Plot from '../../plugins/plot/Plot.vue'; +import WebPage from '../../plugins/webPage/components/WebPage.vue'; export default { ObjectView, StackedPlot, - Plot + Plot, + WebPage };