## Summary - add the Spec 194 governance action catalog, friction classes, reason policies, and regression guards - align exception, review, evidence, finding, tenant, provider connection, and system run actions to the shared semantics model - add focused feature, RBAC, audit, unit, and browser coverage, including the tenant detail triage header consistency update ## Verification - ran the focused Spec 194 verification pack from the quickstart and task plan - ran targeted tenant triage coverage after the detail-header update - ran `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` ## Filament Notes - Filament v5 / Livewire v4 compliance preserved - provider registration remains in `apps/platform/bootstrap/providers.php` - globally searchable resources were not changed - destructive actions remain confirmation-gated and server-authorized - no new Filament assets were introduced; the existing `cd apps/platform && php artisan filament:assets` deploy step stays unchanged Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #229
40 lines
1.4 KiB
PHP
40 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\TenantResource\Pages;
|
|
|
|
use App\Filament\Resources\TenantResource;
|
|
use App\Models\Tenant;
|
|
use App\Support\Tenants\TenantActionSurface;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditTenant extends EditRecord
|
|
{
|
|
protected static string $resource = TenantResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return array_values(array_filter([
|
|
Actions\ActionGroup::make([
|
|
TenantResource::makeRestoreTenantAction(
|
|
TenantActionSurface::TenantEditHeader,
|
|
'You do not have permission to restore tenants.',
|
|
),
|
|
TenantResource::makeArchiveTenantAction(
|
|
TenantActionSurface::TenantEditHeader,
|
|
'You do not have permission to archive tenants.',
|
|
),
|
|
])
|
|
->label('Lifecycle')
|
|
->icon('heroicon-o-archive-box')
|
|
->color('gray')
|
|
->visible(fn (): bool => $this->getRecord() instanceof Tenant
|
|
&& in_array(
|
|
TenantResource::lifecycleActionDescriptor($this->getRecord(), TenantActionSurface::TenantEditHeader)?->key,
|
|
['archive', 'restore'],
|
|
true,
|
|
)),
|
|
]));
|
|
}
|
|
}
|