fix: use pattern B for unassigning cards#52357
Conversation
|
@DylanDylann 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] |
| value: { | ||
| [cardID]: null, | ||
| [cardID]: { | ||
| ...card, |
There was a problem hiding this comment.
| ...card, |
| value: { | ||
| [cardID]: null, | ||
| [cardID]: { | ||
| ...card, |
There was a problem hiding this comment.
| ...card, |
| @@ -263,6 +269,7 @@ function unassignWorkspaceCompanyCard(workspaceAccountID: number, bankName: stri | |||
| value: { | |||
| [cardID]: { | |||
| ...card, | |||
There was a problem hiding this comment.
| ...card, |
| @@ -273,6 +280,7 @@ function unassignWorkspaceCompanyCard(workspaceAccountID: number, bankName: stri | |||
| value: { | |||
| [cardID]: { | |||
| ...card, | |||
There was a problem hiding this comment.
| ...card, |
|
@koko57 Please add [cardID]: null, to successData |
|
@DylanDylann changes applied. |
|
@koko57 There are no card display on member detail page on my account
It dues to this condition Please help to update to use || instead of ?? |
| disabled={isCardDeleted} | ||
| shouldShowRightIcon={!isCardDeleted} | ||
| style={[isCardDeleted ? styles.offlineFeedback.deleted : {}]} | ||
| /> |
There was a problem hiding this comment.
| disabled={isCardDeleted} | |
| shouldShowRightIcon={!isCardDeleted} | |
| style={[isCardDeleted ? styles.offlineFeedback.deleted : {}]} | |
| /> | |
| shouldShowRightIcon |
I believe that we shouldn't prevent user from going to detail card page
There was a problem hiding this comment.
| iconWidth={variables.iconSizeExtraLarge} | ||
| iconHeight={variables.iconSizeExtraLarge} | ||
| onPress={() => navigateToDetails(memberCard)} | ||
| shouldRemoveHoverBackground={isCardDeleted} |
There was a problem hiding this comment.
| shouldRemoveHoverBackground={isCardDeleted} |
There was a problem hiding this comment.
| /> | ||
| ))} | ||
| {(memberCards as MemberCard[]).map((memberCard) => { | ||
| const isCardDeleted = memberCard.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; |
There was a problem hiding this comment.
| const isCardDeleted = memberCard.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; |
There was a problem hiding this comment.
There was a problem hiding this comment.
I don't think you should be able to visit that page because the card was already removed
There was a problem hiding this comment.
@mountiny @DylanDylann I've just added the check to disable going to details page after unassigning
|
@DylanDylann done |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-11-12.at.20.54.01.movAndroid: mWeb ChromeScreen.Recording.2024-11-12.at.20.52.26.moviOS: NativeScreen.Recording.2024-11-12.at.20.51.51.moviOS: mWeb SafariScreen.Recording.2024-11-12.at.20.50.58.mov |
|
Minor comment: #52357 (comment) The rest looks fine |
|
✋ 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.61-0 🚀
|
Confirmed both of these work as expected. @koko57 one thing I noticed is if you unassign your own card, we aren't optimistically removing it on the wallet page. Is that expected? |
Confirmed this is working now too! |
|
@joekaufmanexpensify good catch! I will check it tomorrow |
|
TY! |
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.61-3 🚀
|



I also fixed the problem I mentioned here: #51876 (comment)
and was then posted in this thread https://callstack-hq.slack.com/archives/C049HHMV9SM/p1730983704782069
Explanation of Change
Fixed Issues
$ #51876
PROPOSAL: -
Tests
Avatar problem
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
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 */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)Designlabel so 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