Skip to content

Commit 6ed30ff

Browse files
committed
Remove SystemStatusAction.fetchSystemPluginListWithNameList usage.
1 parent 288c42c commit 6ed30ff

File tree

6 files changed

+0
-47
lines changed

6 files changed

+0
-47
lines changed

Modules/Sources/Yosemite/Actions/SystemStatusAction.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ public enum SystemStatusAction: Action {
1212
///
1313
case fetchSystemPlugin(siteID: Int64, systemPluginName: String, onCompletion: (SystemPlugin?) -> Void)
1414

15-
/// Fetch an specific systemPlugin by siteID and name list.
16-
///
17-
case fetchSystemPluginListWithNameList(siteID: Int64, systemPluginNameList: [String], onCompletion: (SystemPlugin?) -> Void)
18-
1915
/// Fetch a specific systemPlugin by path.
2016
///
2117
case fetchSystemPluginWithPath(siteID: Int64, pluginPath: String, onCompletion: (SystemPlugin?) -> Void)

Modules/Sources/Yosemite/Model/Mocks/ActionHandlers/MockSystemStatusActionHandler.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ struct MockSystemStatusActionHandler: MockActionHandler {
1919
let filteredSystemPlugin = systemPlugins.first { $0.name == systemPluginName }
2020
let matchingPlugin = systemPlugins.first { $0.name == systemPluginName && $0.active } ?? filteredSystemPlugin
2121
onCompletion(matchingPlugin)
22-
case .fetchSystemPluginListWithNameList(let siteID, let systemPluginNameList, let onCompletion):
23-
let systemPlugins = objectGraph.systemPlugins(for: siteID)
24-
let filteredSystemPlugins = systemPlugins.first { systemPluginNameList.contains($0.name) }
25-
onCompletion(filteredSystemPlugins)
2622
case .fetchSystemPluginWithPath(let siteID, let pluginPath, let onCompletion):
2723
let systemPlugins = objectGraph.systemPlugins(for: siteID)
2824
let matchingPlugin = systemPlugins.first { $0.plugin == pluginPath }

Modules/Sources/Yosemite/Stores/SystemStatusStore.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public final class SystemStatusStore: Store {
3131
synchronizeSystemInformation(siteID: siteID, completionHandler: onCompletion)
3232
case .fetchSystemPlugin(let siteID, let systemPluginName, let onCompletion):
3333
fetchSystemPlugin(siteID: siteID, systemPluginNameList: [systemPluginName], completionHandler: onCompletion)
34-
case .fetchSystemPluginListWithNameList(let siteID, let systemPluginNameList, let onCompletion):
35-
fetchSystemPlugin(siteID: siteID, systemPluginNameList: systemPluginNameList, completionHandler: onCompletion)
3634
case .fetchSystemPluginWithPath(let siteID, let pluginPath, let onCompletion):
3735
fetchSystemPluginWithPath(siteID: siteID,
3836
pluginPath: pluginPath,

Modules/Tests/YosemiteTests/Stores/SystemStatusStoreTests.swift

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -194,31 +194,6 @@ final class SystemStatusStoreTests: XCTestCase {
194194
XCTAssertNil(fetchedPlugin)
195195
}
196196

197-
func test_fetchSystemPluginsList_return_systemPlugins_correctly() {
198-
// Given
199-
let systemPlugin1 = viewStorage.insertNewObject(ofType: SystemPlugin.self)
200-
systemPlugin1.name = "Plugin 1"
201-
systemPlugin1.siteID = sampleSiteID
202-
203-
let systemPlugin3 = viewStorage.insertNewObject(ofType: SystemPlugin.self)
204-
systemPlugin3.name = "Plugin 3"
205-
systemPlugin3.siteID = sampleSiteID
206-
207-
let store = SystemStatusStore(dispatcher: dispatcher, storageManager: storageManager, network: network)
208-
209-
// When
210-
let systemPluginResult: Yosemite.SystemPlugin? = waitFor { promise in
211-
let action = SystemStatusAction.fetchSystemPluginListWithNameList(siteID: self.sampleSiteID,
212-
systemPluginNameList: ["Plugin 2", "Plugin 3"]) { result in
213-
promise(result)
214-
}
215-
store.onAction(action)
216-
}
217-
218-
// Then
219-
XCTAssertEqual(systemPluginResult?.name, "Plugin 3")
220-
}
221-
222197
func test_fetchSystemPluginWithPath_returns_plugin_when_matching_plugin_is_in_storage() {
223198
// Given
224199
let systemPlugin1 = viewStorage.insertNewObject(ofType: SystemPlugin.self)

WooCommerce/WooCommerceTests/ViewRelated/OrderDetailsViewModelTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,6 @@ private extension OrderDetailsViewModelTests {
727727
switch action {
728728
case let .fetchSystemPlugin(_, _, onCompletion):
729729
onCompletion(plugin)
730-
case let .fetchSystemPluginListWithNameList(_, _, onCompletion):
731-
onCompletion(plugin)
732730
case let .fetchSystemPluginWithPath(_, pluginPath, onCompletion):
733731
if let path, path != pluginPath {
734732
onCompletion(nil)

WooCommerce/WooCommerceTests/ViewRelated/Orders/Order Details/OrderDetailsViewControllerTests.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,6 @@ private struct OrderDetailStoreManagerFactory {
190190
}
191191
}
192192

193-
// Need to sync plugins first
194-
storesManager.whenReceivingAction(ofType: SystemStatusAction.self) { action in
195-
switch action {
196-
case let .fetchSystemPluginListWithNameList(_, _, onCompletion):
197-
onCompletion(nil)
198-
default:
199-
break
200-
}
201-
}
202-
203193
storesManager.whenReceivingAction(ofType: SubscriptionAction.self) { action in
204194
switch action {
205195
case let .loadSubscriptions(_, onCompletion):

0 commit comments

Comments
 (0)