From 4318ef15312a83419b5ed2309500cf17483bfc83 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Mon, 1 Aug 2022 10:46:05 +1200 Subject: [PATCH 1/6] Fix a code signing issue on Xcode 14 beta 4 --- Podfile | 9 +++++++++ Podfile.lock | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Podfile b/Podfile index 947faff2a63..3c54e291d39 100644 --- a/Podfile +++ b/Podfile @@ -360,5 +360,14 @@ post_install do |installer| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', 'ALPHA=1'] end end + + # Fix a code signing issue in Xcode 14 beta. + # This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1189861270 + # ==================================== + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['CODE_SIGN_IDENTITY'] = '' + end + end # rubocop:enable Style/CombinableLoops end diff --git a/Podfile.lock b/Podfile.lock index 9b56119e7fa..2db67f8e2e5 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -179,6 +179,6 @@ SPEC CHECKSUMS: ZendeskSupportProvidersSDK: 2bdf8544f7cd0fd4c002546f5704b813845beb2a ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba -PODFILE CHECKSUM: 0b413ca49ed0793630b6cffce7d1dabbaf0d2886 +PODFILE CHECKSUM: 3e746ecbe69d5cf22e0377beba8d803003558dd6 COCOAPODS: 1.11.2 From 750f5f887d66e055c78be83b6f6577d97f687e9c Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 30 Aug 2022 17:04:01 +1200 Subject: [PATCH 2/6] On iOS 16, use UIKit to hide or show navigation bar on the HubMenu Fix https://github.com/woocommerce/woocommerce-ios/issues/7393 --- .../Hub Menu/HubMenuViewController.swift | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuViewController.swift b/WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuViewController.swift index 4fb9ffbeefe..c1fa9d5c0b6 100644 --- a/WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuViewController.swift +++ b/WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuViewController.swift @@ -31,6 +31,25 @@ final class HubMenuViewController: UIHostingController { func showPaymentsMenu() { show(InPersonPaymentsMenuViewController(), sender: self) } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + + // We want to hide navigation bar *only* on HubMenu screen. But on iOS 16, the `navigationBarHidden(true)` + // modifier on `HubMenu` view hides the navigation bar for the whole navigation stack. + // Here we manually hide or show navigation bar when entering or leaving the HubMenu screen. + if #available(iOS 16.0, *) { + self.navigationController?.setNavigationBarHidden(true, animated: animated) + } + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + + if #available(iOS 16.0, *) { + self.navigationController?.setNavigationBarHidden(false, animated: animated) + } + } } private extension HubMenuViewController { From ea87d953b2fa204b38de11aedd15dbaedb8c2d4e Mon Sep 17 00:00:00 2001 From: Tony Li Date: Tue, 30 Aug 2022 17:04:25 +1200 Subject: [PATCH 3/6] Assert the correct localized date string based on OS version On iOS 16, `DateFormatter` returns a different localized string for template format 'MMM d, h:mm a', compared to previous iOS versions. Feeback to Apple: FB11335645. --- .../Dashboard/Stats V4/StoreStatsPeriodViewModelTests.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WooCommerce/WooCommerceTests/ViewRelated/Dashboard/Stats V4/StoreStatsPeriodViewModelTests.swift b/WooCommerce/WooCommerceTests/ViewRelated/Dashboard/Stats V4/StoreStatsPeriodViewModelTests.swift index 025427fc317..a0ef9f26d82 100644 --- a/WooCommerce/WooCommerceTests/ViewRelated/Dashboard/Stats V4/StoreStatsPeriodViewModelTests.swift +++ b/WooCommerce/WooCommerceTests/ViewRelated/Dashboard/Stats V4/StoreStatsPeriodViewModelTests.swift @@ -341,7 +341,11 @@ final class StoreStatsPeriodViewModelTests: XCTestCase { viewModel.selectedIntervalIndex = 0 // Then - XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3, 1:00 AM"]) + if #available(iOS 16.0, *) { + XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3 at 1:00 AM"]) + } else { + XCTAssertEqual(timeRangeBarViewModels.map { $0.timeRangeText }, ["Monday, Jan 3", "Monday, Jan 3, 1:00 AM"]) + } } func test_timeRangeBarViewModel_for_thisWeek_is_emitted_twice_after_order_and_visitor_stats_updated_and_selecting_interval() { From af1e24b0a22ce69a89d1b1a4aba9a907c25929d1 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 9 Sep 2022 12:52:07 +1200 Subject: [PATCH 4/6] Explicitly make amount text field lose keyboard focus --- .../Order Creation/PaymentSection/ShippingLineDetails.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WooCommerce/Classes/ViewRelated/Orders/Order Creation/PaymentSection/ShippingLineDetails.swift b/WooCommerce/Classes/ViewRelated/Orders/Order Creation/PaymentSection/ShippingLineDetails.swift index f69a3a616e6..c42d32df14d 100644 --- a/WooCommerce/Classes/ViewRelated/Orders/Order Creation/PaymentSection/ShippingLineDetails.swift +++ b/WooCommerce/Classes/ViewRelated/Orders/Order Creation/PaymentSection/ShippingLineDetails.swift @@ -52,6 +52,9 @@ struct ShippingLineDetails: View { symbol: nil, keyboardType: .default) .accessibilityIdentifier("add-shipping-name-field") + .onTapGesture { + focusAmountInput = false + } } .padding(.horizontal, insets: safeAreaInsets) .addingTopAndBottomDividers() From 2a36b11492ec0b9425bcf55c52b366c92d31060e Mon Sep 17 00:00:00 2001 From: Tony Li Date: Wed, 14 Sep 2022 12:04:07 +1200 Subject: [PATCH 5/6] Use Xcode 14 on CI --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 2f03fb20191..3d77e8296b3 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -8,7 +8,7 @@ common_params: repo: "woocommerce/woocommerce-ios/" # Common environment values to use with the `env` key. - &common_env - IMAGE_ID: xcode-13.4.1 + IMAGE_ID: xcode-14 # This is the default pipeline – it will build and test the app steps: From 0405e145a42e64e802a498f591c82ff51056b8b2 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Wed, 14 Sep 2022 14:36:06 +1200 Subject: [PATCH 6/6] Use iPhone 14 to run UI tests --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 3d77e8296b3..a813967a88b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -68,7 +68,7 @@ steps: # UI Tests ################# - label: "🔬 UI Tests (iPhone)" - command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 11' + command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 14' depends_on: "build" env: *common_env plugins: *common_plugins