Merge branch 'master' into deployment/cicd
This commit is contained in:
commit
892b818a65
@ -9,6 +9,8 @@ export class BackendService {
|
|||||||
|
|
||||||
constructor(private httpClient: HttpClient) {}
|
constructor(private httpClient: HttpClient) {}
|
||||||
|
|
||||||
|
|
||||||
|
// Tasks
|
||||||
public getTasks(): Observable<HttpResponse<ScrumTask[]>> {
|
public getTasks(): Observable<HttpResponse<ScrumTask[]>> {
|
||||||
const url = `${environment.apiUrl}/tasks`;
|
const url = `${environment.apiUrl}/tasks`;
|
||||||
return this.httpClient.get<ScrumTask[]>(url, { observe: 'response' });
|
return this.httpClient.get<ScrumTask[]>(url, { observe: 'response' });
|
||||||
@ -35,8 +37,7 @@ export class BackendService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Userstories
|
||||||
|
|
||||||
public getUserstories(): Observable<HttpResponse<ScrumUserstory[]>> {
|
public getUserstories(): Observable<HttpResponse<ScrumUserstory[]>> {
|
||||||
const url = `${environment.apiUrl}/userstories`;
|
const url = `${environment.apiUrl}/userstories`;
|
||||||
return this.httpClient.get<ScrumUserstory[]>(url, { observe: 'response' });
|
return this.httpClient.get<ScrumUserstory[]>(url, { observe: 'response' });
|
||||||
@ -62,6 +63,140 @@ export class BackendService {
|
|||||||
return this.httpClient.delete(url, {observe: 'response'});
|
return this.httpClient.delete(url, {observe: 'response'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Sprints
|
||||||
|
public getSprints(): Observable<HttpResponse<ScrumSprint[]>> {
|
||||||
|
const url = `${environment.apiUrl}/sprints`;
|
||||||
|
return this.httpClient.get<ScrumSprint[]>(url, { observe: 'response' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public getSprint(id: number): Observable<HttpResponse<ScrumSprint>> {
|
||||||
|
const url = `${environment.apiUrl}/sprints/${id}`;
|
||||||
|
return this.httpClient.get<ScrumSprint>(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' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public deleteSprint(sprint: ScrumSprint): Observable<HttpResponse<any>> {
|
||||||
|
const url = `${environment.apiUrl}/sprints/${sprint.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' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public getCategory(id: number): Observable<HttpResponse<ScrumCategory>> {
|
||||||
|
const url = `${environment.apiUrl}/categories/${id}`;
|
||||||
|
return this.httpClient.get<ScrumCategory>(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 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' });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Status
|
||||||
|
public getAllStatus(): Observable<HttpResponse<ScrumStatus[]>> {
|
||||||
|
const url = `${environment.apiUrl}/status`;
|
||||||
|
return this.httpClient.get<ScrumStatus[]>(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 postStatus(status: ScrumStatus): Observable<HttpResponse<ScrumStatus>> {
|
||||||
|
const url = `${environment.apiUrl}/status`;
|
||||||
|
return this.httpClient.post<ScrumStatus>(url, status, { 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 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' });
|
||||||
|
}
|
||||||
|
|
||||||
|
public getUser(id: number): Observable<HttpResponse<ScrumUser>> {
|
||||||
|
const url = `${environment.apiUrl}/users/${id}`;
|
||||||
|
return this.httpClient.get<ScrumUser>(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 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' });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Priority {
|
export enum Priority {
|
||||||
@ -128,5 +263,3 @@ export interface ScrumProject {
|
|||||||
title: string;
|
title: string;
|
||||||
isprivate: boolean;
|
isprivate: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,18 +1,23 @@
|
|||||||
<div class="modal-content p-3">
|
<div class="modal-content p-3">
|
||||||
|
<div>
|
||||||
|
<button (click) ="onClose()" type="button" class="close" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<form (ngSubmit)="onSubmit()">
|
<form (ngSubmit)="onSubmit()">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Title">Titel</label>
|
<label for="Title">Titel</label>
|
||||||
<input type="text" class="form-control" id="Title" required name="title" [(ngModel)]="title">
|
<input type="text" class="form-control" id="Title" required name="title" [(ngModel)]="task.title">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Inhalt">Inhalt</label>
|
<label for="Inhalt">Inhalt</label>
|
||||||
<input type="text" class="form-control" id="Content" required name="content" [(ngModel)]="content">
|
<input type="text" class="form-control" id="Content" required name="content" [(ngModel)]="task.content">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Prio">Prio</label>
|
<label for="Prio">Prio</label>
|
||||||
<select class="form-control" id="prio" required name="prio" [(ngModel)]="prio">
|
<select class="form-control" id="prio" required name="prio" [(ngModel)]="task.priority">
|
||||||
<option value="low">Low</option>
|
<option value="low">Low</option>
|
||||||
<option value="medium">Medium</option>
|
<option value="medium">Medium</option>
|
||||||
<option value="high">High</option>
|
<option value="high">High</option>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Component, OnInit, Input } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { BackendService, ScrumTask, Priority } from '../services/backend.service';
|
import { BackendService, ScrumTask, Priority, ScrumStatus, ScrumCategory, ScrumUser, ScrumProject } from '../services/backend.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-task-form',
|
selector: 'app-task-form',
|
||||||
@ -9,29 +9,25 @@ import { BackendService, ScrumTask, Priority } from '../services/backend.service
|
|||||||
})
|
})
|
||||||
export class TaskFormComponent implements OnInit {
|
export class TaskFormComponent implements OnInit {
|
||||||
|
|
||||||
public title: string;
|
|
||||||
public content: string;
|
|
||||||
public prio: Priority;
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
public task: ScrumTask;
|
public task: ScrumTask;
|
||||||
private submitted: boolean;
|
public editing: Boolean;
|
||||||
|
|
||||||
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { }
|
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.task !== null && this.task !== undefined) {
|
if (this.task === null || this.task === undefined) {
|
||||||
this.title = this.task.title;
|
this.task = {title: ""};
|
||||||
this.content = this.task.content;
|
this.editing = false;
|
||||||
this.prio = this.task.priority;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.editing = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
if (this.task !== null && this.task !== undefined) {
|
if (this.editing) {
|
||||||
this.task.title = this.title;
|
|
||||||
this.task.content = this.content;
|
|
||||||
this.task.priority = this.prio;
|
|
||||||
this.backendService.putTask(this.task).subscribe(response => {
|
this.backendService.putTask(this.task).subscribe(response => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
alert('Fehler');
|
alert('Fehler');
|
||||||
@ -39,14 +35,16 @@ export class TaskFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.task = { title: this.title, content: this.content, priority: this.prio };
|
|
||||||
this.backendService.postTask(this.task).subscribe(response => {
|
this.backendService.postTask(this.task).subscribe(response => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
alert('Fehler');
|
alert('Fehler');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.submitted = true;
|
|
||||||
this.activeModalService.close(this.task);
|
this.activeModalService.close(this.task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onClose(){
|
||||||
|
this.activeModalService.dismiss(this.task);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,23 @@
|
|||||||
<div class="modal-content p-3">
|
<div class="modal-content p-3">
|
||||||
|
<div>
|
||||||
|
<button (click) ="onClose()" type="button" class="close" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<form (ngSubmit)="onSubmit()">
|
<form (ngSubmit)="onSubmit()">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Title">Titel</label>
|
<label for="Title">Titel</label>
|
||||||
<input type="text" class="form-control" id="Title" required name="title" [(ngModel)]="title">
|
<input type="text" class="form-control" id="Title" required name="title" [(ngModel)]="userstory.title">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Inhalt">Inhalt</label>
|
<label for="Inhalt">Inhalt</label>
|
||||||
<input type="text" class="form-control" id="Content" required name="content" [(ngModel)]="content">
|
<input type="text" class="form-control" id="Content" required name="content" [(ngModel)]="userstory.content">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="Prio">Prio</label>
|
<label for="Prio">Prio</label>
|
||||||
<select class="form-control" id="prio" required name="prio" [(ngModel)]="prio">
|
<select class="form-control" id="prio" required name="prio" [(ngModel)]="userstory.priority">
|
||||||
<option value="low">Low</option>
|
<option value="low">Low</option>
|
||||||
<option value="medium">Medium</option>
|
<option value="medium">Medium</option>
|
||||||
<option value="high">High</option>
|
<option value="high">High</option>
|
||||||
|
@ -9,29 +9,26 @@ import { BackendService, ScrumUserstory, Priority } from '../services/backend.se
|
|||||||
})
|
})
|
||||||
export class UserstoryFormComponent implements OnInit {
|
export class UserstoryFormComponent implements OnInit {
|
||||||
|
|
||||||
public title: string;
|
|
||||||
public content: string;
|
|
||||||
public prio: Priority;
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
public userstory: ScrumUserstory;
|
public userstory: ScrumUserstory;
|
||||||
private submitted: boolean;
|
private editing: boolean;
|
||||||
|
|
||||||
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { }
|
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.userstory !== null && this.userstory !== undefined) {
|
if (this.userstory === null || this.userstory === undefined) {
|
||||||
this.title = this.userstory.title;
|
this.userstory = {title: ""};
|
||||||
this.content = this.userstory.content;
|
this.editing = false;
|
||||||
this.prio = this.userstory.priority;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.editing = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
if (this.userstory !== null && this.userstory !== undefined) {
|
if (this.editing) {
|
||||||
this.userstory.title = this.title;
|
|
||||||
this.userstory.content = this.content;
|
|
||||||
this.userstory.priority = this.prio;
|
|
||||||
this.backendService.putUserstory(this.userstory).subscribe(response => {
|
this.backendService.putUserstory(this.userstory).subscribe(response => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
alert('Fehler');
|
alert('Fehler');
|
||||||
@ -39,14 +36,15 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.userstory = { title: this.title, content: this.content, priority: this.prio };
|
|
||||||
this.backendService.postUserstory(this.userstory).subscribe(response => {
|
this.backendService.postUserstory(this.userstory).subscribe(response => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
alert('Fehler');
|
alert('Fehler');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.submitted = true;
|
|
||||||
this.activeModalService.close(this.userstory);
|
this.activeModalService.close(this.userstory);
|
||||||
}
|
}
|
||||||
|
onClose(){
|
||||||
|
this.activeModalService.dismiss(this.userstory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user