Merge branch 'feature/sprint-form' into preview

This commit is contained in:
Nicolai Ort 2020-06-30 10:51:44 +02:00
commit 2b415336c3
2 changed files with 24 additions and 7 deletions

View File

@ -8,8 +8,8 @@
<h6 class="modal-caption text-muted"> Gehört zu Story: <a href="#" id="userstoryTitle">{{this.userstoryId}}</a></h6>
</tr>
<select class="form-control custom-select mr-sm-2" id="prio" required name="prio"
[(ngModel)]="task.priority" *ngFor="let userstory of userstories">
<option value="low">{{userstory}}</option>
[(ngModel)]="task.priority">
<option *ngFor="let userstory of userstories" value="low">{{userstory.title}}</option>
</select>
</table>
<button (click)="onClose()" type="button" class="close" aria-label="Close">
@ -52,8 +52,12 @@
<div class="col-md-2">
<div class="form-group">
<label for="Inhalt">Status</label>
<input type="text" class="form-control" id="Status" required name="status"
[(ngModel)]="task.statusid">
<!-- <input type="text" class="form-control" id="Status" required name="status"
[(ngModel)]="task.status"> -->
<select class="form-control custom-select mr-sm-2" id="prio" required name="prio"
[(ngModel)]="task.priority">
<option *ngFor="let status of allStatus" value="low">{{status.title}}</option>
</select>
</div>
<div class="form-group">
<label for="Inhalt">Assigned User</label>

View File

@ -22,9 +22,13 @@ export class TaskFormComponent implements OnInit {
@Input() public task: ScrumTask;
public editing: Boolean;
public userstoryId: string;
public userstories: any[];
public userstories: any[] = [];
public allStatus: any[] = [];
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {}
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
this.getUserStories();
this.getTaskStatus();
}
ngOnInit(): void {
if (this.task === null || this.task === undefined) {
@ -35,7 +39,6 @@ export class TaskFormComponent implements OnInit {
}
document.getElementById('titleField').focus();
this.getRelatedStory();
this.getUserStories();
}
onSubmit() {
@ -78,4 +81,14 @@ export class TaskFormComponent implements OnInit {
}
});
}
getTaskStatus() {
this.backendService.getAllStatus().subscribe((response) => {
if (response.status > 399) {
alert('Fehler');
} else {
this.allStatus.push(...response.body);
}
});
}
}