fix(calendar): EWS uses NTLM auth + edit form stays open after save
- Replace ews-javascript-api (Basic Auth only) with httpntlm for EWS connections - testEwsConnection uses GetFolder SOAP via NTLM - fetchViaEws uses FindItem CalendarView SOAP via NTLM - Edit form no longer auto-closes on save — shows "Erfolgreich gespeichert" instead - Test button in edit mode uses saved credentials via /sources/:id/test endpoint - Add saveSuccess i18n key (de/en) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,7 @@ export function CalendarSettingsPanel() {
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [saveError, setSaveError] = useState<string | null>(null);
|
||||
const [editSaveError, setEditSaveError] = useState<string | null>(null);
|
||||
const [editSaveSuccess, setEditSaveSuccess] = useState(false);
|
||||
const [testResults, setTestResults] = useState<Record<string, 'success' | 'error' | 'testing'>>({});
|
||||
|
||||
// Load sources on mount
|
||||
@@ -234,9 +235,11 @@ export function CalendarSettingsPanel() {
|
||||
<button
|
||||
type="button"
|
||||
className="text-muted-foreground hover:text-foreground transition-colors"
|
||||
onClick={() =>
|
||||
setEditingId(editingId === source.id ? null : source.id)
|
||||
}
|
||||
onClick={() => {
|
||||
setEditingId(editingId === source.id ? null : source.id);
|
||||
setEditSaveSuccess(false);
|
||||
setEditSaveError(null);
|
||||
}}
|
||||
aria-label={`Edit ${source.name}`}
|
||||
>
|
||||
<svg
|
||||
@@ -288,6 +291,9 @@ export function CalendarSettingsPanel() {
|
||||
{editSaveError && (
|
||||
<p className="mb-3 text-sm text-destructive">{editSaveError}</p>
|
||||
)}
|
||||
{editSaveSuccess && (
|
||||
<p className="mb-3 text-sm text-green-600 dark:text-green-400">{t('calendar.saveSuccess') || 'Gespeichert'}</p>
|
||||
)}
|
||||
<h3 className="mb-3 text-sm font-semibold text-foreground">
|
||||
Edit Source
|
||||
</h3>
|
||||
@@ -310,12 +316,13 @@ export function CalendarSettingsPanel() {
|
||||
onSave={async (payload) => {
|
||||
setIsSaving(true);
|
||||
setEditSaveError(null);
|
||||
setEditSaveSuccess(false);
|
||||
try {
|
||||
const updated = await updateSource(editingId, payload);
|
||||
setSources((prev) =>
|
||||
prev.map((s) => (s.id === editingId ? updated : s)),
|
||||
);
|
||||
setEditingId(null);
|
||||
setEditSaveSuccess(true);
|
||||
} catch {
|
||||
setEditSaveError(t('calendar.saveError') || 'Fehler beim Speichern');
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user