Skip to content
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

Site Editor: Update site editor MVP to a remote feature flag and enable it #20713

Merged
merged 2 commits into from
May 19, 2023
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
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
22.5
-----
* [*] [Jetpack-only] Reader: Fixed an issue that was causing the Report and Block actions to be missing from Post Menu actions sheet. [#20705]

* [***] Enables editing of the site homepage for sites using block-based themes directly from the pages list. [#20713]

22.4
-----
Expand Down
5 changes: 0 additions & 5 deletions WordPress/Classes/Utility/BuildInformation/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ enum FeatureFlag: Int, CaseIterable {
case siteCreationDomainPurchasing
case readerUserBlocking
case personalizeHomeTab
case siteEditorMVP

/// Returns a boolean indicating if the feature is enabled
var enabled: Bool {
Expand Down Expand Up @@ -126,8 +125,6 @@ enum FeatureFlag: Int, CaseIterable {
return true
case .personalizeHomeTab:
return false
case .siteEditorMVP:
return BuildConfiguration.current != .appStore
}
}

Expand Down Expand Up @@ -224,8 +221,6 @@ extension FeatureFlag {
return "Reader User Blocking"
case .personalizeHomeTab:
return "Personalize Home Tab"
case .siteEditorMVP:
return "Site Editor MVP"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum RemoteFeatureFlag: Int, CaseIterable {
case activityLogDashboardCard
case sdkLessGoogleSignIn
case bloggingPromptsSocial
case siteEditorMVP

var defaultValue: Bool {
switch self {
Expand Down Expand Up @@ -56,6 +57,8 @@ enum RemoteFeatureFlag: Int, CaseIterable {
return false
case .bloggingPromptsSocial:
return AppConfiguration.isJetpack
case .siteEditorMVP:
return true
}
}

Expand Down Expand Up @@ -96,6 +99,8 @@ enum RemoteFeatureFlag: Int, CaseIterable {
return "google_signin_without_sdk"
case .bloggingPromptsSocial:
return "blogging_prompts_social_enabled"
case .siteEditorMVP:
return "site_editor_mvp"
}
}

Expand Down Expand Up @@ -135,6 +140,8 @@ enum RemoteFeatureFlag: Int, CaseIterable {
return "Sign-In with Google without the Google SDK"
case .bloggingPromptsSocial:
return "Blogging Prompts Social"
case .siteEditorMVP:
return "Site Editor MVP"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class PageListTableViewHandler: WPTableViewHandler {
}

var showEditorHomepage: Bool {
guard FeatureFlag.siteEditorMVP.enabled else {
guard RemoteFeatureFlag.siteEditorMVP.enabled() else {
return false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class PageListViewController: AbstractPostListViewController, UIViewControllerRe

private func fetchEditorSettings(success: ((Bool) -> ())?, failure: ((NSError) -> ())?) -> (success: (_ hasMore: Bool) -> (), failure: (NSError) -> ()) {
let fetchTask = Task { @MainActor [weak self] in
guard FeatureFlag.siteEditorMVP.enabled,
guard RemoteFeatureFlag.siteEditorMVP.enabled(),
let result = await editorSettingsService?.fetchSettings() else {
return
}
Expand Down Expand Up @@ -437,7 +437,7 @@ class PageListViewController: AbstractPostListViewController, UIViewControllerRe
predicates.append(searchPredicate)
}

if FeatureFlag.siteEditorMVP.enabled,
if RemoteFeatureFlag.siteEditorMVP.enabled(),
blog.blockEditorSettings?.isFSETheme ?? false,
let homepageID = blog.homepagePageID,
let homepageType = blog.homepageType,
Expand Down