Hotfix: Vorschau im Inhalte-Editor und Seitennavigation der Medienbibliothek

- AllowPortalFraming: frame-ancestors 'self' + Portal statt X-Frame-Options SAMEORIGIN,
  damit portal.b2in.eu die Website im Vorschau-iframe zeigen darf
- Medienbibliothek und Hub-Verwaltung: WithPagination – ohne zeigten die Seitenlinks nach
  dem ersten Livewire-Klick auf den Update-Endpunkt (405); Suche/Filter springen auf Seite 1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-10-09 09:36:16 +00:00
parent a661a68913
commit 69d50eed0f
5 changed files with 92 additions and 2 deletions

View file

@ -0,0 +1,37 @@
<?php
use App\Models\User;
use FluxCms\Core\Models\CmsMedia;
use Livewire\Volt\Volt;
/**
* Hotfixes 09.10.2026: Website im Vorschau-iframe des Portals, Seitennavigation der Medienbibliothek.
*/
it('lets the portal frame the website but no other site', function () {
config()->set('domains.domain_portal_url', 'https://portal.b2in.eu');
$this->get('/?cms-preview=0')
->assertSuccessful()
->assertHeader('Content-Security-Policy', "frame-ancestors 'self' https://portal.b2in.eu")
->assertHeaderMissing('X-Frame-Options');
});
it('keeps the media library pagination on the page after a livewire request', function () {
$this->actingAs(User::factory()->create());
foreach (range(1, 50) as $i) {
CmsMedia::create([
'filename' => "bild-{$i}.jpg", 'disk' => 'public', 'path' => "cms/media/originals/{$i}.jpg",
'type' => 'image', 'mime_type' => 'image/jpeg', 'file_size' => 1, 'conversions' => [],
]);
}
$component = Volt::test('admin.cms.media-index')
->call('startEdit', CmsMedia::query()->first()->id)
->call('gotoPage', 2)
->assertSet('paginators.page', 2);
expect($component->html())->not->toContain('livewire/update?page=');
$component->set('search', 'bild-1')->assertSet('paginators.page', 1);
});