From b695af4a61595a5b7dc56913040e7b41333a78a7 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Wed, 31 Aug 2022 16:22:20 +0200 Subject: [PATCH 01/15] build initial optimistic IOU report object --- src/libs/actions/Report.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 353b39921104..79db2dae7c0c 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -702,6 +702,27 @@ function createOptimisticChatReport(participantList) { }; } +function buildOptimisticIOUReport(total, chatReportID, currency) { + // comment: this.state.comment, + // amount: Math.round(this.state.amount * 100), + // currency: this.props.iou.selectedCurrencyCode, + // debtorEmail: OptionsListUtils.addSMSDomainIfPhoneNumber(this.state.participants[0].login), + + return { + cachedTotal: "(£123.45)", //todo, use Web-E format util func + chatReportID: chatReportID, + currency: currency, + hasOutstandingIOU: true, + managerEmail: "hariseldon585@gmail.com", + ownerEmail: "jules@expensify.com", + reportID: ReportUtils.generateReportID(), + state: "SUBMITTED", + stateNum: 1, + submitterPayPalMeAddress: "jules", + total: total, + }; +} + /** * @param {Number} reportID * @param {String} [text] From a2fe1ae9b12373da13a0492fc5bd264af9af2d0a Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Fri, 2 Sep 2022 18:10:17 +0200 Subject: [PATCH 02/15] improve the optimistic report object data --- src/libs/actions/Report.js | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 79db2dae7c0c..2866338dd06a 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -702,23 +702,17 @@ function createOptimisticChatReport(participantList) { }; } -function buildOptimisticIOUReport(total, chatReportID, currency) { - // comment: this.state.comment, - // amount: Math.round(this.state.amount * 100), - // currency: this.props.iou.selectedCurrencyCode, - // debtorEmail: OptionsListUtils.addSMSDomainIfPhoneNumber(this.state.participants[0].login), - +function buildOptimisticIOUReport(total, chatReportID, currency, locale) { return { - cachedTotal: "(£123.45)", //todo, use Web-E format util func + cachedTotal: NumberFormatUtils.format(locale, number, options), chatReportID: chatReportID, currency: currency, hasOutstandingIOU: true, - managerEmail: "hariseldon585@gmail.com", - ownerEmail: "jules@expensify.com", + managerEmail: "__FAKE__", + ownerEmail: "__FAKE__", reportID: ReportUtils.generateReportID(), state: "SUBMITTED", stateNum: 1, - submitterPayPalMeAddress: "jules", total: total, }; } @@ -742,16 +736,7 @@ function createOptimisticReportAction(reportID, text, file) { const textForNewComment = isAttachment ? '[Attachment]' : parser.htmlToText(htmlForNewComment); - // Generate a clientID so we can save the optimistic action to storage with the clientID as key. Later, we will - // remove the optimistic action when we add the real action created in the server. We do this because it's not - // safe to assume that this will use the very next sequenceNumber. An action created by another can overwrite that - // sequenceNumber if it is created before this one. We use a combination of current epoch timestamp (milliseconds) - // and a random number so that the probability of someone else having the same optimisticReportActionID is - // extremely low even if they left the comment at the same moment as another user on the same report. The random - // number is 3 digits because if we go any higher JS will convert the digits after the 16th position to 0's in - // optimisticReportActionID. - const randomNumber = Math.floor((Math.random() * (999 - 100)) + 100); - const optimisticReportActionID = parseInt(`${Date.now()}${randomNumber}`, 10); + const optimisticReportActionSequenceNumber = NumberUtils.generateReportActionSequenceNumber(); return { commentText, @@ -770,8 +755,8 @@ function createOptimisticReportAction(reportID, text, file) { automatic: false, // Use the client generated ID as a optimistic action ID so we can remove it later - sequenceNumber: optimisticReportActionID, - clientID: optimisticReportActionID, + sequenceNumber: optimisticReportActionSequenceNumber, + clientID: optimisticReportActionSequenceNumber, avatar: lodashGet(personalDetails, [currentUserEmail, 'avatar'], ReportUtils.getDefaultAvatar(currentUserEmail)), timestamp: moment().unix(), message: [ @@ -1635,6 +1620,7 @@ export { openReport, openPaymentDetailsPage, createOptimisticChatReport, + buildOptimisticIOUReport, updatePolicyRoomName, clearPolicyRoomNameErrors, }; From 168220a92c9634bb485e6dc68a9790f3344048af Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Fri, 2 Sep 2022 18:18:16 +0200 Subject: [PATCH 03/15] use shorthand property names --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 2866338dd06a..aceb1cbf01df 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -705,7 +705,7 @@ function createOptimisticChatReport(participantList) { function buildOptimisticIOUReport(total, chatReportID, currency, locale) { return { cachedTotal: NumberFormatUtils.format(locale, number, options), - chatReportID: chatReportID, + chatReportID, currency: currency, hasOutstandingIOU: true, managerEmail: "__FAKE__", From b36a46c34e577507e9b69bb3070f170607b80cc4 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Fri, 2 Sep 2022 18:19:37 +0200 Subject: [PATCH 04/15] Merge branch 'main' into jules-KeyboardFix # Conflicts: # src/components/ScreenWrapper/index.android.js --- src/libs/actions/Report.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index aceb1cbf01df..3db6c56f0d3d 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -28,6 +28,8 @@ import PusherUtils from '../PusherUtils'; import DateUtils from '../DateUtils'; import * as ReportActionsUtils from '../ReportActionsUtils'; import * as NumberUtils from '../NumberUtils'; +import * as NumberFormatUtils from './NumberFormatUtils'; + let currentUserEmail; let currentUserAccountID; @@ -706,14 +708,14 @@ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { return { cachedTotal: NumberFormatUtils.format(locale, number, options), chatReportID, - currency: currency, + currency, hasOutstandingIOU: true, managerEmail: "__FAKE__", ownerEmail: "__FAKE__", reportID: ReportUtils.generateReportID(), state: "SUBMITTED", stateNum: 1, - total: total, + total, }; } From a5f2f92f64e3f36a6690ed704f020e4894edfa16 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Fri, 2 Sep 2022 18:24:35 +0200 Subject: [PATCH 05/15] fix numer formatting and add a function doc --- src/libs/actions/Report.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 82ee80d843e0..49a543b3acd5 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -618,9 +618,18 @@ function createOptimisticChatReport(participantList) { }; } +/* + * Creates an optimistic IOU report with a randomly generated reportID + */ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { + const formattedTotal = NumberFormatUtils.numberFormat( + total, { + style: 'currency', + currency: currency, + }, + ); return { - cachedTotal: NumberFormatUtils.format(locale, number, options), + cachedTotal: formattedTotal, chatReportID, currency, hasOutstandingIOU: true, From 24137ed35138e9afa4c08da5b04221753ae260a1 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Fri, 2 Sep 2022 18:26:22 +0200 Subject: [PATCH 06/15] further formatting fixes --- src/libs/actions/Report.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 49a543b3acd5..dc5621414197 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -29,7 +29,6 @@ import * as ReportActionsUtils from '../ReportActionsUtils'; import * as NumberUtils from '../NumberUtils'; import * as NumberFormatUtils from './NumberFormatUtils'; - let currentUserEmail; let currentUserAccountID; Onyx.connect({ @@ -633,10 +632,10 @@ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { chatReportID, currency, hasOutstandingIOU: true, - managerEmail: "__FAKE__", - ownerEmail: "__FAKE__", + managerEmail: '__FAKE__', + ownerEmail: '__FAKE__', reportID: ReportUtils.generateReportID(), - state: "SUBMITTED", + state: 'SUBMITTED', stateNum: 1, total, }; From 918fcf8eaf3d5bd8fd498d05ec2a0b365670c683 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Mon, 5 Sep 2022 17:46:55 +0100 Subject: [PATCH 07/15] further formatting fixes --- src/libs/actions/Report.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index dc5621414197..3e6851914f96 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -27,7 +27,7 @@ import * as Localize from '../Localize'; import DateUtils from '../DateUtils'; import * as ReportActionsUtils from '../ReportActionsUtils'; import * as NumberUtils from '../NumberUtils'; -import * as NumberFormatUtils from './NumberFormatUtils'; +import * as NumberFormatUtils from '../NumberFormatUtils'; let currentUserEmail; let currentUserAccountID; @@ -621,10 +621,10 @@ function createOptimisticChatReport(participantList) { * Creates an optimistic IOU report with a randomly generated reportID */ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { - const formattedTotal = NumberFormatUtils.numberFormat( + const formattedTotal = NumberFormatUtils.numberFormat(locale, total, { style: 'currency', - currency: currency, + currency, }, ); return { From 1b5cbd79b0ef7223fdcf9e54a93c10a00e90e6e3 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Mon, 5 Sep 2022 17:52:05 +0100 Subject: [PATCH 08/15] fix unexpected newline --- src/libs/actions/Report.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 3e6851914f96..28c631b23f5c 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -625,8 +625,7 @@ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { total, { style: 'currency', currency, - }, - ); + },); return { cachedTotal: formattedTotal, chatReportID, From fc618eec5884a9f5c2d5fdfdc2f1332d0950932d Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Tue, 6 Sep 2022 09:42:42 +0100 Subject: [PATCH 09/15] fix number formatting logic --- src/libs/actions/Report.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 28c631b23f5c..67eb3c731850 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -621,11 +621,11 @@ function createOptimisticChatReport(participantList) { * Creates an optimistic IOU report with a randomly generated reportID */ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { - const formattedTotal = NumberFormatUtils.numberFormat(locale, + const formattedTotal = NumberFormatUtils.format(locale, total, { style: 'currency', currency, - },); + }); return { cachedTotal: formattedTotal, chatReportID, From 22c561265af71704a34f4c9c878a919702747e28 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Wed, 7 Sep 2022 17:12:19 +0100 Subject: [PATCH 10/15] refactor the existing createOptimistic... functions to buildOptimistic... --- src/libs/actions/Policy.js | 2 +- src/libs/actions/Report.js | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index 64f190168720..283239e2c469 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -810,7 +810,7 @@ function createWorkspace() { expenseChatReportID, expenseChatData, expenseReportActionData, - } = Report.createOptimisticWorkspaceChats(policyID, workspaceName); + } = Report.buildOptimisticWorkspaceChats(policyID, workspaceName); // We need to use makeRequestWithSideEffects as we try to redirect to the policy right after creation // The policy hasn't been merged in Onyx data at this point, leading to an intermittent Not Found screen diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index e6fde748bd9d..265cb585ead1 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -586,7 +586,7 @@ function fetchAllReports( } /** - * Creates an optimistic chat report with a randomly generated reportID and as much information as we currently have + * Builds an optimistic chat report with a randomly generated reportID and as much information as we currently have * * @param {Array} participantList * @param {String} reportName @@ -597,7 +597,7 @@ function fetchAllReports( * @param {String} oldPolicyName * @returns {Object} */ -function createOptimisticChatReport( +function buildOptimisticChatReport( participantList, reportName = 'Chat Report', chatType = '', @@ -632,7 +632,7 @@ function createOptimisticChatReport( } /* - * Creates an optimistic IOU report with a randomly generated reportID + * Builds an optimistic IOU report with a randomly generated reportID */ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { const formattedTotal = NumberFormatUtils.format(locale, @@ -659,7 +659,7 @@ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { * @param {String} ownerEmail * @returns {Object} */ -function createOptimisticCreatedReportAction(ownerEmail) { +function buildOptimisticCreatedReportAction(ownerEmail) { return { 0: { actionName: CONST.REPORT.ACTIONS.TYPE.CREATED, @@ -699,8 +699,8 @@ function createOptimisticCreatedReportAction(ownerEmail) { * @param {String} policyName * @returns {Object} */ -function createOptimisticWorkspaceChats(policyID, policyName) { - const announceChatData = createOptimisticChatReport( +function buildOptimisticWorkspaceChats(policyID, policyName) { + const announceChatData = buildOptimisticChatReport( [currentUserEmail], CONST.REPORT.WORKSPACE_CHAT_ROOMS.ANNOUNCE, CONST.REPORT.CHAT_TYPE.POLICY_ANNOUNCE, @@ -710,15 +710,15 @@ function createOptimisticWorkspaceChats(policyID, policyName) { policyName, ); const announceChatReportID = announceChatData.reportID; - const announceReportActionData = createOptimisticCreatedReportAction(announceChatData.ownerEmail); + const announceReportActionData = buildOptimisticCreatedReportAction(announceChatData.ownerEmail); - const adminsChatData = createOptimisticChatReport([currentUserEmail], CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS, CONST.REPORT.CHAT_TYPE.POLICY_ADMINS, policyID, null, false, policyName); + const adminsChatData = buildOptimisticChatReport([currentUserEmail], CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS, CONST.REPORT.CHAT_TYPE.POLICY_ADMINS, policyID, null, false, policyName); const adminsChatReportID = adminsChatData.reportID; - const adminsReportActionData = createOptimisticCreatedReportAction(adminsChatData.ownerEmail); + const adminsReportActionData = buildOptimisticCreatedReportAction(adminsChatData.ownerEmail); - const expenseChatData = createOptimisticChatReport([currentUserEmail], '', CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT, policyID, currentUserEmail, true, policyName); + const expenseChatData = buildOptimisticChatReport([currentUserEmail], '', CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT, policyID, currentUserEmail, true, policyName); const expenseChatReportID = expenseChatData.reportID; - const expenseReportActionData = createOptimisticCreatedReportAction(expenseChatData.ownerEmail); + const expenseReportActionData = buildOptimisticCreatedReportAction(expenseChatData.ownerEmail); return { announceChatReportID, @@ -1655,10 +1655,10 @@ export { readOldestAction, openReport, openPaymentDetailsPage, - createOptimisticWorkspaceChats, - createOptimisticChatReport, + buildOptimisticWorkspaceChats, + buildOptimisticChatReport, buildOptimisticIOUReport, - createOptimisticCreatedReportAction, + buildOptimisticCreatedReportAction, updatePolicyRoomName, clearPolicyRoomNameErrors, }; From 409ae5778982f54bbd71152304424c5493c9a766 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Wed, 7 Sep 2022 20:19:48 +0100 Subject: [PATCH 11/15] add emails to optimistic report, as we know them already --- src/libs/actions/Report.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 265cb585ead1..3cb1f9e33316 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -634,7 +634,7 @@ function buildOptimisticChatReport( /* * Builds an optimistic IOU report with a randomly generated reportID */ -function buildOptimisticIOUReport(total, chatReportID, currency, locale) { +function buildOptimisticIOUReport(ownerEmail, recipientEmail, total, chatReportID, currency, locale) { const formattedTotal = NumberFormatUtils.format(locale, total, { style: 'currency', @@ -645,8 +645,8 @@ function buildOptimisticIOUReport(total, chatReportID, currency, locale) { chatReportID, currency, hasOutstandingIOU: true, - managerEmail: '__FAKE__', - ownerEmail: '__FAKE__', + managerEmail: recipientEmail, + ownerEmail, reportID: ReportUtils.generateReportID(), state: 'SUBMITTED', stateNum: 1, From 6a99e9ccc92a6b2f02c548d345f64c6ee05a6136 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Thu, 8 Sep 2022 10:54:36 +0100 Subject: [PATCH 12/15] use consts for state and status --- src/CONST.js | 3 +++ src/libs/actions/Report.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index 903f70bdaa56..01fc60918767 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -286,6 +286,9 @@ const CONST = { ANNOUNCE: '#announce', ADMINS: '#admins', }, + STATE: { + SUBMITTED: 'SUBMITTED', + }, STATE_NUM: { OPEN: 0, PROCESSING: 1, diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 3cb1f9e33316..4161246d960b 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -648,8 +648,8 @@ function buildOptimisticIOUReport(ownerEmail, recipientEmail, total, chatReportI managerEmail: recipientEmail, ownerEmail, reportID: ReportUtils.generateReportID(), - state: 'SUBMITTED', - stateNum: 1, + state: CONST.STATE.SUBMITTED, + stateNum: CONST.STATUS.SUBMITTED, total, }; } From 5d2e3ccc5d98c3ff31cbb2e6f3dad2790ab7b8e0 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Thu, 8 Sep 2022 10:59:12 +0100 Subject: [PATCH 13/15] replace confusing CONST with integer --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 4161246d960b..d9c70cfa5127 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -649,7 +649,7 @@ function buildOptimisticIOUReport(ownerEmail, recipientEmail, total, chatReportI ownerEmail, reportID: ReportUtils.generateReportID(), state: CONST.STATE.SUBMITTED, - stateNum: CONST.STATUS.SUBMITTED, + stateNum: 1, total, }; } From 4ed3c6a07e86d0ea2ce99f7e2fcbc0b74d039f15 Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Thu, 8 Sep 2022 11:14:25 +0100 Subject: [PATCH 14/15] refactor optimistic iouReport to ReportUtils --- src/libs/ReportUtils.js | 25 +++++++++++++++++++++++++ src/libs/actions/Report.js | 25 ------------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 8fd7ec3af880..363c2d9065cc 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -12,6 +12,7 @@ import md5 from './md5'; import Navigation from './Navigation/Navigation'; import ROUTES from '../ROUTES'; import * as NumberUtils from './NumberUtils'; +import * as NumberFormatUtils from './NumberFormatUtils'; let sessionEmail; Onyx.connect({ @@ -560,6 +561,29 @@ function hasReportNameError(report) { return !_.isEmpty(lodashGet(report, 'errorFields.reportName', {})); } +/* + * Builds an optimistic IOU report with a randomly generated reportID + */ +function buildOptimisticIOUReport(ownerEmail, recipientEmail, total, chatReportID, currency, locale) { + const formattedTotal = NumberFormatUtils.format(locale, + total, { + style: 'currency', + currency, + }); + return { + cachedTotal: formattedTotal, + chatReportID, + currency, + hasOutstandingIOU: true, + managerEmail: recipientEmail, + ownerEmail, + reportID: ReportUtils.generateReportID(), + state: CONST.STATE.SUBMITTED, + stateNum: 1, + total, + }; +} + /** * Builds an optimistic IOU reportAction object * @@ -660,6 +684,7 @@ export { navigateToDetailsPage, generateReportID, hasReportNameError, + buildOptimisticIOUReport, buildOptimisticIOUReportAction, isUnread, }; diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d9c70cfa5127..80e2e7918421 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -27,7 +27,6 @@ import * as Localize from '../Localize'; import DateUtils from '../DateUtils'; import * as ReportActionsUtils from '../ReportActionsUtils'; import * as NumberUtils from '../NumberUtils'; -import * as NumberFormatUtils from '../NumberFormatUtils'; let currentUserEmail; let currentUserAccountID; @@ -631,29 +630,6 @@ function buildOptimisticChatReport( }; } -/* - * Builds an optimistic IOU report with a randomly generated reportID - */ -function buildOptimisticIOUReport(ownerEmail, recipientEmail, total, chatReportID, currency, locale) { - const formattedTotal = NumberFormatUtils.format(locale, - total, { - style: 'currency', - currency, - }); - return { - cachedTotal: formattedTotal, - chatReportID, - currency, - hasOutstandingIOU: true, - managerEmail: recipientEmail, - ownerEmail, - reportID: ReportUtils.generateReportID(), - state: CONST.STATE.SUBMITTED, - stateNum: 1, - total, - }; -} - /** * Returns the necessary reportAction onyx data to indicate that the chat has been created optimistically * @param {String} ownerEmail @@ -1657,7 +1633,6 @@ export { openPaymentDetailsPage, buildOptimisticWorkspaceChats, buildOptimisticChatReport, - buildOptimisticIOUReport, buildOptimisticCreatedReportAction, updatePolicyRoomName, clearPolicyRoomNameErrors, From 1c857bbf8936c42c6f5f1fee6cac574cd0d79e9b Mon Sep 17 00:00:00 2001 From: Jules Rosser Date: Thu, 8 Sep 2022 12:48:44 +0100 Subject: [PATCH 15/15] tidy params after switching file --- src/libs/ReportUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 363c2d9065cc..add2b50c483c 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -577,8 +577,8 @@ function buildOptimisticIOUReport(ownerEmail, recipientEmail, total, chatReportI hasOutstandingIOU: true, managerEmail: recipientEmail, ownerEmail, - reportID: ReportUtils.generateReportID(), - state: CONST.STATE.SUBMITTED, + reportID: generateReportID(), + state: CONST.REPORT.STATE.SUBMITTED, stateNum: 1, total, };