Repository navigation
Move visible state to parent component - #51350
Conversation
|
@jayeshmangwani 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] |
2f66068 to
baa476f
Compare
| }; | ||
|
|
||
| function DelegateMagicCodeModal({login, role, onClose}: DelegateMagicCodeModalProps) { | ||
| function DelegateMagicCodeModal({login, role, onClose, isValidateCodeActionModalVisible, setIsValidateCodeActionModalVisible}: DelegateMagicCodeModalProps) { |
There was a problem hiding this comment.
Can we use a single onClose prop here, and not pass the setIsValidateCodeActionModalVisible ? By pressing onClose, we can handle the setIsValidateCodeActionModalVisible on the ConfirmDelegatePage
|
@cretadn22 please check this comment |
|
@jayeshmangwani This suggestion has a small issue, please give me some time to thoroughly test it. I'll provide an update shortly. |
|
@cretadn22 Could you please elaborate on the specific issue? If we get more details, we can work on figuring it out together. |
|
bump @cretadn22 |
| if (!showValidateActionModal) { | ||
| return; | ||
| } | ||
| Navigation.navigate(ROUTES.SETTINGS_SECURITY); |
There was a problem hiding this comment.
@jayeshmangwani I'm not clear on why this code is necessary. Which use case is it addressing?
cc @getusha
There was a problem hiding this comment.
@cretadn22 It seems this case was added to handle navigation depending on the source page. If we arrive from the SecuritySettingsPage and close the DelegateMagicCodeModal, we need to navigate back to the SecuritySettingsPage on close. However, if we come from the Add Copilot flow, we should simply hide the modal without further navigation.
There was a problem hiding this comment.
After reviewing the git blame and testing the flow, I believe a bit of refactoring is needed here. For example, we can remove the entire usage of showValidateActionModal and use DelegateMagicCodeModal directly on the SecuritySettingsPage
There was a problem hiding this comment.
@getusha Could you help us understand why we navigate to the DelegateConfirmPage from the SecuritySettingsPage? Wouldn’t it be easier to handle if we used the DelegateMagicCodeModal directly on the SecuritySettingsPage instead? Or am I missing some underlying logic here?
There was a problem hiding this comment.
@cretadn22, I've pinged Getabalew on Slack to see why the above was added and what it does. Let's see if they can help us understand.
cc: @carlosmiceli
There was a problem hiding this comment.
If so, I believe the current code is both safer and simpler.
Can we proceed by adding setIsValidateCodeActionModalVisible in the onClose function?
There was a problem hiding this comment.
Oh, sorry, I missed your commit. Have you tested all the platforms again after this change?
There was a problem hiding this comment.
One question: can we add setIsValidateCodeActionModalVisible(false); inside the if (!showValidateActionModal) { block? Since, if showValidateActionModal is true, we’re already calling the navigation.navigate, so when we return to this page, isValidateCodeActionModalVisible will be set to true.
There was a problem hiding this comment.
@jayeshmangwani I made updates and tests, it is fine
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid.mp4Android: mWeb Chromemweb-chrome.mp4iOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.0.57-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.57-10 🚀
|
Details
Fixed Issues
$ #51273
PROPOSAL: #51273 (comment)
Tests
QA Steps
Offline tests
QA Steps
QA Steps
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
Screen.Recording.2024-10-24.at.00.25.13.mov
Android: mWeb Chrome
Screen.Recording.2024-10-24.at.00.01.35.mov
iOS: Native
Screen.Recording.2024-10-24.at.00.23.28.mov
iOS: mWeb Safari
Screen.Recording.2024-10-24.at.00.01.11.mov
MacOS: Chrome / Safari
Screen.Recording.2024-10-23.at.23.57.20.mov
MacOS: Desktop
Screen.Recording.2024-10-23.at.23.59.22.mov