diff --git a/src/app/core/browse/browse-definition-data.service.ts b/src/app/core/browse/browse-definition-data.service.ts index 3ffc821b79..e4d3718806 100644 --- a/src/app/core/browse/browse-definition-data.service.ts +++ b/src/app/core/browse/browse-definition-data.service.ts @@ -16,7 +16,6 @@ import { dataService } from '../data/base/data-service.decorator'; import { getPaginatedListPayload, getRemoteDataPayload } from '../shared/operators'; import { RequestParam } from '../cache/models/request-param.model'; import { SearchData, SearchDataImpl } from '../data/base/search-data'; -import { BrowseService } from './browse.service'; import { distinctUntilChanged, map, startWith } from 'rxjs/operators'; import { isEmpty, isNotEmpty } from '../../shared/empty.util'; @@ -31,6 +30,19 @@ export class BrowseDefinitionDataService extends IdentifiableDataService; private searchData: SearchDataImpl; + public static toSearchKeyArray(metadataKey: string): string[] { + const keyParts = metadataKey.split('.'); + const searchFor = []; + searchFor.push('*'); + for (let i = 0; i < keyParts.length - 1; i++) { + const prevParts = keyParts.slice(0, i + 1); + const nextPart = [...prevParts, '*'].join('.'); + searchFor.push(nextPart); + } + searchFor.push(metadataKey); + return searchFor; + } + constructor( protected requestService: RequestService, protected rdbService: RemoteDataBuildService, @@ -122,7 +134,7 @@ export class BrowseDefinitionDataService extends IdentifiableDataService { let searchKeyArray: string[] = []; metadataKeys.forEach((metadataKey) => { - searchKeyArray = searchKeyArray.concat(BrowseService.toSearchKeyArray(metadataKey)); + searchKeyArray = searchKeyArray.concat(BrowseDefinitionDataService.toSearchKeyArray(metadataKey)); }); return this.findAll().pipe( getRemoteDataPayload(), diff --git a/src/app/core/browse/browse.service.ts b/src/app/core/browse/browse.service.ts index e17cc5e830..280e8e6f5a 100644 --- a/src/app/core/browse/browse.service.ts +++ b/src/app/core/browse/browse.service.ts @@ -19,9 +19,9 @@ import { } from '../shared/operators'; import { URLCombiner } from '../url-combiner/url-combiner'; import { BrowseEntrySearchOptions } from './browse-entry-search-options.model'; -import { BrowseDefinitionDataService } from './browse-definition-data.service'; import { HrefOnlyDataService } from '../data/href-only-data.service'; import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model'; +import { BrowseDefinitionDataService } from './browse-definition-data.service'; export const BROWSE_LINKS_TO_FOLLOW: FollowLinkConfig[] = [