fix crash on DetailsPage - #10820
fix crash on DetailsPage#10820
Conversation
| } | ||
|
|
||
| DetailsPage.propTypes = propTypes; | ||
| DetailsPage.displayName = 'DetailsPage'; |
There was a problem hiding this comment.
Remove this as it's no longer needed since this is a class-based component!
Santhosh-Sellavel
left a comment
There was a problem hiding this comment.
Suggested a comment
Co-authored-by: Santhoshkumar Sellavel <85645967+Santhosh-Sellavel@users.noreply.github.com>
|
Santhosh-Sellavel
left a comment
There was a problem hiding this comment.
Looks good, tests well!
@iwiznia all you!
|
@iwiznia looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Are you drunk Melvin?! This had passing tests |
| const GMTTime = `${timezone.toString().split(/[+-]/)[0].slice(-3)} ${timezone.zoneAbbr()}`; | ||
| const currentTime = Number.isNaN(Number(timezone.zoneAbbr())) ? timezone.zoneAbbr() : GMTTime; | ||
| const shouldShowLocalTime = !ReportUtils.hasExpensifyEmails([details.login]); | ||
| render() { |
There was a problem hiding this comment.
I'm a bit confused why this was turned into a class based component, was that necessary?
There was a problem hiding this comment.
This is very old PR and at that time, we're not allowed to use functional component with hooks.
#9545 (comment)
Now this is deprecated.
| let pronouns = details.pronouns; | ||
| // If we have a reportID param this means that we | ||
| // arrived here via the ParticipantsPage and should be allowed to navigate back to it | ||
| const shouldShowBackButton = Boolean(this.props.route.params.reportID); |
There was a problem hiding this comment.
Also this is quite interesting... In ROUTES.js we only have getDetailsRoute to construct this page's route, and we can only pass a Login here at the moment, no reportID - so how is reportID still available here??
At the moment I don't see the back button being shown on the details page anywhere... I thinkkkk the reportID you're looking for is in the ReportParticipantsPage, not DetailsPage
There was a problem hiding this comment.
This was old old logic. Not introduced by this PR.
https://github.com/Expensify/App/pull/10820/files#diff-4426aa1d3788c60f7845305d45877244f89c00bc81e2322e1f1eeff653a13becR78-R79
Details
Fixed Issues
$ #9545
Tests
For web, mWeb:
For android, iOS, desktop:
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)QA Steps
For web, mWeb:
For android, iOS, desktop:
Screenshots
Web
web.mov
Mobile Web
mweb.mov
Desktop
desktop.mov
iOS
ios.mov
Android
android.mov