Skip to content

Commit 1170399

Browse files
committed
Merge remote-tracking branch 'origin/trunk' into mokagio/localize-widgets
2 parents 1d83ae5 + 29c95b9 commit 1170399

File tree

100 files changed

+1478
-627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1478
-627
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Contains editorialized release notes. Raw release notes should go into `RELEASE-NOTES.txt`.
33
-->
44

5+
## 10.3
6+
7+
More love for In-Person Payments and Analytics this time around. We fixed a bug which could prevent you from collecting payments in the app. Card reader connections are more stable. And we fixed an issue where your store's analytics are sometimes not updated.
8+
9+
510
## 10.2
611
Even though this release doesn’t have any new features, we still put a lot of love into it! You can now enable or disable the option to take card or cash payments on collection or delivery. We also added a new Help Center page that makes it easier for you to login to the app.
712

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
77
switch featureFlag {
88
case .barcodeScanner:
99
return buildConfig == .localDeveloper || buildConfig == .alpha
10-
case .couponView:
11-
return true
1210
case .productSKUInputScanner:
1311
return true
1412
case .inbox:
@@ -17,20 +15,10 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
1715
return buildConfig == .localDeveloper || buildConfig == .alpha
1816
case .splitViewInOrdersTab:
1917
return buildConfig == .localDeveloper || buildConfig == .alpha
20-
case .couponDeletion:
21-
return true
22-
case .couponEditing:
23-
return true
24-
case .couponCreation:
25-
return true
2618
case .updateOrderOptimistically:
2719
return buildConfig == .localDeveloper || buildConfig == .alpha
2820
case .shippingLabelsOnboardingM1:
2921
return buildConfig == .localDeveloper || buildConfig == .alpha
30-
case .backgroundProductImageUpload:
31-
return true
32-
case .appleIDAccountDeletion:
33-
return true
3422
case .newToWooCommerceLinkInLoginPrologue:
3523
return true
3624
case .loginPrologueOnboarding:

Experiments/Experiments/FeatureFlag.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ public enum FeatureFlag: Int {
1414
///
1515
case reviews
1616

17-
/// Displays the option to view coupons
18-
///
19-
case couponView
20-
2117
/// Barcode scanner for product SKU input
2218
///
2319
case productSKUInputScanner
@@ -34,18 +30,6 @@ public enum FeatureFlag: Int {
3430
///
3531
case splitViewInOrdersTab
3632

37-
/// Displays the option to delete coupons
38-
///
39-
case couponDeletion
40-
41-
/// Displays the option to edit a coupon
42-
///
43-
case couponEditing
44-
45-
/// Displays the option to create a coupon
46-
///
47-
case couponCreation
48-
4933
/// Enable optimistic updates for orders
5034
///
5135
case updateOrderOptimistically
@@ -54,18 +38,10 @@ public enum FeatureFlag: Int {
5438
///
5539
case shippingLabelsOnboardingM1
5640

57-
/// Enable image upload after leaving the product form
58-
///
59-
case backgroundProductImageUpload
60-
6141
/// Enable IPP reader manuals consolidation screen
6242
///
6343
case consolidatedCardReaderManuals
6444

65-
/// Apple ID account deletion
66-
///
67-
case appleIDAccountDeletion
68-
6945
/// Showing a "New to WooCommerce" link in the login prologue screen
7046
///
7147
case newToWooCommerceLinkInLoginPrologue

Networking/Networking/Network/WordPressOrgNetwork.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public final class WordPressOrgNetwork: Network {
2525
return sessionManager
2626
}()
2727

28-
public init(authenticator: Authenticator? = nil, userAgent: String? = nil) {
28+
public init(authenticator: Authenticator? = nil, userAgent: String = UserAgent.defaultUserAgent) {
2929
self.authenticator = authenticator
3030
self.userAgent = userAgent
3131
}

Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ target 'WooCommerce' do
5252
pod 'Gridicons', '~> 1.2.0'
5353

5454
# To allow pod to pick up beta versions use -beta. E.g., 1.1.7-beta.1
55-
pod 'WordPressAuthenticator', '~> 2.4.0'
56-
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
55+
pod 'WordPressAuthenticator', '~> 3.1.0-beta.1'
56+
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
5757
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :branch => ''
5858
# pod 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS'
5959

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ PODS:
4242
- WordPress-Aztec-iOS (1.11.0)
4343
- WordPress-Editor-iOS (1.11.0):
4444
- WordPress-Aztec-iOS (= 1.11.0)
45-
- WordPressAuthenticator (2.4.0):
45+
- WordPressAuthenticator (3.1.0-beta.1):
4646
- Alamofire (~> 4.8)
4747
- CocoaLumberjack (~> 3.5)
4848
- GoogleSignIn (~> 6.0.1)
@@ -92,7 +92,7 @@ DEPENDENCIES:
9292
- Sourcery (~> 1.0.3)
9393
- StripeTerminal (~> 2.7)
9494
- WordPress-Editor-iOS (~> 1.11.0)
95-
- WordPressAuthenticator (~> 2.4.0)
95+
- WordPressAuthenticator (~> 3.1.0-beta.1)
9696
- WordPressKit (~> 4.49.0)
9797
- WordPressShared (~> 1.15)
9898
- WordPressUI (~> 1.12.5)
@@ -163,7 +163,7 @@ SPEC CHECKSUMS:
163163
UIDeviceIdentifier: af4e11e25a2ea670078e2bd677bb0e8144f9f063
164164
WordPress-Aztec-iOS: 050b34d4c3adfb7c60363849049b13d60683b348
165165
WordPress-Editor-iOS: 304098424f1051cb271546c99f906aac296b1b81
166-
WordPressAuthenticator: afc1b7ec564f2b8e71c3d2ab8afa29df70ed6d03
166+
WordPressAuthenticator: 7adf1ab6dea0b1e01c519feb5cd2fc160f47798e
167167
WordPressKit: 96deb6ba37ea5eaec4ddcaa53eca04d653246152
168168
WordPressShared: 5477f179c7fe03b5d574f91adda66f67d131827e
169169
WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac
@@ -179,6 +179,6 @@ SPEC CHECKSUMS:
179179
ZendeskSupportProvidersSDK: 2bdf8544f7cd0fd4c002546f5704b813845beb2a
180180
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
181181

182-
PODFILE CHECKSUM: a9915adfd885798e630904e5ae74f77f8555ccfe
182+
PODFILE CHECKSUM: 777d68ac2ad78e410f8930be0fecb3b38338c2ae
183183

184184
COCOAPODS: 1.11.2

RELEASE-NOTES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]
22

3+
10.4
4+
-----
5+
- [*] Help center: Added help center web page with FAQs for "Pick a WooCommerce Store" screen. [https://github.com/woocommerce/woocommerce-ios/pull/7641]
6+
- [*] Login: Users can now set up the Jetpack connection between a self-hosted site and their WP.com account. [https://github.com/woocommerce/woocommerce-ios/pull/7608]
7+
38
10.3
49
-----
510
- [*] Dashboard: the last selected time range tab (Today/This Week/This Month/This Year) is persisted for the site and shown on the next site launch (app launch or switching stores). [https://github.com/woocommerce/woocommerce-ios/pull/7638]
611
- [*] Dashboard: swiping to another time range tab now triggers syncing for the target tab. Previously, the stats on the target tab aren't synced from the swipe gesture. [https://github.com/woocommerce/woocommerce-ios/pull/7650]
712
- [*] In-Person Payments: Fixed an issue where the Pay in Person toggle could be out of sync with the setting on the website. [https://github.com/woocommerce/woocommerce-ios/pull/7656]
813
- [*] In-Person Payments: Removed the need to sign in when purchasing a card reader [https://github.com/woocommerce/woocommerce-ios/pull/7670]
14+
- [*] In-Person Payments: Fixed a bug where canceling a reader connection could result in being unable to connect a reader in future [https://github.com/woocommerce/woocommerce-ios/pull/7678]
15+
- [*] In-Person Payments: Fixed a bug which prevented the Collect Payment button from being shown for Cash on Delivery orders [https://github.com/woocommerce/woocommerce-ios/pull/7694]
916

1017
10.2
1118
-----

WooCommerce/Classes/Authentication/AuthenticationManager.swift

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,18 @@ class AuthenticationManager: Authentication {
189189
/// and returns an error view controller if not.
190190
func errorViewController(for siteURL: String,
191191
with matcher: ULAccountMatcher,
192+
credentials: AuthenticatorCredentials? = nil,
192193
navigationController: UINavigationController,
193194
onStorePickerDismiss: @escaping () -> Void) -> UIViewController? {
194195

195196
/// Account mismatched case
196197
guard matcher.match(originalURL: siteURL) else {
198+
/// Account mismatch experiment iteration 1: show jetpack connection error
199+
/// if the error happens during site credential login.
200+
if let credentials = credentials?.wporg {
201+
DDLogWarn("⚠️ Present Jetpack connection error for site: \(String(describing: siteURL))")
202+
return jetpackConnectionUI(for: siteURL, with: credentials, in: navigationController)
203+
}
197204
DDLogWarn("⚠️ Present account mismatch error for site: \(String(describing: siteURL))")
198205
return accountMismatchUI(for: siteURL, with: matcher)
199206
}
@@ -350,7 +357,11 @@ extension AuthenticationManager: WordPressAuthenticatorDelegate {
350357
let matcher = ULAccountMatcher(storageManager: storageManager)
351358
matcher.refreshStoredSites()
352359

353-
if let vc = errorViewController(for: siteURL, with: matcher, navigationController: navigationController, onStorePickerDismiss: onDismiss) {
360+
if let vc = errorViewController(for: siteURL,
361+
with: matcher,
362+
credentials: credentials,
363+
navigationController: navigationController,
364+
onStorePickerDismiss: onDismiss) {
354365
loggedOutAppSettings?.setErrorLoginSiteAddress(siteURL)
355366
navigationController.show(vc, sender: nil)
356367
} else {
@@ -607,8 +618,27 @@ private extension AuthenticationManager {
607618
return ULErrorViewController(viewModel: viewModel)
608619
}
609620

621+
/// The error screen to be displayed when the user tries to enter as site
622+
/// whose Jetpack is not connected to their WP.com account.
623+
/// This screen is currently displayed when user logged in with site credentials.
624+
///
625+
func jetpackConnectionUI(for siteURL: String,
626+
with credentials: WordPressOrgCredentials,
627+
in navigationController: UINavigationController) -> UIViewController {
628+
let viewModel = JetpackConnectionErrorViewModel(siteURL: siteURL, credentials: credentials, onJetpackSetupCompletion: { email in
629+
return WordPressAuthenticator.showVerifyEmailForWPCom(
630+
from: navigationController,
631+
xmlrpc: credentials.xmlrpc,
632+
connectedEmail: email,
633+
siteURL: siteURL
634+
)
635+
})
636+
return ULErrorViewController(viewModel: viewModel)
637+
}
638+
610639
/// The error screen to be displayed when the user tries to enter a site
611640
/// whose Jetpack is not associated with their account.
641+
/// This screen is currently displayed when user logged in with a WP.com account.
612642
///
613643
func accountMismatchUI(for siteURL: String, with matcher: ULAccountMatcher) -> UIViewController {
614644
let viewModel = WrongAccountErrorViewModel(siteURL: siteURL, showsConnectedStores: matcher.hasConnectedStores)

WooCommerce/Classes/Authentication/Epilogue/StorePickerViewController.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private extension StorePickerViewController {
289289
}
290290

291291
func presentHelp() {
292-
ServiceLocator.authenticationManager.presentSupport(from: self, sourceTag: .generalLogin)
292+
ServiceLocator.authenticationManager.presentSupport(from: self, screen: .storePicker)
293293
}
294294
}
295295

@@ -637,7 +637,6 @@ extension StorePickerViewController: UITableViewDataSource {
637637
hideActionButton()
638638
let cell = tableView.dequeueReusableCell(EmptyStoresTableViewCell.self, for: indexPath)
639639
let isRemoveAppleIDAccessButtonVisible = appleIDCredentialChecker.hasAppleUserID()
640-
&& featureFlagService.isFeatureFlagEnabled(.appleIDAccountDeletion)
641640
cell.updateRemoveAppleIDAccessButtonVisibility(isVisible: isRemoveAppleIDAccessButtonVisible)
642641
if isRemoveAppleIDAccessButtonVisible {
643642
cell.onCloseAccountButtonTapped = { [weak self] in

0 commit comments

Comments
 (0)