Skip to content
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

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

csuadev
Copy link
Contributor

@csuadev csuadev commented May 14, 2024

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:
image

After:
image

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-4

Steps to test or reproduce

Further comments

Copy link
Contributor

dionisio-bot bot commented May 14, 2024

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 7.0.0, but it targets 6.9.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

Copy link

changeset-bot bot commented May 14, 2024

⚠️ No Changeset found

Latest commit: 440bbe5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 55.91%. Comparing base (2d84fe2) to head (440bbe5).
Report is 25 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
e2e 55.71% <80.00%> (+0.60%) ⬆️
unit 72.38% <ø> (-0.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@csuadev csuadev marked this pull request as ready for review May 16, 2024 08:54
@csuadev csuadev requested a review from a team as a code owner May 16, 2024 08:54
@csuadev csuadev added this to the 7.0 milestone May 20, 2024
@@ -22,6 +22,13 @@ const ModerationConsoleTableRow = ({ report, onClick, isDesktopOrLarger }: Moder
return room.fname || room.name;
});

const normalizeMessage = () => {
if (message.startsWith('[ ](') && message.includes('\n')) {
Copy link
Contributor

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?

Copy link
Contributor

@MarcosSpessatto MarcosSpessatto left a 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();
});
});
Copy link
Contributor

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?

Copy link
Contributor Author

@csuadev csuadev May 27, 2024

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();
});
});
});
Copy link
Contributor

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? 🤔

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants