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

Posts & Pages: Minor fixes and improvements #21958

Merged
merged 9 commits into from
Nov 3, 2023
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -108,7 +108,6 @@ extension PageListViewController: InteractivePostViewDelegate {

private enum Strings {

static let offlineMessage = NSLocalizedString("pagesList.trash.offline", value: "Unable to trash pages while offline. Please try again later.", comment: "Message that appears when a user tries to trash a page while their device is offline.")
static let cancelText = NSLocalizedString("pagesList.trash.cancel", value: "Cancel", comment: "Cancels an Action")

enum DeletePermanently {
25 changes: 0 additions & 25 deletions WordPress/Classes/ViewRelated/Pages/PageListViewController.swift
Original file line number Diff line number Diff line change
@@ -473,31 +473,6 @@ class PageListViewController: AbstractPostListViewController, UIViewControllerRe
ActionDispatcher.global.dispatch(NoticeAction.post(notice))
}

private func handleTrashPage(_ post: AbstractPost) {
let cancelText = NSLocalizedString("Cancel", comment: "Cancels an Action")
let deleteText: String
let messageText: String
let titleText: String

if post.status == .trash {
deleteText = NSLocalizedString("Delete Permanently", comment: "Delete option in the confirmation alert when deleting a page from the trash.")
titleText = NSLocalizedString("Delete Permanently?", comment: "Title of the confirmation alert when deleting a page from the trash.")
messageText = NSLocalizedString("Are you sure you want to permanently delete this page?", comment: "Message of the confirmation alert when deleting a page from the trash.")
} else {
deleteText = NSLocalizedString("Move to Trash", comment: "Trash option in the trash page confirmation alert.")
titleText = NSLocalizedString("Trash this page?", comment: "Title of the trash page confirmation alert.")
messageText = NSLocalizedString("Are you sure you want to trash this page?", comment: "Message of the trash page confirmation alert.")
}

let alertController = UIAlertController(title: titleText, message: messageText, preferredStyle: .alert)

alertController.addCancelActionWithTitle(cancelText)
alertController.addDestructiveActionWithTitle(deleteText) { [weak self] action in
self?.deletePost(post)
}
alertController.presentFromRootViewController()
}

// MARK: - NetworkAwareUI

override func noConnectionMessage() -> String {
Original file line number Diff line number Diff line change
@@ -193,7 +193,6 @@ final class PageMenuViewModelTests: CoreDataTestCase {
.filter { !$0.buttons.isEmpty }
.map { $0.buttons }
let expectedButtons: [[AbstractPostButton]] = [
[.view],
[.moveToDraft],
[.trash]
]