Add close button
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user