50463: use search/facet endpoint to retrieve facet values

This commit is contained in:
Lotte Hofstede
2018-03-20 11:39:51 +01:00
parent 3f36e0371e
commit cdf1dc402a
18 changed files with 236 additions and 97 deletions

View File

@@ -12,7 +12,7 @@ import { BrowseDefinition } from '../shared/browse-definition.model';
import { HALEndpointService } from '../shared/hal-endpoint.service';
@Injectable()
export class BrowseService extends HALEndpointService {
export class BrowseService {
protected linkPath = 'browses';
private static toSearchKeyArray(metadatumKey: string): string[] {
@@ -31,13 +31,12 @@ export class BrowseService extends HALEndpointService {
constructor(
protected responseCache: ResponseCacheService,
protected requestService: RequestService,
@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig) {
super();
protected halService: HALEndpointService) {
}
getBrowseURLFor(metadatumKey: string, linkPath: string): Observable<string> {
const searchKeyArray = BrowseService.toSearchKeyArray(metadatumKey);
return this.getEndpoint()
return this.halService.getEndpoint(linkPath)
.filter((href: string) => isNotEmpty(href))
.distinctUntilChanged()
.map((endpointURL: string) => new BrowseEndpointRequest(this.requestService.generateRequestId(), endpointURL))