Skip to content

Commit 137cb8d

Browse files
committed
Merge branch 'trunk' into feat/6966-reset-stats-sync-ts-after-orders
* trunk: (40 commits) Rename widgets target entitlements to be consistent with app target Increase debounce to 0.3s to allow scrolling on slower devices. Explicitly define app groups in app and widget targets entitlements Remove reference to removed IOS_VERSION variable Remove ios_version parameter from test_without_building lane Update test for loadAndsyncSite when forcedUpdate Restore and fix Unit Test for syncSites when JCP Removed WordPressComSiteInfo+Woo extension Update description comment Encapsulate universal links tracking events into WooAnalyticsEvent instances. 7655 Rename PluginWebView to AuthenticatedWebView Fix an issue where UI tests for iPad isn't running on iPad Add woo logo to widgets target Adds Basic UI for non conected store Update Widgets text to render correctly on dark mode Rename WordPressComSiteInfoWooTests Pass string instead of URL to avoid crashing Tracks 7633 Add Payment Gateway fetch fix to release notes 7633 Refresh PaymentGateway on Payment Menu open Remove jetpackConnectionPackageSupport flag ... # Conflicts: # WooCommerce/Classes/ViewRelated/Dashboard/Stats v4/StoreStatsAndTopPerformersViewController.swift
2 parents 4a52c61 + fdd4c16 commit 137cb8d

File tree

53 files changed

+896
-711
lines changed

Some content is hidden

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

53 files changed

+896
-711
lines changed

.buildkite/commands/run-ui-tests.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
TEST_NAME=$1
44
DEVICE=$2
5-
IOS_VERSION=$3
65

7-
echo "Running $TEST_NAME on $DEVICE for iOS $IOS_VERSION"
6+
echo "Running $TEST_NAME on $DEVICE"
87

98
# Run this at the start to fail early if value not available
109
echo '--- :test-analytics: Configuring Test Analytics'
@@ -36,7 +35,7 @@ echo "--- 🧪 Testing"
3635
xcrun simctl list >> /dev/null
3736
rake mocks &
3837
set +e
39-
bundle exec fastlane test_without_building name:"$TEST_NAME" device:"$DEVICE" ios_version:"$IOS_VERSION"
38+
bundle exec fastlane test_without_building name:"$TEST_NAME" device:"$DEVICE"
4039
TESTS_EXIT_STATUS=$?
4140
set -e
4241

.buildkite/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ steps:
6868
# UI Tests
6969
#################
7070
- label: "🔬 UI Tests (iPhone)"
71-
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 11' 15.0
71+
command: .buildkite/commands/run-ui-tests.sh UITests 'iPhone 11'
7272
depends_on: "build"
7373
env: *common_env
7474
plugins: *common_plugins
@@ -79,7 +79,7 @@ steps:
7979
context: "UI Tests (iPhone)"
8080

8181
- label: "🔬 UI Tests (iPad)"
82-
command: .buildkite/commands/run-ui-tests.sh UITests "iPad Air (4th generation)" 15.0
82+
command: .buildkite/commands/run-ui-tests.sh UITests "iPad Air (5th generation)"
8383
depends_on: "build"
8484
env: *common_env
8585
plugins: *common_plugins

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 0 additions & 2 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 .jetpackConnectionPackageSupport:
11-
return true
1210
case .couponView:
1311
return true
1412
case .productSKUInputScanner:

Experiments/Experiments/FeatureFlag.swift

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

17-
/// Allows sites with plugins that include Jetpack Connection Package and without Jetpack-the-plugin to connect to the app
18-
///
19-
case jetpackConnectionPackageSupport
20-
2117
/// Displays the option to view coupons
2218
///
2319
case couponView

RELEASE-NOTES.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
10.3
44
-----
5-
5+
- [*] 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]
6+
- [*] 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]
7+
- [*] 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]
68

79
10.2
810
-----

Storage/Storage/Model/Copiable/Models+Copiable.generated.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,23 @@ extension GeneralStoreSettings {
6161
telemetryLastReportedTime: NullableCopiableProp<Date> = .copy,
6262
areSimplePaymentTaxesEnabled: CopiableProp<Bool> = .copy,
6363
preferredInPersonPaymentGateway: NullableCopiableProp<String> = .copy,
64-
skippedCashOnDeliveryOnboardingStep: CopiableProp<Bool> = .copy
64+
skippedCashOnDeliveryOnboardingStep: CopiableProp<Bool> = .copy,
65+
lastSelectedStatsTimeRange: CopiableProp<String> = .copy
6566
) -> GeneralStoreSettings {
6667
let isTelemetryAvailable = isTelemetryAvailable ?? self.isTelemetryAvailable
6768
let telemetryLastReportedTime = telemetryLastReportedTime ?? self.telemetryLastReportedTime
6869
let areSimplePaymentTaxesEnabled = areSimplePaymentTaxesEnabled ?? self.areSimplePaymentTaxesEnabled
6970
let preferredInPersonPaymentGateway = preferredInPersonPaymentGateway ?? self.preferredInPersonPaymentGateway
7071
let skippedCashOnDeliveryOnboardingStep = skippedCashOnDeliveryOnboardingStep ?? self.skippedCashOnDeliveryOnboardingStep
72+
let lastSelectedStatsTimeRange = lastSelectedStatsTimeRange ?? self.lastSelectedStatsTimeRange
7173

7274
return GeneralStoreSettings(
7375
isTelemetryAvailable: isTelemetryAvailable,
7476
telemetryLastReportedTime: telemetryLastReportedTime,
7577
areSimplePaymentTaxesEnabled: areSimplePaymentTaxesEnabled,
7678
preferredInPersonPaymentGateway: preferredInPersonPaymentGateway,
77-
skippedCashOnDeliveryOnboardingStep: skippedCashOnDeliveryOnboardingStep
79+
skippedCashOnDeliveryOnboardingStep: skippedCashOnDeliveryOnboardingStep,
80+
lastSelectedStatsTimeRange: lastSelectedStatsTimeRange
7881
)
7982
}
8083
}

Storage/Storage/Model/GeneralStoreSettings.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,21 @@ public struct GeneralStoreSettings: Codable, Equatable, GeneratedCopiable {
3737
///
3838
public let skippedCashOnDeliveryOnboardingStep: Bool
3939

40+
/// The raw value string of `StatsTimeRangeV4` that indicates the last selected time range tab in store stats.
41+
public var lastSelectedStatsTimeRange: String
42+
4043
public init(isTelemetryAvailable: Bool = false,
4144
telemetryLastReportedTime: Date? = nil,
4245
areSimplePaymentTaxesEnabled: Bool = false,
4346
preferredInPersonPaymentGateway: String? = nil,
44-
skippedCashOnDeliveryOnboardingStep: Bool = false) {
47+
skippedCashOnDeliveryOnboardingStep: Bool = false,
48+
lastSelectedStatsTimeRange: String = "") {
4549
self.isTelemetryAvailable = isTelemetryAvailable
4650
self.telemetryLastReportedTime = telemetryLastReportedTime
4751
self.areSimplePaymentTaxesEnabled = areSimplePaymentTaxesEnabled
4852
self.preferredInPersonPaymentGateway = preferredInPersonPaymentGateway
4953
self.skippedCashOnDeliveryOnboardingStep = skippedCashOnDeliveryOnboardingStep
54+
self.lastSelectedStatsTimeRange = lastSelectedStatsTimeRange
5055
}
5156
}
5257

@@ -62,6 +67,7 @@ extension GeneralStoreSettings {
6267
self.areSimplePaymentTaxesEnabled = try container.decodeIfPresent(Bool.self, forKey: .areSimplePaymentTaxesEnabled) ?? false
6368
self.preferredInPersonPaymentGateway = try container.decodeIfPresent(String.self, forKey: .preferredInPersonPaymentGateway)
6469
self.skippedCashOnDeliveryOnboardingStep = try container.decodeIfPresent(Bool.self, forKey: .skippedCashOnDeliveryOnboardingStep) ?? false
70+
self.lastSelectedStatsTimeRange = try container.decodeIfPresent(String.self, forKey: .lastSelectedStatsTimeRange) ?? ""
6571

6672
// Decode new properties with `decodeIfPresent` and provide a default value if necessary.
6773
}

WooCommerce/Classes/Analytics/WooAnalyticsEvent.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,3 +1574,20 @@ extension WooAnalyticsEvent {
15741574
}
15751575
}
15761576
}
1577+
1578+
// MARK: - Universal Links
1579+
//
1580+
extension WooAnalyticsEvent {
1581+
enum Key: String {
1582+
case path = "path"
1583+
case url = "url"
1584+
}
1585+
1586+
static func universalLinkOpened(with path: String) -> WooAnalyticsEvent {
1587+
WooAnalyticsEvent(statName: .universalLinkOpened, properties: [Key.path.rawValue: path])
1588+
}
1589+
1590+
static func universalLinkFailed(with url: URL) -> WooAnalyticsEvent {
1591+
WooAnalyticsEvent(statName: .universalLinkFailed, properties: [Key.url.rawValue: url.absoluteString])
1592+
}
1593+
}

WooCommerce/Classes/Analytics/WooAnalyticsStat.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,10 @@ public enum WooAnalyticsStat: String {
676676

677677
// MARK: Payments Menu
678678
case pluginsNotSyncedYet = "plugins_not_synced_yet"
679+
680+
// MARK: Universal Links
681+
case universalLinkOpened = "universal_link_opened"
682+
case universalLinkFailed = "universal_link_failed"
679683
}
680684

681685
public extension WooAnalyticsStat {

WooCommerce/Classes/Authentication/Navigation Exceptions/PluginSetupWebViewController.swift renamed to WooCommerce/Classes/Authentication/AuthenticatedWebViewController.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import Combine
22
import UIKit
33
import WebKit
44

5-
/// The web view to handle plugin setup in the login flow.
5+
/// A web view which is authenticated for WordPress.com, when possible.
66
///
7-
final class PluginSetupWebViewController: UIViewController {
7+
final class AuthenticatedWebViewController: UIViewController {
88

9-
private let viewModel: PluginSetupWebViewModel
9+
private let viewModel: AuthenticatedWebViewModel
1010

1111
/// Main web view
1212
private lazy var webView: WKWebView = {
@@ -26,7 +26,7 @@ final class PluginSetupWebViewController: UIViewController {
2626
/// Strong reference for the subscription to update progress bar
2727
private var subscriptions: Set<AnyCancellable> = []
2828

29-
init(viewModel: PluginSetupWebViewModel) {
29+
init(viewModel: AuthenticatedWebViewModel) {
3030
self.viewModel = viewModel
3131
super.init(nibName: nil, bundle: nil)
3232
}
@@ -51,7 +51,7 @@ final class PluginSetupWebViewController: UIViewController {
5151
}
5252
}
5353

54-
private extension PluginSetupWebViewController {
54+
private extension AuthenticatedWebViewController {
5555
func configureNavigationBar() {
5656
title = viewModel.title
5757
}
@@ -104,7 +104,7 @@ private extension PluginSetupWebViewController {
104104
}
105105
}
106106

107-
extension PluginSetupWebViewController: WKNavigationDelegate {
107+
extension AuthenticatedWebViewController: WKNavigationDelegate {
108108
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction) async -> WKNavigationActionPolicy {
109109
guard let navigationURL = navigationAction.request.url else {
110110
return .allow

0 commit comments

Comments
 (0)