Fix: Correction des erreurs TypeScript de build

Corrections apportées pour résoudre l'échec de build :

1. **Index.tsx** :
   - Ajout du else manquant dans le ternaire conditionnel (ligne 1536)
   - Ajout du type explicite pour calendarAuthStatus (authType)
   - Cast de type pour google_auth_type dans onValueChange
   - Ajout d'un bouton "Synchroniser" pour Service Account

2. **SettingsService.ts** :
   - Ajout des nouvelles propriétés à l'interface Settings :
     - google_auth_type?: 'oauth2' | 'service_account'
     - google_service_account_key?: string
     - google_calendar_email?: string

Le build passe maintenant avec succès (✓ built in 8.72s).
This commit is contained in:
Claude committed 2025-11-12 13:10:59 +00:00
1 parent 3cb6c81489
commit 81f25a09d1
2 files changed
+26 -2

No files matched your search

+23 -2
View File
@@ -54,7 +54,12 @@ const Index = () => {
const [noteTags, setNoteTags] = useState<Tag[]>([]);
const [openRouterModels, setOpenRouterModels] = useState<OpenRouterModel[]>([]);
const [loadingModels, setLoadingModels] = useState(false);
const [calendarAuthStatus, setCalendarAuthStatus] = useState({
const [calendarAuthStatus, setCalendarAuthStatus] = useState<{
isAuthenticated: boolean;
isExpired: boolean;
needsReauth: boolean;
authType?: 'oauth2' | 'service_account';
}>({
isAuthenticated: false,
isExpired: false,
needsReauth: true
@@ -1354,7 +1359,7 @@ const Index = () => {
<Label htmlFor="google-auth-type">Méthode d'authentification</Label>
<Select
value={settings.google_auth_type || 'oauth2'}
onValueChange={(value) => setSettings({ ...settings, google_auth_type: value })}
onValueChange={(value) => setSettings({ ...settings, google_auth_type: value as 'oauth2' | 'service_account' })}
>
<SelectTrigger id="google-auth-type">
<SelectValue placeholder="Sélectionnez une méthode" />
@@ -1533,6 +1538,22 @@ const Index = () => {
Déconnecter
</Button>
</>
) : (
<Button
onClick={async () => {
try {
const result = await CalendarService.sync();
showSuccess(`${result.syncedCount} événements synchronisés`);
await loadCalendarEvents();
} catch (error) {
showError("Erreur lors de la synchronisation");
}
}}
className="flex items-center gap-2"
>
<RefreshCw className="h-4 w-4" />
Synchroniser
</Button>
)}
</div>
</>
+3
View File
@@ -7,6 +7,9 @@ export interface Settings {
theme?: 'light' | 'dark' | 'auto';
google_client_id?: string;
google_client_secret?: string;
google_auth_type?: 'oauth2' | 'service_account';
google_service_account_key?: string;
google_calendar_email?: string;
// Legacy fields (kept for backward compatibility)
google_calendar_api_key?: string;
google_calendar_id?: string;