mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Merge branch 'resolvers-branch-angular6' into patch-support
Conflicts: src/app/core/auth/auth-response-parsing.service.spec.ts src/app/core/auth/auth.service.ts src/app/core/auth/models/auth-status.model.ts src/app/core/auth/server-auth.service.ts src/app/core/data/data.service.spec.ts src/app/core/data/data.service.ts src/app/core/data/dspace-object-data.service.ts src/app/core/data/item-data.service.spec.ts src/app/core/data/item-data.service.ts src/app/core/data/request.models.ts src/app/shared/auth-nav-menu/auth-nav-menu.component.ts src/app/shared/mocks/mock-form-service.ts src/app/shared/mocks/mock-remote-data-build.service.ts src/app/shared/mocks/mock-store.ts
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
|
||||
import {of as observableOf, Observable } from 'rxjs';
|
||||
|
||||
import { distinctUntilChanged, filter, take, first, map } from 'rxjs/operators';
|
||||
import { of as observableOf, Observable } from 'rxjs';
|
||||
import {mergeMap, first, take, distinctUntilChanged, map, filter} from 'rxjs/operators';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
||||
@@ -27,17 +26,13 @@ export abstract class DataService<TNormalized extends NormalizedObject, TDomain>
|
||||
protected abstract halService: HALEndpointService;
|
||||
protected abstract objectCache: ObjectCacheService;
|
||||
|
||||
public abstract getScopedEndpoint(scope: string): Observable<string>
|
||||
public abstract getBrowseEndpoint(options: FindAllOptions): Observable<string>
|
||||
|
||||
protected getFindAllHref(endpoint, options: FindAllOptions = {}): Observable<string> {
|
||||
protected getFindAllHref(options: FindAllOptions = {}): Observable<string> {
|
||||
let result: Observable<string>;
|
||||
const args = [];
|
||||
|
||||
if (hasValue(options.scopeID)) {
|
||||
result = this.getScopedEndpoint(options.scopeID).pipe(distinctUntilChanged());
|
||||
} else {
|
||||
result = observableOf(endpoint);
|
||||
}
|
||||
result = this.getBrowseEndpoint(options).pipe(distinctUntilChanged());
|
||||
|
||||
if (hasValue(options.currentPage) && typeof options.currentPage === 'number') {
|
||||
/* TODO: this is a temporary fix for the pagination start index (0 or 1) discrepancy between the rest and the frontend respectively */
|
||||
@@ -64,8 +59,7 @@ export abstract class DataService<TNormalized extends NormalizedObject, TDomain>
|
||||
}
|
||||
|
||||
findAll(options: FindAllOptions = {}): Observable<RemoteData<PaginatedList<TDomain>>> {
|
||||
const hrefObs = this.halService.getEndpoint(this.linkPath).pipe(filter((href: string) => isNotEmpty(href)),
|
||||
mergeMap((endpoint: string) => this.getFindAllHref(endpoint, options)),);
|
||||
const hrefObs = this.getFindAllHref(options);
|
||||
|
||||
hrefObs.pipe(
|
||||
filter((href: string) => hasValue(href)),
|
||||
|
Reference in New Issue
Block a user