Refactor FlagCommentPage to access parent report directly from Onyx#38356
Refactor FlagCommentPage to access parent report directly from Onyx#38356arosiclair merged 8 commits intomainfrom
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.
oh i see there are type errors as methods are undefined
There was a problem hiding this comment.
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.
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.
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.
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, 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.
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