Merge branch 'master' into w2p-60168_Alphabetic-browse-widget

Conflicts:
	src/app/core/browse/browse.service.ts
	src/app/shared/shared.module.ts
This commit is contained in:
Kristof De Langhe
2019-02-22 09:02:46 +01:00
116 changed files with 3815 additions and 967 deletions

View File

@@ -41,8 +41,8 @@ import { RequestEntry } from '../data/request.reducer';
export class BrowseService {
protected linkPath = 'browses';
private static toSearchKeyArray(metadatumKey: string): string[] {
const keyParts = metadatumKey.split('.');
private static toSearchKeyArray(metadataKey: string): string[] {
const keyParts = metadataKey.split('.');
const searchFor = [];
searchFor.push('*');
for (let i = 0; i < keyParts.length - 1; i++) {
@@ -50,7 +50,7 @@ export class BrowseService {
const nextPart = [...prevParts, '*'].join('.');
searchFor.push(nextPart);
}
searchFor.push(metadatumKey);
searchFor.push(metadataKey);
return searchFor;
}
@@ -233,8 +233,8 @@ export class BrowseService {
* @param metadatumKey
* @param linkPath
*/
getBrowseURLFor(metadatumKey: string, linkPath: string): Observable<string> {
const searchKeyArray = BrowseService.toSearchKeyArray(metadatumKey);
getBrowseURLFor(metadataKey: string, linkPath: string): Observable<string> {
const searchKeyArray = BrowseService.toSearchKeyArray(metadataKey);
return this.getBrowseDefinitions().pipe(
getRemoteDataPayload(),
map((browseDefinitions: BrowseDefinition[]) => browseDefinitions
@@ -245,7 +245,7 @@ export class BrowseService {
),
map((def: BrowseDefinition) => {
if (isEmpty(def) || isEmpty(def._links) || isEmpty(def._links[linkPath])) {
throw new Error(`A browse endpoint for ${linkPath} on ${metadatumKey} isn't configured`);
throw new Error(`A browse endpoint for ${linkPath} on ${metadataKey} isn't configured`);
} else {
return def._links[linkPath];
}