Added regions to table component base
This commit is contained in:
parent
b9da373c8d
commit
5d636a7cb0
@ -16,12 +16,21 @@ export abstract class TableComponentBase<T extends ScrumTask | ScrumUserstory |
|
|||||||
this.route.paramMap.subscribe((map) => this.applyFilterParameters(map));
|
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) {
|
private applyFilterParameters(params: ParamMap) {
|
||||||
if (params.has('id')) {
|
if (params.has('id')) {
|
||||||
this.highlightId = parseInt(params.get('id'));
|
this.highlightId = parseInt(params.get('id'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//#endregion tableFunctions
|
||||||
|
|
||||||
|
//#region sorters
|
||||||
protected doNumericSort(by: string, key: (item: T) => number) {
|
protected doNumericSort(by: string, key: (item: T) => number) {
|
||||||
if (this.sortBy === by) {
|
if (this.sortBy === by) {
|
||||||
this.sortDescending = !this.sortDescending;
|
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() {
|
public sortById() {
|
||||||
this.doNumericSort('id', (obj) => obj.id);
|
this.doNumericSort('id', (obj) => obj.id);
|
||||||
}
|
}
|
||||||
@ -72,4 +77,5 @@ export abstract class TableComponentBase<T extends ScrumTask | ScrumUserstory |
|
|||||||
public sortByTitle() {
|
public sortByTitle() {
|
||||||
this.doStringSort('title', (obj) => obj.title);
|
this.doStringSort('title', (obj) => obj.title);
|
||||||
}
|
}
|
||||||
|
//#endregion sorters
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user