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
Enable Search for Self-Hosted Sites #12565
Enable Search for Self-Hosted Sites #12565
Conversation
This tests were written on purpose before implementing the 'isAccessedViewXmlRpc(...)' method, TDD style, to prove that the next commit adds value. As such the last test will fail because it expects 'true' but the template utility method currently always returns 'false'.
The corresponding failing test now successfully passes.
By enabling search for self-hosted site, this test should pass with the current change. However, as it is now it doesn't since the main code is not yet implemented. Thus, updating first the test to fail and in the next commit the change will be implemented so that the test passes.
The corresponding failing test now successfully passes. This is the first (UI) part of the overall solution, which makes the search icon appear for self-hosted sites (previously hidden). This, along with the second (Backend) part of the overall solution (coming soon) will close the cycle.
This is done for readability purposes.
Also, this part is done to make the diffing easier on the next commit.
This is the second (Backend) part of the overall solution, which along with the first (UI) part, effectively enables search for self-hosted sites.
I am not sure about the two items in the
Also, another ✅ that I would have liked to check are adding UI tests where possible, much I am not sure what is the process for adding those. |
PS: Locally, both |
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.
Thanks for the changes @ParaskP7! The apps works as expected, great job!
I have a couple of questions/suggestions.
- The step 3 is mentioning "Site Pages". I'm wondering if we need to test site pages, since we modified just Post List's VMs. Wdyt?
- I agree that a SiteModel can theoretically have "UNKNOWN" origin - at least the "enum" supports it. However, afaik we don't support that type anywhere else in the app. The app needs to communicate with either WPComRest or XML-RPC. If it doesn't know the type it can't communicate with the site at all. That's the main reason why we never found a need to introduce "isAccessedViaXmlRpc" ->
!isAccessedViaWPComRest == isAccessedViaXmlRpc
(btw there is a typo in the code "View" vs "Via"). I'm wondering if we really want to introduce it now. Wdyt?
Many thanks for reviewing my PR @malinajirka and verifying its functionality! 🌟
|
No worries ;)!
Yep, sounds good to me ;). |
Great, thanks again and I am on it, please expect an update to this PR very soon! |
After a PR discussion it turns out that 'UNKNOWN' sites cannot exist and as such all sites, both WPCom and XML-RPC, can have search enabled by default.
This version contains the search filter for XML PRC requests functionality that the enable search for self-hosted sites solution depends on.
@malinajirka all your suggestions have been now added in this PR. Please let me know if everything looks as expected! |
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.
Thanks for the changes Petros! It all looks good to me. We can merge this PR when the conflicts are resolved and all the checks pass. GJ 🎉
Fixes #12058
Prerequisite WordPress-FluxC-Android #1646
Description
This feature enables search for self-hosted sites, something that was previously only available for WordPress.com/Jetpack sites. See issue above for more info.
In general the solution is split into two parts:
search icon
available for when the user navigates to a self-hosted site, just as it is available for non self-hosted sites.search query
to the XML RPC descriptor that is responsible to later make an API request for the self-hosted site. Note that with thedevelop
version of this repo thesearch query
argument is not available since a new version of Android FluxC is required (seeTo test
section below).So, the above work is closely related to the [Feature] Add Search Filter for XML RPC Requests #1646 PR, which needs to be merge first.
Blog Posts for Self-Hosted Site (Before)
Blog Posts for Self-Hosted Site (After)
Test:
WordPress
app with afluxcVersion
ofe32d20633e68ca1fba1726b75463aa7219ca88f0
(update that within the project's parentbuild.gradle
file)Blog Posts
Search Icon
is available on the top rightSearch Icon
and verify the search functionality works as expected and in general works as it used to work for non self-hosted siteWhile testing note that search in general, for both for self-hosted and non self-hosted sites has a configuration change related bug, see #12561. However, it is out of the scope of this task to fix this bug, but it will be considered as part of another task, later on in the future.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.