diff --git a/src/app/components/board/board.component.html b/src/app/components/board/board.component.html
index 7f53a47..356e535 100644
--- a/src/app/components/board/board.component.html
+++ b/src/app/components/board/board.component.html
@@ -44,9 +44,15 @@
onclick="openAddTaskPage('todo')"
/>
-
-
-
+
@@ -64,11 +70,14 @@
onclick="openAddTaskPage('inprogress')"
/>
-
@@ -85,14 +94,14 @@
onclick="openAddTaskPage('awaitfeedback')"
/>
-
@@ -109,11 +118,14 @@
onclick="openAddTaskPage('done')"
/>
-
diff --git a/src/app/components/board/board.component.ts b/src/app/components/board/board.component.ts
index f08d472..99b130c 100644
--- a/src/app/components/board/board.component.ts
+++ b/src/app/components/board/board.component.ts
@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
import { TaskComponent } from './task/task.component';
import { DragDropService } from '../../services/drag-drop.service';
import { CommonModule } from '@angular/common';
+import { FirebaseService } from '../../services/firebase.service';
@Component({
selector: 'app-board',
@@ -11,24 +12,20 @@ import { CommonModule } from '@angular/common';
styleUrl: './board.component.scss',
})
export class BoardComponent {
- tasks = [
- {
- id: '1',
- category: 'HTML',
- status: 'todo',
- },
- {
- id: '2',
- category: 'CSS',
- status: 'done',
- },
- ];
-
- constructor(public dragDropService: DragDropService) {
+ constructor(
+ public dragDropService: DragDropService,
+ public firebaseService: FirebaseService
+ ) {
this.dragDropService.itemDropped.subscribe(({ index, status }) => {
- if (index >= 0 && index < this.tasks.length) {
- this.tasks[index].status = status;
- }
+ this.firebaseService.allTasks[index].status = status;
+ this.firebaseService.updateTask(
+ this.firebaseService.allTasks[index].id,
+ index
+ );
});
}
+
+ ngOnInit() {
+ this.firebaseService.updateAllTasks();
+ }
}
diff --git a/src/app/components/board/task/task.component.html b/src/app/components/board/task/task.component.html
index 833addd..7d3f8dc 100644
--- a/src/app/components/board/task/task.component.html
+++ b/src/app/components/board/task/task.component.html
@@ -7,12 +7,14 @@
>
- category
+ {{ firebaseService.allTasks[index].category }}
+
+ {{ firebaseService.allTasks[index].title }}
+
+ {{ firebaseService.allTasks[index].description }}
- title
- description
checkSubtasks(tasks[id].id)