feat(email): add provider picker to Settings > Account
b5 of the multi-provider email roadmap (frontend). Adds EmailProviderConnections -- one card per provider (Gmail, Outlook/Microsoft 365, generic IMAP) showing connect status and connect/disconnect actions, mounted in SettingsView's Account tab alongside the existing app-login GoogleAuthCard (a separate concern: that card is sign-in identity, this is mailbox linking). Gmail and Microsoft reuse the OAuth-popup + postMessage handshake already built server-side (mirrors Correspondence.tsx's existing Gmail-connect flow). IMAP has no OAuth step, so it's a plain host/port/ssl/username/password form posting to /api/imap/connect, which verifies the connection server-side before storing it. Deliberately NOT touched: the Gmail-specific job-candidate-matching/review UI in Correspondence.tsx and GmailReviewPage.tsx. That backend pipeline (ListJobCandidateMessagesAsync, GmailReviewDecisions) is still Gmail-only by design -- generalising it now would mean building fake UI for capabilities Microsoft/IMAP don't have yet. This is scoped to the piece that's actually provider-neutral: connect/disconnect status. Verified live (backend + frontend dev servers): logged in, confirmed all three /status calls return 200, Gmail connect-url fetch succeeds, IMAP form submit hits /api/imap/connect and surfaces the expected 400 on a bad host. Frontend suite: 25 suites / 57 tests green (2 new). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -384,6 +384,35 @@ export interface GmailStatus {
|
||||
lastSyncError?: string | null;
|
||||
}
|
||||
|
||||
export interface MicrosoftGraphStatus {
|
||||
connected: boolean;
|
||||
mailAddress?: string | null;
|
||||
connectedAt?: string;
|
||||
lastSyncedAt?: string;
|
||||
lastSyncAttemptedAt?: string;
|
||||
lastSyncSucceededAt?: string;
|
||||
lastSyncMode?: string | null;
|
||||
lastSyncSource?: string | null;
|
||||
lastSyncStatus?: string | null;
|
||||
lastSyncError?: string | null;
|
||||
}
|
||||
|
||||
export interface ImapStatus {
|
||||
connected: boolean;
|
||||
host?: string | null;
|
||||
port?: number | null;
|
||||
useSsl?: boolean | null;
|
||||
username?: string | null;
|
||||
connectedAt?: string;
|
||||
lastSyncedAt?: string;
|
||||
lastSyncAttemptedAt?: string;
|
||||
lastSyncSucceededAt?: string;
|
||||
lastSyncMode?: string | null;
|
||||
lastSyncSource?: string | null;
|
||||
lastSyncStatus?: string | null;
|
||||
lastSyncError?: string | null;
|
||||
}
|
||||
|
||||
export interface GmailManualSyncResult {
|
||||
queriesRun: number;
|
||||
candidateThreadCount: number;
|
||||
|
||||
Reference in New Issue
Block a user