-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Disable Story posts when Jetpack features are removed #19823
Conversation
static func shouldBeShown(blog: Blog?) -> Bool { | ||
return (blog?.supports(.stories) ?? false) && !UIDevice.isPad() && !JetpackFeaturesRemovalCoordinator.shouldRemoveJetpackFeatures() | ||
} |
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.
I noticed that we weren't using the same conditions for determining if the Story Post action should be shown in different places. For this reason, I decided to unify the logic into a single function. Specifically, checking if the device is an iPad. Based on this PR and this Kanvas issue, I understand that the Story post shouldn't be enabled on iPad.
You can test the changes in Jetpack from this Pull Request by:
|
You can test the changes in WordPress from this Pull Request by:
|
ac08a81
to
6197b2b
Compare
WordPress/Classes/Models/Blog.m
Outdated
@@ -691,7 +691,8 @@ - (BOOL)supportsPluginManagement | |||
- (BOOL)supportsStories | |||
{ | |||
BOOL hasRequiredJetpack = [self hasRequiredJetpackVersion:@"9.1"]; | |||
return hasRequiredJetpack || self.isHostedAtWPcom; | |||
// Stories are disabled in iPad until this Kanvas issue is solved: https://github.com/tumblr/kanvas-ios/issues/104 | |||
return (hasRequiredJetpack || self.isHostedAtWPcom) && ![UIDevice isPad] && ![JetpackFeaturesRemovalCoordinator shouldRemoveJetpackFeatures]; |
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.
I noticed that we weren't using the same conditions for determining if the Story Post action should be shown in different places. For this reason, I decided to unify the logic into a single function. Specifically, checking if the device is an iPad. Based on this PR and this Kanvas issue, I understand that the Story post shouldn't be enabled on iPad.
@@ -691,7 +691,8 @@ - (BOOL)supportsPluginManagement | |||
- (BOOL)supportsStories |
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.
I originally considered checking the isPad
and feature removal conditions in a specific helper within the StoryAction
class. But I finally ended up using the supports
functionality of the Blog model as the logic seemed closer to me. In any case, please let me know if there's a better approach for this, thanks!
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.
Works as described! 🚀
...ess/Classes/ViewRelated/Jetpack/Branding/Coordinator/JetpackFeaturesRemovalCoordinator.swift
Show resolved
Hide resolved
# Conflicts: # WordPress/Classes/ViewRelated/Jetpack/Branding/Coordinator/JetpackFeaturesRemovalCoordinator.swift
Disables the option to create a Story post when the Jetpack-powered features are removed.
Ref: pe7hp4-4k-p2
To test:
1 - Story post ENABLED in WordPress app
Jetpack Features Removal Phase Four
andJetpack Features Removal Phase For New Users
flags off.2 - Story post DISABLED in WordPress app
Jetpack Features Removal Phase Four
flag on.NOTE: It's recommended that the following steps are also checked by turning the
Jetpack Features Removal Phase For New Users
flag on andJetpack Features Removal Phase Four
flag off in Debug settings.NOTE: If you were on the My Site screen when changing the flags, you might need to navigate to a different tab and back again to My Site to see the changes reflected.
3- Story post is ENABLED in Jetpack app
Jetpack Features Removal Phase Four
flag on. This flag should be omitted by the Jetpack app.Regression Notes
Potential unintended areas of impact
The changes should only impact the floating Create button located on My Site and Posts list screens.
What I did to test those areas of impact (or what existing automated tests I relied on)
N/A
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txt
if necessary.