Skip to content

Commit 50f651b

Browse files
committed
Merge branch 'develop' into issue/5032-new-push-notification-payload
# Conflicts: # config/Version.Public.xcconfig
2 parents 82c2e68 + bcc0154 commit 50f651b

File tree

150 files changed

+4679
-1145
lines changed

Some content is hidden

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

150 files changed

+4679
-1145
lines changed

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
1919
return true
2020
case .shippingLabelsMultiPackage:
2121
return true
22-
case .whatsNewOnWooCommerce:
23-
return buildConfig == .localDeveloper || buildConfig == .alpha
2422
case .pushNotificationsForAllStores:
2523
return buildConfig == .localDeveloper || buildConfig == .alpha
26-
case .quickPayPrototype:
24+
case .quickOrderPrototype:
25+
return buildConfig == .localDeveloper || buildConfig == .alpha
26+
case .orderListFilters:
27+
return buildConfig == .localDeveloper || buildConfig == .alpha
28+
case .filterProductsByCategory:
2729
return buildConfig == .localDeveloper || buildConfig == .alpha
2830
default:
2931
return true

Experiments/Experiments/FeatureFlag.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,19 @@ public enum FeatureFlag: Int {
3838
///
3939
case shippingLabelsMultiPackage
4040

41-
/// Display "What's new on WooCommerce" on App Launch and App Settings
42-
///
43-
case whatsNewOnWooCommerce
44-
4541
/// Push notifications for all stores
4642
///
4743
case pushNotificationsForAllStores
4844

49-
/// Allows to create quick pay orders
45+
/// Allows to create quick order orders
46+
///
47+
case quickOrderPrototype
48+
49+
/// Display the bar for displaying the filters in the Order List
50+
///
51+
case orderListFilters
52+
53+
/// Allows to filter products by a product category, persisting it so the filter can remain after restarting the app
5054
///
51-
case quickPayPrototype
55+
case filterProductsByCategory
5256
}

Networking/Networking/Model/Product/StoredProductSettings.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ public struct StoredProductSettings: Codable, Equatable, GeneratedFakeable {
1212
public let stockStatusFilter: ProductStockStatus?
1313
public let productStatusFilter: ProductStatus?
1414
public let productTypeFilter: ProductType?
15+
public let productCategoryFilter: ProductCategory?
1516

1617
public init(siteID: Int64,
1718
sort: String?,
1819
stockStatusFilter: ProductStockStatus?,
1920
productStatusFilter: ProductStatus?,
20-
productTypeFilter: ProductType?) {
21+
productTypeFilter: ProductType?,
22+
productCategoryFilter: ProductCategory?) {
2123
self.siteID = siteID
2224
self.sort = sort
2325
self.stockStatusFilter = stockStatusFilter
2426
self.productStatusFilter = productStatusFilter
2527
self.productTypeFilter = productTypeFilter
28+
self.productCategoryFilter = productCategoryFilter
2629
}
2730

2831
public func numberOfActiveFilters() -> Int {
@@ -36,6 +39,11 @@ public struct StoredProductSettings: Codable, Equatable, GeneratedFakeable {
3639
if productTypeFilter != nil {
3740
total += 1
3841
}
42+
43+
if productCategoryFilter != nil {
44+
total += 1
45+
}
46+
3947
return total
4048
}
4149
}

Networking/Networking/Network/MockNetwork.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ class MockNetwork: Network {
3131
///
3232
required init(credentials: Credentials) { }
3333

34-
/// Dummy convenience initializer. Remember: Real Network wrappers will allways need credentials!
34+
/// Dummy convenience initializer. Remember: Real Network wrappers will always need credentials!
3535
///
36-
/// Note: If the useResponseQueue param is `true`, any repsonses added via `simulateResponse` will stored in a FIFO queue
37-
/// and used once for a matching request (then removed from the queue). Subsuquent requests will use the next response in the queue, and so on.
36+
/// Note: If the useResponseQueue param is `true`, any responses added via `simulateResponse` will stored in a FIFO queue
37+
/// and used once for a matching request (then removed from the queue). Subsequent requests will use the next response in the queue, and so on.
3838
///
39-
/// If the useResponseQueue param is `false`, any repsonses added via `simulateResponse` will stored in an array and can
39+
/// If the useResponseQueue param is `false`, any responses added via `simulateResponse` will stored in an array and can
4040
/// be reused multiple times.
4141
///
4242
/// - Parameter useResponseQueue: Use the response queue. Default is `false`.

Networking/Networking/Remote/OrdersRemote.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ public class OrdersRemote: Remote {
99
/// - Parameters:
1010
/// - siteID: Site for which we'll fetch remote orders.
1111
/// - status: Filters the Orders by the specified Status, if any.
12-
/// - before: If given, exclude orders created before this date/time. Passing a local date is fine. This
12+
/// - after: If given, limit response to orders published after a given compliant date. Passing a local date is fine. This
13+
/// method will convert it to UTC ISO 8601 before calling the REST API.
14+
/// - before: If given, limit response to resources published before a given compliant date.. Passing a local date is fine. This
1315
/// method will convert it to UTC ISO 8601 before calling the REST API.
1416
/// - pageNumber: Number of page that should be retrieved.
1517
/// - pageSize: Number of Orders to be retrieved per page.
1618
/// - completion: Closure to be executed upon completion.
1719
///
1820
public func loadAllOrders(for siteID: Int64,
1921
statusKey: String? = nil,
22+
after: Date? = nil,
2023
before: Date? = nil,
2124
pageNumber: Int = Defaults.pageNumber,
2225
pageSize: Int = Defaults.pageSize,
@@ -31,6 +34,9 @@ public class OrdersRemote: Remote {
3134
ParameterKeys.fields: ParameterValues.listFieldValues,
3235
]
3336

37+
if let after = after {
38+
parameters[ParameterKeys.after] = utcDateFormatter.string(from: after)
39+
}
3440
if let before = before {
3541
parameters[ParameterKeys.before] = utcDateFormatter.string(from: before)
3642
}
@@ -233,6 +239,7 @@ public extension OrdersRemote {
233239
static let perPage: String = "per_page"
234240
static let statusKey: String = "status"
235241
static let fields: String = "_fields"
242+
static let after: String = "after"
236243
static let before: String = "before"
237244
}
238245

RELEASE-NOTES.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
7.9
44
-----
55
- [*] Fix: after disconnecting a site or connecting to a new site, the sites in site picker (Settings > Switch Store) should be updated accordingly. The only exception is when the newly disconnected site is the currently selected site. [https://github.com/woocommerce/woocommerce-ios/pull/5241]
6-
6+
- [*] Order Details: Show a button on the "Product" section of Order Details screen to allow recreating shipping labels. [https://github.com/woocommerce/woocommerce-ios/pull/5255]
7+
- [*] Edit Order Address - Enable `Done` button when `Use as {Shipping/Billing} Address` toggle is turned on. [https://github.com/woocommerce/woocommerce-ios/pull/5254]
8+
- [*] Add/Edit Product: fix an issue where the product name keyboard is English only. [https://github.com/woocommerce/woocommerce-ios/pull/5288]
79

810
7.8
911
-----

Storage/Storage.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@
297297
26EA01D024EC3AEA00176A57 /* FeedbackType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedbackType.swift; sourceTree = "<group>"; };
298298
26EA01D424EC44B300176A57 /* GeneralAppSettingsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralAppSettingsTests.swift; sourceTree = "<group>"; };
299299
26F4E7F12566193500EA633B /* Model 39.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 39.xcdatamodel"; sourceTree = "<group>"; };
300+
31C1D22D2727204200EDEE49 /* Model 56.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 56.xcdatamodel"; sourceTree = "<group>"; };
300301
31D9C881266844B8000AC134 /* Model 52.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 52.xcdatamodel"; sourceTree = "<group>"; };
301302
31D9C8C626684AEC000AC134 /* PaymentGatewayAccount+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "PaymentGatewayAccount+CoreDataClass.swift"; path = "../../../PaymentGatewayAccount+CoreDataClass.swift"; sourceTree = "<group>"; };
302303
31D9C8C726684AEC000AC134 /* PaymentGatewayAccount+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "PaymentGatewayAccount+CoreDataProperties.swift"; path = "../../../PaymentGatewayAccount+CoreDataProperties.swift"; sourceTree = "<group>"; };
@@ -1686,6 +1687,7 @@
16861687
B59E11D820A9D00C004121A4 /* WooCommerce.xcdatamodeld */ = {
16871688
isa = XCVersionGroup;
16881689
children = (
1690+
31C1D22D2727204200EDEE49 /* Model 56.xcdatamodel */,
16891691
DE126D1026CE5A28007F901D /* Model 55.xcdatamodel */,
16901692
077F39C2269F1E2F00ABEADC /* Model 54.xcdatamodel */,
16911693
45E462022684B86F00011BF2 /* Model 53.xcdatamodel */,
@@ -1742,7 +1744,7 @@
17421744
746A9D14214071F90013F6FF /* Model 2.xcdatamodel */,
17431745
B59E11D920A9D00C004121A4 /* Model.xcdatamodel */,
17441746
);
1745-
currentVersion = DE126D1026CE5A28007F901D /* Model 55.xcdatamodel */;
1747+
currentVersion = 31C1D22D2727204200EDEE49 /* Model 56.xcdatamodel */;
17461748
path = WooCommerce.xcdatamodeld;
17471749
sourceTree = "<group>";
17481750
versionGroupType = wrapper.xcdatamodel;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ extension GeneralAppSettings {
99
installationDate: NullableCopiableProp<Date> = .copy,
1010
feedbacks: CopiableProp<[FeedbackType: FeedbackSettings]> = .copy,
1111
isViewAddOnsSwitchEnabled: CopiableProp<Bool> = .copy,
12+
isQuickOrderSwitchEnabled: CopiableProp<Bool> = .copy,
1213
knownCardReaders: CopiableProp<[String]> = .copy,
1314
lastEligibilityErrorInfo: NullableCopiableProp<EligibilityErrorInfo> = .copy
1415
) -> GeneralAppSettings {
1516
let installationDate = installationDate ?? self.installationDate
1617
let feedbacks = feedbacks ?? self.feedbacks
1718
let isViewAddOnsSwitchEnabled = isViewAddOnsSwitchEnabled ?? self.isViewAddOnsSwitchEnabled
19+
let isQuickOrderSwitchEnabled = isQuickOrderSwitchEnabled ?? self.isQuickOrderSwitchEnabled
1820
let knownCardReaders = knownCardReaders ?? self.knownCardReaders
1921
let lastEligibilityErrorInfo = lastEligibilityErrorInfo ?? self.lastEligibilityErrorInfo
2022

2123
return GeneralAppSettings(
2224
installationDate: installationDate,
2325
feedbacks: feedbacks,
2426
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
27+
isQuickOrderSwitchEnabled: isQuickOrderSwitchEnabled,
2528
knownCardReaders: knownCardReaders,
2629
lastEligibilityErrorInfo: lastEligibilityErrorInfo
2730
)

Storage/Storage/Model/GeneralAppSettings.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
2424
///
2525
public let isViewAddOnsSwitchEnabled: Bool
2626

27+
/// The state(`true` or `false`) for the Quick Order feature switch.
28+
///
29+
public let isQuickOrderSwitchEnabled: Bool
30+
2731
/// A list (possibly empty) of known card reader IDs - i.e. IDs of card readers that should be reconnected to automatically
2832
/// e.g. ["CHB204909005931"]
2933
///
@@ -36,11 +40,13 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
3640
public init(installationDate: Date?,
3741
feedbacks: [FeedbackType: FeedbackSettings],
3842
isViewAddOnsSwitchEnabled: Bool,
43+
isQuickOrderSwitchEnabled: Bool,
3944
knownCardReaders: [String],
4045
lastEligibilityErrorInfo: EligibilityErrorInfo? = nil) {
4146
self.installationDate = installationDate
4247
self.feedbacks = feedbacks
4348
self.isViewAddOnsSwitchEnabled = isViewAddOnsSwitchEnabled
49+
self.isQuickOrderSwitchEnabled = isQuickOrderSwitchEnabled
4450
self.knownCardReaders = knownCardReaders
4551
self.lastEligibilityErrorInfo = lastEligibilityErrorInfo
4652
}
@@ -66,8 +72,27 @@ public struct GeneralAppSettings: Codable, Equatable, GeneratedCopiable {
6672
installationDate: installationDate,
6773
feedbacks: updatedFeedbacks,
6874
isViewAddOnsSwitchEnabled: isViewAddOnsSwitchEnabled,
75+
isQuickOrderSwitchEnabled: isQuickOrderSwitchEnabled,
6976
knownCardReaders: knownCardReaders,
7077
lastEligibilityErrorInfo: lastEligibilityErrorInfo
7178
)
7279
}
7380
}
81+
82+
//// MARK: Custom Decoding
83+
extension GeneralAppSettings {
84+
/// We need a custom decoding to make sure it doesn't fails when this type is updated (eg: when adding/removing new properties)
85+
/// Otherwise we will lose previously stored information.
86+
public init(from decoder: Decoder) throws {
87+
let container = try decoder.container(keyedBy: CodingKeys.self)
88+
89+
self.installationDate = try container.decodeIfPresent(Date.self, forKey: .installationDate)
90+
self.feedbacks = try container.decodeIfPresent([FeedbackType: FeedbackSettings].self, forKey: .feedbacks) ?? [:]
91+
self.isViewAddOnsSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isViewAddOnsSwitchEnabled) ?? false
92+
self.isQuickOrderSwitchEnabled = try container.decodeIfPresent(Bool.self, forKey: .isQuickOrderSwitchEnabled) ?? false
93+
self.knownCardReaders = try container.decodeIfPresent([String].self, forKey: .knownCardReaders) ?? []
94+
self.lastEligibilityErrorInfo = try container.decodeIfPresent(EligibilityErrorInfo.self, forKey: .lastEligibilityErrorInfo)
95+
96+
// Decode new properties with `decodeIfPresent` and provide a default value if necessary.
97+
}
98+
}

Storage/Storage/Model/MIGRATIONS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
This file documents changes in the WCiOS Storage data model. Please explain any changes to the data model as well as any custom migrations.
44

5+
## Model 56 (Release 7.9.0.0)
6+
- @allendav 2021-10-25
7+
- Added `active` attribute to `SystemPlugin` entity
8+
59
## Model 55 (Release 7.5.0.0)
610
- @itsmeichigo 2021-08-19
711
- Added `commercialInvoiceURL` attribute to `ShippingLabel` entity.

0 commit comments

Comments
 (0)