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:
@@ -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
|
||||
|
||||
@@ -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é
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user