## Summary - cut over workspace-owned analysis and library surfaces to workspace shell ownership instead of inheriting remembered environment shell context - update the affected findings pages, scope resolution, navigation helpers, and related Blade views to keep environment focus explicit instead of implicit - add and update Spec 320 artifacts plus focused regression coverage for findings navigation context, workspace hub registration, and admin surface scope behavior ## Guardrails - Filament remains on v5 with Livewire v4 compliance unchanged - provider registration remains in apps/platform/bootstrap/providers.php - no new globally searchable resources were introduced or changed - no new destructive actions were introduced or changed - no Filament assets were added or changed, so the deploy requirement for filament:assets is unchanged ## Testing - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Findings/FindingsAssignmentHygieneReportTest.php tests/Feature/Findings/FindingsIntakeQueueNavigationContextTest.php tests/Feature/Findings/FindingsIntakeQueueTest.php tests/Feature/Findings/MyFindingsInboxNavigationContextTest.php tests/Feature/Findings/MyWorkInboxTest.php tests/Feature/Navigation/WorkspaceHubRegistryTest.php tests/Unit/Support/OperateHub/OperateHubShellResolutionTest.php tests/Unit/Tenants/AdminSurfaceScopeTest.php` - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #375
56 lines
4.2 KiB
PHP
56 lines
4.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Support\Navigation\AdminSurfaceScope;
|
|
use App\Support\Tenants\TenantInteractionLane;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
it('classifies in-scope admin routes into canonical page categories', function (string $path, AdminSurfaceScope $expected): void {
|
|
expect(AdminSurfaceScope::fromPath($path))->toBe($expected);
|
|
})->with([
|
|
'workspace overview' => ['/admin', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'workspace chooser exception' => ['/admin/choose-workspace', AdminSurfaceScope::WorkspaceChooserException],
|
|
'tenant chooser' => ['/admin/choose-environment', AdminSurfaceScope::WorkspaceScoped],
|
|
'retired tenant resource detail' => ['/admin/tenants/tenant-123', AdminSurfaceScope::WorkspaceScoped],
|
|
'retired tenant panel route' => ['/admin/t/tenant-123', AdminSurfaceScope::WorkspaceScoped],
|
|
'workspace environment detail' => ['/admin/workspaces/acme/environments/tenant-123', AdminSurfaceScope::EnvironmentBound],
|
|
'baseline compare environment route' => ['/admin/workspaces/acme/environments/tenant-123/baseline-compare', AdminSurfaceScope::EnvironmentBound],
|
|
'baseline profiles list' => ['/admin/baseline-profiles', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'baseline profiles detail' => ['/admin/baseline-profiles/42', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'baseline profiles edit' => ['/admin/baseline-profiles/42/edit', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'baseline profiles compare matrix' => ['/admin/baseline-profiles/42/compare-matrix', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'baseline snapshots list' => ['/admin/baseline-snapshots', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'baseline snapshots detail' => ['/admin/baseline-snapshots/42', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'my findings inbox' => ['/admin/findings/my-work', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'findings intake' => ['/admin/findings/intake', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'findings hygiene' => ['/admin/findings/hygiene', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'cross-environment compare' => ['/admin/cross-environment-compare', AdminSurfaceScope::WorkspaceOwnedAnalysisSurface],
|
|
'tenant scoped evidence detail' => ['/admin/evidence/123', AdminSurfaceScope::EnvironmentScopedEvidence],
|
|
'evidence overview' => ['/admin/evidence/overview', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'customer review workspace' => ['/admin/reviews/workspace', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'review register' => ['/admin/reviews', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'governance decisions' => ['/admin/governance/decisions', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'alerts' => ['/admin/alerts', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'provider connections' => ['/admin/provider-connections', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'workspace home overview' => ['/admin/workspaces/acme/overview', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'onboarding index' => ['/admin/onboarding', AdminSurfaceScope::OnboardingWorkflow],
|
|
'onboarding draft' => ['/admin/onboarding/42', AdminSurfaceScope::OnboardingWorkflow],
|
|
'operations index' => ['/admin/workspaces/acme/operations', AdminSurfaceScope::WorkspaceWideSurface],
|
|
'retired operation run detail' => ['/admin/operations/44', AdminSurfaceScope::WorkspaceScoped],
|
|
'operation run detail' => ['/admin/workspaces/acme/operations/44', AdminSurfaceScope::CanonicalWorkspaceRecordViewer],
|
|
]);
|
|
|
|
it('keeps workspace owned analysis surfaces tenantless without query hint or remembered environment restore', function (): void {
|
|
$surface = AdminSurfaceScope::WorkspaceOwnedAnalysisSurface;
|
|
|
|
expect($surface->allowsQueryEnvironmentHints())->toBeFalse()
|
|
->and($surface->allowsRememberedEnvironmentRestore())->toBeFalse()
|
|
->and($surface->allowsEnvironmentlessState())->toBeTrue()
|
|
->and($surface->forcesEnvironmentlessShellContext())->toBeTrue()
|
|
->and($surface->requiresExplicitEnvironment())->toBeFalse()
|
|
->and($surface->lane())->toBe(TenantInteractionLane::StandardActiveOperating);
|
|
});
|