-
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
Fix: On delete Message hide un-actionable items #20460
Fix: On delete Message hide un-actionable items #20460
Conversation
@techievivek @aimane-chnaif One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@aimane-chnaif do we need to add conditions for |
I believe keep as is now. No reason for disabling those in deleted message. |
Sure not added in this PR @aimane-chnaif |
@aimane-chnaif any other suggestion on other options to hide here? |
What is this step for? |
@aimane-chnaif I just removed that since that Is not required |
Also reaction icon and 4 quick reactions in Step 7. |
@aimane-chnaif I have added little note on step-5 so QA team can test |
5 repeated conditions seem not perfect. Let's introduce global function similar to |
yeah agree I'm about to create a new function but I was thinking to create inside |
ok let's do that |
@aimane-chnaif added a new helper function to fetch delete status |
Reviewer Checklist
Screenshots/VideosWebweb.movweb2.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.movAndroidandroid.mov |
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.
@techievivek LGTM 🎉
src/libs/ReportActionsUtils.js
Outdated
* @param {Object} reportActions | ||
* @returns {Boolean} | ||
*/ | ||
function isMessageDeleted(reportActions) { |
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.
Can't we use this function which already exists -
App/src/libs/ReportActionsUtils.js
Lines 45 to 49 in 2386491
function isDeletedAction(reportAction) { | |
// A deleted comment has either an empty array or an object with html field with empty string as value | |
const message = lodashGet(reportAction, 'message', []); | |
return message.length === 0 || lodashGet(message, [0, 'html']) === ''; | |
} |
Also, your parameter should be named reportAction
and not reportActions
in case we do end up adding this function.
Apologies, if contributors can't comment on other PRs but I was working on a similar issue and came here to see what was being changed here.
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.
I noticed inconsistent logic to check if action is deleted.
We reused already existing logic in ContextMenuActions download icon. This is also being used here:
App/src/libs/ReportActionsUtils.js
Line 312 in 3531af2
const isDeletedParentAction = lodashGet(reportAction, ['message', 0, 'isDeletedParentAction'], false); |
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.
I think isDeletedParentAction
logic check makes more sense than html emptiness
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.
Nope, we can't use this function we have specific situations when we delete messages on thread we are displaying [deleted message] on that particular comment has this status stored inside originalMessage.isDeletedParentAction
which we don't have any function so created new please compare it yourself
For rename parameters i have just followed the above function we can check as well for consistency its fine
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.
Let's use reportAction
name. This should be correct one
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.
Cool, adding a new function makes sense but since the parameter is a single action, I thought it should be named reportAction
and in most places it is singular only but that is just my suggestion so it is up to you and the reviewers to decide.
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.
Yeah let me Change that spell
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.
@aimane-chnaif done
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.
@techievivek all yours!
bump for review @techievivek |
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.
Sorry for the delay as I was ooo. Changes looks good to me.
Also, in future, if the assigned engineer is delaying the review feel free to bring a discussion to the C+ channel so someone else can look into it. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Sure thanks. I just left PR for your review since it's not extreme urgent PR and hoping you'll be back no later than a week 😄 |
noted :) |
🚀 Deployed to staging by https://github.com/techievivek in version: 1.3.29-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.29-11 🚀
|
Hey there, it would be better if bug #21103 were fixed in this PR. |
Details
Fixed Issues
$ #20074
PROPOSAL: #20074 (comment)
Tests
Offline tests
Same as above
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android