diff --git a/src/plugins/CouchDBSearchFolder/plugin.js b/src/plugins/CouchDBSearchFolder/plugin.js index 002daf8d11..49a228da29 100644 --- a/src/plugins/CouchDBSearchFolder/plugin.js +++ b/src/plugins/CouchDBSearchFolder/plugin.js @@ -1,15 +1,16 @@ export default function (folderName, couchPlugin, searchFilter) { return function install(openmct) { const couchProvider = couchPlugin.couchProvider; + const couchSearchName = `couch-search-${folderName || 'CouchDB Documents'}`; 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({ @@ -25,8 +26,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..32f57f1683 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;