added chart.js
This commit is contained in:
		
							
								
								
									
										36
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										36
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -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",
 | 
			
		||||
 
 | 
			
		||||
@@ -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<HttpResponse<ScrumTask[]>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/tasks`;
 | 
			
		||||
    return this.httpClient.get<ScrumTask[]>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public getTask(id: number): Observable<HttpResponse<ScrumTask>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/tasks/${id}`;
 | 
			
		||||
    return this.httpClient.get<ScrumTask>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    // Tasks
 | 
			
		||||
    public getTasks(): Observable<HttpResponse<ScrumTask[]>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/tasks`;
 | 
			
		||||
        return this.httpClient.get<ScrumTask[]>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public postTask(task: ScrumTask): Observable<HttpResponse<ScrumTask>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/tasks`;
 | 
			
		||||
    return this.httpClient.post<ScrumTask>(url, task, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public getTask(id: number): Observable<HttpResponse<ScrumTask>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/tasks/${id}`;
 | 
			
		||||
        return this.httpClient.get<ScrumTask>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public putTask(task: ScrumTask): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/tasks/${task.id}`;
 | 
			
		||||
    return this.httpClient.put(url, task, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public postTask(task: ScrumTask): Observable<HttpResponse<ScrumTask>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/tasks`;
 | 
			
		||||
        return this.httpClient.post<ScrumTask>(url, task, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public deleteTask(task: ScrumTask): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/tasks/${task.id}`;
 | 
			
		||||
    return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public putTask(task: ScrumTask): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/tasks/${task.id}`;
 | 
			
		||||
        return this.httpClient.put(url, task, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  // Userstories
 | 
			
		||||
  public getUserstories(): Observable<HttpResponse<ScrumUserstory[]>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/userstories`;
 | 
			
		||||
    return this.httpClient.get<ScrumUserstory[]>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public deleteTask(task: ScrumTask): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/tasks/${task.id}`;
 | 
			
		||||
        return this.httpClient.delete(url, {observe: 'response'});
 | 
			
		||||
    }
 | 
			
		||||
  public getUserstory(id: number): Observable<HttpResponse<ScrumUserstory>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/userstories/${id}`;
 | 
			
		||||
    return this.httpClient.get<ScrumUserstory>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public postUserstory(
 | 
			
		||||
    userstory: ScrumUserstory
 | 
			
		||||
  ): Observable<HttpResponse<ScrumUserstory>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/userstories`;
 | 
			
		||||
    return this.httpClient.post<ScrumUserstory>(url, userstory, {
 | 
			
		||||
      observe: 'response',
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    // Userstories
 | 
			
		||||
    public getUserstories(): Observable<HttpResponse<ScrumUserstory[]>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/userstories`;
 | 
			
		||||
        return this.httpClient.get<ScrumUserstory[]>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public putUserstory(
 | 
			
		||||
    userstory: ScrumUserstory
 | 
			
		||||
  ): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/userstories/${userstory.id}`;
 | 
			
		||||
    return this.httpClient.put(url, userstory, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public getUserstory(id: number): Observable<HttpResponse<ScrumUserstory>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/userstories/${id}`;
 | 
			
		||||
        return this.httpClient.get<ScrumUserstory>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public deleteUserstory(
 | 
			
		||||
    userstory: ScrumUserstory
 | 
			
		||||
  ): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/userstories/${userstory.id}`;
 | 
			
		||||
    return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public postUserstory(userstory: ScrumUserstory): Observable<HttpResponse<ScrumUserstory>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/userstories`;
 | 
			
		||||
        return this.httpClient.post<ScrumUserstory>(url, userstory, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  // Sprints
 | 
			
		||||
  public getSprints(): Observable<HttpResponse<ScrumSprint[]>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/sprints`;
 | 
			
		||||
    return this.httpClient.get<ScrumSprint[]>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public putUserstory(userstory: ScrumUserstory): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/userstories/${userstory.id}`;
 | 
			
		||||
        return this.httpClient.put(url, userstory, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public getSprint(id: number): Observable<HttpResponse<ScrumSprint>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/sprints/${id}`;
 | 
			
		||||
    return this.httpClient.get<ScrumSprint>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public deleteUserstory(userstory: ScrumUserstory): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/userstories/${userstory.id}`;
 | 
			
		||||
        return this.httpClient.delete(url, {observe: 'response'});
 | 
			
		||||
    }
 | 
			
		||||
  public postSprint(
 | 
			
		||||
    sprint: ScrumSprint
 | 
			
		||||
  ): Observable<HttpResponse<ScrumSprint>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/sprints`;
 | 
			
		||||
    return this.httpClient.post<ScrumSprint>(url, sprint, {
 | 
			
		||||
      observe: 'response',
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public putSprint(sprint: ScrumSprint): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/sprints/${sprint.id}`;
 | 
			
		||||
    return this.httpClient.put(url, sprint, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    // Sprints
 | 
			
		||||
    public getSprints(): Observable<HttpResponse<ScrumSprint[]>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/sprints`;
 | 
			
		||||
        return this.httpClient.get<ScrumSprint[]>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public deleteSprint(sprint: ScrumSprint): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/sprints/${sprint.id}`;
 | 
			
		||||
    return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public getSprint(id: number): Observable<HttpResponse<ScrumSprint>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/sprints/${id}`;
 | 
			
		||||
        return this.httpClient.get<ScrumSprint>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  // Categories
 | 
			
		||||
  public getCategories(): Observable<HttpResponse<ScrumCategory[]>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/categories`;
 | 
			
		||||
    return this.httpClient.get<ScrumCategory[]>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public postSprint(sprint: ScrumSprint): Observable<HttpResponse<ScrumSprint>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/sprints`;
 | 
			
		||||
        return this.httpClient.post<ScrumSprint>(url, sprint, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public getCategory(id: number): Observable<HttpResponse<ScrumCategory>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/categories/${id}`;
 | 
			
		||||
    return this.httpClient.get<ScrumCategory>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public putSprint(sprint: ScrumSprint): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/sprints/${sprint.id}`;
 | 
			
		||||
        return this.httpClient.put(url, sprint, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public postCategory(
 | 
			
		||||
    category: ScrumCategory
 | 
			
		||||
  ): Observable<HttpResponse<ScrumCategory>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/categories`;
 | 
			
		||||
    return this.httpClient.post<ScrumCategory>(url, category, {
 | 
			
		||||
      observe: 'response',
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public deleteSprint(sprint: ScrumSprint): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/sprints/${sprint.id}`;
 | 
			
		||||
        return this.httpClient.delete(url, {observe: 'response'});
 | 
			
		||||
    }
 | 
			
		||||
  public putCategory(category: ScrumCategory): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/categories/${category.id}`;
 | 
			
		||||
    return this.httpClient.put(url, category, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public deleteCategory(
 | 
			
		||||
    category: ScrumCategory
 | 
			
		||||
  ): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/categories/${category.id}`;
 | 
			
		||||
    return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    // Categories
 | 
			
		||||
    public getCategories(): Observable<HttpResponse<ScrumCategory[]>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/categories`;
 | 
			
		||||
        return this.httpClient.get<ScrumCategory[]>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  // Status
 | 
			
		||||
  public getAllStatus(): Observable<HttpResponse<ScrumStatus[]>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/status`;
 | 
			
		||||
    return this.httpClient.get<ScrumStatus[]>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public getCategory(id: number): Observable<HttpResponse<ScrumCategory>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/categories/${id}`;
 | 
			
		||||
        return this.httpClient.get<ScrumCategory>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public getStatus(id: number): Observable<HttpResponse<ScrumStatus>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/status/${id}`;
 | 
			
		||||
    return this.httpClient.get<ScrumStatus>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public postCategory(category: ScrumCategory): Observable<HttpResponse<ScrumCategory>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/categories`;
 | 
			
		||||
        return this.httpClient.post<ScrumCategory>(url, category, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public postStatus(
 | 
			
		||||
    status: ScrumStatus
 | 
			
		||||
  ): Observable<HttpResponse<ScrumStatus>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/status`;
 | 
			
		||||
    return this.httpClient.post<ScrumStatus>(url, status, {
 | 
			
		||||
      observe: 'response',
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public putCategory(category: ScrumCategory): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/categories/${category.id}`;
 | 
			
		||||
        return this.httpClient.put(url, category, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public putStatus(status: ScrumStatus): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/status/${status.id}`;
 | 
			
		||||
    return this.httpClient.put(url, status, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public deleteCategory(category: ScrumCategory): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/categories/${category.id}`;
 | 
			
		||||
        return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public deleteStatus(status: ScrumStatus): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/status/${status.id}`;
 | 
			
		||||
    return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Users
 | 
			
		||||
  public getUsers(): Observable<HttpResponse<ScrumUser[]>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/users`;
 | 
			
		||||
    return this.httpClient.get<ScrumUser[]>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    // Status
 | 
			
		||||
    public getAllStatus(): Observable<HttpResponse<ScrumStatus[]>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/status`;
 | 
			
		||||
        return this.httpClient.get<ScrumStatus[]>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public getUser(id: number): Observable<HttpResponse<ScrumUser>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/users/${id}`;
 | 
			
		||||
    return this.httpClient.get<ScrumUser>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public getStatus(id: number): Observable<HttpResponse<ScrumStatus>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/status/${id}`;
 | 
			
		||||
        return this.httpClient.get<ScrumStatus>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public postUser(user: ScrumUser): Observable<HttpResponse<ScrumUser>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/users`;
 | 
			
		||||
    return this.httpClient.post<ScrumUser>(url, user, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public postStatus(status: ScrumStatus): Observable<HttpResponse<ScrumStatus>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/status`;
 | 
			
		||||
        return this.httpClient.post<ScrumStatus>(url, status, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public putUser(user: ScrumUser): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/users/${user.id}`;
 | 
			
		||||
    return this.httpClient.put(url, user, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public putStatus(status: ScrumStatus): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/status/${status.id}`;
 | 
			
		||||
        return this.httpClient.put(url, status, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public deleteUser(user: ScrumUser): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/users/${user.id}`;
 | 
			
		||||
    return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public deleteStatus(status: ScrumStatus): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/status/${status.id}`;
 | 
			
		||||
        return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  // Projects
 | 
			
		||||
  public getProjects(): Observable<HttpResponse<ScrumProject[]>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/projects`;
 | 
			
		||||
    return this.httpClient.get<ScrumProject[]>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public getProject(id: number): Observable<HttpResponse<ScrumProject>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/projects/${id}`;
 | 
			
		||||
    return this.httpClient.get<ScrumProject>(url, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    // Users
 | 
			
		||||
    public getUsers(): Observable<HttpResponse<ScrumUser[]>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/users`;
 | 
			
		||||
        return this.httpClient.get<ScrumUser[]>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public postProject(
 | 
			
		||||
    project: ScrumProject
 | 
			
		||||
  ): Observable<HttpResponse<ScrumProject>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/projects`;
 | 
			
		||||
    return this.httpClient.post<ScrumProject>(url, project, {
 | 
			
		||||
      observe: 'response',
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public getUser(id: number): Observable<HttpResponse<ScrumUser>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/users/${id}`;
 | 
			
		||||
        return this.httpClient.get<ScrumUser>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public putProject(project: ScrumProject): Observable<HttpResponse<any>> {
 | 
			
		||||
    const url = `${environment.apiUrl}/projects/${project.id}`;
 | 
			
		||||
    return this.httpClient.put(url, project, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
    public postUser(user: ScrumUser): Observable<HttpResponse<ScrumUser>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/users`;
 | 
			
		||||
        return this.httpClient.post<ScrumUser>(url, user, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public putUser(user: ScrumUser): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/users/${user.id}`;
 | 
			
		||||
        return this.httpClient.put(url, user, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public deleteUser(user: ScrumUser): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/users/${user.id}`;
 | 
			
		||||
        return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // Projects
 | 
			
		||||
    public getProjects(): Observable<HttpResponse<ScrumProject[]>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/projects`;
 | 
			
		||||
        return this.httpClient.get<ScrumProject[]>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public getProject(id: number): Observable<HttpResponse<ScrumProject>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/projects/${id}`;
 | 
			
		||||
        return this.httpClient.get<ScrumProject>(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public postProject(project: ScrumProject): Observable<HttpResponse<ScrumProject>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/projects`;
 | 
			
		||||
        return this.httpClient.post<ScrumProject>(url, project, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public putProject(project: ScrumProject): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/projects/${project.id}`;
 | 
			
		||||
        return this.httpClient.put(url, project, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public deleteProject(project: ScrumProject): Observable<HttpResponse<any>> {
 | 
			
		||||
        const url = `${environment.apiUrl}/projects/${project.id}`;
 | 
			
		||||
        return this.httpClient.delete(url, { observe: 'response' });
 | 
			
		||||
    }
 | 
			
		||||
  public deleteProject(project: ScrumProject): Observable<HttpResponse<any>> {
 | 
			
		||||
    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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
  // }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user