code cleanup and comments.
This commit is contained in:
parent
62730d53b6
commit
f64f7439ea
@ -1,4 +1,4 @@
|
|||||||
<!--Popup form to create a new sprint-->
|
<!--Popup form to create an modify sprints-->
|
||||||
|
|
||||||
<div class="card" style="width: 100%;">
|
<div class="card" style="width: 100%;">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
<!--Popup form to create and modify a task-->
|
||||||
|
|
||||||
<div class="card" style="width: 100%;">
|
<div class="card" style="width: 100%;">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@ -46,7 +48,6 @@
|
|||||||
{{p}}</option>
|
{{p}}</option>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Section to choose, create or delete a random status for the userstory. -->
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div ngbDropdown class="dropdown" [autoClose]="false">
|
<div ngbDropdown class="dropdown" [autoClose]="false">
|
||||||
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
||||||
@ -71,7 +72,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<select class="form-control custom-select mr-sm-2" id="prio" required name="prio"
|
<select class="form-control custom-select mr-sm-2" id="status" required name="status"
|
||||||
[(ngModel)]="task.statusid">
|
[(ngModel)]="task.statusid">
|
||||||
<option *ngFor="let status of allStatus" [value]="status.id">{{
|
<option *ngFor="let status of allStatus" [value]="status.id">{{
|
||||||
status.title
|
status.title
|
||||||
@ -79,7 +80,6 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Section to choose an author for the userstory. -->
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div ngbDropdown class="dropdown" [autoClose]="true">
|
<div ngbDropdown class="dropdown" [autoClose]="true">
|
||||||
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
||||||
@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-menu">
|
<div class="dropdown-menu">
|
||||||
<select class="form-control custom-select mr-sm-2" id="prio" required name="prio"
|
<select class="form-control custom-select mr-sm-2" id="assignedto" required name="assignedto"
|
||||||
[(ngModel)]="task.assignedtoid">
|
[(ngModel)]="task.assignedtoid">
|
||||||
<option *ngFor="let user of allUser" [value]="user.id">{{
|
<option *ngFor="let user of allUser" [value]="user.id">{{
|
||||||
user.name
|
user.name
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// Importing necessary components and interfaces.
|
||||||
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 {
|
import {
|
||||||
@ -16,8 +17,10 @@ import { HttpResponse } from '@angular/common/http';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-task-form',
|
selector: 'app-task-form',
|
||||||
templateUrl: './task-form.component.html',
|
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 {
|
export class TaskFormComponent implements OnInit {
|
||||||
@Input() public task: ScrumTask;
|
@Input() public task: ScrumTask;
|
||||||
public editing: boolean;
|
public editing: boolean;
|
||||||
@ -25,7 +28,7 @@ export class TaskFormComponent implements OnInit {
|
|||||||
public userstoryId: string;
|
public userstoryId: string;
|
||||||
public userstories: any[] = [];
|
public userstories: any[] = [];
|
||||||
public allStatus: any[] = [];
|
public allStatus: any[] = [];
|
||||||
public status: ScrumStatus = {title: "", description: ""};
|
public status: ScrumStatus = { title: "", description: "" };
|
||||||
public allUser: any[] = [];
|
public allUser: any[] = [];
|
||||||
public user: ScrumUser = { name: "" };
|
public user: ScrumUser = { name: "" };
|
||||||
|
|
||||||
@ -35,6 +38,8 @@ export class TaskFormComponent implements OnInit {
|
|||||||
this.getAllUsers();
|
this.getAllUsers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no task exists a new one will be created.
|
||||||
|
// In other cases the task exists and gets modifiable.
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.task === null || this.task === undefined) {
|
if (this.task === null || this.task === undefined) {
|
||||||
this.task = { title: '' };
|
this.task = { title: '' };
|
||||||
@ -48,7 +53,8 @@ export class TaskFormComponent implements OnInit {
|
|||||||
document.getElementById('titleField').focus();
|
document.getElementById('titleField').focus();
|
||||||
this.getRelatedStory();
|
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() {
|
onSubmit() {
|
||||||
if (this.editing) {
|
if (this.editing) {
|
||||||
this.backendService.putTask(this.task).subscribe((response) => {
|
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);
|
this.activeModalService.close(this.task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Closes the popup form window (by clicking "close button").
|
||||||
onClose() {
|
onClose() {
|
||||||
this.activeModalService.dismiss(this.task);
|
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() {
|
getRelatedStory() {
|
||||||
if(!this.task.userstoryid)
|
if (!this.task.userstoryid) {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this.backendService.getUserstory(this.task.userstoryid).subscribe((response) => {
|
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() {
|
getUserStories() {
|
||||||
this.backendService.getUserstories().subscribe((response) => {
|
this.backendService.getUserstories().subscribe((response) => {
|
||||||
if (response.status > 399) {
|
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() {
|
getTaskStatus() {
|
||||||
this.backendService.getAllStatus().subscribe((response) => {
|
this.backendService.getAllStatus().subscribe((response) => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
@ -104,40 +115,44 @@ 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) => {
|
this.backendService.postStatus(status).subscribe((response) => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
alert('Fehler');
|
alert('Fehler');
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
this.allStatus.push(response.body);
|
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) {
|
deleteStatus(id: number) {
|
||||||
var status = this.allStatus.find((x) => x.id === id);
|
var status = this.allStatus.find((x) => x.id === id);
|
||||||
this.backendService.deleteStatus(status).subscribe((response) => {
|
this.backendService.deleteStatus(status).subscribe((response) => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
alert('Fehler');
|
alert('Fehler');
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
const index = this.allStatus.indexOf(status);
|
const index = this.allStatus.indexOf(status);
|
||||||
if (index !== -1) {
|
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[] {
|
getAllPriorities(): Priority[] {
|
||||||
return Object.values(Priority);
|
return Object.values(Priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
getUserstoryTitleById(id: number): string{
|
// necessary?????????????????????????????????????????????????????
|
||||||
|
getUserstoryTitleById(id: number): string {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -148,7 +163,8 @@ export class TaskFormComponent implements OnInit {
|
|||||||
return story.title;
|
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) {
|
if (!id) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -159,8 +175,7 @@ export class TaskFormComponent implements OnInit {
|
|||||||
return status.title;
|
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() {
|
getAllUsers() {
|
||||||
this.backendService.getUsers().subscribe((response) => {
|
this.backendService.getUsers().subscribe((response) => {
|
||||||
if (response.status > 399) {
|
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 {
|
getAuthorById(id: number): string {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
<!--Popup form to create and modify a task-->
|
||||||
|
|
||||||
<div class="card" style="width: 100%;">
|
<div class="card" style="width: 100%;">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@ -36,8 +38,6 @@
|
|||||||
{{p}}</option>
|
{{p}}</option>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Section to choose, create or delete a random status for the userstory. -->
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div ngbDropdown class="dropdown" [autoClose]="false">
|
<div ngbDropdown class="dropdown" [autoClose]="false">
|
||||||
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
||||||
@ -70,8 +70,6 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Section to choose, create or delete a random category for the userstory. -->
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div ngbDropdown class="dropdown" [autoClose]="false">
|
<div ngbDropdown class="dropdown" [autoClose]="false">
|
||||||
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
||||||
@ -104,8 +102,6 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Section to choose an author for the userstory. -->
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div ngbDropdown class="dropdown" [autoClose]="true">
|
<div ngbDropdown class="dropdown" [autoClose]="true">
|
||||||
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
<button ngbDropdownToggle class="btn btn-secondary dropdown-toggle" type="button"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// Importing necessary components and interfaces.
|
||||||
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, ScrumUserstory, Priority } from '../services/backend.service';
|
import { BackendService, ScrumUserstory, Priority } from '../services/backend.service';
|
||||||
@ -14,6 +15,8 @@ import {
|
|||||||
templateUrl: './userstory-form.component.html',
|
templateUrl: './userstory-form.component.html',
|
||||||
styleUrls: ['./userstory-form.component.css']
|
styleUrls: ['./userstory-form.component.css']
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Class implements the logic for a popup window form to create and modify userstories.
|
||||||
export class UserstoryFormComponent implements OnInit {
|
export class UserstoryFormComponent implements OnInit {
|
||||||
@Input() public userstory: ScrumUserstory;
|
@Input() public userstory: ScrumUserstory;
|
||||||
public allStatus: any[] = [];
|
public allStatus: any[] = [];
|
||||||
@ -21,16 +24,17 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
public allUser: any[] = [];
|
public allUser: any[] = [];
|
||||||
public user: ScrumUser = { name: "" };
|
public user: ScrumUser = { name: "" };
|
||||||
public allCategories: any[] = [];
|
public allCategories: any[] = [];
|
||||||
public category: ScrumCategory = { title: ""};
|
public category: ScrumCategory = { title: "" };
|
||||||
private editing: boolean;
|
private editing: boolean;
|
||||||
|
|
||||||
|
|
||||||
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
|
constructor(private backendService: BackendService, private activeModalService: NgbActiveModal) {
|
||||||
this.getUserstoryStatus();
|
this.getUserstoryStatus();
|
||||||
this.getAllUsers();
|
this.getAllUsers();
|
||||||
this.getUserstoryCategory();
|
this.getUserstoryCategory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no userstory exists a new one will be created.
|
||||||
|
// In other cases the userstory exists and gets modifiable.
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.userstory === null || this.userstory === undefined) {
|
if (this.userstory === null || this.userstory === undefined) {
|
||||||
this.userstory = { title: '' };
|
this.userstory = { title: '' };
|
||||||
@ -41,6 +45,8 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
document.getElementById('titleField').focus();
|
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() {
|
onSubmit() {
|
||||||
if (this.editing) {
|
if (this.editing) {
|
||||||
this.backendService.putUserstory(this.userstory).subscribe((response) => {
|
this.backendService.putUserstory(this.userstory).subscribe((response) => {
|
||||||
@ -55,14 +61,16 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Closes the popup window after submitting/canceling.
|
||||||
this.activeModalService.close(this.userstory);
|
this.activeModalService.close(this.userstory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Closes the popup form window (by clicking "close button").
|
||||||
onClose() {
|
onClose() {
|
||||||
this.activeModalService.dismiss(this.userstory);
|
this.activeModalService.dismiss(this.userstory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods for adding, choosing and deleting random status tags.
|
// Getting all available status from backend to list it in status-dropdown in popup window.
|
||||||
|
|
||||||
getUserstoryStatus() {
|
getUserstoryStatus() {
|
||||||
this.backendService.getAllStatus().subscribe((response) => {
|
this.backendService.getAllStatus().subscribe((response) => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
@ -73,6 +81,8 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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) {
|
createUserstoryStatus(status: ScrumStatus) {
|
||||||
this.backendService.postStatus(status).subscribe((response) => {
|
this.backendService.postStatus(status).subscribe((response) => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
@ -84,6 +94,8 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A custom status can even be deleted if not used anymore.
|
||||||
|
// This will remove the status from status-array.
|
||||||
deleteStatus(id: number) {
|
deleteStatus(id: number) {
|
||||||
var status = this.allStatus.find((x) => x.id === id);
|
var status = this.allStatus.find((x) => x.id === id);
|
||||||
this.backendService.deleteStatus(status).subscribe((response) => {
|
this.backendService.deleteStatus(status).subscribe((response) => {
|
||||||
@ -100,10 +112,12 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Getting the values of the Priority enum to be shown in a dropdown in popup window.
|
||||||
getAllPriorities(): Priority[] {
|
getAllPriorities(): Priority[] {
|
||||||
return Object.values(Priority);
|
return Object.values(Priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shows the before choosen status in the status-field in the popup window.
|
||||||
getStatusTitleById(id: number): string {
|
getStatusTitleById(id: number): string {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return null;
|
return null;
|
||||||
@ -115,8 +129,7 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
return status.title;
|
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() {
|
getAllUsers() {
|
||||||
this.backendService.getUsers().subscribe((response) => {
|
this.backendService.getUsers().subscribe((response) => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
@ -127,6 +140,7 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shows the before assigned user in the author-field in the popup window.
|
||||||
getAuthorById(id: number): string {
|
getAuthorById(id: number): string {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return null;
|
return null;
|
||||||
@ -138,8 +152,7 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
return user.name;
|
return user.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods for creating, choosing and deleting categories for a userstory.
|
// Getting all available categories from backend to list it in status-dropdown in popup window.
|
||||||
|
|
||||||
getUserstoryCategory() {
|
getUserstoryCategory() {
|
||||||
this.backendService.getCategories().subscribe((response) => {
|
this.backendService.getCategories().subscribe((response) => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
@ -150,6 +163,8 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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) {
|
createUserstoryCategory(category: ScrumCategory) {
|
||||||
this.backendService.postCategory(category).subscribe((response) => {
|
this.backendService.postCategory(category).subscribe((response) => {
|
||||||
if (response.status > 399) {
|
if (response.status > 399) {
|
||||||
@ -161,6 +176,8 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A custom category can even be deleted if not used anymore.
|
||||||
|
// This will remove the category from category-array.
|
||||||
deleteCategory(id: number) {
|
deleteCategory(id: number) {
|
||||||
var category = this.allCategories.find((x) => x.id === id);
|
var category = this.allCategories.find((x) => x.id === id);
|
||||||
this.backendService.deleteCategory(category).subscribe((response) => {
|
this.backendService.deleteCategory(category).subscribe((response) => {
|
||||||
@ -176,7 +193,7 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
this.userstory.categoryid = null;
|
this.userstory.categoryid = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Shows the before choosen category in the category-field in the popup window.
|
||||||
getCategoryById(id: number): string {
|
getCategoryById(id: number): string {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return null;
|
return null;
|
||||||
@ -187,5 +204,4 @@ export class UserstoryFormComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
return category.title;
|
return category.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user