TenantAtlas/resources/views/filament/pages/tenant-diagnostics.blade.php
ahmido 3490fb9e2c feat: RBAC troubleshooting & tenant UI bugfix pack (spec 067) (#84)
Summary
Implements Spec 067 “RBAC Troubleshooting & Tenant UI Bugfix Pack v1” for the tenant admin plane (/admin) with strict RBAC UX semantics:

Non-member tenant scope ⇒ 404 (deny-as-not-found)
Member lacking capability ⇒ 403 server-side, while the UI stays visible-but-disabled with standardized tooltips
What changed
Tenant view header actions now use centralized UI enforcement (no “normal click → error page” for readonly members).
Archived tenants remain resolvable in tenant-scoped routes for entitled members; an “Archived” banner is shown.
Adds tenant-scoped diagnostics page (/admin/t/{tenant}/diagnostics) with safe repair actions (confirmation + authorization + audit log).
Adds/updates targeted Pest tests to lock the 404 vs 403 semantics and action UX.
Implementation notes
Livewire v4.0+ compliance: Uses Filament v5 + Livewire v4 conventions; widget Blade views render a single root element.
Provider registration: Laravel 11+ providers stay in providers.php (no changes required).
Global search: No global search behavior/resources changed in this PR.
Destructive actions:
Tenant archive/restore/force delete and diagnostics repairs execute via ->action(...) and include ->requiresConfirmation().
Server-side authorization is enforced (non-members 404, insufficient capability 403).
Assets: No new assets. No change to php artisan filament:assets expectations.
Tests
Ran:

vendor/bin/sail bin pint --dirty
vendor/bin/sail artisan test --compact (focused files for Spec 067)

Co-authored-by: Ahmed Darrazi <ahmeddarrazi@MacBookPro.fritz.box>
Reviewed-on: #84
2026-01-31 20:09:25 +00:00

32 lines
1.7 KiB
PHP

<x-filament-panels::page>
<div class="space-y-6">
<div class="rounded-xl border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900">
<h2 class="text-base font-semibold text-gray-950 dark:text-white">Tenant diagnostics</h2>
<p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
Identify common tenant configuration issues and apply safe repairs.
</p>
</div>
@if ($missingOwner)
<div class="rounded-xl border border-amber-200 bg-amber-50 p-4 text-amber-900 dark:border-amber-900/40 dark:bg-amber-950/40 dark:text-amber-100">
<div class="font-semibold">Missing owner</div>
<div class="mt-1 text-sm">This tenant currently has no Owner members.</div>
</div>
@endif
@if ($hasDuplicateMembershipsForCurrentUser)
<div class="rounded-xl border border-amber-200 bg-amber-50 p-4 text-amber-900 dark:border-amber-900/40 dark:bg-amber-950/40 dark:text-amber-100">
<div class="font-semibold">Duplicate memberships</div>
<div class="mt-1 text-sm">This tenant has duplicate membership rows for your user.</div>
</div>
@endif
@if (! $missingOwner && ! $hasDuplicateMembershipsForCurrentUser)
<div class="rounded-xl border border-gray-200 bg-white p-4 text-gray-700 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300">
<div class="font-semibold text-gray-950 dark:text-white">All good</div>
<div class="mt-1 text-sm">No known issues detected.</div>
</div>
@endif
</div>
</x-filament-panels::page>