-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
De-duplicate checking if a report action is an attachment #25560
Conversation
src/libs/isReportActionAttachment.js
Outdated
* @returns {Boolean} | ||
*/ | ||
export default function isReportActionAttachment(reportAction) { | ||
const message = _.first(lodashGet(reportAction, 'message', [{}])); |
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 switched to first
to be consistent with the ['message', 0, 'html']
path I used elsewhere, but attachment messages (and comment messages in general) can't have multiple fragments if I understand this correctly.
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.
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.
What I meant is that...
...in some places, like this, we were looking at the last fragment of the attachment message (this is what I de-duplicate)
...but in other places, like this (actually the next line), we were looking at the first fragment of the attachment message
In both cases, the actual assumption seems to be that an attachment message has only one fragment. Still, I decided to make that consistent and always look at the first fragment.
By "fragment", I mean an element of the message
array.
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.
@venture1981 Let me know if my explanation clarified this
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.
@venture1981 Friendly bump
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.
@venture1981 As the merge freeze is over, it would be great if we could resolve this conversation. If for some reason you're not available to reply, I'll resolve this thread anyway and try to get this PR merged. Thanks!
defcc6a
to
ed7d7ba
Compare
...and improve the 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.
Can you do at least 1 test?
Additionally, there are conflicts |
I did manual tests, but I didn't include their description in the Tests section. Fixed.
The conflict was minor. Resolved. |
Could you please attach at least 1 screenshot or video for the tests? |
@flodnv Sure! Done. I added a video for the Web/Desktop. |
Thanks! Does this fix #25415 ? |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Ah ok, in the future please link this context in the PR description so we can better understand |
🚀 Deployed to staging by https://github.com/flodnv in version: 1.3.71-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.71-12 🚀
|
Details
De-duplicate the code checking if a report action is an attachment
Fixed Issues
$
PROPOSAL:
Tests
Offline tests
Same as Tests
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
deduplicate-isAttachment-web.mp4
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android