## Summary - make `/admin` the canonical workspace-level home instead of implicitly forcing tenant context - add a new Filament workspace overview page with bounded workspace-safe widgets, quick actions, and empty states - align panel routing, middleware, redirect helpers, and tests with the new workspace-home semantics - add Spec 129 design artifacts, contracts, and focused Pest coverage for landing, navigation, content, operations, and authorization ## Validation - `vendor/bin/sail artisan test --compact tests/Feature/Filament/AdminHomeRedirectsToChooseTenantWhenWorkspaceSelectedTest.php tests/Feature/Filament/LoginRedirectsToChooseWorkspaceWhenMultipleWorkspacesTest.php tests/Feature/Filament/WorkspaceOverviewLandingTest.php tests/Feature/Filament/WorkspaceOverviewNavigationTest.php tests/Feature/Filament/WorkspaceOverviewContentTest.php tests/Feature/Filament/WorkspaceOverviewEmptyStatesTest.php tests/Feature/Filament/WorkspaceOverviewOperationsTest.php tests/Feature/Filament/WorkspaceOverviewAuthorizationTest.php tests/Feature/Filament/WorkspaceOverviewPermissionVisibilityTest.php tests/Feature/Filament/ChooseTenantRequiresWorkspaceTest.php tests/Feature/Guards/AdminWorkspaceRoutesGuardTest.php` - `vendor/bin/sail bin pint --dirty --format agent` ## Notes - Livewire v4.0+ compliance is preserved through Filament v5 usage. - Panel provider registration remains in `bootstrap/providers.php` for Laravel 12. - This feature adds a workspace overview page for the admin panel home; it does not introduce destructive actions. - No new Filament assets were added, so there is no additional `filament:assets` deployment requirement for this branch. - Manual browser QA for the quickstart scenarios was not completed in this session because the local browser opened at the Microsoft login flow without an authenticated test session. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #157
103 lines
5.4 KiB
PHP
103 lines
5.4 KiB
PHP
<x-filament-panels::page>
|
|
@php
|
|
$workspace = $overview['workspace'] ?? ['name' => 'Workspace'];
|
|
$quickActions = $overview['quick_actions'] ?? [];
|
|
$zeroTenantState = $overview['zero_tenant_state'] ?? null;
|
|
@endphp
|
|
|
|
<div class="space-y-6">
|
|
<x-filament::section>
|
|
<div class="space-y-2">
|
|
<div class="flex flex-wrap items-center gap-2">
|
|
<span class="inline-flex items-center gap-1.5 rounded-full border border-primary-200 bg-primary-50 px-3 py-1 text-xs font-medium text-primary-700 dark:border-primary-700/60 dark:bg-primary-950/40 dark:text-primary-300">
|
|
<x-filament::icon icon="heroicon-o-home" class="h-3.5 w-3.5" />
|
|
Workspace overview
|
|
</span>
|
|
|
|
@if (filled($workspace['slug'] ?? null))
|
|
<span class="inline-flex items-center gap-1 rounded-full border border-gray-200 bg-gray-50 px-3 py-1 text-xs font-medium text-gray-600 dark:border-white/10 dark:bg-white/5 dark:text-gray-300">
|
|
{{ $workspace['slug'] }}
|
|
</span>
|
|
@endif
|
|
</div>
|
|
|
|
<h1 class="text-2xl font-semibold tracking-tight text-gray-950 dark:text-white">
|
|
{{ $workspace['name'] ?? 'Workspace' }}
|
|
</h1>
|
|
|
|
<p class="max-w-2xl text-sm leading-6 text-gray-600 dark:text-gray-300">
|
|
This home stays workspace-scoped even when you were previously working in a tenant. Tenant drill-down remains explicit so the overview never silently narrows itself.
|
|
</p>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
@if ($quickActions !== [])
|
|
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5">
|
|
@foreach ($quickActions as $action)
|
|
<a
|
|
href="{{ $action['url'] }}"
|
|
class="rounded-xl border border-gray-200 bg-white px-4 py-3 text-left transition hover:border-primary-300 hover:shadow-sm dark:border-white/10 dark:bg-white/5 dark:hover:border-primary-500/40 dark:hover:bg-white/10"
|
|
>
|
|
<div class="flex items-start gap-3">
|
|
<div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg {{ $action['color'] === 'primary' ? 'bg-primary-100 text-primary-700 dark:bg-primary-950/50 dark:text-primary-300' : 'bg-gray-100 text-gray-700 dark:bg-white/10 dark:text-gray-200' }}">
|
|
<x-filament::icon :icon="$action['icon']" class="h-5 w-5" />
|
|
</div>
|
|
|
|
<div class="min-w-0">
|
|
<div class="text-sm font-semibold text-gray-950 dark:text-white">
|
|
{{ $action['label'] }}
|
|
</div>
|
|
<div class="mt-1 text-xs leading-5 text-gray-600 dark:text-gray-300">
|
|
{{ $action['description'] }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
|
|
@if (is_array($zeroTenantState))
|
|
<section class="rounded-2xl border border-warning-200 bg-warning-50 p-5 shadow-sm dark:border-warning-700/50 dark:bg-warning-950/30">
|
|
<div class="flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
|
|
<div class="space-y-1">
|
|
<h2 class="text-sm font-semibold text-warning-900 dark:text-warning-100">
|
|
{{ $zeroTenantState['title'] }}
|
|
</h2>
|
|
<p class="text-sm text-warning-800 dark:text-warning-200">
|
|
{{ $zeroTenantState['body'] }}
|
|
</p>
|
|
</div>
|
|
|
|
<x-filament::button
|
|
tag="a"
|
|
color="warning"
|
|
:href="$zeroTenantState['action_url']"
|
|
icon="heroicon-o-arrow-right"
|
|
>
|
|
{{ $zeroTenantState['action_label'] }}
|
|
</x-filament::button>
|
|
</div>
|
|
</section>
|
|
@endif
|
|
|
|
<div class="space-y-6">
|
|
@livewire(\App\Filament\Widgets\Workspace\WorkspaceSummaryStats::class, [
|
|
'metrics' => $overview['summary_metrics'] ?? [],
|
|
], key('workspace-overview-summary-' . ($workspace['id'] ?? 'none')))
|
|
|
|
<div class="grid grid-cols-1 gap-6 xl:grid-cols-2">
|
|
@livewire(\App\Filament\Widgets\Workspace\WorkspaceNeedsAttention::class, [
|
|
'items' => $overview['attention_items'] ?? [],
|
|
'emptyState' => $overview['attention_empty_state'] ?? [],
|
|
], key('workspace-overview-attention-' . ($workspace['id'] ?? 'none')))
|
|
|
|
@livewire(\App\Filament\Widgets\Workspace\WorkspaceRecentOperations::class, [
|
|
'operations' => $overview['recent_operations'] ?? [],
|
|
'emptyState' => $overview['recent_operations_empty_state'] ?? [],
|
|
], key('workspace-overview-operations-' . ($workspace['id'] ?? 'none')))
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-filament-panels::page>
|