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
4 changes: 0 additions & 4 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,6 @@ function isReportActionDeprecated(reportAction: OnyxEntry<ReportAction>, key: st
CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_SETUP_REQUESTED,
CONST.REPORT.ACTIONS.TYPE.DONATION,
CONST.REPORT.ACTIONS.TYPE.REIMBURSED,

// We're temporarily deprecating the actions below since the feature is still WIP and these actions are being shown as duplicated
CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION,
CONST.REPORT.ACTIONS.TYPE.MOVED_TRANSACTION,
];
if (deprecatedOldDotReportActions.includes(reportAction.actionName)) {
Log.info('Front end filtered out reportAction for being an older, deprecated report action', false, reportAction);
Expand Down
42 changes: 0 additions & 42 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6374,47 +6374,6 @@ function buildOptimisticDetachReceipt(reportID: string | undefined, transactionI
};
}

/**
* Builds an optimistic modified expense action for a tracked expense move with a randomly generated reportActionID.
* @param transactionThreadID - The reportID of the transaction thread
* @param movedToReportID - The reportID of the report the transaction is moved to
*/
function buildOptimisticMovedTrackedExpenseModifiedReportAction(transactionThreadID: string | undefined, movedToReportID: string | undefined): OptimisticModifiedExpenseReportAction {
const delegateAccountDetails = getPersonalDetailByEmail(delegateEmail);

return {
actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE,
actorAccountID: currentUserAccountID,
automatic: false,
avatar: getCurrentUserAvatar(),
created: DateUtils.getDBTime(),
isAttachmentOnly: false,
message: [
{
// Currently we are composing the message from the originalMessage and message is only used in OldDot and not in the App
text: 'You',
style: 'strong',
type: CONST.REPORT.MESSAGE.TYPE.TEXT,
},
],
originalMessage: {
movedToReportID,
},
person: [
{
style: 'strong',
text: currentUserPersonalDetails?.displayName ?? String(currentUserAccountID),
type: 'TEXT',
},
],
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
reportActionID: rand64(),
reportID: transactionThreadID,
shouldShow: true,
delegateAccountID: delegateAccountDetails?.accountID,
};
}

/**
* Updates a report preview action that exists for an IOU report.
*
Expand Down Expand Up @@ -10493,7 +10452,6 @@ export {
buildOptimisticMoneyRequestEntities,
buildOptimisticMovedReportAction,
buildOptimisticChangePolicyReportAction,
buildOptimisticMovedTrackedExpenseModifiedReportAction,
buildOptimisticRenamedRoomReportAction,
buildOptimisticRoomDescriptionUpdatedReportAction,
buildOptimisticReportPreview,
Expand Down
8 changes: 4 additions & 4 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ import {
buildOptimisticIOUReportAction,
buildOptimisticModifiedExpenseReportAction,
buildOptimisticMoneyRequestEntities,
buildOptimisticMovedTrackedExpenseModifiedReportAction,
buildOptimisticMovedTransactionAction,
buildOptimisticReportPreview,
buildOptimisticResolvedDuplicatesReportAction,
buildOptimisticSubmittedReportAction,
Expand Down Expand Up @@ -4595,13 +4595,13 @@ const getConvertTrackedExpenseInformation = (
failureData?.push(...deleteFailureData);

// Build modified expense report action with the transaction changes
const modifiedExpenseReportAction = buildOptimisticMovedTrackedExpenseModifiedReportAction(transactionThreadReportID, moneyRequestReportID);
const modifiedExpenseReportAction = buildOptimisticMovedTransactionAction(transactionThreadReportID, moneyRequestReportID ?? CONST.REPORT.UNREPORTED_REPORTID);

optimisticData?.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`,
value: {
[modifiedExpenseReportAction.reportActionID]: modifiedExpenseReportAction as OnyxTypes.ReportAction,
[modifiedExpenseReportAction.reportActionID]: modifiedExpenseReportAction,
},
});
successData?.push({
Expand All @@ -4616,7 +4616,7 @@ const getConvertTrackedExpenseInformation = (
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transactionThreadReportID}`,
value: {
[modifiedExpenseReportAction.reportActionID]: {
...(modifiedExpenseReportAction as OnyxTypes.ReportAction),
...modifiedExpenseReportAction,
errors: getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericEditFailureMessage'),
},
},
Expand Down
2 changes: 0 additions & 2 deletions tests/utils/collections/reportActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ const deprecatedReportActions: ReportActionName[] = [
CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_REQUESTED,
CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_SETUP_REQUESTED,
CONST.REPORT.ACTIONS.TYPE.DONATION,
CONST.REPORT.ACTIONS.TYPE.MOVED_TRANSACTION,
CONST.REPORT.ACTIONS.TYPE.UNREPORTED_TRANSACTION,
] as const;

export default function createRandomReportAction(index: number): ReportAction {
Expand Down