-
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
Create ReportActionsList
to organize and Isolate problem code in ReportActionsView
#8830
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.
Went through all the 3 changed files and tested this locally. Everything worked pretty well and this refactor was indeed a great move.
index, | ||
}) { | ||
const shouldDisplayNewIndicator = this.props.report.newMarkerSequenceNumber > 0 | ||
&& item.action.sequenceNumber === this.props.report.newMarkerSequenceNumber; |
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.
Making sure I understand this, it should be >=
or ===
?
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 ask this question another way?
I believe the left side of the condition is checking to make sure we do not have 0
since that would show a new line indicator at the bottom of the chat and it's supposed to go above at least one chat 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 was asking this for this part of the condition item.action.sequenceNumber === this.props.report.newMarkerSequenceNumber
. From my understanding, I thought for a current item to be considered new its sequence number must be greater than the newMarkerSequenceNumber
or it should be equal?
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.
Hmm sorry, I still don't understand what it is you're asking. It sounds like you concluded that the current item's sequence number would need to be greater than the "new marker sequence number"? I'm not sure how you got that though. Let me know if you have a specific question and try to add as much context as possible if you can.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Cherry-picked to staging by @sketchydroide in version: 1.1.57-8 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by @chiragsalian in version: 1.1.57-17 🚀
|
Details
This is an effort to clean up the
ReportActionsView
and start getting things under control. For now, I've focused on isolating stuff that more or less makes sense and separating it out from things that are confusing e.g.componentDidUpdate()
logic that handles a "new action that is not from the current user" eventReportActionsView
Changes that were made
ReportActionsList
componentDidUpdate()
to make the conditional logic there a little clearerNote: No logic should be changed in this PR as it is just a reorganization of existing code.
Fixed Issues
$ #8829
Tests
Check for general regressions around the chat views, chat switching etc.
PR Review Checklist
PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
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)QA Steps
Check for general regressions around the chat views, chat switching etc.
Screenshots
❌