feat: add project key support for Jira analytics
- Introduced `projectKey` and `ignoredProjects` fields in Jira configuration to enhance analytics capabilities. - Implemented project validation logic in `JiraConfigClient` and integrated it into the `JiraConfigForm` for user input. - Updated `IntegrationsSettingsPageClient` to display analytics dashboard link based on the configured project key. - Enhanced API routes to handle project key in Jira sync and user preferences. - Marked related tasks as complete in `TODO.md`.
This commit is contained in:
68
lib/types.ts
68
lib/types.ts
@@ -84,6 +84,7 @@ export interface JiraConfig {
|
||||
email?: string;
|
||||
apiToken?: string;
|
||||
enabled: boolean;
|
||||
projectKey?: string; // Clé du projet à surveiller pour les analytics d'équipe (ex: "MYTEAM")
|
||||
ignoredProjects?: string[]; // Liste des clés de projets à ignorer (ex: ["DEMO", "TEST"])
|
||||
}
|
||||
|
||||
@@ -147,6 +148,73 @@ export interface JiraTask {
|
||||
labels: string[];
|
||||
}
|
||||
|
||||
// Types pour l'analytics Jira
|
||||
export interface JiraAnalytics {
|
||||
project: {
|
||||
key: string;
|
||||
name: string;
|
||||
totalIssues: number;
|
||||
};
|
||||
teamMetrics: {
|
||||
totalAssignees: number;
|
||||
activeAssignees: number;
|
||||
issuesDistribution: AssigneeDistribution[];
|
||||
};
|
||||
velocityMetrics: {
|
||||
currentSprintPoints: number;
|
||||
averageVelocity: number;
|
||||
sprintHistory: SprintVelocity[];
|
||||
};
|
||||
cycleTimeMetrics: {
|
||||
averageCycleTime: number; // en jours
|
||||
cycleTimeByType: CycleTimeByType[];
|
||||
};
|
||||
workInProgress: {
|
||||
byStatus: StatusDistribution[];
|
||||
byAssignee: AssigneeWorkload[];
|
||||
};
|
||||
}
|
||||
|
||||
export interface AssigneeDistribution {
|
||||
assignee: string;
|
||||
displayName: string;
|
||||
totalIssues: number;
|
||||
completedIssues: number;
|
||||
inProgressIssues: number;
|
||||
percentage: number;
|
||||
}
|
||||
|
||||
export interface SprintVelocity {
|
||||
sprintName: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
completedPoints: number;
|
||||
plannedPoints: number;
|
||||
completionRate: number;
|
||||
}
|
||||
|
||||
export interface CycleTimeByType {
|
||||
issueType: string;
|
||||
averageDays: number;
|
||||
medianDays: number;
|
||||
samples: number;
|
||||
}
|
||||
|
||||
export interface StatusDistribution {
|
||||
status: string;
|
||||
count: number;
|
||||
percentage: number;
|
||||
}
|
||||
|
||||
export interface AssigneeWorkload {
|
||||
assignee: string;
|
||||
displayName: string;
|
||||
todoCount: number;
|
||||
inProgressCount: number;
|
||||
reviewCount: number;
|
||||
totalActive: number;
|
||||
}
|
||||
|
||||
// Types pour l'API
|
||||
export interface ApiResponse<T> {
|
||||
data?: T;
|
||||
|
||||
Reference in New Issue
Block a user