diff --git a/src/app/sprint-form/sprint-form.component.html b/src/app/sprint-form/sprint-form.component.html
index bb00ac8..fe3fb87 100644
--- a/src/app/sprint-form/sprint-form.component.html
+++ b/src/app/sprint-form/sprint-form.component.html
@@ -1,4 +1,4 @@
-
+
diff --git a/src/app/task-form/task-form.component.html b/src/app/task-form/task-form.component.html
index d653550..680ec5a 100644
--- a/src/app/task-form/task-form.component.html
+++ b/src/app/task-form/task-form.component.html
@@ -1,3 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/src/app/task-form/task-form.component.ts b/src/app/task-form/task-form.component.ts
index 2f036f1..d7cf7b9 100644
--- a/src/app/task-form/task-form.component.ts
+++ b/src/app/task-form/task-form.component.ts
@@ -1,3 +1,4 @@
+// Importing necessary components and interfaces.
import { Component, OnInit, Input } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import {
@@ -16,8 +17,10 @@ import { HttpResponse } from '@angular/common/http';
@Component({
selector: 'app-task-form',
templateUrl: './task-form.component.html',
- styleUrls: [ './task-form.component.css' ]
+ styleUrls: ['./task-form.component.css']
})
+
+// Class implements the logic for a popup window form to create and modify tasks.
export class TaskFormComponent implements OnInit {
@Input() public task: ScrumTask;
public editing: boolean;
@@ -25,7 +28,7 @@ export class TaskFormComponent implements OnInit {
public userstoryId: string;
public userstories: any[] = [];
public allStatus: any[] = [];
- public status: ScrumStatus = {title: "", description: ""};
+ public status: ScrumStatus = { title: "", description: "" };
public allUser: any[] = [];
public user: ScrumUser = { name: "" };
@@ -35,6 +38,8 @@ export class TaskFormComponent implements OnInit {
this.getAllUsers();
}
+ // If no task exists a new one will be created.
+ // In other cases the task exists and gets modifiable.
ngOnInit(): void {
if (this.task === null || this.task === undefined) {
this.task = { title: '' };
@@ -48,7 +53,8 @@ export class TaskFormComponent implements OnInit {
document.getElementById('titleField').focus();
this.getRelatedStory();
}
-
+ // A new created task will be saved in backend (POST).
+ // If a task already exists, modifying results an update (PUT) to the backend.
onSubmit() {
if (this.editing) {
this.backendService.putTask(this.task).subscribe((response) => {
@@ -63,16 +69,19 @@ export class TaskFormComponent implements OnInit {
}
});
}
+ // Closes the popup window after submitting/canceling.
this.activeModalService.close(this.task);
}
+ // Closes the popup form window (by clicking "close button").
onClose() {
this.activeModalService.dismiss(this.task);
}
+ // Getting the userstory which is related to a task.
+ // The related story will be shown in popup window of a task.
getRelatedStory() {
- if(!this.task.userstoryid)
- {
+ if (!this.task.userstoryid) {
return null;
}
this.backendService.getUserstory(this.task.userstoryid).subscribe((response) => {
@@ -84,6 +93,7 @@ export class TaskFormComponent implements OnInit {
});
}
+ // Getting all userstories from backend to show in a dropdown in popup window.
getUserStories() {
this.backendService.getUserstories().subscribe((response) => {
if (response.status > 399) {
@@ -94,6 +104,7 @@ export class TaskFormComponent implements OnInit {
});
}
+ // Getting all available status from backend to list it in status-dropdown in popup window.
getTaskStatus() {
this.backendService.getAllStatus().subscribe((response) => {
if (response.status > 399) {
@@ -104,63 +115,67 @@ export class TaskFormComponent implements OnInit {
});
}
- createTaskStatus(status:ScrumStatus) {
+ // If desired a new arbitrary status (such as "Waiting") can be created, which will be stored in an array.
+ // The new status is available to all tasks.
+ createTaskStatus(status: ScrumStatus) {
this.backendService.postStatus(status).subscribe((response) => {
if (response.status > 399) {
alert('Fehler');
}
- else
- {
+ else {
this.allStatus.push(response.body);
}
});
}
+ // A custom status can even be deleted if not used anymore.
+ // This will remove the status from status-array.
deleteStatus(id: number) {
var status = this.allStatus.find((x) => x.id === id);
this.backendService.deleteStatus(status).subscribe((response) => {
if (response.status > 399) {
alert('Fehler');
}
- else
- {
+ else {
const index = this.allStatus.indexOf(status);
if (index !== -1) {
- this.allStatus.splice(index, 1);
+ this.allStatus.splice(index, 1);
}
}
- this.task.statusid=null;
+ this.task.statusid = null;
});
}
+ // Getting the values of the Priority enum to be shown in a dropdown in popup window.
getAllPriorities(): Priority[] {
return Object.values(Priority);
}
- getUserstoryTitleById(id: number): string{
+ // necessary?????????????????????????????????????????????????????
+ getUserstoryTitleById(id: number): string {
if (!id) {
return null;
- }
+ }
var story = this.userstories.find((x) => x.id === id);
if (!story) {
return null;
- }
+ }
return story.title;
}
- getStatusTitleById(id: number) :string{
+ // Shows the before choosen status in the status-field in the popup window.
+ getStatusTitleById(id: number): string {
if (!id) {
return null;
- }
+ }
var status = this.allStatus.find((x) => x.id === id);
if (!status) {
return null;
- }
+ }
return status.title;
}
- // Methods for choosing creator of a userstory.
-
+ // Getting all taskboard users from backend to show in a dropdown in popup window.
getAllUsers() {
this.backendService.getUsers().subscribe((response) => {
if (response.status > 399) {
@@ -171,6 +186,7 @@ export class TaskFormComponent implements OnInit {
});
}
+ // Shows the before assigned user in the author-field in the popup window.
getAuthorById(id: number): string {
if (!id) {
return null;
@@ -181,4 +197,4 @@ export class TaskFormComponent implements OnInit {
}
return user.name;
}
-}
+}
\ No newline at end of file
diff --git a/src/app/userstory-form/userstory-form.component.html b/src/app/userstory-form/userstory-form.component.html
index e367b6f..b0fb258 100644
--- a/src/app/userstory-form/userstory-form.component.html
+++ b/src/app/userstory-form/userstory-form.component.html
@@ -1,3 +1,5 @@
+
+