Update site sharing menu visibility #14979
Merged
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 #14944
This PR updates "My Site" -> "Sharing" menu visibility for Jetpack sites as well as for other conditions taken from the iOS app in the FluxC PR: wordpress-mobile/WordPress-FluxC-Android#2047
To test
It should be sufficient to see if FluxC PR includes important tests for the "Sharing" menu support.
I've also tested important conditions manually using the below steps (you may randomly pick a scenario and see it works as expected):
PS: Tested using WordPress app build variant for non Jetpack sites
Jetpack Site
Login with a wpcom account having a site with a jetpack complete plan e.g. pressable-jetpack-complete on Calypso as well in the app.
Go to Jetpack -> Settings -> Sharing on Calypso
Based on the enabled state of "Publicize connections" and "Sharing buttons" on Calypso, check that sharing menu is shown/hidden appropriately on the "My Site" tab in the app.
WpCom site (with publish_posts capabilities)
WpCom Site (no publish_posts, manage_options capabilities)
Self-hosted non Jetpack site
Self-hosted Jetpack site
Login using a Jurassic ninja self-hosted in the app.
Install Jetpack and connect to wpcom account.
Notice that My Site -> Sharing menu is hidden for the site.
Enable "Sharing buttons" Jetpack module for the site on Tools -> Sharing Buttons in Calypso.
Refresh sites using site picker in the app, re-select the site.
Notice that the My Site -> Sharing menu is now shown for the site.
Merge Instructions
Regression Notes
Potential unintended areas of impact
Sharing menu visibility for
wpcom
sites.What I did to test those areas of impact (or what existing automated tests I relied on)
Tested "Sharing" menu visibility for different types of sites/ Jetpack active modules/ user roles manually.
What automated tests I added (or what prevented me from doing so)
Added tests in the FluxC PR.
PR submission checklist:
RELEASE-NOTES.txt
if necessary.