-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Show deleted comments in conversation history #6819
Conversation
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.
Does not look like the supporting color is applied at all? I think you should use styles instead of passing the color.
isDeleted() { | ||
// A deleted comment has either an empty array or an object with html field with empty string as value | ||
return lodashGet(this.props.action, 'message[0].html', '') === ''; | ||
} |
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.
Move this to ReportUtils with isDeletedAction
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.
Done
*/ | ||
isDeleted() { | ||
// A deleted comment has either an empty array or an object with html field with empty string as value | ||
return lodashGet(this.props.action, 'message[0].html', '') === ''; |
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.
Don't think we need to explicitly compare it with ===' '
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.
Fixed
/> | ||
))} | ||
{isDeleted | ||
? <ExpensifyText color={themeColors.textSupporting}>{`[${Localize.translateLocal('common.deletedCommentMessage')}]`}</ExpensifyText> |
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.
use WithLocalize
instead.
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.
Done
Co-authored-by: Rajat Parashar <[email protected]>
I took the video right before changing the text style. It was getting confusing with normal comments. Updated video below. final.mp4 |
Thanks for the video. I am not a designer guy ✏️ so I will request @shawnborton to review the video and decide the color and font styles. |
Shouldn't format be the same as that used in LHN? @parasharrajat |
yup, that's a valid point. Just thought of sharing a different perspective. But I definitely think that we should reduce the text size. |
I actually like what's shown in this comment here: #6819 (comment) |
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.
a few changes...
src/libs/reportUtils.js
Outdated
@@ -200,8 +200,19 @@ function canShowReportRecipientLocalTime(personalDetails, myPersonalDetails, rep | |||
&& moment().tz(currentUserTimezone.selected).utcOffset() !== moment().tz(reportRecipientTimezone.selected).utcOffset(); | |||
} | |||
|
|||
/** | |||
* Check if the comment is deleted | |||
* @param {Array<Object>} action |
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.
Wrong type...
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.
Fixed
@@ -42,4 +54,4 @@ ReportActionItemMessage.propTypes = propTypes; | |||
ReportActionItemMessage.defaultProps = defaultProps; | |||
ReportActionItemMessage.displayName = 'ReportActionItemMessage'; | |||
|
|||
export default withNetwork()(ReportActionItemMessage); | |||
export default compose(withNetwork(), withLocalize)(ReportActionItemMessage); |
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.
NAB: May be wrap this to the next lines like the other components?
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.
Done
src/libs/reportUtils.js
Outdated
/** | ||
* Check if the comment is deleted | ||
* @param {Array<Object>} action | ||
* @returns {boolean} |
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.
* @returns {boolean} | |
* @returns {Boolean} |
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.
Fixed
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.
LGTM.
cc: @Luke9389
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.
Lookin good! Thanks
This failed because of the |
🚀 Deployed to production by @francoisl in version: 1.1.24-19 🚀
|
@francoisl Fix here #7006 |
Guessing this did not make it to staging and so does not need to be CP'd to staging but not sure just saw it was breaking my GH actions in open PRs I'm working on. |
The changes weren't deployed to staging, but the staging branch does have the broken code on it so I think we should CP so we can get this fixed on the production branch faster. |
Details
This PR fixes an issue where deleted comments get removed completely from conversations. Instead it replaces deleted messages with a placeholder text
[Comment deleted]
Fixed Issues
$ #6759
Tests
[Comment deleted]
NB: Native apps doesn't seem to offer delete option at the moment. Reported here
QA Steps
[Comment deleted]
Tested On
Screenshots
Web
1.mp4
Mobile Web
Desktop
iOS
Android
2.mp4