mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
102415: Provide all external sources of correct entity type in edit relationships ({item-page}/edit/relationship)
This commit is contained in:

committed by
Alexandre Vryghem

parent
e4f483c308
commit
a9c5c20c5a
@@ -30,6 +30,10 @@ import { getAllSucceededRemoteDataPayload } from '../../../../../core/shared/ope
|
|||||||
import { followLink } from '../../../../utils/follow-link-config.model';
|
import { followLink } from '../../../../utils/follow-link-config.model';
|
||||||
import { RelationshipType } from '../../../../../core/shared/item-relationships/relationship-type.model';
|
import { RelationshipType } from '../../../../../core/shared/item-relationships/relationship-type.model';
|
||||||
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject';
|
||||||
|
import { FindListOptions } from '../../../../../core/data/request.models';
|
||||||
|
import { RequestParam } from '../../../../../core/cache/models/request-param.model';
|
||||||
|
import { getFirstSucceededRemoteDataPayload } from '../../../../../core/shared/operators';
|
||||||
|
import { PaginatedList } from '../../../../../core/data/paginated-list.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-dynamic-lookup-relation-modal',
|
selector: 'ds-dynamic-lookup-relation-modal',
|
||||||
@@ -202,6 +206,19 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
|
|||||||
).pipe(
|
).pipe(
|
||||||
getAllSucceededRemoteDataPayload()
|
getAllSucceededRemoteDataPayload()
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
const findListOptions = Object.assign({}, new FindListOptions(), {
|
||||||
|
elementsPerPage: 5,
|
||||||
|
currentPage: 1,
|
||||||
|
searchParams: [
|
||||||
|
new RequestParam('entityType', this.relationshipOptions.relationshipType)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
this.externalSourcesRD$ = this.externalSourceService.searchBy('findByEntityType', findListOptions,
|
||||||
|
true, true, followLink('entityTypes'))
|
||||||
|
.pipe(getFirstSucceededRemoteDataPayload(), map((r: PaginatedList<ExternalSource>) => {
|
||||||
|
return r.page;
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setTotals();
|
this.setTotals();
|
||||||
|
Reference in New Issue
Block a user