#6 - Get the billing grace end period collection with useOnyx#83149
Conversation
|
@shubham1206agra 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56387ab8a2
ℹ️ 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".
| isASAPSubmitBetaEnabled: boolean, | ||
| expenseReportCurrentNextStepDeprecated: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>, | ||
| betas: OnyxEntry<OnyxTypes.Beta[]>, | ||
| userBillingGraceEndPeriodCollection: OnyxCollection<OnyxTypes.BillingGraceEndPeriod>, |
There was a problem hiding this comment.
Preserve
full argument semantics in approve flow
Adding userBillingGraceEndPeriodCollection before full changes the meaning of existing 9-argument calls, so callers still using the old signature (for example src/components/SettlementButton/index.tsx:467 and src/libs/PaymentUtils.ts:200) now pass a boolean as the billing collection and leave full undefined. In this state shouldRestrictUserBillableActions() receives true/false instead of the collection and skips non-owner grace-period checks, allowing restricted users to proceed with billable approval actions in those paths.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 809164e262
ℹ️ 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".
| activePolicy, | ||
| policy, | ||
| betas, | ||
| userBillingGraceEndPeriodCollection, |
There was a problem hiding this comment.
Include billing grace data in confirmPayment memo deps
confirmPayment now reads userBillingGraceEndPeriodCollection when calling payMoneyRequest, but the useCallback dependency list was not updated. If this Onyx collection is undefined on first render and arrives later, the memoized handler keeps the stale value and can continue using the fallback path in shouldRestrictUserBillableActions, allowing restricted users to initiate pay actions from this preview until another dependency changes and recreates the callback.
Useful? React with 👍 / 👎.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Explanation of Change
Fixed Issues
$ #66456
PROPOSAL:
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Prerequisite: have a report pending to submit, approve, and pay
Onyx.merge('sharedNVP_private_billingGracePeriodEnd_[replaceWithYourACcountID]', {value: 1});in consolePR 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
web.mp4