diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/components/dashboard/dashboard.component.ts
similarity index 99%
rename from src/app/dashboard/dashboard.component.ts
rename to src/app/components/dashboard/dashboard.component.ts
index 2ea774d..b47f895 100644
--- a/src/app/dashboard/dashboard.component.ts
+++ b/src/app/components/dashboard/dashboard.component.ts
@@ -1,7 +1,7 @@
import {Component, OnChanges} from '@angular/core';
import {forkJoin} from 'rxjs';
import Chart from 'chart.js';
-import {BackendService, ScrumSprint, ScrumStatus, ScrumUserstory} from '../services/backend.service';
+import {BackendService, ScrumSprint, ScrumStatus, ScrumUserstory} from '../../services/backend.service';
@Component({
selector: 'app-dashboard',
diff --git a/src/app/sprint-form/sprint-form.component.css b/src/app/components/sprint-form/sprint-form.component.css
similarity index 100%
rename from src/app/sprint-form/sprint-form.component.css
rename to src/app/components/sprint-form/sprint-form.component.css
diff --git a/src/app/sprint-form/sprint-form.component.html b/src/app/components/sprint-form/sprint-form.component.html
similarity index 97%
rename from src/app/sprint-form/sprint-form.component.html
rename to src/app/components/sprint-form/sprint-form.component.html
index fe3fb87..fcb9fa8 100644
--- a/src/app/sprint-form/sprint-form.component.html
+++ b/src/app/components/sprint-form/sprint-form.component.html
@@ -1,35 +1,35 @@
-
-
-
-
-
-
-
-
-
Neuen Sprint anlegen
-
-
-
+
+
+
+
+
+
+
+
+
Neuen Sprint anlegen
+
+
+
\ No newline at end of file
diff --git a/src/app/sprint-form/sprint-form.component.ts b/src/app/components/sprint-form/sprint-form.component.ts
similarity index 91%
rename from src/app/sprint-form/sprint-form.component.ts
rename to src/app/components/sprint-form/sprint-form.component.ts
index ad55a0f..bac0d22 100644
--- a/src/app/sprint-form/sprint-form.component.ts
+++ b/src/app/components/sprint-form/sprint-form.component.ts
@@ -1,60 +1,60 @@
-// Importing necessary components and interfaces.
-import { Component, OnInit, Input } from '@angular/core';
-import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import {
- BackendService,
- ScrumSprint
-} from '../services/backend.service';
-
-@Component({
- selector: 'app-task-form',
- templateUrl: './sprint-form.component.html',
- styleUrls: ['./sprint-form.component.css']
-})
-
-// Class implements the logic for a popup window form to create and modify sprints.
-export class SprintFormComponent implements OnInit {
- @Input() public sprint: ScrumSprint;
- public editing: Boolean;
- public sprintid: string;
-
- constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { }
-
- // If no sprint exists a new one will be created.
- // In other cases the sprint exists and gets modifiable.
- ngOnInit(): void {
- if (this.sprint === null || this.sprint === undefined) {
- this.sprint = { title: '', startDate: '', endDate: '' };
- this.editing = false;
- } else {
- this.editing = true;
- }
- document.getElementById('titleField').focus();
- }
-
- // A new created sprint will be saved in backend (POST).
- // If a sprint already exists, modifying results an update (PUT) to the backend.
- onSubmit() {
- if (this.editing) {
- this.backendService.putSprint(this.sprint).subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- }
- });
- } else {
- this.backendService.postSprint(this.sprint).subscribe((response) => {
- console.log('Sprint gespeichert!');
- if (response.status > 399) {
- alert('Fehler');
- }
- });
- }
- // Closes the popup window after submitting/canceling.
- this.activeModalService.close(this.sprint);
- }
-
- // Closes the popup form window (by clicking "close button").
- onClose() {
- this.activeModalService.dismiss(this.sprint);
- }
-}
\ No newline at end of file
+// Importing necessary components and interfaces.
+import { Component, OnInit, Input } from '@angular/core';
+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
+import {
+ BackendService,
+ ScrumSprint
+} from '../../services/backend.service';
+
+@Component({
+ selector: 'app-task-form',
+ templateUrl: './sprint-form.component.html',
+ styleUrls: ['./sprint-form.component.css']
+})
+
+// Class implements the logic for a popup window form to create and modify sprints.
+export class SprintFormComponent implements OnInit {
+ @Input() public sprint: ScrumSprint;
+ public editing: Boolean;
+ public sprintid: string;
+
+ constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) { }
+
+ // If no sprint exists a new one will be created.
+ // In other cases the sprint exists and gets modifiable.
+ ngOnInit(): void {
+ if (this.sprint === null || this.sprint === undefined) {
+ this.sprint = { title: '', startDate: '', endDate: '' };
+ this.editing = false;
+ } else {
+ this.editing = true;
+ }
+ document.getElementById('titleField').focus();
+ }
+
+ // A new created sprint will be saved in backend (POST).
+ // If a sprint already exists, modifying results an update (PUT) to the backend.
+ onSubmit() {
+ if (this.editing) {
+ this.backendService.putSprint(this.sprint).subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ } else {
+ this.backendService.postSprint(this.sprint).subscribe((response) => {
+ console.log('Sprint gespeichert!');
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ }
+ // Closes the popup window after submitting/canceling.
+ this.activeModalService.close(this.sprint);
+ }
+
+ // Closes the popup form window (by clicking "close button").
+ onClose() {
+ this.activeModalService.dismiss(this.sprint);
+ }
+}
diff --git a/src/app/sprint-table/sprint-table.component.css b/src/app/components/sprint-table/sprint-table.component.css
similarity index 100%
rename from src/app/sprint-table/sprint-table.component.css
rename to src/app/components/sprint-table/sprint-table.component.css
diff --git a/src/app/sprint-table/sprint-table.component.html b/src/app/components/sprint-table/sprint-table.component.html
similarity index 97%
rename from src/app/sprint-table/sprint-table.component.html
rename to src/app/components/sprint-table/sprint-table.component.html
index 04c3d79..251698b 100644
--- a/src/app/sprint-table/sprint-table.component.html
+++ b/src/app/components/sprint-table/sprint-table.component.html
@@ -1,66 +1,66 @@
-
-
-
- Sprints
-
-
-
-
-
-
-
- ID
-
-
-
-
-
-
-
- Titel
-
-
-
-
-
-
-
- Start
-
-
-
-
-
-
-
- End
-
-
-
-
-
-
-
-
-
-
-
-
-
{{sprint.id}}
-
{{sprint.title}}
-
{{sprint.startDate | date:'dd.MM.yyyy'}}
-
{{sprint.endDate | date:'dd.MM.yyyy'}}
-
-
-
-
-
-
-
-
-
-
+
+
+
+ Sprints
+
+
+
+
+
+
+
+ ID
+
+
+
+
+
+
+
+ Titel
+
+
+
+
+
+
+
+ Start
+
+
+
+
+
+
+
+ End
+
+
+
+
+
+
+
+
+
+
+
+
+
{{sprint.id}}
+
{{sprint.title}}
+
{{sprint.startDate | date:'dd.MM.yyyy'}}
+
{{sprint.endDate | date:'dd.MM.yyyy'}}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/sprint-table/sprint-table.component.ts b/src/app/components/sprint-table/sprint-table.component.ts
similarity index 90%
rename from src/app/sprint-table/sprint-table.component.ts
rename to src/app/components/sprint-table/sprint-table.component.ts
index eb646cb..3d18bc7 100644
--- a/src/app/sprint-table/sprint-table.component.ts
+++ b/src/app/components/sprint-table/sprint-table.component.ts
@@ -1,87 +1,87 @@
-import {Component} from '@angular/core';
-import {BackendService, ScrumSprint} from '../services/backend.service';
-import {TableComponentBase} from '../services/table-component.base';
-import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
-import {ActivatedRoute, ParamMap, Router} from '@angular/router';
-import { SprintFormComponent } from '../sprint-form/sprint-form.component';
-
-@Component({
- selector: 'app-sprint',
- templateUrl: './sprint-table.component.html',
- styleUrls: ['./sprint-table.component.css']
-})
-export class SprintTableComponent extends TableComponentBase {
- public filterSprintId: number | null = null;
- public highlightId: number;
-
- public get filteredItems() {
- return this.items.filter(sprint =>
- (this.filterSprintId === null || sprint.id === this.filterSprintId)
- );
- }
-
- constructor(
- private backendService: BackendService, private modalService: NgbModal,
- private route: ActivatedRoute, private router: Router
- ) {
- super();
-
- this.applyFilterParameters(route.snapshot.paramMap);
- route.paramMap.subscribe(map => this.applyFilterParameters(map));
-
- backendService.getSprints().subscribe(response => {
- if (response.status > 399) {
- alert('Fehler');
- } else {
- this.items.push(...response.body);
- }
- });
- }
-
- private applyFilterParameters(params: ParamMap) {
- if (params.has('id')) {
- this.highlightId = parseInt(params.get('id'));
- }
- }
-
- public deleteSprint(sprint: ScrumSprint) {
- this.backendService.deleteSprint(sprint).subscribe(response => {
- if (response.status > 399) {
- alert('Fehler');
- }
- });
- const index = this.items.indexOf(sprint);
- if (index !== -1) {
- this.items.splice(index, 1);
- }
- }
-
- public openSprintForm(editSprint?: ScrumSprint) {
- const modalRef = this.modalService.open(SprintFormComponent, {
- backdrop: 'static',
- keyboard: true,
- });
- if (editSprint === null) {
- modalRef.result.then(result => {
- this.items.push(result);
- });
- }
- modalRef.componentInstance.sprint = editSprint;
- }
-
- sortById() {
- this.doNumericSort('id', sprint => sprint.id);
- }
-
- sortByTitle() {
- this.doStringSort('title', sprint => sprint.title);
- }
-
- sortByStartDate() {
- this.doStringSort('startDate', sprint => sprint.startDate);
- }
-
- sortByEndDate() {
- this.doStringSort('endDate', sprint => sprint.endDate);
- }
-}
+import {Component} from '@angular/core';
+import {BackendService, ScrumSprint} from '../../services/backend.service';
+import {TableComponentBase} from '../../services/table-component.base';
+import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
+import {ActivatedRoute, ParamMap, Router} from '@angular/router';
+import { SprintFormComponent } from '../sprint-form/sprint-form.component';
+
+@Component({
+ selector: 'app-sprint',
+ templateUrl: './sprint-table.component.html',
+ styleUrls: ['./sprint-table.component.css']
+})
+export class SprintTableComponent extends TableComponentBase {
+ public filterSprintId: number | null = null;
+ public highlightId: number;
+
+ public get filteredItems() {
+ return this.items.filter(sprint =>
+ (this.filterSprintId === null || sprint.id === this.filterSprintId)
+ );
+ }
+
+ constructor(
+ private backendService: BackendService, private modalService: NgbModal,
+ private route: ActivatedRoute, private router: Router
+ ) {
+ super();
+
+ this.applyFilterParameters(route.snapshot.paramMap);
+ route.paramMap.subscribe(map => this.applyFilterParameters(map));
+
+ backendService.getSprints().subscribe(response => {
+ if (response.status > 399) {
+ alert('Fehler');
+ } else {
+ this.items.push(...response.body);
+ }
+ });
+ }
+
+ private applyFilterParameters(params: ParamMap) {
+ if (params.has('id')) {
+ this.highlightId = parseInt(params.get('id'));
+ }
+ }
+
+ public deleteSprint(sprint: ScrumSprint) {
+ this.backendService.deleteSprint(sprint).subscribe(response => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ const index = this.items.indexOf(sprint);
+ if (index !== -1) {
+ this.items.splice(index, 1);
+ }
+ }
+
+ public openSprintForm(editSprint?: ScrumSprint) {
+ const modalRef = this.modalService.open(SprintFormComponent, {
+ backdrop: 'static',
+ keyboard: true,
+ });
+ if (editSprint === null) {
+ modalRef.result.then(result => {
+ this.items.push(result);
+ });
+ }
+ modalRef.componentInstance.sprint = editSprint;
+ }
+
+ sortById() {
+ this.doNumericSort('id', sprint => sprint.id);
+ }
+
+ sortByTitle() {
+ this.doStringSort('title', sprint => sprint.title);
+ }
+
+ sortByStartDate() {
+ this.doStringSort('startDate', sprint => sprint.startDate);
+ }
+
+ sortByEndDate() {
+ this.doStringSort('endDate', sprint => sprint.endDate);
+ }
+}
diff --git a/src/app/task-form/task-form.component.css b/src/app/components/task-form/task-form.component.css
similarity index 100%
rename from src/app/task-form/task-form.component.css
rename to src/app/components/task-form/task-form.component.css
diff --git a/src/app/task-form/task-form.component.html b/src/app/components/task-form/task-form.component.html
similarity index 100%
rename from src/app/task-form/task-form.component.html
rename to src/app/components/task-form/task-form.component.html
diff --git a/src/app/task-form/task-form.component.spec.ts b/src/app/components/task-form/task-form.component.spec.ts
similarity index 100%
rename from src/app/task-form/task-form.component.spec.ts
rename to src/app/components/task-form/task-form.component.spec.ts
diff --git a/src/app/task-form/task-form.component.ts b/src/app/components/task-form/task-form.component.ts
similarity index 95%
rename from src/app/task-form/task-form.component.ts
rename to src/app/components/task-form/task-form.component.ts
index d7cf7b9..8da2775 100644
--- a/src/app/task-form/task-form.component.ts
+++ b/src/app/components/task-form/task-form.component.ts
@@ -1,200 +1,200 @@
-// Importing necessary components and interfaces.
-import { Component, OnInit, Input } from '@angular/core';
-import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import {
- 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']
-})
-
-// 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;
- public creating: boolean;
- public userstoryId: string;
- public userstories: any[] = [];
- public allStatus: any[] = [];
- public status: ScrumStatus = { title: "", description: "" };
- public allUser: any[] = [];
- public user: ScrumUser = { name: "" };
-
- constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
- this.getUserStories();
- this.getTaskStatus();
- 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: '' };
- this.editing = false;
- this.creating = false;
- } else if (this.task.userstoryid) {
- this.editing = true;
- } else {
- this.creating = true;
- }
- 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) => {
- if (response.status > 399) {
- alert('Fehler');
- }
- });
- } else {
- this.backendService.postTask(this.task).subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- }
- });
- }
- // 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) {
- return null;
- }
- this.backendService.getUserstory(this.task.userstoryid).subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- } else {
- this.userstoryId = response.body.title;
- }
- });
- }
-
- // Getting all userstories from backend to show in a dropdown in popup window.
- getUserStories() {
- this.backendService.getUserstories().subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- } else {
- this.userstories.push(...response.body);
- }
- });
- }
-
- // 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) {
- alert('Fehler');
- } else {
- this.allStatus.push(...response.body);
- }
- });
- }
-
- // 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 {
- 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 {
- const index = this.allStatus.indexOf(status);
- if (index !== -1) {
- this.allStatus.splice(index, 1);
- }
- }
- 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);
- }
-
- // 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;
- }
-
- // 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;
- }
-
- // Getting all taskboard users from backend to show in a dropdown in popup window.
- getAllUsers() {
- this.backendService.getUsers().subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- } else {
- this.allUser.push(...response.body);
- }
- });
- }
-
- // Shows the before assigned user in the author-field in the popup window.
- getAuthorById(id: number): string {
- if (!id) {
- return null;
- }
- var user = this.allUser.find((x) => x.id === id);
- if (!user) {
- return null;
- }
- return user.name;
- }
-}
\ No newline at end of file
+// Importing necessary components and interfaces.
+import { Component, OnInit, Input } from '@angular/core';
+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
+import {
+ 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']
+})
+
+// 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;
+ public creating: boolean;
+ public userstoryId: string;
+ public userstories: any[] = [];
+ public allStatus: any[] = [];
+ public status: ScrumStatus = { title: "", description: "" };
+ public allUser: any[] = [];
+ public user: ScrumUser = { name: "" };
+
+ constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
+ this.getUserStories();
+ this.getTaskStatus();
+ 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: '' };
+ this.editing = false;
+ this.creating = false;
+ } else if (this.task.userstoryid) {
+ this.editing = true;
+ } else {
+ this.creating = true;
+ }
+ 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) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ } else {
+ this.backendService.postTask(this.task).subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ }
+ // 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) {
+ return null;
+ }
+ this.backendService.getUserstory(this.task.userstoryid).subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ } else {
+ this.userstoryId = response.body.title;
+ }
+ });
+ }
+
+ // Getting all userstories from backend to show in a dropdown in popup window.
+ getUserStories() {
+ this.backendService.getUserstories().subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ } else {
+ this.userstories.push(...response.body);
+ }
+ });
+ }
+
+ // 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) {
+ alert('Fehler');
+ } else {
+ this.allStatus.push(...response.body);
+ }
+ });
+ }
+
+ // 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 {
+ 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 {
+ const index = this.allStatus.indexOf(status);
+ if (index !== -1) {
+ this.allStatus.splice(index, 1);
+ }
+ }
+ 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);
+ }
+
+ // 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;
+ }
+
+ // 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;
+ }
+
+ // Getting all taskboard users from backend to show in a dropdown in popup window.
+ getAllUsers() {
+ this.backendService.getUsers().subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ } else {
+ this.allUser.push(...response.body);
+ }
+ });
+ }
+
+ // Shows the before assigned user in the author-field in the popup window.
+ getAuthorById(id: number): string {
+ if (!id) {
+ return null;
+ }
+ var user = this.allUser.find((x) => x.id === id);
+ if (!user) {
+ return null;
+ }
+ return user.name;
+ }
+}
diff --git a/src/app/task-table/task-table.component.css b/src/app/components/task-table/task-table.component.css
similarity index 100%
rename from src/app/task-table/task-table.component.css
rename to src/app/components/task-table/task-table.component.css
diff --git a/src/app/task-table/task-table.component.html b/src/app/components/task-table/task-table.component.html
similarity index 100%
rename from src/app/task-table/task-table.component.html
rename to src/app/components/task-table/task-table.component.html
diff --git a/src/app/task-table/task-table.component.ts b/src/app/components/task-table/task-table.component.ts
similarity index 95%
rename from src/app/task-table/task-table.component.ts
rename to src/app/components/task-table/task-table.component.ts
index 44299d5..a5559d2 100644
--- a/src/app/task-table/task-table.component.ts
+++ b/src/app/components/task-table/task-table.component.ts
@@ -5,12 +5,12 @@ import {
ScrumStatus,
ScrumUser,
ScrumCategory,
-} from '../services/backend.service';
+} from '../../services/backend.service';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { TaskFormComponent } from '../task-form/task-form.component';
-import { TableComponentBase } from '../services/table-component.base';
+import { TableComponentBase } from '../../services/table-component.base';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
-import { getNumberForPriority } from '../services/sorting.service';
+import { getNumberForPriority } from '../../services/sorting.service';
import { NONE_TYPE } from '@angular/compiler';
@Component({
diff --git a/src/app/userstory-form/userstory-form.component.css b/src/app/components/userstory-form/userstory-form.component.css
similarity index 100%
rename from src/app/userstory-form/userstory-form.component.css
rename to src/app/components/userstory-form/userstory-form.component.css
diff --git a/src/app/userstory-form/userstory-form.component.html b/src/app/components/userstory-form/userstory-form.component.html
similarity index 98%
rename from src/app/userstory-form/userstory-form.component.html
rename to src/app/components/userstory-form/userstory-form.component.html
index b0fb258..0acc5bb 100644
--- a/src/app/userstory-form/userstory-form.component.html
+++ b/src/app/components/userstory-form/userstory-form.component.html
@@ -1,140 +1,140 @@
-
-
-
-
-
-
-
-
-
-
-
Neue Userstory anlegen
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
Neue Userstory anlegen
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/app/userstory-form/userstory-form.component.ts b/src/app/components/userstory-form/userstory-form.component.ts
similarity index 94%
rename from src/app/userstory-form/userstory-form.component.ts
rename to src/app/components/userstory-form/userstory-form.component.ts
index 023ba0c..9838fe7 100644
--- a/src/app/userstory-form/userstory-form.component.ts
+++ b/src/app/components/userstory-form/userstory-form.component.ts
@@ -1,207 +1,207 @@
-// Importing necessary components and interfaces.
-import { Component, OnInit, Input } from '@angular/core';
-import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
-import { BackendService, ScrumUserstory, Priority } from '../services/backend.service';
-import {
- ScrumTask,
- ScrumStatus,
- ScrumCategory,
- ScrumUser,
- ScrumProject,
-} from '../services/backend.service';
-
-@Component({
- selector: 'app-userstory-form',
- templateUrl: './userstory-form.component.html',
- styleUrls: ['./userstory-form.component.css']
-})
-
-// Class implements the logic for a popup window form to create and modify userstories.
-export class UserstoryFormComponent implements OnInit {
- @Input() public userstory: ScrumUserstory;
- public allStatus: any[] = [];
- public status: ScrumStatus = { title: "", description: "" };
- public allUser: any[] = [];
- public user: ScrumUser = { name: "" };
- public allCategories: any[] = [];
- public category: ScrumCategory = { title: "" };
- private editing: boolean;
-
- constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
- this.getUserstoryStatus();
- this.getAllUsers();
- this.getUserstoryCategory();
- }
-
- // If no userstory exists a new one will be created.
- // In other cases the userstory exists and gets modifiable.
- ngOnInit(): void {
- if (this.userstory === null || this.userstory === undefined) {
- this.userstory = { title: '' };
- this.editing = false;
- } else {
- this.editing = true;
- }
- document.getElementById('titleField').focus();
- }
-
- // A new created userstory will be saved in backend (POST).
- // If a userstory already exists, modifying results an update (PUT) to the backend.
- onSubmit() {
- if (this.editing) {
- this.backendService.putUserstory(this.userstory).subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- }
- });
- } else {
- this.backendService.postUserstory(this.userstory).subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- }
- });
- }
- // Closes the popup window after submitting/canceling.
- this.activeModalService.close(this.userstory);
- }
-
- // Closes the popup form window (by clicking "close button").
- onClose() {
- this.activeModalService.dismiss(this.userstory);
- }
-
- // Getting all available status from backend to list it in status-dropdown in popup window.
- getUserstoryStatus() {
- this.backendService.getAllStatus().subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- } else {
- this.allStatus.push(...response.body);
- }
- });
- }
-
- // 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 userstories.
- createUserstoryStatus(status: ScrumStatus) {
- this.backendService.postStatus(status).subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- }
- 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 {
- const index = this.allStatus.indexOf(status);
- if (index !== -1) {
- this.allStatus.splice(index, 1);
- }
- }
- this.userstory.statusid = null;
- });
- }
-
- // Getting the values of the Priority enum to be shown in a dropdown in popup window.
- getAllPriorities(): Priority[] {
- return Object.values(Priority);
- }
-
- // 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;
- }
-
- // Getting all taskboard users from backend to show in a dropdown in popup window.
- getAllUsers() {
- this.backendService.getUsers().subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- } else {
- this.allUser.push(...response.body);
- }
- });
- }
-
- // Shows the before assigned user in the author-field in the popup window.
- getAuthorById(id: number): string {
- if (!id) {
- return null;
- }
- var user = this.allUser.find((x) => x.id === id);
- if (!user) {
- return null;
- }
- return user.name;
- }
-
- // Getting all available categories from backend to list it in status-dropdown in popup window.
- getUserstoryCategory() {
- this.backendService.getCategories().subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- } else {
- this.allCategories.push(...response.body);
- }
- });
- }
-
- // If desired a new arbitrary category can be created, which will be stored in an array.
- // The new category is available to all userstories.
- createUserstoryCategory(category: ScrumCategory) {
- this.backendService.postCategory(category).subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- }
- else {
- this.allCategories.push(response.body);
- }
- });
- }
-
- // A custom category can even be deleted if not used anymore.
- // This will remove the category from category-array.
- deleteCategory(id: number) {
- var category = this.allCategories.find((x) => x.id === id);
- this.backendService.deleteCategory(category).subscribe((response) => {
- if (response.status > 399) {
- alert('Fehler');
- }
- else {
- const index = this.allCategories.indexOf(category);
- if (index !== -1) {
- this.allCategories.splice(index, 1);
- }
- }
- this.userstory.categoryid = null;
- });
- }
- // Shows the before choosen category in the category-field in the popup window.
- getCategoryById(id: number): string {
- if (!id) {
- return null;
- }
- var category = this.allCategories.find((x) => x.id === id);
- if (!category) {
- return null;
- }
- return category.title;
- }
-}
\ No newline at end of file
+// Importing necessary components and interfaces.
+import { Component, OnInit, Input } from '@angular/core';
+import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
+import { BackendService, ScrumUserstory, Priority } from '../../services/backend.service';
+import {
+ ScrumTask,
+ ScrumStatus,
+ ScrumCategory,
+ ScrumUser,
+ ScrumProject,
+} from '../../services/backend.service';
+
+@Component({
+ selector: 'app-userstory-form',
+ templateUrl: './userstory-form.component.html',
+ styleUrls: ['./userstory-form.component.css']
+})
+
+// Class implements the logic for a popup window form to create and modify userstories.
+export class UserstoryFormComponent implements OnInit {
+ @Input() public userstory: ScrumUserstory;
+ public allStatus: any[] = [];
+ public status: ScrumStatus = { title: "", description: "" };
+ public allUser: any[] = [];
+ public user: ScrumUser = { name: "" };
+ public allCategories: any[] = [];
+ public category: ScrumCategory = { title: "" };
+ private editing: boolean;
+
+ constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
+ this.getUserstoryStatus();
+ this.getAllUsers();
+ this.getUserstoryCategory();
+ }
+
+ // If no userstory exists a new one will be created.
+ // In other cases the userstory exists and gets modifiable.
+ ngOnInit(): void {
+ if (this.userstory === null || this.userstory === undefined) {
+ this.userstory = { title: '' };
+ this.editing = false;
+ } else {
+ this.editing = true;
+ }
+ document.getElementById('titleField').focus();
+ }
+
+ // A new created userstory will be saved in backend (POST).
+ // If a userstory already exists, modifying results an update (PUT) to the backend.
+ onSubmit() {
+ if (this.editing) {
+ this.backendService.putUserstory(this.userstory).subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ } else {
+ this.backendService.postUserstory(this.userstory).subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ });
+ }
+ // Closes the popup window after submitting/canceling.
+ this.activeModalService.close(this.userstory);
+ }
+
+ // Closes the popup form window (by clicking "close button").
+ onClose() {
+ this.activeModalService.dismiss(this.userstory);
+ }
+
+ // Getting all available status from backend to list it in status-dropdown in popup window.
+ getUserstoryStatus() {
+ this.backendService.getAllStatus().subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ } else {
+ this.allStatus.push(...response.body);
+ }
+ });
+ }
+
+ // 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 userstories.
+ createUserstoryStatus(status: ScrumStatus) {
+ this.backendService.postStatus(status).subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ 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 {
+ const index = this.allStatus.indexOf(status);
+ if (index !== -1) {
+ this.allStatus.splice(index, 1);
+ }
+ }
+ this.userstory.statusid = null;
+ });
+ }
+
+ // Getting the values of the Priority enum to be shown in a dropdown in popup window.
+ getAllPriorities(): Priority[] {
+ return Object.values(Priority);
+ }
+
+ // 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;
+ }
+
+ // Getting all taskboard users from backend to show in a dropdown in popup window.
+ getAllUsers() {
+ this.backendService.getUsers().subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ } else {
+ this.allUser.push(...response.body);
+ }
+ });
+ }
+
+ // Shows the before assigned user in the author-field in the popup window.
+ getAuthorById(id: number): string {
+ if (!id) {
+ return null;
+ }
+ var user = this.allUser.find((x) => x.id === id);
+ if (!user) {
+ return null;
+ }
+ return user.name;
+ }
+
+ // Getting all available categories from backend to list it in status-dropdown in popup window.
+ getUserstoryCategory() {
+ this.backendService.getCategories().subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ } else {
+ this.allCategories.push(...response.body);
+ }
+ });
+ }
+
+ // If desired a new arbitrary category can be created, which will be stored in an array.
+ // The new category is available to all userstories.
+ createUserstoryCategory(category: ScrumCategory) {
+ this.backendService.postCategory(category).subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ else {
+ this.allCategories.push(response.body);
+ }
+ });
+ }
+
+ // A custom category can even be deleted if not used anymore.
+ // This will remove the category from category-array.
+ deleteCategory(id: number) {
+ var category = this.allCategories.find((x) => x.id === id);
+ this.backendService.deleteCategory(category).subscribe((response) => {
+ if (response.status > 399) {
+ alert('Fehler');
+ }
+ else {
+ const index = this.allCategories.indexOf(category);
+ if (index !== -1) {
+ this.allCategories.splice(index, 1);
+ }
+ }
+ this.userstory.categoryid = null;
+ });
+ }
+ // Shows the before choosen category in the category-field in the popup window.
+ getCategoryById(id: number): string {
+ if (!id) {
+ return null;
+ }
+ var category = this.allCategories.find((x) => x.id === id);
+ if (!category) {
+ return null;
+ }
+ return category.title;
+ }
+}
diff --git a/src/app/userstory-inner-table/userstory-inner-table.component.css b/src/app/components/userstory-inner-table/userstory-inner-table.component.css
similarity index 100%
rename from src/app/userstory-inner-table/userstory-inner-table.component.css
rename to src/app/components/userstory-inner-table/userstory-inner-table.component.css
diff --git a/src/app/userstory-inner-table/userstory-inner-table.component.html b/src/app/components/userstory-inner-table/userstory-inner-table.component.html
similarity index 100%
rename from src/app/userstory-inner-table/userstory-inner-table.component.html
rename to src/app/components/userstory-inner-table/userstory-inner-table.component.html
diff --git a/src/app/userstory-inner-table/userstory-inner-table.component.ts b/src/app/components/userstory-inner-table/userstory-inner-table.component.ts
similarity index 95%
rename from src/app/userstory-inner-table/userstory-inner-table.component.ts
rename to src/app/components/userstory-inner-table/userstory-inner-table.component.ts
index 3430dc0..7a82081 100644
--- a/src/app/userstory-inner-table/userstory-inner-table.component.ts
+++ b/src/app/components/userstory-inner-table/userstory-inner-table.component.ts
@@ -5,10 +5,10 @@ import {
ScrumUserstory,
ScrumStatus,
ScrumCategory,
-} from '../services/backend.service';
+} from '../../services/backend.service';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
-import { TableComponentBase } from '../services/table-component.base';
-import { getNumberForPriority } from '../services/sorting.service';
+import { TableComponentBase } from '../../services/table-component.base';
+import { getNumberForPriority } from '../../services/sorting.service';
import { UserstoryFormComponent } from '../userstory-form/userstory-form.component';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
diff --git a/src/app/userstory-table/userstory-table.component.css b/src/app/components/userstory-table/userstory-table.component.css
similarity index 100%
rename from src/app/userstory-table/userstory-table.component.css
rename to src/app/components/userstory-table/userstory-table.component.css
diff --git a/src/app/userstory-table/userstory-table.component.html b/src/app/components/userstory-table/userstory-table.component.html
similarity index 100%
rename from src/app/userstory-table/userstory-table.component.html
rename to src/app/components/userstory-table/userstory-table.component.html
diff --git a/src/app/userstory-table/userstory-table.component.ts b/src/app/components/userstory-table/userstory-table.component.ts
similarity index 93%
rename from src/app/userstory-table/userstory-table.component.ts
rename to src/app/components/userstory-table/userstory-table.component.ts
index b61809b..fba1dd1 100644
--- a/src/app/userstory-table/userstory-table.component.ts
+++ b/src/app/components/userstory-table/userstory-table.component.ts
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import {
BackendService,
ScrumUserstory,
-} from '../services/backend.service';
+} from '../../services/backend.service';
@Component({
selector: 'app-userstory-table',