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 1009027807
versionName "9.2.78-7"
versionCode 1009027808
versionName "9.2.78-8"
// 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.2.78.7</string>
<string>9.2.78.8</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.2.78</string>
<key>CFBundleVersion</key>
<string>9.2.78.7</string>
<string>9.2.78.8</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.2.78</string>
<key>CFBundleVersion</key>
<string>9.2.78.7</string>
<string>9.2.78.8</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.2.78-7",
"version": "9.2.78-8",
"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
4 changes: 4 additions & 0 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function mapTransactionItemToSelectedEntry(
item.keyForList,
{
isSelected: true,
canDelete: item.canDelete,
canReject: canRejectRequest,
canHold: canHoldRequest,
isHeld: isOnHold(item),
Expand Down Expand Up @@ -198,6 +199,7 @@ function prepareTransactionsList(
...selectedTransactions,
[item.keyForList]: {
isSelected: true,
canDelete: item.canDelete,
canReject: canRejectRequest,
canHold: canHoldRequest,
isHeld: isOnHold(item),
Expand Down Expand Up @@ -541,6 +543,7 @@ function Search({
),
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
isSelected: areAllMatchingItemsSelected || selectedTransactions[transactionItem.transactionID]?.isSelected || isExpenseReportType,
canDelete: transactionItem.canDelete,
canReject: canRejectRequest,
reportID: transactionItem.reportID,
policyID: transactionItem.report?.policyID,
Expand Down Expand Up @@ -592,6 +595,7 @@ function Search({
),
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
isSelected: areAllMatchingItemsSelected || selectedTransactions[transactionItem.transactionID].isSelected,
canDelete: transactionItem.canDelete,
canReject: canRejectRequest,
reportID: transactionItem.reportID,
policyID: transactionItem.report?.policyID,
Expand Down
3 changes: 3 additions & 0 deletions src/components/Search/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ type SelectedTransactionInfo = {
/** Whether the transaction is selected */
isSelected: boolean;

/** If the transaction can be deleted */
canDelete: boolean;

/** If the transaction can be rejected */
canReject: boolean;

Expand Down
1 change: 1 addition & 0 deletions src/libs/SearchUIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2658,6 +2658,7 @@ function getTransactionFromTransactionListItem(item: TransactionListItemType): O
isTaxAmountColumnWide,
violations,
hash,
canDelete,
accountID,
policyID,
...transaction
Expand Down
34 changes: 7 additions & 27 deletions src/pages/Search/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ import {navigateToParticipantPage} from '@libs/IOUUtils';
import Navigation from '@libs/Navigation/Navigation';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
import type {SearchFullscreenNavigatorParamList} from '@libs/Navigation/types';
import {getActiveAdminWorkspaces, hasDynamicExternalWorkflow, hasOnlyPersonalPolicies as hasOnlyPersonalPoliciesUtil, hasVBBA, isPaidGroupPolicy} from '@libs/PolicyUtils';
import {getOriginalMessage, isMoneyRequestAction} from '@libs/ReportActionsUtils';
import {getActiveAdminWorkspaces, hasDynamicExternalWorkflow, hasOnlyPersonalPolicies as hasOnlyPersonalPoliciesUtil, isPaidGroupPolicy} from '@libs/PolicyUtils';
import {
canDeleteMoneyRequestReport,
generateReportID,
getPolicyExpenseChat,
getReportOrDraftReport,
Expand Down Expand Up @@ -671,24 +669,7 @@ function SearchPage({route}: SearchPageProps) {
});
}

const shouldShowDeleteOption =
!isOffline &&
selectedTransactionsKeys.every((id) => {
const transaction = currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${id}`];
if (!transaction) {
return false;
}
const parentReportID = transaction.reportID;
const parentReport = currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`];
if (!parentReport) {
return false;
}
const reportActions = currentSearchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReportID}`];
const parentReportAction = Object.values(reportActions ?? {}).find(
(action) => (isMoneyRequestAction(action) ? getOriginalMessage(action)?.IOUTransactionID : undefined) === transaction.transactionID,
);
return canDeleteMoneyRequestReport(parentReport, [transaction], parentReportAction ? [parentReportAction] : []);
});
const shouldShowDeleteOption = !isOffline && selectedTransactionsKeys.every((id) => selectedTransactions[id].canDelete);

if (shouldShowDeleteOption) {
options.push({
Expand Down Expand Up @@ -735,16 +716,15 @@ function SearchPage({route}: SearchPageProps) {
status,
hash,
selectedTransactions,
expensifyIcons,
translate,
areAllMatchingItemsSelected,
isOffline,
selectedReports,
queryJSON,
selectedTransactionReportIDs,
lastPaymentMethods,
selectedReportIDs,
allTransactions,
selectedTransactionReportIDs,
queryJSON,
selectedPolicyIDs,
policies,
integrationsExportTemplates,
Expand All @@ -754,14 +734,14 @@ function SearchPage({route}: SearchPageProps) {
dismissedRejectUseExplanation,
bulkPayButtonOptions,
onBulkPaySelected,
areAllTransactionsFromSubmitter,
dismissedHoldUseExplanation,
allReports,
currentSearchResults?.data,
theme.icon,
styles.colorMuted,
styles.fontWeightNormal,
styles.textWrap,
expensifyIcons,
dismissedHoldUseExplanation,
areAllTransactionsFromSubmitter,
]);

const handleDeleteExpenses = () => {
Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/SearchResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ type SearchTransaction = {
/** The transaction amount */
amount: number;

/** If the transaction can be deleted */
canDelete: boolean;

/** The edited transaction amount */
modifiedAmount: number;

Expand Down
1 change: 1 addition & 0 deletions tests/unit/MoneyRequestReportUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const transactionItemBaseMock: TransactionListItemType = {
policy: policyBaseMock,
reportAction: reportActionBaseMock,
holdReportAction: undefined,
canDelete: true,
cardID: undefined,
cardName: undefined,
category: '',
Expand Down
Loading
Loading