Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rocio Perez-Cano <pecanoro@users.noreply.github.com>
  • Loading branch information
shubham1206agra and pecanoro authored Apr 17, 2024
1 parent 63da26a commit c7cd851
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
source={resolvedThumbnail || resolvedReceiptImage || ''}
// AuthToken is required when retrieving the image from the server
// but we don't need it to load the blob:// or file:// image when starting a submit / split expense
// but we don't need it to load the blob:// or file:// image when starting an expense/split
// So if we have a thumbnail, it means we're retrieving the image from the server
isAuthTokenRequired={!!receiptThumbnail}
fileExtension={fileExtension}
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export default {
},
login: {
hero: {
header: 'Gestiona o divide gastos y chatea con su equipo.',
header: 'Gestiona, divide gastos y chatea con tu equipo.',
body: 'Bienvenido al futuro de Expensify, tu nuevo lugar de referencia para la colaboración financiera con amigos y compañeros de equipo por igual.',
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ function getOptions(
return;
}

// In case user needs to add credit bank account, don't allow them to submit expense from the workspace.
// In case user needs to add credit bank account, don't allow them to submit an expense from the workspace.
if (includeOwnedWorkspaceChats && ReportUtils.hasIOUWaitingOnCurrentUserBankAccount(report)) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ function getMemberChangeMessagePlainText(reportAction: OnyxEntry<ReportAction>):
}

/**
* Helper method to determine if the provided accountID has made an expense on the specified report.
* Helper method to determine if the provided accountID has submitted an expense on the specified report.
*
* @param reportID
* @param currentAccountID
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ function getDeleteTrackExpenseInformation(
}

/**
* Gathers all the data needed to make an expense. It attempts to find existing reports, iouReports, and receipts. If it doesn't find them, then
* Gathers all the data needed to submit an expense. It attempts to find existing reports, iouReports, and receipts. If it doesn't find them, then
* it creates optimistic versions of them and uses those instead
*/
function getMoneyRequestInformation(
Expand Down
6 changes: 3 additions & 3 deletions src/libs/actions/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ function playSoundForMessageType(pushJSON: OnyxServerUpdate[]) {
const types = flatten.map((data) => data?.originalMessage).filter(Boolean) as OriginalMessage[];

for (const message of types) {
// pay someone flow
// Pay someone flow
if ('IOUDetails' in message) {
return playSound(SOUNDS.SUCCESS);
}
Expand All @@ -545,12 +545,12 @@ function playSoundForMessageType(pushJSON: OnyxServerUpdate[]) {
return playSound(SOUNDS.ATTENTION);
}

// submit expense flow
// Submit expense flow
if ('IOUTransactionID' in message) {
return playSound(SOUNDS.ATTENTION);
}

// Someone completes an expense
// Someone reimburses an expense
if ('IOUReportID' in message) {
return playSound(SOUNDS.SUCCESS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const messageCopy = {
"6. Tap *Add to split* when you're done.\n" +
'7. Review and tap *Split* to split your expense(s).\n' +
'\n' +
"We'll send an expense to each of your friends and make sure you get paid back. Let me know how it goes!",
"We'll submit an expense to each of your friends and make sure you get paid back. Let me know how it goes!",
};

const menuIcons = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemSingle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function ReportActionItemSingle({
let secondaryAvatar: Icon;
const primaryDisplayName = displayName;
if (displayAllActors) {
// The ownerAccountID and actorAccountID can be the same if the a user submits expense back from the IOU's original creator, in that case we need to use managerID to avoid displaying the same user twice
// The ownerAccountID and actorAccountID can be the same if the a user submits an expense back from the IOU's original creator, in that case we need to use managerID to avoid displaying the same user twice
const secondaryAccountId = iouReport?.ownerAccountID === actorAccountID ? iouReport?.managerID : iouReport?.ownerAccountID;
const secondaryUserAvatar = personalDetails?.[secondaryAccountId ?? -1]?.avatar ?? '';
const secondaryDisplayName = ReportUtils.getDisplayNameForParticipant(secondaryAccountId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function MoneyTemporaryForRefactorRequestParticipantsSelector({participants, onF
CONST.EXPENSIFY_EMAILS,

// If we are using this component in the "Submit expense" flow then we pass the includeOwnedWorkspaceChats argument so that the current user
// sees the option to submit expense from their admin on their own Workspace Chat.
// sees the option to submit an expense from their admin on their own Workspace Chat.
iouType === CONST.IOU.TYPE.REQUEST && action !== CONST.IOU.ACTION.MOVE,

(canUseP2PDistanceRequests || iouRequestType !== CONST.IOU.REQUEST_TYPE.DISTANCE) && ![CONST.IOU.ACTION.CATEGORIZE, CONST.IOU.ACTION.SHARE].includes(action),
Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/request/step/IOURequestStepMerchant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function IOURequestStepMerchant({
}
IOU.setMoneyRequestMerchant(transactionID, newMerchant ?? '', !isEditing);
if (isEditing) {
// When creating new expense newMerchant can be blank so we fall back on PARTIAL_TRANSACTION_MERCHANT
// When creating a new expense, newMerchant can be blank so we fall back on PARTIAL_TRANSACTION_MERCHANT
IOU.updateMoneyRequestMerchant(transactionID, reportID, newMerchant || CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, policy, policyTags, policyCategories);
}
navigateBack();
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/IOUUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('IOUUtils', () => {
});
});

test('Submitting expense offline in a different currency will show the pending conversion message', () => {
test('Submitting an expense offline in a different currency will show the pending conversion message', () => {
const iouReport = ReportUtils.buildOptimisticIOUReport(1, 2, 100, '1', 'USD');
const usdPendingTransaction = TransactionUtils.buildOptimisticTransaction(100, 'USD', iouReport.reportID);
const aedPendingTransaction = TransactionUtils.buildOptimisticTransaction(100, 'AED', iouReport.reportID);
Expand All @@ -34,12 +34,12 @@ describe('IOUUtils', () => {
MergeQueries[`${ONYXKEYS.COLLECTION.TRANSACTION}${aedPendingTransaction.transactionID}`] = aedPendingTransaction;

return Onyx.mergeCollection(ONYXKEYS.COLLECTION.TRANSACTION, MergeQueries).then(() => {
// We submitted expense offline in a different currency, we don't know the total of the iouReport until we're back online
// We submitted an expense offline in a different currency, we don't know the total of the iouReport until we're back online
expect(IOUUtils.isIOUReportPendingCurrencyConversion(iouReport)).toBe(true);
});
});

test('Submitting expense online in a different currency will not show the pending conversion message', () => {
test('Submitting an expense online in a different currency will not show the pending conversion message', () => {
const iouReport = ReportUtils.buildOptimisticIOUReport(2, 3, 100, '1', 'USD');
const usdPendingTransaction = TransactionUtils.buildOptimisticTransaction(100, 'USD', iouReport.reportID);
const aedPendingTransaction = TransactionUtils.buildOptimisticTransaction(100, 'AED', iouReport.reportID);
Expand All @@ -55,7 +55,7 @@ describe('IOUUtils', () => {
};

return Onyx.mergeCollection(ONYXKEYS.COLLECTION.TRANSACTION, MergeQueries).then(() => {
// We submitted expense online in a different currency, we know the iouReport total and there's no need to show the pending conversion message
// We submitted an expense online in a different currency, we know the iouReport total and there's no need to show the pending conversion message
expect(IOUUtils.isIOUReportPendingCurrencyConversion(iouReport)).toBe(false);
});
});
Expand Down

0 comments on commit c7cd851

Please sign in to comment.