diff --git a/src/app/components/tabels/userstory-inner-table/userstory-inner-table.component.ts b/src/app/components/tabels/userstory-inner-table/userstory-inner-table.component.ts index dbec7f9..2a8c22f 100644 --- a/src/app/components/tabels/userstory-inner-table/userstory-inner-table.component.ts +++ b/src/app/components/tabels/userstory-inner-table/userstory-inner-table.component.ts @@ -65,6 +65,11 @@ export class UserstoryInnerTableComponent extends TableComponentBase< } //#region getters + + /** + * Returns a filtered list of all userstories that have a selected priority. + * If no pritority to be filtered for is defined it just returns all userstories. + */ public get filteredItems() { if (this.filterPriority == null) { return this.items; @@ -72,10 +77,19 @@ export class UserstoryInnerTableComponent extends TableComponentBase< return this.items.filter((t) => t.priority == this.filterPriority); } + /** + * Returns the number of related tasks of a given userstory. + * The relation is defined by the userstoryid property of the task object and the id property of the userstory object. + * @param userstory The userstory for which the number of related tasks gets calculated + */ public getNumberOfTasks(userstory: ScrumUserstory) { return this.tasks.filter((t) => t.userstoryid === userstory.id).length; } + /** + * Returns the title of the status that has the provided id. + * @param id id of the searched status + */ getStatusTitleById(id) { var status = this.status.find((x) => x.id === id); if (!status) { @@ -84,6 +98,10 @@ export class UserstoryInnerTableComponent extends TableComponentBase< return status.title; } + /** + * Returns the title of the category that has the provided id. + * @param id id of the searched category + */ getCategoryTitleById(id) { var category = this.categories.find((x) => x.id === id); if (!category) { @@ -94,6 +112,10 @@ export class UserstoryInnerTableComponent extends TableComponentBase< //#endregion getters //#region userstoryTableFunctions + /** + * Deletes a userstory by calling the delete method via the backendService and removing it from the tabel's items array. + * @param userstory userstory that will be deleted + */ public deleteUserstory(userstory: ScrumUserstory) { this.backendService.deleteUserstory(userstory).subscribe((response) => { if (response.status > 399) {