design modifications. added author dropdown

This commit is contained in:
test 2020-07-02 16:33:33 +02:00
parent 0c485486e0
commit 941e2f7ee5
3 changed files with 43 additions and 0 deletions

View File

@ -67,6 +67,30 @@
</select> </select>
</div> </div>
</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"> <div class="form-group">
<label for="Inhalt">Autor</label> <label for="Inhalt">Autor</label>
<input type="text" class="form-control" id="Author" required name="author" /> <input type="text" class="form-control" id="Author" required name="author" />

View File

@ -18,6 +18,8 @@ export class UserstoryFormComponent implements OnInit {
@Input() public userstory: ScrumUserstory; @Input() public userstory: ScrumUserstory;
public allStatus: any[] = []; public allStatus: any[] = [];
public status: ScrumStatus = { title: "", description: "" }; public status: ScrumStatus = { title: "", description: "" };
public allUser: any[] = [];
public user : ScrumUser = {name:""};
private editing: boolean; private editing: boolean;
@ -55,6 +57,8 @@ export class UserstoryFormComponent implements OnInit {
this.activeModalService.dismiss(this.userstory); this.activeModalService.dismiss(this.userstory);
} }
// Methods for adding, choosing and deleting random status tags.
getUserstoryStatus() { getUserstoryStatus() {
this.backendService.getAllStatus().subscribe((response) => { this.backendService.getAllStatus().subscribe((response) => {
if (response.status > 399) { if (response.status > 399) {
@ -95,6 +99,7 @@ export class UserstoryFormComponent implements OnInit {
getAllPriorities(): string[] { getAllPriorities(): string[] {
return Object.values(Priority); return Object.values(Priority);
} }
getStatusTitleById(id: number): string { getStatusTitleById(id: number): string {
if (!id) { if (!id) {
return null; return null;
@ -106,4 +111,17 @@ export class UserstoryFormComponent implements OnInit {
return status.title; 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;
}
} }

View File

@ -96,6 +96,7 @@ export class UserstoryTableComponent extends TableComponentBase<
const modalRef = this.modalService.open(UserstoryFormComponent, { const modalRef = this.modalService.open(UserstoryFormComponent, {
backdrop: 'static', backdrop: 'static',
keyboard: true, keyboard: true,
size: 'lg'
}); });
if (editUserstory === null) { if (editUserstory === null) {
modalRef.result.then((result) => { modalRef.result.then((result) => {