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