Skip to content

Commit db79ed3

Browse files
Merge branch 'trunk' into feat/8166-native-jetpack-installation-ab-testing
2 parents 79c4120 + 9ab67ff commit db79ed3

File tree

88 files changed

+2811
-845
lines changed

Some content is hidden

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

88 files changed

+2811
-845
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ common_params:
1111
repo: "automattic/woocommerce-ios/"
1212
# Common environment values to use with the `env` key.
1313
- &common_env
14+
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
1415
IMAGE_ID: xcode-14
1516

1617
# This is the default pipeline – it will build and test the app

.buildkite/release-builds.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ common_params:
1313
repo: "automattic/woocommerce-ios/"
1414
# Common environment values to use with the `env` key.
1515
- &common_env
16+
# Be sure to also update the `.xcode-version` file when updating the Xcode image/version here
1617
IMAGE_ID: xcode-14
1718

1819
steps:

.xcode-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~> 14.0

.xcversion

Lines changed: 0 additions & 1 deletion
This file was deleted.

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
3737
return true
3838
case .storeCreationM2:
3939
return buildConfig == .localDeveloper || buildConfig == .alpha
40+
case .storeCreationM2WithInAppPurchasesEnabled:
41+
return false
4042
case .justInTimeMessagesOnDashboard:
4143
return true
4244
case .systemStatusReportInSupportRequest:

Experiments/Experiments/FeatureFlag.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ public enum FeatureFlag: Int {
7878
///
7979
case storeCreationM2
8080

81+
/// Whether in-app purchases are enabled for store creation milestone 2 behind `storeCreationM2` feature flag.
82+
/// If disabled, mock in-app purchases are provided by `MockInAppPurchases`.
83+
///
84+
case storeCreationM2WithInAppPurchasesEnabled
85+
8186
/// Just In Time Messages on Dashboard
8287
///
8388
case justInTimeMessagesOnDashboard

Fakes/Fakes/Networking.generated.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,8 @@ extension Networking.OrderStatsV4Totals {
604604
taxes: .fake(),
605605
shipping: .fake(),
606606
netRevenue: .fake(),
607-
totalProducts: .fake()
607+
totalProducts: .fake(),
608+
averageOrderValue: .fake()
608609
)
609610
}
610611
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,8 @@ extension Networking.OrderStatsV4Totals {
729729
taxes: CopiableProp<Decimal> = .copy,
730730
shipping: CopiableProp<Decimal> = .copy,
731731
netRevenue: CopiableProp<Decimal> = .copy,
732-
totalProducts: NullableCopiableProp<Int> = .copy
732+
totalProducts: NullableCopiableProp<Int> = .copy,
733+
averageOrderValue: CopiableProp<Decimal> = .copy
733734
) -> Networking.OrderStatsV4Totals {
734735
let totalOrders = totalOrders ?? self.totalOrders
735736
let totalItemsSold = totalItemsSold ?? self.totalItemsSold
@@ -741,6 +742,7 @@ extension Networking.OrderStatsV4Totals {
741742
let shipping = shipping ?? self.shipping
742743
let netRevenue = netRevenue ?? self.netRevenue
743744
let totalProducts = totalProducts ?? self.totalProducts
745+
let averageOrderValue = averageOrderValue ?? self.averageOrderValue
744746

745747
return Networking.OrderStatsV4Totals(
746748
totalOrders: totalOrders,
@@ -752,7 +754,8 @@ extension Networking.OrderStatsV4Totals {
752754
taxes: taxes,
753755
shipping: shipping,
754756
netRevenue: netRevenue,
755-
totalProducts: totalProducts
757+
totalProducts: totalProducts,
758+
averageOrderValue: averageOrderValue
756759
)
757760
}
758761
}

Networking/Networking/Model/Stats/OrderStatsV4Totals.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public struct OrderStatsV4Totals: Decodable, Equatable, GeneratedCopiable, Gener
1313
public let shipping: Decimal
1414
public let netRevenue: Decimal
1515
public let totalProducts: Int?
16+
public let averageOrderValue: Decimal
1617

1718
public init(totalOrders: Int,
1819
totalItemsSold: Int,
@@ -23,7 +24,8 @@ public struct OrderStatsV4Totals: Decodable, Equatable, GeneratedCopiable, Gener
2324
taxes: Decimal,
2425
shipping: Decimal,
2526
netRevenue: Decimal,
26-
totalProducts: Int?) {
27+
totalProducts: Int?,
28+
averageOrderValue: Decimal) {
2729
self.totalOrders = totalOrders
2830
self.totalItemsSold = totalItemsSold
2931
self.grossRevenue = grossRevenue
@@ -34,6 +36,7 @@ public struct OrderStatsV4Totals: Decodable, Equatable, GeneratedCopiable, Gener
3436
self.shipping = shipping
3537
self.netRevenue = netRevenue
3638
self.totalProducts = totalProducts
39+
self.averageOrderValue = averageOrderValue
3740
}
3841

3942
public init(from decoder: Decoder) throws {
@@ -48,6 +51,7 @@ public struct OrderStatsV4Totals: Decodable, Equatable, GeneratedCopiable, Gener
4851
let shipping = try container.decode(Decimal.self, forKey: .shipping)
4952
let netRevenue = try container.decode(Decimal.self, forKey: .netRevenue)
5053
let totalProducts = try container.decodeIfPresent(Int.self, forKey: .products)
54+
let averageOrderValue = try container.decode(Decimal.self, forKey: .averageOrderValue)
5155

5256
self.init(totalOrders: totalOrders,
5357
totalItemsSold: totalItemsSold,
@@ -58,7 +62,8 @@ public struct OrderStatsV4Totals: Decodable, Equatable, GeneratedCopiable, Gener
5862
taxes: taxes,
5963
shipping: shipping,
6064
netRevenue: netRevenue,
61-
totalProducts: totalProducts)
65+
totalProducts: totalProducts,
66+
averageOrderValue: averageOrderValue)
6267
}
6368
}
6469

@@ -77,5 +82,6 @@ private extension OrderStatsV4Totals {
7782
case shipping
7883
case netRevenue = "net_revenue"
7984
case products
85+
case averageOrderValue = "avg_order_value"
8086
}
8187
}

Networking/Networking/Remote/AccountRemote.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public protocol AccountRemoteProtocol {
1313
func checkIfWooCommerceIsActive(for siteID: Int64) -> AnyPublisher<Result<Bool, Error>, Never>
1414
func fetchWordPressSiteSettings(for siteID: Int64) -> AnyPublisher<Result<WordPressSiteSettings, Error>, Never>
1515
func loadSitePlan(for siteID: Int64, completion: @escaping (Result<SitePlan, Error>) -> Void)
16-
func loadUsernameSuggestions(from text: String) async -> Result<[String], Error>
16+
func loadUsernameSuggestions(from text: String) async throws -> [String]
1717

1818
/// Creates a WPCOM account with the given email and password.
1919
/// - Parameters:
@@ -131,17 +131,15 @@ public class AccountRemote: Remote, AccountRemoteProtocol {
131131
enqueue(request, mapper: mapper, completion: completion)
132132
}
133133

134-
public func loadUsernameSuggestions(from text: String) async -> Result<[String], Error> {
134+
public func loadUsernameSuggestions(from text: String) async throws -> [String] {
135135
let path = Path.usernameSuggestions
136136
let parameters = [ParameterKey.name: text]
137137
let request = DotcomRequest(wordpressApiVersion: .wpcomMark2, method: .get, path: path, parameters: parameters)
138-
do {
139-
let result: [String: [String]] = try await enqueue(request)
140-
let suggestions = result["suggestions"] ?? []
141-
return .success(suggestions)
142-
} catch {
143-
return .failure(error)
144-
}
138+
139+
let result: [String: [String]] = try await enqueue(request)
140+
let suggestions = result["suggestions"] ?? []
141+
142+
return suggestions
145143
}
146144

147145
public func createAccount(email: String,

0 commit comments

Comments
 (0)