First round of comments for userstory inner table
This commit is contained in:
parent
a3c964f762
commit
76210d8d0d
@ -15,9 +15,11 @@ import { ActivatedRoute, ParamMap, Router } from '@angular/router';
|
||||
@Component({
|
||||
selector: 'app-userstory-inner-table',
|
||||
templateUrl: './userstory-inner-table.component.html',
|
||||
styleUrls: ['./userstory-inner-table.component.css']
|
||||
styleUrls: ['./userstory-inner-table.component.css'],
|
||||
})
|
||||
export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserstory> {
|
||||
export class UserstoryInnerTableComponent extends TableComponentBase<
|
||||
ScrumUserstory
|
||||
> {
|
||||
public tasks: ScrumTask[] = [];
|
||||
public filterPriority: string | null = null;
|
||||
public status: ScrumStatus[] = [];
|
||||
@ -28,7 +30,7 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
||||
constructor(
|
||||
private backendService: BackendService,
|
||||
private modalService: NgbModal,
|
||||
protected route: ActivatedRoute,
|
||||
protected route: ActivatedRoute
|
||||
) {
|
||||
super(route);
|
||||
this.items = this.storys;
|
||||
@ -64,8 +66,10 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
||||
|
||||
//#region getters
|
||||
public get filteredItems() {
|
||||
if(this.filterPriority == null){return this.items;}
|
||||
return this.items.filter(t => t.priority == this.filterPriority);
|
||||
if (this.filterPriority == null) {
|
||||
return this.items;
|
||||
}
|
||||
return this.items.filter((t) => t.priority == this.filterPriority);
|
||||
}
|
||||
|
||||
public getNumberOfTasks(userstory: ScrumUserstory) {
|
||||
@ -104,28 +108,45 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
||||
//#endregion userstoryTableFunctions
|
||||
|
||||
//#region sorters
|
||||
/**
|
||||
* Sorts the tabel's items by priority
|
||||
*/
|
||||
public sortByPrio() {
|
||||
this.doNumericSort('priority', (us) => getNumberForPriority(us.priority));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the tabel's items by amount of related tasks
|
||||
*/
|
||||
public sortByTasks() {
|
||||
this.doNumericSort('tasks', (us) => this.getNumberOfTasks(us));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the tabel's items by statusid
|
||||
*/
|
||||
public sortByStatus() {
|
||||
this.doNumericSort('statusid', (us) => us.statusid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the tabel's items by categoryid
|
||||
*/
|
||||
public sortByCategory() {
|
||||
this.doNumericSort('categoryid', (us) => us.categoryid);
|
||||
}
|
||||
//#endregion sorters
|
||||
|
||||
//#region modals
|
||||
/**
|
||||
* Opens a UserstoryForm popup for editing a existing userstory or creating a new one.
|
||||
* @param editUserstory optional: userstory to edit (only needed if a userstory should be edited, not newly created)
|
||||
*/
|
||||
public openUserstoryForm(editUserstory?: ScrumUserstory) {
|
||||
const modalRef = this.modalService.open(UserstoryFormComponent, {
|
||||
backdrop: 'static',
|
||||
keyboard: true,
|
||||
size: "lg",
|
||||
size: 'lg',
|
||||
});
|
||||
if (editUserstory === null) {
|
||||
modalRef.result.then((result) => {
|
||||
@ -136,4 +157,3 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
||||
}
|
||||
//#endregion modals
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user