- Replaced `DailyCalendar` with a new `Calendar` component for improved functionality and consistency. - Introduced `AlertBanner` to replace `DeadlineReminder`, providing a more flexible way to display urgent tasks. - Updated `DailyAddForm` to use new options for task types, enhancing user experience when adding tasks. - Removed unused state and components, streamlining the DailyPageClient for better performance and maintainability. - Enhanced `DailySection` to utilize new `CheckboxItem` format for better integration with the UI. - Cleaned up imports and improved overall structure for better readability.
457 lines
9.6 KiB
TypeScript
457 lines
9.6 KiB
TypeScript
import { TfsConfig } from '@/services/integrations/tfs';
|
|
import { Theme } from './theme-config';
|
|
|
|
// Réexporter Theme pour les autres modules
|
|
export type { Theme };
|
|
|
|
// Types de base pour les tâches
|
|
// Note: TaskStatus et TaskPriority sont maintenant gérés par la configuration centralisée dans lib/status-config.ts
|
|
export type TaskStatus =
|
|
| 'backlog'
|
|
| 'todo'
|
|
| 'in_progress'
|
|
| 'done'
|
|
| 'cancelled'
|
|
| 'freeze'
|
|
| 'archived';
|
|
export type TaskPriority = 'low' | 'medium' | 'high' | 'urgent';
|
|
export type TaskSource = 'reminders' | 'jira' | 'tfs' | 'manual';
|
|
|
|
// Types de thèmes partagés - maintenant dans theme-config.ts
|
|
|
|
// Interface centralisée pour les statistiques
|
|
export interface TaskStats {
|
|
total: number;
|
|
completed: number;
|
|
inProgress: number;
|
|
todo: number;
|
|
backlog: number;
|
|
cancelled: number;
|
|
freeze: number;
|
|
archived: number;
|
|
completionRate: number;
|
|
}
|
|
|
|
// Interface principale pour les tâches
|
|
export interface Task {
|
|
id: string;
|
|
title: string;
|
|
description?: string;
|
|
status: TaskStatus;
|
|
priority: TaskPriority;
|
|
source: TaskSource;
|
|
sourceId?: string;
|
|
tags: string[];
|
|
dueDate?: Date;
|
|
completedAt?: Date;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
|
|
// Métadonnées Jira
|
|
jiraProject?: string;
|
|
jiraKey?: string;
|
|
jiraType?: string; // Type de ticket Jira: Story, Task, Bug, Epic, etc.
|
|
|
|
// Métadonnées TFS/Azure DevOps
|
|
tfsProject?: string;
|
|
tfsPullRequestId?: number;
|
|
tfsRepository?: string;
|
|
tfsSourceBranch?: string;
|
|
tfsTargetBranch?: string;
|
|
|
|
assignee?: string;
|
|
}
|
|
|
|
// Interface pour les tags
|
|
export interface Tag {
|
|
id: string;
|
|
name: string;
|
|
color: string;
|
|
isPinned?: boolean; // Tag pour objectifs principaux
|
|
}
|
|
|
|
// Types pour les préférences utilisateur
|
|
export interface KanbanFilters {
|
|
search?: string;
|
|
tags?: string[];
|
|
priorities?: TaskPriority[];
|
|
showCompleted?: boolean;
|
|
sortBy?: string;
|
|
showWithDueDate?: boolean;
|
|
// Filtres spécifiques Jira
|
|
showJiraOnly?: boolean;
|
|
hideJiraTasks?: boolean;
|
|
jiraProjects?: string[];
|
|
jiraTypes?: string[];
|
|
// Filtres spécifiques TFS
|
|
showTfsOnly?: boolean;
|
|
hideTfsTasks?: boolean;
|
|
tfsProjects?: string[];
|
|
[key: string]: string | string[] | TaskPriority[] | boolean | undefined;
|
|
}
|
|
|
|
export interface ViewPreferences {
|
|
compactView: boolean;
|
|
swimlanesByTags: boolean;
|
|
swimlanesMode?: 'tags' | 'priority';
|
|
showObjectives: boolean;
|
|
showFilters: boolean;
|
|
objectivesCollapsed: boolean;
|
|
theme: Theme;
|
|
fontSize: 'small' | 'medium' | 'large';
|
|
[key: string]:
|
|
| boolean
|
|
| 'tags'
|
|
| 'priority'
|
|
| Theme
|
|
| 'small'
|
|
| 'medium'
|
|
| 'large'
|
|
| undefined;
|
|
}
|
|
|
|
export interface ColumnVisibility {
|
|
hiddenStatuses: TaskStatus[];
|
|
[key: string]: TaskStatus[] | undefined;
|
|
}
|
|
|
|
export interface JiraConfig {
|
|
baseUrl?: string;
|
|
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"])
|
|
}
|
|
|
|
|
|
export interface UserPreferences {
|
|
kanbanFilters: KanbanFilters;
|
|
viewPreferences: ViewPreferences;
|
|
columnVisibility: ColumnVisibility;
|
|
jiraConfig: JiraConfig;
|
|
jiraAutoSync: boolean;
|
|
jiraSyncInterval: 'hourly' | 'daily' | 'weekly';
|
|
tfsConfig: TfsConfig;
|
|
tfsAutoSync: boolean;
|
|
tfsSyncInterval: 'hourly' | 'daily' | 'weekly';
|
|
}
|
|
|
|
// Interface pour les logs de synchronisation
|
|
export interface SyncLog {
|
|
id: string;
|
|
source: TaskSource;
|
|
status: 'success' | 'error';
|
|
message?: string;
|
|
tasksSync: number;
|
|
createdAt: Date;
|
|
}
|
|
|
|
// Types pour les rappels macOS
|
|
export interface MacOSReminder {
|
|
id: string;
|
|
title: string;
|
|
notes?: string;
|
|
completed: boolean;
|
|
dueDate?: Date;
|
|
completionDate?: Date;
|
|
priority: number; // 0=None, 1=Low, 5=Medium, 9=High
|
|
list: string;
|
|
tags?: string[];
|
|
}
|
|
|
|
// Types pour Jira
|
|
export interface JiraTask {
|
|
id: string;
|
|
key: string;
|
|
summary: string;
|
|
description?: string;
|
|
status: {
|
|
name: string;
|
|
category: string;
|
|
};
|
|
priority?: {
|
|
name: string;
|
|
};
|
|
assignee?: {
|
|
displayName: string;
|
|
emailAddress: string;
|
|
};
|
|
project: {
|
|
key: string;
|
|
name: string;
|
|
};
|
|
issuetype: {
|
|
name: string; // Story, Task, Bug, Epic, etc.
|
|
};
|
|
issueType?: {
|
|
name: string; // Alias pour compatibilité
|
|
};
|
|
components?: Array<{
|
|
name: string;
|
|
}>;
|
|
fixVersions?: Array<{
|
|
name: string;
|
|
description?: string;
|
|
}>;
|
|
duedate?: string;
|
|
created: string;
|
|
updated: string;
|
|
labels: string[];
|
|
storyPoints?: number; // Ajout pour les story points
|
|
}
|
|
|
|
// Types pour TFS/Azure DevOps
|
|
export interface TfsPullRequest {
|
|
pullRequestId: number;
|
|
title: string;
|
|
description?: string;
|
|
status: 'active' | 'completed' | 'abandoned';
|
|
createdBy: {
|
|
displayName: string;
|
|
uniqueName: string; // email
|
|
id: string;
|
|
};
|
|
creationDate: string;
|
|
lastMergeSourceCommit?: {
|
|
commitId: string;
|
|
};
|
|
sourceRefName: string; // refs/heads/feature-branch
|
|
targetRefName: string; // refs/heads/main
|
|
repository: {
|
|
id: string;
|
|
name: string;
|
|
project: {
|
|
id: string;
|
|
name: string;
|
|
};
|
|
};
|
|
reviewers?: Array<{
|
|
displayName: string;
|
|
uniqueName: string;
|
|
vote: number; // -10=rejected, -5=waiting for author, 0=no vote, 5=approved, 10=approved with suggestions
|
|
}>;
|
|
labels?: Array<{
|
|
id: string;
|
|
name: string;
|
|
}>;
|
|
isDraft: boolean;
|
|
mergeStatus: 'succeeded' | 'failed' | 'conflicts' | 'queued';
|
|
closedDate?: 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;
|
|
count: number; // Ajout pour compatibilité
|
|
}
|
|
|
|
export interface SprintVelocity {
|
|
sprintName: string;
|
|
startDate: string;
|
|
endDate: string;
|
|
completedPoints: number;
|
|
plannedPoints: number;
|
|
completionRate: number;
|
|
velocity: number; // Ajout pour compatibilité
|
|
}
|
|
|
|
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 les filtres avancés
|
|
export interface JiraAnalyticsFilters {
|
|
components: string[];
|
|
fixVersions: string[];
|
|
issueTypes: string[];
|
|
statuses: string[];
|
|
assignees: string[];
|
|
labels: string[];
|
|
priorities: string[];
|
|
dateRange?: {
|
|
from: Date;
|
|
to: Date;
|
|
};
|
|
}
|
|
|
|
export interface FilterOption {
|
|
value: string;
|
|
label: string;
|
|
count: number;
|
|
}
|
|
|
|
export interface AvailableFilters {
|
|
components: FilterOption[];
|
|
fixVersions: FilterOption[];
|
|
issueTypes: FilterOption[];
|
|
statuses: FilterOption[];
|
|
assignees: FilterOption[];
|
|
labels: FilterOption[];
|
|
priorities: FilterOption[];
|
|
}
|
|
|
|
// Types pour l'API
|
|
export interface ApiResponse<T> {
|
|
data?: T;
|
|
error?: string;
|
|
message?: string;
|
|
}
|
|
|
|
export interface PaginatedResponse<T> {
|
|
data: T[];
|
|
total: number;
|
|
page: number;
|
|
limit: number;
|
|
}
|
|
|
|
// Types pour les filtres
|
|
export interface TaskFilters {
|
|
status?: TaskStatus[];
|
|
priority?: TaskPriority[];
|
|
source?: TaskSource[];
|
|
tags?: string[];
|
|
assignee?: string;
|
|
search?: string;
|
|
dueDate?: {
|
|
from?: Date;
|
|
to?: Date;
|
|
};
|
|
}
|
|
|
|
// Types pour les statistiques d'équipe
|
|
export interface TeamStats {
|
|
totalTasks: number;
|
|
completedTasks: number;
|
|
inProgressTasks: number;
|
|
velocity: number;
|
|
burndownData: BurndownPoint[];
|
|
memberStats: MemberStats[];
|
|
}
|
|
|
|
export interface BurndownPoint {
|
|
date: Date;
|
|
remaining: number;
|
|
completed: number;
|
|
}
|
|
|
|
export interface MemberStats {
|
|
name: string;
|
|
email: string;
|
|
totalTasks: number;
|
|
completedTasks: number;
|
|
averageCompletionTime: number;
|
|
}
|
|
|
|
// Types d'erreur
|
|
export class BusinessError extends Error {
|
|
constructor(
|
|
message: string,
|
|
public code?: string
|
|
) {
|
|
super(message);
|
|
this.name = 'BusinessError';
|
|
}
|
|
}
|
|
|
|
export class ValidationError extends Error {
|
|
constructor(
|
|
message: string,
|
|
public field?: string
|
|
) {
|
|
super(message);
|
|
this.name = 'ValidationError';
|
|
}
|
|
}
|
|
|
|
// Types pour les dailies
|
|
export type DailyCheckboxType = 'task' | 'meeting';
|
|
|
|
export interface DailyCheckbox {
|
|
id: string;
|
|
date: Date;
|
|
text: string;
|
|
isChecked: boolean;
|
|
type: DailyCheckboxType;
|
|
order: number;
|
|
taskId?: string;
|
|
task?: Task; // Relation optionnelle vers une tâche
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
}
|
|
|
|
// Interface pour créer/modifier une checkbox
|
|
export interface CreateDailyCheckboxData {
|
|
date: Date;
|
|
text: string;
|
|
type?: DailyCheckboxType;
|
|
taskId?: string;
|
|
order?: number;
|
|
isChecked?: boolean;
|
|
}
|
|
|
|
export interface UpdateDailyCheckboxData {
|
|
text?: string;
|
|
isChecked?: boolean;
|
|
type?: DailyCheckboxType;
|
|
taskId?: string;
|
|
order?: number;
|
|
date?: Date;
|
|
}
|
|
|
|
// Interface pour récupérer les checkboxes d'une journée
|
|
export interface DailyView {
|
|
date: Date;
|
|
yesterday: DailyCheckbox[]; // Checkboxes de la veille
|
|
today: DailyCheckbox[]; // Checkboxes du jour
|
|
}
|