-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic Dashboard: Reviews card states and unit tests #12806
Conversation
|
ee015b2
to
037849d
Compare
|
||
func emptyView(isFiltered: Bool) -> some View { | ||
VStack(spacing: 0) { | ||
ReviewsDashboardEmptyView(isFiltered: isFiltered) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this view is simple so can be part of this file, not necessary to be separate unless it's to be reused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, updated in 811f143
|
||
static let noFilteredReviewsText = NSLocalizedString( | ||
"mostActiveCouponsEmptyView.noFilteredReviewsText", | ||
value: "No reviews match the selected filter, please try changing the filter.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: if this view is kept in ReviewDashboardCard
, you can use the current filter to display in the message. Something like: "No reviews matching Hold status". This would be more explicit and concise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that's more useful. Added in 811f143
await viewModel.reloadData() | ||
|
||
// Then | ||
XCTAssertEqual(viewModel.data.count, self.sampleReviews.count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should compare the data rather than just the count, to make sure that the details are correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated in 8739e01
Conflicts: WooCommerce/Classes/ViewRelated/Dashboard/Reviews/ReviewsDashboardCard.swift
Conflicts: WooCommerce/WooCommerce.xcodeproj/project.pbxproj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @hafizrahman 👋 As discussed in the previous PR, I think we should not always show the review list when there is existing data. From my testing, when refreshing the card, we show the list without the shimmering animation, making it confusing to understand if data is being reloaded.
@itsmeichigo I think something might have gone wrong / unaccounted for after merging from the latest branch, I was just responding to the previous feedbacks without adding any logic change. Let me check, thanks! |
@itsmeichigo I decided to revamp the loading state to match similar behavior in InboxDashboardCard and have placeholder data displayed always when loading. I also simplified the syncing to only show items when there's full text with product names and notifications loaded, just makes things easier to follow that way. Video of latest loading state: Simulator.Screen.Recording.-.iPhone.15.iOS.17.4.-.2024-05-30.at.10.37.49.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Hafiz, LGTM
Please do not merge until target is trunk
Closes: #12742
Description
This PR completes the Reviews card task by adding the following:
Testing instructions
Please check and compare with screenshots posted below:
Tracked dynamic_dashboard_card_retry_tapped, ...
withtype: reviews
included.Tracked dynamic_dashboard_hide_card_tapped, ...
withtype: reviews
included.Screenshots
Error case: