feat: Link decoration for single labeled and whitelisted internal hosts.
Proposed changes (including videos or screenshots)
Links like http://server/document were not decorated in the chat even if the user whitelisted the domain name as "server".
It needed to be parsed as a link to get decorated, hence the message-parser required to be modified to adapt to this change.
I traced the point of change to be the grammar.pegjs file, specifically where the domain was verified and then the text was passed to autolink function to get parsed as a 'LINK' and not as a 'PLAIN_TEXT'.
I created a utility function to verify the domain names from the custom whitelist for which the text needed to be parsed as a link and then used that function in the pegjs file to verify the domain name. To check this behaviour, I created a test case also.
Issue(s)
This PR may close #29874
Steps to test or reproduce
Mentioned in the issue tagged above.
Further comments
It was first time for me working on a pegjs file, hence I am not sure about the code quality. Please feel free to reach out if any changes or modification is required.
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 missing the required milestone or project
Please fix the issues and try again
If you have any trouble, please check the PR guidelines
🦋 Changeset detected
Latest commit: b309d567ebb2b1ca828bfb5fb6f2ca493d52b6c6
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 34 packages
| Name | Type |
|---|---|
| @rocket.chat/message-parser | Minor |
| @rocket.chat/meteor | Patch |
| @rocket.chat/core-services | Patch |
| @rocket.chat/core-typings | Patch |
| @rocket.chat/gazzodown | Major |
| @rocket.chat/livechat | Patch |
| @rocket.chat/rest-typings | Patch |
| rocketchat-services | Patch |
| @rocket.chat/account-service | Patch |
| @rocket.chat/authorization-service | Patch |
| @rocket.chat/ddp-streamer | Patch |
| @rocket.chat/omnichannel-transcript | Patch |
| @rocket.chat/presence-service | Patch |
| @rocket.chat/queue-worker | Patch |
| @rocket.chat/stream-hub-service | Patch |
| @rocket.chat/network-broker | Patch |
| @rocket.chat/omnichannel-services | Patch |
| @rocket.chat/presence | Patch |
| @rocket.chat/uikit-playground | Patch |
| @rocket.chat/api-client | Patch |
| @rocket.chat/apps | Patch |
| @rocket.chat/cron | Patch |
| @rocket.chat/ddp-client | Patch |
| @rocket.chat/freeswitch | Patch |
| @rocket.chat/fuselage-ui-kit | Patch |
| @rocket.chat/model-typings | Patch |
| @rocket.chat/ui-contexts | Patch |
| @rocket.chat/license | Patch |
| @rocket.chat/pdf-worker | Patch |
| @rocket.chat/models | Patch |
| @rocket.chat/ui-avatar | Patch |
| @rocket.chat/ui-video-conf | Patch |
| @rocket.chat/web-ui-registration | Patch |
| @rocket.chat/instance-status | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
I don't know if this PR requires a changeset. Please let me know if this is needed as it is a change in the message parser package.
I don't know if this PR requires a changeset. Please let me know if this is needed as it is a change in the message parser package.
Hey Barrylimarti, first of all thank you so much for your PR. Yes, this PR is adding features to our existing systems so a changeset is necessary. Please refer to our documentation on development workflow, at the end of it there is a nice guideline on how to write changesets: https://developer.rocket.chat/docs/development-workflow
Also please have a look at our PR title guidelines: https://developer.rocket.chat/v1/docs/pull-requests-tags
Hi @tassoevan Thanks for approving the PR, although I saw there was one more linting error which was failing some cases. I committed the change after fixing it now. You can check it now.
Hey guys, I can see some of the checks failing in CI. Does this mean some test cases are not passing and Can you help me how to deal with these?
Hi @tassoevan Can you please review this again, as I checked everything on my system and the linting checks and test cases pass perfectly. It would be great motivation for me if this PR gets merged.