feat: enhance metrics dashboard with new components and data handling

- Introduced `MetricsOverview`, `MetricsMainCharts`, `MetricsDistributionCharts`, `MetricsVelocitySection`, and `MetricsProductivitySection` for improved metrics visualization.
- Updated `MetricsTab` to integrate new components and streamline data presentation.
- Added compatibility fields in `JiraTask` and `AssigneeDistribution` for better data handling.
- Refactored `calculateAssigneeDistribution` to include a count for total issues.
- Enhanced `JiraAnalyticsService` and `JiraAdvancedFiltersService` to support new metrics calculations.
- Cleaned up unused imports and components for a more maintainable codebase.
This commit is contained in:
Julien Froidefond
2025-09-21 15:55:11 +02:00
parent c650c67627
commit 0a03e40469
43 changed files with 2781 additions and 1805 deletions

View File

@@ -180,7 +180,8 @@ export class JiraAdvancedFiltersService {
totalIssues: stats.total,
completedIssues: stats.completed,
inProgressIssues: stats.inProgress,
percentage: totalFilteredIssues > 0 ? (stats.total / totalFilteredIssues) * 100 : 0
percentage: totalFilteredIssues > 0 ? (stats.total / totalFilteredIssues) * 100 : 0,
count: stats.total // Ajout pour compatibilité
}));
// Calculer la nouvelle distribution par statut

View File

@@ -178,7 +178,8 @@ export class JiraAnalyticsService {
totalIssues: stats.total,
completedIssues: stats.completed,
inProgressIssues: stats.inProgress,
percentage: Math.round((stats.total / issues.length) * 100)
percentage: Math.round((stats.total / issues.length) * 100),
count: stats.total // Ajout pour compatibilité
})).sort((a, b) => b.totalIssues - a.totalIssues);
const activeAssignees = distribution.filter(d => d.inProgressIssues > 0).length;
@@ -279,7 +280,8 @@ export class JiraAnalyticsService {
endDate: endDate.toISOString(),
completedPoints,
plannedPoints,
completionRate
completionRate,
velocity: completedPoints // Ajout pour compatibilité
});
}

View File

@@ -11,6 +11,17 @@ export interface SystemInfo {
totalUsers: number;
totalBackups: number;
databaseSize: string;
totalTags: number; // Ajout pour compatibilité
totalDailies: number; // Ajout pour compatibilité
size: string; // Alias pour databaseSize
};
backups: {
totalBackups: number;
lastBackup?: string;
};
app: {
version: string;
environment: string;
};
uptime: string;
lastUpdate: string;
@@ -30,7 +41,20 @@ export class SystemInfoService {
return {
version: packageInfo.version,
environment: process.env.NODE_ENV || 'development',
database: dbStats,
database: {
...dbStats,
totalTags: dbStats.totalTags || 0,
totalDailies: dbStats.totalDailies || 0,
size: dbStats.databaseSize
},
backups: {
totalBackups: dbStats.totalBackups,
lastBackup: undefined // TODO: Implement backup tracking
},
app: {
version: packageInfo.version,
environment: process.env.NODE_ENV || 'development'
},
uptime: this.getUptime(),
lastUpdate: this.getLastUpdate()
};
@@ -67,17 +91,21 @@ export class SystemInfoService {
*/
private static async getDatabaseStats() {
try {
const [totalTasks, totalUsers, totalBackups] = await Promise.all([
const [totalTasks, totalUsers, totalBackups, totalTags, totalDailies] = await Promise.all([
prisma.task.count(),
prisma.userPreferences.count(),
// Pour les backups, on compte les fichiers via le service backup
this.getBackupCount()
this.getBackupCount(),
prisma.tag.count(),
prisma.dailyCheckbox.count()
]);
return {
totalTasks,
totalUsers,
totalBackups,
totalTags,
totalDailies,
databaseSize: await this.getDatabaseSize()
};
} catch (error) {