[No QA] [Workspace Feeds] Integrate Deactivate_Card API#47986
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] |
|
@mountiny What is the expected behavior when offline? Currently, when users deactivate a card, it gets hidden. Normally, in our app, when an action is performed offline, we grey it out until the API confirms success. Screen.Recording.2024-08-26.at.20.32.56.mov |
|
@DylanDylann Actually this makes an external API call so I wonder if we should even allow taking this action offline. I will discuss |
|
Asked here |
# Conflicts: # src/pages/workspace/members/WorkspaceMemberDetailsPage.tsx
|
@VickyStash Still get conflict |
# Conflicts: # src/libs/actions/Card.ts
|
@DylanDylann I've added an offline modal and resolved conflicts, please take a look |
mountiny
left a comment
There was a problem hiding this comment.
Tested the PR locally and I was able to deactivate the card successfully 🎉
| if (!authToken) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
I think we can remove these, I am not sure sure why we started to add it, this should not happen
| if (!authToken) { | |
| return; | |
| } |
There was a problem hiding this comment.
@mountiny I think it's to narrow down the type of authToken, cause the type of authToken also includes undefined
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-28.at.17.23.43.movAndroid: mWeb ChromeScreen.Recording.2024-08-28.at.17.18.49.moviOS: NativeScreen.Recording.2024-08-28.at.17.22.16.moviOS: mWeb SafariScreen.Recording.2024-08-28.at.17.16.24.movMacOS: Chrome / SafariScreen.Recording.2024-08-28.at.16.59.51.movMacOS: DesktopScreen.Recording.2024-08-28.at.17.12.17.mov |
| API.write(WRITE_COMMANDS.UPDATE_EXPENSIFY_CARD_LIMIT_TYPE, parameters, {optimisticData, successData, failureData}); | ||
| } | ||
|
|
||
| function deactivateCard(workspaceAccountID: number, cardID: number, card?: Card) { |
There was a problem hiding this comment.
Should we remove cardID param and use card.cardID
| if (!authToken) { | ||
| return; | ||
| } |
|
I am going to merge this as we are getting closer to deploy |
|
✋ 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.26-1 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.0.26-6 🚀
|
| }, | ||
| }, | ||
| ]; | ||
|
|
There was a problem hiding this comment.
Came from this issue
We have an edge case that after deactivating Expensify card, Expensify Card link in the system message remains linked, which leads to not here page since we don't update cardID state in onyx
More context here

Details
Integrate Deactivate_Card API
Fixed Issues
$ #44320
PROPOSAL: N/A
Tests
Pre-steps:
workspaceFeedbeta enabledDeactivate_Cardcall is executed and the card isn't displayed anymore.Offline tests
Same as in the Tests section
QA Steps
Same as in the Tests section
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
MacOS: Chrome / Safari
web1.mp4