-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search all posts and group results into sections #10837
Merged
planarvoid
merged 18 commits into
wordpress-mobile:develop
from
chipsnyder:issue/9183-fetch-then-group-posts-ui
Nov 25, 2019
Merged
Search all posts and group results into sections #10837
planarvoid
merged 18 commits into
wordpress-mobile:develop
from
chipsnyder:issue/9183-fetch-then-group-posts-ui
Nov 25, 2019
Conversation
This file contains 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
- Modified PostListType to have the SEARCH type inclide all post statuses - Modified PostListViewModel to to limit the number of posts per fetch because I was getting frequent 500 errors from the API when requesting 60 items per request
When searching after a page is fetched from the API the results are now grouped into sections. Also reverted the change to ask for smaller page sizes as it appears that including "meta" in the "fields" parameter is the item that periodically causes a 500 from the server.
…e new searching scope
Moved Published to come before drafts to mirror the ordering of the tabs in the post list.
Reverted the other english translations. These will be translated automatically later.
…istent and getting the translations we want
…t is already available postListType which is already provided gives the needed information on if this is a search or not
Generated by 🚫 dangerJS |
Closing PR to resolve missing data |
@planarvoid Here's the PR opened to the main Repo |
planarvoid
approved these changes
Nov 25, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good 👍 Thanks for the changes and for the new updated PR
3 tasks
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 #9183
Description
This is to handle an enhancement to the current search in the Posts section of the App. Today the app only searches the published posts, where the goal will be to add the other types of posts to the results and mirror the look and feel of the Pages section of the app.
To do this in
PostListItemDataSource
the app will fetch the next list of data from GET /sites/$site/posts/ (sorted by date) and them group the posts into the sections. It then inserts the headers (if the section has results) and returns back a list with the grouped elements.Notes:
To test:
Searching Prompt
Given the user is on the Blog Posts Search screen
Then they should see "Search posts" instead of "Search published posts"
Searching with results
Given the user is on the Blog Posts Search screen
When they perform a search with results in multiple statuses
Then they should see the results separated into each status group sorted by date
Searching with results and scroll
Given the user is on the Blog Posts Search screen
When they perform a search with results in multiple statuses
And they trigger a new paged to be fetched
Then they should see the sections update with the new pages added.
Searching with no results (Unchanged behavior)
Given the user is on the Blog Posts Search screen
When they perform a search with no results
Then they should see a prompt "No posts matching your search"
PR submission checklist:
I have considered adding unit tests where possible.
I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txt
if necessary.