-
Notifications
You must be signed in to change notification settings - Fork 10k
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
chore: reported message text on quoted message #32432
base: develop
Are you sure you want to change the base?
Conversation
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #32432 +/- ##
===========================================
+ Coverage 55.60% 55.91% +0.30%
===========================================
Files 2408 2455 +47
Lines 53023 53978 +955
Branches 10902 11102 +200
===========================================
+ Hits 29483 30181 +698
- Misses 20931 21155 +224
- Partials 2609 2642 +33
Flags with carried forward coverage won't be shown. Click here to find out more. |
apps/meteor/client/views/admin/moderation/ModerationConsoleTableRow.tsx
Outdated
Show resolved
Hide resolved
@@ -22,6 +22,13 @@ const ModerationConsoleTableRow = ({ report, onClick, isDesktopOrLarger }: Moder | |||
return room.fname || room.name; | |||
}); | |||
|
|||
const normalizeMessage = () => { | |||
if (message.startsWith('[ ](') && message.includes('\n')) { |
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 wonder if it would not be better to have regex here to do the recognization instead. @ggazzo can you give your input here please?
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.
If the PR fixes the problem, we need to change the PR title to fix:
and add a changeset.
await expect(poModeration.reportedMessagesTab).toBeVisible(); | ||
await expect(poModeration.findRowByName(quotedMessage)).toBeVisible(); | ||
}); | ||
}); |
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.
Can we add a test with a chain (at least 2) of quotes?
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 tested that scenario by myself but didn't write a test for it, it's basically the same scenario, it doesn't change anything, it just extract latest message as it does with a single quote.
await expect(poModeration.findRowByName(quotedMessage)).toBeVisible(); | ||
}); | ||
}); | ||
}); |
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.
Also, I'm concerned with this... What happens if we report a quoted message with an image instead of text? Or a video? Or any thing different from a text? 🤔
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.
Seems to me like this is a different issue that we need to work on, don't know if in a separate task, in the current scenario it just does the same as the text, it puts a link to the message and doesn't show any text, with my changes it doesn't show any text when its an image as I remove the link. I will try to fix it, if the workaround its too complicated I would prefer to have a separate task/PR for that since its not related to the reported QA task.
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.
@MarcosSpessatto I think we would need a different task for that since I was looking into it and we don't have a way to know what kind of message it is inside the report, probably would need a little backend work to try to send more information in the reports information. I only get the message content and when it is an image, it just gets an empty string, which is kind of hard to evaluate to assume that when it gets an empty string in the message, its because its a multimedia.
This PR fix a small UI tweak that causes the UI to show the reported message placed inside the url of the quoted message when the message is a quote.
Proposed changes (including videos or screenshots)
Before:
After:
Issue(s)
https://rocketchat.atlassian.net/browse/CORE-4
Steps to test or reproduce
Further comments