mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
107873: Shorten paginationId
I chose 2 characters instead of one in case a 'SUCCEEDED' process status is added in the future. 'SUCCEEDED' could encompass both 'COMPLETED' and 'FAILED' processes, but it's paginationId would clash with 'SCHEDULED' (both start with 's'). By choosing the first 2 characters of the status, this clash does not occur (ids would be 'sc' and 'su').
This commit is contained in:
@@ -71,7 +71,10 @@ export class ProcessOverviewTableComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.paginationId = 'processOverviewTable' + this.processStatus;
|
// Creates an ID from the first 2 characters of the process status.
|
||||||
|
// Should two process status values ever start with the same substring,
|
||||||
|
// increase the number of characters until the ids are distinct.
|
||||||
|
this.paginationId = this.processStatus.toLowerCase().substring(0,2);
|
||||||
|
|
||||||
let defaultPaginationOptions = Object.assign(new PaginationComponentOptions(), {
|
let defaultPaginationOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
id: this.paginationId,
|
id: this.paginationId,
|
||||||
|
Reference in New Issue
Block a user