feat: implement Jira auto-sync scheduler and UI configuration

- Added `jiraAutoSync` and `jiraSyncInterval` fields to user preferences for scheduler configuration.
- Created `JiraScheduler` service to manage automatic synchronization with Jira based on user settings.
- Updated API route to handle scheduler actions and configuration updates.
- Introduced `JiraSchedulerConfig` component for user interface to control scheduler settings.
- Enhanced `TODO.md` to reflect completed tasks related to Jira synchronization features.
This commit is contained in:
Julien Froidefond
2025-09-21 11:30:41 +02:00
parent a0e2a78372
commit 799a21df5c
9 changed files with 581 additions and 10 deletions

View File

@@ -9,6 +9,15 @@ export interface JiraConnectionStatus {
connected: boolean;
message: string;
details?: string;
scheduler?: JiraSchedulerStatus;
}
export interface JiraSchedulerStatus {
isRunning: boolean;
isEnabled: boolean;
interval: 'hourly' | 'daily' | 'weekly';
nextSync: string | null;
jiraConfigured: boolean;
}
export class JiraClient extends HttpClient {
@@ -30,6 +39,29 @@ export class JiraClient extends HttpClient {
const response = await this.post<{ data: JiraSyncResult }>('/sync');
return response.data;
}
/**
* Active/désactive le scheduler automatique
*/
async toggleScheduler(enabled: boolean): Promise<JiraSchedulerStatus> {
const response = await this.post<{ data: JiraSchedulerStatus }>('/sync', {
action: 'scheduler',
enabled
});
return response.data;
}
/**
* Met à jour la configuration du scheduler
*/
async updateSchedulerConfig(jiraAutoSync: boolean, jiraSyncInterval: 'hourly' | 'daily' | 'weekly'): Promise<JiraSchedulerStatus> {
const response = await this.post<{ data: JiraSchedulerStatus }>('/sync', {
action: 'config',
jiraAutoSync,
jiraSyncInterval
});
return response.data;
}
}
// Instance singleton