bugfixes
This commit is contained in:
parent
27e5e71639
commit
90703611a4
4 changed files with 12 additions and 9 deletions
|
|
@ -192,8 +192,8 @@
|
||||||
<option value="" disabled [selected]="!taskData.category">
|
<option value="" disabled [selected]="!taskData.category">
|
||||||
Select task category
|
Select task category
|
||||||
</option>
|
</option>
|
||||||
<option value="1">User Story</option>
|
<option value="User Story">User Story</option>
|
||||||
<option value="2">Technical Task</option>
|
<option value="Technical Task">Technical Task</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="error-msg">
|
<div class="error-msg">
|
||||||
@if (!category.valid && category.touched) {
|
@if (!category.valid && category.touched) {
|
||||||
|
|
|
||||||
|
|
@ -29,16 +29,15 @@ export class AddTaskComponent {
|
||||||
constructor(public firebaseService: FirebaseService) {}
|
constructor(public firebaseService: FirebaseService) {}
|
||||||
|
|
||||||
taskData: Task = {
|
taskData: Task = {
|
||||||
id: '',
|
|
||||||
title: '',
|
title: '',
|
||||||
description: '',
|
description: '',
|
||||||
category: '',
|
category: '',
|
||||||
status: '',
|
status: 'todo',
|
||||||
priority: 'medium',
|
priority: 'medium',
|
||||||
subtasksTitle: [],
|
subtasksTitle: [],
|
||||||
subtasksDone: [],
|
subtasksDone: [],
|
||||||
assigned: [],
|
assigned: [],
|
||||||
date: '',
|
date: this.currentDate,
|
||||||
};
|
};
|
||||||
|
|
||||||
receiveAssigned(assigned: string[]) {
|
receiveAssigned(assigned: string[]) {
|
||||||
|
|
@ -135,11 +134,13 @@ export class AddTaskComponent {
|
||||||
this.taskData.category = '';
|
this.taskData.category = '';
|
||||||
this.taskData.assigned = [];
|
this.taskData.assigned = [];
|
||||||
this.taskData.subtasksTitle = [];
|
this.taskData.subtasksTitle = [];
|
||||||
|
this.taskData.subtasksDone = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit(ngForm: NgForm) {
|
onSubmit(ngForm: NgForm) {
|
||||||
if (ngForm.submitted && ngForm.form.valid) {
|
if (ngForm.submitted && ngForm.form.valid) {
|
||||||
this.firebaseService.addNewTask(this.taskData);
|
const { id, ...taskWithoutId } = this.taskData;
|
||||||
|
this.firebaseService.addNewTask(taskWithoutId);
|
||||||
this.removeTaskData();
|
this.removeTaskData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export interface Task {
|
export interface Task {
|
||||||
id: string;
|
id?: string;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
category: string;
|
category: string;
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,11 @@ export class DragDropService {
|
||||||
|
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
startDragging(event: DragEvent, id: string) {
|
startDragging(event: DragEvent, id: string | undefined) {
|
||||||
|
if (id !== undefined) {
|
||||||
event.dataTransfer?.setData('text/plain', id);
|
event.dataTransfer?.setData('text/plain', id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
allowDrop(event: DragEvent) {
|
allowDrop(event: DragEvent) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue