feat(calendar): add domain field and test-connection button to Exchange sources

- Prisma: domain String? added to CalendarSource model (db push applied)
- DTOs: domain in CreateCalendarSourceDto, UpdateCalendarSourceDto, new TestCalendarSourceConfigDto
- Service: domain in SOURCE_SAFE_SELECT, addSource, updateSource; new testConnectionFromConfig method
- Controller: POST /calendar/sources/test-config (before :id routes to avoid collision)
- ExchangeProvider: domain in all source interfaces; passed as 3rd arg to EWS WebCredentials
- Frontend: domain in CalendarSource/CreateSourcePayload/UpdateSourcePayload; testSourceConfig API fn
- Form: domain field (Exchange-only), "Test connection" button with idle/loading/success/error states
- i18n: de+en keys for formFieldDomain, formFieldDomainHint, formTestConnection, formTesting, formTestSuccess, formTestFailed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 13:15:13 +02:00
parent 2e0e7290ba
commit 42daa87e5e
12 changed files with 214 additions and 6 deletions
@@ -24,6 +24,7 @@ export class ExchangeProvider implements CalendarProvider {
username?: string;
password?: string;
exchangeMode?: string | null;
domain?: string;
id: string;
color?: string | null;
},
@@ -56,6 +57,7 @@ export class ExchangeProvider implements CalendarProvider {
username?: string;
password?: string;
exchangeMode?: string | null;
domain?: string;
id: string;
},
): Promise<boolean> {
@@ -144,6 +146,7 @@ export class ExchangeProvider implements CalendarProvider {
url: string;
username?: string;
password?: string;
domain?: string;
id: string;
color?: string | null;
},
@@ -158,6 +161,7 @@ export class ExchangeProvider implements CalendarProvider {
service.Credentials = new ews.WebCredentials(
source.username || '',
source.password || '',
source.domain || undefined,
);
// CalendarView constructor accepts JS Dates in ews-javascript-api
@@ -210,7 +214,7 @@ export class ExchangeProvider implements CalendarProvider {
* Tests EWS connection by binding to the calendar folder.
*/
private async testEwsConnection(
source: { url: string; username?: string; password?: string },
source: { url: string; username?: string; password?: string; domain?: string },
): Promise<boolean> {
const ews: any = await import('ews-javascript-api');
@@ -219,6 +223,7 @@ export class ExchangeProvider implements CalendarProvider {
service.Credentials = new ews.WebCredentials(
source.username || '',
source.password || '',
source.domain || undefined,
);
await ews.Folder.Bind(service, ews.WellKnownFolderName.Calendar);