Skip to content

Commit

Permalink
Merge pull request #19823 from wordpress-mobile/disable-jp-features-s…
Browse files Browse the repository at this point in the history
…tory-posts

Disable Story posts when Jetpack features are removed
  • Loading branch information
fluiddot committed Jan 4, 2023
2 parents 6596d86 + b156b82 commit cb040ad
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
21.5
-----
* [***] [internal] A significant refactor to the app’s architecture was made to allow for the new simplified UI. Regression testing on the app’s main flows is needed. [#19817]

* [**] [internal] Disable Story posts when Jetpack features are removed [#19823]

21.4
-----
Expand Down
1 change: 1 addition & 0 deletions WordPress/Classes/Models/Blog.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
@class UserSuggestion;
@class SiteSuggestion;
@class PageTemplateCategory;
@class JetpackFeaturesRemovalCoordinator;

extern NSString * const BlogEntityName;
extern NSString * const PostFormatStandard;
Expand Down
3 changes: 2 additions & 1 deletion WordPress/Classes/Models/Blog.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 jetpackFeaturesEnabled];
}

- (BOOL)supportsContactInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extension MySiteViewController {

var actions: [ActionSheetItem] = []

if shouldShowNewStory {
if blog?.supports(.stories) ?? false {
actions.append(StoryAction(handler: newStory, source: source))
}

Expand All @@ -38,8 +38,4 @@ extension MySiteViewController {
let coordinator = CreateButtonCoordinator(self, actions: actions, source: source, blog: blog)
return coordinator
}

private var shouldShowNewStory: Bool {
return (blog?.supports(.stories) ?? false) && !UIDevice.isPad()
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

/// A class containing convenience methods for the the Jetpack features removal experience
class JetpackFeaturesRemovalCoordinator {
class JetpackFeaturesRemovalCoordinator: NSObject {

/// Enum descibing the current phase of the Jetpack features removal
enum GeneralPhase: String {
Expand Down Expand Up @@ -108,6 +108,7 @@ class JetpackFeaturesRemovalCoordinator {
}

/// Used to determine if the Jetpack features are enabled based on the removal phase.
@objc
static func jetpackFeaturesEnabled() -> Bool {
switch generalPhase() {
case .four, .newUsers:
Expand Down

0 comments on commit cb040ad

Please sign in to comment.