Skip to content

Commit 5460e1c

Browse files
committed
feat: Implement task management features in project and user task pages
- Enhanced TaskListPage to manage tasks with CRUD operations, including adding, editing, and deleting tasks. - Integrated category management for tasks, allowing users to select categories based on the project. - Improved user assignment functionality, enabling selection of users assigned to tasks. - Added Kanban board for visual task management, supporting drag-and-drop functionality for task categorization. - Updated MyTasks page to handle task creation and editing with improved user experience. - Introduced API integration for categories, allowing dynamic loading of categories based on the selected project. - Refactored task data structures to support multiple assignees and improved user resolution for task assignments.
1 parent 5bde71e commit 5460e1c

26 files changed

Lines changed: 1587 additions & 414 deletions

Flowboard-Project-Management-System-Backend.http

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
### Public - Auth - Done
55
### ===============================
66

7-
### Auth - Register - Frontend Backend
7+
### Auth - Register
88
# @name register
99
POST {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/auth/register
1010
Content-Type: application/json
@@ -21,33 +21,27 @@ Content-Type: application/json
2121
"password": "Hatdog21!"
2222
}
2323

24-
### Auth - Login - Frontend Backend
24+
### Auth - Login
2525
# @name login
2626
POST {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/auth/login
2727
Content-Type: application/json
2828

2929
{
30-
"UserNameOrEmail": "johnkennyreyes21@gmail.com",
31-
"password": "Sanagumana21!"
30+
"UserNameOrEmail": "johnkennyreyes21gmail.com",
31+
"password": "Hatdog21!"
3232
}
3333

3434
### ===============================
3535
### Users
3636
### ===============================
3737

38-
39-
### Users - Get ALL Users (Protected) - Frontend Backend
40-
GET {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/users/
41-
Authorization: Bearer {{login.response.body.token}}
42-
Accept: application/json
43-
44-
### Users - Get by ID (Protected) - Frontend Backend
38+
### Users - Get by ID (Protected)
4539
GET {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/users/{{login.response.body.user.id}}
4640
Authorization: Bearer {{login.response.body.token}}
4741
Accept: application/json
4842

4943

50-
### Users - Update (Replace) - UPDATE - Frontend Backend
44+
### Users - Update (Replace) - UPDATE - Works
5145
PATCH {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/users/{{login.response.body.user.id}}
5246
Content-Type: application/json
5347
Authorization: Bearer {{login.response.body.token}}
@@ -57,7 +51,7 @@ Authorization: Bearer {{login.response.body.token}}
5751
}
5852

5953

60-
### Patch - Update Password (server must hash before save) - Frontend Backend
54+
### Patch - Update Password (server must hash before save) - Works
6155
PATCH {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/users/{{login.response.body.user.id}}
6256
Content-Type: application/json
6357
Authorization: Bearer {{login.response.body.token}}
@@ -71,19 +65,15 @@ Authorization: Bearer {{login.response.body.token}}
7165
### Projects
7266
### ===============================
7367

74-
### Projects - Create (Protected) - Works - Frontend - Backend
68+
### Projects - Create (Protected) - Works
7569
# @name createProject
7670
POST {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/projects
7771
Content-Type: application/json
7872
Authorization: Bearer {{login.response.body.token}}
7973

8074
{
8175
"projectName": "IPT102",
82-
"description": "Project Management System",
83-
"teamMembers": [
84-
"691989a863538927dd65315c",
85-
"690d04b90943671dbf22f65e"
86-
]
76+
"description": "Project Management System"
8777
}
8878

8979

@@ -94,12 +84,12 @@ Accept: application/json
9484

9585
### Projects - Get by ID (Protected) - Works
9686
# @name getProject
97-
GET {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/projects/{{createProject.response.body.id}}
87+
GET {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/projects/6919d3b0a66df6db05f2567b
9888
Authorization: Bearer {{login.response.body.token}}
9989
Accept: application/json
10090

10191
### Projects - Update (Protected) - Works
102-
PATCH {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/projects/{{createProject.response.body.id}}
92+
PATCH {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/projects/6919d3b0a66df6db05f2567b
10393
Content-Type: application/json
10494
Authorization: Bearer {{login.response.body.token}}
10595

@@ -129,7 +119,11 @@ Authorization: Bearer {{login.response.body.token}}
129119
"teamMembers": [
130120
"691989a863538927dd65315c",
131121
"690d04b90943671dbf22f65e"
132-
]
122+
],
123+
"permissions": {
124+
"691989a863538927dd65315c": "Editor",
125+
"690d04b90943671dbf22f65e": "Team Member"
126+
}
133127
}
134128

135129
### Projects - Remove Single Member (Protected) - Work
@@ -142,7 +136,12 @@ Authorization: Bearer {{login.response.body.token}}
142136
}
143137

144138
### Projects - Delete (Protected)
145-
DELETE {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/projects/{{createProject.response.body.id}}
139+
DELETE {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/projects/6919c7caba3bf16fa679bc92
140+
Authorization: Bearer {{login.response.body.token}}
141+
142+
### Projects - Leave Project (Protected) - Self removal
143+
DELETE {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/projects/{{createProject.response.body.id}}/leave
144+
Content-Type: application/json
146145
Authorization: Bearer {{login.response.body.token}}
147146

148147
### ===============================
@@ -174,6 +173,16 @@ Authorization: Bearer {{login.response.body.token}}
174173
]
175174
}
176175

176+
### Tasks - Get Task from logged in user and assigned by other (Protected)
177+
GET {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/tasks/user/{{login.response.body.user.id}}
178+
Authorization: Bearer {{login.response.body.token}}
179+
Accept: application/json
180+
181+
### Tasks - Get tasks for current authenticated user (shortcut)
182+
GET {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/tasks/me
183+
Authorization: Bearer {{login.response.body.token}}
184+
Accept: application/json
185+
177186
### Tasks - Get All (Protected) - Works
178187
GET {{Flowboard_Project_Management_System_Backend_HostAddress}}/api/tasks
179188
Authorization: Bearer {{login.response.body.token}}

src/components/apis/README.md

Lines changed: 0 additions & 173 deletions
This file was deleted.

src/components/apis/axiosInstance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios from 'axios';
22

3-
export const API_BASE_URL = "https://flowboard-backend.azurewebsites.net/";
4-
// export const API_BASE_URL = "http://localhost:5158/";
3+
// export const API_BASE_URL = "https://flowboard-backend.azurewebsites.net/";
4+
export const API_BASE_URL = "http://localhost:5158/";
55

66
const axiosInstance = axios.create({
77
baseURL: API_BASE_URL,

src/components/apis/categories.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import axiosInstance from './axiosInstance';
2+
3+
export interface Category {
4+
id: string;
5+
projectId: string;
6+
categoryName: string;
7+
createdBy: string;
8+
}
9+
10+
export const categoriesApi = {
11+
getCategoriesByProject: async (projectId: string): Promise<Category[]> => {
12+
const response = await axiosInstance.get<Category[]>('/api/categories', {
13+
params: { projectId }
14+
});
15+
return response.data;
16+
},
17+
18+
createCategory: async (categoryData: Omit<Category, 'id'>): Promise<Category> => {
19+
const response = await axiosInstance.post<Category>('/api/categories', categoryData);
20+
return response.data;
21+
},
22+
23+
deleteCategory: async (categoryId: string): Promise<void> => {
24+
await axiosInstance.delete(`/api/categories/${categoryId}`);
25+
}
26+
};

src/components/apis/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export * from './auth';
22
export * from './tasks';
33
export * from './users';
44
export * from './projects';
5+
export * from './categories';
56
export { default as axiosInstance } from './axiosInstance';

src/components/apis/projects.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,9 @@ export const projectsApi = {
7878
const response = await axiosInstance.delete<Project>(`/api/projects/${projectId}/member`, { data: payload });
7979
return response.data;
8080
},
81+
82+
leaveProject: async (projectId: string): Promise<Project> => {
83+
const response = await axiosInstance.delete<Project>(`/api/projects/${projectId}/leave`);
84+
return response.data;
85+
},
8186
};

0 commit comments

Comments
 (0)