Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge beta 22.1.0.2 #20527

Merged
merged 19 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
22.2
-----

* [**] [Jetpack-only] Added a dashboard card for purchasing domains. [#20424]
* [**] [internal] Refactored Google SignIn implementation to not use the Google SDK [#20128]

22.1
-----
* [**] [internal] Refactor updating account related Core Data operations, which ususally happens during log in and out of the app. [#20394]
* [***] [internal] Refactor uploading photos (from the device photo, the Free Photo library, and other sources) to the WordPress Media Library. Affected areas are where you can choose a photo and upload, including the "Media" screen, adding images to a post, updating site icon, etc. [#20322]
* [**] [WordPress-only] Warns user about sites with only individual plugins not supporting core app features and offers the option to switch to the Jetpack app. [#20408]
* [**] [internal] Refactored Google SignIn implementation to not use the Google SDK [#20128]
Comment on lines +4 to -11
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the PR description, this entry was in 22.1 because that's where the PR was meant to land after code freeze but I fumbled and it landed on trunk instead.

* [*] [Reader] Fix an issue that was causing the app to crash when tapping the More or Share buttons in Reader Detail screen. [#20490]
* [*] Block editor: Avoid empty Gallery block error [https://github.com/WordPress/gutenberg/pull/49557]
Comment on lines +11 to +12
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


22.0
-----
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import UIKit

extension UIPopoverPresentationController {

enum PopoverAnchor {
case view(UIView)
case barButtonItem(UIBarButtonItem)
}
}
25 changes: 23 additions & 2 deletions WordPress/Classes/ViewRelated/Post/PostSharingController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ import SVProgressHUD
}

@objc func sharePost(_ title: String, summary: String, link: String?, fromView anchorView: UIView, inViewController viewController: UIViewController) {
sharePost(title, summary: summary, link: link, fromAnchor: .view(anchorView), inViewController: viewController)
}

private func sharePost(_ title: String, summary: String, link: String?, fromAnchor anchor: PopoverAnchor, inViewController viewController: UIViewController) {
let controller = shareController(
title,
summary: summary,
Expand All @@ -59,8 +63,13 @@ import SVProgressHUD
viewController.present(controller, animated: true)
if let presentationController = controller.popoverPresentationController {
presentationController.permittedArrowDirections = .any
presentationController.sourceView = anchorView
presentationController.sourceRect = anchorView.bounds
switch anchor {
case .barButtonItem(let item):
presentationController.barButtonItem = item
case .view(let anchorView):
presentationController.sourceView = anchorView
presentationController.sourceRect = anchorView.bounds
}
}
}

Expand All @@ -84,6 +93,16 @@ import SVProgressHUD
inViewController: viewController)
}

func shareReaderPost(_ post: ReaderPost, fromAnchor anchor: PopoverAnchor, inViewController viewController: UIViewController) {

sharePost(
post.titleForDisplay(),
summary: post.contentPreviewForDisplay(),
link: post.permaLink,
fromAnchor: anchor,
inViewController: viewController)
}

@objc func shareReaderPost(_ post: ReaderPost, fromView anchorView: UIView, inViewController viewController: UIViewController) {

sharePost(
Expand Down Expand Up @@ -114,4 +133,6 @@ import SVProgressHUD
}

}

typealias PopoverAnchor = UIPopoverPresentationController.PopoverAnchor
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,17 @@ class ReaderDetailCoordinator {
/// Share the current post
///
func share(fromView anchorView: UIView) {
self.share(fromAnchor: .view(anchorView))
}

/// Share the current post
///
func share(fromAnchor anchor: UIPopoverPresentationController.PopoverAnchor) {
guard let post = post, let view = viewController else {
return
}

sharingController.shareReaderPost(post, fromView: anchorView, inViewController: view)
sharingController.shareReaderPost(post, fromAnchor: anchor, inViewController: view)

WPAnalytics.trackReader(.readerSharedItem)
}
Expand Down Expand Up @@ -400,7 +406,7 @@ class ReaderDetailCoordinator {

/// Show a menu with options for the current post's site
///
private func showMenu(_ anchorView: UIView) {
private func showMenu(_ anchor: UIPopoverPresentationController.PopoverAnchor) {
guard let post = post,
let context = post.managedObjectContext,
let viewController = viewController,
Expand All @@ -414,7 +420,7 @@ class ReaderDetailCoordinator {
post: post,
context: context,
readerTopic: readerTopic,
anchor: anchorView,
anchor: anchor,
vc: viewController,
source: ReaderPostMenuSource.details,
followCommentsService: followCommentsService
Expand Down Expand Up @@ -680,8 +686,12 @@ extension ReaderDetailCoordinator: ReaderDetailHeaderViewDelegate {
previewSite()
}

func didTapMenuButton(_ sender: UIBarButtonItem) {
showMenu(.barButtonItem(sender))
}

func didTapMenuButton(_ sender: UIView) {
showMenu(sender)
showMenu(.view(sender))
}

func didTapTagButton() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,15 +704,15 @@ class ReaderDetailViewController: UIViewController, ReaderDetailView {

/// Ask the coordinator to present the share sheet
///
@objc func didTapShareButton(_ sender: UIButton) {
coordinator?.share(fromView: sender)
@objc func didTapShareButton(_ sender: UIBarButtonItem) {
coordinator?.share(fromAnchor: .barButtonItem(sender))
}

@objc func didTapMenuButton(_ sender: UIButton) {
@objc func didTapMenuButton(_ sender: UIBarButtonItem) {
coordinator?.didTapMenuButton(sender)
}

@objc func didTapBrowserButton(_ sender: UIButton) {
@objc func didTapBrowserButton(_ sender: UIBarButtonItem) {
coordinator?.openInBrowser()
}

Expand Down
11 changes: 11 additions & 0 deletions WordPress/Classes/ViewRelated/Reader/ReaderMenuAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ final class ReaderMenuAction {
vc: UIViewController,
source: ReaderPostMenuSource,
followCommentsService: FollowCommentsService
) {
self.execute(post: post, context: context, anchor: .view(anchor), vc: vc, source: source, followCommentsService: followCommentsService)
}

func execute(post: ReaderPost,
context: NSManagedObjectContext,
readerTopic: ReaderAbstractTopic? = nil,
anchor: ReaderShowMenuAction.PopoverAnchor,
vc: UIViewController,
source: ReaderPostMenuSource,
followCommentsService: FollowCommentsService
) {
let siteTopic: ReaderSiteTopic? = post.isFollowing ? (try? ReaderSiteTopic.lookup(withSiteID: post.siteID, in: context)) : nil

Expand Down
6 changes: 5 additions & 1 deletion WordPress/Classes/ViewRelated/Reader/ReaderShareAction.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/// Encapsulates a command share a post
final class ReaderShareAction {
func execute(with post: ReaderPost, context: NSManagedObjectContext, anchor: UIView, vc: UIViewController) {
self.execute(with: post, context: context, anchor: .view(anchor), vc: vc)
}

func execute(with post: ReaderPost, context: NSManagedObjectContext, anchor: UIPopoverPresentationController.PopoverAnchor, vc: UIViewController) {
let postID = post.objectID
if let post: ReaderPost = ReaderActionHelpers.existingObject(for: postID, in: context) {
let sharingController = PostSharingController()

sharingController.shareReaderPost(post, fromView: anchor, inViewController: vc)
sharingController.shareReaderPost(post, fromAnchor: anchor, inViewController: vc)
WPAnalytics.trackReader(.itemSharedReader, properties: ["blogId": post.siteID as Any])
}
}
Expand Down
15 changes: 12 additions & 3 deletions WordPress/Classes/ViewRelated/Reader/ReaderShowMenuAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class ReaderShowMenuAction {
context: NSManagedObjectContext,
siteTopic: ReaderSiteTopic? = nil,
readerTopic: ReaderAbstractTopic? = nil,
anchor: UIView,
anchor: PopoverAnchor,
vc: UIViewController,
source: ReaderPostMenuSource,
followCommentsService: FollowCommentsService
Expand Down Expand Up @@ -194,8 +194,13 @@ final class ReaderShowMenuAction {
vc.present(alertController, animated: true)
if let presentationController = alertController.popoverPresentationController {
presentationController.permittedArrowDirections = .any
presentationController.sourceView = anchor
presentationController.sourceRect = anchor.bounds
switch anchor {
case .barButtonItem(let item):
presentationController.barButtonItem = item
case .view(let anchor):
presentationController.sourceView = anchor
presentationController.sourceRect = anchor.bounds
}
}
} else {
vc.present(alertController, animated: true)
Expand Down Expand Up @@ -283,4 +288,8 @@ final class ReaderShowMenuAction {
let userInfo: [String: Any] = [ReaderNotificationKeys.post: post, ReaderNotificationKeys.result: result]
center.post(name: .ReaderUserBlockingDidEnd, object: nil, userInfo: userInfo)
}

// MARK: - Types

typealias PopoverAnchor = UIPopoverPresentationController.PopoverAnchor
}
98 changes: 97 additions & 1 deletion WordPress/Resources/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Translation-Revision-Date: 2023-03-23 23:54:26+0000 */
/* Translation-Revision-Date: 2023-04-05 13:54:09+0000 */
/* Plural-Forms: nplurals=6; plural=(n == 0) ? 0 : ((n == 1) ? 1 : ((n == 2) ? 2 : ((n % 100 >= 3 && n % 100 <= 10) ? 3 : ((n % 100 >= 11 && n % 100 <= 99) ? 4 : 5)))); */
/* Generator: GlotPress/4.0.0-alpha.4 */
/* Language: ar */
Expand Down Expand Up @@ -6490,6 +6490,9 @@ translators: %s: Select control button label e.g. \"Button width\" */
/* title of the button that searches the first domain. */
"Search for a domain" = "البحث عن نطاق";

/* Select domain name. Subtitle */
"Search for a short and memorable keyword to help people find and visit your website." = "ابحث عن كلمة مفتاحية قصيرة لا تُنسى لمساعدة الأشخاص على العثور على موقعك على الويب وزيارته.";

/* No comment provided by engineer. */
"Search input field." = "حقل إدخال البحث.";

Expand Down Expand Up @@ -9696,6 +9699,42 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */
/* Customize Insights button title */
"customizeInsightsCell.tryItButton.title" = "تجربة ذلك الآن";

/* Title for an empty state view when no cards are displayed */
"dasboard.emptyView.subtitle" = "أضف البطاقات التي تناسب احتياجاتك للاطلاع على معلومات حول موقعك.";

/* Title for an empty state view when no cards are displayed */
"dasboard.emptyView.title" = "لا توجد بطاقات لعرضها";

/* Personialize home tab button title */
"dasboard.personalizeHomeButtonTitle" = "علامة تبويب تخصيص صفحتك الرئيسية";

/* Remote config params debug menu footer explaining the meaning of a cell with a checkmark. */
"debugMenu.remoteConfig.footer" = "يُشار إلى المعلمات التي تم تجاوزها بعلامة اختيار.";

/* Hint for overriding remote config params */
"debugMenu.remoteConfig.hint" = "تجاوز المعلمة المختارة عن طريق تحديد قيمة جديدة هنا.";

/* Placeholder for overriding remote config params */
"debugMenu.remoteConfig.placeholder" = "لا توجد قيمة بعيدة أو افتراضية";

/* Remote Config debug menu title */
"debugMenu.remoteConfig.title" = "تكوين بعيد";

/* Title of the Local Feature Flags screen used in debug builds of the app */
"debugMenu.section.localFeatureFlags" = "تتميز محلي للعلامات";

/* Title of the Remote Feature Flags screen used in debug builds of the app */
"debugMenu.section.remoteFeatureFlags" = "تمييز بعيد للعلامات";

/* Description for the Domains dashboard card. */
"domain.dashboard.card.description" = "شارك مطالبتك في زاوية الويب لديك مع عنوان الموقع الذي يسهل العثور عليه ومشاركته ومتابعته.";

/* Title for a menu action in the context menu on the Jetpack install card. */
"domain.dashboard.card.menu.hide" = "إخفاء هذا";

/* Title for the Domains dashboard card. */
"domain.dashboard.card.title" = "امتلاك هويتك على الإنترنت مع نطاق مخصص";

/* No comment provided by engineer. */
"double-tap to change unit" = "أنقر نقرًا مزدوجًا لتغيير الوحدة";

Expand Down Expand Up @@ -9992,6 +10031,15 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */
/* Title of the primary button shown after the Jetpack plugin has been installed. Tapping on the button dismisses the installation screen. */
"jetpack.install-flow.success.primaryButtonText" = "تم";

/* Title of a button for connecting user account to Jetpack. */
"jetpack.install.connectUser.button.title" = "ربط حساب المستخدم الخاص بك";

/* Message asking the user if they want to set up Jetpack from notifications */
"jetpack.install.connectUser.notifications.description" = "للحصول على إشعارات مساعدة على هاتفك من موقع ووردبريس الخاص بك، سيتعين عليك الاتصال بحساب المستخدم الخاص بك.";

/* Message asking the user if they want to set up Jetpack from stats by connecting their user account */
"jetpack.install.connectUser.stats.description" = "لاستخدام الإحصاءات على موقعك، سيتعين عليك ربط إضافة Jetpack بحساب المستخدم الخاص بك.";

/* Description inside a menu card communicating that features are moving to the Jetpack app. */
"jetpack.menuCard.description" = "ستنتقل ميزات الإحصاءات والقارئ والتنبيهات وغيرها من الميزات إلى تطبيق Jetpack للهاتف المحمول قريبًا.";

Expand Down Expand Up @@ -10229,6 +10277,30 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */
/* No comment provided by engineer. */
"password" = "كلمة المرور";

/* Section footer displayed below the list of toggles */
"personalizeHome.cardsSectionFooter" = "قد تعرض البطاقات محتوى مختلفًا استنادًا إلى ما يحدث على موقعك. إننا نعمل على مزيد من البطاقات وضوابط التحكم.";

/* Section header */
"personalizeHome.cardsSectionHeader" = "إضافة بطاقات أو إخفاؤها";

/* Card title for the pesonalization menu */
"personalizeHome.dashboardCard.blaze" = "التوهج";

/* Card title for the pesonalization menu */
"personalizeHome.dashboardCard.draftPosts" = "إعداد مسودة للتدوينات";

/* Card title for the pesonalization menu */
"personalizeHome.dashboardCard.prompts" = "مطالبات التدوين";

/* Card title for the pesonalization menu */
"personalizeHome.dashboardCard.scheduledPosts" = "تدوينات مجدولة";

/* Card title for the pesonalization menu */
"personalizeHome.dashboardCard.todaysStats" = "إحصاءات اليوم";

/* Page title */
"personalizeHome.title" = "علامة تبويب تخصيص الصفحة الرئيسية";

/* Register Domain - Domain contact information field Phone */
"phone number" = "رقم الهاتف";

Expand All @@ -10247,6 +10319,9 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */
/* Promote the post with Blaze. */
"posts.blaze.actionTitle" = "الترويج مع الإبراز";

/* Title for a tappable string that opens the reader with a prompts tag */
"prompts.card.viewprompts.title" = "عرض كل الردود";

/* Subtitle of the notification when prompts are hidden from the dashboard card */
"prompts.notification.removed.subtitle" = "زيارة إعدادات الموقع لإعادة التشغيل";

Expand Down Expand Up @@ -10322,6 +10397,9 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */
/* Share extension error dialog title. */
"shareModularViewController.retryAlert.title" = "خطأ في المشاركة";

/* Site name description that sits in the template website view. */
"site.creation.domain.tooltip.description" = "على غرار المثال أعلاه، يسمح النطاق للأشخاص بالعثور على موقعك وزيارته من متصفح الويب لديهم.";

/* Label for the blogging prompts setting */
"sitesettings.prompts.title" = "إظهار المطالبات";

Expand Down Expand Up @@ -10637,6 +10715,24 @@ translators: %s: Select control option value e.g: \"Auto, 25%\". */
/* This is a comma separated list of keywords used for spotlight indexing of the 'My Sites' tab. */
"wordpress, sites, site, blogs, blog" = "ووردبريس، المواقع، الموقع، المدونات، المدونة";

/* Jetpack Plugin Modal on WordPress primary button title */
"wordpress.jetpack.plugin.modal.primary.button.title" = "التبديل إلى تطبيق Jetpack";

/* Jetpack Plugin Modal on WordPress secondary button title */
"wordpress.jetpack.plugin.modal.secondary.button.title" = "الاستمرار من دون Jetpack";

/* Jetpack Plugin Modal (multiple plugins) on WordPress subtitle with formatted texts. %1$@ is for the site name. */
"wordpress.jetpack.plugin.modal.subtitle.plural" = "تستخدم %1$@ إضافات Jetpack الفردية، غير المدعومة من تطبيق ووردبريس.";

/* Jetpack Plugin Modal on WordPress (single plugin) subtitle with formatted texts. %1$@ is for the site name and %2$@ is for the specific plugin name. */
"wordpress.jetpack.plugin.modal.subtitle.singular" = "تستخدم %1$@ إضافة %2$@، غير المدعومة من تطبيق ووردبريس.";

/* Second paragraph of the Jetpack Plugin Modal on WordPress asking the user to switch to Jetpack. */
"wordpress.jetpack.plugin.modal.subtitle.switch" = "يرجى التبديل إلى تطبيق Jetpack، حيث سنرشدك من خلال الاتصال بإضافة Jetpack الكاملة حتى تتمكن من استخدام كل ميزات التطبيقات في هذا الموقع.";

/* Jetpack Plugin Modal title in WordPress */
"wordpress.jetpack.plugin.modal.title" = "عذرًا، هذا الموقع غير مدعوم من تطبيق ووردبريس";

/* Description of the jetpack migration success card, used in My site. */
"wp.migration.successcard.description" = "يرجى حذف تطبيق ووردبريس";

Expand Down
Loading