diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 0455c4545181..fae2f7b6abfa 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -7,9 +7,9 @@ 24.3 ----- * [***] [internal] Refactored websocket connections to Pinghub. [#22611] - * [**] Multiple pre-publishing sheet fixes and improvements [#22606] * [*] Gravatar: Adds informative new view about Gravatar to the profile editing page. [#22615] +* [*] [internal][WordPress-only] Updates Jetpack banners and badges copy for consistency [#20123] 24.2 ----- diff --git a/WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib b/WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib index 88a5ffb9a04f..9697163752ff 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib +++ b/WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib @@ -42,7 +42,7 @@ - + diff --git a/WordPress/Classes/ViewRelated/Jetpack/Branding/JetpackBrandingTextProvider.swift b/WordPress/Classes/ViewRelated/Jetpack/Branding/JetpackBrandingTextProvider.swift index c74bc3387bc0..2c54588390ca 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Branding/JetpackBrandingTextProvider.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Branding/JetpackBrandingTextProvider.swift @@ -118,11 +118,7 @@ private extension JetpackBrandingTextProvider { static let phaseThreeSingularMovingInText = NSLocalizedString("jetpack.branding.badge_banner.moving_in.singular", value: "%@ is moving in %@", comment: "Title of a badge indicating when a feature in singular form will be removed. First argument is the feature name. Second argument is the number of days/weeks it will be removed in. Ex: Reader is moving in 2 weeks") - static let phaseStaticScreensText = NSLocalizedString( - "jetpack.branding.badge_banner.moving_in_days.plural", - value: "Moving to the Jetpack app in a few days.", - comment: "Title of a badge or banner indicating that this feature will be moved in a few days." - ) + static let phaseStaticScreensText = defaultText } private var isPlural: Bool { diff --git a/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController.swift b/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController.swift index 9266edbc8597..de92a45551ca 100644 --- a/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController.swift @@ -231,10 +231,8 @@ final class PrepublishingViewController: UIViewController, UITableViewDataSource navigationController?.setNavigationBarHidden(false, animated: animated) } - if isBeingDismissed || parent?.isBeingDismissed == true { - if !didTapPublish, - post.status == .publishPrivate, - let originalStatus = post.original?.status { + if (isBeingDismissed || parent?.isBeingDismissed == true) && !didTapPublish { + if post.status == .publishPrivate, let originalStatus = post.original?.status { post.status = originalStatus } completion(.dismissed) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift index c46b899b82ce..66ffe60ab299 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift @@ -406,8 +406,8 @@ class ReaderDetailViewController: UIViewController, ReaderDetailView { /// Scroll the content to a given #hash /// func scroll(to hash: String) { - webView.evaluateJavaScript("document.getElementById('\(hash)').offsetTop", completionHandler: { [unowned self] height, _ in - guard let height = height as? CGFloat else { + webView.evaluateJavaScript("document.getElementById('\(hash)').offsetTop", completionHandler: { [weak self] height, _ in + guard let self, let height = height as? CGFloat else { return } @@ -577,7 +577,10 @@ class ReaderDetailViewController: UIViewController, ReaderDetailView { } // Load the image - featuredImage.load { [unowned self] in + featuredImage.load { [weak self] in + guard let self else { + return + } self.hideLoading() } } diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift b/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift index 00b3e6611d04..db08fad5056a 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift @@ -250,7 +250,10 @@ class ReaderCardsStreamViewController: ReaderStreamViewController { // MARK: - Select Interests Display private extension ReaderCardsStreamViewController { func displaySelectInterestsIfNeeded() { - selectInterestsViewController.userIsFollowingTopics { [unowned self] isFollowing in + selectInterestsViewController.userIsFollowingTopics { [weak self] isFollowing in + guard let self else { + return + } if isFollowing { self.hideSelectInterestsView() } else { @@ -291,7 +294,10 @@ private extension ReaderCardsStreamViewController { selectInterestsViewController.view.frame = self.view.bounds self.add(selectInterestsViewController) - selectInterestsViewController.didSaveInterests = { [unowned self] _ in + selectInterestsViewController.didSaveInterests = { [weak self] _ in + guard let self else { + return + } self.hideSelectInterestsView() } } diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderSearchViewController.swift b/WordPress/Classes/ViewRelated/Reader/ReaderSearchViewController.swift index 979f6e7b2917..ffb9842d5ebb 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderSearchViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderSearchViewController.swift @@ -59,7 +59,10 @@ import Gridicons private lazy var bannerView: JetpackBannerView = { let textProvider = JetpackBrandingTextProvider(screen: JetpackBannerScreen.readerSearch) let bannerView = JetpackBannerView() - bannerView.configure(title: textProvider.brandingText()) { [unowned self] in + bannerView.configure(title: textProvider.brandingText()) { [weak self] in + guard let self else { + return + } JetpackBrandingCoordinator.presentOverlay(from: self) JetpackBrandingAnalyticsHelper.trackJetpackPoweredBannerTapped(screen: .readerSearch) } diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift b/WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift index 60a74f07df8a..8144b9cf9dfc 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift @@ -528,7 +528,10 @@ import WordPressUI } let textProvider = JetpackBrandingTextProvider(screen: JetpackBannerScreen.reader) let bannerView = JetpackBannerView() - bannerView.configure(title: textProvider.brandingText()) { [unowned self] in + bannerView.configure(title: textProvider.brandingText()) { [weak self] in + guard let self else { + return + } JetpackBrandingCoordinator.presentOverlay(from: self) JetpackBrandingAnalyticsHelper.trackJetpackPoweredBannerTapped(screen: .reader) } diff --git a/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift b/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift index 43283d0b79d1..de070468cdc9 100644 --- a/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift +++ b/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift @@ -27,17 +27,31 @@ extension WPTabBarController { } @objc func makeReaderTabViewController() -> ReaderTabViewController { - return ReaderTabViewController(viewModel: readerTabViewModel) { [unowned self] viewModel in + return ReaderTabViewController(viewModel: readerTabViewModel) { [weak self] viewModel in + guard let self else { + return ReaderTabView(viewModel: viewModel) + } return self.makeReaderTabView(viewModel) } } @objc func makeReaderTabViewModel() -> ReaderTabViewModel { let viewModel = ReaderTabViewModel( - readerContentFactory: { [unowned self] in - self.makeReaderContentViewController(with: $0) + readerContentFactory: { [weak self] content in + if content.topicType == .discover, let topic = content.topic { + let controller = ReaderCardsStreamViewController.controller(topic: topic) + controller.shouldShowCommentSpotlight = self?.readerTabViewModel.shouldShowCommentSpotlight ?? false + return controller + } else if let topic = content.topic { + return ReaderStreamViewController.controllerWithTopic(topic) + } else { + return ReaderStreamViewController.controllerForContentType(content.type) + } }, - searchNavigationFactory: { [unowned self] in + searchNavigationFactory: { [weak self] in + guard let self else { + return + } self.navigateToReaderSearch() }, tabItemsStore: ReaderTabItemsStore(), diff --git a/WordPress/Resources/en.lproj/Localizable.strings b/WordPress/Resources/en.lproj/Localizable.strings index 4c676217bbfc..5c436b79fbaa 100644 --- a/WordPress/Resources/en.lproj/Localizable.strings +++ b/WordPress/Resources/en.lproj/Localizable.strings @@ -4495,9 +4495,6 @@ Example: Reply to Pamela Nguyen */ /* Title of a badge indicating when a feature in singular form will be removed. First argument is the feature name. Second argument is the number of days/weeks it will be removed in. Ex: Reader is moving in 2 weeks */ "jetpack.branding.badge_banner.moving_in.singular" = "%1$@ is moving in %2$@"; -/* Title of a badge or banner indicating that this feature will be moved in a few days. */ -"jetpack.branding.badge_banner.moving_in_days.plural" = "Moving to the Jetpack app in a few days."; - /* Title of a badge indicating that a feature in plural form will be removed soon. First argument is the feature name. Ex: Notifications are moving soon */ "jetpack.branding.badge_banner.moving_soon.plural" = "%@ are moving soon";