Speichere formatierte Texte als bereinigtes HTML mit einem Editor (ADR-50)

Ein Baustein (FormattedText) bereinigt, bringt Werte in die kanonische Form und
wandelt Klartext des Altbestands; RichField ist der eine Editor, ManagesRichFields
verbindet ihn mit den Arbeitsplätzen. Formatiert sind Texte der Übungen und
Textbausteine, Kurzbeschreibung und Beschreibung, Lernziel und Ausstattung.
Mitgliederansicht und PDF zeigen fett, kursiv, Listen, Überschrift, Zitat und Link
(PDF: schräge Schnitte, nur wenn gebraucht). Das Livewire-Limit für verschachtelte
Pfade steigt auf 30, weil Aufzählungen sonst abgelehnt werden.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-23 23:45:54 +01:00
1 parent be24f3bf64
commit 9fbd933e1e
50 files changed
+1461 -181

No files matched your search

+12 -12
View File
@@ -84,7 +84,7 @@ public function test_display_data_does_not_create_a_version_and_a_module_works_w
$this->assertSame('Sichtbar ohne Film', $module->display_title);
$this->assertSame(1, $module->versions()->count());
$this->assertSame('Den Abstand erklären', $module->versions()->first()->learning_goal);
$this->assertSame('<p>Den Abstand erklären</p>', $module->versions()->first()->learning_goal);
$this->assertSame(1, $module->versions()->first()->members()->count());
}
@@ -259,18 +259,18 @@ public function test_saving_a_draft_ten_times_creates_one_version_only_when_rele
$module->refresh();
$this->assertSame(0, $module->versions()->count());
$this->assertSame('Durchgang 10', $module->working_draft['learning_goal']);
$this->assertSame('<p>Durchgang 10</p>', $module->working_draft['learning_goal']);
Livewire::actingAs($editor, 'staff')
->test(EditExercise::class, ['record' => $module->id])
->assertSet('learningGoal', 'Durchgang 10')
->assertSet('learningGoal', '<p>Durchgang 10</p>')
->set('releaseConsent', true)
->call('publishRevision')
->assertSet('feedback', 'Fassung 1 ist freigegeben. Der Entwurf ist geschlossen und die bisherige Fassung bleibt erhalten. Die Mitgliederbibliothek ändert sich dadurch nicht.');
$module->refresh();
$this->assertSame(1, $module->versions()->count());
$this->assertSame('Durchgang 10', $module->versions()->first()->learning_goal);
$this->assertSame('<p>Durchgang 10</p>', $module->versions()->first()->learning_goal);
$this->assertNull($module->working_draft);
Livewire::actingAs($editor, 'staff')
@@ -280,8 +280,8 @@ public function test_saving_a_draft_ten_times_creates_one_version_only_when_rele
$module->refresh();
$this->assertSame(1, $module->versions()->count());
$this->assertSame('Durchgang 10', $module->versions()->first()->fresh()->learning_goal);
$this->assertSame('Nur Entwurf', $module->working_draft['learning_goal']);
$this->assertSame('<p>Durchgang 10</p>', $module->versions()->first()->fresh()->learning_goal);
$this->assertSame('<p>Nur Entwurf</p>', $module->working_draft['learning_goal']);
}
public function test_the_picker_finds_a_film_by_title(): void
@@ -393,7 +393,7 @@ public function test_a_chosen_picture_and_description_do_not_create_a_version():
$this->assertSame(1, $composition->versions()->count());
$this->assertSame('vorschau/komposition-'.$composition->id.'.jpg', $composition->thumbnail_path);
$this->assertSame('element:'.$first->element->id, $composition->thumbnail_source);
$this->assertSame('Eine fachliche Beschreibung für die Bibliothek.', $composition->description);
$this->assertSame('<p>Eine fachliche Beschreibung für die Bibliothek.</p>', $composition->description);
Storage::disk('media_derived')->assertExists($composition->thumbnail_path);
$this->get('/medien/'.$composition->thumbnail_path)->assertNotFound();
}
@@ -429,7 +429,7 @@ public function test_texts_save_in_the_redaktion_and_the_dialog_keeps_didactics_
$composition = $version->composition->fresh();
$this->assertSame(1, $composition->versions()->count());
$this->assertSame('Ausführlicher Dialogtext', $composition->description);
$this->assertSame('<p>Ausführlicher Dialogtext</p>', $composition->description);
$this->assertNull($composition->working_draft);
Livewire::actingAs($editor, 'staff')
@@ -441,7 +441,7 @@ public function test_texts_save_in_the_redaktion_and_the_dialog_keeps_didactics_
$composition->refresh();
$this->assertSame(1, $composition->versions()->count());
$this->assertSame(ContentVersionStatus::Bereit, $composition->versions()->first()->status);
$this->assertSame('Nur im Entwurf', $composition->working_draft['learning_goal']);
$this->assertSame('<p>Nur im Entwurf</p>', $composition->working_draft['learning_goal']);
$this->assertSame(9, $composition->working_draft['duration_minutes']);
}
@@ -621,7 +621,7 @@ public function test_a_module_text_stays_editable_until_it_is_released_and_used(
$version = $element->versions()->sole();
$this->assertSame(ContentVersionStatus::Entwurf, $version->status);
$this->assertSame('Geänderter Wortlaut', $version->body);
$this->assertSame('<p>Geänderter Wortlaut</p>', $version->body);
$this->assertSame(1, $element->versions()->count());
$this->actingAs($editor, 'staff')
@@ -643,7 +643,7 @@ public function test_a_module_text_stays_editable_until_it_is_released_and_used(
->call('saveDraft');
$this->assertSame(2, $element->fresh()->versions()->count());
$this->assertSame('Geänderter Wortlaut', $version->fresh()->body);
$this->assertSame('<p>Geänderter Wortlaut</p>', $version->fresh()->body);
$this->assertSame($version->id, $module->fresh()->versions()->first()->members()->first()->content_element_version_id);
$this->assertSame('element:'.$element->versions()->orderByDesc('number')->first()->id, $module->fresh()->working_draft['members'][0]['target']);
}
@@ -685,7 +685,7 @@ public function test_a_file_can_be_created_inside_the_module(): void
$version = $element->versions()->sole();
$this->assertSame('document', $element->output_class);
$this->assertSame('Für die Gruppe', $element->description);
$this->assertSame('<p>Für die Gruppe</p>', $element->description);
$this->assertSame('Vorher lesen', $element->usage_note);
$this->assertSame(ContentVersionStatus::Entwurf, $version->status);
$this->assertSame('eigen', $element->fresh()->thumbnail_source);