feat(106): Required Permissions sidebar stays on workspace nav #129
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "106-required-permissions-sidebar-context"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the sidebar context bug where navigating to the Required Permissions page (
/admin/tenants/{id}/required-permissions) would switch the sidebar from workspace navigation to tenant-scoped navigation, confusing users.Problem
The
EnsureFilamentTenantSelectedmiddleware detected a tenant ID in the URL and calledsetTenant(), which switched the entire sidebar to tenant-scoped navigation. The Required Permissions page is logically a workspace-level page that happens to reference a tenant — it should keep showing workspace nav.Changes
Middleware (
EnsureFilamentTenantSelected.php)isWorkspaceScopedPageWithTenant()— new private helper that detects workspace-scoped pages containing a tenant parameter via regexsetTenant()bypass — skips tenant activation andrememberLastTenantId()for workspace-scoped pagesTests
RequiredPermissionsSidebarTest.php(NEW) — 7 tests covering:Pre-existing test fixes
RequiredPermissionsEmptyStateTest— fixed URL assertion (dynamicTenantResource::getUrl()instead of hardcoded/admin/onboarding)RequiredPermissionsLinksTest— fixed URL assertion + multiline HTMLdata-testidassertionRequiredPermissionsFiltersTest— fixedentra_permissionsconfig leak from branch 105Test Results
The 2 failures are pre-existing in
OpsUx/OperationCatalogCoverageTestandOpsUx/OperationSummaryKeysSpecTest— unrelated to this feature.Spec Artifacts
specs/106-required-permissions-sidebar-context/plan.mdspecs/106-required-permissions-sidebar-context/tasks.mdspecs/106-required-permissions-sidebar-context/research.mdspecs/106-required-permissions-sidebar-context/data-model.mdspecs/106-required-permissions-sidebar-context/quickstart.md