From 227c32583aa178d80869f3f341193b01fdf56785 Mon Sep 17 00:00:00 2001 From: test Date: Mon, 29 Jun 2020 19:56:09 +0200 Subject: [PATCH 01/63] added script snippet to add new options to status-dropdown --- .../userstory-form.component.html | 136 ++++++++++-------- 1 file changed, 75 insertions(+), 61 deletions(-) diff --git a/src/app/userstory-form/userstory-form.component.html b/src/app/userstory-form/userstory-form.component.html index 0b2ddc8..6a2af0f 100644 --- a/src/app/userstory-form/userstory-form.component.html +++ b/src/app/userstory-form/userstory-form.component.html @@ -1,64 +1,78 @@ -
diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index 06d4d17..064d333 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -91,4 +91,9 @@ export class TaskFormComponent implements OnInit { } }); } + + addNewStatus(){ + allStatus + + } } From f292c197ce79e8586939d0c9a9a879de6d85056f Mon Sep 17 00:00:00 2001 From: test Date: Tue, 30 Jun 2020 13:05:09 +0200 Subject: [PATCH 09/63] work on status dropdown --- src/app/task-form/task-form.component.html | 34 ++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index c00d78a..595fff4 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -5,11 +5,12 @@ - +
@@ -70,11 +67,12 @@
- - + + \ No newline at end of file From 8a7e480bf715d55a87f8c449f63894dacf7c9da8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 Jun 2020 13:12:20 +0200 Subject: [PATCH 10/63] added chart.js --- package-lock.json | 36 +- src/app/services/backend.service.ts | 422 ++++++++++++----------- src/app/task-form/task-form.component.ts | 162 ++++----- 3 files changed, 335 insertions(+), 285 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4bd0e35..e1d2616 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2671,6 +2671,16 @@ "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "blob": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", @@ -5140,6 +5150,13 @@ "schema-utils": "^2.6.5" } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "fileset": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", @@ -7868,6 +7885,13 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "dev": true, + "optional": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -12688,7 +12712,11 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "is-binary-path": { "version": "1.0.1", @@ -13091,7 +13119,11 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, - "optional": true + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } }, "is-absolute-url": { "version": "3.0.3", diff --git a/src/app/services/backend.service.ts b/src/app/services/backend.service.ts index 3fa759e..b312c8e 100644 --- a/src/app/services/backend.service.ts +++ b/src/app/services/backend.service.ts @@ -1,265 +1,281 @@ -import {Injectable} from '@angular/core'; -import {HttpClient, HttpResponse} from '@angular/common/http'; -import {Observable} from 'rxjs'; -import {environment} from '../../environments/environment'; - +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) {} - constructor(private httpClient: HttpClient) {} + // Tasks + 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' }); + } - // Tasks - public getTasks(): Observable> { - const url = `${environment.apiUrl}/tasks`; - 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 getTask(id: number): Observable> { - const url = `${environment.apiUrl}/tasks/${id}`; - return this.httpClient.get(url, { observe: 'response' }); - } + public putTask(task: ScrumTask): Observable> { + const url = `${environment.apiUrl}/tasks/${task.id}`; + return this.httpClient.put(url, task, { observe: 'response' }); + } - public postTask(task: ScrumTask): Observable> { - const url = `${environment.apiUrl}/tasks`; - return this.httpClient.post(url, task, { observe: 'response' }); - } + public deleteTask(task: ScrumTask): Observable> { + const url = `${environment.apiUrl}/tasks/${task.id}`; + return this.httpClient.delete(url, { observe: 'response' }); + } - public putTask(task: ScrumTask): Observable> { - const url = `${environment.apiUrl}/tasks/${task.id}`; - return this.httpClient.put(url, task, { observe: 'response' }); - } + // Userstories + public getUserstories(): Observable> { + const url = `${environment.apiUrl}/userstories`; + return this.httpClient.get(url, { observe: 'response' }); + } - public deleteTask(task: ScrumTask): Observable> { - const url = `${environment.apiUrl}/tasks/${task.id}`; - return this.httpClient.delete(url, {observe: 'response'}); - } + public getUserstory(id: number): Observable> { + const url = `${environment.apiUrl}/userstories/${id}`; + return this.httpClient.get(url, { observe: 'response' }); + } + public postUserstory( + userstory: ScrumUserstory + ): Observable> { + const url = `${environment.apiUrl}/userstories`; + return this.httpClient.post(url, userstory, { + observe: 'response', + }); + } - // Userstories - public getUserstories(): Observable> { - const url = `${environment.apiUrl}/userstories`; - return this.httpClient.get(url, { observe: 'response' }); - } + public putUserstory( + userstory: ScrumUserstory + ): Observable> { + const url = `${environment.apiUrl}/userstories/${userstory.id}`; + return this.httpClient.put(url, userstory, { observe: 'response' }); + } - public getUserstory(id: number): Observable> { - const url = `${environment.apiUrl}/userstories/${id}`; - return this.httpClient.get(url, { observe: 'response' }); - } + public deleteUserstory( + userstory: ScrumUserstory + ): Observable> { + const url = `${environment.apiUrl}/userstories/${userstory.id}`; + return this.httpClient.delete(url, { observe: 'response' }); + } - public postUserstory(userstory: ScrumUserstory): Observable> { - const url = `${environment.apiUrl}/userstories`; - return this.httpClient.post(url, userstory, { observe: 'response' }); - } + // Sprints + public getSprints(): Observable> { + const url = `${environment.apiUrl}/sprints`; + return this.httpClient.get(url, { observe: 'response' }); + } - public putUserstory(userstory: ScrumUserstory): Observable> { - const url = `${environment.apiUrl}/userstories/${userstory.id}`; - return this.httpClient.put(url, userstory, { observe: 'response' }); - } + public getSprint(id: number): Observable> { + const url = `${environment.apiUrl}/sprints/${id}`; + return this.httpClient.get(url, { observe: 'response' }); + } - public deleteUserstory(userstory: ScrumUserstory): Observable> { - const url = `${environment.apiUrl}/userstories/${userstory.id}`; - return this.httpClient.delete(url, {observe: 'response'}); - } + public postSprint( + sprint: ScrumSprint + ): Observable> { + const url = `${environment.apiUrl}/sprints`; + return this.httpClient.post(url, sprint, { + observe: 'response', + }); + } + public putSprint(sprint: ScrumSprint): Observable> { + const url = `${environment.apiUrl}/sprints/${sprint.id}`; + return this.httpClient.put(url, sprint, { observe: 'response' }); + } - // Sprints - public getSprints(): Observable> { - const url = `${environment.apiUrl}/sprints`; - return this.httpClient.get(url, { observe: 'response' }); - } + public deleteSprint(sprint: ScrumSprint): Observable> { + const url = `${environment.apiUrl}/sprints/${sprint.id}`; + return this.httpClient.delete(url, { observe: 'response' }); + } - public getSprint(id: number): Observable> { - const url = `${environment.apiUrl}/sprints/${id}`; - return this.httpClient.get(url, { observe: 'response' }); - } + // Categories + public getCategories(): Observable> { + const url = `${environment.apiUrl}/categories`; + return this.httpClient.get(url, { observe: 'response' }); + } - public postSprint(sprint: ScrumSprint): Observable> { - const url = `${environment.apiUrl}/sprints`; - return this.httpClient.post(url, sprint, { observe: 'response' }); - } + public getCategory(id: number): Observable> { + const url = `${environment.apiUrl}/categories/${id}`; + return this.httpClient.get(url, { observe: 'response' }); + } - public putSprint(sprint: ScrumSprint): Observable> { - const url = `${environment.apiUrl}/sprints/${sprint.id}`; - return this.httpClient.put(url, sprint, { observe: 'response' }); - } + public postCategory( + category: ScrumCategory + ): Observable> { + const url = `${environment.apiUrl}/categories`; + return this.httpClient.post(url, category, { + observe: 'response', + }); + } - public deleteSprint(sprint: ScrumSprint): Observable> { - const url = `${environment.apiUrl}/sprints/${sprint.id}`; - return this.httpClient.delete(url, {observe: 'response'}); - } + public putCategory(category: ScrumCategory): Observable> { + const url = `${environment.apiUrl}/categories/${category.id}`; + return this.httpClient.put(url, category, { observe: 'response' }); + } + public deleteCategory( + category: ScrumCategory + ): Observable> { + const url = `${environment.apiUrl}/categories/${category.id}`; + return this.httpClient.delete(url, { observe: 'response' }); + } - // Categories - public getCategories(): Observable> { - const url = `${environment.apiUrl}/categories`; - return this.httpClient.get(url, { observe: 'response' }); - } + // Status + public getAllStatus(): Observable> { + const url = `${environment.apiUrl}/status`; + return this.httpClient.get(url, { observe: 'response' }); + } - public getCategory(id: number): Observable> { - const url = `${environment.apiUrl}/categories/${id}`; - return this.httpClient.get(url, { observe: 'response' }); - } + public getStatus(id: number): Observable> { + const url = `${environment.apiUrl}/status/${id}`; + return this.httpClient.get(url, { observe: 'response' }); + } - public postCategory(category: ScrumCategory): Observable> { - const url = `${environment.apiUrl}/categories`; - return this.httpClient.post(url, category, { observe: 'response' }); - } + public postStatus( + status: ScrumStatus + ): Observable> { + const url = `${environment.apiUrl}/status`; + return this.httpClient.post(url, status, { + observe: 'response', + }); + } - public putCategory(category: ScrumCategory): Observable> { - const url = `${environment.apiUrl}/categories/${category.id}`; - return this.httpClient.put(url, category, { observe: 'response' }); - } + public putStatus(status: ScrumStatus): Observable> { + const url = `${environment.apiUrl}/status/${status.id}`; + return this.httpClient.put(url, status, { observe: 'response' }); + } - public deleteCategory(category: ScrumCategory): Observable> { - const url = `${environment.apiUrl}/categories/${category.id}`; - return this.httpClient.delete(url, { observe: 'response' }); - } + public deleteStatus(status: ScrumStatus): Observable> { + const url = `${environment.apiUrl}/status/${status.id}`; + return this.httpClient.delete(url, { observe: 'response' }); + } + // Users + public getUsers(): Observable> { + const url = `${environment.apiUrl}/users`; + return this.httpClient.get(url, { observe: 'response' }); + } - // Status - public getAllStatus(): Observable> { - const url = `${environment.apiUrl}/status`; - return this.httpClient.get(url, { observe: 'response' }); - } + public getUser(id: number): Observable> { + const url = `${environment.apiUrl}/users/${id}`; + return this.httpClient.get(url, { observe: 'response' }); + } - public getStatus(id: number): Observable> { - const url = `${environment.apiUrl}/status/${id}`; - return this.httpClient.get(url, { observe: 'response' }); - } + public postUser(user: ScrumUser): Observable> { + const url = `${environment.apiUrl}/users`; + return this.httpClient.post(url, user, { observe: 'response' }); + } - public postStatus(status: ScrumStatus): Observable> { - const url = `${environment.apiUrl}/status`; - return this.httpClient.post(url, status, { observe: 'response' }); - } + public putUser(user: ScrumUser): Observable> { + const url = `${environment.apiUrl}/users/${user.id}`; + return this.httpClient.put(url, user, { observe: 'response' }); + } - public putStatus(status: ScrumStatus): Observable> { - const url = `${environment.apiUrl}/status/${status.id}`; - return this.httpClient.put(url, status, { observe: 'response' }); - } + public deleteUser(user: ScrumUser): Observable> { + const url = `${environment.apiUrl}/users/${user.id}`; + return this.httpClient.delete(url, { observe: 'response' }); + } - public deleteStatus(status: ScrumStatus): Observable> { - const url = `${environment.apiUrl}/status/${status.id}`; - return this.httpClient.delete(url, { observe: 'response' }); - } + // Projects + public getProjects(): Observable> { + const url = `${environment.apiUrl}/projects`; + return this.httpClient.get(url, { observe: 'response' }); + } + public getProject(id: number): Observable> { + const url = `${environment.apiUrl}/projects/${id}`; + return this.httpClient.get(url, { observe: 'response' }); + } - // Users - public getUsers(): Observable> { - const url = `${environment.apiUrl}/users`; - return this.httpClient.get(url, { observe: 'response' }); - } + public postProject( + project: ScrumProject + ): Observable> { + const url = `${environment.apiUrl}/projects`; + return this.httpClient.post(url, project, { + observe: 'response', + }); + } - public getUser(id: number): Observable> { - const url = `${environment.apiUrl}/users/${id}`; - return this.httpClient.get(url, { observe: 'response' }); - } + public putProject(project: ScrumProject): Observable> { + const url = `${environment.apiUrl}/projects/${project.id}`; + return this.httpClient.put(url, project, { observe: 'response' }); + } - public postUser(user: ScrumUser): Observable> { - const url = `${environment.apiUrl}/users`; - return this.httpClient.post(url, user, { observe: 'response' }); - } - - public putUser(user: ScrumUser): Observable> { - const url = `${environment.apiUrl}/users/${user.id}`; - return this.httpClient.put(url, user, { observe: 'response' }); - } - - public deleteUser(user: ScrumUser): Observable> { - const url = `${environment.apiUrl}/users/${user.id}`; - return this.httpClient.delete(url, { observe: 'response' }); - } - - - // Projects - public getProjects(): Observable> { - const url = `${environment.apiUrl}/projects`; - return this.httpClient.get(url, { observe: 'response' }); - } - - public getProject(id: number): Observable> { - const url = `${environment.apiUrl}/projects/${id}`; - return this.httpClient.get(url, { observe: 'response' }); - } - - public postProject(project: ScrumProject): Observable> { - const url = `${environment.apiUrl}/projects`; - return this.httpClient.post(url, project, { observe: 'response' }); - } - - public putProject(project: ScrumProject): Observable> { - const url = `${environment.apiUrl}/projects/${project.id}`; - return this.httpClient.put(url, project, { observe: 'response' }); - } - - public deleteProject(project: ScrumProject): Observable> { - const url = `${environment.apiUrl}/projects/${project.id}`; - return this.httpClient.delete(url, { observe: 'response' }); - } + public deleteProject(project: ScrumProject): Observable> { + const url = `${environment.apiUrl}/projects/${project.id}`; + return this.httpClient.delete(url, { observe: 'response' }); + } } export enum Priority { - High="high", - Medium="medium", - Low="low" + High = 'high', + Medium = 'medium', + Low = 'low', } export interface ScrumTask { - id?: number; - title: string; - content?: string; - statusid?: number; - categoryid?: number; - assignedtoid?: number; - sprintid?: number; - projectid?: number; - userstoryid?: number; - priority?: Priority; + id?: number; + title: string; + content?: string; + statusid?: number; + categoryid?: number; + assignedtoid?: number; + sprintid?: number; + projectid?: number; + userstoryid?: number; + priority?: Priority; } export interface ScrumUserstory { - id?: number; - title: string; - content?: string; - priority?: Priority; - statusid?: number; - categoryid?: number; - createdbyid?: number; - projectid?: number; + id?: number; + title: string; + content?: string; + priority?: Priority; + statusid?: number; + categoryid?: number; + createdbyid?: number; + projectid?: number; } -export interface ScrumSprint{ - id?: number; - title: string; - description?: string; - startDate: Date; - endDate: Date; - 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; + id?: number; + title: string; + description?: string; + color?: string; + project: number; } export interface ScrumStatus { - id? : number; - title: string; - description: string; + id?: number; + title: string; + description: string; } - export interface ScrumUser { - id?: number; - name: string; + id?: number; + name: string; } export interface ScrumProject { - id?: number; - title: string; - isprivate: boolean; + 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 064d333..ed7ddbe 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -1,99 +1,101 @@ import { Component, OnInit, Input } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { - BackendService, - ScrumTask, - Priority, - ScrumStatus, - ScrumCategory, - ScrumUser, - ScrumProject, - ScrumUserstory + BackendService, + ScrumTask, + Priority, + ScrumStatus, + ScrumCategory, + ScrumUser, + ScrumProject, + ScrumUserstory, } from '../services/backend.service'; import { Observable } from 'rxjs'; import { HttpResponse } from '@angular/common/http'; @Component({ - selector: 'app-task-form', - templateUrl: './task-form.component.html', - styleUrls: [ './task-form.component.css' ] + selector: 'app-task-form', + templateUrl: './task-form.component.html', + styleUrls: ['./task-form.component.css'], }) export class TaskFormComponent implements OnInit { - @Input() public task: ScrumTask; - public editing: Boolean; - public userstoryId: string; - public userstories: any[] = []; - public allStatus: any[] = []; + @Input() public task: ScrumTask; + public editing: Boolean; + public userstoryId: string; + public userstories: any[] = []; + public allStatus: any[] = []; - constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { - this.getUserStories(); - this.getTaskStatus(); - } + constructor( + private backendService: BackendService, + private activeModalService: NgbActiveModal + ) { + this.getUserStories(); + this.getTaskStatus(); + } - ngOnInit(): void { - if (this.task === null || this.task === undefined) { - this.task = { title: '' }; - this.editing = false; - } else { - this.editing = true; - } - document.getElementById('titleField').focus(); - this.getRelatedStory(); - } + ngOnInit(): void { + if (this.task === null || this.task === undefined) { + this.task = { title: '' }; + this.editing = false; + } else { + this.editing = true; + } + document.getElementById('titleField').focus(); + this.getRelatedStory(); + } - onSubmit() { - if (this.editing) { - this.backendService.putTask(this.task).subscribe((response) => { - if (response.status > 399) { - alert('Fehler'); - } - }); - } else { - this.backendService.postTask(this.task).subscribe((response) => { - if (response.status > 399) { - alert('Fehler'); - } - }); - } - this.activeModalService.close(this.task); - } + onSubmit() { + if (this.editing) { + this.backendService.putTask(this.task).subscribe((response) => { + if (response.status > 399) { + alert('Fehler'); + } + }); + } else { + this.backendService.postTask(this.task).subscribe((response) => { + if (response.status > 399) { + alert('Fehler'); + } + }); + } + this.activeModalService.close(this.task); + } - onClose() { - this.activeModalService.dismiss(this.task); - } + onClose() { + this.activeModalService.dismiss(this.task); + } - getRelatedStory() { - this.backendService.getUserstory(2).subscribe((response) => { - if (response.status > 399) { - alert('Fehler'); - } else { - this.userstoryId = response.body.title; - } - }); - } + getRelatedStory() { + this.backendService.getUserstory(2).subscribe((response) => { + if (response.status > 399) { + alert('Fehler'); + } else { + this.userstoryId = response.body.title; + } + }); + } - getUserStories() { - this.backendService.getUserstories().subscribe((response) => { - if (response.status > 399) { - alert('Fehler'); - } else { - this.userstories.push(...response.body); - } - }); - } + getUserStories() { + this.backendService.getUserstories().subscribe((response) => { + if (response.status > 399) { + alert('Fehler'); + } else { + this.userstories.push(...response.body); + } + }); + } - getTaskStatus() { - this.backendService.getAllStatus().subscribe((response) => { - if (response.status > 399) { - alert('Fehler'); - } else { - this.allStatus.push(...response.body); - } - }); - } + getTaskStatus() { + this.backendService.getAllStatus().subscribe((response) => { + if (response.status > 399) { + alert('Fehler'); + } else { + this.allStatus.push(...response.body); + } + }); + } - addNewStatus(){ - allStatus - - } + // addNewStatus() { + // this.allStatus; + // } } From 89429b49b36e01c54204a1c69ea82a9538d0dbc1 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 Jun 2020 13:23:08 +0200 Subject: [PATCH 11/63] added status title --- src/app/app-routing.module.ts | 12 +- src/app/app.module.ts | 14 +- src/app/dashboard/dashboard.component.css | 4 +- src/app/dashboard/dashboard.component.html | 4 +- src/app/dashboard/dashboard.component.ts | 268 ++++++++++++--------- src/app/task-form/task-form.component.html | 196 +++++++++------ src/app/task-form/task-form.component.ts | 9 + 7 files changed, 296 insertions(+), 211 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 3774aa5..909fbbc 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,21 +1,21 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import {UserstoryTableComponent} from './userstory-table/userstory-table.component'; -import {TaskTableComponent} from './task-table/task-table.component'; +import { UserstoryTableComponent } from './userstory-table/userstory-table.component'; +import { TaskTableComponent } from './task-table/task-table.component'; import { SprintTableComponent } from './sprint-table/sprint-table.component'; -import { DashboardComponent } from './dashboard/dashboard.component'; +// import { DashboardComponent } from './dashboard/dashboard.component'; const routes: Routes = [ { path: 'tasks', component: TaskTableComponent }, { path: 'userstories', component: UserstoryTableComponent }, { path: 'sprints', component: SprintTableComponent }, - { path: 'dashboard', component: DashboardComponent }, + // { path: 'dashboard', component: DashboardComponent }, { path: '', redirectTo: '/tasks', pathMatch: 'full' }, ]; @NgModule({ - imports: [ RouterModule.forRoot(routes) ], - exports: [ RouterModule ] + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule], }) export class AppRoutingModule {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 31855b7..df6ac7c 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -14,7 +14,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { UserstoryTableComponent } from './userstory-table/userstory-table.component'; import { TaskTableComponent } from './task-table/task-table.component'; import { SprintTableComponent } from './sprint-table/sprint-table.component'; -import { DashboardComponent } from './dashboard/dashboard.component'; +// import { DashboardComponent } from './dashboard/dashboard.component'; @NgModule({ declarations: [ @@ -26,18 +26,16 @@ import { DashboardComponent } from './dashboard/dashboard.component'; UserstoryTableComponent, SprintFormComponent, SprintTableComponent, - DashboardComponent + // DashboardComponent, ], imports: [ BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, - NgbModule + NgbModule, ], - providers: [ - BackendService, - ], - bootstrap: [AppComponent] + providers: [BackendService], + bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/src/app/dashboard/dashboard.component.css b/src/app/dashboard/dashboard.component.css index bfaa597..4a386a0 100644 --- a/src/app/dashboard/dashboard.component.css +++ b/src/app/dashboard/dashboard.component.css @@ -1,3 +1,3 @@ -.text-2em { +/* .text-2em { font-size: 2rem; -} +} */ diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index e604953..b63d9f1 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -1,4 +1,4 @@ -
+{% comment %}

Dashboard

@@ -57,4 +57,4 @@
-
+
{% endcomment %} diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 470e6f3..edbe983 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -1,127 +1,159 @@ -import {Component, OnInit} from '@angular/core'; -import Chart from 'chart.js'; -import {BackendService, ScrumStatus, ScrumUser, ScrumUserstory, ScrumSprint} from '../services/backend.service'; +// import { Component, OnInit } from '@angular/core'; +// // import Chart from 'chart.js'; +// import { +// BackendService, +// ScrumStatus, +// ScrumUser, +// ScrumUserstory, +// ScrumSprint, +// } from '../services/backend.service'; -@Component({ - selector: 'app-dashboard', - templateUrl: 'dashboard.component.html', - styleUrls: ['./dashboard.component.css'] -}) -export class DashboardComponent implements OnInit { - /** - * Returns the status that are used by at least one userstory. - */ - public get usedStatus(): ScrumStatus[] { - return this.status.filter(s => this.userstories.find(us => us.statusid === s.id) !== undefined); - } +// @Component({ +// selector: 'app-dashboard', +// templateUrl: 'dashboard.component.html', +// styleUrls: ['./dashboard.component.css'], +// }) +// export class DashboardComponent implements OnInit { +// /** +// * Returns the status that are used by at least one userstory. +// */ +// public get usedStatus(): ScrumStatus[] { +// return this.status.filter( +// (s) => this.userstories.find((us) => us.statusid === s.id) !== undefined +// ); +// } - private status: ScrumStatus[]; - private userstories: ScrumUserstory[]; - private sprints: ScrumSprint[]; +// private status: ScrumStatus[]; +// private userstories: ScrumUserstory[]; +// private sprints: ScrumSprint[]; - constructor(private backendService: BackendService) { - // backendService.getUserstories().subscribe(response => { - // if (response.status > 399) { - // alert('Fehler'); - // } else { - // this.userstories.push(...response.body); - // } - // }); - // backendService.getAllStatus().subscribe(response => { - // if (response.status > 399) { - // alert('Fehler'); - // } else { - // this.status.push(...response.body); - // } - // }); - // backendService.getSprints().subscribe(response => { - // if (response.status > 399) { - // alert('Fehler'); - // } else { - // this.sprints.push(...response.body); - // } - // }); +// constructor(private backendService: BackendService) { +// // backendService.getUserstories().subscribe(response => { +// // if (response.status > 399) { +// // alert('Fehler'); +// // } else { +// // this.userstories.push(...response.body); +// // } +// // }); +// // backendService.getAllStatus().subscribe(response => { +// // if (response.status > 399) { +// // alert('Fehler'); +// // } else { +// // this.status.push(...response.body); +// // } +// // }); +// // backendService.getSprints().subscribe(response => { +// // if (response.status > 399) { +// // alert('Fehler'); +// // } else { +// // this.sprints.push(...response.body); +// // } +// // }); - this.status = [ - {id: 0, title: "In progress", description:""}, - {id: 1, title: "Done", description:""}, - ]; - this.userstories = [ - {statusid: 0, title:""}, - {statusid: 0, title:""}, - {statusid: 0, title:""}, - {statusid: 1, title:""}, - {statusid: 1, title:""}, - ]; - this.sprints = [ - {description:"", title:"", project: 0, startDate: new Date(2020, 5, 22), endDate: new Date(2020, 5, 28)}, - {description:"", title:"", project: 0, startDate: new Date(2020, 5, 29), endDate: new Date(2020, 6, 5)}, - ] - } +// this.status = [ +// { id: 0, title: 'In progress', description: '' }, +// { id: 1, title: 'Done', description: '' }, +// ]; +// this.userstories = [ +// { statusid: 0, title: '' }, +// { statusid: 0, title: '' }, +// { statusid: 0, title: '' }, +// { statusid: 1, title: '' }, +// { statusid: 1, title: '' }, +// ]; +// this.sprints = [ +// { +// description: '', +// title: '', +// project: 0, +// startDate: new Date(2020, 5, 22), +// endDate: new Date(2020, 5, 28), +// }, +// { +// description: '', +// title: '', +// project: 0, +// startDate: new Date(2020, 5, 29), +// endDate: new Date(2020, 6, 5), +// }, +// ]; +// } +// ngOnInit(): void { +// // @ts-ignore +// const context = document +// .getElementById('done-stories-chart') +// .getContext('2d'); +// const chart = new Chart(context, { +// type: 'pie', +// data: { +// labels: this.usedStatus.map((s) => s.title), +// datasets: [ +// { +// label: 'Done stories', +// data: this.usedStatus.map((s) => +// this.getNumberOfUserstoriesByStatus(s) +// ), +// backgroundColor: this.getBackgroundColors(), +// }, +// ], +// }, +// }); +// } - ngOnInit(): void { - // @ts-ignore - const context = document.getElementById('done-stories-chart').getContext('2d'); - const chart = new Chart(context, { - type: 'pie', - data: { - labels: this.usedStatus.map(s => s.title), - datasets: [{ - label: 'Done stories', - data: this.usedStatus.map(s => this.getNumberOfUserstoriesByStatus(s)), - backgroundColor: this.getBackgroundColors(), - }] - } - }); - } +// private getBackgroundColors(): string[] { +// const baseColors = [ +// 'rgb(255, 153, 102)', +// 'rgb(255, 102, 102)', +// 'rgb(153, 204, 255)', +// 'rgb(102, 153, 102)', +// 'rgb(204, 204, 153)', +// 'rgb(153, 102, 204)', +// 'rgb(204, 102, 102)', +// 'rgb(255, 204, 153)', +// 'rgb(153, 102, 255)', +// 'rgb(204, 204, 204)', +// 'rgb(102, 255, 204)', +// 'rgb(102, 153, 255)', +// 'rgb(153, 102, 153)', +// 'rgb(204, 204, 255)', +// ]; +// const colors = []; +// while (colors.length < this.usedStatus.length) { +// colors.push(...baseColors); +// } +// return colors; +// } - private getBackgroundColors(): string[] { - const baseColors = [ - 'rgb(255, 153, 102)', - 'rgb(255, 102, 102)', - 'rgb(153, 204, 255)', - 'rgb(102, 153, 102)', - 'rgb(204, 204, 153)', - 'rgb(153, 102, 204)', - 'rgb(204, 102, 102)', - 'rgb(255, 204, 153)', - 'rgb(153, 102, 255)', - 'rgb(204, 204, 204)', - 'rgb(102, 255, 204)', - 'rgb(102, 153, 255)', - 'rgb(153, 102, 153)', - 'rgb(204, 204, 255)', - ]; - const colors = []; - while (colors.length < this.usedStatus.length) { - colors.push(...baseColors); - } - return colors; - } +// public getNumberOfUserstoriesByStatus(status: ScrumStatus): number { +// return this.userstories.filter((us) => us.statusid === status.id).length; +// } - public getNumberOfUserstoriesByStatus(status: ScrumStatus): number { - return this.userstories.filter(us => us.statusid === status.id).length; - } +// public getRemainingDaysInSprint(): number { +// const now = new Date(); +// const currentSprint = this.sprints.find( +// (s) => s.endDate > now && s.startDate < now +// ); +// if (currentSprint === undefined) { +// return undefined; +// } +// const daysDelta = Math.floor( +// (currentSprint.endDate.getTime() - now.getTime()) / 86400000 +// ); +// return daysDelta; +// } - public getRemainingDaysInSprint(): number { - const now = new Date(); - const currentSprint = this.sprints.find(s => s.endDate > now && s.startDate < now); - if (currentSprint === undefined) { - return undefined; - } - const daysDelta = Math.floor((currentSprint.endDate.getTime() - now.getTime()) / 86400000); - return daysDelta; - } - - public getSprintUrgency(): number { - const now = new Date(); - const currentSprint = this.sprints.find(s => s.endDate > now && s.startDate < now); - if (currentSprint === undefined) { - return undefined; - } - const deltaFromNow = currentSprint.endDate.getTime() - now.getTime(); - const deltaFromStart = currentSprint.endDate.getTime() - currentSprint.startDate.getTime(); - return Math.floor(3 * deltaFromNow / deltaFromStart); - } -} +// public getSprintUrgency(): number { +// const now = new Date(); +// const currentSprint = this.sprints.find( +// (s) => s.endDate > now && s.startDate < now +// ); +// if (currentSprint === undefined) { +// return undefined; +// } +// const deltaFromNow = currentSprint.endDate.getTime() - now.getTime(); +// const deltaFromStart = +// currentSprint.endDate.getTime() - currentSprint.startDate.getTime(); +// return Math.floor((3 * deltaFromNow) / deltaFromStart); +// } +// } diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index 595fff4..b6b4015 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -1,78 +1,124 @@ + + + diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index ed7ddbe..a22c025 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -24,6 +24,7 @@ export class TaskFormComponent implements OnInit { public userstoryId: string; public userstories: any[] = []; public allStatus: any[] = []; + public status: ScrumStatus; constructor( private backendService: BackendService, @@ -95,6 +96,14 @@ export class TaskFormComponent implements OnInit { }); } + createTaskStatus() { + this.backendService.postStatus(this.status).subscribe((response) => { + if (response.status > 399) { + alert('Fehler'); + } + }); + } + // addNewStatus() { // this.allStatus; // } From ac73063b6eb6fb4d0f29c2df9b391607ecf72f23 Mon Sep 17 00:00:00 2001 From: test Date: Tue, 30 Jun 2020 14:12:13 +0200 Subject: [PATCH 12/63] . --- src/app/task-form/task-form.component.html | 215 ++++++++++----------- 1 file changed, 98 insertions(+), 117 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index b6b4015..ccb5b46 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -1,124 +1,105 @@ - + +
+ + +
+ + + + + + \ No newline at end of file From d8fc2766a9f963201a43f411f7dba23733f7ed13 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 Jun 2020 14:32:41 +0200 Subject: [PATCH 13/63] add status logic for adding --- src/app/task-form/task-form.component.html | 10 ++++++---- src/app/task-form/task-form.component.ts | 4 ---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index b6b4015..17ae4b5 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -17,9 +17,11 @@ name="prio" [(ngModel)]="task.priority" > - + - - diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index be575cb..c8860e7 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -64,7 +64,7 @@ export class TaskFormComponent implements OnInit { } getRelatedStory() { - this.backendService.getUserstory(2).subscribe((response) => { + this.backendService.getUserstory(this.task.userstoryid).subscribe((response) => { if (response.status > 399) { alert('Fehler'); } else { From 8d255ad61e024128bac6125ef9318125c02df4c8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 30 Jun 2020 16:43:02 +0200 Subject: [PATCH 19/63] userstory dropdown only when creating task --- src/app/task-form/task-form.component.html | 4 ++-- src/app/task-form/task-form.component.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index 8adfa23..9890d0b 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -5,12 +5,12 @@ - - diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index c8860e7..8774b80 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -20,7 +20,8 @@ import { HttpResponse } from '@angular/common/http'; }) export class TaskFormComponent implements OnInit { @Input() public task: ScrumTask; - public editing: Boolean; + public editing: boolean; + public creating: boolean; public userstoryId: string; public userstories: any[] = []; public allStatus: any[] = []; @@ -35,8 +36,11 @@ export class TaskFormComponent implements OnInit { if (this.task === null || this.task === undefined) { this.task = { title: '' }; this.editing = false; - } else { + this.creating = false; + } else if (this.task.userstoryid) { this.editing = true; + } else { + this.creating = true; } document.getElementById('titleField').focus(); this.getRelatedStory(); From 14a489c77901af223bd2bf9914bc7ba01202faf1 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 1 Jul 2020 08:59:07 +0200 Subject: [PATCH 20/63] deleted commentars --- src/app/task-form/task-form.component.html | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index 9890d0b..ed5c8aa 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -60,24 +60,10 @@ - -
From af081d6c1fbb8afbc605c9203d130ab9f6e8a7b3 Mon Sep 17 00:00:00 2001 From: test Date: Wed, 1 Jul 2020 14:22:58 +0200 Subject: [PATCH 21/63] . --- src/app/task-form/task-form.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index 9890d0b..a0b2f86 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -58,9 +58,9 @@
From df1b3be4ecf2f206660244b738fe7b01766213a8 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 1 Jul 2020 16:31:50 +0200 Subject: [PATCH 22/63] declared status variable --- src/app/task-form/task-form.component.html | 2 +- src/app/task-form/task-form.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index ed5c8aa..0a90a8d 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -60,7 +60,7 @@ diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index 8774b80..c50dac2 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -25,7 +25,7 @@ export class TaskFormComponent implements OnInit { public userstoryId: string; public userstories: any[] = []; public allStatus: any[] = []; - public status: ScrumStatus; + public status: ScrumStatus = { title: '', description: '' }; constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { this.getUserStories(); From 1c858b15298b5880ee3ec3b4d556a9c715d4651f Mon Sep 17 00:00:00 2001 From: Niggl Date: Thu, 2 Jul 2020 09:17:17 +0200 Subject: [PATCH 23/63] Dropdown Menu --- angular.json | 4 +++- src/app/task-form/task-form.component.html | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/angular.json b/angular.json index 226ed4c..8e0bc83 100644 --- a/angular.json +++ b/angular.json @@ -29,7 +29,9 @@ "src/styles.css", "src/assets/scss/black-dashboard.scss" ], - "scripts": [] + "scripts": [ + "node_modules/bootstrap/dist/js/bootstrap.min.js" + ] }, "configurations": { "production": { diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index 0a90a8d..7d93e0e 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -50,19 +50,35 @@
+ + - +
+
From 5db11cc27656981955a41fecc2e5eb51b9fcc4c7 Mon Sep 17 00:00:00 2001 From: Niggl Date: Thu, 2 Jul 2020 09:25:54 +0200 Subject: [PATCH 24/63] New Prio selector --- src/app/task-form/task-form.component.html | 14 +++++++------- src/app/task-form/task-form.component.ts | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index 7d93e0e..9d98909 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -29,13 +29,13 @@
-
- - +
diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts index c50dac2..e2f3c76 100644 --- a/src/app/task-form/task-form.component.ts +++ b/src/app/task-form/task-form.component.ts @@ -112,4 +112,8 @@ export class TaskFormComponent implements OnInit { } }); } + + public getAllPriorities(): string[] { + return Object.values(Priority); + } } From d9aef5a4d706b7f9dd02adc82601c150390a6457 Mon Sep 17 00:00:00 2001 From: Niggl Date: Thu, 2 Jul 2020 09:42:09 +0200 Subject: [PATCH 25/63] Better userstory selector --- src/app/task-form/task-form.component.html | 16 +++++++++------- src/app/task-form/task-form.component.ts | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index 9d98909..aec9012 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -5,14 +5,16 @@ - + - - - From 18160c41276ddfed67ee680e5b57cd4ee07334a8 Mon Sep 17 00:00:00 2001 From: Niggl Date: Thu, 2 Jul 2020 10:18:52 +0200 Subject: [PATCH 27/63] Status dropdown now w/ add and delete working --- src/app/task-form/task-form.component.html | 14 +++++-------- src/app/task-form/task-form.component.ts | 23 +++++++++++++++++----- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html index 572a4fb..99f9f2c 100644 --- a/src/app/task-form/task-form.component.html +++ b/src/app/task-form/task-form.component.html @@ -53,21 +53,17 @@