Repository navigation
Feature Suggestion: Add filter hints to filter tooltip popover - #3069
Open
redbassett wants to merge 1 commit into
Open
redbassett wants to merge 1 commit into
redbassett wants to merge 1 commit into
Conversation
- Adds view logic to retrieve filter hints, if defined - Adds styling to seperate hint text from filter example - Adds example filter hint to example app - Adds defining filter hints to documentation - Adds test coverage
This branch has not been deployed
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.
Using administrate on a client project recently, I was asked if it was possible to add clarifying text to describe what filters within the search for a dashboard did. I have brought the solution I implemented within that project to the core administrate codebase in this PR as a feature suggestion if this is useful for other users of administrate.
Developers using administrate can add a
filter_hintstring translation, similar to thefield_hinttranslation used for form hints, and the value of the translation will be displayed in the filter tooltip popover shown when filters are present in a dashboard:By default the styling of the popover handles this additional text without any major issues, however long strings can stretch this popover significantly. I have included bare minimum styling to pad the hint text away from the filter key/value text for readability but I haven't addressed long hint strings with this styling as I didn't want to change the existing popover styles too much. Such styling can be added if this is considered to be a likely issue.
This PR includes the view logic to find filter hints, adds a filter hint to the example app to demonstrate the functionality, adds documentation within the relevant section on filters, and adds test coverage modeled on
field_hinttests.