-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Pass userBillingGraceEndPeriods from useOnyx in some IOU steps #85619
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ function IOURequestStepHours({ | |
| const policyID = explicitPolicyID ?? report?.policyID; | ||
| const isTransactionDraft = shouldUseTransactionDraft(action); | ||
| const [selectedTab] = useOnyx(`${ONYXKEYS.COLLECTION.SELECTED_TAB}${CONST.TAB.IOU_REQUEST_TYPE}`); | ||
| const [userBillingGraceEndPeriods] = useOnyx(ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END); | ||
| const [ownerBillingGraceEndPeriod] = useOnyx(ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END); | ||
| const {accountID} = useCurrentUserPersonalDetails(); | ||
| const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); | ||
|
|
@@ -165,7 +166,7 @@ function IOURequestStepHours({ | |
| large={!isExtraSmallScreenHeight} | ||
| style={[styles.w100, canUseTouchScreen ? styles.mt5 : styles.mt0]} | ||
| onPress={() => { | ||
| if (policyID && shouldRestrictUserBillableActions(policyID, undefined, undefined, ownerBillingGraceEndPeriod)) { | ||
| if (policyID && shouldRestrictUserBillableActions(policyID, userBillingGraceEndPeriods, undefined, ownerBillingGraceEndPeriod)) { | ||
| Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policyID)); | ||
| return; | ||
|
Comment on lines
+169
to
171
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.
This button is also used on 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.
handleSelectReport()runs for the edit-report flow as well as the create flow, and in the edit case the parentselectReportcallback only reassigns already-created transactions to another existing report. AddingshouldRestrictUserBillableActions()here means members/admins in a past-due workspace can no longer clean up an expense's report assignment, even though this path is not creating a new expense or a new report.Useful? React with 👍 / 👎.