From 54b6b934028efbaad27a97af04b097fcf2cf42b0 Mon Sep 17 00:00:00 2001 From: kean Date: Sat, 4 May 2024 11:36:59 -0400 Subject: [PATCH] Update footer --- RELEASE-NOTES.txt | 1 + .../Revisions/RevisionsTableViewController.swift | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 8da42bb3cd69..d138674d290c 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -5,6 +5,7 @@ * [*] Make it easier to "Share" and "Blaze" a published post with an updated success view [##23128] * [*] Add support for viewing trashed posts and pages and restoring them from the editor [#23142] * [*] Update the "More" menu in the Editor to use modern iOS design and update copy to match Gutenberg [#23145] +* [*] Update the "Revisions" list design and fix an issue with the footer displaying incorrect "Date Created" for drafts [#23145] 24.8 ----- diff --git a/WordPress/Classes/ViewRelated/Post/Revisions/RevisionsTableViewController.swift b/WordPress/Classes/ViewRelated/Post/Revisions/RevisionsTableViewController.swift index 4b087cfc5a8f..c5e40da78f4c 100644 --- a/WordPress/Classes/ViewRelated/Post/Revisions/RevisionsTableViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Revisions/RevisionsTableViewController.swift @@ -1,3 +1,5 @@ +import UIKit + class RevisionsTableViewController: UITableViewController { typealias RevisionLoadedBlock = (AbstractPost) -> Void @@ -76,7 +78,9 @@ private extension RevisionsTableViewController { refreshControl.addTarget(self, action: #selector(refreshRevisions), for: .valueChanged) self.refreshControl = refreshControl - tableView.tableFooterView = tableViewFooter + if post?.original().isStatus(in: [.draft, .pending]) == false { + tableView.tableFooterView = tableViewFooter + } tableView.separatorColor = .divider WPStyleGuide.configureColors(view: view, tableView: tableView) @@ -230,7 +234,11 @@ extension RevisionsTableViewController: WPTableViewHandlerDelegate { } override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - tableViewHandler.resultsController?.sections?[section].name + guard let sections = tableViewHandler.resultsController?.sections, + sections.indices.contains(section) else { + return nil + } + return sections[section].name } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { @@ -303,7 +311,7 @@ private extension Date { private static let shortDateFormatter: DateFormatter = { let formatter = DateFormatter() - formatter.dateStyle = .short + formatter.dateStyle = .medium formatter.timeStyle = .none return formatter }()