feat(quick-260907-let): Knopf "Verbindung testen" im Postfach-Formular

- testEmailConnection im API-Klienten, POST email-config/test
- EmailAlertConfigForm: Testknopf vor Speichern, Wartezustand, gruene/rote
  Rueckmeldung, Formularaenderung raeumt vorherige Rueckmeldung weg
- Beschreibungsblock der Komponente korrigiert (Knopf existiert jetzt)
- Vier neue Schluessel unter tenderRadar.emailAlerts in de/en
- vi.mock-Fabriken in EmailAlertConfigForm.test.tsx und my-sources.test.tsx
  um testEmailConnection erweitert, zwei neue Testfaelle

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FYZcd3SSmo14QTqWx2KKzU
This commit is contained in:
2026-09-07 15:43:51 +02:00
parent 3bf550bc65
commit c4db3b2e65
6 changed files with 152 additions and 11 deletions
+24
View File
@@ -569,3 +569,27 @@ export async function saveEmailConfig(
}
return res.json();
}
/**
* Test the connection to this user's own portal-alert mailbox WITHOUT
* saving anything (Quick 260907-let, WINDOWS #16). Same payload shape as
* `saveEmailConfig` — when `password`/`username` are left out, the server
* falls back to this user's stored, decrypted credentials.
* POST /modules/tender-radar/email-config/test
*/
export async function testEmailConnection(
payload: Partial<EmailAlertConfig> & { password?: string },
): Promise<{ success: boolean; message?: string }> {
const res = await fetch(`${API_URL}/modules/tender-radar/email-config/test`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify(payload),
});
if (!res.ok) {
throw new Error(
await extractErrorMessage(res, 'Failed to test email-alert connection'),
);
}
return res.json();
}