Add close button
This commit is contained in:
parent
85f8cd9038
commit
3a1b8b71c7
@ -1,18 +1,23 @@
|
||||
<div class="modal-content p-3">
|
||||
<div>
|
||||
<button (click) ="onClose()" type="button" class="close" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form (ngSubmit)="onSubmit()">
|
||||
<div class="form-group">
|
||||
<label for="Title">Titel</label>
|
||||
<input type="text" class="form-control" id="Title" required name="title" [(ngModel)]="title">
|
||||
<input type="text" class="form-control" id="Title" required name="title" [(ngModel)]="task.title">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="Inhalt">Inhalt</label>
|
||||
<input type="text" class="form-control" id="Content" required name="content" [(ngModel)]="content">
|
||||
<input type="text" class="form-control" id="Content" required name="content" [(ngModel)]="task.content">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="Prio">Prio</label>
|
||||
<select class="form-control" id="prio" required name="prio" [(ngModel)]="prio">
|
||||
<select class="form-control" id="prio" required name="priority" [(ngModel)]="task.priority">
|
||||
<option value="low">Low</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="high">High</option>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { BackendService, ScrumTask, Priority } from '../services/backend.service';
|
||||
import { BackendService, ScrumTask, Priority, ScrumStatus, ScrumCategory, ScrumUser, ScrumProject } from '../services/backend.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-task-form',
|
||||
@ -9,10 +9,6 @@ import { BackendService, ScrumTask, Priority } from '../services/backend.service
|
||||
})
|
||||
export class TaskFormComponent implements OnInit {
|
||||
|
||||
public title: string;
|
||||
public content: string;
|
||||
public prio: Priority;
|
||||
|
||||
@Input()
|
||||
public task: ScrumTask;
|
||||
private submitted: boolean;
|
||||
@ -21,17 +17,11 @@ export class TaskFormComponent implements OnInit {
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.task !== null && this.task !== undefined) {
|
||||
this.title = this.task.title;
|
||||
this.content = this.task.content;
|
||||
this.prio = this.task.priority;
|
||||
}
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
if (this.task !== null && this.task !== undefined) {
|
||||
this.task.title = this.title;
|
||||
this.task.content = this.content;
|
||||
this.task.priority = this.prio;
|
||||
this.backendService.putTask(this.task).subscribe(response => {
|
||||
if (response.status > 399) {
|
||||
alert('Fehler');
|
||||
@ -49,4 +39,8 @@ export class TaskFormComponent implements OnInit {
|
||||
this.submitted = true;
|
||||
this.activeModalService.close(this.task);
|
||||
}
|
||||
|
||||
onClose(){
|
||||
this.activeModalService.dismiss(this.task);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,9 @@
|
||||
<div class="modal-content p-3">
|
||||
<div>
|
||||
<button (click) ="onClose()" type="button" class="close" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form (ngSubmit)="onSubmit()">
|
||||
<div class="form-group">
|
||||
<label for="Title">Titel</label>
|
||||
|
@ -49,4 +49,7 @@ export class UserstoryFormComponent implements OnInit {
|
||||
this.submitted = true;
|
||||
this.activeModalService.close(this.userstory);
|
||||
}
|
||||
onClose(){
|
||||
this.activeModalService.dismiss(this.userstory);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user