feat(document): drop the read-only Originaltext field from the edit form
The "Originaltext:" line in WhoWhenSection rendered the verbatim import cell (metaDateRaw) as static text plus a hidden input that re-submitted it on every save. Editors mistook it for an editable field. Remove the visible line, the hidden round-trip input, and the now-unused rawDate prop (here and at the DocumentEditLayout call site). The backend's partial update preserves the stored value, so no data is lost. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -93,13 +93,12 @@ describe('WhoWhenSection — precision controls', () => {
|
||||
expect(document.querySelector('input#metaDateEnd')).not.toBeNull();
|
||||
});
|
||||
|
||||
it('renders the raw cell as static text (not an editable input) and escapes it', async () => {
|
||||
render(WhoWhenSection, { rawDate: '<b>Sommer</b> 1916' });
|
||||
const raw = document.querySelector('[data-testid="who-when-raw"]');
|
||||
expect(raw).not.toBeNull();
|
||||
// Verbatim shown as escaped text; no injected <b> element.
|
||||
expect(raw?.textContent).toContain('<b>Sommer</b> 1916');
|
||||
expect(raw?.querySelector('b')).toBeNull();
|
||||
it('never renders the raw cell, and never re-submits it via a hidden input', async () => {
|
||||
render(WhoWhenSection, {});
|
||||
// The confusing "Originaltext" line is gone …
|
||||
expect(document.querySelector('[data-testid="who-when-raw"]')).toBeNull();
|
||||
// … and editing no longer round-trips metaDateRaw to the backend.
|
||||
expect(document.querySelector('input[name="metaDateRaw"]')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user