From aee256090acf3f346d92a3e82761b9262e0530e5 Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 10:53:33 +0200 Subject: [PATCH 1/9] Added new interfaces --- src/app/services/backend.service.ts | 163 ++++++++++++------ src/app/task-form/task-form.component.ts | 104 +++++------ src/app/task-list/task-list.component.ts | 8 +- .../userstory-list.component.css | 0 .../userstory-list.component.html | 0 .../userstory-list.component.ts | 48 ++++++ 6 files changed, 211 insertions(+), 112 deletions(-) create mode 100644 src/app/userstory-list/userstory-list.component.css create mode 100644 src/app/userstory-list/userstory-list.component.html create mode 100644 src/app/userstory-list/userstory-list.component.ts diff --git a/src/app/services/backend.service.ts b/src/app/services/backend.service.ts index 98433f0..16e165f 100644 --- a/src/app/services/backend.service.ts +++ b/src/app/services/backend.service.ts @@ -1,56 +1,107 @@ -import {Injectable} from '@angular/core'; -import {HttpClient, HttpResponse} from '@angular/common/http'; -import {Observable} from 'rxjs'; -import {environment} from '../../environments/environment'; - - -@Injectable() -export class BackendService { - - constructor(private httpClient: HttpClient) {} - - public getTasks(): Observable> { - const url = `${environment.apiUrl}/tasks`; - return this.httpClient.get(url, { observe: 'response' }); - } - - public getTask(id: number): Observable> { - const url = `${environment.apiUrl}/tasks/${id}`; - return this.httpClient.get(url, { observe: 'response' }); - } - - public postTask(task: Task): Observable> { - const url = `${environment.apiUrl}/tasks`; - return this.httpClient.post(url, task, { observe: 'response' }); - } - - public putTask(task: Task): Observable> { - const url = `${environment.apiUrl}/tasks/${task.id}`; - return this.httpClient.put(url, task, { observe: 'response' }); - } - - public deleteTask(task: Task): Observable> { - const url = `${environment.apiUrl}/tasks/${task.id}`; - return this.httpClient.delete(url, {observe: 'response'}); - } - -} - -export enum Priority { - High="high", - Medium="medium", - Low="low" -} - -export interface Task { - id?: number; - title: string; - content?: string; - status?: number; - category?: number; - assignedto?: number; - sprint?: number; - project?: number; - userstory?: number; - priority?: Priority; -} \ No newline at end of file +import {Injectable} from '@angular/core'; +import {HttpClient, HttpResponse} from '@angular/common/http'; +import {Observable} from 'rxjs'; +import {environment} from '../../environments/environment'; + + +@Injectable() +export class BackendService { + + constructor(private httpClient: HttpClient) {} + + public getTasks(): Observable> { + const url = `${environment.apiUrl}/tasks`; + return this.httpClient.get(url, { observe: 'response' }); + } + + public getTask(id: number): Observable> { + const url = `${environment.apiUrl}/tasks/${id}`; + return this.httpClient.get(url, { observe: 'response' }); + } + + public postTask(task: ScrumTask): Observable> { + const url = `${environment.apiUrl}/tasks`; + return this.httpClient.post(url, task, { observe: 'response' }); + } + + public putTask(task: ScrumTask): Observable> { + const url = `${environment.apiUrl}/tasks/${task.id}`; + return this.httpClient.put(url, task, { observe: 'response' }); + } + + public deleteTask(task: ScrumTask): Observable> { + const url = `${environment.apiUrl}/tasks/${task.id}`; + return this.httpClient.delete(url, {observe: 'response'}); + } + + + + +} + +export enum Priority { + High="high", + Medium="medium", + Low="low" +} + +export interface ScrumTask { + id?: number; + title: string; + content?: string; + status?: number; + category?: number; + assignedto?: number; + sprint?: number; + project?: number; + userstory?: number; + priority?: Priority; +} + +export interface ScrumUserstory { + id?: number; + title: string; + content?: string; + priority?: Priority; + status?: number; + category?: number; + createdby?: number; + project?: number; +} + +export interface ScrumSprint{ + id?: number; + title: string; + description: string; + startDate: Date; + endDate: Date; + project: number; +} + +export interface ScrumCategory { + id?: number; + title: string; + description?: string; + color?: string; + project: number; +} + +export interface ScrumStatus { + id? : number; + title: string; + description: string; +} + + +export interface ScrumUser { + id?: number; + name: string; +} + +export interface ScrumProject { + id?: number; + title: string; + isprivate: boolean; +} + + diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index 6f34dae..379b991 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -1,52 +1,52 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { BackendService, Task, Priority } from '../services/backend.service'; - -@Component({ - selector: 'app-task-form', - templateUrl: './task-form.component.html', - styleUrls: ['./task-form.component.css'] -}) -export class TaskFormComponent implements OnInit { - - public title: string; - public content: string; - public prio: Priority; - - @Input() - public task: Task; - private submitted: boolean; - - constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { } - - 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'); - } - }); - } - else { - this.task = { title: this.title, content: this.content, priority: this.prio }; - this.backendService.postTask(this.task).subscribe(response => { - if (response.status > 399) { - alert('Fehler'); - } - }); - } - this.submitted = true; - this.activeModalService.close(); - } -} +import { Component, OnInit, Input } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { BackendService, ScrumTask, Priority } from '../services/backend.service'; + +@Component({ + selector: 'app-task-form', + templateUrl: './task-form.component.html', + styleUrls: ['./task-form.component.css'] +}) +export class TaskFormComponent implements OnInit { + + public title: string; + public content: string; + public prio: Priority; + + @Input() + public task: ScrumTask; + private submitted: boolean; + + constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { } + + 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'); + } + }); + } + else { + this.task = { title: this.title, content: this.content, priority: this.prio }; + this.backendService.postTask(this.task).subscribe(response => { + if (response.status > 399) { + alert('Fehler'); + } + }); + } + this.submitted = true; + this.activeModalService.close(); + } +} diff --git a/src/app/task-list/task-list.component.ts b/src/app/task-list/task-list.component.ts index 452ca44..b9549d9 100644 --- a/src/app/task-list/task-list.component.ts +++ b/src/app/task-list/task-list.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { BackendService, Task } from '../services/backend.service'; +import { BackendService, ScrumTask } from '../services/backend.service'; import { TaskFormComponent } from '../task-form/task-form.component'; @Component({ @@ -10,7 +10,7 @@ import { TaskFormComponent } from '../task-form/task-form.component'; }) export class TaskListComponent implements OnInit { - public tasks: Task[] = []; + public tasks: ScrumTask[] = []; constructor(private backendService: BackendService, private modalService: NgbModal) { backendService.getTasks().subscribe(response => { @@ -26,7 +26,7 @@ export class TaskListComponent implements OnInit { ngOnInit(): void { } - public deleteTask(task: Task) { + public deleteTask(task: ScrumTask) { this.backendService.deleteTask(task).subscribe(response => { if (response.status > 399) { alert('Fehler'); @@ -38,7 +38,7 @@ export class TaskListComponent implements OnInit { } } - public openTaskForm(editTask: Task) { + public openTaskForm(editTask: ScrumTask) { const modalRef = this.modalService.open(TaskFormComponent, { backdrop: 'static', keyboard: true, diff --git a/src/app/userstory-list/userstory-list.component.css b/src/app/userstory-list/userstory-list.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/userstory-list/userstory-list.component.html b/src/app/userstory-list/userstory-list.component.html new file mode 100644 index 0000000..e69de29 diff --git a/src/app/userstory-list/userstory-list.component.ts b/src/app/userstory-list/userstory-list.component.ts new file mode 100644 index 0000000..0942175 --- /dev/null +++ b/src/app/userstory-list/userstory-list.component.ts @@ -0,0 +1,48 @@ +import { Component, OnInit } from '@angular/core'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { BackendService, ScrumUserstory } from '../services/backend.service'; + +@Component({ + selector: 'app-userstory-list', + templateUrl: './userstory-list.component.html', + styleUrls: ['./userstory-list.component.css'] +}) +export class UserstoryListComponent implements OnInit { + + public userstories: ScrumUserstory[] = []; + + constructor(private backendService: BackendService, private modalService: NgbModal) { + backendService.getUserstories().subscribe(response => { + if (response.status > 399) { + alert('Fehler'); + } + else { + this.userstories.push(...response.body); + } + }); + } + + ngOnInit(): void { + } + + public deleteUserstory(userstory: ScrumUserstory) { + this.backendService.deleteUserstory(userstory).subscribe(response => { + if (response.status > 399) { + alert('Fehler'); + } + }); + const index = this.userstories.indexOf(userstory); + if (index !== -1) { + this.userstories.splice(index, 1); + } + } + + public openUserstoryForm(editUserstory: ScrumUserstory) { + const modalRef = this.modalService.open(UserstoryFormComponent, { + backdrop: 'static', + keyboard: true, + }); + modalRef.componentInstance.userstory = editUserstory; + } + +} From 6e7e7de0df70af98054a34348cd74e791ae05e24 Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 10:55:02 +0200 Subject: [PATCH 2/9] Fixed Project interface --- src/app/services/backend.service.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/app/services/backend.service.ts b/src/app/services/backend.service.ts index 16e165f..f594207 100644 --- a/src/app/services/backend.service.ts +++ b/src/app/services/backend.service.ts @@ -37,6 +37,31 @@ export class BackendService { + public getTasks(): Observable> { + const url = `${environment.apiUrl}/tasks`; + return this.httpClient.get(url, { observe: 'response' }); + } + + public getTask(id: number): Observable> { + const url = `${environment.apiUrl}/tasks/${id}`; + return this.httpClient.get(url, { observe: 'response' }); + } + + public postTask(task: ScrumTask): Observable> { + const url = `${environment.apiUrl}/tasks`; + return this.httpClient.post(url, task, { observe: 'response' }); + } + + public putTask(task: ScrumTask): Observable> { + const url = `${environment.apiUrl}/tasks/${task.id}`; + return this.httpClient.put(url, task, { observe: 'response' }); + } + + public deleteTask(task: ScrumTask): Observable> { + const url = `${environment.apiUrl}/tasks/${task.id}`; + return this.httpClient.delete(url, {observe: 'response'}); + } + } export enum Priority { From 40db6474a1dbb67428996023954b71b99443ad18 Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 11:07:57 +0200 Subject: [PATCH 3/9] Added Userstories route --- src/app/app-routing.module.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 06c7342..441ef44 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,8 +1,14 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; +import { TaskListComponent } from './task-list/task-list.component'; +import { UserstoryListComponent } from './userstory-list/userstory-list.component'; -const routes: Routes = []; + +const routes: Routes = [ + { path: '/tasks', component: TaskListComponent }, + { path: '/userstories', component: UserstoryListComponent } +]; @NgModule({ imports: [RouterModule.forRoot(routes)], From 5179256435370aaaa9685ce8488937ef87b5e9bf Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 11:08:20 +0200 Subject: [PATCH 4/9] Added components for userstory --- src/app/app.module.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 362e532..17855fd 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -6,9 +6,11 @@ import { HttpClientModule } from '@angular/common/http'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; -import { TaskListComponent } from './task-list/task-list.component'; import { BackendService } from './services/backend.service'; +import { TaskListComponent } from './task-list/task-list.component'; import { TaskFormComponent } from './task-form/task-form.component'; +import { UserstoryListComponent } from './userstory-list/userstory-list.component'; +import { UserstoryFormComponent } from './userstory-form/userstory-form.component'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; @NgModule({ From 17b1872ebdfba47926a8613b016a767653d73fff Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 11:09:10 +0200 Subject: [PATCH 5/9] Add basic userstory components nr. 2 --- .../userstory-form.component.css | 0 .../userstory-form.component.html | 25 +++++++++ .../userstory-form.component.ts | 52 +++++++++++++++++++ .../userstory-list.component.html | 14 +++++ .../userstory-list.component.ts | 1 + 5 files changed, 92 insertions(+) create mode 100644 src/app/userstory-form/userstory-form.component.css create mode 100644 src/app/userstory-form/userstory-form.component.html create mode 100644 src/app/userstory-form/userstory-form.component.ts diff --git a/src/app/userstory-form/userstory-form.component.css b/src/app/userstory-form/userstory-form.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/userstory-form/userstory-form.component.html b/src/app/userstory-form/userstory-form.component.html new file mode 100644 index 0000000..edb588c --- /dev/null +++ b/src/app/userstory-form/userstory-form.component.html @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/src/app/userstory-form/userstory-form.component.ts b/src/app/userstory-form/userstory-form.component.ts new file mode 100644 index 0000000..020f199 --- /dev/null +++ b/src/app/userstory-form/userstory-form.component.ts @@ -0,0 +1,52 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { BackendService, ScrumUserstory, Priority } from '../services/backend.service'; + +@Component({ + selector: 'app-userstory-form', + templateUrl: './userstory-form.component.html', + styleUrls: ['./userstory-form.component.css'] +}) +export class UserstoryFormComponent implements OnInit { + + public title: string; + public content: string; + public prio: Priority; + + @Input() + public userstory: ScrumUserstory; + private submitted: boolean; + + constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { } + + ngOnInit(): void { + if (this.userstory !== null && this.userstory !== undefined) { + this.title = this.userstory.title; + this.content = this.userstory.content; + this.prio = this.userstory.priority; + } + } + + onSubmit() { + if (this.userstory !== null && this.userstory !== undefined) { + this.userstory.title = this.title; + this.userstory.content = this.content; + this.userstory.priority = this.prio; + this.backendService.putUserstory(this.userstory).subscribe(response => { + if (response.status > 399) { + alert('Fehler'); + } + }); + } + else { + this.userstory = { title: this.title, content: this.content, priority: this.prio }; + this.backendService.postUserstory(this.userstory).subscribe(response => { + if (response.status > 399) { + alert('Fehler'); + } + }); + } + this.submitted = true; + this.activeModalService.close(); + } +} diff --git a/src/app/userstory-list/userstory-list.component.html b/src/app/userstory-list/userstory-list.component.html index e69de29..c8c9bb6 100644 --- a/src/app/userstory-list/userstory-list.component.html +++ b/src/app/userstory-list/userstory-list.component.html @@ -0,0 +1,14 @@ + + +
    +
  • + Titel: {{userstory.title}} +
    + Inhalt: {{userstory.content}} +
    + Priotität: {{userstory.priority}} +
    + + +
  • +
diff --git a/src/app/userstory-list/userstory-list.component.ts b/src/app/userstory-list/userstory-list.component.ts index 0942175..154fbcf 100644 --- a/src/app/userstory-list/userstory-list.component.ts +++ b/src/app/userstory-list/userstory-list.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { BackendService, ScrumUserstory } from '../services/backend.service'; +import { UserstoryFormComponent } from '../userstory-form/userstory-form.component'; @Component({ selector: 'app-userstory-list', From c718943af38b4d9a1fca7dab6b5cb3ba7935f81c Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 11:16:47 +0200 Subject: [PATCH 6/9] Added more userstory stuff (teamarbeit) --- src/app/app-routing.module.ts | 4 +- src/app/app.module.ts | 4 +- src/app/services/backend.service.ts | 28 +++---- src/app/task-list/task-list.component.ts | 98 ++++++++++++------------ 4 files changed, 68 insertions(+), 66 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 441ef44..ce27b6b 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -6,8 +6,8 @@ import { UserstoryListComponent } from './userstory-list/userstory-list.componen const routes: Routes = [ - { path: '/tasks', component: TaskListComponent }, - { path: '/userstories', component: UserstoryListComponent } + { path: 'tasks', component: TaskListComponent }, + { path: 'userstories', component: UserstoryListComponent } ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 17855fd..ea85efc 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -17,7 +17,9 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; declarations: [ AppComponent, TaskListComponent, - TaskFormComponent + TaskFormComponent, + UserstoryListComponent, + UserstoryFormComponent ], imports: [ BrowserModule, diff --git a/src/app/services/backend.service.ts b/src/app/services/backend.service.ts index f594207..9881f47 100644 --- a/src/app/services/backend.service.ts +++ b/src/app/services/backend.service.ts @@ -37,28 +37,28 @@ export class BackendService { - public getTasks(): Observable> { - const url = `${environment.apiUrl}/tasks`; - return this.httpClient.get(url, { observe: 'response' }); + public getUserstories(): Observable> { + const url = `${environment.apiUrl}/userstories`; + return this.httpClient.get(url, { observe: 'response' }); } - public getTask(id: number): Observable> { - const url = `${environment.apiUrl}/tasks/${id}`; - return this.httpClient.get(url, { observe: 'response' }); + public getUserstory(id: number): Observable> { + const url = `${environment.apiUrl}/userstories/${id}`; + return this.httpClient.get(url, { observe: 'response' }); } - public postTask(task: ScrumTask): Observable> { - const url = `${environment.apiUrl}/tasks`; - return this.httpClient.post(url, task, { observe: 'response' }); + public postUserstory(userstory: ScrumUserstory): Observable> { + const url = `${environment.apiUrl}/userstories`; + return this.httpClient.post(url, userstory, { observe: 'response' }); } - public putTask(task: ScrumTask): Observable> { - const url = `${environment.apiUrl}/tasks/${task.id}`; - return this.httpClient.put(url, task, { observe: 'response' }); + public putUserstory(userstory: ScrumUserstory): Observable> { + const url = `${environment.apiUrl}/userstories/${userstory.id}`; + return this.httpClient.put(url, userstory, { observe: 'response' }); } - public deleteTask(task: ScrumTask): Observable> { - const url = `${environment.apiUrl}/tasks/${task.id}`; + public deleteUserstory(userstory: ScrumUserstory): Observable> { + const url = `${environment.apiUrl}/userstories/${userstory.id}`; return this.httpClient.delete(url, {observe: 'response'}); } diff --git a/src/app/task-list/task-list.component.ts b/src/app/task-list/task-list.component.ts index b9549d9..5b945f4 100644 --- a/src/app/task-list/task-list.component.ts +++ b/src/app/task-list/task-list.component.ts @@ -1,49 +1,49 @@ -import { Component, OnInit } from '@angular/core'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { BackendService, ScrumTask } from '../services/backend.service'; -import { TaskFormComponent } from '../task-form/task-form.component'; - -@Component({ - selector: 'app-task-list', - templateUrl: './task-list.component.html', - styleUrls: ['./task-list.component.css'] -}) -export class TaskListComponent implements OnInit { - - public tasks: ScrumTask[] = []; - - constructor(private backendService: BackendService, private modalService: NgbModal) { - backendService.getTasks().subscribe(response => { - if (response.status > 399) { - alert('Fehler'); - } - else { - this.tasks.push(...response.body); - } - }); - } - - ngOnInit(): void { - } - - public deleteTask(task: ScrumTask) { - this.backendService.deleteTask(task).subscribe(response => { - if (response.status > 399) { - alert('Fehler'); - } - }); - const index = this.tasks.indexOf(task); - if (index !== -1) { - this.tasks.splice(index, 1); - } - } - - public openTaskForm(editTask: ScrumTask) { - const modalRef = this.modalService.open(TaskFormComponent, { - backdrop: 'static', - keyboard: true, - }); - modalRef.componentInstance.task = editTask; - } - -} +import { Component, OnInit } from '@angular/core'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { BackendService, ScrumTask } from '../services/backend.service'; +import { TaskFormComponent } from '../task-form/task-form.component'; + +@Component({ + selector: 'app-task-list', + templateUrl: './task-list.component.html', + styleUrls: ['./task-list.component.css'] +}) +export class TaskListComponent implements OnInit { + + public tasks: ScrumTask[] = []; + + constructor(private backendService: BackendService, private modalService: NgbModal) { + backendService.getTasks().subscribe(response => { + if (response.status > 399) { + alert('Fehler'); + } + else { + this.tasks.push(...response.body); + } + }); + } + + ngOnInit(): void { + } + + public deleteTask(task: ScrumTask) { + this.backendService.deleteTask(task).subscribe(response => { + if (response.status > 399) { + alert('Fehler'); + } + }); + const index = this.tasks.indexOf(task); + if (index !== -1) { + this.tasks.splice(index, 1); + } + } + + public openTaskForm(editTask: ScrumTask) { + const modalRef = this.modalService.open(TaskFormComponent, { + backdrop: 'static', + keyboard: true, + }); + modalRef.componentInstance.task = editTask; + } + +} From e1a531ce80ee961100298850231fcd569529b465 Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 11:28:24 +0200 Subject: [PATCH 7/9] Teamswork sync --- src/app/app.component.html | 2 +- src/app/app.module.ts | 72 +++++++++---------- .../userstory-list.component.html | 4 +- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 45f80e5..90c6b64 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ea85efc..e6c683f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,36 +1,36 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { HttpClientModule } from '@angular/common/http'; - -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; - -import { BackendService } from './services/backend.service'; -import { TaskListComponent } from './task-list/task-list.component'; -import { TaskFormComponent } from './task-form/task-form.component'; -import { UserstoryListComponent } from './userstory-list/userstory-list.component'; -import { UserstoryFormComponent } from './userstory-form/userstory-form.component'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; - -@NgModule({ - declarations: [ - AppComponent, - TaskListComponent, - TaskFormComponent, - UserstoryListComponent, - UserstoryFormComponent - ], - imports: [ - BrowserModule, - AppRoutingModule, - HttpClientModule, - FormsModule, - NgbModule - ], - providers: [ - BackendService, - ], - bootstrap: [AppComponent] -}) -export class AppModule { } +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { HttpClientModule } from '@angular/common/http'; + +import { AppRoutingModule } from './app-routing.module'; +import { AppComponent } from './app.component'; + +import { BackendService } from './services/backend.service'; +import { TaskListComponent } from './task-list/task-list.component'; +import { TaskFormComponent } from './task-form/task-form.component'; +import { UserstoryListComponent } from './userstory-list/userstory-list.component'; +import { UserstoryFormComponent } from './userstory-form/userstory-form.component'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; + +@NgModule({ + declarations: [ + AppComponent, + TaskListComponent, + TaskFormComponent, + UserstoryListComponent, + UserstoryFormComponent + ], + imports: [ + BrowserModule, + AppRoutingModule, + HttpClientModule, + FormsModule, + NgbModule + ], + providers: [ + BackendService, + ], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/src/app/userstory-list/userstory-list.component.html b/src/app/userstory-list/userstory-list.component.html index c8c9bb6..fbee073 100644 --- a/src/app/userstory-list/userstory-list.component.html +++ b/src/app/userstory-list/userstory-list.component.html @@ -6,9 +6,9 @@
Inhalt: {{userstory.content}}
- Priotität: {{userstory.priority}} + Priotität: {{userstory.priority}}
- + From a5323552b041f223a6e60fda5766bba200e9c597 Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 11:34:39 +0200 Subject: [PATCH 8/9] Added dynamic list enlargement --- src/app/task-form/task-form.component.ts | 2 +- src/app/task-list/task-list.component.ts | 5 +++++ src/app/userstory-form/userstory-form.component.ts | 2 +- src/app/userstory-list/userstory-list.component.ts | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index 379b991..832c55a 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -47,6 +47,6 @@ export class TaskFormComponent implements OnInit { }); } this.submitted = true; - this.activeModalService.close(); + this.activeModalService.close(this.task); } } diff --git a/src/app/task-list/task-list.component.ts b/src/app/task-list/task-list.component.ts index 5b945f4..b8daf28 100644 --- a/src/app/task-list/task-list.component.ts +++ b/src/app/task-list/task-list.component.ts @@ -43,6 +43,11 @@ export class TaskListComponent implements OnInit { backdrop: 'static', keyboard: true, }); + if (editTask === null) { + modalRef.result.then(result => { + this.tasks.push(result); + }); + } modalRef.componentInstance.task = editTask; } diff --git a/src/app/userstory-form/userstory-form.component.ts b/src/app/userstory-form/userstory-form.component.ts index 020f199..4fe28be 100644 --- a/src/app/userstory-form/userstory-form.component.ts +++ b/src/app/userstory-form/userstory-form.component.ts @@ -47,6 +47,6 @@ export class UserstoryFormComponent implements OnInit { }); } this.submitted = true; - this.activeModalService.close(); + this.activeModalService.close(this.userstory); } } diff --git a/src/app/userstory-list/userstory-list.component.ts b/src/app/userstory-list/userstory-list.component.ts index 154fbcf..526f825 100644 --- a/src/app/userstory-list/userstory-list.component.ts +++ b/src/app/userstory-list/userstory-list.component.ts @@ -43,6 +43,11 @@ export class UserstoryListComponent implements OnInit { backdrop: 'static', keyboard: true, }); + if (editUserstory === null) { + modalRef.result.then(result => { + this.userstories.push(result); + }); + } modalRef.componentInstance.userstory = editUserstory; } From 8b859e24c0ab1542057b858ca227364dceaa8ebe Mon Sep 17 00:00:00 2001 From: Niggl Date: Wed, 10 Jun 2020 11:36:52 +0200 Subject: [PATCH 9/9] Added redirect to standard view --- src/app/app-routing.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index ce27b6b..7e0c37c 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -7,7 +7,8 @@ import { UserstoryListComponent } from './userstory-list/userstory-list.componen const routes: Routes = [ { path: 'tasks', component: TaskListComponent }, - { path: 'userstories', component: UserstoryListComponent } + { path: 'userstories', component: UserstoryListComponent }, + { path: '', redirectTo: '/tasks', pathMatch: 'full' }, ]; @NgModule({