mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 11:03:05 +00:00
Merge remote-tracking branch 'remotes/origin/master' into #601-resource-policies
# Conflicts: # resources/i18n/en.json5 # src/app/+item-page/edit-item-page/edit-item-page.module.ts # src/app/shared/shared.module.ts
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { filter, find, flatMap, map, tap } from 'rxjs/operators';
|
||||
import { filter, find, flatMap, map, take, tap } from 'rxjs/operators';
|
||||
import { hasValue, hasValueOperator, isNotEmpty } from '../../shared/empty.util';
|
||||
import { SearchResult } from '../../shared/search/search-result.model';
|
||||
import { DSOSuccessResponse, RestResponse } from '../cache/response.models';
|
||||
@@ -228,3 +228,13 @@ export const getFirstOccurrence = () =>
|
||||
source.pipe(
|
||||
map((rd) => Object.assign(rd, { payload: rd.payload.page.length > 0 ? rd.payload.page[0] : undefined }))
|
||||
);
|
||||
|
||||
/**
|
||||
* Operator for turning the current page of bitstreams into an array
|
||||
*/
|
||||
export const paginatedListToArray = () =>
|
||||
<T extends DSpaceObject>(source: Observable<RemoteData<PaginatedList<T>>>): Observable<T[]> =>
|
||||
source.pipe(
|
||||
hasValueOperator(),
|
||||
map((objectRD: RemoteData<PaginatedList<T>>) => objectRD.payload.page.filter((object: T) => hasValue(object)))
|
||||
);
|
||||
|
Reference in New Issue
Block a user