Skip to content

Commit

Permalink
Remove switch to classic from gutenberg
Browse files Browse the repository at this point in the history
Addresses: wordpress-mobile/gutenberg-mobile#3048 (for iOS)

In discussion with @kyleaparker, we decided that it's best to fast-track the removal of the "switch to classic" option in the block editor. This PR will be scheduled for release in v17.1 alongside a matching change for Android.
  • Loading branch information
guarani committed Mar 18, 2021
1 parent 99a8866 commit aebfa17
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
5 changes: 0 additions & 5 deletions WordPress/Classes/Utility/Editor/EditorFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ class EditorFactory {
return gutenbergVC
}

func switchToAztec(from source: EditorViewController) {
let replacement = AztecPostViewController(post: source.post, replaceEditor: source.replaceEditor, editorSession: source.editorSession)
source.replaceEditor(source, replacement)
}

func switchToGutenberg(from source: EditorViewController) {
let replacement = GutenbergViewController(post: source.post, replaceEditor: source.replaceEditor, editorSession: source.editorSession)
source.replaceEditor(source, replacement)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ extension GutenbergViewController {
}
}

alert.addDefaultActionWithTitle(MoreSheetAlert.classicTitle) { [unowned self] _ in
self.savePostEditsAndSwitchToAztec()
}

let toggleModeTitle: String = {
if mode == .richText {
return MoreSheetAlert.htmlTitle
Expand Down Expand Up @@ -105,10 +101,6 @@ extension GutenbergViewController {

extension GutenbergViewController {
struct MoreSheetAlert {
static let classicTitle = NSLocalizedString(
"Switch to classic editor",
comment: "Switches from Gutenberg mobile to the classic editor"
)
static let htmlTitle = NSLocalizedString("Switch to HTML Mode", comment: "Switches the Editor to HTML Mode")
static let richTitle = NSLocalizedString("Switch to Visual Mode", comment: "Switches the Editor to Rich Text Mode")
static let previewTitle = NSLocalizedString("Preview", comment: "Displays the Post Preview Interface")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class GutenbergViewController: UIViewController, PostEditor {
case publish
case close
case more
case switchToAztec
case switchBlog
case autoSave
}
Expand Down Expand Up @@ -501,12 +500,6 @@ class GutenbergViewController: UIViewController, PostEditor {
@objc func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
return presentationController(forPresented: presented, presenting: presenting)
}

// MARK: - Switch to Aztec

func savePostEditsAndSwitchToAztec() {
requestHTML(for: .switchToAztec)
}
}

// MARK: - Views setup
Expand Down Expand Up @@ -809,9 +802,6 @@ extension GutenbergViewController: GutenbergBridgeDelegate {
cancelEditing()
case .more:
displayMoreSheet()
case .switchToAztec:
editorSession.switch(editor: .classic)
EditorFactory().switchToAztec(from: self)
case .switchBlog:
blogPickerWasPressed()
case .autoSave:
Expand Down

0 comments on commit aebfa17

Please sign in to comment.