Cut report last message to specified length#7124
Conversation
| /** | ||
| * Used before merging Report data. | ||
| * Cut last message to specific length, because we don't need full last message | ||
| * | ||
| * @param {String} lastMessage | ||
| * @returns {String} | ||
| */ | ||
| function cutLastMessage(lastMessage) { | ||
| return lastMessage.substr(0, CONST.REPORT.MAX_LAST_MESSAGE_LENGTH); | ||
| } | ||
|
|
There was a problem hiding this comment.
Let's move this to reportUits as formatReportLastMessageText
| // Alwasy cut last message | ||
| updatedReportObject.lastMessageText = cutLastMessage(messageText); | ||
|
|
There was a problem hiding this comment.
Why did you move this out of if block?
There was a problem hiding this comment.
There might be a chance that this if block is not executed, so last message is not being cut.
There was a problem hiding this comment.
Then it means that message is set somewhere else and we should cut the message there not here.
There was a problem hiding this comment.
I have add cuts to possible lastMessage, so this is not necessary. Let's remove this.
There was a problem hiding this comment.
I see that it is important here. We can't remove it. So we can just move the line back to the previous location and add the formatting.
Co-authored-by: Rajat Parashar <parasharrajat@users.noreply.github.com>
Co-authored-by: Rajat Parashar <parasharrajat@users.noreply.github.com>
parasharrajat
left a comment
There was a problem hiding this comment.
LGTM.
cc: @Julesssss
🎀 👀 🎀 C+ reviewed
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by @Julesssss in version: 1.1.30-4 🚀
|
|
🚀 Deployed to production by @chiragsalian in version: 1.1.31-1 🚀
|
Details
Cut last message of a report to specific length, because we only use last message as alternate text on RHN and LHN.
Fixed Issues
$ #6699
Tests
QA Steps
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android