created dropdown to choose a user assigned to the task.
This commit is contained in:
@@ -26,10 +26,13 @@ export class TaskFormComponent implements OnInit {
|
||||
public userstories: any[] = [];
|
||||
public allStatus: any[] = [];
|
||||
public status: ScrumStatus = {title: "", description: ""};
|
||||
public allUser: any[] = [];
|
||||
public user: ScrumUser = { name: "" };
|
||||
|
||||
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
|
||||
this.getUserStories();
|
||||
this.getTaskStatus();
|
||||
this.getAllUsers();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -155,4 +158,27 @@ export class TaskFormComponent implements OnInit {
|
||||
}
|
||||
return status.title;
|
||||
}
|
||||
|
||||
// Methods for choosing creator of a userstory.
|
||||
|
||||
getAllUsers() {
|
||||
this.backendService.getUsers().subscribe((response) => {
|
||||
if (response.status > 399) {
|
||||
alert('Fehler');
|
||||
} else {
|
||||
this.allUser.push(...response.body);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getAuthorById(id: number): string {
|
||||
if (!id) {
|
||||
return null;
|
||||
}
|
||||
var user = this.allUser.find((x) => x.id === id);
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
return user.name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user