Skip to content

Commit

Permalink
Merge branch 'main' into fix/33362-is-loading-tbd
Browse files Browse the repository at this point in the history
  • Loading branch information
paultsimura committed Feb 6, 2024
2 parents 82bb06e + 331d776 commit 749a395
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001043704
versionName "1.4.37-4"
versionCode 1001043706
versionName "1.4.37-6"
}

flavorDimensions "default"
Expand Down
4 changes: 2 additions & 2 deletions docs/_data/_routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ platforms:
icon: /assets/images/accounting.svg
description: From setting up your account to ensuring you get the most out of Expensify’s suite of features, click here to get started on streamlining your expense management journey.

- href: account-settings
title: Account Settings
- href: settings
title: Settings
icon: /assets/images/gears.svg
description: Discover how to personalize your profile, add secondary logins, and grant delegated access to employees with our comprehensive guide on Account Settings.

Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.4.37.4</string>
<string>1.4.37.6</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.4.37.4</string>
<string>1.4.37.6</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion ios/NotificationServiceExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>1.4.37</string>
<key>CFBundleVersion</key>
<string>1.4.37.4</string>
<string>1.4.37.6</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.4.37-4",
"version": "1.4.37-6",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
Expand Down
10 changes: 4 additions & 6 deletions src/components/ValuePicker/ValueSelectorModal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, {useEffect, useState} from 'react';
import React, {useMemo} from 'react';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Modal from '@components/Modal';
import ScreenWrapper from '@components/ScreenWrapper';
Expand Down Expand Up @@ -42,11 +42,9 @@ const defaultProps = {

function ValueSelectorModal({items, selectedItem, label, isVisible, onClose, onItemSelected, shouldShowTooltips}) {
const styles = useThemeStyles();
const [sectionsData, setSectionsData] = useState([]);

useEffect(() => {
const sections = useMemo(() => {
const itemsData = _.map(items, (item) => ({value: item.value, alternateText: item.description, keyForList: item.value, text: item.label, isSelected: item === selectedItem}));
setSectionsData(itemsData);
return [{data: itemsData}];
}, [items, selectedItem]);

return (
Expand All @@ -69,7 +67,7 @@ function ValueSelectorModal({items, selectedItem, label, isVisible, onClose, onI
onBackButtonPress={onClose}
/>
<SelectionList
sections={[{data: sectionsData}]}
sections={sections}
onSelectRow={onItemSelected}
initiallyFocusedOptionKey={selectedItem.value}
shouldStopPropagation
Expand Down
2 changes: 0 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2320,8 +2320,6 @@ function getReportPreviewMessage(
return `${requestorName ? `${requestorName}: ` : ''}${Localize.translateLocal('iou.requestedAmount', {formattedAmount: amountToDisplay})}`;
}

const containsNonReimbursable = hasNonReimbursableTransactions(report.reportID);

return Localize.translateLocal(containsNonReimbursable ? 'iou.payerSpentAmount' : 'iou.payerOwesAmount', {payer: payerName ?? '', amount: formattedAmount});
}

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 @@ -3099,7 +3099,7 @@ function getSendMoneyParams(
paymentMethodType,
transactionID: optimisticTransaction.transactionID,
newIOUReportDetails,
createdReportActionID: isNewChat ? optimisticCreatedAction.reportActionID : '',
createdReportActionID: isNewChat ? optimisticCreatedAction.reportActionID : '0',
reportPreviewReportActionID: reportPreviewAction.reportActionID,
},
optimisticData,
Expand Down
23 changes: 14 additions & 9 deletions src/pages/ReimbursementAccount/ValidationStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ import TextLink from '@components/TextLink';
import withLocalize, {withLocalizePropTypes} from '@components/withLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import compose from '@libs/compose';
import * as CurrencyUtils from '@libs/CurrencyUtils';
import getPermittedDecimalSeparator from '@libs/getPermittedDecimalSeparator';
import BankAccount from '@libs/models/BankAccount';
import * as ValidationUtils from '@libs/ValidationUtils';
import withPolicy from '@pages/workspace/withPolicy';
import WorkspaceResetBankAccountModal from '@pages/workspace/WorkspaceResetBankAccountModal';
import * as BankAccounts from '@userActions/BankAccounts';
import * as Report from '@userActions/Report';
Expand Down Expand Up @@ -61,33 +64,34 @@ const defaultProps = {
* Any dollar amount (e.g. 1.12) will be returned as 112
*
* @param {String} amount field input
* @param {RegExp} amountRegex
* @returns {String}
*/
const filterInput = (amount) => {
const filterInput = (amount, amountRegex) => {
let value = amount ? amount.toString().trim() : '';
if (value === '' || _.isNaN(Number(value)) || !Math.abs(Str.fromUSDToNumber(value))) {
value = value.replace(/^0+|0+$/g, '');
if (value === '' || _.isNaN(Number(value)) || !Math.abs(Str.fromUSDToNumber(value)) || (amountRegex && !amountRegex.test(value))) {
return '';
}

// If the user enters the values in dollars, convert it to the respective cents amount
if (_.contains(value, '.')) {
value = Str.fromUSDToNumber(value);
}

return value;
};

function ValidationStep({reimbursementAccount, translate, onBackButtonPress, account, policyID}) {
function ValidationStep({reimbursementAccount, translate, onBackButtonPress, account, policyID, toLocaleDigit, policy}) {
const styles = useThemeStyles();
/**
* @param {Object} values - form input values passed by the Form component
* @returns {Object}
*/
const validate = (values) => {
const errors = {};
const decimalSeparator = toLocaleDigit('.');
const outputCurrency = lodashGet(policy, 'outputCurrency', CONST.CURRENCY.USD);

const amountRegex = RegExp(String.raw`^-?\d{0,8}([${getPermittedDecimalSeparator(decimalSeparator)}]\d{0,${CurrencyUtils.getCurrencyDecimals(outputCurrency)}})?$`, 'i');

_.each(values, (value, key) => {
const filteredValue = typeof value === 'string' ? filterInput(value) : value;
const filteredValue = typeof value === 'string' ? filterInput(value, amountRegex) : value;
if (ValidationUtils.isRequiredFulfilled(filteredValue)) {
return;
}
Expand Down Expand Up @@ -231,6 +235,7 @@ ValidationStep.displayName = 'ValidationStep';

export default compose(
withLocalize,
withPolicy,
withOnyx({
account: {
key: ONYXKEYS.ACCOUNT,
Expand Down

0 comments on commit 749a395

Please sign in to comment.