mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 21:13:07 +00:00
50632: Replaced mock registry service with implementation and added pagination
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user