-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use pattern B for unassigning cards #52357
Changes from 5 commits
611d3fe
3ef15a0
cfb7a1c
adcc441
9c8cda7
7b79011
b4a4e34
72861ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -315,25 +315,38 @@ function WorkspaceMemberDetailsPage({personalDetails, policy, route}: WorkspaceM | |||||||||||
{translate('walletPage.assignedCards')} | ||||||||||||
</Text> | ||||||||||||
</View> | ||||||||||||
{(memberCards as MemberCard[]).map((memberCard) => ( | ||||||||||||
<MenuItem | ||||||||||||
key={memberCard.cardID} | ||||||||||||
title={memberCard.nameValuePairs?.cardTitle ?? memberCard?.cardName} | ||||||||||||
badgeText={ | ||||||||||||
memberCard.bank === CONST.EXPENSIFY_CARD.BANK | ||||||||||||
? CurrencyUtils.convertToDisplayString(memberCard.nameValuePairs?.unapprovedExpenseLimit) | ||||||||||||
: '' | ||||||||||||
} | ||||||||||||
icon={CardUtils.getCardFeedIcon(memberCard.bank as CompanyCardFeed)} | ||||||||||||
displayInDefaultIconColor | ||||||||||||
iconStyles={styles.cardIcon} | ||||||||||||
contentFit="contain" | ||||||||||||
iconWidth={variables.iconSizeExtraLarge} | ||||||||||||
iconHeight={variables.iconSizeExtraLarge} | ||||||||||||
onPress={() => navigateToDetails(memberCard)} | ||||||||||||
shouldShowRightIcon | ||||||||||||
/> | ||||||||||||
))} | ||||||||||||
{(memberCards as MemberCard[]).map((memberCard) => { | ||||||||||||
const isCardDeleted = memberCard.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; | ||||||||||||
return ( | ||||||||||||
<OfflineWithFeedback | ||||||||||||
key={`${memberCard.nameValuePairs?.cardTitle}_${memberCard.cardID}`} | ||||||||||||
errorRowStyles={styles.ph5} | ||||||||||||
errors={memberCard.errors} | ||||||||||||
pendingAction={memberCard.pendingAction} | ||||||||||||
> | ||||||||||||
<MenuItem | ||||||||||||
key={memberCard.cardID} | ||||||||||||
title={memberCard.nameValuePairs?.cardTitle ?? memberCard?.cardName} | ||||||||||||
badgeText={ | ||||||||||||
memberCard.bank === CONST.EXPENSIFY_CARD.BANK | ||||||||||||
? CurrencyUtils.convertToDisplayString(memberCard.nameValuePairs?.unapprovedExpenseLimit) | ||||||||||||
: '' | ||||||||||||
} | ||||||||||||
icon={CardUtils.getCardFeedIcon(memberCard.bank as CompanyCardFeed)} | ||||||||||||
displayInDefaultIconColor | ||||||||||||
iconStyles={styles.cardIcon} | ||||||||||||
contentFit="contain" | ||||||||||||
iconWidth={variables.iconSizeExtraLarge} | ||||||||||||
iconHeight={variables.iconSizeExtraLarge} | ||||||||||||
onPress={() => navigateToDetails(memberCard)} | ||||||||||||
shouldRemoveHoverBackground={isCardDeleted} | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||
disabled={isCardDeleted} | ||||||||||||
shouldShowRightIcon={!isCardDeleted} | ||||||||||||
style={[isCardDeleted ? styles.offlineFeedback.deleted : {}]} | ||||||||||||
/> | ||||||||||||
Comment on lines
+343
to
+346
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I believe that we shouldn't prevent user from going to detail card page There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||
</OfflineWithFeedback> | ||||||||||||
); | ||||||||||||
})} | ||||||||||||
<MenuItem | ||||||||||||
title={translate('workspace.expensifyCard.newCard')} | ||||||||||||
icon={Expensicons.Plus} | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#51876 (comment),
#51876 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mountiny @koko57 It is consistency with the company card page. On the company card page, we still can access to detail card that is pending removed
Screen.Recording.2024-11-12.at.20.45.06.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mountiny @DylanDylann I've just added the check to disable going to details page after unassigning