Remove error when all workspace is deleted#29781
Conversation
|
@hoangzinh 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] |
| { | ||
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: ONYXKEYS.REIMBURSEMENT_ACCOUNT, | ||
| value: oldReimbursementAccount, |
There was a problem hiding this comment.
I think we should restore the errors value only.
| * @param {String} policyName | ||
| */ | ||
| function deleteWorkspace(policyID, reports, policyName) { | ||
| const filteredPolicies = _.filter(allPolicies, (policy) => policy.id !== policyID); |
There was a problem hiding this comment.
please use lodash instead of underscore for the new code.
| */ | ||
| function deleteWorkspace(policyID, reports, policyName) { | ||
| const filteredPolicies = _.filter(allPolicies, (policy) => policy.id !== policyID); | ||
| const hasActivePolicy = hasActiveFreePolicy(filteredPolicies); |
There was a problem hiding this comment.
If this var is only used 1 place, we can call it directly in the place it used to avoid headaches in naming
|
@hoangzinh Updated all your suggestions. |
|
hey @dukenv0307 do you have the same experience as me? the bank account's error is automatically cleared when RHN is closed. Screen.Recording.2023-10-20.at.18.03.33.mov |
|
@hoangzinh Yes, we should close the app and open it again to keep the error. |
| */ | ||
| function deleteWorkspace(policyID, reports, policyName) { | ||
| const filteredPolicies = filter(allPolicies, (policy) => policy.id !== policyID); | ||
| const oldReimbursementAccount = reimbursementAccount; |
There was a problem hiding this comment.
do we need to assign to a temporary var oldReimbursementAccount here?
There was a problem hiding this comment.
I think we need it to store the old value. The current value can be changed after the optimisticData is merged in Onyx.
There was a problem hiding this comment.
yeah, but we already built failureData below, so I think we don't need to cache the oldReimbursementAccount here. Could you help to verify it again? Don't hesitate to let me know if I'm wrong
There was a problem hiding this comment.
Yes, you're right. Updated.
In the recording of GH issue #29235, we don't need to close the app and open it again. I think there is a recent bug/change related to this bank account form. |
|
@dukenv0307 I think it's related to this issue. Discussing in this issue #27901 (comment) |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2023-11-02.at.22.58.45.-.android.movAndroid: mWeb ChromeScreen.Recording.2023-11-02.at.22.53.18.-.android.chrome.moviOS: NativeScreen.Recording.2023-11-02.at.22.41.00.-.ios.moviOS: mWeb SafariScreen.Recording.2023-11-02.at.22.33.33.-.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2023-11-02.at.16.41.21.-.web.movMacOS: DesktopScreen.Recording.2023-11-02.at.16.44.44.-.desktop.mov |
|
@dukenv0307 because it's related to optimistic Data, I think we should include Offline test, what do you think? |
|
@dukenv0307 also please resolve conflict |
|
@hoangzinh Because the test need to complete bank account flow, I think we need online. |
|
I think bank account is just setup steps. The main of test step is Go to Setting -> WS -> Delete a WS in offline. |
|
OK let me add the offline step with pre condition. |
|
@dukenv0307 let me know when your PR is updated and ready for review |
|
I updated. |
hoangzinh
left a comment
There was a problem hiding this comment.
@dukenv0307 Thanks for update. LGTM
luacmartins
left a comment
There was a problem hiding this comment.
LGMT! I think we should clean up all the underscore and lodash imports in this file in a follow up
|
✋ 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/luacmartins in version: 1.3.96-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
Details
Remove error when all workspace is deleted
Fixed Issues
$ #29235
PROPOSAL: #29235 (comment)
Tests
Offline tests
Pre-condition: The red dot appears on the avatar that comes from ReimbursementAccount errror
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
29235.mp4
Android: mWeb Chrome
Record_2023-10-17-21-23-51.mp4
iOS: Native
Screen.Recording.2023-10-17.at.21.39.52.mov
iOS: mWeb Safari
Screen.Recording.2023-10-17.at.21.36.00.mov
MacOS: Chrome / Safari
Screencast.from.17-10-2023.21.17.01.webm
MacOS: Desktop
Screen.Recording.2023-10-17.at.21.45.47.mov