50632: Replaced mock registry service with implementation and added pagination

This commit is contained in:
Kristof De Langhe
2018-04-04 13:03:15 +02:00
parent 683b58eaaf
commit 0d70faffae
16 changed files with 402 additions and 105 deletions

View File

@@ -4,6 +4,7 @@ import { Observable } from 'rxjs/Observable';
import { RemoteData } from '../../../core/data/remote-data';
import { PaginatedList } from '../../../core/data/paginated-list';
import { BitstreamFormat } from '../../../core/registry/mock-bitstream-format.model';
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
@Component({
selector: 'ds-bitstream-formats',
@@ -12,8 +13,21 @@ import { BitstreamFormat } from '../../../core/registry/mock-bitstream-format.mo
export class BitstreamFormatsComponent {
bitstreamFormats: Observable<RemoteData<PaginatedList<BitstreamFormat>>>;
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
id: 'registry-bitstreamformats-pagination',
pageSize: 20
});
constructor(registryService: RegistryService) {
this.bitstreamFormats = registryService.getBitstreamFormats();
constructor(private registryService: RegistryService) {
this.updateFormats();
}
onPageChange(event) {
this.config.currentPage = event;
this.updateFormats();
}
private updateFormats() {
this.bitstreamFormats = this.registryService.getBitstreamFormats(this.config);
}
}