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({
|
@Component({
|
||||||
selector: 'app-userstory-inner-table',
|
selector: 'app-userstory-inner-table',
|
||||||
templateUrl: './userstory-inner-table.component.html',
|
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 tasks: ScrumTask[] = [];
|
||||||
public filterPriority: string | null = null;
|
public filterPriority: string | null = null;
|
||||||
public status: ScrumStatus[] = [];
|
public status: ScrumStatus[] = [];
|
||||||
@ -28,7 +30,7 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
|||||||
constructor(
|
constructor(
|
||||||
private backendService: BackendService,
|
private backendService: BackendService,
|
||||||
private modalService: NgbModal,
|
private modalService: NgbModal,
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
super(route);
|
super(route);
|
||||||
this.items = this.storys;
|
this.items = this.storys;
|
||||||
@ -64,8 +66,10 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
|||||||
|
|
||||||
//#region getters
|
//#region getters
|
||||||
public get filteredItems() {
|
public get filteredItems() {
|
||||||
if(this.filterPriority == null){return this.items;}
|
if (this.filterPriority == null) {
|
||||||
return this.items.filter(t => t.priority == this.filterPriority);
|
return this.items;
|
||||||
|
}
|
||||||
|
return this.items.filter((t) => t.priority == this.filterPriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getNumberOfTasks(userstory: ScrumUserstory) {
|
public getNumberOfTasks(userstory: ScrumUserstory) {
|
||||||
@ -104,28 +108,45 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
|||||||
//#endregion userstoryTableFunctions
|
//#endregion userstoryTableFunctions
|
||||||
|
|
||||||
//#region sorters
|
//#region sorters
|
||||||
|
/**
|
||||||
|
* Sorts the tabel's items by priority
|
||||||
|
*/
|
||||||
public sortByPrio() {
|
public sortByPrio() {
|
||||||
this.doNumericSort('priority', (us) => getNumberForPriority(us.priority));
|
this.doNumericSort('priority', (us) => getNumberForPriority(us.priority));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorts the tabel's items by amount of related tasks
|
||||||
|
*/
|
||||||
public sortByTasks() {
|
public sortByTasks() {
|
||||||
this.doNumericSort('tasks', (us) => this.getNumberOfTasks(us));
|
this.doNumericSort('tasks', (us) => this.getNumberOfTasks(us));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorts the tabel's items by statusid
|
||||||
|
*/
|
||||||
public sortByStatus() {
|
public sortByStatus() {
|
||||||
this.doNumericSort('statusid', (us) => us.statusid);
|
this.doNumericSort('statusid', (us) => us.statusid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorts the tabel's items by categoryid
|
||||||
|
*/
|
||||||
public sortByCategory() {
|
public sortByCategory() {
|
||||||
this.doNumericSort('categoryid', (us) => us.categoryid);
|
this.doNumericSort('categoryid', (us) => us.categoryid);
|
||||||
}
|
}
|
||||||
//#endregion sorters
|
//#endregion sorters
|
||||||
|
|
||||||
//#region modals
|
//#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) {
|
public openUserstoryForm(editUserstory?: ScrumUserstory) {
|
||||||
const modalRef = this.modalService.open(UserstoryFormComponent, {
|
const modalRef = this.modalService.open(UserstoryFormComponent, {
|
||||||
backdrop: 'static',
|
backdrop: 'static',
|
||||||
keyboard: true,
|
keyboard: true,
|
||||||
size: "lg",
|
size: 'lg',
|
||||||
});
|
});
|
||||||
if (editUserstory === null) {
|
if (editUserstory === null) {
|
||||||
modalRef.result.then((result) => {
|
modalRef.result.then((result) => {
|
||||||
@ -136,4 +157,3 @@ export class UserstoryInnerTableComponent extends TableComponentBase<ScrumUserst
|
|||||||
}
|
}
|
||||||
//#endregion modals
|
//#endregion modals
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user