diff --git a/src/app/services/backend.service.ts b/src/app/services/backend.service.ts index d023a1b..98433f0 100644 --- a/src/app/services/backend.service.ts +++ b/src/app/services/backend.service.ts @@ -36,11 +36,15 @@ export class BackendService { } -//enum prio{high, middle, low}; --> noch nicht im backend +export enum Priority { + High="high", + Medium="medium", + Low="low" +} + export interface Task { id?: number; title: string; - //prio; --> noch nicht im backend content?: string; status?: number; category?: number; @@ -48,4 +52,5 @@ export interface Task { sprint?: number; project?: number; userstory?: number; -} + priority?: Priority; +} \ No newline at end of file diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index c01cd5b..114d1d2 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -10,6 +10,15 @@ +
+ + +
+ diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index 7f2aa19..858a647 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, Input } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { BackendService, Task } from '../services/backend.service'; +import { BackendService, Task, Priority } from '../services/backend.service'; @Component({ selector: 'app-task-form', @@ -11,6 +11,7 @@ export class TaskFormComponent implements OnInit { public title: string; public content: string; + public prio: Priority; @Input() public task: Task; @@ -22,6 +23,7 @@ export class TaskFormComponent implements OnInit { if (this.task !== null && this.task !== undefined) { this.title = this.task.title; this.content = this.task.content; + this.prio = this.task.priority; } } @@ -29,6 +31,7 @@ export class TaskFormComponent implements OnInit { 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'); diff --git a/src/app/task-list/task-list.component.html b/src/app/task-list/task-list.component.html index 269ec70..1f501a3 100644 --- a/src/app/task-list/task-list.component.html +++ b/src/app/task-list/task-list.component.html @@ -5,6 +5,8 @@ Titel: {{task.title}}
Inhalt: {{task.content}} +
+ Priotität: {{task.priority}}