fix: stop panel widgets on managed-tenants landing
This commit is contained in:
parent
797728a243
commit
9fd8cdef83
@ -26,6 +26,18 @@ class ManagedTenantsLanding extends Page
|
||||
|
||||
public Workspace $workspace;
|
||||
|
||||
/**
|
||||
* The Filament simple layout renders the topbar by default, which includes
|
||||
* lazy-loaded database notifications. On this workspace-scoped landing page,
|
||||
* those background Livewire requests currently 404.
|
||||
*/
|
||||
protected function getLayoutData(): array
|
||||
{
|
||||
return [
|
||||
'hasTopbar' => false,
|
||||
];
|
||||
}
|
||||
|
||||
public function mount(Workspace $workspace): void
|
||||
{
|
||||
$this->workspace = $workspace;
|
||||
|
||||
@ -163,9 +163,11 @@ public function panel(Panel $panel): Panel
|
||||
)
|
||||
->renderHook(
|
||||
PanelsRenderHook::BODY_END,
|
||||
fn () => (bool) config('tenantpilot.bulk_operations.progress_widget_enabled', true)
|
||||
? view('livewire.bulk-operation-progress-wrapper')->render()
|
||||
: ''
|
||||
fn (): string => request()->routeIs('admin.workspace.managed-tenants.index')
|
||||
? ''
|
||||
: ((bool) config('tenantpilot.bulk_operations.progress_widget_enabled', true)
|
||||
? view('livewire.bulk-operation-progress-wrapper')->render()
|
||||
: '')
|
||||
)
|
||||
->resources([
|
||||
TenantResource::class,
|
||||
|
||||
@ -34,6 +34,12 @@
|
||||
|
||||
$html = $response->getContent();
|
||||
|
||||
// This landing page must not include Livewire-driven panel widgets that
|
||||
// trigger background updates (lazy-loaded database notifications, progress poller).
|
||||
expect($html)->not->toContain('Filament\\Livewire\\DatabaseNotifications');
|
||||
expect($html)->not->toContain('__lazyLoad');
|
||||
expect($html)->not->toContain('opsUxProgressWidgetPoller');
|
||||
|
||||
// 2. Extract the first Livewire component snapshot
|
||||
preg_match('/wire:snapshot="([^"]+)"/', $html, $snapshotMatch);
|
||||
expect($snapshotMatch)->not->toBeEmpty('No Livewire snapshot found in page HTML');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user