Skip to content

Commit 1c5234a

Browse files
authored
Merge branch 'trunk' into task/WOOMOB-556-mitigate-tax-rounding
2 parents 1e7a218 + 5865702 commit 1c5234a

File tree

18 files changed

+569
-102
lines changed

18 files changed

+569
-102
lines changed

Modules/Package.resolved

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/Package.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ let package = Package(
7272
.package(url: "https://github.com/Alamofire/Alamofire", from: "5.2.0"),
7373
.package(url: "https://github.com/AliSoftware/OHHTTPStubs", from: "9.0.0"),
7474
.package(url: "https://github.com/apple/swift-algorithms.git", from: "1.2.0"),
75+
.package(url: "https://github.com/apple/swift-async-algorithms", exact: "1.0.4"),
7576
.package(url: "https://github.com/Automattic/AutomatticAbout-swift.git", from: "1.1.5"),
7677
.package(url: "https://github.com/Automattic/Automattic-Tracks-iOS.git", from: "3.5.2"),
7778
.package(url: "https://github.com/Automattic/Gridicons-iOS", revision: "c904cb73e26e86463a78e1335c6f4fd54a9e9223"),
@@ -381,6 +382,7 @@ enum XcodeSupport {
381382
.product(name: "Inject", package: "Inject"),
382383
.product(name: "KeychainAccess", package: "KeychainAccess"),
383384
.product(name: "Kingfisher", package: "Kingfisher"),
385+
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
384386
.product(name: "ScrollViewSectionKit", package: "ScrollViewSectionKit"),
385387
.product(name: "Shimmer", package: "SwiftUI-Shimmer"),
386388
.product(name: "StripeTerminal", package: "stripe-terminal-ios"),

Modules/Sources/Experiments/DefaultFeatureFlagService.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
103103
return true
104104
case .pointOfSaleBarcodeScanningi2:
105105
return buildConfig == .localDeveloper || buildConfig == .alpha
106+
case .orderAddressMapSearch:
107+
return buildConfig == .localDeveloper || buildConfig == .alpha
106108
default:
107109
return true
108110
}

Modules/Sources/Experiments/FeatureFlag.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,8 @@ public enum FeatureFlag: Int {
210210
/// Enables the Point of Sale Barcode Scanner set up flows, as part of i2
211211
///
212212
case pointOfSaleBarcodeScanningi2
213+
214+
/// Enables the CTA to search for an address in the map in order details > shipping address.
215+
///
216+
case orderAddressMapSearch
213217
}

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
23.0
55
-----
66
- [*] Increased decimal sensitivity in order creation to mitigate tax rounding issues [https://github.com/woocommerce/woocommerce-ios/pull/15957]
7+
- [*] Fix initialization of authenticator to avoid crashes during login [https://github.com/woocommerce/woocommerce-ios/pull/15953]
78
- [*] Shipping Labels: Made HS tariff number field required in customs form for EU destinations [https://github.com/woocommerce/woocommerce-ios/pull/15946]
89

910
22.9

WooCommerce.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WooCommerce/Classes/Authentication/Epilogue/StorePickerViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ private extension StorePickerViewController {
369369
}
370370

371371
func presentSiteDiscovery() {
372-
ServiceLocator.authenticationManager.initialize()
373372
guard let viewController = WordPressAuthenticator.siteDiscoveryUI() else {
374373
return
375374
}

WooCommerce/Classes/ViewRelated/AppCoordinator.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ final class AppCoordinator {
8989
self.displayLoggedInStateWithoutDefaultStore()
9090
case (true, false):
9191
self.validateRoleEligibility {
92-
self.configureAuthenticator()
9392
self.displayLoggedInUI()
9493
self.synchronizeAndShowWhatsNew()
9594
}
@@ -200,19 +199,13 @@ private extension AppCoordinator {
200199
presentLoginOnboarding { [weak self] in
201200
guard let self = self else { return }
202201
// Only displays the authenticator when dismissing onboarding to allow time for A/B test setup.
203-
self.configureAndDisplayAuthenticator()
202+
self.displayAuthenticator()
204203
}
205204
} else {
206-
configureAndDisplayAuthenticator()
205+
displayAuthenticator()
207206
}
208207
}
209208

210-
/// Configures the WPAuthenticator and sets the authenticator UI as the window's root view.
211-
func configureAndDisplayAuthenticator() {
212-
configureAuthenticator()
213-
displayAuthenticator()
214-
}
215-
216209
/// Configures the WPAuthenticator for usage in both logged-in and logged-out states.
217210
func configureAuthenticator() {
218211
authenticationManager.initialize()
@@ -296,7 +289,6 @@ private extension AppCoordinator {
296289
guard stores.isAuthenticatedWithoutWPCom == false else {
297290
return displayAuthenticatorWithOnboardingIfNeeded()
298291
}
299-
configureAuthenticator()
300292

301293
let matcher = ULAccountMatcher(storageManager: storageManager)
302294
matcher.refreshStoredSites()

WooCommerce/Classes/ViewRelated/JetpackSetup/JetpackSetupCoordinator.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ final class JetpackSetupCoordinator {
1919
private let stores: StoresManager
2020
private let analytics: Analytics
2121
private let featureFlagService: FeatureFlagService
22-
private let dotcomAuthScheme: String
2322

2423
private var loginNavigationController: LoginNavigationController?
2524
private var setupStepsNavigationController: UINavigationController?
@@ -43,24 +42,18 @@ final class JetpackSetupCoordinator {
4342
}
4443

4544
init(site: Site,
46-
dotcomAuthScheme: String = ApiCredentials.dotcomAuthScheme,
4745
rootViewController: UIViewController,
4846
accountService: WordPressComAccountServiceProtocol = WordPressComAccountService(),
4947
stores: StoresManager = ServiceLocator.stores,
5048
analytics: Analytics = ServiceLocator.analytics,
5149
featureFlagService: FeatureFlagService = ServiceLocator.featureFlagService) {
5250
self.site = site
53-
self.dotcomAuthScheme = dotcomAuthScheme
5451
self.requiresConnectionOnly = false // to be updated later after fetching Jetpack status
5552
self.rootViewController = rootViewController
5653
self.accountService = accountService
5754
self.stores = stores
5855
self.analytics = analytics
5956
self.featureFlagService = featureFlagService
60-
61-
/// the authenticator needs to be initialized with configs
62-
/// to be used for requesting authentication link and handle login later.
63-
WordPressAuthenticator.initializeWithCustomConfigs(dotcomAuthScheme: dotcomAuthScheme)
6457
}
6558

6659
func showBenefitModal() {
@@ -72,7 +65,7 @@ final class JetpackSetupCoordinator {
7265
rootViewController.present(benefitsController, animated: true, completion: nil)
7366
}
7467

75-
func handleAuthenticationUrl(_ url: URL) -> Bool {
68+
func handleAuthenticationUrl(_ url: URL, dotcomAuthScheme: String = ApiCredentials.dotcomAuthScheme) -> Bool {
7669
let expectedPrefix = dotcomAuthScheme + "://" + Constants.magicLinkUrlHostname
7770
guard url.absoluteString.hasPrefix(expectedPrefix) else {
7871
return false

WooCommerce/Classes/ViewRelated/Orders/Order Details/Address Edit/AddressFormViewModel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ open class AddressFormViewModel: ObservableObject {
184184
return StateSelectorViewModel(states: states, selected: selectedStateBinding)
185185
}
186186

187+
func findCountry(by code: String) -> Country? {
188+
allCountries.first { $0.code == code }
189+
}
190+
187191
/// Creates a view model to be used when selecting a country for secondary fields
188192
///
189193
func createSecondaryCountryViewModel() -> CountrySelectorViewModel {

0 commit comments

Comments
 (0)