feat(P-11): enhance media asset handling with legal hold attributes and update version to 0.8.85
All checks were successful
Deploy Development / deploy (push) Successful in 39s
Test Suite / pytest-backend (push) Successful in 35s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 10s
Test Suite / playwright-tests (push) Successful in 54s

This commit is contained in:
Lars 2026-05-11 13:07:52 +02:00
parent fb8837574e
commit f79f83e8f9
6 changed files with 24 additions and 11 deletions

View File

@ -1145,7 +1145,10 @@ def list_media_assets(
cur.execute(
f"""SELECT ma.id, ma.mime_type, ma.byte_size, ma.original_filename, ma.visibility, ma.club_id,
ma.uploaded_by_profile_id, ma.lifecycle_state, ma.created_at, ma.sha256,
ma.copyright_notice, ma.storage_key, {tags_select}
ma.copyright_notice, ma.storage_key, ma.rights_status,
ma.legal_hold_active, ma.legal_hold_reason_code, ma.legal_hold_reason_note,
ma.legal_hold_set_at, ma.legal_hold_set_by_profile_id,
{tags_select}
pr.name AS uploader_name,
pr.email AS uploader_email,
cl.name AS club_name

View File

@ -1,6 +1,6 @@
# Shinkan Jinkendo Version Information
APP_VERSION = "0.8.84"
APP_VERSION = "0.8.85"
BUILD_DATE = "2026-05-11"
DB_SCHEMA_VERSION = "20260511051"
@ -33,6 +33,16 @@ MODULE_VERSIONS = {
}
CHANGELOG = [
{
"version": "0.8.85",
"date": "2026-05-11",
"changes": [
"Fix P-11: Listquery fehlte legal_hold_active/reason_code/reason_note/set_at — Badge und 'Sperre aufheben' im Modal waren nie sichtbar.",
"Fix P-11: submitLegalHold rief loadMedia() statt loadItems() auf ('loadMedia is not a function').",
"Fix P-11: Journal-Renderpfad verwendete nw.legal_hold_reason_code/note statt nw.reason_code/note (Keys aus dem Audit-Log).",
"Fix P-11: Archiv-Picker (ExerciseFormPage, ExerciseInlineFileMediaModal) filtert Legal-Hold-Assets auch fuer Superadmins heraus.",
],
},
{
"version": "0.8.84",
"date": "2026-05-11",

View File

@ -151,7 +151,7 @@ export default function ExerciseInlineFileMediaModal({
limit: 48,
lifecycle: 'active',
})
setItems(Array.isArray(res.items) ? res.items : [])
setItems(Array.isArray(res.items) ? res.items.filter(a => !a.legal_hold_active) : [])
} catch (e) {
setErr(e.message || String(e))
setItems([])

View File

@ -434,7 +434,7 @@ function ExerciseFormPage() {
q: archiveQ.trim() || undefined,
limit: 40,
})
if (!cancelled) setArchiveItems(res.items || [])
if (!cancelled) setArchiveItems((res.items || []).filter(a => !a.legal_hold_active))
} catch (e) {
if (!cancelled) setArchiveError(e.message || String(e))
} finally {

View File

@ -508,7 +508,7 @@ export default function MediaLibraryPage() {
setLegalHoldDialog(null)
setModal(null)
setModalDraft(null)
await loadMedia()
await loadItems()
} catch (e) {
alert(e.message || String(e))
} finally {
@ -1634,21 +1634,21 @@ export default function MediaLibraryPage() {
<>
<div className="media-library__journal-audit-row">
<span className="media-library__journal-audit-label">Grund:</span>
<span>{LEGAL_HOLD_REASON_LABELS[nw.legal_hold_reason_code] || nw.legal_hold_reason_code || '—'}</span>
<span>{LEGAL_HOLD_REASON_LABELS[nw.reason_code] || nw.reason_code || '—'}</span>
</div>
{nw.legal_hold_reason_note ? (
{nw.reason_note ? (
<div className="media-library__journal-audit-row">
<span className="media-library__journal-audit-label">Begründung:</span>
<span>{nw.legal_hold_reason_note}</span>
<span>{nw.reason_note}</span>
</div>
) : null}
</>
) : evt.event_type === 'legal_hold_released' ? (
<>
{nw.legal_hold_release_note ? (
{nw.release_note ? (
<div className="media-library__journal-audit-row">
<span className="media-library__journal-audit-label">Freigabegrund:</span>
<span>{nw.legal_hold_release_note}</span>
<span>{nw.release_note}</span>
</div>
) : null}
<div className="media-library__journal-audit-row">

View File

@ -1,6 +1,6 @@
// Shinkan Jinkendo Frontend Version
export const APP_VERSION = "0.8.84"
export const APP_VERSION = "0.8.85"
export const BUILD_DATE = "2026-05-11"
export const PAGE_VERSIONS = {