diff --git a/src/CONST.ts b/src/CONST.ts index a6df33987c8d..d89e047677fd 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -633,59 +633,59 @@ const CONST = { LIMIT: 50, // OldDot Actions render getMessage from Web-Expensify/lib/Report/Action PHP files via getMessageOfOldDotReportAction in ReportActionsUtils.ts TYPE: { - ACTIONABLEJOINREQUEST: 'ACTIONABLEJOINREQUEST', - ACTIONABLEMENTIONWHISPER: 'ACTIONABLEMENTIONWHISPER', - ACTIONABLETRACKEXPENSEWHISPER: 'ACTIONABLETRACKEXPENSEWHISPER', - ADDCOMMENT: 'ADDCOMMENT', + ACTIONABLE_JOIN_REQUEST: 'ACTIONABLEJOINREQUEST', + ACTIONABLE_MENTION_WHISPER: 'ACTIONABLEMENTIONWHISPER', + ACTIONABLE_TRACK_EXPENSE_WHISPER: 'ACTIONABLETRACKEXPENSEWHISPER', + ADD_COMMENT: 'ADDCOMMENT', APPROVED: 'APPROVED', - CHANGEFIELD: 'CHANGEFIELD', // OldDot Action - CHANGEPOLICY: 'CHANGEPOLICY', // OldDot Action - CHANGETYPE: 'CHANGETYPE', // OldDot Action - CHRONOSOOOLIST: 'CHRONOSOOOLIST', + CHANGE_FIELD: 'CHANGEFIELD', // OldDot Action + CHANGE_POLICY: 'CHANGEPOLICY', // OldDot Action + CHANGE_TYPE: 'CHANGETYPE', // OldDot Action + CHRONOS_OOO_LIST: 'CHRONOSOOOLIST', CLOSED: 'CLOSED', CREATED: 'CREATED', - DELEGATESUBMIT: 'DELEGATESUBMIT', // OldDot Action - DELETEDACCOUNT: 'DELETEDACCOUNT', // OldDot Action + DELEGATE_SUBMIT: 'DELEGATESUBMIT', // OldDot Action + DELETED_ACCOUNT: 'DELETEDACCOUNT', // OldDot Action DONATION: 'DONATION', // OldDot Action - EXPORTEDTOCSV: 'EXPORTEDTOCSV', // OldDot Action - EXPORTEDTOINTEGRATION: 'EXPORTEDTOINTEGRATION', // OldDot Action - EXPORTEDTOQUICKBOOKS: 'EXPORTEDTOQUICKBOOKS', // OldDot Action + EXPORTED_TO_CSV: 'EXPORTEDTOCSV', // OldDot Action + EXPORTED_TO_INTEGRATION: 'EXPORTEDTOINTEGRATION', // OldDot Action + EXPORTED_TO_QUICK_BOOKS: 'EXPORTEDTOQUICKBOOKS', // OldDot Action FORWARDED: 'FORWARDED', // OldDot Action HOLD: 'HOLD', - HOLDCOMMENT: 'HOLDCOMMENT', + HOLD_COMMENT: 'HOLDCOMMENT', IOU: 'IOU', - INTEGRATIONSMESSAGE: 'INTEGRATIONSMESSAGE', // OldDot Action - MANAGERATTACHRECEIPT: 'MANAGERATTACHRECEIPT', // OldDot Action - MANAGERDETACHRECEIPT: 'MANAGERDETACHRECEIPT', // OldDot Action - MARKEDREIMBURSED: 'MARKEDREIMBURSED', // OldDot Action - MARKREIMBURSEDFROMINTEGRATION: 'MARKREIMBURSEDFROMINTEGRATION', // OldDot Action - MODIFIEDEXPENSE: 'MODIFIEDEXPENSE', + INTEGRATIONS_MESSAGE: 'INTEGRATIONSMESSAGE', // OldDot Action + MANAGER_ATTACH_RECEIPT: 'MANAGERATTACHRECEIPT', // OldDot Action + MANAGER_DETACH_RECEIPT: 'MANAGERDETACHRECEIPT', // OldDot Action + MARKED_REIMBURSED: 'MARKEDREIMBURSED', // OldDot Action + MARK_REIMBURSED_FROM_INTEGRATION: 'MARKREIMBURSEDFROMINTEGRATION', // OldDot Action + MODIFIED_EXPENSE: 'MODIFIEDEXPENSE', MOVED: 'MOVED', - OUTDATEDBANKACCOUNT: 'OUTDATEDBANKACCOUNT', // OldDot Action - REIMBURSEMENTACHBOUNCE: 'REIMBURSEMENTACHBOUNCE', // OldDot Action - REIMBURSEMENTACHCANCELLED: 'REIMBURSEMENTACHCANCELLED', // OldDot Action - REIMBURSEMENTACCOUNTCHANGED: 'REIMBURSEMENTACCOUNTCHANGED', // OldDot Action - REIMBURSEMENTDELAYED: 'REIMBURSEMENTDELAYED', // OldDot Action - REIMBURSEMENTQUEUED: 'REIMBURSEMENTQUEUED', - REIMBURSEMENTDEQUEUED: 'REIMBURSEMENTDEQUEUED', - REIMBURSEMENTREQUESTED: 'REIMBURSEMENTREQUESTED', // OldDot Action - REIMBURSEMENTSETUP: 'REIMBURSEMENTSETUP', // OldDot Action + OUTDATED_BANK_ACCOUNT: 'OUTDATEDBANKACCOUNT', // OldDot Action + REIMBURSEMENT_ACH_BOUNCE: 'REIMBURSEMENTACHBOUNCE', // OldDot Action + REIMBURSEMENT_ACH_CANCELLED: 'REIMBURSEMENTACHCANCELLED', // OldDot Action + REIMBURSEMENT_ACCOUNT_CHANGED: 'REIMBURSEMENTACCOUNTCHANGED', // OldDot Action + REIMBURSEMENT_DELAYED: 'REIMBURSEMENTDELAYED', // OldDot Action + REIMBURSEMENT_QUEUED: 'REIMBURSEMENTQUEUED', + REIMBURSEMENT_DEQUEUED: 'REIMBURSEMENTDEQUEUED', + REIMBURSEMENT_REQUESTED: 'REIMBURSEMENTREQUESTED', // OldDot Action + REIMBURSEMENT_SETUP: 'REIMBURSEMENTSETUP', // OldDot Action RENAMED: 'RENAMED', - REPORTPREVIEW: 'REPORTPREVIEW', - SELECTEDFORRANDOMAUDIT: 'SELECTEDFORRANDOMAUDIT', // OldDot Action + REPORT_PREVIEW: 'REPORTPREVIEW', + SELECTED_FOR_RANDOM_AUDIT: 'SELECTEDFORRANDOMAUDIT', // OldDot Action SHARE: 'SHARE', // OldDot Action - STRIPEPAID: 'STRIPEPAID', // OldDot Action + STRIPE_PAID: 'STRIPEPAID', // OldDot Action SUBMITTED: 'SUBMITTED', - TAKECONTROL: 'TAKECONTROL', // OldDot Action - TASKCANCELLED: 'TASKCANCELLED', - TASKCOMPLETED: 'TASKCOMPLETED', - TASKEDITED: 'TASKEDITED', - TASKREOPENED: 'TASKREOPENED', + TAKE_CONTROL: 'TAKECONTROL', // OldDot Action + TASK_CANCELLED: 'TASKCANCELLED', + TASK_COMPLETED: 'TASKCOMPLETED', + TASK_EDITED: 'TASKEDITED', + TASK_REOPENED: 'TASKREOPENED', UNAPPROVED: 'UNAPPROVED', // OldDot Action UNHOLD: 'UNHOLD', UNSHARE: 'UNSHARE', // OldDot Action - UPDATEGROUPCHATMEMBERROLE: 'UPDATEGROUPCHATMEMBERROLE', - POLICYCHANGELOG: { + UPDATE_GROUP_CHAT_MEMBER_ROLE: 'UPDATEGROUPCHATMEMBERROLE', + POLICY_CHANGE_LOG: { ADD_APPROVER_RULE: 'POLICYCHANGELOG_ADD_APPROVER_RULE', ADD_BUDGET: 'POLICYCHANGELOG_ADD_BUDGET', ADD_CATEGORY: 'POLICYCHANGELOG_ADD_CATEGORY', @@ -713,16 +713,16 @@ const CONST = { REMOVE_FROM_ROOM: 'POLICYCHANGELOG_REMOVEFROMROOM', LEAVE_ROOM: 'POLICYCHANGELOG_LEAVEROOM', REPLACE_CATEGORIES: 'POLICYCHANGELOG_REPLACE_CATEGORIES', - SET_AUTOREIMBURSEMENT: 'POLICYCHANGELOG_SET_AUTOREIMBURSEMENT', + SET_AUTO_REIMBURSEMENT: 'POLICYCHANGELOG_SET_AUTOREIMBURSEMENT', SET_AUTO_JOIN: 'POLICYCHANGELOG_SET_AUTO_JOIN', SET_CATEGORY_NAME: 'POLICYCHANGELOG_SET_CATEGORY_NAME', SHARED_BUDGET_NOTIFICATION: 'POLICYCHANGELOG_SHARED_BUDGET_NOTIFICATION', UPDATE_ACH_ACCOUNT: 'POLICYCHANGELOG_UPDATE_ACH_ACCOUNT', UPDATE_APPROVER_RULE: 'POLICYCHANGELOG_UPDATE_APPROVER_RULE', UPDATE_AUDIT_RATE: 'POLICYCHANGELOG_UPDATE_AUDIT_RATE', - UPDATE_AUTOHARVESTING: 'POLICYCHANGELOG_UPDATE_AUTOHARVESTING', - UPDATE_AUTOREIMBURSEMENT: 'POLICYCHANGELOG_UPDATE_AUTOREIMBURSEMENT', - UPDATE_AUTOREPORTING_FREQUENCY: 'POLICYCHANGELOG_UPDATE_AUTOREPORTING_FREQUENCY', + UPDATE_AUTO_HARVESTING: 'POLICYCHANGELOG_UPDATE_AUTOHARVESTING', + UPDATE_AUTO_REIMBURSEMENT: 'POLICYCHANGELOG_UPDATE_AUTOREIMBURSEMENT', + UPDATE_AUTO_REPORTING_FREQUENCY: 'POLICYCHANGELOG_UPDATE_AUTOREPORTING_FREQUENCY', UPDATE_BUDGET: 'POLICYCHANGELOG_UPDATE_BUDGET', UPDATE_CATEGORY: 'POLICYCHANGELOG_UPDATE_CATEGORY', UPDATE_CURRENCY: 'POLICYCHANGELOG_UPDATE_CURRENCY', @@ -753,7 +753,7 @@ const CONST = { UPDATE_TIME_RATE: 'POLICYCHANGELOG_UPDATE_TIME_RATE', LEAVE_POLICY: 'POLICYCHANGELOG_LEAVE_POLICY', }, - ROOMCHANGELOG: { + ROOM_CHANGE_LOG: { INVITE_TO_ROOM: 'INVITETOROOM', REMOVE_FROM_ROOM: 'REMOVEFROMROOM', LEAVE_ROOM: 'LEAVEROOM', diff --git a/src/libs/ModifiedExpenseMessage.ts b/src/libs/ModifiedExpenseMessage.ts index d73771734636..2df75030ac19 100644 --- a/src/libs/ModifiedExpenseMessage.ts +++ b/src/libs/ModifiedExpenseMessage.ts @@ -106,7 +106,7 @@ function getForDistanceRequest(newDistance: string, oldDistance: string, newAmou * If we change this function be sure to update the backend as well. */ function getForReportAction(reportID: string | undefined, reportAction: OnyxEntry | ReportAction | Record): string { - if (reportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE) { + if (reportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE) { return ''; } const reportActionOriginalMessage = reportAction?.originalMessage as ExpenseOriginalMessage | undefined; diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index c11a1499a88f..2aad4179c337 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -722,7 +722,7 @@ function createOption( let lastMessageText = lastMessageTextFromReport; const lastAction = visibleReportActionItems[report.reportID]; - const shouldDisplayLastActorName = lastAction && lastAction.actionName !== CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && lastAction.actionName !== CONST.REPORT.ACTIONS.TYPE.IOU; + const shouldDisplayLastActorName = lastAction && lastAction.actionName !== CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && lastAction.actionName !== CONST.REPORT.ACTIONS.TYPE.IOU; if (shouldDisplayLastActorName && lastActorDisplayName && lastMessageTextFromReport) { lastMessageText = `${lastActorDisplayName}: ${lastMessageTextFromReport}`; diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index d4a2afafb420..97b2b62391c4 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -47,7 +47,7 @@ type MemberChangeMessageRoomReferenceElement = { type MemberChangeMessageElement = MessageTextElement | MemberChangeMessageUserMentionElement | MemberChangeMessageRoomReferenceElement; -const policyChangeActionsSet = new Set(Object.values(CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG)); +const policyChangeActionsSet = new Set(Object.values(CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG)); let allReports: OnyxCollection = {}; Onyx.connect({ @@ -126,7 +126,7 @@ function isMoneyRequestAction(reportAction: OnyxEntry): reportActi } function isReportPreviewAction(reportAction: OnyxEntry): boolean { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW; } function isReportActionSubmitted(reportAction: OnyxEntry): boolean { @@ -134,7 +134,7 @@ function isReportActionSubmitted(reportAction: OnyxEntry): boolean } function isModifiedExpenseAction(reportAction: OnyxEntry | ReportAction | Record): boolean { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE; } function isWhisperAction(reportAction: OnyxEntry | EmptyObject): boolean { @@ -152,29 +152,29 @@ function isWhisperActionTargetedToOthers(reportAction: OnyxEntry): } function isReimbursementQueuedAction(reportAction: OnyxEntry) { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTQUEUED; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_QUEUED; } function isMemberChangeAction(reportAction: OnyxEntry) { return ( - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM || - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.REMOVE_FROM_ROOM || - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.INVITE_TO_ROOM || - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.REMOVE_FROM_ROOM || - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.LEAVE_POLICY + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM || + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.REMOVE_FROM_ROOM || + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.INVITE_TO_ROOM || + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.REMOVE_FROM_ROOM || + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.LEAVE_POLICY ); } function isInviteMemberAction(reportAction: OnyxEntry) { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.INVITE_TO_ROOM; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.INVITE_TO_ROOM; } function isLeavePolicyAction(reportAction: OnyxEntry) { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.LEAVE_POLICY; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.LEAVE_POLICY; } function isReimbursementDeQueuedAction(reportAction: OnyxEntry): reportAction is ReportActionBase & OriginalMessageReimbursementDequeued { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTDEQUEUED; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DEQUEUED; } /** @@ -283,9 +283,9 @@ function getSortedReportActions(reportActions: ReportAction[] | null, shouldSort if ((first.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED || second.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED) && first.actionName !== second.actionName) { return (first.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED ? -1 : 1) * invertedMultiplier; } - // Ensure that `REPORTPREVIEW` actions always come after if they have the same timestamp as another action type - if ((first.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW || second.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW) && first.actionName !== second.actionName) { - return (first.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW ? 1 : -1) * invertedMultiplier; + // Ensure that `REPORT_PREVIEW` actions always come after if they have the same timestamp as another action type + if ((first.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW || second.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW) && first.actionName !== second.actionName) { + return (first.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW ? 1 : -1) * invertedMultiplier; } // Then fallback on reportActionID as the final sorting criteria. It is a random number, @@ -332,7 +332,7 @@ function getContinuousReportActionChain(sortedReportActions: ReportAction[], id? (endIndex < sortedReportActions.length - 1 && sortedReportActions[endIndex].previousReportActionID === sortedReportActions[endIndex + 1].reportActionID) || !!sortedReportActions[endIndex + 1]?.whisperedToAccountIDs?.length || !!sortedReportActions[endIndex]?.whisperedToAccountIDs?.length || - sortedReportActions[endIndex]?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM || + sortedReportActions[endIndex]?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM || sortedReportActions[endIndex + 1]?.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED || sortedReportActions[endIndex + 1]?.actionName === CONST.REPORT.ACTIONS.TYPE.CREATED ) { @@ -350,7 +350,7 @@ function getContinuousReportActionChain(sortedReportActions: ReportAction[], id? sortedReportActions[startIndex - 1]?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing sortedReportActions[startIndex - 1]?.isOptimisticAction || - sortedReportActions[startIndex - 1]?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM + sortedReportActions[startIndex - 1]?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM ) { startIndex--; } @@ -491,7 +491,7 @@ function isReportActionDeprecated(reportAction: OnyxEntry, key: st return false; } -const {POLICYCHANGELOG: policyChangelogTypes, ROOMCHANGELOG: roomChangeLogTypes, ...otherActionTypes} = CONST.REPORT.ACTIONS.TYPE; +const {POLICY_CHANGE_LOG: policyChangelogTypes, ROOM_CHANGE_LOG: roomChangeLogTypes, ...otherActionTypes} = CONST.REPORT.ACTIONS.TYPE; const supportedActionTypes: ActionName[] = [...Object.values(otherActionTypes), ...Object.values(policyChangelogTypes), ...Object.values(roomChangeLogTypes)]; /** @@ -519,7 +519,7 @@ function shouldReportActionBeVisible(reportAction: OnyxEntry, key: // Ignore markedAsReimbursed action here since we're already display message that explains the expense was paid // elsewhere in the IOU reportAction - if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED) { + if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED) { return false; } @@ -560,7 +560,7 @@ function shouldReportActionBeVisibleAsLastAction(reportAction: OnyxEntry { return ( Object.values(allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReportID}`] ?? {}).find( - (reportAction) => reportAction && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && reportAction.originalMessage.linkedReportID === iouReportID, + (reportAction) => reportAction && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && reportAction.originalMessage.linkedReportID === iouReportID, ) ?? null ); } @@ -778,11 +778,11 @@ function getReportPreviewAction(chatReportID: string, iouReportID: string): Onyx * Get the iouReportID for a given report action. */ function getIOUReportIDFromReportActionPreview(reportAction: OnyxEntry): string { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW ? reportAction.originalMessage.linkedReportID : '0'; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW ? reportAction.originalMessage.linkedReportID : '0'; } function isCreatedTaskReportAction(reportAction: OnyxEntry): boolean { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && !!reportAction.originalMessage?.taskReportID; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT && !!reportAction.originalMessage?.taskReportID; } /** @@ -810,10 +810,10 @@ function isTrackExpenseAction(reportAction: OnyxEntry): boolean { const reportActionName = reportAction?.actionName; return ( - reportActionName === CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED || - reportActionName === CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED || - reportActionName === CONST.REPORT.ACTIONS.TYPE.TASKREOPENED || - reportActionName === CONST.REPORT.ACTIONS.TYPE.TASKEDITED + reportActionName === CONST.REPORT.ACTIONS.TYPE.TASK_COMPLETED || + reportActionName === CONST.REPORT.ACTIONS.TYPE.TASK_CANCELLED || + reportActionName === CONST.REPORT.ACTIONS.TYPE.TASK_REOPENED || + reportActionName === CONST.REPORT.ACTIONS.TYPE.TASK_EDITED ); } @@ -858,7 +858,7 @@ function isNotifiableReportAction(reportAction: OnyxEntry): boolea return false; } - const actions: ActionName[] = [CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE]; + const actions: ActionName[] = [CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE]; return actions.includes(reportAction.actionName); } @@ -951,32 +951,32 @@ function getMemberChangeMessageFragment(reportAction: OnyxEntry): function isOldDotReportAction(action: ReportAction): boolean { return [ - CONST.REPORT.ACTIONS.TYPE.CHANGEFIELD, - CONST.REPORT.ACTIONS.TYPE.CHANGEPOLICY, - CONST.REPORT.ACTIONS.TYPE.CHANGETYPE, - CONST.REPORT.ACTIONS.TYPE.DELEGATESUBMIT, - CONST.REPORT.ACTIONS.TYPE.DELETEDACCOUNT, + CONST.REPORT.ACTIONS.TYPE.CHANGE_FIELD, + CONST.REPORT.ACTIONS.TYPE.CHANGE_POLICY, + CONST.REPORT.ACTIONS.TYPE.CHANGE_TYPE, + CONST.REPORT.ACTIONS.TYPE.DELEGATE_SUBMIT, + CONST.REPORT.ACTIONS.TYPE.DELETED_ACCOUNT, CONST.REPORT.ACTIONS.TYPE.DONATION, - CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOCSV, - CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOINTEGRATION, - CONST.REPORT.ACTIONS.TYPE.EXPORTEDTOQUICKBOOKS, + CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_CSV, + CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION, + CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_QUICK_BOOKS, CONST.REPORT.ACTIONS.TYPE.FORWARDED, - CONST.REPORT.ACTIONS.TYPE.INTEGRATIONSMESSAGE, - CONST.REPORT.ACTIONS.TYPE.MANAGERATTACHRECEIPT, - CONST.REPORT.ACTIONS.TYPE.MANAGERDETACHRECEIPT, - CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, - CONST.REPORT.ACTIONS.TYPE.MARKREIMBURSEDFROMINTEGRATION, - CONST.REPORT.ACTIONS.TYPE.OUTDATEDBANKACCOUNT, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACHBOUNCE, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACHCANCELLED, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTACCOUNTCHANGED, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTDELAYED, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTREQUESTED, - CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTSETUP, - CONST.REPORT.ACTIONS.TYPE.SELECTEDFORRANDOMAUDIT, + CONST.REPORT.ACTIONS.TYPE.INTEGRATIONS_MESSAGE, + CONST.REPORT.ACTIONS.TYPE.MANAGER_ATTACH_RECEIPT, + CONST.REPORT.ACTIONS.TYPE.MANAGER_DETACH_RECEIPT, + CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, + CONST.REPORT.ACTIONS.TYPE.MARK_REIMBURSED_FROM_INTEGRATION, + CONST.REPORT.ACTIONS.TYPE.OUTDATED_BANK_ACCOUNT, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_ACH_BOUNCE, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_ACH_CANCELLED, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_ACCOUNT_CHANGED, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DELAYED, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_REQUESTED, + CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_SETUP, + CONST.REPORT.ACTIONS.TYPE.SELECTED_FOR_RANDOM_AUDIT, CONST.REPORT.ACTIONS.TYPE.SHARE, - CONST.REPORT.ACTIONS.TYPE.STRIPEPAID, - CONST.REPORT.ACTIONS.TYPE.TAKECONTROL, + CONST.REPORT.ACTIONS.TYPE.STRIPE_PAID, + CONST.REPORT.ACTIONS.TYPE.TAKE_CONTROL, CONST.REPORT.ACTIONS.TYPE.UNAPPROVED, CONST.REPORT.ACTIONS.TYPE.UNSHARE, ].some((oldDotActionName) => oldDotActionName === action.actionName); @@ -1020,7 +1020,7 @@ function hasRequestFromCurrentAccount(reportID: string, currentAccountID: number * @param reportAction */ function isActionableMentionWhisper(reportAction: OnyxEntry): reportAction is ReportActionBase & OriginalMessageActionableMentionWhisper { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLEMENTIONWHISPER; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_MENTION_WHISPER; } /** @@ -1076,11 +1076,11 @@ function isCurrentActionUnread(report: Report | EmptyObject, reportAction: Repor * @param reportAction */ function isActionableJoinRequest(reportAction: OnyxEntry): boolean { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLEJOINREQUEST; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_JOIN_REQUEST; } function isActionableTrackExpense(reportAction: OnyxEntry): boolean { - return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLETRACKEXPENSEWHISPER; + return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_TRACK_EXPENSE_WHISPER; } /** diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 28a0f6b385bb..a0610401954b 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1432,7 +1432,7 @@ function canAddOrDeleteTransactions(moneyRequestReport: OnyxEntry): bool } /** - * Can only delete if the author is this user and the action is an ADDCOMMENT action or an IOU action in an unsettled report, or if the user is a + * Can only delete if the author is this user and the action is an ADD_COMMENT action or an IOU action in an unsettled report, or if the user is a * policy admin */ function canDeleteReportAction(reportAction: OnyxEntry, reportID: string): boolean { @@ -1459,7 +1459,7 @@ function canDeleteReportAction(reportAction: OnyxEntry, reportID: } if ( - reportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || + reportAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT || reportAction?.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || ReportActionsUtils.isCreatedTaskReportAction(reportAction) || reportAction?.actorAccountID === CONST.ACCOUNT_ID.CONCIERGE @@ -2019,7 +2019,7 @@ function getDeletedParentActionMessageForChatReport(reportAction: OnyxEntry, report: OnyxEntry, shouldUseShortDisplayName = true): string { const submitterDisplayName = getDisplayNameForParticipant(report?.ownerAccountID, shouldUseShortDisplayName) ?? ''; @@ -2035,7 +2035,7 @@ function getReimbursementQueuedActionMessage(reportAction: OnyxEntry, @@ -2055,12 +2055,12 @@ function getReimbursementDeQueuedActionMessage( } /** - * Builds an optimistic REIMBURSEMENTDEQUEUED report action with a randomly generated reportActionID. + * Builds an optimistic REIMBURSEMENT_DEQUEUED report action with a randomly generated reportActionID. * */ function buildOptimisticCancelPaymentReportAction(expenseReportID: string, amount: number, currency: string): OptimisticCancelPaymentReportAction { return { - actionName: CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTDEQUEUED, + actionName: CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DEQUEUED, actorAccountID: currentUserAccountID, message: [ { @@ -2543,12 +2543,12 @@ function canEditFieldOfMoneyRequest(reportAction: OnyxEntry, field * Can only edit if: * * - It was written by the current user - * - It's an ADDCOMMENT that is not an attachment + * - It's an ADD_COMMENT that is not an attachment * - It's an expense where conditions for editability are defined in canEditMoneyRequest method * - It's not pending deletion */ function canEditReportAction(reportAction: OnyxEntry): boolean { - const isCommentOrIOU = reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU; + const isCommentOrIOU = reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU; return Boolean( reportAction?.actorAccountID === currentUserAccountID && @@ -2920,7 +2920,7 @@ function getAdminRoomInvitedParticipants(parentReportAction: ReportAction | Reco return parentReportActionMessage; } const actionType = parentReportAction.actionName; - const isInviteAction = actionType === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM || actionType === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.INVITE_TO_ROOM; + const isInviteAction = actionType === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM || actionType === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.INVITE_TO_ROOM; const verbKey = isInviteAction ? 'workspace.invite.invited' : 'workspace.invite.removed'; const prepositionKey = isInviteAction ? 'workspace.invite.to' : 'workspace.invite.from'; @@ -3229,7 +3229,7 @@ function buildOptimisticAddCommentReportAction(text?: string, file?: FileObject, commentText, reportAction: { reportActionID: NumberUtils.rand64(), - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, actorAccountID: accountID, person: [ { @@ -3743,7 +3743,7 @@ function buildOptimisticReportPreview(chatReport: OnyxEntry, iouReport: return { reportActionID: NumberUtils.rand64(), reportID: chatReport?.reportID, - actionName: CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW, + actionName: CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, originalMessage: { linkedReportID: iouReport?.reportID, @@ -3780,7 +3780,7 @@ function buildOptimisticModifiedExpenseReportAction( ): OptimisticModifiedExpenseReportAction { const originalMessage = getModifiedExpenseOriginalMessage(oldTransaction, transactionChanges, isFromExpenseReport, policy); return { - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, actorAccountID: currentUserAccountID, automatic: false, avatar: getCurrentUserAvatarOrDefault(), @@ -3816,7 +3816,7 @@ function buildOptimisticModifiedExpenseReportAction( */ function buildOptimisticMovedTrackedExpenseModifiedReportAction(transactionThreadID: string, movedToReportID: string): OptimisticModifiedExpenseReportAction { return { - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, actorAccountID: currentUserAccountID, automatic: false, avatar: getCurrentUserAvatarOrDefault(), @@ -4130,7 +4130,7 @@ function buildOptimisticHoldReportAction(created = DateUtils.getDBTime()): Optim function buildOptimisticHoldReportActionComment(comment: string, created = DateUtils.getDBTime()): OptimisticHoldReportAction { return { reportActionID: NumberUtils.rand64(), - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, actorAccountID: currentUserAccountID, message: [ @@ -4206,7 +4206,7 @@ function buildOptimisticEditedTaskFieldReportAction({title, description}: Task): return { reportActionID: NumberUtils.rand64(), - actionName: CONST.REPORT.ACTIONS.TYPE.TASKEDITED, + actionName: CONST.REPORT.ACTIONS.TYPE.TASK_EDITED, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, actorAccountID: currentUserAccountID, message: [ @@ -4233,7 +4233,7 @@ function buildOptimisticEditedTaskFieldReportAction({title, description}: Task): function buildOptimisticChangedTaskAssigneeReportAction(assigneeAccountID: number): OptimisticEditedTaskReportAction { return { reportActionID: NumberUtils.rand64(), - actionName: CONST.REPORT.ACTIONS.TYPE.TASKEDITED, + actionName: CONST.REPORT.ACTIONS.TYPE.TASK_EDITED, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, actorAccountID: currentUserAccountID, message: [ @@ -4821,7 +4821,7 @@ function chatIncludesChronos(report: OnyxEntry | EmptyObject): boolean { * * - It was written by someone else and isn't a whisper * - It's a welcome message whisper - * - It's an ADDCOMMENT that is not an attachment + * - It's an ADD_COMMENT that is not an attachment */ function canFlagReportAction(reportAction: OnyxEntry, reportID: string | undefined): boolean { let report = getReport(reportID); @@ -4833,9 +4833,9 @@ function canFlagReportAction(reportAction: OnyxEntry, reportID: st } const isCurrentUserAction = reportAction?.actorAccountID === currentUserAccountID; const isOriginalMessageHaveHtml = - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED || - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CHRONOSOOOLIST; + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CHRONOS_OOO_LIST; if (ReportActionsUtils.isWhisperAction(reportAction)) { // Allow flagging welcome message whispers as they can be set by any room creator if (report?.description && !isCurrentUserAction && isOriginalMessageHaveHtml && reportAction?.originalMessage?.html === report.description) { @@ -4848,7 +4848,7 @@ function canFlagReportAction(reportAction: OnyxEntry, reportID: st return Boolean( !isCurrentUserAction && - reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT && !ReportActionsUtils.isDeletedAction(reportAction) && !ReportActionsUtils.isCreatedTaskReportAction(reportAction) && !isEmptyObject(report) && @@ -5908,7 +5908,7 @@ function isAllowedToSubmitDraftExpenseReport(report: OnyxEntry): boolean */ function getIndicatedMissingPaymentMethod(userWallet: OnyxEntry, reportId: string, reportAction: ReportAction): MissingPaymentMethod | undefined { const isSubmitterOfUnsettledReport = isCurrentUserSubmitter(reportId) && !isSettled(reportId); - if (!isSubmitterOfUnsettledReport || reportAction.actionName !== CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTQUEUED) { + if (!isSubmitterOfUnsettledReport || reportAction.actionName !== CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_QUEUED) { return undefined; } const paymentType = reportAction.originalMessage?.paymentType; @@ -5952,7 +5952,7 @@ function canLeavePolicyExpenseChat(report: OnyxEntry, policy: OnyxEntry< function getReportActionActorAccountID(reportAction: OnyxEntry, iouReport: OnyxEntry | undefined): number | undefined { switch (reportAction?.actionName) { - case CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW: + case CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW: return iouReport ? iouReport.managerID : reportAction?.actorAccountID; case CONST.REPORT.ACTIONS.TYPE.SUBMITTED: diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 9fc83d50f1e1..7b0c28b76653 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -321,7 +321,7 @@ function getOptionData({ const lastAction = visibleReportActionItems[report.reportID]; const isThreadMessage = - ReportUtils.isThread(report) && lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && lastAction?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; + ReportUtils.isThread(report) && lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT && lastAction?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; if ((result.isChatRoom || result.isPolicyExpenseChat || result.isThread || result.isTaskReport || isThreadMessage) && !result.isArchivedRoom) { if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) { @@ -330,14 +330,14 @@ function getOptionData({ } else if (ReportActionsUtils.isTaskAction(lastAction)) { result.alternateText = ReportUtils.formatReportLastMessageText(TaskUtils.getTaskReportActionMessage(lastAction).text); } else if ( - lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM || - lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.REMOVE_FROM_ROOM || - lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.INVITE_TO_ROOM || - lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.REMOVE_FROM_ROOM + lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM || + lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.REMOVE_FROM_ROOM || + lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.INVITE_TO_ROOM || + lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.REMOVE_FROM_ROOM ) { const targetAccountIDs = lastAction?.originalMessage?.targetAccountIDs ?? []; const verb = - lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM || lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.INVITE_TO_ROOM + lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM || lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.INVITE_TO_ROOM ? Localize.translate(preferredLocale, 'workspace.invite.invited') : Localize.translate(preferredLocale, 'workspace.invite.removed'); const users = Localize.translate(preferredLocale, targetAccountIDs.length > 1 ? 'workspace.invite.users' : 'workspace.invite.user'); @@ -346,14 +346,14 @@ function getOptionData({ const roomName = lastAction?.originalMessage?.roomName ?? ''; if (roomName) { const preposition = - lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM || lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.INVITE_TO_ROOM + lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.INVITE_TO_ROOM || lastAction.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.INVITE_TO_ROOM ? ` ${Localize.translate(preferredLocale, 'workspace.invite.to')}` : ` ${Localize.translate(preferredLocale, 'workspace.invite.from')}`; result.alternateText += `${preposition} ${roomName}`; } - } else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.LEAVE_POLICY) { + } else if (lastAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.LEAVE_POLICY) { result.alternateText = Localize.translateLocal('workspace.invite.leftWorkspace'); - } else if (lastAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && lastActorDisplayName && lastMessageTextFromReport) { + } else if (lastAction?.actionName !== CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && lastActorDisplayName && lastMessageTextFromReport) { result.alternateText = `${lastActorDisplayName}: ${lastMessageText}`; } else { result.alternateText = lastMessageTextFromReport.length > 0 ? lastMessageText : ReportActionsUtils.getLastVisibleMessage(report.reportID, {}, lastAction)?.lastMessageText; diff --git a/src/libs/TaskUtils.ts b/src/libs/TaskUtils.ts index 19e1025a09c8..17d724472611 100644 --- a/src/libs/TaskUtils.ts +++ b/src/libs/TaskUtils.ts @@ -21,13 +21,13 @@ Onyx.connect({ */ function getTaskReportActionMessage(action: OnyxEntry): Pick { switch (action?.actionName) { - case CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED: + case CONST.REPORT.ACTIONS.TYPE.TASK_COMPLETED: return {text: Localize.translateLocal('task.messages.completed')}; - case CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED: + case CONST.REPORT.ACTIONS.TYPE.TASK_CANCELLED: return {text: Localize.translateLocal('task.messages.canceled')}; - case CONST.REPORT.ACTIONS.TYPE.TASKREOPENED: + case CONST.REPORT.ACTIONS.TYPE.TASK_REOPENED: return {text: Localize.translateLocal('task.messages.reopened')}; - case CONST.REPORT.ACTIONS.TYPE.TASKEDITED: + case CONST.REPORT.ACTIONS.TYPE.TASK_EDITED: return { text: action?.message?.[0]?.text ?? '', html: action?.message?.[0]?.html, diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 83caa65e1d77..eecb7d957e36 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -289,7 +289,7 @@ function getReportPreviewAction(chatReportID: string, iouReportID: string): Onyx // Find the report preview action from the chat report return ( Object.values(reportActions).find( - (reportAction) => reportAction && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && reportAction.originalMessage.linkedReportID === iouReportID, + (reportAction) => reportAction && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && reportAction.originalMessage.linkedReportID === iouReportID, ) ?? null ); } @@ -1431,7 +1431,7 @@ function getMoneyRequestInformation( // 2. CREATED action for the iouReport // 3. IOU action for the iouReport // 4. The transaction thread, which requires the iouAction, and CREATED action for the transaction thread - // 5. REPORTPREVIEW action for the chatReport + // 5. REPORT_PREVIEW action for the chatReport // Note: The CREATED action for the IOU report must be optimistically generated before the IOU action so there's no chance that it appears after the IOU action in the chat const [optimisticCreatedActionForChat, optimisticCreatedActionForIOUReport, iouAction, optimisticTransactionThread, optimisticCreatedActionForTransactionThread] = ReportUtils.buildOptimisticMoneyRequestEntities( @@ -1638,7 +1638,7 @@ function getTrackExpenseInformation( // 1. CREATED action for the iouReport (if tracking in the Expense chat) // 2. IOU action for the iouReport (if tracking in the Expense chat), otherwise – for chatReport // 3. The transaction thread, which requires the iouAction, and CREATED action for the transaction thread - // 4. REPORTPREVIEW action for the chatReport (if tracking in the Expense chat) + // 4. REPORT_PREVIEW action for the chatReport (if tracking in the Expense chat) const [, optimisticCreatedActionForIOUReport, iouAction, optimisticTransactionThread, optimisticCreatedActionForTransactionThread] = ReportUtils.buildOptimisticMoneyRequestEntities( shouldUseMoneyReport && iouReport ? iouReport : chatReport, CONST.IOU.REPORT_ACTION_TYPE.TRACK, @@ -3386,7 +3386,7 @@ function createSplitsAndOnyxData( // 2. CREATED action for the iouReport // 3. IOU action for the iouReport // 4. Transaction Thread and the CREATED action for it - // 5. REPORTPREVIEW action for the chatReport + // 5. REPORT_PREVIEW action for the chatReport const [oneOnOneCreatedActionForChat, oneOnOneCreatedActionForIOU, oneOnOneIOUAction, optimisticTransactionThread, optimisticCreatedActionForTransactionThread] = ReportUtils.buildOptimisticMoneyRequestEntities( oneOnOneIOUReport, @@ -5350,7 +5350,7 @@ function hasIOUToApproveOrPay(chatReport: OnyxEntry | EmptyObj const iouReport = ReportUtils.getReport(action.childReportID ?? ''); const policy = getPolicy(iouReport?.policyID); const shouldShowSettlementButton = canIOUBePaid(iouReport, chatReport, policy) || canApproveIOU(iouReport, chatReport, policy); - return action.childReportID?.toString() !== excludedIOUReportID && action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && shouldShowSettlementButton; + return action.childReportID?.toString() !== excludedIOUReportID && action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && shouldShowSettlementButton; }); } diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 7bcb82861769..a4afff17d972 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1045,7 +1045,7 @@ function markCommentAsUnread(reportID: string, reportActionCreated: string) { current.actorAccountID !== currentUserAccountID && (!latest || current.created > latest.created) && // Whisper action doesn't affect lastVisibleActionCreated, so skip whisper action except actionable mention whisper - (!ReportActionsUtils.isWhisperAction(current) || current.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLEMENTIONWHISPER) + (!ReportActionsUtils.isWhisperAction(current) || current.actionName === CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_MENTION_WHISPER) ) { return current; } @@ -2200,7 +2200,7 @@ function showReportActionNotification(reportID: string, reportAction: ReportActi Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(reportID)); }); - if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE) { + if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE) { LocalNotification.showModifiedExpenseNotification(report, reportAction, onClick); } else { LocalNotification.showCommentNotification(report, reportAction, onClick); diff --git a/src/libs/actions/Task.ts b/src/libs/actions/Task.ts index f74b451c29f6..11e374913209 100644 --- a/src/libs/actions/Task.ts +++ b/src/libs/actions/Task.ts @@ -297,7 +297,7 @@ function createTaskAndNavigate( function completeTask(taskReport: OnyxEntry) { const taskReportID = taskReport?.reportID ?? ''; const message = `marked as complete`; - const completedTaskReportAction = ReportUtils.buildOptimisticTaskReportAction(taskReportID, CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED, message); + const completedTaskReportAction = ReportUtils.buildOptimisticTaskReportAction(taskReportID, CONST.REPORT.ACTIONS.TYPE.TASK_COMPLETED, message); const optimisticData: OnyxUpdate[] = [ { @@ -364,7 +364,7 @@ function completeTask(taskReport: OnyxEntry) { function reopenTask(taskReport: OnyxEntry) { const taskReportID = taskReport?.reportID ?? ''; const message = `marked as incomplete`; - const reopenedTaskReportAction = ReportUtils.buildOptimisticTaskReportAction(taskReportID, CONST.REPORT.ACTIONS.TYPE.TASKREOPENED, message); + const reopenedTaskReportAction = ReportUtils.buildOptimisticTaskReportAction(taskReportID, CONST.REPORT.ACTIONS.TYPE.TASK_REOPENED, message); const optimisticData: OnyxUpdate[] = [ { @@ -815,7 +815,7 @@ function deleteTask(report: OnyxEntry) { return; } const message = `deleted task: ${report.reportName}`; - const optimisticCancelReportAction = ReportUtils.buildOptimisticTaskReportAction(report.reportID ?? '', CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED, message); + const optimisticCancelReportAction = ReportUtils.buildOptimisticTaskReportAction(report.reportID ?? '', CONST.REPORT.ACTIONS.TYPE.TASK_CANCELLED, message); const optimisticReportActionID = optimisticCancelReportAction.reportActionID; const parentReportAction = getParentReportAction(report); const parentReport = getParentReport(report); diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index d4497b983465..5e64419fe608 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -290,7 +290,7 @@ const ContextMenuActions: ContextMenuAction[] = [ const isDeletedAction = ReportActionsUtils.isDeletedAction(reportAction); const shouldDisplayThreadReplies = ReportUtils.shouldDisplayThreadReplies(reportAction, reportID); const subscribed = childReportNotificationPreference !== 'hidden'; - const isCommentAction = reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && !ReportUtils.isThreadFirstChat(reportAction, reportID); + const isCommentAction = reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT && !ReportUtils.isThreadFirstChat(reportAction, reportID); const isWhisperAction = ReportActionsUtils.isWhisperAction(reportAction); return !subscribed && !isWhisperAction && isCommentAction && (!isDeletedAction || shouldDisplayThreadReplies); }, diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 4b87ca6e7eea..fdfcd1e0b833 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -279,7 +279,7 @@ function ReportActionItem({ // Removed messages should not be shown anyway and should not need this flow const latestDecision = action.message?.[0]?.moderationDecision?.decision ?? ''; useEffect(() => { - if (action.actionName !== CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT) { + if (action.actionName !== CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT) { return; } @@ -491,7 +491,7 @@ function ReportActionItem({ isWhisper={isWhisper} /> ); - } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW) { + } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW) { children = ReportUtils.isClosedExpenseReportWithNoExpenses(iouReport) ? ( ${translate('parentReportAction.deletedReport')}`} /> ) : ( @@ -513,7 +513,7 @@ function ReportActionItem({ children = ( ); - } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTQUEUED) { + } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_QUEUED) { const linkedReport = ReportUtils.isChatThread(report) ? ReportUtils.getReport(report.parentReportID) : report; const submitterDisplayName = PersonalDetailsUtils.getDisplayNameOrDefault(personalDetails[linkedReport?.ownerAccountID ?? -1]); const paymentType = action.originalMessage.paymentType ?? ''; @@ -568,16 +568,16 @@ function ReportActionItem({ ); - } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTDEQUEUED) { + } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DEQUEUED) { children = ; - } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE) { + } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE) { children = ; } else if (ReportActionsUtils.isOldDotReportAction(action)) { // This handles all historical actions from OldDot that we just want to display the message text children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD) { children = ; - } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLDCOMMENT) { + } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.HOLD_COMMENT) { children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.UNHOLD) { children = ; @@ -840,7 +840,7 @@ function ReportActionItem({ if (action.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) { return ; } - if (action.actionName === CONST.REPORT.ACTIONS.TYPE.CHRONOSOOOLIST) { + if (action.actionName === CONST.REPORT.ACTIONS.TYPE.CHRONOS_OOO_LIST) { return ( action?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && iouReport, [action?.actionName, iouReport]); + const displayAllActors = useMemo(() => action?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && iouReport, [action?.actionName, iouReport]); const isWorkspaceActor = ReportUtils.isPolicyExpenseChat(report) && (!actorAccountID || displayAllActors); let avatarSource = UserUtils.getAvatar(avatar ?? '', actorAccountID); diff --git a/src/pages/home/report/ReportActionsList.tsx b/src/pages/home/report/ReportActionsList.tsx index 19204958dd5f..206f7558baac 100644 --- a/src/pages/home/report/ReportActionsList.tsx +++ b/src/pages/home/report/ReportActionsList.tsx @@ -430,7 +430,7 @@ function ReportActionsList({ shouldDisplay = isCurrentMessageUnread && (!nextMessage || !isMessageUnread(nextMessage, lastReadTimeRef.current)) && !ReportActionsUtils.shouldHideNewMarker(reportAction); if (shouldDisplay && !messageManuallyMarkedUnread) { const isWithinVisibleThreshold = scrollingVerticalOffset.current < MSG_VISIBLE_THRESHOLD ? reportAction.created < (userActiveSince.current ?? '') : true; - // Prevent displaying a new marker line when report action is of type "REPORTPREVIEW" and last actor is the current user + // Prevent displaying a new marker line when report action is of type "REPORT_PREVIEW" and last actor is the current user shouldDisplay = (ReportActionsUtils.isReportPreviewAction(reportAction) ? !reportAction.childLastActorAccountID : reportAction.actorAccountID) !== Report.getCurrentUserAccountID() && isWithinVisibleThreshold; diff --git a/src/pages/home/report/ReportActionsListItemRenderer.tsx b/src/pages/home/report/ReportActionsListItemRenderer.tsx index 879f567762dd..7b0dea06eb45 100644 --- a/src/pages/home/report/ReportActionsListItemRenderer.tsx +++ b/src/pages/home/report/ReportActionsListItemRenderer.tsx @@ -154,7 +154,7 @@ function ReportActionsListItemRenderer({ shouldDisplayNewMarker={shouldDisplayNewMarker} shouldShowSubscriptAvatar={ (ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isExpenseReport(report)) && - [CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW, CONST.REPORT.ACTIONS.TYPE.SUBMITTED, CONST.REPORT.ACTIONS.TYPE.APPROVED].some( + [CONST.REPORT.ACTIONS.TYPE.IOU, CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW, CONST.REPORT.ACTIONS.TYPE.SUBMITTED, CONST.REPORT.ACTIONS.TYPE.APPROVED].some( (type) => type === reportAction.actionName, ) } diff --git a/src/pages/home/report/ReportActionsView.tsx b/src/pages/home/report/ReportActionsView.tsx index 1af93186d133..3e3ebf1a9cc3 100755 --- a/src/pages/home/report/ReportActionsView.tsx +++ b/src/pages/home/report/ReportActionsView.tsx @@ -367,11 +367,11 @@ function ReportActionsView({ }, [hasCachedActionOnFirstRender]); useEffect(() => { - // Temporary solution for handling REPORTPREVIEW. More details: https://expensify.slack.com/archives/C035J5C9FAP/p1705417778466539?thread_ts=1705035404.136629&cid=C035J5C9FAP - // This code should be removed once REPORTPREVIEW is no longer repositioned. - // We need to call openReport for gaps created by moving REPORTPREVIEW, which causes mismatches in previousReportActionID and reportActionID of adjacent reportActions. The server returns the correct sequence, allowing us to overwrite incorrect data with the correct one. + // Temporary solution for handling REPORT_PREVIEW. More details: https://expensify.slack.com/archives/C035J5C9FAP/p1705417778466539?thread_ts=1705035404.136629&cid=C035J5C9FAP + // This code should be removed once REPORT_PREVIEW is no longer repositioned. + // We need to call openReport for gaps created by moving REPORT_PREVIEW, which causes mismatches in previousReportActionID and reportActionID of adjacent reportActions. The server returns the correct sequence, allowing us to overwrite incorrect data with the correct one. const shouldOpenReport = - newestReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && + newestReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW && !hasCreatedAction && isReadyForCommentLinking && reportActions.length < 24 && diff --git a/src/pages/home/report/reportActionPropTypes.js b/src/pages/home/report/reportActionPropTypes.js index 4d4809cd781f..f40e86aa7a7b 100644 --- a/src/pages/home/report/reportActionPropTypes.js +++ b/src/pages/home/report/reportActionPropTypes.js @@ -5,7 +5,7 @@ export default { /** The ID of the reportAction. It is the string representation of the a 64-bit integer. */ reportActionID: PropTypes.string, - /** Name of the action e.g. ADDCOMMENT */ + /** Name of the action e.g. ADD_COMMENT */ actionName: PropTypes.string, /** Person who created the action */ diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 7ae580006b84..f22edd423c0d 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -26,7 +26,7 @@ type OriginalMessageActionName = | 'ACTIONABLEJOINREQUEST' | 'ACTIONABLEMENTIONWHISPER' | 'ACTIONABLETRACKEXPENSEWHISPER' - | ValueOf; + | ValueOf; type OriginalMessageApproved = { actionName: typeof CONST.REPORT.ACTIONS.TYPE.APPROVED; originalMessage: unknown; @@ -39,7 +39,7 @@ type OriginalMessageHold = { }; type OriginalMessageHoldComment = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.HOLDCOMMENT; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.HOLD_COMMENT; originalMessage: unknown; }; @@ -124,7 +124,7 @@ type Closed = { }; type OriginalMessageAddComment = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT; originalMessage: { html: string; source?: OriginalMessageSource; @@ -141,7 +141,7 @@ type OriginalMessageAddComment = { }; type OriginalMessageActionableMentionWhisper = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.ACTIONABLEMENTIONWHISPER; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_MENTION_WHISPER; originalMessage: { inviteeAccountIDs: number[]; inviteeEmails: string; @@ -168,7 +168,7 @@ type OriginalMessageCreated = { }; type OriginalMessageMarkedReimbursed = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED; originalMessage?: unknown; }; @@ -204,7 +204,7 @@ type ChronosOOOEvent = { }; type OriginalMessageChronosOOOList = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.CHRONOSOOOLIST; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.CHRONOS_OOO_LIST; originalMessage: { edits: string[]; events: ChronosOOOEvent[]; @@ -214,7 +214,7 @@ type OriginalMessageChronosOOOList = { }; type OriginalMessageReportPreview = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW; originalMessage: { linkedReportID: string; lastModified?: string; @@ -222,12 +222,12 @@ type OriginalMessageReportPreview = { }; type OriginalMessagePolicyChangeLog = { - actionName: ValueOf; + actionName: ValueOf; originalMessage: ChangeLog; }; type OriginalMessageJoinPolicyChangeLog = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.ACTIONABLEJOINREQUEST; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_JOIN_REQUEST; originalMessage: { choice: string; email: string; @@ -238,22 +238,22 @@ type OriginalMessageJoinPolicyChangeLog = { }; type OriginalMessageRoomChangeLog = { - actionName: ValueOf; + actionName: ValueOf; originalMessage: ChangeLog; }; type OriginalMessagePolicyTask = { actionName: - | typeof CONST.REPORT.ACTIONS.TYPE.TASKEDITED - | typeof CONST.REPORT.ACTIONS.TYPE.TASKCANCELLED - | typeof CONST.REPORT.ACTIONS.TYPE.TASKCOMPLETED - | typeof CONST.REPORT.ACTIONS.TYPE.TASKREOPENED - | typeof CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE; + | typeof CONST.REPORT.ACTIONS.TYPE.TASK_EDITED + | typeof CONST.REPORT.ACTIONS.TYPE.TASK_CANCELLED + | typeof CONST.REPORT.ACTIONS.TYPE.TASK_COMPLETED + | typeof CONST.REPORT.ACTIONS.TYPE.TASK_REOPENED + | typeof CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE; originalMessage: unknown; }; type OriginalMessageModifiedExpense = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE; originalMessage: { oldMerchant?: string; merchant?: string; @@ -279,14 +279,14 @@ type OriginalMessageModifiedExpense = { }; type OriginalMessageReimbursementQueued = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTQUEUED; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_QUEUED; originalMessage: { paymentType: DeepValueOf; }; }; type OriginalMessageActionableTrackedExpenseWhisper = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.ACTIONABLETRACKEXPENSEWHISPER; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.ACTIONABLE_TRACK_EXPENSE_WHISPER; originalMessage: { transactionID: string; lastModified: string; @@ -295,7 +295,7 @@ type OriginalMessageActionableTrackedExpenseWhisper = { }; type OriginalMessageReimbursementDequeued = { - actionName: typeof CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTDEQUEUED; + actionName: typeof CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DEQUEUED; originalMessage: { expenseReportID: string; }; diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index aa0af7e5f037..45bdc5fe743a 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -2121,7 +2121,7 @@ describe('actions/IOU', () => { let IOU_REPORT_ID: string; let reportActionID; const REPORT_ACTION: OnyxEntry = { - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, actorAccountID: TEST_USER_ACCOUNT_ID, automatic: false, avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', @@ -2370,7 +2370,7 @@ describe('actions/IOU', () => { await waitForBatchedUpdates(); // Then verify that the comment is correctly added - const resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT); + const resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT); reportActionID = resultAction?.reportActionID ?? ''; expect(resultAction?.message).toEqual(REPORT_ACTION.message); @@ -2519,7 +2519,7 @@ describe('actions/IOU', () => { expect(report).toBeFalsy(); }); - it('delete the transaction thread if there are only changelogs (i.e. MODIFIEDEXPENSE actions) in the thread', async () => { + it('delete the transaction thread if there are only changelogs (i.e. MODIFIED_EXPENSE actions) in the thread', async () => { // Given all promises are resolved await waitForBatchedUpdates(); jest.advanceTimersByTime(10); @@ -2656,7 +2656,7 @@ describe('actions/IOU', () => { await waitForBatchedUpdates(); // Then comment details should match the expected report action - const resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT); + const resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT); reportActionID = resultAction?.reportActionID ?? ''; expect(resultAction?.message).toEqual(REPORT_ACTION.message); expect(resultAction?.person).toEqual(REPORT_ACTION.person); @@ -2766,7 +2766,7 @@ describe('actions/IOU', () => { }); }); - let resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT); + let resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT); reportActionID = resultAction?.reportActionID ?? ''; expect(resultAction?.message).toEqual(REPORT_ACTION.message); @@ -2798,7 +2798,7 @@ describe('actions/IOU', () => { Report.addComment(IOU_REPORT_ID, 'Testing a comment'); await waitForBatchedUpdates(); - resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT); + resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT); reportActionID = resultAction?.reportActionID ?? ''; expect(resultAction?.message).toEqual(REPORT_ACTION.message); @@ -2931,7 +2931,7 @@ describe('actions/IOU', () => { Report.addComment(IOU_REPORT_ID, 'Testing a comment'); await waitForBatchedUpdates(); - const resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT); + const resultAction = Object.values(reportActions ?? {}).find((reportAction) => reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT); reportActionID = resultAction?.reportActionID; expect(resultAction?.message).toEqual(REPORT_ACTION.message); diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index 6f1ea2c5ee7f..28aa84babfb5 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -60,7 +60,7 @@ describe('actions/Report', () => { const REPORT_ID = '1'; let reportActionID: string; const REPORT_ACTION = { - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, actorAccountID: TEST_USER_ACCOUNT_ID, automatic: false, avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', @@ -246,7 +246,7 @@ describe('actions/Report', () => { key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, value: { 1: { - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, actorAccountID: USER_2_ACCOUNT_ID, automatic: false, avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', @@ -333,7 +333,7 @@ describe('actions/Report', () => { expect(report?.lastMessageText).toBe('Current User Comment 3'); const USER_1_BASE_ACTION = { - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, actorAccountID: USER_1_ACCOUNT_ID, automatic: false, avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_3.png', @@ -514,7 +514,7 @@ describe('actions/Report', () => { const TEST_USER_ACCOUNT_ID = 1; const REPORT_ID = '1'; const REPORT_ACTION = { - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, }; // Setup user and pusher listeners diff --git a/tests/perf-test/ModifiedExpenseMessage.perf-test.ts b/tests/perf-test/ModifiedExpenseMessage.perf-test.ts index df9ffca59b7d..1711badd8c05 100644 --- a/tests/perf-test/ModifiedExpenseMessage.perf-test.ts +++ b/tests/perf-test/ModifiedExpenseMessage.perf-test.ts @@ -44,7 +44,7 @@ test('[ModifiedExpenseMessage] getForReportAction on 1k reports and policies', a const report = createRandomReport(1); const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { amount: randAmount(), currency: CONST.CURRENCY.USD, diff --git a/tests/perf-test/ReportUtils.perf-test.ts b/tests/perf-test/ReportUtils.perf-test.ts index ae3429bb9c01..40098d00ee6f 100644 --- a/tests/perf-test/ReportUtils.perf-test.ts +++ b/tests/perf-test/ReportUtils.perf-test.ts @@ -66,7 +66,7 @@ describe('ReportUtils', () => { test('[ReportUtils] canDeleteReportAction on 1k reports and policies', async () => { const reportID = '1'; - const reportAction = {...createRandomReportAction(1), actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT} as unknown as ReportAction; + const reportAction = {...createRandomReportAction(1), actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT} as unknown as ReportAction; await waitForBatchedUpdates(); await measureFunction(() => ReportUtils.canDeleteReportAction(reportAction, reportID)); diff --git a/tests/ui/UnreadIndicatorsTest.tsx b/tests/ui/UnreadIndicatorsTest.tsx index 2aeee2cc77bf..a7f689036d05 100644 --- a/tests/ui/UnreadIndicatorsTest.tsx +++ b/tests/ui/UnreadIndicatorsTest.tsx @@ -405,7 +405,7 @@ describe('Unread Indicators', () => { reportActionID: createdReportActionID, }, [commentReportActionID]: { - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, actorAccountID: USER_C_ACCOUNT_ID, person: [{type: 'TEXT', style: 'strong', text: 'User C'}], created: format(NEW_REPORT_FIST_MESSAGE_CREATED_DATE, CONST.DATE.FNS_DB_FORMAT_STRING), diff --git a/tests/unit/MigrationTest.ts b/tests/unit/MigrationTest.ts index e50c7bdcee55..69e0e80e589a 100644 --- a/tests/unit/MigrationTest.ts +++ b/tests/unit/MigrationTest.ts @@ -42,10 +42,10 @@ describe('Migrations', () => { 1: { reportActionID: '1', created: '', - actionName: CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, + actionName: CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, reportID: '1', }, - 2: {reportActionID: '2', created: '', actionName: CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, reportID: '1'}, + 2: {reportActionID: '2', created: '', actionName: CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, reportID: '1'}, }, ], (item) => item[1].reportID ?? '', @@ -78,14 +78,14 @@ describe('Migrations', () => { reportActionID: '1', previousReportActionID: '0', created: '', - actionName: CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, + actionName: CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, reportID: '1', }, 2: { reportActionID: '2', previousReportActionID: '1', created: '', - actionName: CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, + actionName: CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, reportID: '1', }, }, @@ -126,13 +126,13 @@ describe('Migrations', () => { 1: { reportActionID: '1', created: '', - actionName: CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, + actionName: CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, reportID: '4', }, 2: { reportActionID: '2', created: '', - actionName: CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, + actionName: CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, reportID: '4', }, }, @@ -175,14 +175,14 @@ describe('Migrations', () => { reportActionID: '1', previousReportActionID: '10', created: '', - actionName: CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, + actionName: CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, reportID: '4', }, 2: { reportActionID: '2', previousReportActionID: '23', created: '', - actionName: CONST.REPORT.ACTIONS.TYPE.MARKEDREIMBURSED, + actionName: CONST.REPORT.ACTIONS.TYPE.MARKED_REIMBURSED, reportID: '4', }, }, diff --git a/tests/unit/ModifiedExpenseMessageTest.ts b/tests/unit/ModifiedExpenseMessageTest.ts index dd4e4368ed55..d7fe10bc0507 100644 --- a/tests/unit/ModifiedExpenseMessageTest.ts +++ b/tests/unit/ModifiedExpenseMessageTest.ts @@ -9,7 +9,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the amount is changed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { amount: 1800, currency: CONST.CURRENCY.USD, @@ -30,7 +30,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the amount is changed while the original value was partial', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { amount: 1800, currency: CONST.CURRENCY.USD, @@ -51,7 +51,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the amount is changed and the description is removed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { amount: 1800, currency: CONST.CURRENCY.USD, @@ -74,7 +74,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the amount is changed, the description is removed, and category is set', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { amount: 1800, currency: CONST.CURRENCY.USD, @@ -99,7 +99,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the amount and merchant are changed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { merchant: 'Taco Bell', oldMerchant: 'Big Belly', @@ -122,7 +122,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the amount and merchant are changed, the description is removed, and category is set', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { merchant: 'Taco Bell', oldMerchant: 'Big Belly', @@ -150,7 +150,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the amount, comment and merchant are changed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { merchant: 'Taco Bell', oldMerchant: 'Big Belly', @@ -176,7 +176,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the merchant is removed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { merchant: '', oldMerchant: 'Big Belly', @@ -195,7 +195,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the merchant is changed while the previous merchant was partial', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { merchant: 'KFC', oldMerchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, @@ -214,7 +214,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the merchant and the description are removed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { merchant: '', oldMerchant: 'Big Belly', @@ -235,7 +235,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the merchant, the category and the description are removed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { merchant: '', oldMerchant: 'Big Belly', @@ -258,7 +258,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the merchant is set', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { oldMerchant: '', merchant: 'Big Belly', @@ -277,7 +277,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the merchant and the description are set', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { oldMerchant: '', merchant: 'Big Belly', @@ -298,7 +298,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the merchant, the category and the description are set', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { oldMerchant: '', merchant: 'Big Belly', @@ -321,7 +321,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the created date is changed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { created: '2023-12-27', oldCreated: '2023-12-26', @@ -340,7 +340,7 @@ describe('ModifiedExpenseMessage', () => { describe('when the created date was not changed', () => { const reportAction = { ...createRandomReportAction(1), - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, originalMessage: { created: '2023-12-27', }, diff --git a/tests/unit/ReportActionsUtilsTest.ts b/tests/unit/ReportActionsUtilsTest.ts index a926d0589e80..05fe50fe78b7 100644 --- a/tests/unit/ReportActionsUtilsTest.ts +++ b/tests/unit/ReportActionsUtilsTest.ts @@ -35,7 +35,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:27:01.825', reportActionID: '8401445780099176', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -44,7 +44,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:27:01.600', reportActionID: '6401435781022176', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -55,7 +55,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:26:48.789', reportActionID: '2962390724708756', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -64,7 +64,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:26:48.789', reportActionID: '1609646094152486', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -73,7 +73,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:26:48.789', reportActionID: '1661970171066218', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -84,7 +84,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:26:48.789', reportActionID: '1609646094152486', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -93,7 +93,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:26:48.789', reportActionID: '1661970171066218', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -102,7 +102,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:26:48.789', reportActionID: '2962390724708756', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -111,7 +111,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:27:01.600', reportActionID: '6401435781022176', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -120,7 +120,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:27:01.825', reportActionID: '8401445780099176', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -134,7 +134,7 @@ describe('ReportActionsUtils', () => { { created: '2023-01-10 22:25:47.132', reportActionID: '3', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -152,7 +152,7 @@ describe('ReportActionsUtils', () => { { created: '2023-01-10 22:25:47.132', reportActionID: '1', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -173,7 +173,7 @@ describe('ReportActionsUtils', () => { { created: '2023-01-10 22:25:47.132', reportActionID: '1', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -182,7 +182,7 @@ describe('ReportActionsUtils', () => { { created: '2023-01-10 22:25:47.132', reportActionID: '3', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -209,7 +209,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-13 22:27:01.825', reportActionID: '8401445780099176', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -276,14 +276,14 @@ describe('ReportActionsUtils', () => { { created: '2022-11-09 22:27:01.825', reportActionID: '8049485084562457', - actionName: CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.UPDATE_FIELD, + actionName: CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_FIELD, originalMessage: {}, message: [{html: 'updated the Approval Mode from "Submit and Approve" to "Submit and Close"', type: 'Action type', text: 'Action text'}], }, { created: '2022-11-08 22:27:06.825', reportActionID: '1661970171066216', - actionName: CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENTQUEUED, + actionName: CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_QUEUED, originalMessage: { paymentType: 'ACH', }, @@ -292,7 +292,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-06 22:27:08.825', reportActionID: '1661970171066220', - actionName: CONST.REPORT.ACTIONS.TYPE.TASKEDITED, + actionName: CONST.REPORT.ACTIONS.TYPE.TASK_EDITED, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -310,7 +310,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-13 22:27:01.825', reportActionID: '8401445780099176', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -401,7 +401,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-13 22:27:01.825', reportActionID: '8401445780099176', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -417,7 +417,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-12 22:27:01.825', reportActionID: '8401445780099175', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -428,7 +428,7 @@ describe('ReportActionsUtils', () => { { created: '2022-11-11 22:27:01.825', reportActionID: '8401445780099174', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -449,7 +449,7 @@ describe('ReportActionsUtils', () => { reportActionID: '1', previousReportActionID: undefined, created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -466,7 +466,7 @@ describe('ReportActionsUtils', () => { reportActionID: '2', previousReportActionID: '1', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -483,7 +483,7 @@ describe('ReportActionsUtils', () => { reportActionID: '3', previousReportActionID: '2', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -500,7 +500,7 @@ describe('ReportActionsUtils', () => { reportActionID: '4', previousReportActionID: '3', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -517,7 +517,7 @@ describe('ReportActionsUtils', () => { reportActionID: '5', previousReportActionID: '4', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -534,7 +534,7 @@ describe('ReportActionsUtils', () => { reportActionID: '6', previousReportActionID: '5', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -551,7 +551,7 @@ describe('ReportActionsUtils', () => { reportActionID: '7', previousReportActionID: '6', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -570,7 +570,7 @@ describe('ReportActionsUtils', () => { reportActionID: '9', previousReportActionID: '8', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -587,7 +587,7 @@ describe('ReportActionsUtils', () => { reportActionID: '10', previousReportActionID: '9', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -604,7 +604,7 @@ describe('ReportActionsUtils', () => { reportActionID: '11', previousReportActionID: '10', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -621,7 +621,7 @@ describe('ReportActionsUtils', () => { reportActionID: '12', previousReportActionID: '11', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -640,7 +640,7 @@ describe('ReportActionsUtils', () => { reportActionID: '14', previousReportActionID: '13', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -657,7 +657,7 @@ describe('ReportActionsUtils', () => { reportActionID: '15', previousReportActionID: '14', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -674,7 +674,7 @@ describe('ReportActionsUtils', () => { reportActionID: '16', previousReportActionID: '15', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -691,7 +691,7 @@ describe('ReportActionsUtils', () => { reportActionID: '17', previousReportActionID: '16', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -711,7 +711,7 @@ describe('ReportActionsUtils', () => { reportActionID: '1', previousReportActionID: undefined, created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -728,7 +728,7 @@ describe('ReportActionsUtils', () => { reportActionID: '2', previousReportActionID: '1', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -745,7 +745,7 @@ describe('ReportActionsUtils', () => { reportActionID: '3', previousReportActionID: '2', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -762,7 +762,7 @@ describe('ReportActionsUtils', () => { reportActionID: '4', previousReportActionID: '3', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -779,7 +779,7 @@ describe('ReportActionsUtils', () => { reportActionID: '5', previousReportActionID: '4', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -796,7 +796,7 @@ describe('ReportActionsUtils', () => { reportActionID: '6', previousReportActionID: '5', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -813,7 +813,7 @@ describe('ReportActionsUtils', () => { reportActionID: '7', previousReportActionID: '6', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -840,7 +840,7 @@ describe('ReportActionsUtils', () => { reportActionID: '1', previousReportActionID: undefined, created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -857,7 +857,7 @@ describe('ReportActionsUtils', () => { reportActionID: '2', previousReportActionID: '1', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -874,7 +874,7 @@ describe('ReportActionsUtils', () => { reportActionID: '3', previousReportActionID: '2', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -891,7 +891,7 @@ describe('ReportActionsUtils', () => { reportActionID: '4', previousReportActionID: '3', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -908,7 +908,7 @@ describe('ReportActionsUtils', () => { reportActionID: '5', previousReportActionID: '4', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -925,7 +925,7 @@ describe('ReportActionsUtils', () => { reportActionID: '6', previousReportActionID: '5', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -942,7 +942,7 @@ describe('ReportActionsUtils', () => { reportActionID: '7', previousReportActionID: '6', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -961,7 +961,7 @@ describe('ReportActionsUtils', () => { reportActionID: '9', previousReportActionID: '8', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -978,7 +978,7 @@ describe('ReportActionsUtils', () => { reportActionID: '10', previousReportActionID: '9', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -995,7 +995,7 @@ describe('ReportActionsUtils', () => { reportActionID: '11', previousReportActionID: '10', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1012,7 +1012,7 @@ describe('ReportActionsUtils', () => { reportActionID: '12', previousReportActionID: '11', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1031,7 +1031,7 @@ describe('ReportActionsUtils', () => { reportActionID: '14', previousReportActionID: '13', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1048,7 +1048,7 @@ describe('ReportActionsUtils', () => { reportActionID: '15', previousReportActionID: '14', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1065,7 +1065,7 @@ describe('ReportActionsUtils', () => { reportActionID: '16', previousReportActionID: '15', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1082,7 +1082,7 @@ describe('ReportActionsUtils', () => { reportActionID: '17', previousReportActionID: '16', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1102,7 +1102,7 @@ describe('ReportActionsUtils', () => { reportActionID: '9', previousReportActionID: '8', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1119,7 +1119,7 @@ describe('ReportActionsUtils', () => { reportActionID: '10', previousReportActionID: '9', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1136,7 +1136,7 @@ describe('ReportActionsUtils', () => { reportActionID: '11', previousReportActionID: '10', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1153,7 +1153,7 @@ describe('ReportActionsUtils', () => { reportActionID: '12', previousReportActionID: '11', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1180,7 +1180,7 @@ describe('ReportActionsUtils', () => { reportActionID: '1', previousReportActionID: undefined, created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1197,7 +1197,7 @@ describe('ReportActionsUtils', () => { reportActionID: '2', previousReportActionID: '1', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1214,7 +1214,7 @@ describe('ReportActionsUtils', () => { reportActionID: '3', previousReportActionID: '2', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1231,7 +1231,7 @@ describe('ReportActionsUtils', () => { reportActionID: '4', previousReportActionID: '3', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1248,7 +1248,7 @@ describe('ReportActionsUtils', () => { reportActionID: '5', previousReportActionID: '4', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1265,7 +1265,7 @@ describe('ReportActionsUtils', () => { reportActionID: '6', previousReportActionID: '5', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1282,7 +1282,7 @@ describe('ReportActionsUtils', () => { reportActionID: '7', previousReportActionID: '6', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1301,7 +1301,7 @@ describe('ReportActionsUtils', () => { reportActionID: '9', previousReportActionID: '8', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1318,7 +1318,7 @@ describe('ReportActionsUtils', () => { reportActionID: '10', previousReportActionID: '9', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1335,7 +1335,7 @@ describe('ReportActionsUtils', () => { reportActionID: '11', previousReportActionID: '10', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1352,7 +1352,7 @@ describe('ReportActionsUtils', () => { reportActionID: '12', previousReportActionID: '11', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1371,7 +1371,7 @@ describe('ReportActionsUtils', () => { reportActionID: '14', previousReportActionID: '13', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1388,7 +1388,7 @@ describe('ReportActionsUtils', () => { reportActionID: '15', previousReportActionID: '14', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1405,7 +1405,7 @@ describe('ReportActionsUtils', () => { reportActionID: '16', previousReportActionID: '15', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1422,7 +1422,7 @@ describe('ReportActionsUtils', () => { reportActionID: '17', previousReportActionID: '16', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1442,7 +1442,7 @@ describe('ReportActionsUtils', () => { reportActionID: '14', previousReportActionID: '13', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1459,7 +1459,7 @@ describe('ReportActionsUtils', () => { reportActionID: '15', previousReportActionID: '14', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1476,7 +1476,7 @@ describe('ReportActionsUtils', () => { reportActionID: '16', previousReportActionID: '15', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1493,7 +1493,7 @@ describe('ReportActionsUtils', () => { reportActionID: '17', previousReportActionID: '16', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1520,7 +1520,7 @@ describe('ReportActionsUtils', () => { reportActionID: '1', previousReportActionID: undefined, created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1537,7 +1537,7 @@ describe('ReportActionsUtils', () => { reportActionID: '2', previousReportActionID: '1', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1554,7 +1554,7 @@ describe('ReportActionsUtils', () => { reportActionID: '3', previousReportActionID: '2', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1571,7 +1571,7 @@ describe('ReportActionsUtils', () => { reportActionID: '4', previousReportActionID: '3', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1588,7 +1588,7 @@ describe('ReportActionsUtils', () => { reportActionID: '5', previousReportActionID: '4', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1605,7 +1605,7 @@ describe('ReportActionsUtils', () => { reportActionID: '6', previousReportActionID: '5', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1622,7 +1622,7 @@ describe('ReportActionsUtils', () => { reportActionID: '7', previousReportActionID: '6', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1641,7 +1641,7 @@ describe('ReportActionsUtils', () => { reportActionID: '9', previousReportActionID: '8', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1658,7 +1658,7 @@ describe('ReportActionsUtils', () => { reportActionID: '10', previousReportActionID: '9', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1675,7 +1675,7 @@ describe('ReportActionsUtils', () => { reportActionID: '11', previousReportActionID: '10', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1692,7 +1692,7 @@ describe('ReportActionsUtils', () => { reportActionID: '12', previousReportActionID: '11', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1711,7 +1711,7 @@ describe('ReportActionsUtils', () => { reportActionID: '14', previousReportActionID: '13', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1728,7 +1728,7 @@ describe('ReportActionsUtils', () => { reportActionID: '15', previousReportActionID: '14', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1745,7 +1745,7 @@ describe('ReportActionsUtils', () => { reportActionID: '16', previousReportActionID: '15', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1762,7 +1762,7 @@ describe('ReportActionsUtils', () => { reportActionID: '17', previousReportActionID: '16', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1791,7 +1791,7 @@ describe('ReportActionsUtils', () => { reportActionID: '1', previousReportActionID: undefined, created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1809,7 +1809,7 @@ describe('ReportActionsUtils', () => { reportActionID: '2', previousReportActionID: '1', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1827,7 +1827,7 @@ describe('ReportActionsUtils', () => { reportActionID: '3', previousReportActionID: '2', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1845,7 +1845,7 @@ describe('ReportActionsUtils', () => { reportActionID: '4', previousReportActionID: '3', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1863,7 +1863,7 @@ describe('ReportActionsUtils', () => { reportActionID: '5', previousReportActionID: '4', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1881,7 +1881,7 @@ describe('ReportActionsUtils', () => { reportActionID: '6', previousReportActionID: '5', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], @@ -1899,7 +1899,7 @@ describe('ReportActionsUtils', () => { reportActionID: '7', previousReportActionID: '6', created: '2022-11-13 22:27:01.825', - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, originalMessage: { html: 'Hello world', whisperedTo: [], diff --git a/tests/unit/ReportUtilsTest.ts b/tests/unit/ReportUtilsTest.ts index 63f83a03e022..0ed28ea84fcb 100644 --- a/tests/unit/ReportUtilsTest.ts +++ b/tests/unit/ReportUtilsTest.ts @@ -768,7 +768,7 @@ describe('ReportUtils', () => { it("should disable on a whisper action and it's neither a report preview nor IOU action", () => { const reportAction = { - actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIEDEXPENSE, + actionName: CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, whisperedToAccountIDs: [123456], } as ReportAction; expect(ReportUtils.shouldDisableThread(reportAction, reportID)).toBeTruthy(); diff --git a/tests/unit/SidebarOrderTest.ts b/tests/unit/SidebarOrderTest.ts index 2758d43fb81e..868630a8f7d2 100644 --- a/tests/unit/SidebarOrderTest.ts +++ b/tests/unit/SidebarOrderTest.ts @@ -122,7 +122,7 @@ describe('Sidebar', () => { const report2 = LHNTestUtils.getFakeReport([3, 4], 2); const report3 = LHNTestUtils.getFakeReport([5, 6], 1); - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); @@ -168,7 +168,7 @@ describe('Sidebar', () => { const report2 = LHNTestUtils.getFakeReport([3, 4], 2); const report3 = LHNTestUtils.getFakeReport([5, 6], 1); - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); @@ -219,7 +219,7 @@ describe('Sidebar', () => { const report2 = LHNTestUtils.getFakeReport([3, 4], 2); const report3 = LHNTestUtils.getFakeReport([5, 6], 1); - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); @@ -278,7 +278,7 @@ describe('Sidebar', () => { statusNum: CONST.REPORT.STATUS_NUM.OPEN, }; - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); @@ -342,7 +342,7 @@ describe('Sidebar', () => { }; report3.iouReportID = iouReport.reportID; - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); @@ -409,7 +409,7 @@ describe('Sidebar', () => { }; report3.iouReportID = expenseReport.reportID; - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); @@ -459,7 +459,7 @@ describe('Sidebar', () => { }; const report3 = LHNTestUtils.getFakeReport([5, 6], 1); - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); @@ -815,7 +815,7 @@ describe('Sidebar', () => { const report2 = LHNTestUtils.getFakeReport([3, 4]); const report3 = LHNTestUtils.getFakeReport([5, 6]); - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); @@ -1117,7 +1117,7 @@ describe('Sidebar', () => { lastVisibleActionCreated, }; - // Each report has at least one ADDCOMMENT action so should be rendered in the LNH + // Each report has at least one ADD_COMMENT action so should be rendered in the LNH Report.addComment(report1.reportID, 'Hi, this is a comment'); Report.addComment(report2.reportID, 'Hi, this is a comment'); Report.addComment(report3.reportID, 'Hi, this is a comment'); diff --git a/tests/utils/TestHelper.ts b/tests/utils/TestHelper.ts index 9f3b28973923..562176288565 100644 --- a/tests/utils/TestHelper.ts +++ b/tests/utils/TestHelper.ts @@ -203,7 +203,7 @@ function setPersonalDetails(login: string, accountID: number) { function buildTestReportComment(created: string, actorAccountID: number, actionID: string | null = null, previousReportActionID: string | null = null) { const reportActionID = actionID ?? NumberUtils.rand64().toString(); return { - actionName: CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT, + actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT, person: [{type: 'TEXT', style: 'strong', text: 'User B'}], created, message: [{type: 'COMMENT', html: `Comment ${actionID}`, text: `Comment ${actionID}`}],