Skip to content

Commit f53ebfb

Browse files
Merge branch 'trunk' into merge/12.1-final-into-trunk
2 parents 857de3d + a532628 commit f53ebfb

File tree

84 files changed

+2836
-349
lines changed

Some content is hidden

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

84 files changed

+2836
-349
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!--
22
Contains editorialized release notes. Raw release notes should go into `RELEASE-NOTES.txt`.
33
-->
4+
## 12.2
5+
We’ve made a few enhancements to manage your business. It’s now easier to set up your store when logging in. Adding attributes from the app just became a whole lot easier! Keep your feedback coming!
6+
47
## 12.1
58
This release includes a few bug fixes and improvements to products and in person payments. Please continue to send us feedback – we are listening!
69

Experiments/Experiments/DefaultFeatureFlagService.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
5959
return buildConfig == .localDeveloper
6060
case .domainSettings:
6161
return buildConfig == .localDeveloper || buildConfig == .alpha
62+
case .supportRequests:
63+
return buildConfig == .localDeveloper || buildConfig == .alpha
6264
default:
6365
return true
6466
}

Experiments/Experiments/FeatureFlag.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,8 @@ public enum FeatureFlag: Int {
141141
/// Whether to enable domain updates from the settings for a WPCOM site.
142142
///
143143
case domainSettings
144+
145+
/// Whether to enable the new support request form.
146+
///
147+
case supportRequests
144148
}

Fakes/Fakes/Networking.generated.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,25 @@ extension Networking.Customer {
196196
)
197197
}
198198
}
199+
extension Networking.DomainContactInfo {
200+
/// Returns a "ready to use" type filled with fake values.
201+
///
202+
public static func fake() -> Networking.DomainContactInfo {
203+
.init(
204+
firstName: .fake(),
205+
lastName: .fake(),
206+
organization: .fake(),
207+
address1: .fake(),
208+
address2: .fake(),
209+
postcode: .fake(),
210+
city: .fake(),
211+
state: .fake(),
212+
countryCode: .fake(),
213+
phone: .fake(),
214+
email: .fake()
215+
)
216+
}
217+
}
199218
extension DotcomError {
200219
/// Returns a "ready to use" type filled with fake values.
201220
///

Networking/Networking.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
0219B03923964BB3007DCD5E /* ProductShippingClassMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0219B03823964BB3007DCD5E /* ProductShippingClassMapper.swift */; };
2626
021A84DA257DF92800BC71D1 /* ShippingLabelRefundMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021A84D9257DF92800BC71D1 /* ShippingLabelRefundMapper.swift */; };
2727
021C7BF723863D1800A3BCBD /* Encodable+Serialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021C7BF623863D1800A3BCBD /* Encodable+Serialization.swift */; };
28+
021D741C2987B1550035687E /* checkout-doman-cart-with-domain-credit-success.json in Resources */ = {isa = PBXBuildFile; fileRef = 021D741B2987B1550035687E /* checkout-doman-cart-with-domain-credit-success.json */; };
2829
021E2A1423A9FC5900B1DE07 /* ProductBackordersSetting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021E2A1323A9FC5900B1DE07 /* ProductBackordersSetting.swift */; };
2930
021EAA5625493B3600AA8CCD /* OrderItemAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021EAA5525493B3600AA8CCD /* OrderItemAttribute.swift */; };
3031
022902D422E2436400059692 /* stats_module_disabled_error.json in Resources */ = {isa = PBXBuildFile; fileRef = 022902D122E2436300059692 /* stats_module_disabled_error.json */; };
@@ -93,6 +94,9 @@
9394
02C254B925637BA000A04423 /* OrderShippingLabelListMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C254B825637BA000A04423 /* OrderShippingLabelListMapper.swift */; };
9495
02C254D32563992900A04423 /* OrderShippingLabelListMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C254D22563992900A04423 /* OrderShippingLabelListMapperTests.swift */; };
9596
02C254D72563999300A04423 /* order-shipping-labels.json in Resources */ = {isa = PBXBuildFile; fileRef = 02C254D62563999200A04423 /* order-shipping-labels.json */; };
97+
02C4325F298A55D100F14AEE /* domain-contact-info.json in Resources */ = {isa = PBXBuildFile; fileRef = 02C4325C298A55D100F14AEE /* domain-contact-info.json */; };
98+
02C43260298A55D100F14AEE /* validate-domain-contact-info-failure.json in Resources */ = {isa = PBXBuildFile; fileRef = 02C4325D298A55D100F14AEE /* validate-domain-contact-info-failure.json */; };
99+
02C43261298A55D100F14AEE /* validate-domain-contact-info-success.json in Resources */ = {isa = PBXBuildFile; fileRef = 02C4325E298A55D100F14AEE /* validate-domain-contact-info-success.json */; };
96100
02C54CC624D3E938007D658F /* product-variations-load-all-manage-stock-two-states.json in Resources */ = {isa = PBXBuildFile; fileRef = 02C54CC524D3E937007D658F /* product-variations-load-all-manage-stock-two-states.json */; };
97101
02DD6492248A3EC00082523E /* product-external.json in Resources */ = {isa = PBXBuildFile; fileRef = 02DD6491248A3EC00082523E /* product-external.json */; };
98102
02E7FFCB256218F600C53030 /* ShippingLabelRemoteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02E7FFCA256218F600C53030 /* ShippingLabelRemoteTests.swift */; };
@@ -102,6 +106,7 @@
102106
02EF1670292F0CF400D90AD6 /* create-cart-success.json in Resources */ = {isa = PBXBuildFile; fileRef = 02EF166F292F0CF400D90AD6 /* create-cart-success.json */; };
103107
02EF1672292F0D1900D90AD6 /* load-plan-success.json in Resources */ = {isa = PBXBuildFile; fileRef = 02EF1671292F0D1900D90AD6 /* load-plan-success.json */; };
104108
02F096C22406691100C0C1D5 /* media-library.json in Resources */ = {isa = PBXBuildFile; fileRef = 02F096C12406691100C0C1D5 /* media-library.json */; };
109+
02F4AA2929791623002AA0E8 /* create-doman-cart-success.json in Resources */ = {isa = PBXBuildFile; fileRef = 02F4AA2829791623002AA0E8 /* create-doman-cart-success.json */; };
105110
0313651928AE559D00EEE571 /* PaymentGatewayMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0313651828AE559D00EEE571 /* PaymentGatewayMapper.swift */; };
106111
0313651B28AE60E000EEE571 /* payment-gateway-cod.json in Resources */ = {isa = PBXBuildFile; fileRef = 0313651A28AE60E000EEE571 /* payment-gateway-cod.json */; };
107112
0313651D28AE625300EEE571 /* PaymentGatewayMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0313651C28AE625300EEE571 /* PaymentGatewayMapperTests.swift */; };
@@ -898,6 +903,7 @@
898903
0219B03823964BB3007DCD5E /* ProductShippingClassMapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductShippingClassMapper.swift; sourceTree = "<group>"; };
899904
021A84D9257DF92800BC71D1 /* ShippingLabelRefundMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelRefundMapper.swift; sourceTree = "<group>"; };
900905
021C7BF623863D1800A3BCBD /* Encodable+Serialization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Encodable+Serialization.swift"; sourceTree = "<group>"; };
906+
021D741B2987B1550035687E /* checkout-doman-cart-with-domain-credit-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "checkout-doman-cart-with-domain-credit-success.json"; sourceTree = "<group>"; };
901907
021E2A1323A9FC5900B1DE07 /* ProductBackordersSetting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductBackordersSetting.swift; sourceTree = "<group>"; };
902908
021EAA5525493B3600AA8CCD /* OrderItemAttribute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderItemAttribute.swift; sourceTree = "<group>"; };
903909
022902D122E2436300059692 /* stats_module_disabled_error.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = stats_module_disabled_error.json; sourceTree = "<group>"; };
@@ -966,6 +972,9 @@
966972
02C254B825637BA000A04423 /* OrderShippingLabelListMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderShippingLabelListMapper.swift; sourceTree = "<group>"; };
967973
02C254D22563992900A04423 /* OrderShippingLabelListMapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderShippingLabelListMapperTests.swift; sourceTree = "<group>"; };
968974
02C254D62563999200A04423 /* order-shipping-labels.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "order-shipping-labels.json"; sourceTree = "<group>"; };
975+
02C4325C298A55D100F14AEE /* domain-contact-info.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "domain-contact-info.json"; sourceTree = "<group>"; };
976+
02C4325D298A55D100F14AEE /* validate-domain-contact-info-failure.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "validate-domain-contact-info-failure.json"; sourceTree = "<group>"; };
977+
02C4325E298A55D100F14AEE /* validate-domain-contact-info-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "validate-domain-contact-info-success.json"; sourceTree = "<group>"; };
969978
02C54CC524D3E937007D658F /* product-variations-load-all-manage-stock-two-states.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "product-variations-load-all-manage-stock-two-states.json"; sourceTree = "<group>"; };
970979
02DD6491248A3EC00082523E /* product-external.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "product-external.json"; sourceTree = "<group>"; };
971980
02E7FFCA256218F600C53030 /* ShippingLabelRemoteTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelRemoteTests.swift; sourceTree = "<group>"; };
@@ -975,6 +984,7 @@
975984
02EF166F292F0CF400D90AD6 /* create-cart-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "create-cart-success.json"; sourceTree = "<group>"; };
976985
02EF1671292F0D1900D90AD6 /* load-plan-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "load-plan-success.json"; sourceTree = "<group>"; };
977986
02F096C12406691100C0C1D5 /* media-library.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "media-library.json"; sourceTree = "<group>"; };
987+
02F4AA2829791623002AA0E8 /* create-doman-cart-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "create-doman-cart-success.json"; sourceTree = "<group>"; };
978988
0313651828AE559D00EEE571 /* PaymentGatewayMapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentGatewayMapper.swift; sourceTree = "<group>"; };
979989
0313651A28AE60E000EEE571 /* payment-gateway-cod.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "payment-gateway-cod.json"; sourceTree = "<group>"; };
980990
0313651C28AE625300EEE571 /* PaymentGatewayMapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaymentGatewayMapperTests.swift; sourceTree = "<group>"; };
@@ -2263,8 +2273,10 @@
22632273
B559EBA820A0B5B100836CD4 /* Responses */ = {
22642274
isa = PBXGroup;
22652275
children = (
2276+
021D741B2987B1550035687E /* checkout-doman-cart-with-domain-credit-success.json */,
22662277
DEC2B092297AA60D003923FB /* category-without-data.json */,
22672278
DEC2B090297AA5A6003923FB /* categories-all-without-data.json */,
2279+
02C4325C298A55D100F14AEE /* domain-contact-info.json */,
22682280
DEC2B08E297AA123003923FB /* reviews-single-without-data.json */,
22692281
DEC2B08C297AA048003923FB /* reviews-all-without-data.json */,
22702282
DE66C5682977D62700DAA978 /* plugins-without-data.json */,
@@ -2305,6 +2317,7 @@
23052317
028CB71A290224D700331C09 /* create-account-error-username.json */,
23062318
028CB712290223CB00331C09 /* create-account-success.json */,
23072319
02EF166F292F0CF400D90AD6 /* create-cart-success.json */,
2320+
02F4AA2829791623002AA0E8 /* create-doman-cart-success.json */,
23082321
02050F58296FEC5B00710E63 /* domain-products.json */,
23092322
0239306C291A973F00B2632F /* domain-suggestions.json */,
23102323
02050F56296FE90A00710E63 /* domain-suggestions-paid.json */,
@@ -2534,6 +2547,8 @@
25342547
74ABA1C7213F19FE00FFAD30 /* top-performers-year.json */,
25352548
FE28F6E726842D57004465C7 /* user-complete.json */,
25362549
DEF13C4F29629EEA0024A02B /* user-complete-without-data.json */,
2550+
02C4325D298A55D100F14AEE /* validate-domain-contact-info-failure.json */,
2551+
02C4325E298A55D100F14AEE /* validate-domain-contact-info-success.json */,
25372552
7495AACE225D366D00801A89 /* variation-as-product.json */,
25382553
02A26F192744F5FC008E4EDB /* wc-site-settings-partial.json */,
25392554
D800DA0D25EFEC21001E13CE /* wcpay-connection-token.json */,
@@ -3117,6 +3132,7 @@
31173132
files = (
31183133
D865CE6F278CC19A002C8520 /* stripe-location-error.json in Resources */,
31193134
31799AFE270518AD00D78179 /* wcpay-location-error.json in Resources */,
3135+
02F4AA2929791623002AA0E8 /* create-doman-cart-success.json in Resources */,
31203136
74C8F07020EEC3A800B6EDC9 /* broken-notes.json in Resources */,
31213137
2670C3FE270F4E6A002FE931 /* sites-malformed.json in Resources */,
31223138
CCF434662906C2A400B4475A /* products-ids-only.json in Resources */,
@@ -3156,6 +3172,7 @@
31563172
CC9A253C26442C71005DE56E /* shipping-label-eligibility-success.json in Resources */,
31573173
B5A24179217F98F600595DEF /* notifications-load-all.json in Resources */,
31583174
DEA6B1C9296D0E8B005AA5E9 /* systemStatusWithPluginsOnly-without-data.json in Resources */,
3175+
02C4325F298A55D100F14AEE /* domain-contact-info.json in Resources */,
31593176
EE57C12B297F8F8600BC31E7 /* attribute-term-without-data.json in Resources */,
31603177
314EDF2927C02CC100A56B6F /* stripe-account-complete-empty-descriptor.json in Resources */,
31613178
028CB71F2902589E00331C09 /* create-account-error-invalid-email.json in Resources */,
@@ -3164,6 +3181,7 @@
31643181
31A451CE27863A2E00FE81AA /* stripe-account-wrong-json.json in Resources */,
31653182
EE57C143297FCCA700BC31E7 /* product-shipping-classes-load-all-without-data.json in Resources */,
31663183
26BD9FCD2965EC3C004E0D15 /* product-variations-bulk-create.json in Resources */,
3184+
02C43260298A55D100F14AEE /* validate-domain-contact-info-failure.json in Resources */,
31673185
EE57C13C297FBECB00BC31E7 /* product-tags-all-without-data.json in Resources */,
31683186
028CB718290223CB00331C09 /* account-username-suggestions.json in Resources */,
31693187
0282DD91233A120A006A5FDB /* products-search-photo.json in Resources */,
@@ -3257,6 +3275,7 @@
32573275
B58D10CA2114D22E00107ED4 /* new-order-note.json in Resources */,
32583276
D865CE6B278CA266002C8520 /* stripe-payment-intent-error.json in Resources */,
32593277
CCB2CAA82620ABCC00285CA0 /* shipping-label-create-package-error.json in Resources */,
3278+
021D741C2987B1550035687E /* checkout-doman-cart-with-domain-credit-success.json in Resources */,
32603279
B57B1E6C21C94C9F0046E764 /* timeout_error.json in Resources */,
32613280
0313651B28AE60E000EEE571 /* payment-gateway-cod.json in Resources */,
32623281
B5C6FCD620A3768900A4F8E4 /* order.json in Resources */,
@@ -3431,6 +3450,7 @@
34313450
DEF13C5029629EEA0024A02B /* user-complete-without-data.json in Resources */,
34323451
EE57C123297EB04F00BC31E7 /* product-attribute-create-without-data.json in Resources */,
34333452
EE57C11929794DCA00BC31E7 /* get-application-passwords-success.json in Resources */,
3453+
02C43261298A55D100F14AEE /* validate-domain-contact-info-success.json in Resources */,
34343454
74ABA1CA213F19FE00FFAD30 /* top-performers-year.json in Resources */,
34353455
DEF13C5C2965812D0024A02B /* order-stats-v4-year-without-data.json in Resources */,
34363456
31A451CF27863A2E00FE81AA /* stripe-account-rejected-terms-of-service.json in Resources */,

Networking/Networking/Remote/CommentRemote.swift

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,32 @@ public class CommentRemote: Remote {
6262
/// - Parameters:
6363
/// - siteID: site ID which contains the comment
6464
/// - commentID: ID of the comment to reply to
65+
/// - productID: ID of the product that the comment is associated to
6566
/// - content: the text of the comment reply
6667
/// - completion: callback to be executed on completion
6768
///
68-
public func replyToComment(siteID: Int64, commentID: Int64, content: String, completion: @escaping (Result<CommentStatus, Error>) -> Void) {
69-
let path = "\(Paths.sites)/" + String(siteID) + "/" + "\(Paths.comments)/" + String(commentID) + "/\(Paths.commentReply)"
70-
let parameters = [
71-
ParameterKeys.content: content
69+
public func replyToComment(siteID: Int64,
70+
commentID: Int64,
71+
productID: Int64,
72+
content: String,
73+
completion: @escaping (Result<CommentStatus, Error>) -> Void) {
74+
let path = "sites/\(siteID)/\(Paths.comments)"
75+
let parameters: [String: Any] = [
76+
ParameterKeys.content: content,
77+
ParameterKeys.parent: commentID,
78+
ParameterKeys.post: productID
7279
]
7380
let mapper = CommentResultMapper()
74-
let request = DotcomRequest(wordpressApiVersion: .mark1_1, method: .post, path: path, parameters: parameters)
75-
enqueue(request, mapper: mapper, completion: completion)
81+
do {
82+
let request = try DotcomRequest(wordpressApiVersion: .wpMark2,
83+
method: .post,
84+
path: path,
85+
parameters: parameters,
86+
availableAsRESTRequest: true)
87+
enqueue(request, mapper: mapper, completion: completion)
88+
} catch {
89+
completion(.failure(error))
90+
}
7691
}
7792
}
7893

@@ -90,6 +105,8 @@ private extension CommentRemote {
90105
static let status: String = "status"
91106
static let context: String = "context"
92107
static let content: String = "content"
108+
static let parent: String = "parent"
109+
static let post: String = "post"
93110
}
94111

95112
enum ParameterValues {

0 commit comments

Comments
 (0)