Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Fakes/Fakes/Networking.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,7 @@ extension Site {
description: .fake(),
url: .fake(),
adminURL: .fake(),
loginURL: .fake(),
plan: .fake(),
isJetpackThePluginInstalled: .fake(),
isJetpackConnected: .fake(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,7 @@ extension Site {
description: CopiableProp<String> = .copy,
url: CopiableProp<String> = .copy,
adminURL: CopiableProp<String> = .copy,
loginURL: CopiableProp<String> = .copy,
plan: CopiableProp<String> = .copy,
isJetpackThePluginInstalled: CopiableProp<Bool> = .copy,
isJetpackConnected: CopiableProp<Bool> = .copy,
Expand All @@ -1738,6 +1739,7 @@ extension Site {
let description = description ?? self.description
let url = url ?? self.url
let adminURL = adminURL ?? self.adminURL
let loginURL = loginURL ?? self.loginURL
let plan = plan ?? self.plan
let isJetpackThePluginInstalled = isJetpackThePluginInstalled ?? self.isJetpackThePluginInstalled
let isJetpackConnected = isJetpackConnected ?? self.isJetpackConnected
Expand All @@ -1753,6 +1755,7 @@ extension Site {
description: description,
url: url,
adminURL: adminURL,
loginURL: loginURL,
plan: plan,
isJetpackThePluginInstalled: isJetpackThePluginInstalled,
isJetpackConnected: isJetpackConnected,
Expand Down
9 changes: 9 additions & 0 deletions Networking/Networking/Model/Site.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
///
public let adminURL: String

/// Site's login URL.
///
public let loginURL: String

/// Short name for site's plan.
///
public let plan: String
Expand Down Expand Up @@ -77,12 +81,14 @@ public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
let timezone = try optionsContainer.decode(String.self, forKey: .timezone)
let gmtOffset = try optionsContainer.decode(Double.self, forKey: .gmtOffset)
let adminURL = try optionsContainer.decode(String.self, forKey: .adminURL)
let loginURL = try optionsContainer.decode(String.self, forKey: .loginURL)

self.init(siteID: siteID,
name: name,
description: description,
url: url,
adminURL: adminURL,
loginURL: loginURL,
plan: String(), // Not created on init. Added in supplementary API request.
isJetpackThePluginInstalled: isJetpackThePluginInstalled,
isJetpackConnected: isJetpackConnected,
Expand All @@ -100,6 +106,7 @@ public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
description: String,
url: String,
adminURL: String,
loginURL: String,
plan: String,
isJetpackThePluginInstalled: Bool,
isJetpackConnected: Bool,
Expand All @@ -113,6 +120,7 @@ public struct Site: Decodable, Equatable, GeneratedFakeable, GeneratedCopiable {
self.description = description
self.url = url
self.adminURL = adminURL
self.loginURL = loginURL
self.plan = plan
self.isJetpackThePluginInstalled = isJetpackThePluginInstalled
self.isJetpackConnected = isJetpackConnected
Expand Down Expand Up @@ -154,6 +162,7 @@ private extension Site {
case gmtOffset = "gmt_offset"
case jetpackConnectionActivePlugins = "jetpack_connection_active_plugins"
case adminURL = "admin_url"
case loginURL = "login_url"
}

enum PlanKeys: String, CodingKey {
Expand Down
2 changes: 1 addition & 1 deletion Networking/Networking/Remote/AccountRemote.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class AccountRemote: Remote, AccountRemoteProtocol {
let path = "me/sites"
let parameters = [
"fields": "ID,name,description,URL,options,jetpack,jetpack_connection",
"options": "timezone,is_wpcom_store,woocommerce_is_active,gmt_offset,jetpack_connection_active_plugins,admin_url"
"options": "timezone,is_wpcom_store,woocommerce_is_active,gmt_offset,jetpack_connection_active_plugins,admin_url,login_url"
]

let request = DotcomRequest(wordpressApiVersion: .mark1_1, method: .get, path: path, parameters: parameters)
Expand Down
4 changes: 3 additions & 1 deletion Storage/Storage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@
933A272F2222344D00C2143A /* Logging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = "<group>"; };
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>"; };
AE93BE8F272C0E9F001B55EA /* GeneralStoreSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralStoreSettings.swift; sourceTree = "<group>"; };
AEC4481B290853C300BAA299 /* Model 76.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 76.xcdatamodel"; sourceTree = "<group>"; };
B505255320EE6914008090F5 /* StorageType+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "StorageType+Extensions.swift"; sourceTree = "<group>"; };
B505F6D820BEEA3100BB1B69 /* Account+CoreDataProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Account+CoreDataProperties.swift"; sourceTree = "<group>"; };
B505F6D920BEEA3200BB1B69 /* Account+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Account+CoreDataClass.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1812,6 +1813,7 @@
DEC51AA4275B41BE009F3DF4 /* WooCommerce.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
AEC4481B290853C300BAA299 /* Model 76.xcdatamodel */,
688908A328F8EB360081A07E /* Model 75.xcdatamodel */,
6889088D28F668330081A07E /* Model 74.xcdatamodel */,
027CE79D28D167D0001B8D0E /* Model 73.xcdatamodel */,
Expand Down Expand Up @@ -1888,7 +1890,7 @@
DEC51ADE275B41BE009F3DF4 /* Model 47.xcdatamodel */,
DEC51ADF275B41BE009F3DF4 /* Model 19.xcdatamodel */,
);
currentVersion = 688908A328F8EB360081A07E /* Model 75.xcdatamodel */;
currentVersion = AEC4481B290853C300BAA299 /* Model 76.xcdatamodel */;
path = WooCommerce.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
Expand Down
1 change: 1 addition & 0 deletions Storage/Storage/Model/Site+CoreDataProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extension Site {
@NSManaged public var tagline: String?
@NSManaged public var url: String?
@NSManaged public var adminURL: String?
@NSManaged public var loginURL: String?
@NSManaged public var plan: String?
@NSManaged public var isWooCommerceActive: NSNumber?
@NSManaged public var isWordPressStore: NSNumber?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
<string>Model 75.xcdatamodel</string>
<string>Model 76.xcdatamodel</string>
</dict>
</plist>
Loading