Skip to content

🍒 Cherry pick PR #61765 to staging 🍒 #61811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Mobile-Expensify
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1009014305
versionName "9.1.43-5"
versionCode 1009014306
versionName "9.1.43-6"
// Supported language variants must be declared here to avoid from being removed during the compilation.
// This also helps us to not include unnecessary language variants in the APK.
resConfigs "en", "es"
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9.1.43.5</string>
<string>9.1.43.6</string>
<key>FullStory</key>
<dict>
<key>OrgId</key>
Expand Down
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>9.1.42</string>
<key>CFBundleVersion</key>
<string>9.1.43.5</string>
<string>9.1.43.6</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/ShareViewController/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleShortVersionString</key>
<string>9.1.42</string>
<key>CFBundleVersion</key>
<string>9.1.43.5</string>
<string>9.1.43.6</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</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": "9.1.43-5",
"version": "9.1.43-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
3 changes: 2 additions & 1 deletion src/components/SelectionListWithModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ function SelectionListWithModal<TItem extends ListItem>(
} else if (selectedItems.length === 0 && selectionMode?.isEnabled && !wasSelectionOnRef.current) {
turnOffMobileSelectionMode();
}
}, [sections, selectionMode, isSmallScreenWidth, isSelected, isFocused]);
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [sections, isSmallScreenWidth, isSelected, isFocused]);

useEffect(
() => () => {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/StringUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function normalizeAccents(text: string) {
* - trimming
*/
function normalize(text: string): string {
return removeInvisibleCharacters(sanitizeString(text))
return removeInvisibleCharacters(text)
.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, ' ') // space-like -> ' '
.replace(/\s+/g, ' ') // collapse spaces
.trim();
Expand Down
46 changes: 31 additions & 15 deletions src/pages/workspace/WorkspaceMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import DecisionModal from '@components/DecisionModal';
import {Download, FallbackAvatar, MakeAdmin, Plus, RemoveMembers, Table, User, UserEye} from '@components/Icon/Expensicons';
import {ReceiptWrangler} from '@components/Icon/Illustrations';
import MessagesRow from '@components/MessagesRow';
import ScrollView from '@components/ScrollView';
import SearchBar from '@components/SearchBar';
import TableListItem from '@components/SelectionList/TableListItem';
import type {ListItem, SelectionListHandle} from '@components/SelectionList/types';
Expand Down Expand Up @@ -513,13 +514,13 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
clearInviteDraft(route.params.policyID);
}, [invitedEmailsToAccountIDsDraft, isFocused, accountIDs, prevAccountIDs, route.params.policyID]);

const getHeaderMessage = () => {
const headerMessage = useMemo(() => {
if (isOfflineAndNoMemberDataAvailable) {
return translate('workspace.common.mustBeOnlineToViewMembers');
}

return !isLoading && isEmptyObject(policy?.employeeList) ? translate('workspace.common.memberNotFound') : '';
};
}, [isLoading, policy?.employeeList, translate, isOfflineAndNoMemberDataAvailable]);

const getHeaderContent = () => (
<View style={shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection}>
Expand Down Expand Up @@ -699,6 +700,8 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson

const selectionModeHeader = selectionMode?.isEnabled && shouldUseNarrowLayout;

const sections = useMemo(() => [{data: filteredData, isDisabled: false}], [filteredData]);

return (
<WorkspacePageWithSections
headerText={selectionModeHeader ? translate('common.selectMultiple') : translate('workspace.common.members')}
Expand All @@ -725,15 +728,6 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
{() => (
<>
{shouldUseNarrowLayout && <View style={[styles.pl5, styles.pr5]}>{getHeaderButtons()}</View>}
{shouldUseNarrowLayout ? <View style={[styles.pr5]}>{getHeaderContent()}</View> : getHeaderContent()}
{data.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
inputValue={inputValue}
onChangeText={setInputValue}
label={translate('workspace.people.findMember')}
shouldShowEmptyState={!filteredData.length}
/>
)}
<ConfirmModal
isVisible={isOfflineModalVisible}
onConfirm={() => setIsOfflineModalVisible(false)}
Expand Down Expand Up @@ -772,18 +766,40 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
isVisible={isDownloadFailureModalVisible}
onClose={() => setIsDownloadFailureModalVisible(false)}
/>
{!!filteredData.length && (
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={[styles.flexGrow1, styles.flexShrink0]}
>
{shouldUseNarrowLayout && filteredData.length > 0 && <View style={[styles.pr5]}>{getHeaderContent()}</View>}
{!shouldUseNarrowLayout && (
<>
{!!headerMessage && (
<View style={[styles.ph5, styles.pb5]}>
<Text style={[styles.textLabel, styles.colorMuted, styles.minHeight5]}>{headerMessage}</Text>
</View>
)}
{getHeaderContent()}
</>
)}
{data.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
inputValue={inputValue}
onChangeText={setInputValue}
label={translate('workspace.people.findMember')}
shouldShowEmptyState={!filteredData.length}
/>
)}
<View style={[styles.w100, styles.flex1]}>
<SelectionListWithModal
ref={selectionListRef}
canSelectMultiple={canSelectMultiple}
sections={[{data: filteredData, isDisabled: false}]}
sections={sections}
ListItem={TableListItem}
turnOnSelectionModeOnLongPress={isPolicyAdmin}
onTurnOnSelectionMode={(item) => item && toggleUser(item?.accountID)}
shouldUseUserSkeletonView
disableKeyboardShortcuts={removeMembersConfirmModalVisible}
headerMessage={getHeaderMessage()}
headerMessage={shouldUseNarrowLayout ? headerMessage : undefined}
onSelectRow={openMemberDetails}
shouldSingleExecuteRowSelect={!isPolicyAdmin}
onCheckboxPress={(item) => toggleUser(item.accountID)}
Expand All @@ -798,7 +814,7 @@ function WorkspaceMembersPage({personalDetails, route, policy, currentUserPerson
addBottomSafeAreaPadding
/>
</View>
)}
</ScrollView>
</>
)}
</WorkspacePageWithSections>
Expand Down
130 changes: 68 additions & 62 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {

useAutoTurnSelectionModeOffWhenHasNoActiveOption(filteredCategoryList);

const sections = useMemo(() => [{data: filteredCategoryList, isDisabled: false}], [filteredCategoryList]);

const toggleCategory = useCallback(
(category: PolicyOption) => {
setSelectedCategories((prev) => {
Expand Down Expand Up @@ -421,70 +423,74 @@ function WorkspaceCategoriesPage({route}: WorkspaceCategoriesPageProps) {
danger
/>
{shouldUseNarrowLayout && <View style={[styles.pl5, styles.pr5]}>{getHeaderButtons()}</View>}
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasSyncError && isConnectionVerified ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.categories.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`}
>
{`${currentConnectionName} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.categories.subtitle')}</Text>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={[styles.flexGrow1, styles.flexShrink0]}
>
<View style={[styles.ph5, styles.pb5, styles.pt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
{!hasSyncError && isConnectionVerified ? (
<Text>
<Text style={[styles.textNormal, styles.colorMuted]}>{`${translate('workspace.categories.importedFromAccountingSoftware')} `}</Text>
<TextLink
style={[styles.textNormal, styles.link]}
href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`}
>
{`${currentConnectionName} ${translate('workspace.accounting.settings')}`}
</TextLink>
<Text style={[styles.textNormal, styles.colorMuted]}>.</Text>
</Text>
) : (
<Text style={[styles.textNormal, styles.colorMuted]}>{translate('workspace.categories.subtitle')}</Text>
)}
</View>
{isLoading && (
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
style={[styles.flex1]}
color={theme.spinner}
/>
)}
</View>
{categoryList.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
label={translate('workspace.categories.findCategory')}
inputValue={inputValue}
onChangeText={setInputValue}
shouldShowEmptyState={hasVisibleCategories && !isLoading && filteredCategoryList.length === 0}
/>
)}
{isLoading && (
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
style={[styles.flex1]}
color={theme.spinner}
/>
)}
{!hasVisibleCategories && !isLoading && inputValue.length === 0 && (
<ScrollView contentContainerStyle={[styles.flexGrow1, styles.flexShrink0]}>
<EmptyStateComponent
SkeletonComponent={TableListItemSkeleton}
headerMediaType={CONST.EMPTY_STATE_MEDIA.ANIMATION}
headerMedia={LottieAnimations.GenericEmptyState}
title={translate('workspace.categories.emptyCategories.title')}
subtitle={translate('workspace.categories.emptyCategories.subtitle')}
headerStyles={[styles.emptyStateCardIllustrationContainer, styles.emptyFolderBG]}
lottieWebViewStyles={styles.emptyStateFolderWebStyles}
headerContentStyles={styles.emptyStateFolderWebStyles}
{categoryList.length > CONST.SEARCH_ITEM_LIMIT && (
<SearchBar
label={translate('workspace.categories.findCategory')}
inputValue={inputValue}
onChangeText={setInputValue}
shouldShowEmptyState={hasVisibleCategories && !isLoading && filteredCategoryList.length === 0}
/>
</ScrollView>
)}
{hasVisibleCategories && !isLoading && (
<SelectionListWithModal
canSelectMultiple={canSelectMultiple}
turnOnSelectionModeOnLongPress={isSmallScreenWidth}
onTurnOnSelectionMode={(item) => item && toggleCategory(item)}
sections={[{data: filteredCategoryList, isDisabled: false}]}
onCheckboxPress={toggleCategory}
onSelectRow={navigateToCategorySettings}
shouldPreventDefaultFocusOnSelectRow={!canUseTouchScreen()}
onSelectAll={toggleAllCategories}
ListItem={TableListItem}
onDismissError={dismissError}
customListHeader={getCustomListHeader()}
listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]}
showScrollIndicator={false}
addBottomSafeAreaPadding
/>
)}

)}
{hasVisibleCategories && !isLoading && (
<SelectionListWithModal
canSelectMultiple={canSelectMultiple}
turnOnSelectionModeOnLongPress={isSmallScreenWidth}
onTurnOnSelectionMode={(item) => item && toggleCategory(item)}
sections={sections}
onCheckboxPress={toggleCategory}
onSelectRow={navigateToCategorySettings}
shouldPreventDefaultFocusOnSelectRow={!canUseTouchScreen()}
onSelectAll={toggleAllCategories}
ListItem={TableListItem}
onDismissError={dismissError}
customListHeader={getCustomListHeader()}
listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]}
showScrollIndicator={false}
addBottomSafeAreaPadding
/>
)}
{!hasVisibleCategories && !isLoading && inputValue.length === 0 && (
<ScrollView contentContainerStyle={[styles.flexGrow1, styles.flexShrink0]}>
<EmptyStateComponent
SkeletonComponent={TableListItemSkeleton}
headerMediaType={CONST.EMPTY_STATE_MEDIA.ANIMATION}
headerMedia={LottieAnimations.GenericEmptyState}
title={translate('workspace.categories.emptyCategories.title')}
subtitle={translate('workspace.categories.emptyCategories.subtitle')}
headerStyles={[styles.emptyStateCardIllustrationContainer, styles.emptyFolderBG]}
lottieWebViewStyles={styles.emptyStateFolderWebStyles}
headerContentStyles={styles.emptyStateFolderWebStyles}
/>
</ScrollView>
)}
</ScrollView>
<ConfirmModal
isVisible={isOfflineModalVisible}
onConfirm={() => setIsOfflineModalVisible(false)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {useOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {PressableWithFeedback} from '@components/Pressable';
import ScrollView from '@components/ScrollView';
import SearchBar from '@components/SearchBar';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
Expand Down Expand Up @@ -119,7 +120,10 @@ function WorkspaceCompanyCardsList({cardsList, policyID, handleAssignCard, isDis
const isSearchEmpty = filteredSortedCards.length === 0 && inputValue.length > 0;

return (
<>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={[styles.flexGrow1, styles.flexShrink0]}
>
{allCards.length > 0 && (
<SearchBar
label={translate('workspace.companyCards.findCard')}
Expand All @@ -136,7 +140,7 @@ function WorkspaceCompanyCardsList({cardsList, policyID, handleAssignCard, isDis
ListHeaderComponent={!isSearchEmpty ? renderListHeader : null}
stickyHeaderIndices={[0]}
/>
</>
</ScrollView>
);
}

Expand Down
Loading
Loading