Skip to content

Commit f9304bf

Browse files
committed
Add loginURL to Site
1 parent 3451283 commit f9304bf

File tree

10 files changed

+860
-3
lines changed

10 files changed

+860
-3
lines changed

Fakes/Fakes/Networking.generated.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,7 @@ extension Site {
14741474
description: .fake(),
14751475
url: .fake(),
14761476
adminURL: .fake(),
1477+
loginURL: .fake(),
14771478
plan: .fake(),
14781479
isJetpackThePluginInstalled: .fake(),
14791480
isJetpackConnected: .fake(),

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,7 @@ extension Site {
17241724
description: CopiableProp<String> = .copy,
17251725
url: CopiableProp<String> = .copy,
17261726
adminURL: CopiableProp<String> = .copy,
1727+
loginURL: CopiableProp<String> = .copy,
17271728
plan: CopiableProp<String> = .copy,
17281729
isJetpackThePluginInstalled: CopiableProp<Bool> = .copy,
17291730
isJetpackConnected: CopiableProp<Bool> = .copy,
@@ -1738,6 +1739,7 @@ extension Site {
17381739
let description = description ?? self.description
17391740
let url = url ?? self.url
17401741
let adminURL = adminURL ?? self.adminURL
1742+
let loginURL = loginURL ?? self.loginURL
17411743
let plan = plan ?? self.plan
17421744
let isJetpackThePluginInstalled = isJetpackThePluginInstalled ?? self.isJetpackThePluginInstalled
17431745
let isJetpackConnected = isJetpackConnected ?? self.isJetpackConnected
@@ -1753,6 +1755,7 @@ extension Site {
17531755
description: description,
17541756
url: url,
17551757
adminURL: adminURL,
1758+
loginURL: loginURL,
17561759
plan: plan,
17571760
isJetpackThePluginInstalled: isJetpackThePluginInstalled,
17581761
isJetpackConnected: isJetpackConnected,

Networking/Networking/Model/Site.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
2525
///
2626
public let adminURL: String
2727

28+
/// Site's login URL.
29+
///
30+
public let loginURL: String
31+
2832
/// Short name for site's plan.
2933
///
3034
public let plan: String
@@ -77,12 +81,14 @@ public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
7781
let timezone = try optionsContainer.decode(String.self, forKey: .timezone)
7882
let gmtOffset = try optionsContainer.decode(Double.self, forKey: .gmtOffset)
7983
let adminURL = try optionsContainer.decode(String.self, forKey: .adminURL)
84+
let loginURL = try optionsContainer.decode(String.self, forKey: .loginURL)
8085

8186
self.init(siteID: siteID,
8287
name: name,
8388
description: description,
8489
url: url,
8590
adminURL: adminURL,
91+
loginURL: loginURL,
8692
plan: String(), // Not created on init. Added in supplementary API request.
8793
isJetpackThePluginInstalled: isJetpackThePluginInstalled,
8894
isJetpackConnected: isJetpackConnected,
@@ -100,6 +106,7 @@ public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
100106
description: String,
101107
url: String,
102108
adminURL: String,
109+
loginURL: String,
103110
plan: String,
104111
isJetpackThePluginInstalled: Bool,
105112
isJetpackConnected: Bool,
@@ -113,6 +120,7 @@ public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
113120
self.description = description
114121
self.url = url
115122
self.adminURL = adminURL
123+
self.loginURL = loginURL
116124
self.plan = plan
117125
self.isJetpackThePluginInstalled = isJetpackThePluginInstalled
118126
self.isJetpackConnected = isJetpackConnected
@@ -154,6 +162,7 @@ private extension Site {
154162
case gmtOffset = "gmt_offset"
155163
case jetpackConnectionActivePlugins = "jetpack_connection_active_plugins"
156164
case adminURL = "admin_url"
165+
case loginURL = "login_url"
157166
}
158167

159168
enum PlanKeys: String, CodingKey {

Networking/Networking/Remote/AccountRemote.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class AccountRemote: Remote, AccountRemoteProtocol {
6969
let path = "me/sites"
7070
let parameters = [
7171
"fields": "ID,name,description,URL,options,jetpack,jetpack_connection",
72-
"options": "timezone,is_wpcom_store,woocommerce_is_active,gmt_offset,jetpack_connection_active_plugins,admin_url"
72+
"options": "timezone,is_wpcom_store,woocommerce_is_active,gmt_offset,jetpack_connection_active_plugins,admin_url,login_url"
7373
]
7474

7575
let request = DotcomRequest(wordpressApiVersion: .mark1_1, method: .get, path: path, parameters: parameters)

Storage/Storage.xcodeproj/project.pbxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@
393393
933A272F2222344D00C2143A /* Logging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = "<group>"; };
394394
A3821B262583F14863740A37 /* Pods-Storage.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Storage.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-Storage/Pods-Storage.debug.xcconfig"; sourceTree = "<group>"; };
395395
AE93BE8F272C0E9F001B55EA /* GeneralStoreSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralStoreSettings.swift; sourceTree = "<group>"; };
396+
AEC4481B290853C300BAA299 /* Model 76.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 76.xcdatamodel"; sourceTree = "<group>"; };
396397
B505255320EE6914008090F5 /* StorageType+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "StorageType+Extensions.swift"; sourceTree = "<group>"; };
397398
B505F6D820BEEA3100BB1B69 /* Account+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Account+CoreDataProperties.swift"; sourceTree = "<group>"; };
398399
B505F6D920BEEA3200BB1B69 /* Account+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Account+CoreDataClass.swift"; sourceTree = "<group>"; };
@@ -1812,6 +1813,7 @@
18121813
DEC51AA4275B41BE009F3DF4 /* WooCommerce.xcdatamodeld */ = {
18131814
isa = XCVersionGroup;
18141815
children = (
1816+
AEC4481B290853C300BAA299 /* Model 76.xcdatamodel */,
18151817
688908A328F8EB360081A07E /* Model 75.xcdatamodel */,
18161818
6889088D28F668330081A07E /* Model 74.xcdatamodel */,
18171819
027CE79D28D167D0001B8D0E /* Model 73.xcdatamodel */,
@@ -1888,7 +1890,7 @@
18881890
DEC51ADE275B41BE009F3DF4 /* Model 47.xcdatamodel */,
18891891
DEC51ADF275B41BE009F3DF4 /* Model 19.xcdatamodel */,
18901892
);
1891-
currentVersion = 688908A328F8EB360081A07E /* Model 75.xcdatamodel */;
1893+
currentVersion = AEC4481B290853C300BAA299 /* Model 76.xcdatamodel */;
18921894
path = WooCommerce.xcdatamodeld;
18931895
sourceTree = "<group>";
18941896
versionGroupType = wrapper.xcdatamodel;

Storage/Storage/Model/Site+CoreDataProperties.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ extension Site {
1212
@NSManaged public var tagline: String?
1313
@NSManaged public var url: String?
1414
@NSManaged public var adminURL: String?
15+
@NSManaged public var loginURL: String?
1516
@NSManaged public var plan: String?
1617
@NSManaged public var isWooCommerceActive: NSNumber?
1718
@NSManaged public var isWordPressStore: NSNumber?

Storage/Storage/Model/WooCommerce.xcdatamodeld/.xccurrentversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<plist version="1.0">
44
<dict>
55
<key>_XCCurrentVersionName</key>
6-
<string>Model 75.xcdatamodel</string>
6+
<string>Model 76.xcdatamodel</string>
77
</dict>
88
</plist>

0 commit comments

Comments
 (0)