-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[NoQA] API integration for freeze card #82199
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 475ddec0ab
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const previousFrozen = card?.nameValuePairs?.frozen ?? null; | ||
|
|
||
| const frozenData: PartialDeep<Card> = { | ||
| state: CONST.EXPENSIFY_CARD.STATE.STATE_SUSPENDED, |
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.
Avoid hiding cards when freezing sets suspended state
Setting state to STATE_SUSPENDED here will make the card disappear from workspace card selectors as soon as freezeCard() runs, because filterInactiveCards() treats suspended cards as inactive (src/libs/CardUtils.ts:798-811) and getAllCardsForWorkspace() applies that filter before details rendering (src/libs/CardUtils.ts:831-833). In that flow, the details page can immediately lose card and render NotFoundPage (src/pages/workspace/expensifyCard/WorkspaceExpensifyCardDetailsPage.tsx:99-101), leaving no in-app path to unfreeze.
Useful? React with 👍 / 👎.
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.
We need to show the frozen card in the list and will be handled in a future PR.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
| type CardListUpdateData = Omit<PartialDeep<Card>, 'errors'> & { | ||
| errors?: Card['errors'] | null; | ||
| }; |
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.
| type CardListUpdateData = Omit<PartialDeep<Card>, 'errors'> & { | |
| errors?: Card['errors'] | null; | |
| }; | |
| type CardListUpdateData = PartialDeep<Card>; |
Can we do this and set errors: undefined in building optimistic data?
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.
Isn't it true that Onyx.merge() can ignore top-level undefined changes? And setting to null is better?
Explanation of Change
API integration for freeze card feature.
Fixed Issues
$ #81642
PROPOSAL:
Tests
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 stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari