mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Resolved type errors after merge
This commit is contained in:
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { RequestService } from './request.service';
|
||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||
import { filter, find, map, switchMap, tap } from 'rxjs/operators';
|
||||
import { filter, find, map, switchMap } from 'rxjs/operators';
|
||||
import { configureRequest, getSucceededRemoteData } from '../shared/operators';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { RelationshipType } from '../shared/item-relationships/relationship-type.model';
|
||||
@@ -42,7 +42,7 @@ export class RelationshipTypeService {
|
||||
map((endpointURL: string) => new FindListRequest(this.requestService.generateRequestId(), endpointURL, options)),
|
||||
configureRequest(this.requestService),
|
||||
switchMap(() => this.rdbService.buildList(link$))
|
||||
);
|
||||
) as Observable<RemoteData<PaginatedList<RelationshipType>>>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -3,8 +3,13 @@ import { RequestService } from './request.service';
|
||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||
import { hasValue, hasValueOperator, isNotEmpty, isNotEmptyOperator } from '../../shared/empty.util';
|
||||
import { distinctUntilChanged, filter, map, mergeMap, skipWhile, startWith, switchMap, take, tap } from 'rxjs/operators';
|
||||
import { configureRequest, getRemoteDataPayload, getResponseFromEntry, getSucceededRemoteData } from '../shared/operators';
|
||||
import { distinctUntilChanged, filter, map, mergeMap, startWith, switchMap, take, tap } from 'rxjs/operators';
|
||||
import {
|
||||
configureRequest,
|
||||
getRemoteDataPayload,
|
||||
getResponseFromEntry,
|
||||
getSucceededRemoteData
|
||||
} from '../shared/operators';
|
||||
import { DeleteRequest, FindListOptions, PostRequest, RestRequest } from './request.models';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { RestResponse } from '../cache/response.models';
|
||||
@@ -15,7 +20,11 @@ import { RemoteData } from './remote-data';
|
||||
import { combineLatest, combineLatest as observableCombineLatest } from 'rxjs';
|
||||
import { PaginatedList } from './paginated-list';
|
||||
import { ItemDataService } from './item-data.service';
|
||||
import { compareArraysUsingIds, paginatedRelationsToItems, relationsToItems } from '../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
import {
|
||||
compareArraysUsingIds,
|
||||
paginatedRelationsToItems,
|
||||
relationsToItems
|
||||
} from '../../+item-page/simple/item-types/shared/item-relationships-utils';
|
||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||
import { DataService } from './data.service';
|
||||
import { NormalizedObjectBuildService } from '../cache/builders/normalized-object-build.service';
|
||||
@@ -28,7 +37,10 @@ import { SearchParam } from '../cache/models/search-param.model';
|
||||
import { HttpOptions } from '../dspace-rest-v2/dspace-rest-v2.service';
|
||||
import { AppState, keySelector } from '../../app.reducer';
|
||||
import { NameVariantListState } from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.reducer';
|
||||
import { RemoveNameVariantAction, SetNameVariantAction } from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.actions';
|
||||
import {
|
||||
RemoveNameVariantAction,
|
||||
SetNameVariantAction
|
||||
} from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.actions';
|
||||
|
||||
const relationshipListsStateSelector = (state: AppState) => state.relationshipLists;
|
||||
|
||||
@@ -117,7 +129,7 @@ export class RelationshipService extends DataService<Relationship> {
|
||||
getResponseFromEntry(),
|
||||
tap(() => this.removeRelationshipItemsFromCache(item1)),
|
||||
tap(() => this.removeRelationshipItemsFromCache(item2))
|
||||
);
|
||||
) as Observable<RestResponse>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -136,7 +136,10 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
|
||||
);
|
||||
|
||||
const relatedItems$: Observable<Item[]> = relatedItemPairs$.pipe(
|
||||
map(([relatedItemPairs,]: [Array<[Item, Item]>]) => relatedItemPairs.map(([left, right]: [Item, Item]) => left.uuid === this.item.uuid ? left : right))
|
||||
map((relatedItemPairs: Array<[Item, Item]>) => {
|
||||
return relatedItemPairs
|
||||
.map(([left, right]: [Item, Item]) => left.uuid === this.item.uuid ? left : right)
|
||||
})
|
||||
);
|
||||
|
||||
relatedItems$.pipe(take(1)).subscribe((relatedItems) => {
|
||||
|
@@ -15,7 +15,6 @@ import { Router } from '@angular/router';
|
||||
import { SelectableListService } from '../../../../../object-list/selectable-list/selectable-list.service';
|
||||
import { hasValue, isNotEmpty } from '../../../../../empty.util';
|
||||
import { concat, map, multicast, switchMap, take, takeWhile, tap } from 'rxjs/operators';
|
||||
import { DSpaceObject } from '../../../../../../core/shared/dspace-object.model';
|
||||
import { getSucceededRemoteData } from '../../../../../../core/shared/operators';
|
||||
import { RouteService } from '../../../../../../core/services/route.service';
|
||||
import { CollectionElementLinkType } from '../../../../../object-collection/collection-element-link.type';
|
||||
@@ -87,13 +86,13 @@ export class DsDynamicLookupRelationSearchTabComponent implements OnInit, OnDest
|
||||
multicast(
|
||||
() => new ReplaySubject(1),
|
||||
(subject) => subject.pipe(
|
||||
takeWhile((rd: RemoteData<PaginatedList<SearchResult<DSpaceObject>>>) => rd.isLoading),
|
||||
takeWhile((rd: RemoteData<PaginatedList<SearchResult<Item>>>) => rd.isLoading),
|
||||
concat(subject.pipe(take(1)))
|
||||
)
|
||||
) as any
|
||||
)
|
||||
})
|
||||
);
|
||||
) as Observable<RemoteData<PaginatedList<SearchResult<Item>>>>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,18 +1,20 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MemoizedSelector, select, Store } from '@ngrx/store';
|
||||
import { Observable } from 'rxjs';
|
||||
import { distinctUntilChanged, filter, map, startWith, tap } from 'rxjs/operators';
|
||||
import { SelectableListsState, SelectableListState } from './selectable-list.reducer';
|
||||
import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||
import { SelectableListState } from './selectable-list.reducer';
|
||||
import { AppState, keySelector } from '../../../app.reducer';
|
||||
import { ListableObject } from '../../object-collection/shared/listable-object.model';
|
||||
import {
|
||||
SelectableListDeselectAction, SelectableListDeselectAllAction,
|
||||
SelectableListDeselectSingleAction, SelectableListSelectAction,
|
||||
SelectableListDeselectAction,
|
||||
SelectableListDeselectAllAction,
|
||||
SelectableListDeselectSingleAction,
|
||||
SelectableListSelectAction,
|
||||
SelectableListSelectSingleAction
|
||||
} from './selectable-list.actions';
|
||||
import { hasNoValue, hasValue, isNotEmpty } from '../../empty.util';
|
||||
import { hasValue, isNotEmpty } from '../../empty.util';
|
||||
|
||||
const selectableListsStateSelector = (state) => state.selectableLists;
|
||||
const selectableListsStateSelector = (state: AppState) => state.selectableLists;
|
||||
|
||||
const menuByIDSelector = (id: string): MemoizedSelector<AppState, SelectableListState> => {
|
||||
return keySelector<SelectableListState>(id, selectableListsStateSelector);
|
||||
@@ -21,7 +23,7 @@ const menuByIDSelector = (id: string): MemoizedSelector<AppState, SelectableList
|
||||
@Injectable()
|
||||
export class SelectableListService {
|
||||
|
||||
constructor(private store: Store<SelectableListsState>) {
|
||||
constructor(private store: Store<AppState>) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,7 +21,12 @@ import {
|
||||
SaveSubmissionSectionFormAction,
|
||||
SetActiveSectionAction
|
||||
} from './objects/submission-objects.actions';
|
||||
import { SubmissionObjectEntry, SubmissionSectionEntry, SubmissionSectionError, SubmissionSectionObject } from './objects/submission-objects.reducer';
|
||||
import {
|
||||
SubmissionObjectEntry,
|
||||
SubmissionSectionEntry,
|
||||
SubmissionSectionError,
|
||||
SubmissionSectionObject
|
||||
} from './objects/submission-objects.reducer';
|
||||
import { submissionObjectFromIdSelector } from './selectors';
|
||||
import { GlobalConfig } from '../../config/global-config.interface';
|
||||
import { GLOBAL_CONFIG } from '../../config';
|
||||
@@ -38,11 +43,7 @@ import { WorkspaceitemSectionsObject } from '../core/submission/models/workspace
|
||||
import { RemoteData } from '../core/data/remote-data';
|
||||
import { ErrorResponse } from '../core/cache/response.models';
|
||||
import { RemoteDataError } from '../core/data/remote-data-error';
|
||||
import {
|
||||
createFailedRemoteDataObject$,
|
||||
createSuccessfulRemoteDataObject,
|
||||
createSuccessfulRemoteDataObject$
|
||||
} from '../shared/testing/utils';
|
||||
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject } from '../shared/testing/utils';
|
||||
import { RequestService } from '../core/data/request.service';
|
||||
import { SearchService } from '../core/shared/search/search.service';
|
||||
|
||||
@@ -107,7 +108,7 @@ export class SubmissionService {
|
||||
*/
|
||||
createSubmission(): Observable<SubmissionObject> {
|
||||
return this.restService.postToEndpoint(this.workspaceLinkPath, {}).pipe(
|
||||
map((workspaceitem: SubmissionObject) => workspaceitem[0] as SubmissionObject),
|
||||
map((workspaceitem: SubmissionObject[]) => workspaceitem[0] as SubmissionObject),
|
||||
catchError(() => observableOf({} as SubmissionObject)))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user