Speichere die Postfachkennung als Text, damit eine uebernommene E-Mail in der Akte ankommt.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
ad6240a5da
commit
17a3b3a736
4 files changed
+13
-3
No files matched your search
@@ -979,7 +979,7 @@ def post_external(body: ExternalIn, principal: Principal = Depends(get_principal
|
||||
body.dates.document_on,
|
||||
body.dates.sent_on,
|
||||
body.dates.received_on,
|
||||
body.detail.model_dump(exclude_none=True) if body.detail else None,
|
||||
body.detail.model_dump(mode="json", exclude_none=True) if body.detail else None,
|
||||
)
|
||||
return _created(f"/api/v1/elements/{element['id']}", {"id": str(element["id"]), "title": element["title"]})
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ def link_source(body: ExternalIn, principal: Principal = Depends(get_principal),
|
||||
body.dates.document_on,
|
||||
body.dates.sent_on,
|
||||
body.dates.received_on,
|
||||
body.detail.model_dump(exclude_none=True) if body.detail else None,
|
||||
body.detail.model_dump(mode="json", exclude_none=True) if body.detail else None,
|
||||
)
|
||||
return _created(f"/api/v1/elements/{element['id']}", {"id": str(element["id"]), "title": element["title"]})
|
||||
|
||||
|
||||
@@ -61,6 +61,8 @@ def test_dates_do_not_invent_a_direction_and_explicit_choice_survives(client, db
|
||||
"direction": "in",
|
||||
"message_from": "Hausverwaltung Mueller",
|
||||
"mailbox": "INBOX",
|
||||
"connector_id": "6f0b6a2e-1c4d-4b8a-9e2f-0a1b2c3d4e5f",
|
||||
"uid": 17,
|
||||
},
|
||||
},
|
||||
status=201,
|
||||
@@ -76,6 +78,8 @@ def test_dates_do_not_invent_a_direction_and_explicit_choice_survives(client, db
|
||||
assert _binding(shown, "Scan ohne Richtung")["communication"]["direction"] is None
|
||||
mail = _binding(shown, "Mail der Verwaltung")
|
||||
assert mail["communication"] == {"direction": "in", "explicit": True}
|
||||
assert mail["element"]["external"]["detail"]["connector_id"] == "6f0b6a2e-1c4d-4b8a-9e2f-0a1b2c3d4e5f"
|
||||
assert mail["element"]["external"]["detail"]["uid"] == 17
|
||||
|
||||
ada.request(
|
||||
"PATCH",
|
||||
|
||||
@@ -305,6 +305,7 @@ export function MailPicker({ context, placement, chapterId = "", chapterTitle =
|
||||
const [selectedKey, setSelectedKey] = useState("");
|
||||
const [preview, setPreview] = useState(null);
|
||||
const [previewError, setPreviewError] = useState("");
|
||||
const [adopting, setAdopting] = useState(false);
|
||||
const [loading, setLoading] = useState("");
|
||||
const [error, setError] = useState("");
|
||||
|
||||
@@ -433,7 +434,9 @@ export function MailPicker({ context, placement, chapterId = "", chapterTitle =
|
||||
}
|
||||
|
||||
async function link(item) {
|
||||
if (adopting) return;
|
||||
setError("");
|
||||
setAdopting(true);
|
||||
const letter = preview && preview.uid === item.uid ? preview : null;
|
||||
const known = letter?.direction || item.direction;
|
||||
const direction = known === "out" || known === "in" ? known : null;
|
||||
@@ -479,6 +482,8 @@ export function MailPicker({ context, placement, chapterId = "", chapterTitle =
|
||||
onDone();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
} finally {
|
||||
setAdopting(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,7 +552,8 @@ export function MailPicker({ context, placement, chapterId = "", chapterTitle =
|
||||
{preview?.text ? <pre className="mail-letter__body">{preview.text}</pre> : null}
|
||||
{preview?.text_truncated ? <p className="muted">Der Text ist gekürzt, weil die Nachricht sehr groß ist.</p> : null}
|
||||
{preview && !preview.text ? <p className="muted">Diese Nachricht hat keinen lesbaren Text.</p> : null}
|
||||
<button type="button" onClick={() => link(selected)} disabled={!selected.uid}>Übernehmen</button>
|
||||
<ErrorNote error={error} />
|
||||
<button type="button" onClick={() => link(selected)} disabled={!selected.uid || adopting}>{adopting ? "Wird übernommen …" : "Übernehmen"}</button>
|
||||
</>
|
||||
)}
|
||||
</aside>
|
||||
|
||||
Reference in new issue
Block a user