Skip to content
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 1009019910
versionName "9.1.99-10"
versionCode 1009019911
versionName "9.1.99-11"
// 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.99.10</string>
<string>9.1.99.11</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.99</string>
<key>CFBundleVersion</key>
<string>9.1.99.10</string>
<string>9.1.99.11</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.99</string>
<key>CFBundleVersion</key>
<string>9.1.99.10</string>
<string>9.1.99.11</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.99-10",
"version": "9.1.99-11",
"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
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,8 @@ function TransactionGroupListItem<TItem extends ListItem>({

useSyncFocus(pressableRef, !!isFocused, shouldSyncFocus);

const pendingAction =
(item.pendingAction ?? (groupItem.transactions.length > 0 && groupItem.transactions.every((transaction) => transaction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)))
? CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE
: undefined;

return (
<OfflineWithFeedback pendingAction={pendingAction}>
<OfflineWithFeedback pendingAction={item.pendingAction}>
<PressableWithFeedback
ref={pressableRef}
onLongPress={onLongPress}
Expand Down Expand Up @@ -209,11 +204,9 @@ function TransactionGroupListItem<TItem extends ListItem>({
</View>
) : (
groupItem.transactions.map((transaction) => (
<OfflineWithFeedback
<TransactionItemRow
key={transaction.transactionID}
pendingAction={transaction.pendingAction}
>
<TransactionItemRow

report={transaction.report}
transactionItem={transaction}
isSelected={!!transaction.isSelected}
Expand All @@ -232,7 +225,7 @@ function TransactionGroupListItem<TItem extends ListItem>({
isReportItemChild
isInSingleTransactionReport={groupItem.transactions.length === 1}
/>
</OfflineWithFeedback>

))
)}
</View>
Expand Down
6 changes: 1 addition & 5 deletions src/libs/SearchUIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1717,11 +1717,7 @@ function getSortedReportActionData(data: ReportActionListItemType[], localeCompa
* Checks if the search results contain any data, useful for determining if the search results are empty.
*/
function isSearchResultsEmpty(searchResults: SearchResults) {
return !Object.keys(searchResults?.data).some(
(key) =>
key.startsWith(ONYXKEYS.COLLECTION.TRANSACTION) &&
(searchResults?.data[key as keyof typeof searchResults.data] as SearchTransaction)?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
return !Object.keys(searchResults?.data).some((key) => key.startsWith(ONYXKEYS.COLLECTION.TRANSACTION));
}

/**
Expand Down
27 changes: 2 additions & 25 deletions src/libs/actions/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,31 +497,8 @@ function unholdMoneyRequestOnSearch(hash: number, transactionIDList: string[]) {
}

function deleteMoneyRequestOnSearch(hash: number, transactionIDList: string[]) {
const {optimisticData: loadingOptimisticData, finallyData} = getOnyxLoadingData(hash);
const optimisticData: OnyxUpdate[] = [
...loadingOptimisticData,
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
value: {
data: Object.fromEntries(
transactionIDList.map((transactionID) => [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE}]),
) as Partial<SearchTransaction>,
},
},
];
const failureData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`,
value: {
data: Object.fromEntries(
transactionIDList.map((transactionID) => [`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {pendingAction: null}]),
) as Partial<SearchTransaction>,
},
},
];
API.write(WRITE_COMMANDS.DELETE_MONEY_REQUEST_ON_SEARCH, {hash, transactionIDList}, {optimisticData, failureData, finallyData});
const {optimisticData, finallyData} = getOnyxLoadingData(hash);
API.write(WRITE_COMMANDS.DELETE_MONEY_REQUEST_ON_SEARCH, {hash, transactionIDList}, {optimisticData, finallyData});
}

type Params = Record<string, ExportSearchItemsToCSVParams>;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,11 @@ function SearchPage({route}: SearchPageProps) {
}

setIsDeleteExpensesConfirmModalVisible(false);
deleteMoneyRequestOnSearch(hash, selectedTransactionsKeys);

// Translations copy for delete modal depends on amount of selected items,
// We need to wait for modal to fully disappear before clearing them to avoid translation flicker between singular vs plural
InteractionManager.runAfterInteractions(() => {
deleteMoneyRequestOnSearch(hash, selectedTransactionsKeys);
clearSelectedTransactions();
});
};
Expand Down
61 changes: 0 additions & 61 deletions tests/unit/Search/SearchUIUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2157,67 +2157,6 @@ describe('SearchUIUtils', () => {
});
});

describe('Test isSearchResultsEmpty', () => {
it('should return true when all transactions have delete pending action', () => {
const results: OnyxTypes.SearchResults = {
data: {
personalDetailsList: {},
// eslint-disable-next-line @typescript-eslint/naming-convention
transactions_1805965960759424086: {
accountID: 2074551,
amount: 0,
canDelete: false,
canHold: true,
canUnhold: false,
category: 'Employee Meals Remote (Fringe Benefit)',
action: 'approve',
allActions: ['approve'],
comment: {
comment: '',
},
created: '2025-05-26',
currency: 'USD',
hasEReceipt: false,
isFromOneTransactionReport: true,
managerID: adminAccountID,
merchant: '(none)',
modifiedAmount: -1000,
modifiedCreated: '2025-05-22',
modifiedCurrency: 'USD',
modifiedMerchant: 'Costco Wholesale',
parentTransactionID: '',
policyID: '137DA25D273F2423',
receipt: {
source: 'https://www.expensify.com/receipts/fake.jpg',
state: CONST.IOU.RECEIPT_STATE.SCAN_COMPLETE,
},
reportID: '6523565988285061',
reportType: 'expense',
tag: '',
transactionID: '1805965960759424086',
transactionThreadReportID: '4139222832581831',
transactionType: 'cash',
pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
},
},
search: {
type: 'expense',
status: CONST.SEARCH.STATUS.EXPENSE.ALL,
offset: 0,
hasMoreResults: false,
hasResults: true,
isLoading: false,
columnsToShow: {
shouldShowCategoryColumn: true,
shouldShowTagColumn: true,
shouldShowTaxColumn: true,
},
},
};
expect(SearchUIUtils.isSearchResultsEmpty(results)).toBe(true);
});
});

test('Should show `View` to overlimit approver', () => {
Onyx.merge(ONYXKEYS.SESSION, {accountID: overlimitApproverAccountID});
searchResults.data[`policy_${policyID}`].role = CONST.POLICY.ROLE.USER;
Expand Down
Loading