Skip to content

Commit 441fa01

Browse files
committed
Remove row view model code due to PR size.
1 parent 375c344 commit 441fa01

File tree

5 files changed

+6
-181
lines changed

5 files changed

+6
-181
lines changed

WooCommerce/Classes/ViewRelated/Inbox/Inbox.swift

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ struct Inbox: View {
1515
Group {
1616
switch viewModel.syncState {
1717
case .results:
18+
// TODO: 5954 - update results state
1819
InfiniteScrollList(isLoading: viewModel.shouldShowBottomActivityIndicator,
1920
loadAction: viewModel.onLoadNextPageAction) {
20-
ForEach(viewModel.noteRowViewModels) { rowViewModel in
21-
if #available(iOS 15.0, *) {
22-
// In order to show full-width separator, the default list separator is hidden and a `Divider` is shown inside the row.
23-
InboxNoteRow(viewModel: rowViewModel)
24-
.listRowSeparator(.hidden)
25-
} else {
26-
InboxNoteRow(viewModel: rowViewModel)
27-
}
21+
ForEach(viewModel.notes, id: \.id) { note in
22+
TitleAndSubtitleRow(title: note.title, subtitle: note.content)
2823
}
2924
}
3025
case .empty:
@@ -34,14 +29,8 @@ struct Inbox: View {
3429
image: .emptyProductsTabImage)
3530
.frame(maxHeight: .infinity)
3631
case .syncingFirstPage:
37-
List {
38-
ForEach(viewModel.placeholderRowViewModels) { rowViewModel in
39-
InboxNoteRow(viewModel: rowViewModel)
40-
.redacted(reason: .placeholder)
41-
.shimmering()
42-
}
43-
}
44-
.listStyle(PlainListStyle())
32+
// TODO: 5954 - update placeholder state
33+
EmptyView()
4534
}
4635
}
4736
.background(Color(.listBackground).ignoresSafeArea())

WooCommerce/Classes/ViewRelated/Inbox/InboxNoteRow.swift

Lines changed: 0 additions & 104 deletions
This file was deleted.

WooCommerce/Classes/ViewRelated/Inbox/InboxNoteRowViewModel.swift

Lines changed: 0 additions & 40 deletions
This file was deleted.

WooCommerce/Classes/ViewRelated/Inbox/InboxViewModel.swift

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,7 @@ final class InboxViewModel: ObservableObject {
88
let onLoadTrigger: PassthroughSubject<Void, Never> = PassthroughSubject()
99

1010
/// All inbox notes.
11-
@Published private var notes: [InboxNote] = []
12-
13-
/// View models for inbox note rows.
14-
@Published private(set) var noteRowViewModels: [InboxNoteRowViewModel] = []
15-
16-
/// View models for placeholder rows.
17-
let placeholderRowViewModels: [InboxNoteRowViewModel] = [Int64](0..<3).map {
18-
// The content does not matter because the text in placeholder rows is redacted.
19-
InboxNoteRowViewModel(id: $0, title: " ",
20-
actions: [.init(id: 0, title: "Placeholder", url: nil)])
21-
}
11+
@Published private(set) var notes: [InboxNote] = []
2212

2313
// MARK: Sync
2414

@@ -46,8 +36,6 @@ final class InboxViewModel: ObservableObject {
4636
self.syncState = syncState
4737
self.paginationTracker = PaginationTracker(pageSize: pageSize)
4838

49-
$notes.map { $0.map { InboxNoteRowViewModel(note: $0) } }.assign(to: &$noteRowViewModels)
50-
5139
configurePaginationTracker()
5240
configureFirstPageLoad()
5341
}

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,8 @@
208208
0262DA5823A23AC80029AF30 /* ProductShippingSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0262DA5623A23AC80029AF30 /* ProductShippingSettingsViewController.swift */; };
209209
0262DA5923A23AC80029AF30 /* ProductShippingSettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0262DA5723A23AC80029AF30 /* ProductShippingSettingsViewController.xib */; };
210210
0262DA5B23A244830029AF30 /* Product+ShippingSettingsViewModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0262DA5A23A244830029AF30 /* Product+ShippingSettingsViewModels.swift */; };
211-
02645D7C27BA027B0065DC68 /* InboxNoteRowViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02645D7827BA027A0065DC68 /* InboxNoteRowViewModel.swift */; };
212211
02645D7D27BA027B0065DC68 /* Inbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02645D7927BA027B0065DC68 /* Inbox.swift */; };
213212
02645D7E27BA027B0065DC68 /* InboxViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02645D7A27BA027B0065DC68 /* InboxViewModel.swift */; };
214-
02645D7F27BA027B0065DC68 /* InboxNoteRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02645D7B27BA027B0065DC68 /* InboxNoteRow.swift */; };
215213
02691780232600A6002AFC20 /* ProductsTabProductViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0269177F232600A6002AFC20 /* ProductsTabProductViewModelTests.swift */; };
216214
02691782232605B9002AFC20 /* PaginatedListViewControllerStateCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02691781232605B9002AFC20 /* PaginatedListViewControllerStateCoordinatorTests.swift */; };
217215
0269576A23726304001BA0BF /* KeyboardFrameObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0269576923726304001BA0BF /* KeyboardFrameObserver.swift */; };
@@ -1835,10 +1833,8 @@
18351833
0262DA5623A23AC80029AF30 /* ProductShippingSettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductShippingSettingsViewController.swift; sourceTree = "<group>"; };
18361834
0262DA5723A23AC80029AF30 /* ProductShippingSettingsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ProductShippingSettingsViewController.xib; sourceTree = "<group>"; };
18371835
0262DA5A23A244830029AF30 /* Product+ShippingSettingsViewModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Product+ShippingSettingsViewModels.swift"; sourceTree = "<group>"; };
1838-
02645D7827BA027A0065DC68 /* InboxNoteRowViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InboxNoteRowViewModel.swift; sourceTree = "<group>"; };
18391836
02645D7927BA027B0065DC68 /* Inbox.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Inbox.swift; sourceTree = "<group>"; };
18401837
02645D7A27BA027B0065DC68 /* InboxViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InboxViewModel.swift; sourceTree = "<group>"; };
1841-
02645D7B27BA027B0065DC68 /* InboxNoteRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InboxNoteRow.swift; sourceTree = "<group>"; };
18421838
0269177F232600A6002AFC20 /* ProductsTabProductViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductsTabProductViewModelTests.swift; sourceTree = "<group>"; };
18431839
02691781232605B9002AFC20 /* PaginatedListViewControllerStateCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaginatedListViewControllerStateCoordinatorTests.swift; sourceTree = "<group>"; };
18441840
0269576923726304001BA0BF /* KeyboardFrameObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardFrameObserver.swift; sourceTree = "<group>"; };
@@ -3757,8 +3753,6 @@
37573753
isa = PBXGroup;
37583754
children = (
37593755
02645D7927BA027B0065DC68 /* Inbox.swift */,
3760-
02645D7B27BA027B0065DC68 /* InboxNoteRow.swift */,
3761-
02645D7827BA027A0065DC68 /* InboxNoteRowViewModel.swift */,
37623756
02645D7A27BA027B0065DC68 /* InboxViewModel.swift */,
37633757
);
37643758
path = Inbox;
@@ -8590,7 +8584,6 @@
85908584
311237EE2714DA240033C44E /* CardPresentModalDisplayMessage.swift in Sources */,
85918585
45E3C8F325E7D30300102E84 /* ShippingLabelAddress+Woo.swift in Sources */,
85928586
57A25C7C25ACFAEC00A54A62 /* OrderFulfillmentNoticePresenter.swift in Sources */,
8593-
02645D7C27BA027B0065DC68 /* InboxNoteRowViewModel.swift in Sources */,
85948587
D8610BD2256F291000A5DF27 /* JetpackErrorViewModel.swift in Sources */,
85958588
26C6E8E626E6B5F500C7BB0F /* StateSelectorViewModel.swift in Sources */,
85968589
020B2F9423BDDBDC00BD79AD /* ProductUpdateError+UI.swift in Sources */,
@@ -8763,7 +8756,6 @@
87638756
454453CA27566CDE00464AC5 /* HubMenuViewModel.swift in Sources */,
87648757
934CB123224EAB150005CCB9 /* main.swift in Sources */,
87658758
456396AE25C81D81001F1A26 /* ShippingLabelFormViewModel.swift in Sources */,
8766-
02645D7F27BA027B0065DC68 /* InboxNoteRow.swift in Sources */,
87678759
02ECD1DF24FF48D000735BE5 /* PaginationTracker.swift in Sources */,
87688760
020886572499E643001D784E /* ProductExternalLinkViewController.swift in Sources */,
87698761
262A09812628A8F40033AD20 /* WooStyleModifiers.swift in Sources */,

0 commit comments

Comments
 (0)