Repository navigation
fix: hide Add shipping details if deactivated - #51230
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] |
| action, | ||
| CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED, | ||
| CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED_VIRTUAL, | ||
| CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS, |
There was a problem hiding this comment.
Should we only check CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS here? Because eventually in line 55, we only check CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS
| const [cardList = {}] = useOnyx(ONYXKEYS.CARD_LIST); | ||
| const [cardsList] = useOnyx(`${ONYXKEYS.COLLECTION.WORKSPACE_CARDS_LIST}${workspaceAccountID}_${CONST.EXPENSIFY_CARD.BANK}`); |
There was a problem hiding this comment.
Do we have other names for cardList and cardsList? They caused me to be confused at first.
|
cc @truph01 on above feedbacks |
|
@hoangzinh I just merged the latest main, so now the PR is just one line change. Can you help review it again? |
Reviewer Checklist
Screenshots/Videos |
|
✋ 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/jasperhuangg in version: 9.0.57-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.57-10 🚀
|
| const cardID = cardIssuedActionOriginalMessage?.cardID ?? -1; | ||
| const isPolicyAdmin = PolicyUtils.isPolicyAdmin(PolicyUtils.getPolicy(policyID)); | ||
| const card = isPolicyAdmin ? cardsList?.[cardID] : cardList[cardID]; | ||
| const shouldShowAddMissingDetailsButton = !isEmptyObject(card) && action?.actionName === CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS && missingDetails && isAssigneeCurrentUser; |
There was a problem hiding this comment.
FYI, this was wrong, We have an additional condition compared to the condition to display the message. It is the check isEmptyObject(card)
And in this case, the card isn't created successfully. So the CARDMISSINGADDRESS message still be displayed but the card button isn't displayed.
This caused #55026






Details
Fixed Issues
$ #50693
PROPOSAL: #50693 (comment)
Tests
Precondition:
User has assigned a physical card to self.
Private details have not been added.
Offline tests
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-22.at.16.25.17.mov
Android: mWeb Chrome
Screen.Recording.2024-10-22.at.16.26.44.mov
iOS: Native
Screen.Recording.2024-10-22.at.16.21.56.mov
iOS: mWeb Safari
Screen.Recording.2024-10-22.at.16.23.45.mov
MacOS: Chrome / Safari
Screen.Recording.2024-10-22.at.16.11.08.mov
MacOS: Desktop
Screen.Recording.2024-10-22.at.16.20.01.mov