Add new read commands for the workspace profile and initial settings pages - v2#44902
Conversation
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
@dukenv0307 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: NativeScreen.Recording.2024-07-05.at.23.29.51.movAndroid: mWeb ChromeScreen.Recording.2024-07-05.at.22.55.52.moviOS: NativeScreen.Recording.2024-07-05.at.22.44.27.moviOS: mWeb SafariScreen.Recording.2024-07-05.at.22.46.29.movMacOS: Chrome / Safarichrome.mp4Screen.Recording.2024-07-05.at.22.33.27.movMacOS: DesktopScreen.Recording.2024-07-05.at.22.27.11.mov |
|
@mountiny This is not related to this PR but we're having duplicate API call on workspace pages: Screen.Recording.2024-07-05.at.22.20.18.mov |
@hungvu193 The issue is connected to react strict mode, not limited only to workspace pages; all requests in dev are duplicated. |
Oh dang! I forgot we enabled strict mode so component will re-render few more times. Thanks for the information! |
| // When we create a new workspaces, the policy prop will not be set on the first render. Therefore, we have to delay rendering until it has been set in Onyx. | ||
| if (policy === undefined) { | ||
| return null; | ||
| } | ||
|
|
There was a problem hiding this comment.
Nice one!
This fixes issue where we have a little delay after creating workspace 👍
mountiny
left a comment
There was a problem hiding this comment.
Thanks for the quick work
|
@mountiny can you please assign me to the issue to handle the payment? Thank you 😄 |
|
✋ 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/mountiny in version: 9.0.5-0 🚀
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.5-2 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.6-8 🚀
|
| Policy.openPolicyInitialPage(route.params.policyID); | ||
| }, [policyDraft?.id, route.params.policyID]); | ||
|
|
||
| useNetwork({onReconnect: fetchPolicyData}); |
There was a problem hiding this comment.
This hook will trigger when reconnecting, even when this screen is not focused. This accidentally introduced this bug #82769. During reconnect in Add Bank Account Flow, openPolicyInitialPage API was called and wiped out the reimbursementAccount.
More details:
#82769 (comment)
Details
This is a revised version of PR #42901 :
OpenPolicyProfilePageand its aliasOpenPolicyInitialPage. These are two endpoints for the1:1:1but in both, we are loading the policy data to make sure the policy settings/ feature options are shown correctly.OpenPolicyInitialPageis called in narrow view only when the workspace settings options (features) are shown. If you then select the Profile option, we also call theOpenPolicyProfilePage.OpenPolicyInitialPageis never called and only theOpenPolicyProfilePageis going to be triggered as that is the default main page the user is navigated to when they open the workspace settingsFixed Issues
$ #41914
$ #44601
#41914 (comment)
Tests
Test 1 :
OpenPolicyProfilePageAPI read call was doneOpenWorkspaceMembersPageAPI call was doneOpenPolicyInitialPageAPI call was madeTest 2 :
Offline tests
N/A
QA Steps
Same as Tests
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
CleanShot.2024-07-05.at.15.31.02.mp4
Android: mWeb Chrome
CleanShot.2024-07-05.at.15.34.33.mp4
iOS: Native
CleanShot.2024-07-05.at.15.21.26.mp4
iOS: mWeb Safari
CleanShot.2024-07-05.at.15.26.11.mp4
MacOS: Chrome / Safari
CleanShot.2024-07-05.at.14.43.32.mp4
MacOS: Desktop
CleanShot.2024-07-05.at.15.13.59.mp4