mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { Component } from '@angular/core';
|
|
import { RegistryService } from '../../../core/registry/registry.service';
|
|
import { Observable } from 'rxjs';
|
|
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',
|
|
templateUrl: './bitstream-formats.component.html'
|
|
})
|
|
export class BitstreamFormatsComponent {
|
|
|
|
bitstreamFormats: Observable<RemoteData<PaginatedList<BitstreamFormat>>>;
|
|
config: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
|
id: 'registry-bitstreamformats-pagination',
|
|
pageSize: 10000
|
|
});
|
|
|
|
constructor(private registryService: RegistryService) {
|
|
this.updateFormats();
|
|
}
|
|
|
|
onPageChange(event) {
|
|
this.config.currentPage = event;
|
|
this.updateFormats();
|
|
}
|
|
|
|
private updateFormats() {
|
|
this.bitstreamFormats = this.registryService.getBitstreamFormats(this.config);
|
|
}
|
|
}
|