Skip to content

v1.3.0

Choose a tag to compare

@github-actions github-actions released this 14 Nov 18:57
· 49 commits to main since this release

A security fix, new features behind config switches, and a new default look for the menu. Update now if you use policies on your records. No breaking changes: every new key has a default in the code, so a published config from 1.2 keeps working.

Security

  • Relation pages did not apply the record's view policy (1.0.0 to 1.2.1, GHSA-v3mh-w7qp-37gc). Filament checks it when the view page mounts, not in canAccess(), and relation pages only called canAccess(): a user denied view on a record, but allowed viewAny, could open its relation pages and see the related records and the header. Relation pages now run the same record check as the page they stand for (view for a view page, update for an edit page), also on every Livewire request.

Added

  • Links to relation manager tabs open the relation page (config redirect_relation_tabs, default false): /customers/1?relation=bills on the view or edit page redirects to /customers/1/bills, with wire:navigate in SPA mode. Tabs without a relation page, or that the record cannot see, stay where they are. Per page: shouldRedirectRelationNavigatorTabs() and getRelationNavigatorTabRedirectUrl().

  • Deferred badges: menu.badges also takes 'lazy'. The page then renders without the badge queries, and the menu loads the badges when it opens (one request, a spinner meanwhile). New page methods hasDeferredRelationNavigatorBadges() and getRelationNavigatorBadges(), and $hasDeferredBadges for preset views. If you published the package views, update menu/partials/list.blade.php before turning it on, or the menu shows no badges.

  • Previous and next record buttons before the header actions of the pages with the menu (config record_navigation, default false). They open the neighbour by key on the same page (view, edit, a relation page), or on its first page in the menu when it cannot open that one, and are disabled at the ends. They use the resource's own query, so tenancy and your scopes apply. Per page: hasRelationNavigatorRecordNavigation(), getRelationNavigatorRecordNavigationQuery(), getRelationNavigatorRecordNeighbours(). Nested resources are not supported yet: they show no buttons.

  • "Open as page" link above the table of every relation manager that has its own page, on the view and edit pages (config relation_manager_link, default true). It links to the relation group's page for a manager inside a group, and tells apart two entries of the same manager (PostsRelationManager::make([...])) by their properties. RelationNavigator::getRelationManagerPageUrl() returns the same URL for your own buttons.

  • RelationPage::canAccessRecord() and RelationNavigator::canAccessRecordPage(): the record check of the view and edit pages.

Fixed

  • The menu lists the view and edit pages only when the user can open them for the record (view and update policies): a user who cannot edit a record no longer sees an Edit item that ends in a 403.

Changed

  • The default menu is now the github preset with the search field (menu.preset = github, menu.searchable = true): it is the one with the most features. Apps that published the config keep what they set. To keep the menu of 1.2 and earlier, set 'preset' => 'simple' and 'searchable' => false in config/filament-relation-navigator.php, or override getRelationNavigatorPreset() and isRelationNavigatorSearchable() on the page.

Internal

  • Tests for each feature, tenancy, nested resources and record policies included, and a browser test for the deferred badges. README with a GIF and new screenshots.