Compare commits

...

8 Commits

Author SHA1 Message Date
b86932ad9c Remove console logs 2023-06-29 12:37:35 -07:00
26cbd1b986 Use unique uuids 2023-06-29 12:36:59 -07:00
35e6f6b950 Fix typo 2023-06-29 10:58:13 -07:00
e711768066 Add debug statements 2023-06-29 10:41:16 -07:00
52ce012251 Adds parsed string for couch search folder name 2023-06-29 09:52:15 -07:00
f6a8d4e265 Adding debugging comments 2023-06-29 09:30:09 -07:00
d02638655a Test ttt-report 2023-06-29 08:25:42 -07:00
99f0f30be5 Make couch search folders unique roots 2023-06-29 07:57:08 -07:00
3 changed files with 13 additions and 9 deletions

View File

@ -1,15 +1,19 @@
import { v4 as uuid } from 'uuid';
export default function (folderName, couchPlugin, searchFilter) {
return function install(openmct) {
const couchProvider = couchPlugin.couchProvider;
const couchSearchId = uuid();
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({
@ -25,8 +29,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() {

View File

@ -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;

View File

@ -29,7 +29,7 @@ export default function WebPage(openmct) {
name: 'Web Page',
cssClass: 'icon-page',
canView: function (domainObject) {
return domainObject.type === 'webPage';
return domainObject.type === 'webPage' || domainObject.type === 'ttt-report';
},
view: function (domainObject) {
let component;