design modifications. added author dropdown
This commit is contained in:
parent
0c485486e0
commit
941e2f7ee5
@ -67,6 +67,30 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Section to choose an author for the userstory. Currently not finished -->
|
||||
<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">
|
||||
Autor: {{getAuthorById(userstory.createdbyid)}}
|
||||
</button>
|
||||
<div ngbDropdownMenu class="dropdown-menu" aria-labelledby="dropdownMenu2">
|
||||
<div class="card-text" for="Inhalt">User wählen</div>
|
||||
<option disable-auto-close ngbDropdownItem *ngFor="let user of allUser"
|
||||
(click)="userstory.createdbyid = user.id">{{ user.name }}</option>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-menu">
|
||||
<select class="form-control custom-select mr-sm-2" id="prio" required name="prio"
|
||||
[(ngModel)]="userstory.createdbyid">
|
||||
<option *ngFor="let user of allUser" [value]="user.id">{{
|
||||
user.name
|
||||
}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Old author input -->
|
||||
<div class="form-group">
|
||||
<label for="Inhalt">Autor</label>
|
||||
<input type="text" class="form-control" id="Author" required name="author" />
|
||||
|
@ -18,6 +18,8 @@ export class UserstoryFormComponent implements OnInit {
|
||||
@Input() public userstory: ScrumUserstory;
|
||||
public allStatus: any[] = [];
|
||||
public status: ScrumStatus = { title: "", description: "" };
|
||||
public allUser: any[] = [];
|
||||
public user : ScrumUser = {name:""};
|
||||
private editing: boolean;
|
||||
|
||||
|
||||
@ -55,6 +57,8 @@ export class UserstoryFormComponent implements OnInit {
|
||||
this.activeModalService.dismiss(this.userstory);
|
||||
}
|
||||
|
||||
// Methods for adding, choosing and deleting random status tags.
|
||||
|
||||
getUserstoryStatus() {
|
||||
this.backendService.getAllStatus().subscribe((response) => {
|
||||
if (response.status > 399) {
|
||||
@ -95,6 +99,7 @@ export class UserstoryFormComponent implements OnInit {
|
||||
getAllPriorities(): string[] {
|
||||
return Object.values(Priority);
|
||||
}
|
||||
|
||||
getStatusTitleById(id: number): string {
|
||||
if (!id) {
|
||||
return null;
|
||||
@ -106,4 +111,17 @@ export class UserstoryFormComponent implements OnInit {
|
||||
return status.title;
|
||||
}
|
||||
|
||||
// Methods for choosing a creator in userstory.
|
||||
|
||||
getAuthorById(id: number): string {
|
||||
if (!id) {
|
||||
return null;
|
||||
}
|
||||
var user = this.allUser.find((x) => x.id === id);
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
return user.name;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -96,6 +96,7 @@ export class UserstoryTableComponent extends TableComponentBase<
|
||||
const modalRef = this.modalService.open(UserstoryFormComponent, {
|
||||
backdrop: 'static',
|
||||
keyboard: true,
|
||||
size: 'lg'
|
||||
});
|
||||
if (editUserstory === null) {
|
||||
modalRef.result.then((result) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user