Skip to content
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,7 @@ const CONST = {
CORPORATE_UPGRADE: 'POLICYCHANGELOG_CORPORATE_UPGRADE',
TEAM_DOWNGRADE: 'POLICYCHANGELOG_TEAM_DOWNGRADE',
},
RECEIPTSCANFAILED: 'RECEIPTSCANFAILED',
RESOLVED_DUPLICATES: 'RESOLVEDDUPLICATES',
ROOM_CHANGE_LOG: {
INVITE_TO_ROOM: 'INVITETOROOM',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@ const translations = {
deleteReceipt: 'Delete receipt',
deleteConfirmation: 'Are you sure you want to delete this receipt?',
addReceipt: 'Add receipt',
scanFailed: "The receipt couldn't be scanned, as it's missing a merchant, date, or amount.",
},
quickAction: {
scanReceipt: 'Scan receipt',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ const translations = {
deleteReceipt: 'Eliminar recibo',
deleteConfirmation: '¿Estás seguro de que quieres borrar este recibo?',
addReceipt: 'Añadir recibo',
scanFailed: 'El recibo no pudo ser escaneado, ya que falta el comerciante, la fecha o el monto.',
},
quickAction: {
scanReceipt: 'Escanear recibo',
Expand Down
3 changes: 3 additions & 0 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
getMessageOfOldDotReportAction,
getOneTransactionThreadReportID,
getOriginalMessage,
getReceiptScanFailedMessage,
getReopenedMessage,
getReportActionHtml,
getReportActionMessageText,
Expand Down Expand Up @@ -815,6 +816,8 @@
lastMessageTextFromReport = getReportActionMessageText(lastReportAction);
} else if (lastReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION) {
lastMessageTextFromReport = getExportIntegrationLastMessageText(lastReportAction);
} else if (lastReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.RECEIPTSCANFAILED) {

Check failure on line 819 in src/libs/OptionsListUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (RECEIPTSCANFAILED)
lastMessageTextFromReport = getReceiptScanFailedMessage();
} else if (lastReportAction?.actionName && isOldDotReportAction(lastReportAction)) {
lastMessageTextFromReport = getMessageOfOldDotReportAction(lastReportAction, false);
} else if (isActionableJoinRequest(lastReportAction)) {
Expand Down
5 changes: 5 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
// A legacy deleted comment has either an empty array or an object with html field with empty string as value
const isLegacyDeletedComment = message.length === 0 || message.at(0)?.html === '';

return isLegacyDeletedComment || !!message.at(0)?.deleted || (!!originalMessage && 'deleted' in originalMessage && !!originalMessage?.deleted);

Check failure on line 153 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator.
}

/**
Expand Down Expand Up @@ -294,7 +294,7 @@
}

if (originalMessage && typeof originalMessage === 'object' && 'whisperedTo' in originalMessage) {
return originalMessage?.whisperedTo ?? [];

Check failure on line 297 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / typecheck

Type '{}' is missing the following properties from type 'number[]': length, pop, push, concat, and 35 more.
}

if (typeof originalMessage !== 'object') {
Expand Down Expand Up @@ -1590,6 +1590,10 @@
return translateLocal('iou.reopened');
}

function getReceiptScanFailedMessage() {
return translateLocal('receipt.scanFailed');
}

function getUpdateRoomDescriptionFragment(reportAction: ReportAction): Message {
const html = getUpdateRoomDescriptionMessage(reportAction);
return {
Expand Down Expand Up @@ -2127,7 +2131,7 @@
}

if (updatedField === 'maxAmountNoReceipt' && typeof oldValue !== 'boolean' && typeof newValue !== 'boolean') {
const policy = getPolicy(policyID);

Check failure on line 2134 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'getPolicy' is deprecated. Get the data straight from Onyx - This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850

const maxExpenseAmountToDisplay = policy?.maxExpenseAmountNoReceipt === CONST.DISABLED_MAX_EXPENSE_VALUE ? 0 : policy?.maxExpenseAmountNoReceipt;

Expand Down Expand Up @@ -2529,7 +2533,7 @@
});
}

function getAddedApprovaRulelMessage(reportAction: OnyxEntry<ReportAction>) {

Check failure on line 2536 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (Rulel)

Check failure on line 2536 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (Approva)
const {name, approverAccountID, approverEmail, field, approverName} =
getOriginalMessage(reportAction as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_APPROVER_RULE>) ?? {};

Expand All @@ -2545,7 +2549,7 @@
return getReportActionText(reportAction);
}

function getDeletedApprovaRulelMessage(reportAction: OnyxEntry<ReportAction>) {

Check failure on line 2552 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (Rulel)

Check failure on line 2552 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (Approva)
const {name, approverAccountID, approverEmail, field, approverName} =
getOriginalMessage(reportAction as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_APPROVER_RULE>) ?? {};

Expand Down Expand Up @@ -2781,8 +2785,8 @@
getNumberOfMoneyRequests,
getOneTransactionThreadReportID,
getOriginalMessage,
getAddedApprovaRulelMessage,

Check failure on line 2788 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (Rulel)

Check failure on line 2788 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (Approva)
getDeletedApprovaRulelMessage,

Check failure on line 2789 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (Rulel)

Check failure on line 2789 in src/libs/ReportActionsUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (Approva)
getUpdatedApprovalRuleMessage,
getRemovedFromApprovalChainMessage,
getDemotedFromWorkspaceMessage,
Expand Down Expand Up @@ -2916,6 +2920,7 @@
getReportActionFromExpensifyCard,
isReopenedAction,
getIntegrationSyncFailedMessage,
getReceiptScanFailedMessage,
};

export type {LastVisibleMessage};
3 changes: 3 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4632,6 +4632,9 @@
personalDetails,
});
}
if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.RECEIPTSCANFAILED) {

Check failure on line 4635 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / 🔍 spellcheck

Unknown word (RECEIPTSCANFAILED)
return translateLocal('receipt.scanFailed');
}

if (isReimbursementDeQueuedOrCanceledAction(reportAction)) {
return getReimbursementDeQueuedOrCanceledActionMessage(reportAction, getReportOrDraftReport(reportID, reports));
Expand Down
2 changes: 2 additions & 0 deletions src/pages/home/report/PureReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,8 @@ function PureReportActionItem({
);
} else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION)) {
children = <ExportIntegration action={action} />;
} else if (isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.RECEIPTSCANFAILED)) {
children = <ReportActionItemBasicMessage message={translate('receipt.scanFailed')} />;
} else if (isRenamedAction(action)) {
const message = getRenamedAction(action, isExpenseReport(report));
children = <ReportActionItemBasicMessage message={message} />;
Expand Down
Loading