Backlog now actually does stuff, when you move userstorys
This commit is contained in:
parent
971994aee0
commit
f1ab3156e5
@ -36,7 +36,7 @@
|
||||
|
||||
<div class="col-lg-6 container-fluid">
|
||||
|
||||
<h4>Sprint-Backlog - y</h4>
|
||||
<h4>Sprint-Backlog - Aktueller Sprint: {{this.currentSprint.title}}</h4>
|
||||
<div *ngFor="let story of choosen" class="col-lg-6 container-fluid">
|
||||
<div class="card" style="width: 150%;">
|
||||
<div class="card-body">
|
||||
|
@ -27,7 +27,7 @@ export class BacklogComponent extends TableComponentBase<
|
||||
public filterPriority: string | null = null;
|
||||
public status: ScrumStatus[] = [];
|
||||
public categories: ScrumCategory[] = [];
|
||||
public currentSprint: ScrumSprint;
|
||||
public sprints: ScrumSprint[] = [];
|
||||
|
||||
public backlog: ScrumUserstory[] = [];
|
||||
public choosen: ScrumUserstory[] = [];
|
||||
@ -38,13 +38,19 @@ export class BacklogComponent extends TableComponentBase<
|
||||
private route: ActivatedRoute,
|
||||
) {
|
||||
super();
|
||||
|
||||
backendService.getSprints().subscribe((response) => {
|
||||
if (response.status > 399) {
|
||||
alert('Fehler');
|
||||
} else {
|
||||
this.sprints.push(...response.body);
|
||||
}
|
||||
});
|
||||
backendService.getUserstories().subscribe((response) => {
|
||||
if (response.status > 399) {
|
||||
alert('Fehler');
|
||||
} else {
|
||||
this.items.push(...response.body);
|
||||
this.backlog = this.items;
|
||||
this.backlog = response.body.filter(u => u.sprintid == null);
|
||||
this.choosen = response.body.filter(u => u.sprintid == this.currentSprint.id);
|
||||
}
|
||||
});
|
||||
backendService.getTasks().subscribe((response) => {
|
||||
@ -68,7 +74,6 @@ export class BacklogComponent extends TableComponentBase<
|
||||
this.categories.push(...response.body);
|
||||
}
|
||||
});
|
||||
this.getCurrentSprint();
|
||||
}
|
||||
|
||||
public deleteUserstory(userstory: ScrumUserstory) {
|
||||
@ -101,38 +106,6 @@ export class BacklogComponent extends TableComponentBase<
|
||||
return this.tasks.filter((t) => t.userstoryid === userstory.id).length;
|
||||
}
|
||||
|
||||
public sortById() {
|
||||
this.doNumericSort('id', (us) => us.id);
|
||||
}
|
||||
|
||||
public sortByTitle() {
|
||||
this.doStringSort('title', (us) => us.title);
|
||||
}
|
||||
|
||||
public sortByPrio() {
|
||||
this.doNumericSort('priority', (us) => getNumberForPriority(us.priority));
|
||||
}
|
||||
|
||||
public sortByTasks() {
|
||||
this.doNumericSort('tasks', (us) => this.getNumberOfTasks(us));
|
||||
}
|
||||
|
||||
sortByStatus() {
|
||||
this.doNumericSort('statusid', (us) => us.statusid);
|
||||
}
|
||||
|
||||
sortByCategory() {
|
||||
this.doNumericSort('categoryid', (us) => us.categoryid);
|
||||
}
|
||||
|
||||
getStatusTitleById(id) {
|
||||
var status = this.status.find((x) => x.id === id);
|
||||
if (!status) {
|
||||
return 'N/A';
|
||||
}
|
||||
return status.title;
|
||||
}
|
||||
|
||||
getCategoryTitleById(id) {
|
||||
var category = this.categories.find((x) => x.id === id);
|
||||
if (!category) {
|
||||
@ -147,23 +120,29 @@ export class BacklogComponent extends TableComponentBase<
|
||||
this.choosen.push(userstory);
|
||||
const index = this.backlog.indexOf(userstory);
|
||||
this.backlog.splice(index, 1);
|
||||
|
||||
userstory.sprintid = this.currentSprint.id;
|
||||
this.backendService.putUserstory(userstory).subscribe((response) => {
|
||||
if (response.status > 399) {
|
||||
alert('Fehler');
|
||||
}
|
||||
});
|
||||
}
|
||||
public deleteFromSprintBacklog(userstory: ScrumUserstory){
|
||||
|
||||
public deleteFromSprintBacklog(userstory: ScrumUserstory){
|
||||
const index = this.choosen.indexOf(userstory);
|
||||
this.choosen.splice(index, 1);
|
||||
this.backlog.push(userstory);
|
||||
this.backlog.push(userstory)
|
||||
userstory.sprintid = null;
|
||||
this.backendService.putUserstory(userstory).subscribe((response) => {
|
||||
if (response.status > 399) {
|
||||
alert('Fehler');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public getCurrentSprint()
|
||||
{
|
||||
this.backendService.getSprints().subscribe((response) => {
|
||||
if (response.status > 399) {
|
||||
} else {
|
||||
public get currentSprint(): ScrumSprint {
|
||||
const now = Date.now();
|
||||
this.currentSprint = response.body.find(s => Date.parse(s.startDate) < now && Date.parse(s.endDate) > now);
|
||||
}});
|
||||
return this.sprints.find(s => Date.parse(s.startDate) < now && Date.parse(s.endDate) > now);
|
||||
}
|
||||
|
||||
public openSprintForm(editSprint?: ScrumSprint) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user