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
[Notifications P2] Commen Moderation: Pending #23134
[Notifications P2] Commen Moderation: Pending #23134
Conversation
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
|
…ss-mobile/WordPress-iOS into feature/notifications-p2_comment-approval # Conflicts: # Modules/Sources/DesignSystem/Foundation/IconName.swift
…ss-mobile/WordPress-iOS into feature/notifications-p2_comment-approval
…ss-mobile/WordPress-iOS into feature/notifications-p2_comment-approval # Conflicts: # Modules/Sources/DesignSystem/Foundation/IconName.swift # WordPress/Classes/ViewRelated/Notifications/Comment Moderation/CommentModerationView.swift # WordPress/Classes/ViewRelated/Notifications/Comment Moderation/CommentModerationViewModel.swift
// isNotificationComment ? WPAppAnalytics.track(.notificationsCommentApproved, | ||
// withProperties: Constants.notificationDetailSource, | ||
// withBlogID: notification?.metaSiteID) : | ||
// CommentAnalytics.trackCommentApproved(comment: comment) | ||
// | ||
commentService.approve(comment, success: { [weak self] in | ||
self?.state = .approved(liked: false) | ||
// self?.showActionableNotice(title: ModerationMessages.approveSuccess) | ||
// self?.refreshData() | ||
}, failure: { /* [weak self] */ error in | ||
// self?.displayNotice(title: ModerationMessages.approveFail) | ||
// self?.commentStatus = CommentStatusType.typeForStatus(self?.comment.status) | ||
}) |
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.
I left these as a reminder to not miss the existing functionality. Will be removed once the actions are implemented.
) | ||
let hostingController = UIHostingController(rootView: commentModerationView) | ||
containerStackView.addArrangedSubview(hostingController.view) | ||
} |
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 @alpavanoglu, the moderation doesn't show up in my case even though comment.allowsModeration
is true
and comment status is pending
.
After investigating the issue, I discovered that CommentModerationState(comment: comment)
was returning nil
because the comment.status
for a pending comment is set to hold
, not pending
.
Suggestion: I think It would be more reliable to use the CommentDetailViewController.commentStatus
property, which is of type CommentStatusType
. This property was used in the outdated moderation view.
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.
That type seem to have draft
as an option. I don't think it is relevant in Notifications context. We would need to handle the draft
case. I've updated the value to hold
now. Lmk if you have other concerns regarding that.
WordPress/Classes/ViewRelated/Notifications/Comment Moderation/CommentModerationView.swift
Show resolved
Hide resolved
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.
LGTM! 🚀
9a98fa3
into
feature/notifications_refresh_p2
Fixes #https://github.com/Automattic/wordpress-mobile/issues/33
Description
This PR adds the new Moderation View UI to the Comment Detail Screen. The functionality will follow with other PRs.
Acceptance Criteria
If the comment has the "Pending" moderation status, a moderation panel is displayed at the bottom of the comment details screen. There is a separator between the content and the panel.
1⃣ There is a label indicating the moderation state with a dedicated icon.
2⃣ Approve comment CTA button with an icon is visible but not actionable.
3⃣ More options CTA button opens a bottom sheet dialog containing all the available moderation options.
4⃣ The bottom sheet dialog presents "Approved," "Pending," "Thrash," and "Spam" options that are not actionable.
Testing Steps
Test in dark and light mode and with different dynamic font sizes.
Screenshot Reference
Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: