diff --git a/src/app/backlog-table/backlog.component.html b/src/app/backlog-table/backlog.component.html index acd12f5..75d1fea 100644 --- a/src/app/backlog-table/backlog.component.html +++ b/src/app/backlog-table/backlog.component.html @@ -10,117 +10,32 @@
- ID - - - - - - | -- Titel - - - - - - | -- Tasks - - - - - - | -- Status - - - - - - | -
-
-
-
- Priorität:
-
-
- {{filterPriority || "All"}}
-
-
-
-
-
-
-
-
-
-
- |
- - Category - - - - - - | -- |
---|---|---|---|---|---|---|
{{userstory.id}} | -{{userstory.title}} | -- - {{getNumberOfTasks(userstory)}} Tasks - - | -- - {{getStatusTitleById(userstory.statusid)}} - - | -{{userstory.priority}} | -- - {{getCategoryTitleById(userstory.categoryid)}} - - | -- - | -
{{userstory.id}} | {{userstory.title}} | diff --git a/src/app/backlog-table/backlog.component.ts b/src/app/backlog-table/backlog.component.ts index 24b87cd..8c21895 100644 --- a/src/app/backlog-table/backlog.component.ts +++ b/src/app/backlog-table/backlog.component.ts @@ -26,30 +26,19 @@ export class BacklogComponent extends TableComponentBase< > { public tasks: ScrumTask[] = []; public filterPriority: string | null = null; - public highlightId: number; public status: ScrumStatus[] = []; public categories: ScrumCategory[] = []; + public currentSprint: ScrumSprint; public choosen: ScrumUserstory[] = []; - public get filteredItems() { - return this.items.filter( - (task) => - this.filterPriority === null || task.priority === this.filterPriority - ); - } - constructor( private backendService: BackendService, private modalService: NgbModal, private route: ActivatedRoute, - private router: Router ) { super(); - this.applyFilterParameters(this.route.snapshot.paramMap); - this.route.paramMap.subscribe((map) => this.applyFilterParameters(map)); - backendService.getUserstories().subscribe((response) => { if (response.status > 399) { alert('Fehler'); @@ -78,12 +67,7 @@ export class BacklogComponent extends TableComponentBase< this.categories.push(...response.body); } }); - } - - private applyFilterParameters(params: ParamMap) { - if (params.has('id')) { - this.highlightId = parseInt(params.get('id')); - } + this.getCurrentSprint(); } public deleteUserstory(userstory: ScrumUserstory) { @@ -135,6 +119,7 @@ export class BacklogComponent extends TableComponentBase< sortByStatus() { this.doNumericSort('statusid', (us) => us.statusid); } + sortByCategory() { this.doNumericSort('categoryid', (us) => us.categoryid); } @@ -159,6 +144,7 @@ export class BacklogComponent extends TableComponentBase< public addToSprintBacklog(userstory: ScrumUserstory) { this.choosen.push(userstory); + } public deleteFromSprintBacklog(userstory: ScrumUserstory){ @@ -166,8 +152,15 @@ export class BacklogComponent extends TableComponentBase< this.choosen.splice(index, 1); } - public addToSprint(choosen: ScrumUserstory[]){ - + public getCurrentSprint() + { + this.backendService.getSprints().subscribe((response) => { + if (response.status > 399) { + } else { + var currentDate = new Date(); + this.currentSprint = response.body.find(x => x.startDate < currentDate); + alert(this.currentSprint); + }}); } public openSprintForm(editSprint?: ScrumSprint) { |