Skip to content

Commit 24d28d6

Browse files
Merge branch 'main' into chore/eslint-config-expensify-2.0.100
2 parents a65d1cb + 90a58c4 commit 24d28d6

14 files changed

Lines changed: 95 additions & 79 deletions

File tree

Mobile-Expensify

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ android {
114114
minSdkVersion rootProject.ext.minSdkVersion
115115
targetSdkVersion rootProject.ext.targetSdkVersion
116116
multiDexEnabled rootProject.ext.multiDexEnabled
117-
versionCode 1009026501
118-
versionName "9.2.65-1"
117+
versionCode 1009026504
118+
versionName "9.2.65-4"
119119
// Supported language variants must be declared here to avoid from being removed during the compilation.
120120
// This also helps us to not include unnecessary language variants in the APK.
121121
resConfigs "en", "es"

ios/NewExpensify/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</dict>
4545
</array>
4646
<key>CFBundleVersion</key>
47-
<string>9.2.65.1</string>
47+
<string>9.2.65.4</string>
4848
<key>FullStory</key>
4949
<dict>
5050
<key>OrgId</key>

ios/NotificationServiceExtension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleShortVersionString</key>
1414
<string>9.2.65</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.2.65.1</string>
16+
<string>9.2.65.4</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionPointIdentifier</key>

ios/ShareViewController/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleShortVersionString</key>
1414
<string>9.2.65</string>
1515
<key>CFBundleVersion</key>
16-
<string>9.2.65.1</string>
16+
<string>9.2.65.4</string>
1717
<key>NSExtension</key>
1818
<dict>
1919
<key>NSExtensionAttributes</key>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "9.2.65-1",
3+
"version": "9.2.65-4",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",

src/CONST/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ const CONST = {
16491649
TRIE_INITIALIZATION: 'trie_initialization',
16501650
COMMENT_LENGTH_DEBOUNCE_TIME: 1500,
16511651
SEARCH_OPTION_LIST_DEBOUNCE_TIME: 300,
1652-
MENTION_SUGGESTION_DEBOUNCE_TIME: 100,
1652+
SUGGESTION_DEBOUNCE_TIME: 100,
16531653
RESIZE_DEBOUNCE_TIME: 100,
16541654
UNREAD_UPDATE_DEBOUNCE_TIME: 300,
16551655
SEARCH_FILTER_OPTIONS: 'search_filter_options',

src/components/MoneyRequestConfirmationList.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import blurActiveElement from '@libs/Accessibility/blurActiveElement';
1717
import {
1818
adjustRemainingSplitShares,
1919
computePerDiemExpenseAmount,
20+
isValidPerDiemExpenseAmount,
2021
resetSplitShares,
2122
setCustomUnitRateID,
2223
setIndividualShare,
@@ -926,6 +927,13 @@ function MoneyRequestConfirmationList({
926927
return;
927928
}
928929

930+
if (isPerDiemRequest) {
931+
if (!isValidPerDiemExpenseAmount(transaction.comment?.customUnit ?? {}, iouCurrencyCode)) {
932+
setFormError('iou.error.invalidQuantity');
933+
return;
934+
}
935+
}
936+
929937
if (isEditingSplitBill && areRequiredFieldsEmpty(transaction)) {
930938
setDidConfirmSplit(true);
931939
setFormError('iou.error.genericSmartscanFailureMessage');

src/components/Search/SearchPageHeader/SearchFiltersBar.tsx

Lines changed: 28 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import {emailSelector} from '@selectors/Session';
44
import {searchResultsErrorSelector} from '@selectors/Snapshot';
55
import React, {useCallback, useContext, useEffect, useMemo, useRef} from 'react';
66
import type {ReactNode} from 'react';
7-
import {FlatList, View} from 'react-native';
7+
import {View} from 'react-native';
8+
// eslint-disable-next-line no-restricted-imports
9+
import type {ScrollView as RNScrollView} from 'react-native';
810
import Button from '@components/Button';
911
import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu';
1012
import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types';
@@ -13,6 +15,7 @@ import {KYCWallContext} from '@components/KYCWall/KYCWallContext';
1315
import type {PaymentMethodType} from '@components/KYCWall/types';
1416
import {LockedAccountContext} from '@components/LockedAccountModalProvider';
1517
import {usePersonalDetails} from '@components/OnyxListItemProvider';
18+
import ScrollView from '@components/ScrollView';
1619
import type {SearchDateValues} from '@components/Search/FilterComponents/DatePresetFilterBase';
1720
import DateSelectPopup from '@components/Search/FilterDropdowns/DateSelectPopup';
1821
import type {PopoverComponentProps} from '@components/Search/FilterDropdowns/DropdownButton';
@@ -45,7 +48,6 @@ import {getActiveAdminWorkspaces, getAllTaxRates, isPaidGroupPolicy} from '@libs
4548
import {isExpenseReport} from '@libs/ReportUtils';
4649
import {buildFilterFormValuesFromQuery, buildQueryStringFromFilterFormValues, isFilterSupported, isSearchDatePreset} from '@libs/SearchQueryUtils';
4750
import {getDatePresets, getFeedOptions, getGroupByOptions, getGroupCurrencyOptions, getHasOptions, getStatusOptions, getTypeOptions, getWithdrawalTypeOptions} from '@libs/SearchUIUtils';
48-
import shouldAdjustScroll from '@libs/shouldAdjustScroll';
4951
import CONST from '@src/CONST';
5052
import type {TranslationPaths} from '@src/languages/types';
5153
import ONYXKEYS from '@src/ONYXKEYS';
@@ -84,7 +86,7 @@ function SearchFiltersBar({
8486
latestBankItems,
8587
}: SearchFiltersBarProps) {
8688
const isFocused = useIsFocused();
87-
const scrollRef = useRef<FlatList<FilterItem>>(null);
89+
const scrollRef = useRef<RNScrollView>(null);
8890
const currentPolicy = usePolicy(currentSelectedPolicyID);
8991
const [isUserValidated] = useOnyx(ONYXKEYS.ACCOUNT, {selector: isUserValidatedSelector, canBeMissing: true});
9092
// type, groupBy and status values are not guaranteed to respect the ts type as they come from user input
@@ -732,60 +734,6 @@ function SearchFiltersBar({
732734
});
733735
}, [filterFormValues, filters, typeFiltersKeys]);
734736

735-
const prevFiltersLength = useRef(0);
736-
737-
useEffect(() => {
738-
return () => {
739-
prevFiltersLength.current = filters.length;
740-
};
741-
}, [filters.length]);
742-
743-
const adjustScroll = useCallback(() => {
744-
// Workaround for a known React Native bug on Android (https://github.com/facebook/react-native/issues/27504):
745-
// When the FlatList is scrolled to the end and the last item is changed, a blank space is left behind.
746-
// To fix this, we detect when onEndReached is triggered due to an item deletion,
747-
// and programmatically scroll to the end to fill the space.
748-
if (!shouldAdjustScroll) {
749-
return;
750-
}
751-
prevFiltersLength.current = filters.length;
752-
scrollRef.current?.scrollToEnd();
753-
}, [filters.length]);
754-
755-
const renderFilterItem = useCallback(
756-
// eslint-disable-next-line react/no-unused-prop-types
757-
({item}: {item: FilterItem}) => (
758-
<DropdownButton
759-
label={item.label}
760-
value={item.value}
761-
PopoverComponent={item.PopoverComponent}
762-
/>
763-
),
764-
[],
765-
);
766-
767-
const filterButtonText = useMemo(
768-
() => translate('search.filtersHeader') + (hiddenSelectedFilters.length > 0 ? ` (${hiddenSelectedFilters.length})` : ''),
769-
[translate, hiddenSelectedFilters.length],
770-
);
771-
772-
const renderListFooter = useCallback(
773-
() => (
774-
<Button
775-
link
776-
small
777-
shouldUseDefaultHover={false}
778-
text={filterButtonText}
779-
iconFill={theme.link}
780-
iconHoverFill={theme.linkHover}
781-
icon={expensifyIcons.Filter}
782-
textStyles={[styles.textMicroBold]}
783-
onPress={openAdvancedFilters}
784-
/>
785-
),
786-
[filterButtonText, theme.link, theme.linkHover, styles.textMicroBold, openAdvancedFilters, expensifyIcons],
787-
);
788-
789737
if (hasErrors) {
790738
return null;
791739
}
@@ -851,20 +799,35 @@ function SearchFiltersBar({
851799
)}
852800
</KYCWall>
853801
) : (
854-
<FlatList
802+
<ScrollView
855803
horizontal
856804
keyboardShouldPersistTaps="always"
857805
style={[styles.flexRow, styles.overflowScroll, styles.flexGrow0]}
858806
contentContainerStyle={[styles.flexRow, styles.flexGrow0, styles.gap2, styles.ph5]}
859807
ref={scrollRef}
860808
showsHorizontalScrollIndicator={false}
861-
data={filters}
862-
keyExtractor={(item) => item.label}
863-
renderItem={renderFilterItem}
864-
ListFooterComponent={renderListFooter}
865-
onEndReached={adjustScroll}
866-
onEndReachedThreshold={0.75}
867-
/>
809+
>
810+
{filters.map((filter) => (
811+
<DropdownButton
812+
key={filter.label}
813+
label={filter.label}
814+
value={filter.value}
815+
PopoverComponent={filter.PopoverComponent}
816+
/>
817+
))}
818+
819+
<Button
820+
link
821+
small
822+
shouldUseDefaultHover={false}
823+
text={translate('search.filtersHeader') + (hiddenSelectedFilters.length > 0 ? ` (${hiddenSelectedFilters.length})` : '')}
824+
iconFill={theme.link}
825+
iconHoverFill={theme.linkHover}
826+
icon={expensifyIcons.Filter}
827+
textStyles={[styles.textMicroBold]}
828+
onPress={openAdvancedFilters}
829+
/>
830+
</ScrollView>
868831
)}
869832
</View>
870833
);

0 commit comments

Comments
 (0)