diff --git a/app/Filament/Resources/Compositions/Pages/EditComposition.php b/app/Filament/Resources/Compositions/Pages/EditComposition.php index b269319..971501f 100644 --- a/app/Filament/Resources/Compositions/Pages/EditComposition.php +++ b/app/Filament/Resources/Compositions/Pages/EditComposition.php @@ -968,6 +968,15 @@ public function addText(): void $this->feedback = $title.' ist angelegt und in den Aufbau übernommen. Der Text bleibt bearbeitbar, solange diese Fassung nicht freigegeben und verwendet wird. Es entsteht keine neue Fassung dieses Eintrags.'; } + /** + * Schließt erst den Picker und öffnet danach den Dialog, damit beide nicht übereinander liegen. + */ + public function startCreateMedium(): void + { + $this->closePicker(); + $this->js("\$wire.mountAction('createMedium')"); + } + private function revealMediumForm(): void { $this->pickerOpen = false; diff --git a/resources/views/filament/verwaltung/picker.blade.php b/resources/views/filament/verwaltung/picker.blade.php index 6146e62..f139bfa 100644 --- a/resources/views/filament/verwaltung/picker.blade.php +++ b/resources/views/filament/verwaltung/picker.blade.php @@ -242,7 +242,7 @@ @if ($zweck === 'aufbau') @if (method_exists($this, 'openText'))@endif - + @if (method_exists($this, 'isProgram') && $this->isProgram())
diff --git a/tests/Feature/VerwaltungArbeitsplatzTest.php b/tests/Feature/VerwaltungArbeitsplatzTest.php index 73b45ac..d0ddce1 100644 --- a/tests/Feature/VerwaltungArbeitsplatzTest.php +++ b/tests/Feature/VerwaltungArbeitsplatzTest.php @@ -165,6 +165,19 @@ public function test_the_license_article_needs_the_catalog_role_and_offers_no_gl ->assertDontSee('Website-Freigabe zurücknehmen'); } + public function test_creating_a_medium_from_the_picker_closes_the_picker_first(): void + { + $module = app(ContentService::class)->createComposition('Neues Medium', CompositionKind::Uebung); + + Livewire::actingAs($this->editor(), 'staff') + ->test(EditExercise::class, ['record' => $module->id]) + ->call('openPicker') + ->assertSee('Neues Medium anlegen') + ->call('startCreateMedium') + ->assertSet('pickerOpen', false) + ->assertDontSee('Bestandteil auswählen'); + } + public function test_redaktion_return_keeps_open_composition_inputs_and_saves_only_editorial_text(): void { $content = app(ContentService::class);