Skip to content

Commit 5992bc3

Browse files
committed
add: data model to the configure method
1 parent 99a014c commit 5992bc3

6 files changed

Lines changed: 7 additions & 7 deletions

File tree

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import UIKit
33
typealias DashboardCollectionViewCell = UICollectionViewCell & Reusable & BlogDashboardCardConfigurable
44

55
protocol BlogDashboardCardConfigurable {
6-
func configure(blog: Blog, viewController: BlogDashboardViewController?)
6+
func configure(blog: Blog, viewController: BlogDashboardViewController?, dataModel: NSDictionary?)
77
}
88

99
final class BlogDashboardViewController: UIViewController {

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Posts/DashboardPostsCardCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22

33
class DashboardPostsCardCell: UICollectionViewCell, Reusable, BlogDashboardCardConfigurable {
4-
func configure(blog: Blog, viewController: BlogDashboardViewController?) {
4+
func configure(blog: Blog, viewController: BlogDashboardViewController?, dataModel: NSDictionary?) {
55
guard let viewController = viewController else {
66
return
77
}

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Posts/PostsCardViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import UIKit
1313
private var ghostableTableView: UITableView?
1414
private var errorView: DashboardCardInnerErrorView?
1515

16-
private let status: BasePost.Status = .draft
16+
var status: BasePost.Status = .draft
1717

1818
// TODO: add status as an init param
1919
@objc init(blog: Blog) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22

33
class DashboardStatsCardCell: UICollectionViewCell, Reusable, BlogDashboardCardConfigurable {
4-
func configure(blog: Blog, viewController: BlogDashboardViewController?) {
5-
4+
func configure(blog: Blog, viewController: BlogDashboardViewController?, dataModel: NSDictionary?) {
5+
66
}
77
}

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/HostCollectionViewCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class HostCollectionViewCell<Content>: UICollectionViewCell, Hostable where Cont
4949
extension HostCollectionViewCell: Reusable { }
5050

5151
extension HostCollectionViewCell: BlogDashboardCardConfigurable {
52-
func configure(blog: Blog, viewController: BlogDashboardViewController?) {
52+
func configure(blog: Blog, viewController: BlogDashboardViewController?, dataModel: NSDictionary?) {
5353
hostedView = QuickLinksView(title: "Quick Links") as? Content
5454
}
5555
}

WordPress/Classes/ViewRelated/Blog/Blog Dashboard/ViewModel/BlogDashboardViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class BlogDashboardViewModel {
3535

3636
let cellType = identifier.id.cell
3737
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellType.defaultReuseID, for: indexPath)
38-
(cell as? BlogDashboardCardConfigurable)?.configure(blog: blog, viewController: viewController)
38+
(cell as? BlogDashboardCardConfigurable)?.configure(blog: blog, viewController: viewController, dataModel: identifier.cellViewModel)
3939
return cell
4040

4141
}

0 commit comments

Comments
 (0)