Skip to content

Commit

Permalink
Merge release/24.3 into trunk to propagate strings changes (#22715)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio authored Feb 28, 2024
2 parents 1393161 + 04a78bc commit aab11ac
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 25 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bUe-f2-zzc" userLabel="Icon Super View">
<rect key="frame" x="0.0" y="0.0" width="317" height="75"/>
<subviews>
<view contentMode="scaleToFill" placeholderIntrinsicWidth="120" placeholderIntrinsicHeight="100" translatesAutoresizingMaskIntoConstraints="NO" id="v3d-AD-Jsf" customClass="AnimationView" customModule="Lottie">
<view contentMode="scaleToFill" placeholderIntrinsicWidth="120" placeholderIntrinsicHeight="100" translatesAutoresizingMaskIntoConstraints="NO" id="v3d-AD-Jsf" customClass="LottieAnimationView" customModule="Lottie">
<rect key="frame" x="0.0" y="0.0" width="120" height="65"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
3 changes: 0 additions & 3 deletions WordPress/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit aab11ac

Please sign in to comment.