fixed bug where going to the mydspace page broke

This commit is contained in:
lotte
2019-11-08 13:42:20 +01:00
parent 6d3a52d2f9
commit 5b37d90444
5 changed files with 4 additions and 7 deletions

View File

@@ -113,7 +113,6 @@ export class RemoteDataBuildService {
href$ = observableOf(href$); href$ = observableOf(href$);
} }
href$.subscribe(href => console.log('request url: ', href));
const requestEntry$ = href$.pipe(getRequestFromRequestHref(this.requestService)); const requestEntry$ = href$.pipe(getRequestFromRequestHref(this.requestService));
const tDomainList$ = requestEntry$.pipe( const tDomainList$ = requestEntry$.pipe(
getResourceLinksFromResponse(), getResourceLinksFromResponse(),

View File

@@ -197,7 +197,7 @@ export abstract class DataService<T extends CacheableObject> {
} }
), ),
switchMap((href) => this.requestService.getByHref(href)), switchMap((href) => this.requestService.getByHref(href)),
skipWhile((requestEntry) => hasValue(requestEntry)), skipWhile((requestEntry) => hasValue(requestEntry) && requestEntry.completed),
switchMap((href) => switchMap((href) =>
this.rdbService.buildList<T>(hrefObs) as Observable<RemoteData<PaginatedList<T>>> this.rdbService.buildList<T>(hrefObs) as Observable<RemoteData<PaginatedList<T>>>
) )

View File

@@ -319,13 +319,13 @@ export class RelationshipService extends DataService<Relationship> {
}) })
) )
), ),
switchMap((relationshipAndType: {relation: Relationship, type: RelationshipType}) => { switchMap((relationshipAndType: { relation: Relationship, type: RelationshipType }) => {
const { relation, type } = relationshipAndType; const { relation, type } = relationshipAndType;
let updatedRelationship; let updatedRelationship;
if (relationshipLabel === type.leftwardType) { if (relationshipLabel === type.leftwardType) {
updatedRelationship = Object.assign(new Relationship(), relation, { rightwardValue: nameVariant });
} else {
updatedRelationship = Object.assign(new Relationship(), relation, { leftwardValue: nameVariant }); updatedRelationship = Object.assign(new Relationship(), relation, { leftwardValue: nameVariant });
} else {
updatedRelationship = Object.assign(new Relationship(), relation, { rightwardValue: nameVariant });
} }
return this.update(updatedRelationship); return this.update(updatedRelationship);
}) })

View File

@@ -47,7 +47,6 @@ export const getResponseFromEntry = () =>
export const getResourceLinksFromResponse = () => export const getResourceLinksFromResponse = () =>
(source: Observable<RequestEntry>): Observable<string[]> => (source: Observable<RequestEntry>): Observable<string[]> =>
source.pipe( source.pipe(
tap((t) => console.log(t)),
filterSuccessfulResponses(), filterSuccessfulResponses(),
map((response: DSOSuccessResponse) => response.resourceSelfLinks), map((response: DSOSuccessResponse) => response.resourceSelfLinks),
); );

View File

@@ -222,7 +222,6 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
getRemoteDataPayload(), getRemoteDataPayload(),
switchMap((submissionObject: SubmissionObject) => (submissionObject.item as Observable<RemoteData<Item>>).pipe(getSucceededRemoteData(), getRemoteDataPayload())), switchMap((submissionObject: SubmissionObject) => (submissionObject.item as Observable<RemoteData<Item>>).pipe(getSucceededRemoteData(), getRemoteDataPayload())),
switchMap((item: Item) => this.relationService.getRelatedItemsByLabel(item, this.model.relationship.relationshipType)), switchMap((item: Item) => this.relationService.getRelatedItemsByLabel(item, this.model.relationship.relationshipType)),
tap((t) => console.log(t)),
map((items: PaginatedList<Item>) => items.page.map((item) => Object.assign(new SearchResult(), { indexableObject: item }))), map((items: PaginatedList<Item>) => items.page.map((item) => Object.assign(new SearchResult(), { indexableObject: item }))),
).subscribe((relatedItems: SearchResult<Item>[]) => this.selectableListService.select(this.listId, relatedItems)); ).subscribe((relatedItems: SearchResult<Item>[]) => this.selectableListService.select(this.listId, relatedItems));