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

[Gutenberg] - Remove tooltip flag and modal layout feature flag #15550

Merged
merged 11 commits into from
Jan 13, 2021
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ target 'WordPress' do
## Gutenberg (React Native)
## =====================
##
gutenberg :tag => 'v1.44.0'
gutenberg :tag => 'v1.45.0-alpha1'

## Third party libraries
## =====================
Expand Down
166 changes: 83 additions & 83 deletions Podfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion WordPress/Classes/Services/PageCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class PageCoordinator {
typealias TemplateSelectionCompletion = (_ layout: PageTemplateLayout?) -> Void

static func showLayoutPickerIfNeeded(from controller: UIViewController, forBlog blog: Blog, completion: @escaping TemplateSelectionCompletion) {
if FeatureFlag.gutenbergModalLayoutPicker.enabled && blog.isGutenbergEnabled {
geriux marked this conversation as resolved.
Show resolved Hide resolved
if blog.isGutenbergEnabled {
showLayoutPicker(from: controller, forBlog: blog, completion)
} else {
completion(nil)
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 @@ -10,7 +10,6 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag {
case homepageSettings
case gutenbergMentions
case gutenbergXposts
case gutenbergModalLayoutPicker
case whatIsNew
case newNavBarAppearance
case unifiedPrologueCarousel
Expand Down Expand Up @@ -44,8 +43,6 @@ enum FeatureFlag: Int, CaseIterable, OverrideableFlag {
return true
case .gutenbergXposts:
return true
case .gutenbergModalLayoutPicker:
return true
case .whatIsNew:
return true
case .newNavBarAppearance:
Expand Down Expand Up @@ -108,8 +105,6 @@ extension FeatureFlag {
return "Mentions in Gutenberg"
case .gutenbergXposts:
return "Xposts in Gutenberg"
case .gutenbergModalLayoutPicker:
return "Gutenberg Modal Layout Picker"
case .whatIsNew:
return "What's New / Feature Announcement"
case .newNavBarAppearance:
Expand Down
11 changes: 0 additions & 11 deletions WordPress/Classes/Utility/Editor/GutenbergSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class GutenbergSettings {
let url = urlStringFrom(blog)
return "kShowGutenbergPhase2Dialog-" + url
}
static let starterPageTemplatesTooltipShown = "kGutenbergStarterPageTampletesTooltipShown"

private static func urlStringFrom(_ blog: Blog) -> String {
return (blog.url ?? "")
Expand Down Expand Up @@ -158,16 +157,6 @@ class GutenbergSettings {
database.set(true, forKey: Key.enabledOnce(for: blog))
}

/// True if it should show the tooltip for the starter page templates picker
var starterPageTemplatesTooltipShown: Bool {
get {
database.bool(forKey: Key.starterPageTemplatesTooltipShown)
}
set {
database.set(newValue, forKey: Key.starterPageTemplatesTooltipShown)
}
}

// MARK: - Gutenberg Choice Logic

/// Call this method to know if Gutenberg must be used for the specified post.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,6 @@ class GutenbergViewController: UIViewController, PostEditor {
}

private func presentNewPageNoticeIfNeeded() {
guard FeatureFlag.gutenbergModalLayoutPicker.enabled else { return }

// Validate if the post is a newly created page or not.
guard post is Page,
post.isDraft(),
Expand Down Expand Up @@ -862,14 +860,6 @@ extension GutenbergViewController: GutenbergBridgeDelegate {
})
}

func gutenbergDidRequestStarterPageTemplatesTooltipShown() -> Bool {
return gutenbergSettings.starterPageTemplatesTooltipShown
}

func gutenbergDidRequestSetStarterPageTemplatesTooltipShown(_ tooltipShown: Bool) {
gutenbergSettings.starterPageTemplatesTooltipShown = tooltipShown
}

func gutenbergDidSendButtonPressedAction(_ buttonType: Gutenberg.ActionButtonType) {
switch buttonType {
case .missingBlockAlertActionButton:
Expand Down Expand Up @@ -990,7 +980,6 @@ extension GutenbergViewController: GutenbergBridgeDataSource {
.xposts: FeatureFlag.gutenbergXposts.enabled && SiteSuggestionService.shared.shouldShowSuggestions(for: post.blog),
.unsupportedBlockEditor: isUnsupportedBlockEditorEnabled,
.canEnableUnsupportedBlockEditor: post.blog.jetpack?.isConnected ?? false,
.modalLayoutPicker: FeatureFlag.gutenbergModalLayoutPicker.enabled,
]
}

Expand Down