Skip to content

Commit 82c2e68

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

File tree

92 files changed

+1831
-1118
lines changed

Some content is hidden

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

92 files changed

+1831
-1118
lines changed

Gemfile.lock

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ GEM
1616
artifactory (3.0.15)
1717
atomos (0.1.3)
1818
aws-eventstream (1.2.0)
19-
aws-partitions (1.510.0)
20-
aws-sdk-core (3.121.1)
19+
aws-partitions (1.516.0)
20+
aws-sdk-core (3.121.2)
2121
aws-eventstream (~> 1, >= 1.0.2)
2222
aws-partitions (~> 1, >= 1.239.0)
2323
aws-sigv4 (~> 1.1)
2424
jmespath (~> 1.0)
25-
aws-sdk-kms (1.49.0)
26-
aws-sdk-core (~> 3, >= 3.120.0)
25+
aws-sdk-kms (1.50.0)
26+
aws-sdk-core (~> 3, >= 3.121.2)
2727
aws-sigv4 (~> 1.1)
28-
aws-sdk-s3 (1.103.0)
29-
aws-sdk-core (~> 3, >= 3.120.0)
28+
aws-sdk-s3 (1.104.0)
29+
aws-sdk-core (~> 3, >= 3.121.2)
3030
aws-sdk-kms (~> 1)
3131
aws-sigv4 (~> 1.4)
3232
aws-sigv4 (1.4.0)
@@ -89,7 +89,7 @@ GEM
8989
escape (0.0.4)
9090
ethon (0.14.0)
9191
ffi (>= 1.15.0)
92-
excon (0.86.0)
92+
excon (0.87.0)
9393
faraday (1.8.0)
9494
faraday-em_http (~> 1.0)
9595
faraday-em_synchrony (~> 1.0)
@@ -112,10 +112,10 @@ GEM
112112
faraday-net_http_persistent (1.2.0)
113113
faraday-patron (1.0.0)
114114
faraday-rack (1.0.0)
115-
faraday_middleware (1.1.0)
115+
faraday_middleware (1.2.0)
116116
faraday (~> 1.0)
117117
fastimage (2.2.5)
118-
fastlane (2.195.0)
118+
fastlane (2.196.0)
119119
CFPropertyList (>= 2.3, < 4.0.0)
120120
addressable (>= 2.8, < 3.0.0)
121121
artifactory (~> 3.0)
@@ -184,7 +184,7 @@ GEM
184184
gh_inspector (1.1.3)
185185
git (1.9.1)
186186
rchardet (~> 1.8)
187-
google-apis-androidpublisher_v3 (0.11.0)
187+
google-apis-androidpublisher_v3 (0.12.0)
188188
google-apis-core (>= 0.4, < 2.a)
189189
google-apis-core (0.4.1)
190190
addressable (~> 2.5, >= 2.5.1)
@@ -229,14 +229,15 @@ GEM
229229
i18n (1.8.10)
230230
concurrent-ruby (~> 1.0)
231231
jmespath (1.4.0)
232-
json (2.5.1)
232+
json (2.6.0)
233233
jsonlint (0.3.0)
234234
oj (~> 3)
235235
optimist (~> 3)
236236
jwt (2.3.0)
237237
memoist (0.16.2)
238238
mini_magick (4.11.0)
239-
mini_mime (1.1.1)
239+
mini_mime (1.1.2)
240+
mini_portile2 (2.6.1)
240241
minitest (5.14.4)
241242
molinillo (0.8.0)
242243
multi_json (1.15.0)
@@ -245,6 +246,9 @@ GEM
245246
nap (1.1.0)
246247
naturally (2.2.1)
247248
netrc (0.11.0)
249+
nokogiri (1.12.2)
250+
mini_portile2 (~> 2.6.1)
251+
racc (~> 1.4)
248252
nokogiri (1.12.2-x86_64-darwin)
249253
racc (~> 1.4)
250254
octokit (4.21.0)

Networking/Networking/Model/Address.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,36 @@ public struct Address: Codable, GeneratedFakeable, GeneratedCopiable {
7070
email: email)
7171
}
7272

73+
public func encode(to encoder: Encoder) throws {
74+
var container = encoder.container(keyedBy: CodingKeys.self)
75+
76+
try container.encode(firstName, forKey: .firstName)
77+
try container.encode(lastName, forKey: .lastName)
78+
try container.encodeIfPresent(company, forKey: .company)
79+
try container.encode(address1, forKey: .address1)
80+
try container.encodeIfPresent(address2, forKey: .address2)
81+
try container.encode(city, forKey: .city)
82+
try container.encode(state, forKey: .state)
83+
try container.encode(postcode, forKey: .postcode)
84+
try container.encode(country, forKey: .country)
85+
try container.encodeIfPresent(phone, forKey: .phone)
86+
87+
/// Encoding an `email` has some special conditions.
88+
/// - Encode the content to update the value.
89+
/// - Encode `nil` to clear the value
90+
/// - Don't encode to leave the value unaltered.
91+
/// PS: Encoding an empty string will produce an error due to server validations.
92+
///
93+
switch email {
94+
case .some(let content) where content.isEmpty:
95+
try container.encodeNil(forKey: .email)
96+
case .some(let content):
97+
try container.encode(content, forKey: .email)
98+
case .none:
99+
break
100+
}
101+
}
102+
73103
public static var empty: Address {
74104
self.init(firstName: "",
75105
lastName: "",

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,42 @@ extension ShippingLabelPurchase {
11381138
}
11391139
}
11401140

1141+
extension Site {
1142+
public func copy(
1143+
siteID: CopiableProp<Int64> = .copy,
1144+
name: CopiableProp<String> = .copy,
1145+
description: CopiableProp<String> = .copy,
1146+
url: CopiableProp<String> = .copy,
1147+
plan: CopiableProp<String> = .copy,
1148+
isWooCommerceActive: CopiableProp<Bool> = .copy,
1149+
isWordPressStore: CopiableProp<Bool> = .copy,
1150+
timezone: CopiableProp<String> = .copy,
1151+
gmtOffset: CopiableProp<Double> = .copy
1152+
) -> Site {
1153+
let siteID = siteID ?? self.siteID
1154+
let name = name ?? self.name
1155+
let description = description ?? self.description
1156+
let url = url ?? self.url
1157+
let plan = plan ?? self.plan
1158+
let isWooCommerceActive = isWooCommerceActive ?? self.isWooCommerceActive
1159+
let isWordPressStore = isWordPressStore ?? self.isWordPressStore
1160+
let timezone = timezone ?? self.timezone
1161+
let gmtOffset = gmtOffset ?? self.gmtOffset
1162+
1163+
return Site(
1164+
siteID: siteID,
1165+
name: name,
1166+
description: description,
1167+
url: url,
1168+
plan: plan,
1169+
isWooCommerceActive: isWooCommerceActive,
1170+
isWordPressStore: isWordPressStore,
1171+
timezone: timezone,
1172+
gmtOffset: gmtOffset
1173+
)
1174+
}
1175+
}
1176+
11411177
extension SitePlugin {
11421178
public func copy(
11431179
siteID: CopiableProp<Int64> = .copy,

Networking/Networking/Model/Site.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Codegen
33

44
/// Represents a WordPress.com Site.
55
///
6-
public struct Site: Decodable, Equatable, GeneratedFakeable {
6+
public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
77

88
/// WordPress.com Site Identifier.
99
///

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ target 'WooCommerce' do
5050

5151
aztec
5252

53-
pod 'WPMediaPicker', '~> 1.7.3-beta.1'
53+
pod 'WPMediaPicker', '~> 1.7.3'
5454

5555
# External Libraries
5656
# ==================

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ PODS:
7373
- FormatterKit/TimeIntervalFormatter (~> 1.8)
7474
- WordPressUI (1.12.1)
7575
- Wormholy (1.6.4)
76-
- WPMediaPicker (1.7.3-beta.1)
76+
- WPMediaPicker (1.7.3)
7777
- wpxmlrpc (0.9.0)
7878
- XLPagerTabStrip (9.0.0)
7979
- ZendeskCommonUISDK (6.1.1)
@@ -107,7 +107,7 @@ DEPENDENCIES:
107107
- WordPressShared (~> 1.15)
108108
- WordPressUI (~> 1.12.1)
109109
- Wormholy (~> 1.6.4)
110-
- WPMediaPicker (~> 1.7.3-beta.1)
110+
- WPMediaPicker (~> 1.7.3)
111111
- XLPagerTabStrip (~> 9.0)
112112
- ZendeskSupportSDK (~> 5.0)
113113

@@ -186,7 +186,7 @@ SPEC CHECKSUMS:
186186
WordPressShared: 5477f179c7fe03b5d574f91adda66f67d131827e
187187
WordPressUI: 414bf3a7d007618f94a1c7969d6e849779877d5d
188188
Wormholy: 2e70f64227e010d363f8d33268369f77faf12471
189-
WPMediaPicker: 4236e8fe012cf470e190fbd91d1f50037454a216
189+
WPMediaPicker: 4af3fdfba06541ada2613178f8c01175671c38a8
190190
wpxmlrpc: bf55a43a7e710bd2a4fb8c02dfe83b1246f14f13
191191
XLPagerTabStrip: 61c57fd61f611ee5f01ff1495ad6fbee8bf496c5
192192
ZendeskCommonUISDK: 5808802951ad2bb424f0bed4259dc3c0ce9b52ec
@@ -197,6 +197,6 @@ SPEC CHECKSUMS:
197197
ZendeskSupportProvidersSDK: 2bdf8544f7cd0fd4c002546f5704b813845beb2a
198198
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
199199

200-
PODFILE CHECKSUM: 19bb301f90c9e3a8ea6e0717f69df14547233155
200+
PODFILE CHECKSUM: 30d1d85f4fae2e2129a3fa6db6272e741601317c
201201

202202
COCOAPODS: 1.11.2

RELEASE-NOTES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]
22

3+
7.9
4+
-----
5+
- [*] 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+
7+
38
7.8
49
-----
510
- [***] Shipping Labels: merchants can create multiple packages for the same order, moving the items between different packages. [https://github.com/woocommerce/woocommerce-ios/pull/5190]
@@ -10,6 +15,8 @@
1015
- [*] Shipping Labels: Fix crash when tapping on Learn more rows of customs form. [https://github.com/woocommerce/woocommerce-ios/pull/5207]
1116
- [*] Shipping Labels: The shipping address now prefills the phone number from the billing address if a shipping phone number is not available. [https://github.com/woocommerce/woocommerce-ios/pull/5177]
1217
- [*] Shipping Labels: now in Carrier and Rates we always display the discounted rate instead of the retail rate if available. [https://github.com/woocommerce/woocommerce-ios/pull/5188]
18+
- [*] Shipping Labels: If the shipping address is invalid, there are now options to email, call, or message the customer. [https://github.com/woocommerce/woocommerce-ios/pull/5228]
19+
- [*] Accessibility: notify when offline mode banner appears or disappears. [https://github.com/woocommerce/woocommerce-ios/pull/5225]
1320

1421
7.7
1522
-----

Storage/Storage/Tools/StorageType+Extensions.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ public extension StorageType {
2626
return firstObject(ofType: Site.self, matching: predicate)
2727
}
2828

29+
/// Retrieves all stored sites.
30+
///
31+
func loadAllSites() -> [Site] {
32+
allObjects(ofType: Site.self, matching: nil, sortedBy: nil)
33+
}
34+
2935
// MARK: - Orders
3036

3137
/// Retrieves the Stored Order.

WooCommerce/Classes/Analytics/WooAnalyticsEvent.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,20 @@ extension WooAnalyticsEvent {
351351
}
352352
}
353353
}
354+
355+
// MARK: - What's New Component
356+
//
357+
extension WooAnalyticsEvent {
358+
/// Possible sources for the What's New component
359+
///
360+
enum Source: String {
361+
fileprivate static let key = "source"
362+
363+
case appUpgrade = "app_upgrade"
364+
case appSettings = "app_settings"
365+
}
366+
367+
static func featureAnnouncementShown(source: Source) -> WooAnalyticsEvent {
368+
WooAnalyticsEvent(statName: .featureAnnouncementShown, properties: [Source.key: source.rawValue])
369+
}
370+
}

WooCommerce/Classes/Analytics/WooAnalyticsStat.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ public enum WooAnalyticsStat: String {
506506
case removeProductAttributeButtonTapped = "remove_product_attribute_button_tapped"
507507
case editProductVariationAttributeOptionsRowTapped = "edit_product_variation_attribute_options_row_tapped"
508508
case editProductVariationAttributeOptionsDoneButtonTapped = "edit_product_variation_attribute_options_done_button_tapped"
509+
510+
// MARK: What's New Component events
511+
//
512+
case featureAnnouncementShown = "feature_announcement_shown"
509513
}
510514

511515
public extension WooAnalyticsStat {

0 commit comments

Comments
 (0)