-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Update report option when personal detail is changed #40167
Conversation
@hungvu193 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] |
Precondition: Create a brand new account. Screen.Recording.2024-04-17.at.09.37.24.mov |
@hungvu193 Updated to fix this case. |
@@ -45,6 +51,7 @@ function OptionsListContextProvider({reports, children}: OptionsListProviderProp | |||
}); | |||
|
|||
const personalDetails = usePersonalDetails(); | |||
const prevPersonalDetails = useRef(personalDetails); |
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 replace this by our existing hook usePrevious
?
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.
@hungvu193 I tested and we can use usePrevious
hook. Updated to use this hook.
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.
Awesome, let's me test again!
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid.movAndroid: mWeb ChromemWebAndroid.moviOS: NativeIOS.moviOS: mWeb SafarimSafari.movMacOS: Chrome / SafariChrome.movMacOS: Desktopdesktop.mov |
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!
return newOptions; | ||
}); | ||
|
||
// eslint-disable-next-line react-hooks/exhaustive-deps |
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 other dependencies is this expecting that we're purposefully ignoring? it looks reports
?
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.
@nkdengineer can you help me understand why we added 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.
@bondydaa In this case we only want to update the personal detail option and the related report of the changed personal detail. So we're ignoring other dependencies.
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.
got it, can you add that as a comment here then as well so future us can know exactly why/which dependencies we are okay with ignoring?
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.
little bump @nkdengineer on above 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.
Updating now.
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.
@bondydaa I added a comment, please help to check again.
cc @hungvu193
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.
little bump @bondydaa for final review
@bondydaa Any update here. |
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.
sorry went OOO last week, 👍
✋ 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 https://github.com/francoisl in version: 1.4.67-7 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to staging by https://github.com/bondydaa in version: 1.4.68-0 🚀
|
🚀 Cherry-picked to staging by https://github.com/francoisl in version: 1.4.67-7 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
newReportOption: OptionsListUtils.SearchOption<Report>; | ||
}> = []; | ||
|
||
Object.keys(personalDetails).forEach((accoutID) => { |
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.
Heads up, this caused the regression #41275
(Also, accountID
😄)
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 handling it while I'm AFK, that's weird that I already tested logged out case but couldn't see the crash.
I should have tested it more careful next time!
🚀 Deployed to production by https://github.com/francoisl in version: 1.4.68-3 🚀
|
Details
Update report option when personal detail is changed
Fixed Issues
$ #39607
PROPOSAL: #39607 (comment)
Tests
Offline tests
Same as above
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 methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Screen.Recording.2024-04-16.at.15.52.13.mov
Android: mWeb Chrome
Screen.Recording.2024-04-16.at.15.51.43.mov
iOS: Native
Screen.Recording.2024-04-16.at.15.52.50.mov
iOS: mWeb Safari
Screen.Recording.2024-04-16.at.15.51.00.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-16.at.15.50.16.mov
MacOS: Desktop
Screen.Recording.2024-04-16.at.15.54.06.mov