64574: View-more/less for related-items + refactoring item pages

This commit is contained in:
Kristof De Langhe
2019-08-27 14:12:39 +02:00
parent bd54d47037
commit 4afb35c53e
19 changed files with 117 additions and 169 deletions

View File

@@ -226,9 +226,10 @@ export class RelationshipService extends DataService<Relationship> {
* and return the items as an array
* @param item
* @param label
* @param options
*/
getRelatedItemsByLabel(item: Item, label: string): Observable<RemoteData<PaginatedList<Item>>> {
return this.getItemRelationshipsByLabel(item, label).pipe(paginatedRelationsToItems(item.uuid));
getRelatedItemsByLabel(item: Item, label: string, options?: FindAllOptions): Observable<RemoteData<PaginatedList<Item>>> {
return this.getItemRelationshipsByLabel(item, label, options).pipe(paginatedRelationsToItems(item.uuid));
}
/**
@@ -236,11 +237,15 @@ export class RelationshipService extends DataService<Relationship> {
* and return the items as an array
* @param item
* @param label
* @param options
*/
getItemRelationshipsByLabel(item: Item, label: string): Observable<RemoteData<PaginatedList<Relationship>>> {
const options = new FindAllOptions();
options.searchParams = [ new SearchParam('label', label), new SearchParam('dso', item.id) ];
return this.searchBy('byLabel', options);
getItemRelationshipsByLabel(item: Item, label: string, options?: FindAllOptions): Observable<RemoteData<PaginatedList<Relationship>>> {
let findAllOptions = new FindAllOptions();
if (options) {
findAllOptions = Object.assign(new FindAllOptions(), options);
}
findAllOptions.searchParams = [ new SearchParam('label', label), new SearchParam('dso', item.id) ];
return this.searchBy('byLabel', findAllOptions);
}
/**