-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Refactor FlagCommentPage to access parent report directly from Onyx #38356
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
Conversation
|
@arosiclair Please 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] |
Reviewer Checklist
Screenshots/VideosAndroid: NativeRecord_2024-03-15-02-50-55.mp4Android: mWeb ChromeRecord_2024-03-15-03-00-44.mp4iOS: NativeScreen.Recording.2024-03-15.at.2.26.20.AM.moviOS: mWeb SafariScreen.Recording.2024-03-15.at.2.37.32.AM.movMacOS: Chrome / SafariScreen.Recording.2024-03-15.at.2.39.15.AM.movMacOS: DesktopScreen.Recording.2024-03-15.at.3.29.28.AM.mov |
|
Lint and tests failing :( |
|
Oops, sorry! Fixed them and updated the branch. |
|
Thank you! |
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 we use ts ?
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.
oh i see there are type errors as methods are undefined
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.
Oh, good suggestion! I didn't even think of it. Let me try.
|
Updated with tests written in TS |
| function getParentReport(report: OnyxEntry<OnyxTypes.Report> | EmptyObject): OnyxEntry<OnyxTypes.Report> | EmptyObject { | ||
| if (!report?.parentReportID) { | ||
| return {}; | ||
| } | ||
| return allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report.parentReportID}`] ?? {}; | ||
| } |
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 verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
Seems we are intentionally doing this, but just mentioning...
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.
The correct pattern to use is that every file will use it's own withOnyx or Onyx.connect() to access the Onyx data it needs. This prevents data from becoming stale
found this explaination justifiable 👌
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.
Thanks for pointing it out!
|
Bug: I see Not-found page on flag as offensive page for a second for android. video: Record_2024-03-15-02-50-55.mp4 |
|
Hm, are you sure that's not happening before? The |
|
just checked on main, can reproduce i'll report in slack if there's no issue already 👍 |
ishpaul777
left a 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.
LGTM!
|
🎯 @ishpaul777, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #38360. |
arosiclair
left a 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.
LGTM. Looking forward to this reducing pesky dependency cycles 👍
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 1.4.54-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.4.54-4 🚀
|
Fixed Issues
Part of #27262
Tests
Offline tests
Same as the above
QA Steps
Same as the above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop