From a53103bbad83a65a2cc186dbd410380f2fc3b536 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Mon, 29 May 2023 23:24:40 +0700 Subject: [PATCH 01/22] Add new table header view for comment --- .../Comments/CommentTableHeaderView.swift | 156 ++++++++++++++++++ WordPress/WordPress.xcodeproj/project.pbxproj | 6 + 2 files changed, 162 insertions(+) create mode 100644 WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift diff --git a/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift b/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift new file mode 100644 index 000000000000..64f05b3cbc7d --- /dev/null +++ b/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift @@ -0,0 +1,156 @@ +import SwiftUI + +class CommentTableHeaderView: UITableViewHeaderFooterView, Reusable { + + enum Subtitle { + /// Subtext for a top-level comment on a post. + case post + + /// Subtext for a reply to a comment. + /// Requires a String describing the replied author's name. + case reply(String) + + /// Subtext for the comment threads. + case commentThread + + fileprivate var stringValue: String { + switch self { + case .post: + return Constants.postCommentSubText + case .reply(let authorName): + return String(format: Constants.replyCommentSubTextFormat, authorName) + case .commentThread: + return Constants.commentThreadSubText + } + } + } + + private let hostingController: UIHostingController + + init(title: String, + subtitle: Subtitle, + showsDisclosureIndicator: Bool = false, + reuseIdentifier: String? = CommentTableHeaderView.defaultReuseID) { + let headerView = CommentHeaderView(title: title, + subtitle: subtitle, + showsDisclosureIndicator: showsDisclosureIndicator) + hostingController = .init(rootView: headerView) + super.init(reuseIdentifier: reuseIdentifier) + configureView() + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +// MARK: - Private methods + +private extension CommentTableHeaderView { + + func configureView() { + hostingController.view.translatesAutoresizingMaskIntoConstraints = false + hostingController.view.backgroundColor = .clear + contentView.addSubview(hostingController.view) + contentView.pinSubviewToAllEdges(hostingController.view) + } + + enum Constants { + static let postCommentSubText = NSLocalizedString( + "comment.header.subText.post", + value: "Comment on", + comment: """ + Provides a hint that the current screen displays a comment on a post. + The title of the post will be displayed below this text. + Example: Comment on \n My First Post + """ + ) + + static let replyCommentSubTextFormat = NSLocalizedString( + "comment.header.subText.reply", + value: "Reply to %1$@", + comment: """ + Provides a hint that the current screen displays a reply to a comment. + %1$@ is a placeholder for the comment author's name that's been replied to. + Example: Reply to Pamela Nguyen + """ + ) + + static let commentThreadSubText = NSLocalizedString( + "comment.header.subText.commentThread", + value: "Comments on", + comment: """ + Sentence fragment. + The full phrase is 'Comments on' followed by the title of the post on a separate line. + """ + ) + } +} + +// MARK: - SwiftUI + +private struct CommentHeaderView: View { + + @State var title = String() + @State var subtitle: CommentTableHeaderView.Subtitle = .post + @State var showsDisclosureIndicator = true + + var body: some View { + if #available(iOS 15.0, *) { + // Material ShapeStyles are only available from iOS 15.0. + content.background(.thinMaterial) + } else { + ZStack { + VisualEffectView(effect: UIBlurEffect(style: .systemThinMaterial)) + content + } + } + } + + var content: some View { + HStack { + text + Spacer() + if showsDisclosureIndicator { + disclosureIndicator + } + } + .padding(EdgeInsets(top: 10, leading: 16, bottom: 10, trailing: 16)) + } + + var text: some View { + VStack(alignment: .leading) { + Text(subtitle.stringValue) + .lineLimit(1) + .font(.footnote) + .foregroundColor(Color(.secondaryLabel)) + Text(title) + .lineLimit(1) + .font(.subheadline) + .foregroundColor(Color(.text)) + } + } + + var disclosureIndicator: some View { + Image(systemName: "chevron.forward") + .renderingMode(.template) + .foregroundColor(Color(.secondaryLabel)) + .font(.caption.weight(.semibold)) + .imageScale(.large) + .padding(.zero) + } +} + +// MARK: SwiftUI VisualEffect support for iOS 14 + +private struct VisualEffectView: UIViewRepresentable { + var effect: UIVisualEffect + + func makeUIView(context: Context) -> UIVisualEffectView { + return UIVisualEffectView() + } + + func updateUIView(_ uiView: UIVisualEffectView, context: Context) { + uiView.effect = effect + } +} diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index de44e1892281..bc6079a911f4 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -5513,6 +5513,8 @@ FE4DC5AA293A84F8008F322F /* WordPressExportRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE4DC5A6293A79F1008F322F /* WordPressExportRoute.swift */; }; FE5096592A17A69F00DDD071 /* TwitterDeprecationTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE5096582A17A69F00DDD071 /* TwitterDeprecationTableFooterView.swift */; }; FE50965A2A17A69F00DDD071 /* TwitterDeprecationTableFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE5096582A17A69F00DDD071 /* TwitterDeprecationTableFooterView.swift */; }; + FE50965C2A20D0F300DDD071 /* CommentTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE50965B2A20D0F300DDD071 /* CommentTableHeaderView.swift */; }; + FE50965D2A20D0F300DDD071 /* CommentTableHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE50965B2A20D0F300DDD071 /* CommentTableHeaderView.swift */; }; FE6BB143293227AC001E5F7A /* ContentMigrationCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE6BB142293227AC001E5F7A /* ContentMigrationCoordinator.swift */; }; FE6BB144293227AC001E5F7A /* ContentMigrationCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE6BB142293227AC001E5F7A /* ContentMigrationCoordinator.swift */; }; FE6BB1462932289B001E5F7A /* ContentMigrationCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE6BB1452932289B001E5F7A /* ContentMigrationCoordinatorTests.swift */; }; @@ -9286,6 +9288,7 @@ FE4DC5A6293A79F1008F322F /* WordPressExportRoute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordPressExportRoute.swift; sourceTree = ""; }; FE5096572A13D5BA00DDD071 /* WordPress 149.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 149.xcdatamodel"; sourceTree = ""; }; FE5096582A17A69F00DDD071 /* TwitterDeprecationTableFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TwitterDeprecationTableFooterView.swift; sourceTree = ""; }; + FE50965B2A20D0F300DDD071 /* CommentTableHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentTableHeaderView.swift; sourceTree = ""; }; FE59DA9527D1FD0700624D26 /* WordPress 138.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 138.xcdatamodel"; sourceTree = ""; }; FE6BB142293227AC001E5F7A /* ContentMigrationCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentMigrationCoordinator.swift; sourceTree = ""; }; FE6BB1452932289B001E5F7A /* ContentMigrationCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentMigrationCoordinatorTests.swift; sourceTree = ""; }; @@ -18027,6 +18030,7 @@ FEA7948C26DD136700CEC520 /* CommentHeaderTableViewCell.swift */, 9839CEB926FAA0510097406E /* CommentModerationBar.swift */, 98F9FB2D270282C100ADF552 /* CommentModerationBar.xib */, + FE50965B2A20D0F300DDD071 /* CommentTableHeaderView.swift */, ); name = Detail; sourceTree = ""; @@ -21914,6 +21918,7 @@ 46C984682527863E00988BB9 /* LayoutPickerAnalyticsEvent.swift in Sources */, 7E442FCD20F6AB9C00DEACA5 /* ActivityRange.swift in Sources */, 9AF9551821A1D7970057827C /* DiffAbstractValue+Attributes.swift in Sources */, + FE50965C2A20D0F300DDD071 /* CommentTableHeaderView.swift in Sources */, 8BD66ED42787530C00CCD95A /* PostsCardViewModel.swift in Sources */, 80EF928D280E83110064A971 /* QuickStartToursCollection.swift in Sources */, 7E58879A20FE8D9300DB6F80 /* Environment.swift in Sources */, @@ -25169,6 +25174,7 @@ FABB25282602FC2C00C8785C /* PostStatsTitleCell.swift in Sources */, FABB25292602FC2C00C8785C /* CommentService.m in Sources */, 0880BADD29ED6FF3002D3AB0 /* UIColor+DesignSystem.swift in Sources */, + FE50965D2A20D0F300DDD071 /* CommentTableHeaderView.swift in Sources */, FABB252A2602FC2C00C8785C /* MediaLibraryStrings.swift in Sources */, FABB252B2602FC2C00C8785C /* StoreFetchingStatus.swift in Sources */, FABB252C2602FC2C00C8785C /* SiteDateFormatters.swift in Sources */, From a21f88cc1ccd287fcf5a3944fcc18731d04735e2 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Mon, 29 May 2023 23:25:16 +0700 Subject: [PATCH 02/22] Show the new comment header in Reader comments --- .../Reader/Comments/ReaderCommentsViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift b/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift index 362f46688bb5..68a2dd5b7d39 100644 --- a/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift @@ -33,6 +33,14 @@ extension NSNotification.Name { return .init() } + if FeatureFlag.commentModerationUpdate.enabled { + let headerView = CommentTableHeaderView(title: post.titleForDisplay(), + subtitle: .commentThread, + showsDisclosureIndicator: true) + headerView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleHeaderTapped))) + return headerView + } + let cell = CommentHeaderTableViewCell() cell.backgroundColor = .systemBackground cell.configure(for: .thread, subtitle: post.titleForDisplay(), showsDisclosureIndicator: allowsPushingPostDetails) From e72de7d195d4605ee738a8a2e661f8253ca11551 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Thu, 15 Jun 2023 16:08:38 +0700 Subject: [PATCH 03/22] Update to ultraThinMaterial --- .../Classes/ViewRelated/Comments/CommentTableHeaderView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift b/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift index 64f05b3cbc7d..9e03a381ae47 100644 --- a/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift +++ b/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift @@ -98,10 +98,10 @@ private struct CommentHeaderView: View { var body: some View { if #available(iOS 15.0, *) { // Material ShapeStyles are only available from iOS 15.0. - content.background(.thinMaterial) + content.background(.ultraThinMaterial) } else { ZStack { - VisualEffectView(effect: UIBlurEffect(style: .systemThinMaterial)) + VisualEffectView(effect: UIBlurEffect(style: .systemUltraThinMaterial)) content } } From 3f2baa8b7c8e0a5881758a3616015fbf29793697 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 16 Jun 2023 10:34:53 -0400 Subject: [PATCH 04/22] Add SiteSettingsRelatedPostsView to replace the old version --- .../SiteSettingsRelatedPostsView.swift | 137 ++++++++++++++++++ .../SiteSettingsViewController+Swift.swift | 7 + .../SiteSettingsViewController.m | 7 - WordPress/WordPress.xcodeproj/project.pbxproj | 6 + 4 files changed, 150 insertions(+), 7 deletions(-) create mode 100644 WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift new file mode 100644 index 000000000000..921adc719499 --- /dev/null +++ b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift @@ -0,0 +1,137 @@ +import Foundation +import SwiftUI +import SVProgressHUD +import WordPressShared + +struct RelatedPostsSettingsView: View { + private let blog: Blog + @ObservedObject private var settings: BlogSettings + + init(blog: Blog) { + self.blog = blog + assert(blog.settings != nil, "Settings should never be nil") + self.settings = blog.settings ?? BlogSettings(context: ContextManager.shared.mainContext) + } + + var body: some View { + Form { + settingsSection + if settings.relatedPostsEnabled { + previewsSection + } + } + .toggleStyle(SwitchToggleStyle(tint: Color(UIColor.jetpackGreen))) + .onChange(of: settings.relatedPostsEnabled) { + save(field: "show_related_posts", value: $0) + } + .onChange(of: settings.relatedPostsShowHeadline) { + save(field: "show_related_posts_header", value: $0) + } + .onChange(of: settings.relatedPostsShowThumbnails) { + save(field: "show_related_posts_thumbnail", value: $0) + } + .navigationTitle(Strings.title) + .navigationBarTitleDisplayMode(.inline) + } + + private var settingsSection: some View { + let section = Section { + Toggle(Strings.showRelatedPosts, isOn: $settings.relatedPostsEnabled) + if settings.relatedPostsEnabled { + Toggle(Strings.showHeader, isOn: $settings.relatedPostsShowHeadline) + Toggle(Strings.showThumbnail, isOn: $settings.relatedPostsShowThumbnails) + } + } footer: { + Text(Strings.optionsFooter) + } + if #available(iOS 15, *) { + return section.tint(Color(UIColor.jetpackGreen)) + } else { + return section.toggleStyle(SwitchToggleStyle(tint: Color(UIColor.jetpackGreen))) + } + } + + private var previewsSection: some View { + Section { + VStack(spacing: settings.relatedPostsShowThumbnails ? 10 : 5) { + if settings.relatedPostsShowHeadline { + Text(Strings.relatedPostsHeader) + .font(.system(size: 11, weight: .semibold)) + .foregroundColor(Color(UIColor.neutral)) + .frame(maxWidth: .infinity, alignment: .leading) + } + ForEach(PreviewViewModel.previews, content: makePreview) + } + } header: { + Text(Strings.previewsHeader) + } + } + + private func makePreview(for viewModel: PreviewViewModel) -> some View { + VStack(spacing: 5) { + if settings.relatedPostsShowThumbnails { + Image(viewModel.imageName) + .resizable() + .aspectRatio(contentMode: .fill) + .frame(height: 96) + .clipped() + } + HStack { + VStack(alignment: .leading, spacing: 0) { + Text(viewModel.title) + .font(.system(size: 14, weight: .semibold)) + .foregroundColor(Color(UIColor.neutral(.shade70))) + Text(viewModel.details) + .font(.system(size: 11).italic()) + .foregroundColor(Color(UIColor.neutral)) + } + Spacer() + } + } + } + + private func save(field: String, value: Any) { + WPAnalytics.trackSettingsChange("related_posts", fieldName: field, value: value) + BlogService(coreDataStack: ContextManager.shared).updateSettings(for: blog, success: nil, failure: { _ in + SVProgressHUD.showDismissibleError(withStatus: Strings.saveFailed) + }) + } +} + +private struct PreviewViewModel: Identifiable { + let id = UUID() + let title: String + let details: String + let imageName: String + + static let previews: [PreviewViewModel] = [ + PreviewViewModel( + title: NSLocalizedString("relatedPostsSettings.preview1.title", value: "Big iPhone/iPad Update Now Available", comment: "Text for related post cell preview"), + details: NSLocalizedString("relatedPostsSettings.preview1.details", value: "in \"Mobile\"", comment: "Text for related post cell preview"), + imageName: "relatedPostsPreview1" + ), + PreviewViewModel( + title: NSLocalizedString("relatedPostsSettings.preview2.title", value: "The WordPress for Android App Gets a Big Facelift", comment: "Text for related post cell preview"), + details: NSLocalizedString("relatedPostsSettings.preview2.details", value: "in \"Apps\"", comment: "Text for related post cell preview"), + imageName: "relatedPostsPreview2" + ), + PreviewViewModel( + title: NSLocalizedString("relatedPostsSettings.preview3.title", value: "Upgrade Focus: VideoPress For Weddings", comment: "Text for related post cell preview"), + details: NSLocalizedString("relatedPostsSettings.preview3.details", value: "in \"Upgrade\"", comment: "Text for related post cell preview"), + imageName: "relatedPostsPreview3" + ) + ] +} + +private extension RelatedPostsSettingsView { + enum Strings { + static let title = NSLocalizedString("relatedPostsSettings.title", value: "Related Posts", comment: "Title for screen that allows configuration of your blog/site related posts settings.") + static let showRelatedPosts = NSLocalizedString("relatedPostsSettings.showRelatedPosts", value: "Show Related Posts", comment: "Label for configuration switch to enable/disable related posts") + static let showHeader = NSLocalizedString("relatedPostsSettings.showHeader", value: "Show Header", comment: "Label for configuration switch to show/hide the header for the related posts section") + static let showThumbnail = NSLocalizedString("relatedPostsSettings.showThumbnail", value: "Show Images", comment: "Label for configuration switch to show/hide images thumbnail for the related posts") + static let optionsFooter = NSLocalizedString("relatedPostsSettings.optionsFooter", value: "Related Posts displays relevant content from your site below your posts", comment: "Information of what related post are and how they are presented") + static let previewsHeader = NSLocalizedString("relatedPostsSettings.previewsHeaders", value: "Preview", comment: "Section title for related posts section preview") + static let relatedPostsHeader = NSLocalizedString("relatedPostsSettings.relatedPostsHeader", value: "Related Posts", comment: "Label for Related Post header preview") + static let saveFailed = NSLocalizedString("relatedPostsSettings.settingsUpdateFailed", value: "Settings update failed", comment: "Message to show when setting save failed") + } +} diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController+Swift.swift b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController+Swift.swift index 07616be964ef..38ced37b41ba 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController+Swift.swift +++ b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController+Swift.swift @@ -1,6 +1,7 @@ import Foundation import SwiftUI import WordPressFlux +import SwiftUI // This is just a wrapper for the receipts, since Receipt isn't exposed to Obj-C @objc class TimeZoneObserver: NSObject { @@ -145,6 +146,12 @@ extension SiteSettingsViewController { navigationController?.pushViewController(speedUpSiteSettingsViewController, animated: true) } + @objc func showRelatedPostsSettings() { + let view = RelatedPostsSettingsView(blog: blog) + let host = UIHostingController(rootView: view) + navigationController?.pushViewController(host, animated: true) + } + // MARK: Footers @objc(getTrafficSettingsSectionFooterView) diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m index c70232b92e36..5964940bcea7 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m @@ -859,13 +859,6 @@ - (void)showPostFormatSelector [self.navigationController pushViewController:vc animated:YES]; } -- (void)showRelatedPostsSettings -{ - RelatedPostsSettingsViewController *relatedPostsViewController = [[RelatedPostsSettingsViewController alloc] initWithBlog:self.blog]; - - [self.navigationController pushViewController:relatedPostsViewController animated:YES]; -} - - (void)tableView:(UITableView *)tableView didSelectInWritingSectionRow:(NSInteger)row { NSInteger writingRow = [self.writingSectionRows[row] integerValue]; diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 2fe87e483c4b..184b0f7f339e 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -362,6 +362,8 @@ 0C896DE42A3A7BDC00D7D4E7 /* SettingsCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C896DDF2A3A763400D7D4E7 /* SettingsCell.swift */; }; 0C896DE52A3A7C1F00D7D4E7 /* SiteVisibility+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C896DE12A3A767200D7D4E7 /* SiteVisibility+Extensions.swift */; }; 0C896DE72A3A832B00D7D4E7 /* SiteVisibilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C896DE62A3A832B00D7D4E7 /* SiteVisibilityTests.swift */; }; + 0C71959B2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C71959A2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift */; }; + 0C71959C2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C71959A2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift */; }; 0CB4056B29C78F06008EED0A /* BlogDashboardPersonalizationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB4056A29C78F06008EED0A /* BlogDashboardPersonalizationService.swift */; }; 0CB4056C29C78F06008EED0A /* BlogDashboardPersonalizationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB4056A29C78F06008EED0A /* BlogDashboardPersonalizationService.swift */; }; 0CB4056E29C7BA63008EED0A /* BlogDashboardPersonalizationServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB4056D29C7BA63008EED0A /* BlogDashboardPersonalizationServiceTests.swift */; }; @@ -6057,6 +6059,7 @@ 0C896DDF2A3A763400D7D4E7 /* SettingsCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsCell.swift; sourceTree = ""; }; 0C896DE12A3A767200D7D4E7 /* SiteVisibility+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SiteVisibility+Extensions.swift"; sourceTree = ""; }; 0C896DE62A3A832B00D7D4E7 /* SiteVisibilityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteVisibilityTests.swift; sourceTree = ""; }; + 0C71959A2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteSettingsRelatedPostsView.swift; sourceTree = ""; }; 0CB4056A29C78F06008EED0A /* BlogDashboardPersonalizationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogDashboardPersonalizationService.swift; sourceTree = ""; }; 0CB4056D29C7BA63008EED0A /* BlogDashboardPersonalizationServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogDashboardPersonalizationServiceTests.swift; sourceTree = ""; }; 0CB4057029C8DCF4008EED0A /* BlogDashboardPersonalizationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogDashboardPersonalizationViewModel.swift; sourceTree = ""; }; @@ -11229,6 +11232,7 @@ 8313B9ED298B1ACD000AF26E /* SiteSettingsViewController+Blogging.swift */, 82C420751FE44BD900CFB15B /* SiteSettingsViewController+Swift.swift */, 0C896DE12A3A767200D7D4E7 /* SiteVisibility+Extensions.swift */, + 0C71959A2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift */, 3F43603723F369A9001DEE70 /* Related Posts */, ); path = "Site Settings"; @@ -22023,6 +22027,7 @@ 8B74A9A8268E3C68003511CE /* RewindStatus+multiSite.swift in Sources */, 3F5B3EAF23A851330060FF1F /* ReaderReblogPresenter.swift in Sources */, 7E3E7A6220E44E6A0075D159 /* BodyContentGroup.swift in Sources */, + 0C71959B2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift in Sources */, FEA088012696E7F600193358 /* ListTableHeaderView.swift in Sources */, 17AD36D51D36C1A60044B10D /* WPStyleGuide+Search.swift in Sources */, F1E3536B25B9F74C00992E3A /* WindowManager.swift in Sources */, @@ -24939,6 +24944,7 @@ FABB24542602FC2C00C8785C /* StoriesIntroViewController.swift in Sources */, FABB24552602FC2C00C8785C /* WPStyleGuide+Suggestions.m in Sources */, FABB24562602FC2C00C8785C /* SiteStatsInsightsViewModel.swift in Sources */, + 0C71959C2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift in Sources */, FABB24572602FC2C00C8785C /* CheckmarkTableViewCell.swift in Sources */, FABB24582602FC2C00C8785C /* ReaderManageScenePresenter.swift in Sources */, FABB24592602FC2C00C8785C /* MediaService.swift in Sources */, From 191c8764c20c673797fb991ff88952ffe8774788 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 16 Jun 2023 12:44:43 -0400 Subject: [PATCH 05/22] Remove RelatedPostsSettingsViewController.h that was replaced --- .../RelatedPostsPreviewTableViewCell.h | 11 - .../RelatedPostsPreviewTableViewCell.m | 211 ------------------ .../RelatedPostsSettingsViewController.h | 9 - .../SiteSettingsViewController.m | 1 - WordPress/WordPress.xcodeproj/project.pbxproj | 24 -- 5 files changed, 256 deletions(-) delete mode 100644 WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsPreviewTableViewCell.h delete mode 100644 WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsPreviewTableViewCell.m delete mode 100644 WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsSettingsViewController.h diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsPreviewTableViewCell.h b/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsPreviewTableViewCell.h deleted file mode 100644 index 914725e40f5c..000000000000 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsPreviewTableViewCell.h +++ /dev/null @@ -1,11 +0,0 @@ -#import -#import - -@interface RelatedPostsPreviewTableViewCell : WPTableViewCell - -@property (nonatomic, assign) BOOL enabledHeader; -@property (nonatomic, assign) BOOL enabledImages; - -- (CGFloat)heightForWidth:(CGFloat)availableWidth; - -@end diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsPreviewTableViewCell.m b/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsPreviewTableViewCell.m deleted file mode 100644 index 83729754bd1b..000000000000 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsPreviewTableViewCell.m +++ /dev/null @@ -1,211 +0,0 @@ -#import "RelatedPostsPreviewTableViewCell.h" -#import -#import -#import "WordPress-Swift.h" - -static CGFloat HorizontalMargin = 0.0; -static CGFloat VerticalMargin = 5.0; -static CGFloat ImageHeight = 96.0; - -@interface RelatedPostsPreview : NSObject - -@property (nonatomic, copy) NSString *title; -@property (nonatomic, copy) NSString *site; -@property (nonatomic, copy) NSString *imageName; - -@property (nonatomic, strong) UILabel *titleLabel; -@property (nonatomic, strong) UILabel *siteLabel; -@property (nonatomic, strong) UIImageView *imageView; - -- (instancetype)initWithTitle:(NSString *)title site:(NSString *)site imageName:(NSString *)imageName; - -@end - -@implementation RelatedPostsPreview - -- (instancetype)initWithTitle:(NSString *)title site:(NSString *)site imageName:(NSString *)imageName -{ - self = [super init]; - if (self) { - _title = title; - _site = site; - _imageName = imageName; - } - - return self; -} - -- (UILabel *)titleLabel -{ - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - _titleLabel.textColor = [UIColor murielNeutral70]; - _titleLabel.font = [WPFontManager systemSemiBoldFontOfSize:14.0]; - _titleLabel.numberOfLines = 0; - } - _titleLabel.text = self.title; - return _titleLabel; -} - -- (UILabel *)siteLabel -{ - if (!_siteLabel) { - _siteLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - _siteLabel.textColor = [UIColor murielNeutral]; - _siteLabel.font = [WPFontManager systemItalicFontOfSize:11.0]; - _siteLabel.numberOfLines = 0; - } - _siteLabel.text = self.site; - return _siteLabel; -} - -- (UIImageView *)imageView -{ - if (!_imageView){ - _imageView = [[UIImageView alloc] init]; - [_imageView setContentMode:UIViewContentModeScaleAspectFill]; - [_imageView setClipsToBounds:YES]; - } - _imageView.image = [UIImage imageNamed:self.imageName]; - return _imageView; -} - -@end - -// Temporary container view for helping to follow readable margins until we can properly adopt this view for readability. -// Brent C. Jul/22/2016 -@protocol RelatedPostsPreviewReadableContentViewDelegate; - -@interface RelatedPostsPreviewReadableContentView : UIView -@property (nonatomic, weak) id delegate; -@end - -@protocol RelatedPostsPreviewReadableContentViewDelegate -- (void)postPreviewReadableContentViewDidLayoutSubviews:(RelatedPostsPreviewReadableContentView *)readableContentView; -@end - -@interface RelatedPostsPreviewTableViewCell() - -@property (nonatomic, strong) UIView *readableContentView; -@property (nonatomic, strong) UILabel *headerLabel; -@property (nonatomic, strong) NSArray *previewPosts; - -@end; - -@implementation RelatedPostsPreviewTableViewCell - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier -{ - self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; - if (self) { - - RelatedPostsPreviewReadableContentView *readableContentView = [[RelatedPostsPreviewReadableContentView alloc] init]; - readableContentView.delegate = self; - readableContentView.translatesAutoresizingMaskIntoConstraints = NO; - readableContentView.backgroundColor = [UIColor clearColor]; - [self.contentView addSubview:readableContentView]; - - UILayoutGuide *readableGuide = self.contentView.readableContentGuide; - [NSLayoutConstraint activateConstraints:@[ - [readableContentView.leadingAnchor constraintEqualToAnchor:readableGuide.leadingAnchor], - [readableContentView.trailingAnchor constraintEqualToAnchor:readableGuide.trailingAnchor], - [readableContentView.topAnchor constraintEqualToAnchor:self.contentView.topAnchor], - [readableContentView.bottomAnchor constraintEqualToAnchor:self.contentView.bottomAnchor] - ]]; - _readableContentView = readableContentView; - - _enabledHeader = YES; - _enabledImages = YES; - _headerLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - _headerLabel.text = NSLocalizedString(@"Related Posts", @"Label for Related Post header preview"); - _headerLabel.textColor = [UIColor murielNeutral]; - _headerLabel.font = [WPFontManager systemSemiBoldFontOfSize:11.0]; - [readableContentView addSubview:_headerLabel]; - - RelatedPostsPreview *preview1 = [[RelatedPostsPreview alloc] initWithTitle:NSLocalizedString(@"Big iPhone/iPad Update Now Available", @"Text for related post cell preview") - site:NSLocalizedString(@"in \"Mobile\"", @"Text for related post cell preview") - imageName:@"relatedPostsPreview1"]; - RelatedPostsPreview *preview2 = [[RelatedPostsPreview alloc] initWithTitle:NSLocalizedString(@"The WordPress for Android App Gets a Big Facelift", @"Text for related post cell preview") - site:NSLocalizedString(@"in \"Apps\"", @"Text for related post cell preview") - imageName:@"relatedPostsPreview2"]; - RelatedPostsPreview *preview3 = [[RelatedPostsPreview alloc] initWithTitle:NSLocalizedString(@"Upgrade Focus: VideoPress For Weddings", @"Text for related post cell preview") - site:NSLocalizedString(@"in \"Upgrade\"", @"Text for related post cell preview") - imageName:@"relatedPostsPreview3"]; - - _previewPosts = @[preview1, preview2, preview3]; - - for (RelatedPostsPreview *relatedPostPreview in _previewPosts) { - [readableContentView addSubview:relatedPostPreview.imageView]; - [readableContentView addSubview:relatedPostPreview.titleLabel]; - [readableContentView addSubview:relatedPostPreview.siteLabel]; - } - } - return self; -} - -- (CGFloat)heightForWidth:(CGFloat)availableWidth -{ - CGFloat width = self.readableContentView.frame.size.width - (2 * HorizontalMargin); - CGFloat height = 0; - CGSize sizeRestriction = CGSizeMake(width, CGFLOAT_MAX); - if (self.enabledHeader) { - height += ceilf([self.headerLabel sizeThatFits:sizeRestriction].height) + VerticalMargin; - } - for (RelatedPostsPreview *relatedPostPreview in _previewPosts) { - if (self.enabledImages) { - height += ImageHeight + (2 * VerticalMargin); - } - height += ceilf([relatedPostPreview.titleLabel sizeThatFits:sizeRestriction].height) + VerticalMargin; - height += ceilf([relatedPostPreview.siteLabel sizeThatFits:sizeRestriction].height); - } - height += VerticalMargin; - - return height; -} - -#pragma mark - RelatedPostsPreviewReadableContentViewDelegate - -- (void)postPreviewReadableContentViewDidLayoutSubviews:(RelatedPostsPreviewReadableContentView *)readableContentView -{ - CGFloat width = self.readableContentView.frame.size.width - (2 * HorizontalMargin); - CGFloat height = 0; - CGSize sizeRestriction = CGSizeMake(width, CGFLOAT_MAX); - if (self.enabledHeader) { - height = ceilf([self.headerLabel sizeThatFits:sizeRestriction].height); - self.headerLabel.frame = CGRectMake(HorizontalMargin, VerticalMargin, width, height); - } else { - self.headerLabel.frame = CGRectZero; - } - UIView *referenceView = self.headerLabel; - for (RelatedPostsPreview *relatedPostPreview in _previewPosts) { - if (self.enabledImages) { - relatedPostPreview.imageView.frame = CGRectMake(HorizontalMargin, CGRectGetMaxY(referenceView.frame) + (2 * VerticalMargin), width, ImageHeight); - relatedPostPreview.imageView.hidden = NO; - referenceView = relatedPostPreview.imageView; - } else { - relatedPostPreview.imageView.frame = CGRectZero; - relatedPostPreview.imageView.hidden = YES; - } - - height = ceilf([relatedPostPreview.titleLabel sizeThatFits:sizeRestriction].height); - relatedPostPreview.titleLabel.frame = CGRectMake(HorizontalMargin, CGRectGetMaxY(referenceView.frame) + VerticalMargin, width, height); - referenceView = relatedPostPreview.titleLabel; - - height = ceilf([relatedPostPreview.siteLabel sizeThatFits:sizeRestriction].height); - relatedPostPreview.siteLabel.frame = CGRectMake(HorizontalMargin, CGRectGetMaxY(referenceView.frame), width, height); - referenceView = relatedPostPreview.siteLabel; - } -} - -@end - -@implementation RelatedPostsPreviewReadableContentView - -- (void)layoutSubviews -{ - [super layoutSubviews]; - - [self.delegate postPreviewReadableContentViewDidLayoutSubviews:self]; -} - -@end diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsSettingsViewController.h b/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsSettingsViewController.h deleted file mode 100644 index 15799d188360..000000000000 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsSettingsViewController.h +++ /dev/null @@ -1,9 +0,0 @@ -#import - -@class Blog; - -@interface RelatedPostsSettingsViewController : UITableViewController - -- (instancetype)initWithBlog:(Blog *)blog; - -@end diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m index 5964940bcea7..9f6b525c38f1 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m @@ -6,7 +6,6 @@ #import "NSURL+IDN.h" #import "PostCategory.h" #import "PostCategoryService.h" -#import "RelatedPostsSettingsViewController.h" #import "SettingsSelectionViewController.h" #import "SettingsMultiTextViewController.h" #import "SettingTableViewCell.h" diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 184b0f7f339e..f35eb2cec2a7 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -5094,7 +5094,6 @@ FABB24EE2602FC2C00C8785C /* Suggestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = B03B9235250BC5FD000A40AF /* Suggestion.swift */; }; FABB24EF2602FC2C00C8785C /* ShareNoticeConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74EA3B87202A0462004F802D /* ShareNoticeConstants.swift */; }; FABB24F02602FC2C00C8785C /* FeatureFlagOverrideStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A09B98238FE13B0022AE0D /* FeatureFlagOverrideStore.swift */; }; - FABB24F12602FC2C00C8785C /* RelatedPostsPreviewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FF1933FE1BB17DA3006825B8 /* RelatedPostsPreviewTableViewCell.m */; }; FABB24F22602FC2C00C8785C /* IntrinsicTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B54075D31D3D7D5B0095C318 /* IntrinsicTableView.swift */; }; FABB24F32602FC2C00C8785C /* HomeWidgetTodayData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FB34ACA25672A90001A74A6 /* HomeWidgetTodayData.swift */; }; FABB24F42602FC2C00C8785C /* NoticePresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 172E27D21FD98135003EA321 /* NoticePresenter.swift */; }; @@ -5306,7 +5305,6 @@ FABB25C52602FC2C00C8785C /* MenusSelectionItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 08D3454D1CD7F50900358E8C /* MenusSelectionItemView.m */; }; FABB25C62602FC2C00C8785C /* TenorReponseParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81CCD6D243AF09900A83E27 /* TenorReponseParser.swift */; }; FABB25C72602FC2C00C8785C /* WPStyleGuide+Gridicon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4020B2BC2007AC850002C963 /* WPStyleGuide+Gridicon.swift */; }; - FABB25C82602FC2C00C8785C /* RelatedPostsSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF42584F1BA092EE00580C68 /* RelatedPostsSettingsViewController.m */; }; FABB25C92602FC2C00C8785C /* CreateButtonCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5E032D5240889EB003AF350 /* CreateButtonCoordinator.swift */; }; FABB25CA2602FC2C00C8785C /* SearchManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74729CA22056FA0900D1394D /* SearchManager.swift */; }; FABB25CB2602FC2C00C8785C /* BlogToBlogMigration87to88.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E8980C922E8C7A600C567B0 /* BlogToBlogMigration87to88.swift */; }; @@ -5593,7 +5591,6 @@ FF0B2567237A023C004E255F /* GutenbergVideoUploadProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF0B2566237A023C004E255F /* GutenbergVideoUploadProcessorTests.swift */; }; FF0D8146205809C8000EE505 /* PostCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF0D8145205809C8000EE505 /* PostCoordinator.swift */; }; FF0F722C206E5345000DAAB5 /* Post+RefreshStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF0F722B206E5345000DAAB5 /* Post+RefreshStatus.swift */; }; - FF1933FF1BB17DA3006825B8 /* RelatedPostsPreviewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FF1933FE1BB17DA3006825B8 /* RelatedPostsPreviewTableViewCell.m */; }; FF1B11E5238FDFE70038B93E /* GutenbergGalleryUploadProcessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1B11E4238FDFE70038B93E /* GutenbergGalleryUploadProcessor.swift */; }; FF1B11E7238FE27A0038B93E /* GutenbergGalleryUploadProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1B11E6238FE27A0038B93E /* GutenbergGalleryUploadProcessorTests.swift */; }; FF1FD0242091268900186384 /* URL+LinkNormalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF1FD0232091268900186384 /* URL+LinkNormalization.swift */; }; @@ -5605,7 +5602,6 @@ FF2EC3C22209AC19006176E1 /* GutenbergImgUploadProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF2EC3C12209AC19006176E1 /* GutenbergImgUploadProcessorTests.swift */; }; FF355D981FB492DD00244E6D /* ExportableAsset.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF355D971FB492DD00244E6D /* ExportableAsset.swift */; }; FF37F90922385CA000AFA3DB /* RELEASE-NOTES.txt in Resources */ = {isa = PBXBuildFile; fileRef = FF37F90822385C9F00AFA3DB /* RELEASE-NOTES.txt */; }; - FF4258501BA092EE00580C68 /* RelatedPostsSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF42584F1BA092EE00580C68 /* RelatedPostsSettingsViewController.m */; }; FF4C069F206560E500E0B2BC /* MediaThumbnailCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF4C069E206560E500E0B2BC /* MediaThumbnailCoordinator.swift */; }; FF4DEAD8244B56E300ACA032 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF4DEAD7244B56E200ACA032 /* CoreServices.framework */; }; FF5371631FDFF64F00619A3F /* MediaService.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5371621FDFF64F00619A3F /* MediaService.swift */; }; @@ -9360,8 +9356,6 @@ FF0B2566237A023C004E255F /* GutenbergVideoUploadProcessorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergVideoUploadProcessorTests.swift; sourceTree = ""; }; FF0D8145205809C8000EE505 /* PostCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostCoordinator.swift; sourceTree = ""; }; FF0F722B206E5345000DAAB5 /* Post+RefreshStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Post+RefreshStatus.swift"; sourceTree = ""; }; - FF1933FD1BB17DA3006825B8 /* RelatedPostsPreviewTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RelatedPostsPreviewTableViewCell.h; sourceTree = ""; }; - FF1933FE1BB17DA3006825B8 /* RelatedPostsPreviewTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RelatedPostsPreviewTableViewCell.m; sourceTree = ""; }; FF1B11E4238FDFE70038B93E /* GutenbergGalleryUploadProcessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GutenbergGalleryUploadProcessor.swift; sourceTree = ""; }; FF1B11E6238FE27A0038B93E /* GutenbergGalleryUploadProcessorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GutenbergGalleryUploadProcessorTests.swift; path = Gutenberg/GutenbergGalleryUploadProcessorTests.swift; sourceTree = ""; }; FF1FD0232091268900186384 /* URL+LinkNormalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+LinkNormalization.swift"; sourceTree = ""; }; @@ -9376,8 +9370,6 @@ FF2EC3C12209AC19006176E1 /* GutenbergImgUploadProcessorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = GutenbergImgUploadProcessorTests.swift; path = Gutenberg/GutenbergImgUploadProcessorTests.swift; sourceTree = ""; }; FF355D971FB492DD00244E6D /* ExportableAsset.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExportableAsset.swift; sourceTree = ""; }; FF37F90822385C9F00AFA3DB /* RELEASE-NOTES.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "RELEASE-NOTES.txt"; path = "../RELEASE-NOTES.txt"; sourceTree = ""; }; - FF42584E1BA092EE00580C68 /* RelatedPostsSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RelatedPostsSettingsViewController.h; sourceTree = ""; }; - FF42584F1BA092EE00580C68 /* RelatedPostsSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RelatedPostsSettingsViewController.m; sourceTree = ""; }; FF4C069E206560E500E0B2BC /* MediaThumbnailCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaThumbnailCoordinator.swift; sourceTree = ""; }; FF4DEAD7244B56E200ACA032 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; FF5371621FDFF64F00619A3F /* MediaService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaService.swift; sourceTree = ""; }; @@ -11205,17 +11197,6 @@ path = "Blog Selector"; sourceTree = ""; }; - 3F43603723F369A9001DEE70 /* Related Posts */ = { - isa = PBXGroup; - children = ( - FF42584E1BA092EE00580C68 /* RelatedPostsSettingsViewController.h */, - FF42584F1BA092EE00580C68 /* RelatedPostsSettingsViewController.m */, - FF1933FD1BB17DA3006825B8 /* RelatedPostsPreviewTableViewCell.h */, - FF1933FE1BB17DA3006825B8 /* RelatedPostsPreviewTableViewCell.m */, - ); - path = "Related Posts"; - sourceTree = ""; - }; 3F43603823F36A76001DEE70 /* Site Settings */ = { isa = PBXGroup; children = ( @@ -11233,7 +11214,6 @@ 82C420751FE44BD900CFB15B /* SiteSettingsViewController+Swift.swift */, 0C896DE12A3A767200D7D4E7 /* SiteVisibility+Extensions.swift */, 0C71959A2A3CA582002EA18C /* SiteSettingsRelatedPostsView.swift */, - 3F43603723F369A9001DEE70 /* Related Posts */, ); path = "Site Settings"; sourceTree = ""; @@ -22284,7 +22264,6 @@ B03B9236250BC5FD000A40AF /* Suggestion.swift in Sources */, 74EA3B88202A0462004F802D /* ShareNoticeConstants.swift in Sources */, 17A09B99238FE13B0022AE0D /* FeatureFlagOverrideStore.swift in Sources */, - FF1933FF1BB17DA3006825B8 /* RelatedPostsPreviewTableViewCell.m in Sources */, B54075D41D3D7D5B0095C318 /* IntrinsicTableView.swift in Sources */, 08A4E12C289D2337001D9EC7 /* UserPersistentRepository.swift in Sources */, 3FB34ADA25672AA5001A74A6 /* HomeWidgetTodayData.swift in Sources */, @@ -22582,7 +22561,6 @@ C7B7CC702812FDCE007B9807 /* MySiteViewController+OnboardingPrompt.swift in Sources */, C81CCD6F243AF7D700A83E27 /* TenorReponseParser.swift in Sources */, 4020B2BD2007AC850002C963 /* WPStyleGuide+Gridicon.swift in Sources */, - FF4258501BA092EE00580C68 /* RelatedPostsSettingsViewController.m in Sources */, 982D261F2788DDF200A41286 /* ReaderCommentsFollowPresenter.swift in Sources */, F5E032D6240889EB003AF350 /* CreateButtonCoordinator.swift in Sources */, 74729CA32056FA0900D1394D /* SearchManager.swift in Sources */, @@ -25160,7 +25138,6 @@ FABB24EE2602FC2C00C8785C /* Suggestion.swift in Sources */, FABB24EF2602FC2C00C8785C /* ShareNoticeConstants.swift in Sources */, FABB24F02602FC2C00C8785C /* FeatureFlagOverrideStore.swift in Sources */, - FABB24F12602FC2C00C8785C /* RelatedPostsPreviewTableViewCell.m in Sources */, FABB24F22602FC2C00C8785C /* IntrinsicTableView.swift in Sources */, FABB24F32602FC2C00C8785C /* HomeWidgetTodayData.swift in Sources */, FABB24F42602FC2C00C8785C /* NoticePresenter.swift in Sources */, @@ -25459,7 +25436,6 @@ FABB25C52602FC2C00C8785C /* MenusSelectionItemView.m in Sources */, FABB25C62602FC2C00C8785C /* TenorReponseParser.swift in Sources */, FABB25C72602FC2C00C8785C /* WPStyleGuide+Gridicon.swift in Sources */, - FABB25C82602FC2C00C8785C /* RelatedPostsSettingsViewController.m in Sources */, FABB25C92602FC2C00C8785C /* CreateButtonCoordinator.swift in Sources */, 3FBF21B8267AA17A0098335F /* BloggingRemindersAnimator.swift in Sources */, FABB25CA2602FC2C00C8785C /* SearchManager.swift in Sources */, From 1635c68643dbf62d69ae6a8fa20763f9b9cd8c46 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 16 Jun 2023 12:46:03 -0400 Subject: [PATCH 06/22] Add constants to SiteSettingsRelatedPostsView.swift --- .../Blog/Site Settings/SiteSettingsRelatedPostsView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift index 921adc719499..00e3fc0bd2cb 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift +++ b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift @@ -73,7 +73,7 @@ struct RelatedPostsSettingsView: View { Image(viewModel.imageName) .resizable() .aspectRatio(contentMode: .fill) - .frame(height: 96) + .frame(height: Constants.imageViewHeight) .clipped() } HStack { @@ -134,4 +134,8 @@ private extension RelatedPostsSettingsView { static let relatedPostsHeader = NSLocalizedString("relatedPostsSettings.relatedPostsHeader", value: "Related Posts", comment: "Label for Related Post header preview") static let saveFailed = NSLocalizedString("relatedPostsSettings.settingsUpdateFailed", value: "Settings update failed", comment: "Message to show when setting save failed") } + + enum Constants { + static let imageViewHeight: CGFloat = 96 + } } From e4b3c1d9aba7e70efd4fe531ed517d040d21b8d1 Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 16 Jun 2023 13:04:02 -0400 Subject: [PATCH 07/22] Fix title not being available on push --- .../Blog/Site Settings/SiteSettingsRelatedPostsView.swift | 2 ++ .../Blog/Site Settings/SiteSettingsViewController+Swift.swift | 1 + 2 files changed, 3 insertions(+) diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift index 00e3fc0bd2cb..cfe48f3ba904 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift +++ b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsRelatedPostsView.swift @@ -7,6 +7,8 @@ struct RelatedPostsSettingsView: View { private let blog: Blog @ObservedObject private var settings: BlogSettings + var title: String { Strings.title } + init(blog: Blog) { self.blog = blog assert(blog.settings != nil, "Settings should never be nil") diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController+Swift.swift b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController+Swift.swift index 38ced37b41ba..a6531757e709 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController+Swift.swift +++ b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController+Swift.swift @@ -149,6 +149,7 @@ extension SiteSettingsViewController { @objc func showRelatedPostsSettings() { let view = RelatedPostsSettingsView(blog: blog) let host = UIHostingController(rootView: view) + host.title = view.title // Make sure title is available before push navigationController?.pushViewController(host, animated: true) } From a69b4a1269bdd7b0e8bdd1b27ad6612a6a726d14 Mon Sep 17 00:00:00 2001 From: kean Date: Wed, 21 Jun 2023 17:54:53 -0400 Subject: [PATCH 08/22] Remove older Related Posts files --- .../RelatedPostsSettingsViewController.m | 264 ------------------ 1 file changed, 264 deletions(-) delete mode 100644 WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsSettingsViewController.m diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsSettingsViewController.m b/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsSettingsViewController.m deleted file mode 100644 index a870160e916b..000000000000 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/Related Posts/RelatedPostsSettingsViewController.m +++ /dev/null @@ -1,264 +0,0 @@ -#import "RelatedPostsSettingsViewController.h" - -#import "Blog.h" -#import "BlogService.h" -#import "CoreDataStack.h" -#import "SettingTableViewCell.h" -#import "SVProgressHud+Dismiss.h" -#import "RelatedPostsPreviewTableViewCell.h" - -#import -#import "WordPress-Swift.h" - - -static const CGFloat RelatePostsSettingsCellHeight = 44; - -typedef NS_ENUM(NSInteger, RelatedPostsSettingsSection) { - RelatedPostsSettingsSectionOptions = 0, - RelatedPostsSettingsSectionPreview, - RelatedPostsSettingsSectionCount -}; - -typedef NS_ENUM(NSInteger, RelatedPostsSettingsOptions) { - RelatedPostsSettingsOptionsEnabled = 0, - RelatedPostsSettingsOptionsShowHeader, - RelatedPostsSettingsOptionsShowThumbnails, - RelatedPostsSettingsOptionsCount, -}; - -@interface RelatedPostsSettingsViewController() - -@property (nonatomic, strong) Blog *blog; - -@property (nonatomic, strong) SwitchTableViewCell *relatedPostsEnabledCell; -@property (nonatomic, strong) SwitchTableViewCell *relatedPostsShowHeaderCell; -@property (nonatomic, strong) SwitchTableViewCell *relatedPostsShowThumbnailsCell; - -@property (nonatomic, strong) RelatedPostsPreviewTableViewCell *relatedPostsPreviewTableViewCell; - -@end - -@implementation RelatedPostsSettingsViewController - -- (instancetype)initWithBlog:(Blog *)blog -{ - NSParameterAssert([blog isKindOfClass:[Blog class]]); - self = [super initWithStyle:UITableViewStyleInsetGrouped]; - if (self) { - _blog = blog; - } - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - [WPStyleGuide configureColorsForView:self.view andTableView:self.tableView]; - self.navigationItem.title = NSLocalizedString(@"Related Posts", @"Title for screen that allows configuration of your blog/site related posts settings."); - self.tableView.allowsSelection = NO; -} - - -#pragma mark - Properties - -- (BlogSettings *)settings -{ - return self.blog.settings; -} - - -#pragma mark - UITableViewDataSource Methods - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView -{ - if (self.settings.relatedPostsEnabled) { - return RelatedPostsSettingsSectionCount; - } else { - return RelatedPostsSettingsSectionCount-1; - } -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - switch (section) { - case RelatedPostsSettingsSectionOptions:{ - if (self.settings.relatedPostsEnabled) { - return RelatedPostsSettingsOptionsCount; - } else { - return 1; - } - } - break; - case RelatedPostsSettingsSectionPreview: - return 1; - break; - } - return 0; -} - -- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section -{ - switch (section) { - case RelatedPostsSettingsSectionPreview: - return NSLocalizedString(@"Preview", @"Section title for related posts section preview"); - default: - return nil; - } -} - -- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section -{ - switch (section) { - case RelatedPostsSettingsSectionOptions: - return NSLocalizedString(@"Related Posts displays relevant content from your site below your posts", @"Information of what related post are and how they are presented");; - default: - return nil; - } -} - -- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section -{ - [WPStyleGuide configureTableViewSectionFooter:view]; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - switch (indexPath.section) { - case RelatedPostsSettingsSectionOptions:{ - return RelatePostsSettingsCellHeight; - } - break; - case RelatedPostsSettingsSectionPreview:{ - return [self.relatedPostsPreviewTableViewCell heightForWidth:tableView.frame.size.width]; - } - break; - case RelatedPostsSettingsSectionCount: - break; - } - return 0; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - RelatedPostsSettingsSection section = (RelatedPostsSettingsSection)indexPath.section; - switch (section) { - case RelatedPostsSettingsSectionOptions:{ - RelatedPostsSettingsOptions row = indexPath.row; - return [self tableView:tableView cellForOptionsRow:row]; - } - break; - case RelatedPostsSettingsSectionPreview:{ - return [self relatedPostsPreviewTableViewCell]; - } - break; - case RelatedPostsSettingsSectionCount: - break; - } - return [UITableViewCell new]; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForOptionsRow:(RelatedPostsSettingsOptions)row -{ - switch (row) { - case RelatedPostsSettingsOptionsEnabled:{ - self.relatedPostsEnabledCell.on = self.settings.relatedPostsEnabled; - return self.relatedPostsEnabledCell; - } - break; - case RelatedPostsSettingsOptionsShowHeader:{ - self.relatedPostsShowHeaderCell.on = self.settings.relatedPostsShowHeadline; - return self.relatedPostsShowHeaderCell; - } - break; - case RelatedPostsSettingsOptionsShowThumbnails:{ - self.relatedPostsShowThumbnailsCell.on = self.settings.relatedPostsShowThumbnails; - return self.relatedPostsShowThumbnailsCell; - } - break; - case RelatedPostsSettingsOptionsCount: - break; - } - return nil; -} - - -#pragma mark - Cell Helpers - -- (SwitchTableViewCell *)relatedPostsEnabledCell -{ - if (!_relatedPostsEnabledCell) { - _relatedPostsEnabledCell = [SwitchTableViewCell new]; - _relatedPostsEnabledCell.name = NSLocalizedString(@"Show Related Posts", @"Label for configuration switch to enable/disable related posts"); - __weak RelatedPostsSettingsViewController *weakSelf = self; - _relatedPostsEnabledCell.onChange = ^(BOOL value){ - [WPAnalytics trackSettingsChange:@"related_posts" fieldName:@"show_related_posts" value:@(value)]; - - [weakSelf updateRelatedPostsSettings:nil]; - }; - } - return _relatedPostsEnabledCell; -} - -- (SwitchTableViewCell *)relatedPostsShowHeaderCell -{ - if (!_relatedPostsShowHeaderCell) { - _relatedPostsShowHeaderCell = [SwitchTableViewCell new]; - _relatedPostsShowHeaderCell.name = NSLocalizedString(@"Show Header", @"Label for configuration switch to show/hide the header for the related posts section"); - __weak RelatedPostsSettingsViewController *weakSelf = self; - _relatedPostsShowHeaderCell.onChange = ^(BOOL value){ - [WPAnalytics trackSettingsChange:@"related_posts" fieldName:@"show_related_posts_header" value:@(value)]; - [weakSelf updateRelatedPostsSettings:nil]; - }; - } - - return _relatedPostsShowHeaderCell; -} - -- (SwitchTableViewCell *)relatedPostsShowThumbnailsCell -{ - if (!_relatedPostsShowThumbnailsCell) { - _relatedPostsShowThumbnailsCell = [SwitchTableViewCell new]; - _relatedPostsShowThumbnailsCell.name = NSLocalizedString(@"Show Images", @"Label for configuration switch to show/hide images thumbnail for the related posts"); - __weak RelatedPostsSettingsViewController *weakSelf = self; - _relatedPostsShowThumbnailsCell.onChange = ^(BOOL value){ - [WPAnalytics trackSettingsChange:@"related_posts" fieldName:@"show_related_posts_thumbnail" value:@(value)]; - - [weakSelf updateRelatedPostsSettings:nil]; - }; - } - - return _relatedPostsShowThumbnailsCell; -} - - -- (RelatedPostsPreviewTableViewCell *)relatedPostsPreviewTableViewCell -{ - if (!_relatedPostsPreviewTableViewCell) { - _relatedPostsPreviewTableViewCell = [[RelatedPostsPreviewTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault - reuseIdentifier:nil]; - } - _relatedPostsPreviewTableViewCell.enabledImages = self.settings.relatedPostsShowThumbnails; - _relatedPostsPreviewTableViewCell.enabledHeader = self.settings.relatedPostsShowHeadline; - - return _relatedPostsPreviewTableViewCell; - -} - -#pragma mark - Helpers - -- (IBAction)updateRelatedPostsSettings:(id)sender -{ - self.settings.relatedPostsEnabled = self.relatedPostsEnabledCell.on; - self.settings.relatedPostsShowHeadline = self.relatedPostsShowHeaderCell.on; - self.settings.relatedPostsShowThumbnails = self.relatedPostsShowThumbnailsCell.on; - - BlogService *blogService = [[BlogService alloc] initWithCoreDataStack:[ContextManager sharedInstance]]; - [blogService updateSettingsForBlog:self.blog success:^{ - [self.tableView reloadData]; - } failure:^(NSError * __unused error) { - [SVProgressHUD showDismissibleErrorWithStatus:NSLocalizedString(@"Settings update failed", @"Message to show when setting save failed")]; - [self.tableView reloadData]; - }]; - [self.tableView reloadData]; -} - -@end From db5d4a3811248d3e3d69f47f65a940f7a25a6a98 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 22 Jun 2023 20:13:13 +1000 Subject: [PATCH 09/22] Update SwiftLint to latest version --- Podfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index a5a5d6ce909d..2175905a68da 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -499,7 +499,7 @@ PODS: - Sodium (0.9.1) - Starscream (3.0.6) - SVProgressHUD (2.2.5) - - SwiftLint (0.50.3) + - SwiftLint (0.52.2) - UIDeviceIdentifier (2.3.0) - WordPress-Aztec-iOS (1.19.8) - WordPress-Editor-iOS (1.19.8): @@ -880,7 +880,7 @@ SPEC CHECKSUMS: Sodium: 23d11554ecd556196d313cf6130d406dfe7ac6da Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5 SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 - SwiftLint: 77f7cb2b9bb81ab4a12fcc86448ba3f11afa50c6 + SwiftLint: 1ac76dac888ca05cb0cf24d0c85887ec1209961d UIDeviceIdentifier: 442b65b4ff1832d4ca9c2a157815cb29ad981b17 WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504 WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345 From 01053b9505502bb7d74e4c48ab178c592ce863c2 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 22 Jun 2023 20:13:46 +1000 Subject: [PATCH 10/22] Enable `overridden_super_call` SwiftLint rule and address violations Set as error so that we won't risk future violations going unnoticed. --- .swiftlint.yml | 6 ++++++ .../ViewRelated/Activity/ActivityDetailViewController.swift | 2 ++ .../Activity/BaseActivityListViewController.swift | 2 ++ .../ViewRelated/Activity/CalendarViewController.swift | 2 ++ .../Blog/Blog Dashboard/BlogDashboardViewController.swift | 2 ++ .../ViewRelated/Blog/My Site/MySiteViewController.swift | 2 ++ .../Site Management/SettingsTitleSubtitleController.swift | 2 ++ WordPress/Classes/ViewRelated/Cells/ExpandableCell.swift | 2 ++ .../ViewRelated/Cells/TitleBadgeDisclosureCell.swift | 2 ++ .../Gutenberg/GutenbergSuggestionsViewController.swift | 4 ++++ .../Branding/Menu Card/JetpackBrandingMenuCardCell.swift | 2 ++ .../Change Username/ChangeUsernameViewController.swift | 2 ++ .../Classes/ViewRelated/NUX/UnifiedProloguePages.swift | 2 ++ WordPress/Classes/ViewRelated/People/PeopleCell.swift | 2 ++ .../ViewRelated/Plugins/CollectionViewContainerRow.swift | 2 ++ .../Classes/ViewRelated/Post/EditPostViewController.swift | 2 ++ .../Revisions/Browser/RevisionsNavigationController.swift | 2 ++ .../Detail/Views/ReaderDetailLikesListController.swift | 2 ++ .../ViewRelated/Reader/Detail/WebView/ReaderWebView.swift | 2 ++ .../Reader/Tab Navigation/ReaderTabViewController.swift | 2 ++ .../ViewRelated/Site Creation/Site Intent/IntentCell.swift | 2 ++ .../Site Creation/Site Segments/SiteSegmentsCell.swift | 2 ++ .../Site Creation/Web Address/AddressTableViewCell.swift | 2 ++ .../ViewRelated/Stats/Shared Views/StatsCellHeader.swift | 2 ++ .../ViewRelated/System/BlurredEmptyViewController.swift | 2 ++ 25 files changed, 56 insertions(+) diff --git a/.swiftlint.yml b/.swiftlint.yml index f9cd6c775d45..51ba0c206ad9 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,2 +1,8 @@ parent_config: https://raw.githubusercontent.com/Automattic/swiftlint-config/0f8ab6388bd8d15a04391825ab125f80cfb90704/.swiftlint.yml remote_timeout: 10.0 + +opt_in_rules: + - overridden_super_call + +overridden_super_call: + severity: error diff --git a/WordPress/Classes/ViewRelated/Activity/ActivityDetailViewController.swift b/WordPress/Classes/ViewRelated/Activity/ActivityDetailViewController.swift index 563eedad2452..d1a6508d0d61 100644 --- a/WordPress/Classes/ViewRelated/Activity/ActivityDetailViewController.swift +++ b/WordPress/Classes/ViewRelated/Activity/ActivityDetailViewController.swift @@ -60,6 +60,8 @@ class ActivityDetailViewController: UIViewController, StoryboardLoadable { var router: ActivityContentRouter? override func viewDidLoad() { + super.viewDidLoad() + setupLabelStyles() setupViews() setupText() diff --git a/WordPress/Classes/ViewRelated/Activity/BaseActivityListViewController.swift b/WordPress/Classes/ViewRelated/Activity/BaseActivityListViewController.swift index e115d49b668f..5567bfee0ca3 100644 --- a/WordPress/Classes/ViewRelated/Activity/BaseActivityListViewController.swift +++ b/WordPress/Classes/ViewRelated/Activity/BaseActivityListViewController.swift @@ -155,6 +155,8 @@ class BaseActivityListViewController: UIViewController, TableViewContainer, Immu } override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + SVProgressHUD.dismiss() } diff --git a/WordPress/Classes/ViewRelated/Activity/CalendarViewController.swift b/WordPress/Classes/ViewRelated/Activity/CalendarViewController.swift index ba50e1464f1e..c3068a70a9aa 100644 --- a/WordPress/Classes/ViewRelated/Activity/CalendarViewController.swift +++ b/WordPress/Classes/ViewRelated/Activity/CalendarViewController.swift @@ -57,6 +57,8 @@ class CalendarViewController: UIViewController { } override func viewDidLoad() { + super.viewDidLoad() + title = NSLocalizedString("Choose date range", comment: "Title to choose date range in a calendar") // Configure Calendar diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift index 7e0934cef9ed..5ae6a2a89ca3 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift @@ -82,6 +82,8 @@ final class BlogDashboardViewController: UIViewController { } override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + stopAlertTimer() } diff --git a/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift b/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift index 5c97bc11a29d..4812d2cf0152 100644 --- a/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift +++ b/WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift @@ -156,6 +156,8 @@ class MySiteViewController: UIViewController, NoResultsViewHost { // MARK: - View Lifecycle override func viewDidLoad() { + super.viewDidLoad() + setupView() setupConstraints() setupNavigationItem() diff --git a/WordPress/Classes/ViewRelated/Blog/Site Management/SettingsTitleSubtitleController.swift b/WordPress/Classes/ViewRelated/Blog/Site Management/SettingsTitleSubtitleController.swift index 58fcf62e36c4..752e56f039f6 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Management/SettingsTitleSubtitleController.swift +++ b/WordPress/Classes/ViewRelated/Blog/Site Management/SettingsTitleSubtitleController.swift @@ -115,6 +115,8 @@ final class SettingsTitleSubtitleController: UITableViewController { } override func viewDidLoad() { + super.viewDidLoad() + setupNavigationBar() setupTitle() setupTable() diff --git a/WordPress/Classes/ViewRelated/Cells/ExpandableCell.swift b/WordPress/Classes/ViewRelated/Cells/ExpandableCell.swift index 460f20643521..cb2851eca9af 100644 --- a/WordPress/Classes/ViewRelated/Cells/ExpandableCell.swift +++ b/WordPress/Classes/ViewRelated/Cells/ExpandableCell.swift @@ -46,6 +46,8 @@ class ExpandableCell: WPReusableTableViewCell { } override func awakeFromNib() { + super.awakeFromNib() + setupSubviews() } diff --git a/WordPress/Classes/ViewRelated/Cells/TitleBadgeDisclosureCell.swift b/WordPress/Classes/ViewRelated/Cells/TitleBadgeDisclosureCell.swift index 88481cdfdd95..ad901d40d046 100644 --- a/WordPress/Classes/ViewRelated/Cells/TitleBadgeDisclosureCell.swift +++ b/WordPress/Classes/ViewRelated/Cells/TitleBadgeDisclosureCell.swift @@ -50,6 +50,8 @@ final class TitleBadgeDisclosureCell: WPTableViewCell { } override func prepareForReuse() { + super.prepareForReuse() + cellTitle.text = "" cellBadge.text = "" } diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergSuggestionsViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergSuggestionsViewController.swift index e52cb60d77f4..69d6b72bcc53 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergSuggestionsViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergSuggestionsViewController.swift @@ -55,6 +55,8 @@ public class GutenbergSuggestionsViewController: UIViewController { } override public func viewDidLoad() { + super.viewDidLoad() + view.translatesAutoresizingMaskIntoConstraints = false view.backgroundColor = .clear @@ -98,6 +100,8 @@ public class GutenbergSuggestionsViewController: UIViewController { } override public func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + suggestionsView.showSuggestions(forWord: suggestionType.trigger) } } diff --git a/WordPress/Classes/ViewRelated/Jetpack/Branding/Menu Card/JetpackBrandingMenuCardCell.swift b/WordPress/Classes/ViewRelated/Jetpack/Branding/Menu Card/JetpackBrandingMenuCardCell.swift index f3912c63bd1c..d059838d1701 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Branding/Menu Card/JetpackBrandingMenuCardCell.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Branding/Menu Card/JetpackBrandingMenuCardCell.swift @@ -156,6 +156,8 @@ class JetpackBrandingMenuCardCell: UITableViewCell { // MARK: Cell Lifecycle override func prepareForReuse() { + super.prepareForReuse() + containerStackView.removeAllSubviews() } diff --git a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift index b1eddc602519..062ba6d33b29 100644 --- a/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/My Profile/Change Username/ChangeUsernameViewController.swift @@ -34,6 +34,8 @@ class ChangeUsernameViewController: SignupUsernameTableViewController { } override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + viewModel.start() } diff --git a/WordPress/Classes/ViewRelated/NUX/UnifiedProloguePages.swift b/WordPress/Classes/ViewRelated/NUX/UnifiedProloguePages.swift index 5841a98af57d..0cdf6dc0a11c 100644 --- a/WordPress/Classes/ViewRelated/NUX/UnifiedProloguePages.swift +++ b/WordPress/Classes/ViewRelated/NUX/UnifiedProloguePages.swift @@ -71,6 +71,8 @@ class UnifiedProloguePageViewController: UIViewController { } override func viewDidLoad() { + super.viewDidLoad() + activateConstraints() } diff --git a/WordPress/Classes/ViewRelated/People/PeopleCell.swift b/WordPress/Classes/ViewRelated/People/PeopleCell.swift index 50cf1eb568a3..4a116b0d6381 100644 --- a/WordPress/Classes/ViewRelated/People/PeopleCell.swift +++ b/WordPress/Classes/ViewRelated/People/PeopleCell.swift @@ -10,6 +10,8 @@ class PeopleCell: WPTableViewCell { @IBOutlet private weak var badgeStackView: UIStackView! override func awakeFromNib() { + super.awakeFromNib() + WPStyleGuide.configureLabel(displayNameLabel, textStyle: .callout) WPStyleGuide.configureLabel(usernameLabel, textStyle: .caption2) } diff --git a/WordPress/Classes/ViewRelated/Plugins/CollectionViewContainerRow.swift b/WordPress/Classes/ViewRelated/Plugins/CollectionViewContainerRow.swift index ba12b35ea476..83e02c8d9a60 100644 --- a/WordPress/Classes/ViewRelated/Plugins/CollectionViewContainerRow.swift +++ b/WordPress/Classes/ViewRelated/Plugins/CollectionViewContainerRow.swift @@ -219,6 +219,8 @@ class CollectionViewContainerCell: UITableViewCell { } override func prepareForReuse() { + super.prepareForReuse() + noResultsView?.removeFromView() noResultsView = nil } diff --git a/WordPress/Classes/ViewRelated/Post/EditPostViewController.swift b/WordPress/Classes/ViewRelated/Post/EditPostViewController.swift index 47531d14bb82..6c0d2acfee30 100644 --- a/WordPress/Classes/ViewRelated/Post/EditPostViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/EditPostViewController.swift @@ -115,6 +115,8 @@ class EditPostViewController: UIViewController { } override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + if !openWithPostPost && !hasShownEditor { showEditor() hasShownEditor = true diff --git a/WordPress/Classes/ViewRelated/Post/Revisions/Browser/RevisionsNavigationController.swift b/WordPress/Classes/ViewRelated/Post/Revisions/Browser/RevisionsNavigationController.swift index 51495061f80e..bcb5b6b9b1b4 100644 --- a/WordPress/Classes/ViewRelated/Post/Revisions/Browser/RevisionsNavigationController.swift +++ b/WordPress/Classes/ViewRelated/Post/Revisions/Browser/RevisionsNavigationController.swift @@ -6,6 +6,8 @@ class RevisionsNavigationController: UINavigationController { } override func viewDidLoad() { + super.viewDidLoad() + navigationBar.setBackgroundImage(UIImage(color: .neutral(.shade70)), for: .default) navigationBar.shadowImage = UIImage(color: .neutral(.shade60)) } diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailLikesListController.swift b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailLikesListController.swift index 56aefb9c2b78..139eaef87325 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailLikesListController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailLikesListController.swift @@ -20,6 +20,8 @@ class ReaderDetailLikesListController: UITableViewController, NoResultsViewHost // MARK: - View override func viewDidLoad() { + super.viewDidLoad() + configureViewTitle() configureTable() WPAnalytics.track(.likeListOpened, properties: ["list_type": "post", "source": "like_reader_list"]) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift index 18b7314fa24b..0c318c60b311 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift @@ -15,6 +15,8 @@ class ReaderWebView: WKWebView { /// Make the webview transparent /// override func awakeFromNib() { + super.awakeFromNib() + isOpaque = false backgroundColor = .clear } diff --git a/WordPress/Classes/ViewRelated/Reader/Tab Navigation/ReaderTabViewController.swift b/WordPress/Classes/ViewRelated/Reader/Tab Navigation/ReaderTabViewController.swift index 266722386cd0..5a2ef070bc2c 100644 --- a/WordPress/Classes/ViewRelated/Reader/Tab Navigation/ReaderTabViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Tab Navigation/ReaderTabViewController.swift @@ -172,6 +172,8 @@ extension ReaderTabViewController: UIViewControllerRestoration { } override func encodeRestorableState(with coder: NSCoder) { + super.encodeRestorableState(with: coder) + coder.encode(viewModel.selectedIndex, forKey: ReaderTabViewController.encodedIndexKey) } diff --git a/WordPress/Classes/ViewRelated/Site Creation/Site Intent/IntentCell.swift b/WordPress/Classes/ViewRelated/Site Creation/Site Intent/IntentCell.swift index 26281c7252c6..bf1061d39ae0 100644 --- a/WordPress/Classes/ViewRelated/Site Creation/Site Intent/IntentCell.swift +++ b/WordPress/Classes/ViewRelated/Site Creation/Site Intent/IntentCell.swift @@ -42,6 +42,8 @@ final class IntentCell: UITableViewCell, ModelSettableCell { } override func prepareForReuse() { + super.prepareForReuse() + title.text = nil emoji.text = nil } diff --git a/WordPress/Classes/ViewRelated/Site Creation/Site Segments/SiteSegmentsCell.swift b/WordPress/Classes/ViewRelated/Site Creation/Site Segments/SiteSegmentsCell.swift index 25feba0a378f..e1a0f5dee260 100644 --- a/WordPress/Classes/ViewRelated/Site Creation/Site Segments/SiteSegmentsCell.swift +++ b/WordPress/Classes/ViewRelated/Site Creation/Site Segments/SiteSegmentsCell.swift @@ -53,6 +53,8 @@ final class SiteSegmentsCell: UITableViewCell, ModelSettableCell { } override func prepareForReuse() { + super.prepareForReuse() + title.text = "" subtitle.text = "" icon.image = nil diff --git a/WordPress/Classes/ViewRelated/Site Creation/Web Address/AddressTableViewCell.swift b/WordPress/Classes/ViewRelated/Site Creation/Web Address/AddressTableViewCell.swift index 627b81c35fc1..fe4d74f6c239 100644 --- a/WordPress/Classes/ViewRelated/Site Creation/Web Address/AddressTableViewCell.swift +++ b/WordPress/Classes/ViewRelated/Site Creation/Web Address/AddressTableViewCell.swift @@ -269,6 +269,8 @@ extension AddressTableViewCell { } override func prepareForReuse() { + super.prepareForReuse() + update(with: nil as DomainSuggestion?) borders.forEach({ $0.removeFromSuperview() }) borders = [] diff --git a/WordPress/Classes/ViewRelated/Stats/Shared Views/StatsCellHeader.swift b/WordPress/Classes/ViewRelated/Stats/Shared Views/StatsCellHeader.swift index 568ff2871fde..ab773cf1e637 100644 --- a/WordPress/Classes/ViewRelated/Stats/Shared Views/StatsCellHeader.swift +++ b/WordPress/Classes/ViewRelated/Stats/Shared Views/StatsCellHeader.swift @@ -22,6 +22,8 @@ class StatsCellHeader: UITableViewCell, NibLoadable, Accessible { // MARK: - Configure override func awakeFromNib() { + super.awakeFromNib() + defaultStackViewTopConstraint = stackViewTopConstraint.constant defaultStackViewHeightConstraint = stackViewHeightConstraint.constant } diff --git a/WordPress/Classes/ViewRelated/System/BlurredEmptyViewController.swift b/WordPress/Classes/ViewRelated/System/BlurredEmptyViewController.swift index f0ae66649989..b38d13bc0b29 100644 --- a/WordPress/Classes/ViewRelated/System/BlurredEmptyViewController.swift +++ b/WordPress/Classes/ViewRelated/System/BlurredEmptyViewController.swift @@ -21,6 +21,8 @@ class BlurredEmptyViewController: UIViewController { // MARK: View Lifecycle override func viewDidLoad() { + super.viewDidLoad() + view.addSubview(visualEffectView) view.pinSubviewToAllEdges(visualEffectView) } From 2358871ba389cf455fc6b99897a6b25fa17048e2 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Fri, 23 Jun 2023 16:56:42 +1000 Subject: [PATCH 11/22] Update WordPress metadata translations --- fastlane/metadata/it/release_notes.txt | 5 +++++ fastlane/metadata/ko/release_notes.txt | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 fastlane/metadata/it/release_notes.txt create mode 100644 fastlane/metadata/ko/release_notes.txt diff --git a/fastlane/metadata/it/release_notes.txt b/fastlane/metadata/it/release_notes.txt new file mode 100644 index 000000000000..f046bfc2622e --- /dev/null +++ b/fastlane/metadata/it/release_notes.txt @@ -0,0 +1,5 @@ +Abbiamo rimosso un bug nei dispositivi con iOS 16 o versioni successive, per il quale la digitazione nell'editor a blocchi durante la dettatura causava la perdita del testo dettato. Meno male. + +Bloccato e caricato: è presente anche un'icona di blocco per le celle disattivate nell'editor a blocchi in modo da sapere quando non sono in uso. + +Infine, abbiamo aggiornato il testo dele segnaposto per i video VideoPress che non appartengono al tuo sito. (Speriamo che non si sentano esclusi.) diff --git a/fastlane/metadata/ko/release_notes.txt b/fastlane/metadata/ko/release_notes.txt new file mode 100644 index 000000000000..967268453d8d --- /dev/null +++ b/fastlane/metadata/ko/release_notes.txt @@ -0,0 +1,5 @@ +IOS 16 이상을 실행하는 기기에서 받아쓰기 중에 블록 편집기에 입력하면 받아쓰기한 텍스트가 손실되던 버그를 제거했습니다. 휴.↵ +↵ +잠금 및 로드됨 - 이제 블록 편집기에 비활성화된 셀에 잠금 아이콘이 표시되어 사용하지 않는 셀을 알 수 있습니다.↵ +↵ +마지막으로, 사이트에 속하지 않은 VideoPress 동영상의 플레이스홀더 텍스트를 업데이트했습니다. (소외감을 느끼지 않으시길 바랍니다.)↵ From 88229dcf0a672e5c87a2afe64c08ae5d8c93ffea Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Fri, 23 Jun 2023 16:56:49 +1000 Subject: [PATCH 12/22] Update Jetpack metadata translations --- fastlane/jetpack_metadata/it/release_notes.txt | 9 +++++++++ fastlane/jetpack_metadata/ja/release_notes.txt | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 fastlane/jetpack_metadata/it/release_notes.txt create mode 100644 fastlane/jetpack_metadata/ja/release_notes.txt diff --git a/fastlane/jetpack_metadata/it/release_notes.txt b/fastlane/jetpack_metadata/it/release_notes.txt new file mode 100644 index 000000000000..a2e57149e054 --- /dev/null +++ b/fastlane/jetpack_metadata/it/release_notes.txt @@ -0,0 +1,9 @@ +I piani WordPress.com saranno presto disponibili sull'app Jetpack. Ottieni il piano adatto alle tue esigenze editoriali e gestiscilo nella stessa postazione in cui scrivi tutte le tue più belle parole. + +È presente un nuovo fantastico pulsante "Personalizza la scheda Home" nella parte inferiore della bacheca del sito in cui puoi personalizzare le schede della bacheca visibili. (Vuoi nascondere le schede che non ti servono? Basta usare il menu "Altro".) + +Abbiamo rimosso un bug nei dispositivi con iOS 16 o versioni successive, per il quale la digitazione nell'editor a blocchi durante la dettatura causava la perdita del testo dettato. È presente anche un'icona di blocco per le celle disattivate nell'editor in modo da sapere quando non sono in uso. + +Nella schermata "Cerca domini", ora vedrai un messaggio di errore se scegli un dominio predefinito non supportato dal tuo sito. Niente più indicatore di stato che gira in continuazione. + +Infine, abbiamo aggiornato il testo dele segnaposto per i video VideoPress che non appartengono al tuo sito. (Speriamo che non si sentano esclusi.) diff --git a/fastlane/jetpack_metadata/ja/release_notes.txt b/fastlane/jetpack_metadata/ja/release_notes.txt new file mode 100644 index 000000000000..08f865090561 --- /dev/null +++ b/fastlane/jetpack_metadata/ja/release_notes.txt @@ -0,0 +1,9 @@ +WordPress.com プランが Jetpack アプリに導入されます。 投稿ニーズに適したプランを利用して、執筆する同じ場所で管理できます。 + +サイトのダッシュボード下部には、新しく「ホームタブのパーソナライズ」ボタンがあり、表示されるダッシュボードカードをカスタマイズできます (不要なカードを非表示にする場合は、 「続き」メニューを使用します)。 + +iOS 16以降を実行している端末で、ディクテーション中にブロックエディターに入力するとディクテーションされたテキストが失われるというバグを削除しました。 エディターで無効化されたセルに錠のアイコンが表示されるため、セルが使用されないことがわかります。 + +「ドメインを検索」画面では、サイトでサポートされていないデフォルトのドメインを選択すると、エラーメッセージが表示されるようになりました。 今後進行状況ホイールがいつまでも回り続けることはありません。 + +最後に、サイトに属さない VideoPress 動画のプレースホルダーテキストを更新しました (この更新を気に入っていただければ幸いです)。 From 5363705cb17d845455410997d8651625937974f9 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Fri, 23 Jun 2023 16:57:02 +1000 Subject: [PATCH 13/22] Bump version number --- config/Version.internal.xcconfig | 2 +- config/Version.public.xcconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/Version.internal.xcconfig b/config/Version.internal.xcconfig index e603e643d906..21d2f0e180e4 100644 --- a/config/Version.internal.xcconfig +++ b/config/Version.internal.xcconfig @@ -1,4 +1,4 @@ VERSION_SHORT=22.6 // Internal long version example: VERSION_LONG=9.9.0.20180423 -VERSION_LONG=22.6.0.20230622 +VERSION_LONG=22.6.0.20230623 diff --git a/config/Version.public.xcconfig b/config/Version.public.xcconfig index dddde6980460..8b76bd6ca21a 100644 --- a/config/Version.public.xcconfig +++ b/config/Version.public.xcconfig @@ -1,4 +1,4 @@ VERSION_SHORT=22.6 // Public long version example: VERSION_LONG=9.9.0.0 -VERSION_LONG=22.6.0.2 +VERSION_LONG=22.6.0.3 From df561e20b18068867eaf58a9c7627d84421d5ed6 Mon Sep 17 00:00:00 2001 From: David Christiandy <1299411+dvdchr@users.noreply.github.com> Date: Fri, 23 Jun 2023 16:15:04 +0700 Subject: [PATCH 14/22] Remove unused padding on the disclosure image --- .../Classes/ViewRelated/Comments/CommentTableHeaderView.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift b/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift index 9e03a381ae47..0cdfbbf15e91 100644 --- a/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift +++ b/WordPress/Classes/ViewRelated/Comments/CommentTableHeaderView.swift @@ -137,7 +137,6 @@ private struct CommentHeaderView: View { .foregroundColor(Color(.secondaryLabel)) .font(.caption.weight(.semibold)) .imageScale(.large) - .padding(.zero) } } From a92bccaab661aeca2e8339258c3916d4c7f496e7 Mon Sep 17 00:00:00 2001 From: Salim Date: Sat, 24 Jun 2023 00:04:02 +0100 Subject: [PATCH 15/22] Implement action to redirect the user to Privacy Settings screen (#20815) --- .../Extensions/CATransaction+Extension.swift | 11 ++ ...tViewPresenter+AppSettingsNavigation.swift | 144 ++++++++++++++++++ .../RootViewPresenter+MeNavigation.swift | 20 ++- .../AppSettingsViewController.swift | 17 ++- WordPress/WordPress.xcodeproj/project.pbxproj | 12 ++ 5 files changed, 192 insertions(+), 12 deletions(-) create mode 100644 WordPress/Classes/Extensions/CATransaction+Extension.swift create mode 100644 WordPress/Classes/System/RootViewPresenter+AppSettingsNavigation.swift diff --git a/WordPress/Classes/Extensions/CATransaction+Extension.swift b/WordPress/Classes/Extensions/CATransaction+Extension.swift new file mode 100644 index 000000000000..197cf64a160d --- /dev/null +++ b/WordPress/Classes/Extensions/CATransaction+Extension.swift @@ -0,0 +1,11 @@ +import UIKit + +extension CATransaction { + + static func perform(block: () -> Void, completion: @escaping () -> Void) { + CATransaction.begin() + CATransaction.setCompletionBlock(completion) + block() + CATransaction.commit() + } +} diff --git a/WordPress/Classes/System/RootViewPresenter+AppSettingsNavigation.swift b/WordPress/Classes/System/RootViewPresenter+AppSettingsNavigation.swift new file mode 100644 index 000000000000..f237ed9b3416 --- /dev/null +++ b/WordPress/Classes/System/RootViewPresenter+AppSettingsNavigation.swift @@ -0,0 +1,144 @@ +import UIKit + +extension RootViewPresenter { + + /// Navigates to "Me > App Settings > Privacy Settings" + func navigateToPrivacySettings() { + navigateToMeScene() + .then(navigateToAppSettings()) + .then(navigateToPrivacySettings()) + .start(on: rootViewController, animated: true) + } + + // MARK: - Navigators + + /// Creates a navigation action to navigate to the "Me" scene. + /// + /// The "Me" scene's navigation controller is popped to the root in case the "Me" scene was already presented. + private func navigateToMeScene() -> ViewControllerNavigationAction { + return .init { [weak self] context, completion in + guard let self else { + return + } + self.showMeScene(animated: context.animated) { meViewController in + self.popMeTabToRoot() + completion(meViewController) + } + } + } + + /// Creates a navigation action to navigate to the "App Settings" from the "Me" scene. + private func navigateToAppSettings() -> ViewControllerNavigationAction { + return .init { context, completion in + let me: MeViewController = try context.fromViewController() + CATransaction.perform { + me.navigateToAppSettings() + } completion: { + completion(me.navigationController?.topViewController) + } + } + } + + /// Creates a navigation action to navigate to the "Privacy Settings" from the "App Settings" scene. + private func navigateToPrivacySettings() -> ViewControllerNavigationAction { + return .init { context, completion in + let appSettings: AppSettingsViewController = try context.fromViewController() + appSettings.navigateToPrivacySettings(animated: context.animated) { privacySettings in + completion(privacySettings) + } + } + } +} + +// MARK: - Private Tools + +/// `ViewControllerNavigationAction` encapsulates a navigation action performed on a view controller. +/// It includes the capability to chain these actions together to perform a sequence of navigations. +/// This sequence is internally represented as a linked list where each node represents a navigation action. +/// The `then` method is used to chain navigation actions, and the `start` method initiates the sequence. +private class ViewControllerNavigationAction { + + /// Reference to the first navigation action. It also represents the first node in a Linked List. + private var first: ViewControllerNavigationAction? + + /// Reference to the next navigation action. It is called when the current one is complete. + private var next: ViewControllerNavigationAction? + + /// The navigation action to perform. + private let action: Action + + /// Initializes the navigation with an action to perform. + init(action: @escaping Action) { + self.action = action + } + + /// Assigns the next action to perform. + @discardableResult func then(_ navigator: ViewControllerNavigationAction) -> ViewControllerNavigationAction { + self.next = navigator + self.next?.first = first ?? self + return navigator + } + + /// Convenience method to start the navigation flow from the first navigator in the chain. + func start(on rootViewController: UIViewController, animated: Bool = true) { + let context = Context(animated: animated, sourceViewController: rootViewController) + let navigator = first ?? self + navigator.perform(with: context) + } + + /// Performs the navigation action, then calls the next navigation action. + private func perform(with context: Context) { + do { + try self.action(context) { presented in + if let next = self.next, let presented { + let context = Context(animated: context.animated, sourceViewController: presented) + next.perform(with: context) + } else { + self.free() + } + } + } catch { + DDLogError("Failed to perform navigation action with error: \(error.localizedDescription)") + self.free() + } + } + + /// Recursively nullifies the `next`, `first`references of all nodes in the Linked List. + /// + /// This method must be called at the end of the navigation to prevent memory leaks. + private func free() { + if let first { + first.free() + return + } + let next = self.next + self.next = nil + self.first = nil + next?.first = nil + next?.free() + } + + // MARK: Types + + typealias Action = (Context, @escaping Completion) throws -> Void + typealias Completion = (UIViewController?) -> Void +} + +extension ViewControllerNavigationAction { + + /// `Context` provides the necessary data for a navigation action, including whether + /// the navigation is animated and the view controller initiating the navigation. + struct Context { + + let animated: Bool + + fileprivate let sourceViewController: UIViewController + + func fromViewController() throws -> T { + guard let sourceVC = self.sourceViewController as? T else { + throw NSError(domain: "ViewControllerNavigationActionCastError", code: 1) + } + return sourceVC + } + } +} diff --git a/WordPress/Classes/System/RootViewPresenter+MeNavigation.swift b/WordPress/Classes/System/RootViewPresenter+MeNavigation.swift index 4802dcad485f..bc0e28cb60d0 100644 --- a/WordPress/Classes/System/RootViewPresenter+MeNavigation.swift +++ b/WordPress/Classes/System/RootViewPresenter+MeNavigation.swift @@ -6,30 +6,34 @@ extension RootViewPresenter { func popMeTabToRoot() { getNavigationController()?.popToRootViewController(animated: false) } + /// presents the Me scene. If the feature flag is disabled, replaces the previously defined `showMeTab` - func showMeScene(animated: Bool = true, completion: (() -> Void)? = nil) { + func showMeScene(animated: Bool = true, completion: ((MeViewController?) -> Void)? = nil) { let meScenePresenter = getMeScenePresenter() - meScenePresenter.present(on: rootViewController, animated: animated, completion: completion) + meScenePresenter.present(on: rootViewController, animated: animated) { [weak self] in + completion?(self?.getMeViewController()) + } } + /// access to sub levels func navigateToAccountSettings() { - showMeScene(animated: false) { + showMeScene(animated: false) { meViewController in self.popMeTabToRoot() - self.getMeViewController()?.navigateToAccountSettings() + meViewController?.navigateToAccountSettings() } } func navigateToAppSettings() { - showMeScene() { + showMeScene() { meViewController in self.popMeTabToRoot() - self.getMeViewController()?.navigateToAppSettings() + meViewController?.navigateToAppSettings() } } func navigateToSupport() { - showMeScene() { + showMeScene() { meViewController in self.popMeTabToRoot() - self.getMeViewController()?.navigateToHelpAndSupport() + meViewController?.navigateToHelpAndSupport() } } diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift b/WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift index 7a9febfee0e5..7ef5437bca10 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift @@ -134,6 +134,18 @@ class AppSettingsViewController: UITableViewController { } } + // MARK: - Navigation + + func navigateToPrivacySettings(animated: Bool = true, completion: ((PrivacySettingsViewController) -> Void)? = nil) { + let destination = PrivacySettingsViewController(style: .insetGrouped) + CATransaction.perform { + self.navigationController?.pushViewController(destination, animated: animated) + WPAnalytics.track(.privacySettingsOpened) + } completion: { + completion?(destination) + } + } + // MARK: - Actions @objc func imageSizeChanged() -> (Int) -> Void { @@ -267,10 +279,7 @@ class AppSettingsViewController: UITableViewController { func openPrivacySettings() -> ImmuTableAction { return { [weak self] _ in - WPAnalytics.track(.privacySettingsOpened) - - let controller = PrivacySettingsViewController(style: .insetGrouped) - self?.navigationController?.pushViewController(controller, animated: true) + self?.navigateToPrivacySettings(animated: true) } } diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 98867169c23e..cda319bef51e 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -3653,6 +3653,10 @@ F478B152292FC1BC00AA8645 /* MigrationAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = F478B151292FC1BC00AA8645 /* MigrationAppearance.swift */; }; F47E154A29E84A9300B6E426 /* DomainPurchasingWebFlowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47E154929E84A9300B6E426 /* DomainPurchasingWebFlowController.swift */; }; F47E154B29E84A9300B6E426 /* DomainPurchasingWebFlowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F47E154929E84A9300B6E426 /* DomainPurchasingWebFlowController.swift */; }; + F484D4EA2A32B51C0050BE15 /* RootViewPresenter+AppSettingsNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F484D4E92A32B51C0050BE15 /* RootViewPresenter+AppSettingsNavigation.swift */; }; + F484D4EB2A32B51C0050BE15 /* RootViewPresenter+AppSettingsNavigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F484D4E92A32B51C0050BE15 /* RootViewPresenter+AppSettingsNavigation.swift */; }; + F484D4ED2A32C4520050BE15 /* CATransaction+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F484D4EC2A32C4520050BE15 /* CATransaction+Extension.swift */; }; + F484D4EE2A32C4520050BE15 /* CATransaction+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F484D4EC2A32C4520050BE15 /* CATransaction+Extension.swift */; }; F48D44B6298992C30051EAA6 /* BlockedSite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48D44B5298992C30051EAA6 /* BlockedSite.swift */; }; F48D44BA2989A58C0051EAA6 /* ReaderSiteService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48D44B92989A58C0051EAA6 /* ReaderSiteService.swift */; }; F48D44BB2989A9070051EAA6 /* ReaderSiteService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48D44B92989A58C0051EAA6 /* ReaderSiteService.swift */; }; @@ -9035,6 +9039,8 @@ F465980728E66A5B00D5F49A /* white-on-blue-icon-app-83.5@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "white-on-blue-icon-app-83.5@2x.png"; sourceTree = ""; }; F478B151292FC1BC00AA8645 /* MigrationAppearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MigrationAppearance.swift; sourceTree = ""; }; F47E154929E84A9300B6E426 /* DomainPurchasingWebFlowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainPurchasingWebFlowController.swift; sourceTree = ""; }; + F484D4E92A32B51C0050BE15 /* RootViewPresenter+AppSettingsNavigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RootViewPresenter+AppSettingsNavigation.swift"; sourceTree = ""; }; + F484D4EC2A32C4520050BE15 /* CATransaction+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CATransaction+Extension.swift"; sourceTree = ""; }; F48D44B5298992C30051EAA6 /* BlockedSite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockedSite.swift; sourceTree = ""; }; F48D44B7298993900051EAA6 /* WordPress 147.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "WordPress 147.xcdatamodel"; sourceTree = ""; }; F48D44B92989A58C0051EAA6 /* ReaderSiteService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderSiteService.swift; sourceTree = ""; }; @@ -13128,6 +13134,7 @@ 803BB97F295957CF00B3F6D6 /* WPTabBarController+RootViewPresenter.swift */, 803BB982295957F600B3F6D6 /* MySitesCoordinator+RootViewPresenter.swift */, 80A2153C29C35197002FE8EB /* StaticScreensTabBarWrapper.swift */, + F484D4E92A32B51C0050BE15 /* RootViewPresenter+AppSettingsNavigation.swift */, ); name = "Root View"; sourceTree = ""; @@ -15206,6 +15213,7 @@ C7AFF873283C0ADC000E01DF /* UIApplication+Helpers.swift */, C3AB4878292F114A001F7AF8 /* UIApplication+AppAvailability.swift */, F49D7BEA29DF329500CB93A5 /* UIPopoverPresentationController+PopoverAnchor.swift */, + F484D4EC2A32C4520050BE15 /* CATransaction+Extension.swift */, ); path = Extensions; sourceTree = ""; @@ -21169,6 +21177,7 @@ B526DC291B1E47FC002A8C5F /* WPStyleGuide+WebView.m in Sources */, F49B9A0029393049000CEFCE /* MigrationAppDetection.swift in Sources */, 3F6DA04125646F96002AB88F /* HomeWidgetData.swift in Sources */, + F484D4EA2A32B51C0050BE15 /* RootViewPresenter+AppSettingsNavigation.swift in Sources */, B089140D27E1255D00CF468B /* SiteIntentViewController.swift in Sources */, 82FC61271FA8ADAD00A1757E /* WPStyleGuide+Activity.swift in Sources */, 98BFF57E23984345008A1DCB /* AllTimeWidgetStats.swift in Sources */, @@ -22389,6 +22398,7 @@ FAD7625B29ED780B00C09583 /* JSONDecoderExtension.swift in Sources */, C81CCD83243BF7A600A83E27 /* TenorDataLoader.swift in Sources */, 98797DBC222F434500128C21 /* OverviewCell.swift in Sources */, + F484D4ED2A32C4520050BE15 /* CATransaction+Extension.swift in Sources */, C3BC86F629528997005D1A01 /* PeopleViewController+JetpackBannerViewController.swift in Sources */, 1749965F2271BF08007021BD /* WordPressAppDelegate.swift in Sources */, 5DA3EE161925090A00294E0B /* MediaService.m in Sources */, @@ -24770,6 +24780,7 @@ FABB23C92602FC2C00C8785C /* JetpackState.swift in Sources */, FABB23CA2602FC2C00C8785C /* EditPostViewController.swift in Sources */, 0141929D2983F0A300CAEDB0 /* SupportConfiguration.swift in Sources */, + F484D4EB2A32B51C0050BE15 /* RootViewPresenter+AppSettingsNavigation.swift in Sources */, FABB23CB2602FC2C00C8785C /* PostListFilter.swift in Sources */, FABB23CC2602FC2C00C8785C /* MediaThumbnailExporter.swift in Sources */, C79C307C26EA915100E88514 /* ReferrerDetailsTableViewController.swift in Sources */, @@ -25292,6 +25303,7 @@ FABB254A2602FC2C00C8785C /* SharePost.swift in Sources */, FABB254B2602FC2C00C8785C /* RoleViewController.swift in Sources */, FABB254C2602FC2C00C8785C /* SiteAddressService.swift in Sources */, + F484D4EE2A32C4520050BE15 /* CATransaction+Extension.swift in Sources */, FABB254D2602FC2C00C8785C /* WPStyleGuide+Notifications.swift in Sources */, FABB254E2602FC2C00C8785C /* SettingTableViewCell.m in Sources */, FABB254F2602FC2C00C8785C /* CountriesMapView.swift in Sources */, From 2769fc0c7d9bcb8872143b0cfc667630b16e87d8 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 26 Jun 2023 08:37:30 +1000 Subject: [PATCH 16/22] Bump version number --- config/Version.internal.xcconfig | 4 ++-- config/Version.public.xcconfig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/Version.internal.xcconfig b/config/Version.internal.xcconfig index 21d2f0e180e4..be4a5fc92397 100644 --- a/config/Version.internal.xcconfig +++ b/config/Version.internal.xcconfig @@ -1,4 +1,4 @@ -VERSION_SHORT=22.6 +VERSION_SHORT=22.7 // Internal long version example: VERSION_LONG=9.9.0.20180423 -VERSION_LONG=22.6.0.20230623 +VERSION_LONG=22.7.0.20230626 diff --git a/config/Version.public.xcconfig b/config/Version.public.xcconfig index 8b76bd6ca21a..adac3fd6a008 100644 --- a/config/Version.public.xcconfig +++ b/config/Version.public.xcconfig @@ -1,4 +1,4 @@ -VERSION_SHORT=22.6 +VERSION_SHORT=22.7 // Public long version example: VERSION_LONG=9.9.0.0 -VERSION_LONG=22.6.0.3 +VERSION_LONG=22.7.0.0 From ec3f14c87e18b7d39fd8501d428dd07d57e96f04 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 26 Jun 2023 08:37:30 +1000 Subject: [PATCH 17/22] Update draft release notes for 22.7. --- WordPress/Resources/release_notes.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/WordPress/Resources/release_notes.txt b/WordPress/Resources/release_notes.txt index 789e1a83bd20..637ca793c29c 100644 --- a/WordPress/Resources/release_notes.txt +++ b/WordPress/Resources/release_notes.txt @@ -1,5 +1,7 @@ -We removed a bug in devices running iOS 16 or later, where typing in the block editor while dictating caused the dictated text to be lost. Phew. +* [**] [internal] Blaze: Switch to using new canBlaze property to determine Blaze eligiblity. [#20916] +* [**] Fixed crash issue when accessing drafts that are mid-upload from the Home 'Work on a Draft Post' card. [#20872] +* [**] [internal] Make sure media-related features function correctly. [#20889], [20887] +* [*] [internal] Posts list: Disable action bar/menu button when a post is being uploaded [#20885] +* [*] Block editor: Image block - Fix issue where in some cases the image doesn't display the right aspect ratio [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5869] +* [*] Block editor: Fix cursor positioning when dictating text on iOS [https://github.com/WordPress/gutenberg/issues/51227] -Locked and loaded—there’s now a lock icon for disabled cells in the block editor so you know when they aren’t in use. - -Finally, we updated the placeholder text for VideoPress videos that don’t belong to your site. (Hopefully they don’t feel left out.) From b63bc728c6875cd12238cd6a3f0d9fba3f98c495 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 26 Jun 2023 08:37:30 +1000 Subject: [PATCH 18/22] Update draft release notes for 22.7. --- WordPress/Jetpack/Resources/release_notes.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/WordPress/Jetpack/Resources/release_notes.txt b/WordPress/Jetpack/Resources/release_notes.txt index 41327b4958f5..637ca793c29c 100644 --- a/WordPress/Jetpack/Resources/release_notes.txt +++ b/WordPress/Jetpack/Resources/release_notes.txt @@ -1,9 +1,7 @@ -WordPress.com plans are coming to the Jetpack app. Get the plan that’s right for your publishing needs and manage it in the same place you write all your best words. +* [**] [internal] Blaze: Switch to using new canBlaze property to determine Blaze eligiblity. [#20916] +* [**] Fixed crash issue when accessing drafts that are mid-upload from the Home 'Work on a Draft Post' card. [#20872] +* [**] [internal] Make sure media-related features function correctly. [#20889], [20887] +* [*] [internal] Posts list: Disable action bar/menu button when a post is being uploaded [#20885] +* [*] Block editor: Image block - Fix issue where in some cases the image doesn't display the right aspect ratio [https://github.com/wordpress-mobile/gutenberg-mobile/pull/5869] +* [*] Block editor: Fix cursor positioning when dictating text on iOS [https://github.com/WordPress/gutenberg/issues/51227] -There’s a shiny new “Personalize Home Tab” button at the bottom of your site dashboard where you can customize your visible dashboard cards. (Want to hide the cards you don’t need? Just use the “More” menu.) - -We removed a bug in devices running iOS 16 or later, where typing in the block editor while dictating caused the dictated text to be lost. There’s also a lock icon for disabled cells in the editor so you know when they aren’t in use. - -On the “Search domains” screen, you’ll now see an error message if you choose a default domain that isn’t supported by your site. No more forever-spinning progress wheel. - -Finally, we updated the placeholder text for VideoPress videos that don’t belong to your site. (Hopefully they don’t feel left out.) From 78e8c88aed934b7d796be7d338f6f965bb667aa0 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 26 Jun 2023 08:37:31 +1000 Subject: [PATCH 19/22] Release Notes: add new section for next version (22.8) --- RELEASE-NOTES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index b7c2331996f4..811221163b1e 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,3 +1,7 @@ +22.8 +----- + + 22.7 ----- * [**] [internal] Blaze: Switch to using new canBlaze property to determine Blaze eligiblity. [#20916] From fc37aacc1d4720132840bd8615cdc58a19ab4817 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 26 Jun 2023 09:02:26 +1000 Subject: [PATCH 20/22] Remove a couple of dead references from the project file A leftover from 50ba522dab --- WordPress/WordPress.xcodeproj/project.pbxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index cda319bef51e..7aaef471f0e9 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -18094,8 +18094,6 @@ FE43DAAD26DFAD1C00CFF595 /* CommentContentTableViewCell.swift */, FE43DAAE26DFAD1C00CFF595 /* CommentContentTableViewCell.xib */, FEA7948C26DD136700CEC520 /* CommentHeaderTableViewCell.swift */, - 9839CEB926FAA0510097406E /* CommentModerationBar.swift */, - 98F9FB2D270282C100ADF552 /* CommentModerationBar.xib */, FE50965B2A20D0F300DDD071 /* CommentTableHeaderView.swift */, ); name = Detail; From d2889441e7534980b00b007fc6d649655de87639 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 26 Jun 2023 09:03:03 +1000 Subject: [PATCH 21/22] Use production versions of internal pods for release 22.6 Notice that the Sentry pods have updated, too. This was a result of updating Tracks. I consider it valuable to use the latest Sentry version to give ourselves the best chances of sending as up-to-date data as possible to their backend. --- Podfile | 4 ++-- Podfile.lock | 33 ++++++++++++++------------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/Podfile b/Podfile index 221e4666d016..a3b0285d7bae 100644 --- a/Podfile +++ b/Podfile @@ -23,9 +23,9 @@ workspace 'WordPress.xcworkspace' ## =================================== ## def wordpress_shared - # pod 'WordPressShared', '~> 2.0-beta' + pod 'WordPressShared', '~> 2.2-beta' # pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', tag: '' - pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', branch: 'trunk' + # pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', branch: 'trunk' # pod 'WordPressShared', git: 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', commit: '' # pod 'WordPressShared', path: '../WordPress-iOS-Shared' end diff --git a/Podfile.lock b/Podfile.lock index 7060c7cca705..606137ac1bd2 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -490,12 +490,12 @@ PODS: - SDWebImageWebPCoder (0.8.5): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.10) - - Sentry (8.6.0): - - Sentry/Core (= 8.6.0) - - SentryPrivate (= 8.6.0) - - Sentry/Core (8.6.0): - - SentryPrivate (= 8.6.0) - - SentryPrivate (8.6.0) + - Sentry (8.8.0): + - Sentry/Core (= 8.8.0) + - SentryPrivate (= 8.8.0) + - Sentry/Core (8.8.0): + - SentryPrivate (= 8.8.0) + - SentryPrivate (8.8.0) - Sodium (0.9.1) - Starscream (3.0.6) - SVProgressHUD (2.2.5) @@ -512,7 +512,7 @@ PODS: - WordPressKit (~> 8.0-beta) - WordPressShared (~> 2.1-beta) - WordPressUI (~> 1.7-beta) - - WordPressKit (8.4.0-beta.1): + - WordPressKit (8.4.0): - Alamofire (~> 4.8.0) - NSObject-SafeExpectations (~> 0.0.4) - UIDeviceIdentifier (~> 2.0) @@ -613,7 +613,7 @@ DEPENDENCIES: - WordPress-Editor-iOS (~> 1.19.8) - WordPressAuthenticator (~> 6.1-beta) - WordPressKit (~> 8.4-beta) - - WordPressShared (from `https://github.com/wordpress-mobile/WordPress-iOS-Shared.git`, branch `trunk`) + - WordPressShared (~> 2.2-beta) - WordPressUI (~> 1.12.5) - WPMediaPicker (~> 1.8-beta) - Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.98.0/third-party-podspecs/Yoga.podspec.json`) @@ -623,6 +623,7 @@ DEPENDENCIES: SPEC REPOS: https://github.com/wordpress-mobile/cocoapods-specs.git: - WordPressAuthenticator + - WordPressKit trunk: - Alamofire - AlamofireImage @@ -661,7 +662,7 @@ SPEC REPOS: - UIDeviceIdentifier - WordPress-Aztec-iOS - WordPress-Editor-iOS - - WordPressKit + - WordPressShared - WordPressUI - WPMediaPicker - wpxmlrpc @@ -776,9 +777,6 @@ EXTERNAL SOURCES: :git: https://github.com/wordpress-mobile/gutenberg-mobile.git :submodules: true :tag: v1.98.0 - WordPressShared: - :branch: trunk - :git: https://github.com/wordpress-mobile/WordPress-iOS-Shared.git Yoga: :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.98.0/third-party-podspecs/Yoga.podspec.json @@ -794,9 +792,6 @@ CHECKOUT OPTIONS: :git: https://github.com/wordpress-mobile/gutenberg-mobile.git :submodules: true :tag: v1.98.0 - WordPressShared: - :commit: 9a010fdab8d31f9e1fa0511f231e7068ef0170b1 - :git: https://github.com/wordpress-mobile/WordPress-iOS-Shared.git SPEC CHECKSUMS: Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844 @@ -875,8 +870,8 @@ SPEC CHECKSUMS: RNTAztecView: 6362ed78bcf0c68a2a0e25b779a84ad7096c9ecf SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d - Sentry: d80553ff85ea72def75b792aaa5a71c158e51595 - SentryPrivate: ef1c5b3dfe44ec0c70e2eb343a5be2689164c021 + Sentry: 927dfb29d18a14d924229a59cc2ad149f43349f2 + SentryPrivate: 4350d865f898224ab9fa02b37d6ee7fbb623f47e Sodium: 23d11554ecd556196d313cf6130d406dfe7ac6da Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5 SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 @@ -885,7 +880,7 @@ SPEC CHECKSUMS: WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504 WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345 WordPressAuthenticator: b0b900696de5129a215adcd1e9ae6eb89da36ac8 - WordPressKit: 45b04f55d471f1edde248b84614d3208b9e2e88a + WordPressKit: f445e6fc3c63ddf611513a435408f86fdf3808b3 WordPressShared: 87f3ee89b0a3e83106106f13a8b71605fb8eb6d2 WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac WPMediaPicker: 0d40b8d66b6dfdaa2d6a41e3be51249ff5898775 @@ -900,6 +895,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37 -PODFILE CHECKSUM: 3f47ee0c345c8439e137d677752d9c4166d2c695 +PODFILE CHECKSUM: 623e3fe64f67d2c0352e26d1ac2bcd58c06b3494 COCOAPODS: 1.12.1 From 864af5c758fe10944693451ddbf05485b8f12932 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Mon, 26 Jun 2023 09:05:53 +1000 Subject: [PATCH 22/22] Update strings for localization --- .../Resources/en.lproj/Localizable.strings | 133 +++++++++++++----- 1 file changed, 96 insertions(+), 37 deletions(-) diff --git a/WordPress/Resources/en.lproj/Localizable.strings b/WordPress/Resources/en.lproj/Localizable.strings index 6187534383d0..863ed3860a00 100644 --- a/WordPress/Resources/en.lproj/Localizable.strings +++ b/WordPress/Resources/en.lproj/Localizable.strings @@ -1231,11 +1231,35 @@ "blazeCampaign.status.active" = "Active"; /* Short status description */ -"blazeCampaign.status.finished" = "Scheduled"; +"blazeCampaign.status.approved" = "Approved"; + +/* Short status description */ +"blazeCampaign.status.canceled" = "Canceled"; + +/* Short status description */ +"blazeCampaign.status.completed" = "Completed"; + +/* Short status description */ +"blazeCampaign.status.created" = "Created"; + +/* Short status description */ +"blazeCampaign.status.inmoderation" = "In Moderation"; /* Short status description */ "blazeCampaign.status.rejected" = "Rejected"; +/* Short status description */ +"blazeCampaign.status.scheduled" = "Scheduled"; + +/* Title for budget stats view */ +"blazeCampaigns.budget" = "Budget"; + +/* Title for impressions stats view */ +"blazeCampaigns.clicks" = "Clicks"; + +/* Title for impressions stats view */ +"blazeCampaigns.impressions" = "Impressions"; + /* translators: displayed right after the block is copied. */ "Block copied" = "Block copied"; @@ -1541,9 +1565,6 @@ /* Title of button that takes user to the system Settings section for the app */ "Change Settings" = "Change Settings"; -/* Title of an alert prompting the user that they are about to change the blog they are posting to. */ -"Change Site" = "Change Site"; - /* Change site icon button */ "Change Site Icon" = "Change Site Icon"; @@ -1716,9 +1737,6 @@ /* Reader select interests subtitle label text */ "Choose your topics" = "Choose your topics"; -/* And alert message warning the user they will loose blog specific edits like categories, and media if they change the blog being posted to. */ -"Choosing a different site will lose edits to site specific content like media and categories. Are you sure?" = "Choosing a different site will lose edits to site specific content like media and categories. Are you sure?"; - /* Register Domain - Address information field City */ "City" = "City"; @@ -1852,6 +1870,20 @@ /* Hint for users to grow their audience by commenting on other blogs. */ "Comment to start making connections." = "Comment to start making connections."; +/* Sentence fragment. +The full phrase is 'Comments on' followed by the title of the post on a separate line. */ +"comment.header.subText.commentThread" = "Comments on"; + +/* Provides a hint that the current screen displays a comment on a post. +The title of the post will be displayed below this text. +Example: Comment on \n My First Post */ +"comment.header.subText.post" = "Comment on"; + +/* Provides a hint that the current screen displays a reply to a comment. +%1$@ is a placeholder for the comment author's name that's been replied to. +Example: Reply to Pamela Nguyen */ +"comment.header.subText.reply" = "Reply to %1$@"; + /* A tip displayed to the user in the stats section to help them gain more followers. */ "Commenting on other blogs is a great way to build attention and followers for your new site." = "Commenting on other blogs is a great way to build attention and followers for your new site."; @@ -1938,6 +1970,26 @@ /* The Quick Start Tour title after the user finished the step. */ "Completed: View your site" = "Completed: View your site"; +/* Footnote for the privacy compliance popover. */ +"compliance.analytics.popover.footnote" = "These cookies allow us to optimize performance by collecting +information on how users interact with our websites."; + +/* Save Button Title for the privacy compliance popover. */ +"compliance.analytics.popover.save.button" = "Save"; + +/* Settings Button Title for the privacy compliance popover. */ +"compliance.analytics.popover.settings.button" = "Go to Settings"; + +/* Subtitle for the privacy compliance popover. */ +"compliance.analytics.popover.subtitle" = "We process your personal data to optimize our website and +marketing activities based on your consent and our legitimate interest."; + +/* Title for the privacy compliance popover. */ +"compliance.analytics.popover.title" = "Manage privacy"; + +/* Toggle Title for the privacy compliance popover. */ +"compliance.analytics.popover.toggle" = "Analytics"; + /* Section title for the configure table section in the blog details screen */ "Configure" = "Configure"; @@ -3973,8 +4025,7 @@ /* Appended to latest post summary text when the post has data. */ "Here's how the post performed so far." = "Here's how the post performed so far."; -/* Accessibility value if login page's password field is hiding the password (i.e. with asterisks). - Text for privacy settings: Hidden */ +/* Accessibility value if login page's password field is hiding the password (i.e. with asterisks). */ "Hidden" = "Hidden"; /* Hides a site from the site picker list @@ -5928,9 +5979,6 @@ Please install the %3$@ to use the app with this site."; /* This is one of the buttons we display when prompting the user for a review */ "notifications.appRatings.sendFeedback.yes.buttonTitle" = "Send feedback"; -/* Dismiss the alert with instructions on how to enable push notifications. */ -"notificationSettingStreams.pushNotificationAlert.dismissButton" = "Dismiss"; - /* Title of button to navigate to the next screen of the blogging reminders flow, setting up push notifications. */ "Notify me" = "Notify me"; @@ -6026,6 +6074,7 @@ Please install the %3$@ to use the app with this site."; /* An informal exclaimation that means `something went wrong`. Title for the view when there's an error loading a comment. Title for the view when there's an error loading Activity Log + Title for the view when there's an error loading Blaze campiagns. Title for the view when there's an error loading blogging prompts. Title for the view when there's an error loading scan status Title for the view when there's an error loading the history @@ -6729,8 +6778,7 @@ Please install the %3$@ to use the app with this site."; "Primary site address" = "Primary site address"; /* Label for the privacy setting - Privacy settings section header - Title for screen to select the privacy options for a blog */ + Privacy settings section header */ "Privacy" = "Privacy"; /* No comment provided by engineer. */ @@ -6751,7 +6799,6 @@ Please install the %3$@ to use the app with this site."; /* Name for the status of a post that is marked private. Privacy setting for posts set to 'Private'. Should be the same as in core WP. - Text for privacy settings: Private Title of the Private Badge */ "Private" = "Private"; @@ -6796,8 +6843,7 @@ Please install the %3$@ to use the app with this site."; /* Title of the notification when prompts are hidden from the dashboard card */ "prompts.notification.removed.title" = "Blogging Prompts hidden"; -/* Privacy setting for posts set to 'Public' (default). Should be the same as in core WP. - Text for privacy settings: Public */ +/* Privacy setting for posts set to 'Public' (default). Should be the same as in core WP. */ "Public" = "Public"; /* Button shown when the author is asked for publishing confirmation. @@ -6863,9 +6909,6 @@ Please install the %3$@ to use the app with this site."; /* Mobile Push Notifications */ "Push Notifications" = "Push Notifications"; -/* Displayed when Push Notifications are disabled (iOS 7) */ -"Push Notifications have been turned off in iOS Settings" = "Push Notifications have been turned off in iOS Settings"; - /* Suggests to enable Push Notification Settings in Settings.app */ "Push Notifications have been turned off in iOS Settings App. Toggle \"Allow Notifications\" to turn them back on." = "Push Notifications have been turned off in iOS Settings App. Toggle \"Allow Notifications\" to turn them back on."; @@ -7285,6 +7328,9 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Share extension error dialog cancel button text */ "Return to post" = "Return to post"; +/* No comment provided by engineer. */ +"Reusable" = "Reusable"; + /* Cancels a pending Email Change */ "Revert Pending Change" = "Revert Pending Change"; @@ -8008,12 +8054,39 @@ Example: given a notice format "Following %@" and empty site name, this will be /* A suggestion of topics the user might */ "Sites to follow" = "Sites to follow"; +/* Title for screen to select the privacy options for a blog */ +"siteSettings.privacy.title" = "Privacy"; + /* Label for the blogging prompts setting */ "sitesettings.prompts.title" = "Show prompts"; /* Label for the blogging reminders setting */ "sitesettings.reminders.title" = "Reminders"; +/* Hint for users when hidden privacy setting is set */ +"siteVisibility.hidden.hint" = "Your site is visible to everyone, but asks search engines not to index your site."; + +/* Text for privacy settings: Hidden */ +"siteVisibility.hidden.title" = "Hidden"; + +/* Hint for users when private privacy setting is set */ +"siteVisibility.private.hint" = "Your site is only visible to you and users you approve."; + +/* Text for privacy settings: Private */ +"siteVisibility.private.title" = "Private"; + +/* Hint for users when public privacy setting is set */ +"siteVisibility.public.hint" = "Your site is visible to everyone, and it may be indexed by search engines."; + +/* Text for privacy settings: Public */ +"siteVisibility.public.title" = "Public"; + +/* Text for unknown privacy setting */ +"siteVisibility.unknown.hint" = "Unknown"; + +/* Text for unknown privacy setting */ +"siteVisibility.unknown.title" = "Unknown"; + /* Image size option title. */ "Size" = "Size"; @@ -8635,9 +8708,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Accessibility hint */ "Tap to select the previous period" = "Tap to select the previous period"; -/* This is the blog picker in the editor */ -"Tap to select which blog to post to" = "Tap to select which blog to post to"; - /* Accessibility hint for button used to switch site */ "Tap to switch to another site, or add a new site" = "Tap to switch to another site, or add a new site"; @@ -8949,6 +9019,9 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Text displayed when there is a failure loading the activity feed */ "There was an error loading activities" = "There was an error loading activities"; +/* Text displayed when there is a failure loading Blaze campaigns. */ +"There was an error loading campaigns." = "There was an error loading campaigns."; + /* Text displayed when there is a failure loading the plan list */ "There was an error loading plans" = "There was an error loading plans"; @@ -9145,9 +9218,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Text instructing the user to enter their email address. */ "To create your new WordPress.com account, please enter your email address." = "To create your new WordPress.com account, please enter your email address."; -/* Displayed when Push Notifications are disabled (iOS 7) */ -"To enable notifications:\n\n1. Open **iOS Settings**\n2. Tap **Notifications**\n3. Select **WordPress**\n4. Turn on **Allow Notifications**" = "To enable notifications:\n\n1. Open **iOS Settings**\n2. Tap **Notifications**\n3. Select **WordPress**\n4. Turn on **Allow Notifications**"; - /* Message asking the user if they want to set up Jetpack from notifications */ "To get helpful notifications on your phone from your WordPress site, you'll need to install the Jetpack plugin." = "To get helpful notifications on your phone from your WordPress site, you'll need to install the Jetpack plugin."; @@ -9261,7 +9331,6 @@ Example: given a notice format "Following %@" and empty site name, this will be /* Accessibility label for trash button to delete items from the user's media library Accessibility label for trash buttons in nav bars - Button title for Trash comment state. Trashes a comment Trashes the comment */ "Trash" = "Trash"; @@ -9582,7 +9651,6 @@ Example: given a notice format "Following %@" and empty site name, this will be "Unhide" = "Unhide"; /* Label for size of media when it's not possible to calculate it. - Text for unknown privacy setting Unknown Tag Name */ "Unknown" = "Unknown"; @@ -10915,18 +10983,9 @@ from anywhere."; /* Title of a message displayed when user starts a restore operation */ "Your site is being restored" = "Your site is being restored"; -/* Hint for users when private privacy setting is set */ -"Your site is only visible to you and users you approve." = "Your site is only visible to you and users you approve."; - /* Message to show to user when media upload failed because user doesn't have enough space on quota/disk */ "Your site is out of storage space for media uploads." = "Your site is out of storage space for media uploads."; -/* Hint for users when public privacy setting is set */ -"Your site is visible to everyone, and it may be indexed by search engines." = "Your site is visible to everyone, and it may be indexed by search engines."; - -/* Hint for users when hidden privacy setting is set */ -"Your site is visible to everyone, but asks search engines not to index your site." = "Your site is visible to everyone, but asks search engines not to index your site."; - /* Title for label when there are threats on the users site */ "Your site may be at risk" = "Your site may be at risk";