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

@@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Item } from '../../../../core/shared/item.model';
import { MetadataRepresentation } from '../../../../core/shared/metadata-representation/metadata-representation.model';
import { ItemViewMode, rendersItemType } from '../../../../shared/items/item-type-decorator';
import { ItemComponent } from '../../../../+item-page/simple/item-types/shared/item.component';
@@ -22,26 +21,7 @@ export class ProjectComponent extends ItemComponent implements OnInit {
*/
contributors$: Observable<RemoteData<PaginatedList<MetadataRepresentation>>>;
/**
* The people related to this project
*/
people$: Observable<RemoteData<PaginatedList<Item>>>;
/**
* The publications related to this project
*/
publications$: Observable<RemoteData<PaginatedList<Item>>>;
/**
* The organisation units related to this project
*/
orgUnits$: Observable<RemoteData<PaginatedList<Item>>>;
ngOnInit(): void {
this.contributors$ = this.buildRepresentations('OrgUnit', 'project.contributor.other', 'isOrgUnitOfProject');
this.people$ = this.relationshipService.getRelatedItemsByLabel(this.item, 'isPersonOfProject');
this.publications$ = this.relationshipService.getRelatedItemsByLabel(this.item, 'isPublicationOfProject');
this.orgUnits$ = this.relationshipService.getRelatedItemsByLabel(this.item, 'isOrgUnitOfProject');
}
}