Skip to content

Commit a05fd12

Browse files
committed
feat: add status field to task updates and enhance task type with projectName
- Updated MyTasks component to include 'status' field in task updates. - Enhanced Task type definition to include 'projectName' for better display. - Updated yarn.lock to include new dependencies related to Fluent UI and D3 libraries.
1 parent 066b6c5 commit a05fd12

17 files changed

Lines changed: 1940 additions & 585 deletions

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@dnd-kit/sortable": "^10.0.0",
1515
"@dnd-kit/utilities": "^3.2.2",
1616
"@fluentui/react-calendar-compat": "^0.3.15",
17+
"@fluentui/react-charting": "^5.25.3",
1718
"@fluentui/react-components": "^9.72.4",
1819
"@fluentui/react-datepicker-compat": "^0.6.20",
1920
"axios": "^1.13.2",

src/components/apis/analytics.ts

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ export interface AnalyticsSummary {
99
tasksPending: number;
1010
tasksOverdue: number;
1111
activeProjects: number;
12+
tasksInProgress: number;
13+
tasksToDo: number;
14+
tasksBlocked: number;
15+
tasksByStatus: Record<string, number>;
16+
tasksByPriority: Record<string, number>;
17+
}
18+
19+
export interface TaskProgress {
20+
totalTasks: number;
21+
completedTasks: number;
22+
inProgressTasks: number;
23+
toDoTasks: number;
24+
blockedTasks: number;
25+
overdueTasks: number;
26+
completionPercentage: number;
27+
inProgressPercentage: number;
28+
remainingTasks: number;
29+
statusBreakdown: Record<string, number>;
1230
}
1331

1432
export interface ProjectStats {
@@ -60,8 +78,9 @@ export const analyticsApi = {
6078
/**
6179
* Get overall system summary statistics
6280
*/
63-
async getSummary(): Promise<AnalyticsSummary> {
64-
const response = await axiosInstance.get('/api/analytics/summary');
81+
async getSummary(projectId?: string): Promise<AnalyticsSummary> {
82+
const params = projectId ? `?projectId=${projectId}` : '';
83+
const response = await axiosInstance.get(`/api/analytics/summary${params}`);
6584
return response.data;
6685
},
6786

@@ -89,6 +108,25 @@ export const analyticsApi = {
89108
return response.data;
90109
},
91110

111+
/**
112+
* Get task progress statistics
113+
*/
114+
async getTaskProgress(projectId?: string, userId?: string): Promise<TaskProgress> {
115+
const params = new URLSearchParams();
116+
if (projectId) params.append('projectId', projectId);
117+
if (userId) params.append('userId', userId);
118+
const response = await axiosInstance.get(`/api/analytics/progress${params.toString() ? '?' + params.toString() : ''}`);
119+
return response.data;
120+
},
121+
122+
/**
123+
* Get current user's task progress
124+
*/
125+
async getMyProgress(): Promise<TaskProgress> {
126+
const response = await axiosInstance.get('/api/analytics/my-progress');
127+
return response.data;
128+
},
129+
92130
/**
93131
* Get top performers by task completion
94132
*/

src/components/apis/axiosInstance.ts

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

3-
export const API_BASE_URL = "https://flowboard-backend.azurewebsites.net/";
3+
// export const API_BASE_URL = "https://flowboard-backend.azurewebsites.net/";
44
// export const API_BASE_URL = "https://animated-space-fiesta-w6wpx564wqxh5vwj-5158.app.github.dev//";
5-
// export const API_BASE_URL = "http://localhost:5158/";
5+
export const API_BASE_URL = "http://localhost:5158/";
66

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

src/components/apis/categories.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export const categoriesApi = {
2020
return response.data;
2121
},
2222

23+
updateCategory: async (categoryId: string, categoryData: Partial<Omit<Category, 'id'>>): Promise<Category> => {
24+
const response = await axiosInstance.put<Category>(`/api/categories/${categoryId}`, categoryData);
25+
return response.data;
26+
},
27+
2328
deleteCategory: async (categoryId: string): Promise<void> => {
2429
await axiosInstance.delete(`/api/categories/${categoryId}`);
2530
}

src/components/apis/subtasks.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export interface CreateSubTaskData {
44
title: string;
55
description?: string;
66
priority?: string;
7+
status?: string;
78
mainTaskId?: string;
89
projectId: string;
910
category?: string;
@@ -18,6 +19,7 @@ export interface UpdateSubTaskData {
1819
title?: string;
1920
description?: string;
2021
priority?: string;
22+
status?: string;
2123
mainTaskId?: string;
2224
projectId?: string;
2325
category?: string;
@@ -33,6 +35,7 @@ export interface SubTaskResponse {
3335
title: string;
3436
description?: string;
3537
priority?: string;
38+
status?: string;
3639
mainTaskId?: string;
3740
projectId: string;
3841
category?: string;
@@ -125,8 +128,11 @@ export const subTasksApi = {
125128
if (updates.title !== undefined) payload.title = updates.title;
126129
if (updates.description !== undefined) payload.description = updates.description;
127130
if (updates.priority !== undefined && updates.priority !== '') payload.priority = updates.priority;
131+
if (updates.status !== undefined && updates.status !== '') payload.status = updates.status;
128132
if (updates.categoryId !== undefined && updates.categoryId !== '') payload.categoryId = updates.categoryId;
129133
if (updates.assignedTo !== undefined) payload.assignedTo = updates.assignedTo;
134+
if (updates.startDate !== undefined) payload.startDate = updates.startDate;
135+
if (updates.endDate !== undefined) payload.endDate = updates.endDate;
130136

131137
const response = await axiosInstance.patch<{ message: string }>(`/api/subtasks/${subTaskId}`, payload);
132138
return response.data;

0 commit comments

Comments
 (0)