fix: workspaces nav uses active tenant
This commit is contained in:
parent
eb7e6d56f0
commit
d4e0632557
@ -53,7 +53,15 @@ public function panel(Panel $panel): Panel
|
|||||||
])
|
])
|
||||||
->navigationItems([
|
->navigationItems([
|
||||||
NavigationItem::make('Workspaces')
|
NavigationItem::make('Workspaces')
|
||||||
->url(fn (): string => ChooseWorkspace::getUrl())
|
->url(function (): string {
|
||||||
|
$tenant = Filament::getTenant();
|
||||||
|
|
||||||
|
if ($tenant instanceof Tenant) {
|
||||||
|
return route('filament.admin.resources.workspaces.index', ['tenant' => $tenant->external_id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ChooseWorkspace::getUrl();
|
||||||
|
})
|
||||||
->icon('heroicon-o-squares-2x2')
|
->icon('heroicon-o-squares-2x2')
|
||||||
->group('Settings')
|
->group('Settings')
|
||||||
->sort(10),
|
->sort(10),
|
||||||
|
|||||||
@ -32,6 +32,7 @@
|
|||||||
assertNoOutboundHttp(function () use ($tenant): void {
|
assertNoOutboundHttp(function () use ($tenant): void {
|
||||||
$this->get(TenantDashboard::getUrl(tenant: $tenant))
|
$this->get(TenantDashboard::getUrl(tenant: $tenant))
|
||||||
->assertOk()
|
->assertOk()
|
||||||
|
->assertSee("/admin/t/{$tenant->external_id}/workspaces", false)
|
||||||
->assertSee('Needs Attention')
|
->assertSee('Needs Attention')
|
||||||
->assertSee('Recent Operations')
|
->assertSee('Recent Operations')
|
||||||
->assertSee('Recent Drift Findings');
|
->assertSee('Recent Drift Findings');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user