Status now has title

This commit is contained in:
Nicolai Ort 2020-07-02 11:52:47 +02:00
parent c25d7993e5
commit c20326f15d
2 changed files with 16 additions and 1 deletions

View File

@ -43,7 +43,7 @@
<div class="form-group">
<div ngbDropdown class="dropdown" [autoClose]="false">
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Status: {{task.statusid}}
Status: {{getStatusTitleById(task.statusid)}}
</button>
<div ngbDropdownMenu class="dropdown-menu" aria-labelledby="dropdownMenu2">
<div class="card-text" for="Inhalt">Status wählen</div>

View File

@ -68,6 +68,10 @@ export class TaskFormComponent implements OnInit {
}
getRelatedStory() {
if(!this.task.userstoryid)
{
return null;
}
this.backendService.getUserstory(this.task.userstoryid).subscribe((response) => {
if (response.status > 399) {
alert('Fehler');
@ -140,4 +144,15 @@ export class TaskFormComponent implements OnInit {
}
return story.title;
}
getStatusTitleById(id: number) :string{
if (!id) {
return null;
}
var status = this.allStatus.find((x) => x.id === id);
if (!status) {
return null;
}
return status.title;
}
}