Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ function MoneyRequestView({
let [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`);
parentReport = parentReport ?? currentSearchResults?.data[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`];
const [parentReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${getNonEmptyStringOnyxID(parentReport?.reportID)}`);
const [reportPolicyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(parentReport?.policyID)}`);

const [parentReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`);
const parentReportAction = transactionThreadReport?.parentReportActionID ? parentReportActions?.[transactionThreadReport.parentReportActionID] : undefined;
Expand Down Expand Up @@ -874,6 +875,7 @@ function MoneyRequestView({
isASAPSubmitBetaEnabled,
parentReportNextStep,
delegateAccountID,
reportPolicyTags,
isTrackIntentUser,
});
});
Expand Down
5 changes: 3 additions & 2 deletions src/libs/actions/IOU/UpdateMoneyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,7 @@ function updateMoneyRequestCategory({
hash,
parentReportNextStep,
delegateAccountID,
reportPolicyTags,
isTrackIntentUser,
}: {
transactionID: string;
Expand All @@ -1102,6 +1103,7 @@ function updateMoneyRequestCategory({
hash?: number;
parentReportNextStep: OnyxEntry<OnyxTypes.ReportNextStepDeprecated>;
delegateAccountID: number | undefined;
reportPolicyTags: OnyxEntry<OnyxTypes.PolicyTagLists>;
isTrackIntentUser: boolean | undefined;
}) {
const transactionChanges: TransactionChanges = {
Expand All @@ -1115,8 +1117,7 @@ function updateMoneyRequestCategory({
transactionChanges,
policy,
policyTagList,
// TODO: Replace getPolicyTagsData (https://github.com/Expensify/App/issues/72721) with useOnyx hook
reportPolicyTags: getPolicyTagsData(parentReport?.policyID),
reportPolicyTags,
policyCategories,
policyRecentlyUsedCategories,
currentUserAccountIDParam,
Expand Down
2 changes: 2 additions & 0 deletions src/pages/iou/request/step/IOURequestStepCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function IOURequestStepCategory({
const [policyRecentlyUsedCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${policyID}`);
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(report?.parentReportID)}`);
const [parentReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${getNonEmptyStringOnyxID(report?.parentReportID)}`);
const [reportPolicyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(parentReport?.policyID)}`);
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});

const policyCategories = policyCategoriesReal ?? policyCategoriesDraft;
Expand Down Expand Up @@ -186,6 +187,7 @@ function IOURequestStepCategory({
isASAPSubmitBetaEnabled,
hash: currentSearchHash,
delegateAccountID,
reportPolicyTags,
isTrackIntentUser,
});
navigateBack();
Expand Down
2 changes: 2 additions & 0 deletions src/pages/iou/request/step/IOURequestStepCategoryCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function IOURequestStepCategoryCreate({
const [policyRecentlyUsedCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_CATEGORIES}${policyID}`);
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(reportReal?.parentReportID ?? reportDraft?.parentReportID)}`);
const [parentReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${getNonEmptyStringOnyxID(reportReal?.parentReportID ?? reportDraft?.parentReportID)}`);
const [reportPolicyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${getNonEmptyStringOnyxID(parentReport?.policyID)}`);
const [isTrackIntentUser] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED, {selector: isTrackIntentUserSelector});

const report = reportReal ?? reportDraft;
Expand Down Expand Up @@ -152,6 +153,7 @@ function IOURequestStepCategoryCreate({
isASAPSubmitBetaEnabled,
hash: currentSearchHash,
delegateAccountID,
reportPolicyTags,
isTrackIntentUser,
});
} else {
Expand Down
4 changes: 4 additions & 0 deletions tests/actions/IOUTest/UpdateMoneyRequestTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ describe('actions/IOU/UpdateMoneyRequest', () => {
transactionID,
transactionThreadReport,
parentReport: undefined,
reportPolicyTags: undefined,
category,
policy: fakePolicy,
policyTagList: undefined,
Expand Down Expand Up @@ -249,6 +250,7 @@ describe('actions/IOU/UpdateMoneyRequest', () => {
transactionID,
transactionThreadReport: {reportID: '3'},
parentReport: undefined,
reportPolicyTags: undefined,
category,
policy: fakePolicy,
policyTagList: undefined,
Expand Down Expand Up @@ -298,6 +300,7 @@ describe('actions/IOU/UpdateMoneyRequest', () => {
transactionID,
transactionThreadReport: {reportID: '3'},
parentReport: undefined,
reportPolicyTags: undefined,
category,
policy: fakePolicy,
policyTagList: undefined,
Expand Down Expand Up @@ -358,6 +361,7 @@ describe('actions/IOU/UpdateMoneyRequest', () => {
transactionID,
transactionThreadReport,
parentReport: undefined,
reportPolicyTags: undefined,
category,
policy: fakePolicy,
policyTagList: undefined,
Expand Down
Loading