modified task-list to "enable" sprint-form.
This commit is contained in:
parent
7c26e91b2a
commit
9c14fc4bd5
@ -1,4 +1,6 @@
|
||||
<button class="btn btn-dark m-3" (click)="openTaskForm(null)">Neu</button>
|
||||
<button class="btn btn-dark m-3" (click)="openSprintForm(null)">Neuer Sprint</button>
|
||||
|
||||
|
||||
<ul class="list-group m-3">
|
||||
<li *ngFor="let task of tasks" class="list-group-item">
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { BackendService, ScrumTask } from '../services/backend.service';
|
||||
import { BackendService, ScrumTask, ScrumSprint } from '../services/backend.service';
|
||||
import { TaskFormComponent } from '../task-form/task-form.component';
|
||||
import { SprintFormComponent } from '../sprint-form/sprint-form.component';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-list',
|
||||
@ -11,6 +13,8 @@ import { TaskFormComponent } from '../task-form/task-form.component';
|
||||
export class TaskListComponent implements OnInit {
|
||||
|
||||
public tasks: ScrumTask[] = [];
|
||||
public sprints: ScrumSprint[] = [];
|
||||
|
||||
|
||||
constructor(private backendService: BackendService, private modalService: NgbModal) {
|
||||
backendService.getTasks().subscribe(response => {
|
||||
@ -51,4 +55,17 @@ export class TaskListComponent implements OnInit {
|
||||
modalRef.componentInstance.task = editTask;
|
||||
}
|
||||
|
||||
public openSprintForm(editSprint: ScrumSprint) {
|
||||
const modalRef = this.modalService.open(SprintFormComponent, {
|
||||
backdrop: 'static',
|
||||
keyboard: true,
|
||||
});
|
||||
if (editSprint === null) {
|
||||
modalRef.result.then(result => {
|
||||
this.sprints.push(result);
|
||||
});
|
||||
}
|
||||
modalRef.componentInstance.userstory = editSprint;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user