diff --git a/app/Filament/Resources/Compositions/Pages/EditComposition.php b/app/Filament/Resources/Compositions/Pages/EditComposition.php index 2aa2a63..29f09b0 100644 --- a/app/Filament/Resources/Compositions/Pages/EditComposition.php +++ b/app/Filament/Resources/Compositions/Pages/EditComposition.php @@ -828,6 +828,13 @@ 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.'; } + private function revealMediumForm(): void + { + $this->pickerOpen = false; + $this->partOpen = false; + $this->textOpen = false; + } + public function createMediumAction(): Action { return Action::make('createMedium') @@ -836,6 +843,7 @@ public function createMediumAction(): Action ->modalDescription('Dieselbe Maske gilt im Medienbestand, im Modul und im Programm. Der Upload zeigt seinen Fortschritt. Beschreibung, Hinweise und Vorschaubild trägst du danach in dieser Maske ein.') ->modalSubmitActionLabel('Anlegen und übernehmen') ->modalWidth(Width::Large) + ->beforeFormFilled(fn () => $this->revealMediumForm()) ->schema(fn (): array => MediumForm::fields(creating: true)) ->action(function (array $data): void { try { @@ -863,6 +871,7 @@ public function editMediumAction(): Action ->modalDescription('Titel, Beschreibung, Hinweise und Vorschaubild gelten für das Medium. Eine neue Fassung entsteht nur, wenn der Text bereits freigegeben und verwendet wird.') ->modalSubmitActionLabel('Speichern') ->modalWidth(Width::Large) + ->beforeFormFilled(fn () => $this->revealMediumForm()) ->fillForm(function (array $arguments): array { $element = ContentElement::query()->find($arguments['element'] ?? 0); diff --git a/resources/views/filament/editorial/styles.blade.php b/resources/views/filament/editorial/styles.blade.php index 05a1e3f..4559bbb 100644 --- a/resources/views/filament/editorial/styles.blade.php +++ b/resources/views/filament/editorial/styles.blade.php @@ -245,6 +245,7 @@ .luf-picker { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(14rem, 0.8fr); gap: 0.8rem; align-items: start; } .luf-detail { background: var(--luf-paper); border: 1px solid var(--luf-line); padding: 0.8rem; } .luf-modal { position: fixed; inset: 0; z-index: 50; background: rgba(27, 40, 56, 0.46); display: grid; place-items: center; padding: 1rem; } + .fi-modal > .fi-modal-close-overlay, .fi-modal > .fi-modal-window-ctn { z-index: 80; } .luf-modal-card { width: min(76rem, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: #fff; border: 1px solid var(--luf-line); padding: 1rem 1.1rem 1.25rem; } .luf-modal-narrow { width: min(36rem, 100%); } .luf-confirm { margin: 0 0 1rem; padding: 0.9rem 1rem; background: #fff; border: 1px solid var(--luf-yellow); } diff --git a/tests/Feature/EditorialEditorTest.php b/tests/Feature/EditorialEditorTest.php index 96bf5f5..a57ac0f 100644 --- a/tests/Feature/EditorialEditorTest.php +++ b/tests/Feature/EditorialEditorTest.php @@ -618,7 +618,11 @@ public function test_a_file_can_be_created_inside_the_module(): void $component = Livewire::actingAs($editor, 'staff') ->test(EditExercise::class, ['record' => $module->id]) + ->assertSee('Medium anlegen') + ->set('pickerOpen', true) + ->assertSee('Material auswählen') ->mountAction('createMedium') + ->assertSet('pickerOpen', false) ->assertMountedActionModalSee('Vorschaubild') ->fillForm([ 'working_title' => 'Merkblatt',