Instant search: add post type icon component#13790
Merged
bluefuton merged 1 commit intoinstant-search-masterfrom Oct 21, 2019
Merged
Instant search: add post type icon component#13790bluefuton merged 1 commit intoinstant-search-masterfrom
bluefuton merged 1 commit intoinstant-search-masterfrom
Conversation
97d6015 to
b73e2fb
Compare
jsnmoon
approved these changes
Oct 21, 2019
Contributor
jsnmoon
left a comment
There was a problem hiding this comment.
This is a nice refactor. 👍
jsnmoon
added a commit
that referenced
this pull request
Oct 23, 2019
* Implement minimal search results and spelling correction (#13365) * Add filtering display (#13371) * Fix search result display bugs and make improvements (#13393) * Add rudimentary support for filtering on post types (#13430) * Add support for filtering on categories and tags (#13505) * Add instant search sorting based on the URL (#13377) * Add support for filtering on dates (#13545) * Add custom taxonomy filtering (#13605) * add sort widget (#13614) * fix many theme incompatibilities (#13602) * Add infinite scrolling (#13684) * Add caching to the api requests (#13714) * Clean up some design bugs/issues (#13721) * Fix labels for post types when we have them. (#13750) * Add localization and formatting of all dates (#13748) * search from any page on the site (#13713) * Hook up default options (inc. sort) (#13742) * Add TrainTracks analytics (#13730) * Create PostTypeIcon component (#13790) * Upgrade to Preact 10 (#13794) * Add comments component (#13797) * Address review feedback
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.
Changes proposed in this Pull Request:
We currently show a post type icon alongside search results in the Jetpack Instant Search prototype.
This is currently part of the 'minimal search result' component. As we expand to offer different search results styles (like products - see #13774), we need to reuse this icon in different spots. This PR moves the rendering of a post type icon into a separate Preact component so it can be shared.
Is this a new feature or does it add/remove features to an existing part of Jetpack?
This is primarily a refactor of existing functionality. I've added one improvement - posts with multiple images now receive the same icon as posts containing a gallery.
Testing instructions:
Add
define( "JETPACK_SEARCH_PROTOTYPE", true );to your wp-config.php.If using Jetpack's Docker development environment, you can create a file at /docker/mu-plugins/instant-search.php and add the define there.
Ensure that your site has the Jetpack Pro plan and Jetpack Search enabled.
You can enable Jetpack Search in the Performance tab within the Jetpack menu (/wp-admin/admin.php?page=jetpack#/performance).
Perform a search and make sure the correct icon is applied for various results. For example:
/?s=card&blog_id=84860689should give you a gallery icon for this result:....and
/?s=socks&blog_id=84860689should give you a product icon:Proposed changelog entry for your changes:
instant-search-masterbranch.