Skip to content

[BUG] App isn't showing message for PDF/file uploads#2584

Merged
diegolmello merged 9 commits intoRocketChat:developfrom
saket-m0:show-description-for-files
Nov 4, 2020
Merged

[BUG] App isn't showing message for PDF/file uploads#2584
diegolmello merged 9 commits intoRocketChat:developfrom
saket-m0:show-description-for-files

Conversation

@saket-m0
Copy link
Copy Markdown
Contributor

Proposed changes

The app now shows the message entered with the pdf or other files on sending.

In app/containers/message/Reply.js added an if statement to check if file description exists and if yes then add a markdown with value msg equal to the description.

Also tested using 'yarn test -u' to add/update the tests.

Issue(s)

Fixing the issue #2531

How to test or reproduce

Screenshots

The text entered while sending the file is visible in the development version now (Refer to the latest attachment sent).
Screenshot_20201010-000013_ DEBUG  RocketChat Experimental

The same text is not visible in the production version (Refer to the latest attachment sent).
Screenshot_20201009-234131_RocketChat

Types of changes

  • [ x ] Bugfix (non-breaking change which fixes an issue)
  • [ x ] Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • [ x ] I have read the CONTRIBUTING doc
  • [ x ] I have signed the CLA
  • [ x ] Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

I am new to Opensource. Please let me know if I have done something wrong so that I can Fix It. Thank You!

In app/containers/message/Reply.js added a View Contaier around the
Attachment Touchable and Added a Markdown attribute with msg set to
description of attachment to display the message if any.
Added an if statement to check if file description exists and if yes
then add a markdown with value msg equal to the description.

Also tested using 'yarn test -u' to add/update the tests.
Removed the condition to check for attachment description.
Added the `markdown` inside the touchable and wrapped `attachmentContainer` and the `markdown` inside a `<>` component
@djorkaeffalexandre djorkaeffalexandre changed the title Show description for files [BUG] App isn't showing message for PDF/file uploads Oct 29, 2020
Copy link
Copy Markdown
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find the if statement mentioned on the description and markdown is rendering inside the touchable.

image

@saket-m0
Copy link
Copy Markdown
Contributor Author

saket-m0 commented Nov 3, 2020

I removed the if statement as one of the maintainers told me there is no need for the if statement.

I have fixed my mistake in the return statement and moved markdown outside the touchable.

Copy link
Copy Markdown
Member

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@diegolmello diegolmello merged commit 8bc32a3 into RocketChat:develop Nov 4, 2020
@diegolmello
Copy link
Copy Markdown
Member

@saket-m0 I've tweaked it a bit in order to merge. You can check my changes. Thanks.

@saket-m0
Copy link
Copy Markdown
Contributor Author

saket-m0 commented Nov 4, 2020

Thanks a lot! :)