forked from hazza/dspace-angular
Merge remote-tracking branch 'remotes/origin/master' into submission
# Conflicts: # src/app/core/data/browse-items-response-parsing-service.ts # src/app/shared/shared.module.ts
This commit is contained in:
@@ -91,7 +91,7 @@ export const getBrowseDefinitionLinks = (definitionID: string) =>
|
||||
source.pipe(
|
||||
getRemoteDataPayload(),
|
||||
map((browseDefinitions: BrowseDefinition[]) => browseDefinitions
|
||||
.find((def: BrowseDefinition) => def.id === definitionID && def.metadataBrowse === true)
|
||||
.find((def: BrowseDefinition) => def.id === definitionID)
|
||||
),
|
||||
map((def: BrowseDefinition) => {
|
||||
if (isNotEmpty(def)) {
|
||||
@@ -101,3 +101,12 @@ export const getBrowseDefinitionLinks = (definitionID: string) =>
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* Get the first occurrence of an object within a paginated list
|
||||
*/
|
||||
export const getFirstOccurrence = () =>
|
||||
<T extends DSpaceObject>(source: Observable<RemoteData<PaginatedList<T>>>): Observable<RemoteData<T>> =>
|
||||
source.pipe(
|
||||
map((rd) => Object.assign(rd, { payload: rd.payload.page.length > 0 ? rd.payload.page[0] : undefined }))
|
||||
);
|
||||
|
Reference in New Issue
Block a user