Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Unreleased
-----

* [*] Added preview device mode selector in the page layout previews [#16141]
* [**] Block Editor: Added Contact Info block to sites on WPcom or with Jetpack version >= 8.5.

17.0
-----
Expand Down
2 changes: 2 additions & 0 deletions WordPress/Classes/Models/Blog.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ typedef NS_ENUM(NSUInteger, BlogFeature) {
BlogFeatureHomepageSettings,
/// Does the blog support stories?
BlogFeatureStories,
/// Does the blog support Jetpack contact info block?
BlogFeatureContactInfo,
};

typedef NS_ENUM(NSInteger, SiteVisibility) {
Expand Down
7 changes: 7 additions & 0 deletions WordPress/Classes/Models/Blog.m
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ - (BOOL)supports:(BlogFeature)feature
return [self supportsRestApi] && [self isAdmin];
case BlogFeatureStories:
return [self supportsStories];
case BlogFeatureContactInfo:
return [self supportsContactInfo];
}
}

Expand Down Expand Up @@ -639,6 +641,11 @@ - (BOOL)supportsStories
return hasRequiredJetpack || self.isHostedAtWPcom;
}

- (BOOL)supportsContactInfo
{
return [self hasRequiredJetpackVersion:@"8.5"] || self.isHostedAtWPcom;
}

- (BOOL)accountIsDefaultAccount
{
AccountService *accountService = [[AccountService alloc] initWithManagedObjectContext:self.managedObjectContext];
Expand Down
5 changes: 5 additions & 0 deletions WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag {
case newNavBarAppearance
case unifiedPrologueCarousel
case stories
case contactInfo
case siteCreationHomePagePicker
case jetpackScan
case activityLogFilters
Expand Down Expand Up @@ -45,6 +46,8 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag {
return false
case .stories:
return true
case .contactInfo:
return BuildConfiguration.current ~= [.localDeveloper, .a8cBranchTest]
case .siteCreationHomePagePicker:
return true
case .jetpackScan:
Expand Down Expand Up @@ -105,6 +108,8 @@ extension FeatureFlag {
return "Unified Prologue Carousel"
case .stories:
return "Stories"
case .contactInfo:
return "Contact Info"
case .siteCreationHomePagePicker:
return "Site Creation: Home Page Picker"
case .jetpackScan:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ extension GutenbergViewController: GutenbergBridgeDataSource {
return [
.mentions: FeatureFlag.gutenbergMentions.enabled && SuggestionService.shared.shouldShowSuggestions(for: post.blog),
.xposts: FeatureFlag.gutenbergXposts.enabled && SiteSuggestionService.shared.shouldShowSuggestions(for: post.blog),
.contactInfoBlock: post.blog.supports(.contactInfo) && FeatureFlag.contactInfo.enabled,
.unsupportedBlockEditor: isUnsupportedBlockEditorEnabled,
.canEnableUnsupportedBlockEditor: post.blog.jetpack?.isConnected ?? false,
.audioBlock: !isFreeWPCom, // Disable audio block until it's usable on free sites via "Insert from URL" capability
Expand Down