Skip to content

Commit e89bad0

Browse files
committed
Remove account country code
1 parent 1cefd8f commit e89bad0

File tree

7 files changed

+10
-25
lines changed

7 files changed

+10
-25
lines changed

Fakes/Fakes/Networking.generated.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ extension Networking.Account {
2727
displayName: .fake(),
2828
email: .fake(),
2929
username: .fake(),
30-
gravatarUrl: .fake(),
31-
ipCountryCode: .fake()
30+
gravatarUrl: .fake()
3231
)
3332
}
3433
}

Networking/Networking/Model/Account.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,14 @@ public struct Account: Decodable, Equatable, GeneratedFakeable {
2525
///
2626
public let gravatarUrl: String?
2727

28-
/// Users IP country Code
29-
/// This setting is not stored in the Storage layer because we don't want to rely on stale value.
30-
/// But there us no problem on add it later if we believe it will be useful.
31-
///
32-
public let ipCountryCode: String
33-
34-
3528
/// Designated Initializer.
3629
///
37-
public init(userID: Int64, displayName: String, email: String, username: String, gravatarUrl: String?, ipCountryCode: String) {
30+
public init(userID: Int64, displayName: String, email: String, username: String, gravatarUrl: String?) {
3831
self.userID = userID
3932
self.displayName = displayName
4033
self.email = email
4134
self.username = username
4235
self.gravatarUrl = gravatarUrl
43-
self.ipCountryCode = ipCountryCode
4436
}
4537
}
4638

@@ -55,6 +47,5 @@ private extension Account {
5547
case email = "email"
5648
case username = "username"
5749
case gravatarUrl = "avatar_URL"
58-
case ipCountryCode = "user_ip_country_code"
5950
}
6051
}

WooCommerce/WooCommerceTests/Internal/SessionManager+Internal.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ extension SessionManager {
3535
displayName: displayName,
3636
email: "",
3737
username: credentials.username,
38-
gravatarUrl: nil,
39-
ipCountryCode: "US")
38+
gravatarUrl: nil)
4039
}
4140
return manager
4241
}

WooCommerce/WooCommerceTests/ViewRelated/JetpackSetup/JetpackSetupCoordinatorTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ final class JetpackSetupCoordinatorTests: XCTestCase {
104104
let coordinator = JetpackSetupCoordinator(site: testSite, dotcomAuthScheme: expectedScheme, rootViewController: navigationController, stores: stores)
105105
let url = try XCTUnwrap(URL(string: "scheme://magic-login?token=test"))
106106

107-
let expectedAccount = Account(userID: 123, displayName: "Test", email: "[email protected]", username: "test", gravatarUrl: nil, ipCountryCode: "US")
107+
let expectedAccount = Account(userID: 123, displayName: "Test", email: "[email protected]", username: "test", gravatarUrl: nil)
108108
stores.whenReceivingAction(ofType: JetpackConnectionAction.self) { action in
109109
switch action {
110110
case let .loadWPComAccount(_, onCompletion):
@@ -133,7 +133,7 @@ final class JetpackSetupCoordinatorTests: XCTestCase {
133133
let coordinator = JetpackSetupCoordinator(site: testSite, dotcomAuthScheme: expectedScheme, rootViewController: navigationController, stores: stores)
134134
let url = try XCTUnwrap(URL(string: "scheme://magic-login?token=test"))
135135

136-
let expectedAccount = Account(userID: 123, displayName: "Test", email: "[email protected]", username: "test", gravatarUrl: nil, ipCountryCode: "US")
136+
let expectedAccount = Account(userID: 123, displayName: "Test", email: "[email protected]", username: "test", gravatarUrl: nil)
137137
stores.whenReceivingAction(ofType: JetpackConnectionAction.self) { action in
138138
switch action {
139139
case let .loadWPComAccount(_, onCompletion):
@@ -162,7 +162,7 @@ final class JetpackSetupCoordinatorTests: XCTestCase {
162162
let coordinator = JetpackSetupCoordinator(site: testSite, dotcomAuthScheme: expectedScheme, rootViewController: navigationController, stores: stores)
163163
let url = try XCTUnwrap(URL(string: "scheme://magic-login?token=test"))
164164

165-
let expectedAccount = Account(userID: 123, displayName: "Test", email: "[email protected]", username: "test", gravatarUrl: nil, ipCountryCode: "US")
165+
let expectedAccount = Account(userID: 123, displayName: "Test", email: "[email protected]", username: "test", gravatarUrl: nil)
166166
stores.whenReceivingAction(ofType: JetpackConnectionAction.self) { action in
167167
switch action {
168168
case let .loadWPComAccount(_, onCompletion):

Yosemite/Yosemite/Model/Mocks/Graphs/ScreenshotsObjectGraph.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ struct ScreenshotObjectGraph: MockObjectGraph {
2929
displayName: i18n.DefaultAccount.displayName,
3030
email: i18n.DefaultAccount.email,
3131
username: i18n.DefaultAccount.username,
32-
gravatarUrl: nil,
33-
ipCountryCode: "USA"
32+
gravatarUrl: nil
3433
)
3534

3635
let defaultSite = Site(

Yosemite/Yosemite/Model/Storage/Account+ReadOnlyConvertible.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ extension Storage.Account: ReadOnlyConvertible {
2323
displayName: displayName ?? "",
2424
email: email ?? "",
2525
username: username ?? "",
26-
gravatarUrl: gravatarUrl,
27-
ipCountryCode: "")
26+
gravatarUrl: gravatarUrl)
2827
}
2928
}

Yosemite/YosemiteTests/Stores/AccountStoreTests.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,7 @@ private extension AccountStoreTests {
878878
displayName: "Sample",
879879
880880
username: "Username!",
881-
gravatarUrl: "https://automattic.com/superawesomegravatar.png",
882-
ipCountryCode: "")
881+
gravatarUrl: "https://automattic.com/superawesomegravatar.png")
883882
}
884883

885884
/// Sample Account: Mark II
@@ -889,8 +888,7 @@ private extension AccountStoreTests {
889888
displayName: "Yosemite",
890889
891890
username: "YOLO",
892-
gravatarUrl: "https://automattic.com/yosemite.png",
893-
ipCountryCode: "")
891+
gravatarUrl: "https://automattic.com/yosemite.png")
894892
}
895893

896894
func sampleAccountSettings() -> Networking.AccountSettings {

0 commit comments

Comments
 (0)