Repository navigation
fix(admin): use a setting or permission item's own link - #5260
Open
GBra-4-669 wants to merge 1 commit into
Open
GBra-4-669 wants to merge 1 commit into
GBra-4-669 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5254
Changes proposed in this pull request:
Admin search ignores the
linkthat an item can declare. Every setting and permission result goes to the group link, or to the page/extension route when there is no group, even if the item sets its ownlink.Results now use the item's own
linkwhen it is set. The order is:link(an empty string counts as not set)This applies to:
generalIndexItems('settings', ...))registerSettingregisterPermissionlinkis now typed and documented onSettingsComponentOptionsandPermissionConfig. I also removed an outdated sentence about an "extra object" from thebuildSettingComponentJSDoc.Behaviour change:
linkon aregisterSettingentry is no longer forwarded to the form field. It used to be passed through like any other attribute, so a third-party custom field component that usedlinkas a prop would lose it. No setting in core or the bundled extensions setslink, so core should not be affected.Not included: indexed permissions (
generalIndexItems('permissions', ...)). That branch already throws inlookup()before any link is read. It is out of scope here and I can follow in a separate PR if you want.Reviewers should focus on:
linkis used as-is and not validated. It's expected to be an admin route path such as the output ofapp.route().registerSettingshould acceptlink. The issue's Possible Solution suggests it, but I'm not sure it's the intended API.linkto custom field componentsScreenshot
N/A
Necessity
Confirmed
yarn testinjs/).composer test).