feat: update dashboard components and analytics for 7-day summaries
- Modified `ManagerWeeklySummary`, `MetricsTab`, and `ProductivityAnalytics` to reflect a focus on the last 7 days instead of the current week. - Enhanced `ManagerSummaryService` and `MetricsService` to calculate metrics over a sliding 7-day window, improving data relevance. - Added a new utility function `formatDistanceToNow` for better date formatting in French. - Updated comments and documentation to clarify changes in timeframes.
This commit is contained in:
29
src/actions/deadline-analytics.ts
Normal file
29
src/actions/deadline-analytics.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
'use server';
|
||||
|
||||
import { DeadlineAnalyticsService, DeadlineMetrics } from '@/services/analytics/deadline-analytics';
|
||||
|
||||
export async function getDeadlineMetrics() {
|
||||
try {
|
||||
const metrics = await DeadlineAnalyticsService.getDeadlineMetrics();
|
||||
return { success: true, data: metrics };
|
||||
} catch (error) {
|
||||
console.error('Erreur lors de la récupération des métriques d\'échéance:', error);
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Erreur lors de la récupération des métriques d\'échéance'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export async function getCriticalDeadlines() {
|
||||
try {
|
||||
const tasks = await DeadlineAnalyticsService.getCriticalDeadlines();
|
||||
return { success: true, data: tasks };
|
||||
} catch (error) {
|
||||
console.error('Erreur lors de la récupération des échéances critiques:', error);
|
||||
return {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : 'Erreur lors de la récupération des échéances critiques'
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user