Added regions to table component base

This commit is contained in:
Nicolai Ort 2020-07-10 21:33:47 +02:00
parent b9da373c8d
commit 5d636a7cb0
1 changed files with 10 additions and 4 deletions

View File

@ -16,12 +16,21 @@ export abstract class TableComponentBase<T extends ScrumTask | ScrumUserstory |
this.route.paramMap.subscribe((map) => this.applyFilterParameters(map));
}
//#region getters
public getAllPriorities(): string[] {
return Object.values(Priority);
}
//#endregion getters
//#region tableFunctions
private applyFilterParameters(params: ParamMap) {
if (params.has('id')) {
this.highlightId = parseInt(params.get('id'));
}
}
//#endregion tableFunctions
//#region sorters
protected doNumericSort(by: string, key: (item: T) => number) {
if (this.sortBy === by) {
this.sortDescending = !this.sortDescending;
@ -61,10 +70,6 @@ export abstract class TableComponentBase<T extends ScrumTask | ScrumUserstory |
}
}
public getAllPriorities(): string[] {
return Object.values(Priority);
}
public sortById() {
this.doNumericSort('id', (obj) => obj.id);
}
@ -72,4 +77,5 @@ export abstract class TableComponentBase<T extends ScrumTask | ScrumUserstory |
public sortByTitle() {
this.doStringSort('title', (obj) => obj.title);
}
//#endregion sorters
}