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 1009018919
versionName "9.1.89-19"
versionCode 1009018920
versionName "9.1.89-20"
// 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.89.19</string>
<string>9.1.89.20</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.89</string>
<key>CFBundleVersion</key>
<string>9.1.89.19</string>
<string>9.1.89.20</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.89</string>
<key>CFBundleVersion</key>
<string>9.1.89.19</string>
<string>9.1.89.20</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.89-19",
"version": "9.1.89-20",
"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: 0 additions & 4 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,6 @@ const CONST = {
RECEIPT: 'receipt',
DATE: 'date',
MERCHANT: 'merchant',
DESCRIPTION: 'description',
FROM: 'from',
TO: 'to',
CATEGORY: 'category',
Expand Down Expand Up @@ -6471,9 +6470,6 @@ const CONST = {
UNAPPROVED_CASH: 'unapprovedCash',
UNAPPROVED_CARD: 'unapprovedCard',
},
ANIMATION: {
FADE_DURATION: 200,
},
},

EXPENSE: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ type ColumnConfig = {
isColumnSortable?: boolean;
};

const shouldShowColumnConfig: Record<SortableColumnName, (isIOUReport: boolean) => boolean> = {
[CONST.SEARCH.TABLE_COLUMNS.RECEIPT]: () => true,
[CONST.SEARCH.TABLE_COLUMNS.TYPE]: () => true,
[CONST.SEARCH.TABLE_COLUMNS.DATE]: () => true,
[CONST.SEARCH.TABLE_COLUMNS.MERCHANT]: () => true,
[CONST.SEARCH.TABLE_COLUMNS.CATEGORY]: (isIOUReport) => !isIOUReport,
[CONST.SEARCH.TABLE_COLUMNS.TAG]: (isIOUReport) => !isIOUReport,
[CONST.REPORT.TRANSACTION_LIST.COLUMNS.COMMENTS]: () => true,
[CONST.SEARCH.TABLE_COLUMNS.TOTAL_AMOUNT]: () => true,
[CONST.SEARCH.TABLE_COLUMNS.IN]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.FROM]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.TO]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.DESCRIPTION]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.TAX_AMOUNT]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.ACTION]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.TITLE]: () => false,
[CONST.SEARCH.TABLE_COLUMNS.ASSIGNEE]: () => false,
};

const columnConfig: ColumnConfig[] = [
{
columnName: CONST.SEARCH.TABLE_COLUMNS.RECEIPT,
Expand All @@ -32,10 +51,6 @@ const columnConfig: ColumnConfig[] = [
columnName: CONST.SEARCH.TABLE_COLUMNS.MERCHANT,
translationKey: 'common.merchant',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.DESCRIPTION,
translationKey: 'common.description',
},
{
columnName: CONST.SEARCH.TABLE_COLUMNS.CATEGORY,
translationKey: 'common.category',
Expand Down Expand Up @@ -63,19 +78,22 @@ type SearchTableHeaderProps = {
amountColumnSize: TableColumnSize;
taxAmountColumnSize: TableColumnSize;
shouldShowSorting: boolean;
columns: SortableColumnName[];
isIOUReport: boolean;
};

function MoneyRequestReportTableHeader({sortBy, sortOrder, onSortPress, dateColumnSize, shouldShowSorting, amountColumnSize, taxAmountColumnSize, columns}: SearchTableHeaderProps) {
function MoneyRequestReportTableHeader({sortBy, sortOrder, onSortPress, dateColumnSize, shouldShowSorting, isIOUReport, amountColumnSize, taxAmountColumnSize}: SearchTableHeaderProps) {
const styles = useThemeStyles();

const shouldShowColumn = useCallback(
(columnName: SortableColumnName) => {
return columns.includes(columnName);
const shouldShowFun = shouldShowColumnConfig[columnName];
if (!shouldShowFun) {
return false;
}
return shouldShowFun(isIOUReport);
},
[columns],
[isIOUReport],
);

return (
<View style={[styles.dFlex, styles.flex5]}>
<SortableTableHeader
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, {useEffect, useRef} from 'react';
import type {View} from 'react-native';
import type {ValueOf} from 'type-fest';
import {getButtonRole} from '@components/Button/utils';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import {PressableWithFeedback} from '@components/Pressable';
import type {TableColumnSize} from '@components/Search/types';
import type {SortableColumnName} from '@components/SelectionList/types';
import TransactionItemRow from '@components/TransactionItemRow';
import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle';
import useLocalize from '@hooks/useLocalize';
Expand All @@ -20,6 +18,17 @@ import CONST from '@src/CONST';
import type {Report} from '@src/types/onyx';
import type {TransactionWithOptionalHighlight} from './MoneyRequestReportTransactionList';

const allReportColumns = [
CONST.REPORT.TRANSACTION_LIST.COLUMNS.RECEIPT,
CONST.REPORT.TRANSACTION_LIST.COLUMNS.TYPE,
CONST.REPORT.TRANSACTION_LIST.COLUMNS.DATE,
CONST.REPORT.TRANSACTION_LIST.COLUMNS.MERCHANT,
CONST.REPORT.TRANSACTION_LIST.COLUMNS.CATEGORY,
CONST.REPORT.TRANSACTION_LIST.COLUMNS.TAG,
CONST.REPORT.TRANSACTION_LIST.COLUMNS.COMMENTS,
CONST.REPORT.TRANSACTION_LIST.COLUMNS.TOTAL_AMOUNT,
];

type MoneyRequestReportTransactionItemProps = {
/** The transaction that is being displayed */
transaction: TransactionWithOptionalHighlight;
Expand Down Expand Up @@ -51,16 +60,12 @@ type MoneyRequestReportTransactionItemProps = {
/** The size of the tax amount column */
taxAmountColumnSize: TableColumnSize;

/** Columns to show */
columns: SortableColumnName[];

/** Callback function that scrolls to this transaction in case it is newly added */
scrollToNewTransaction?: (offset: number) => void;
};

function MoneyRequestReportTransactionItem({
transaction,
columns,
report,
isSelectionModeEnabled,
toggleTransaction,
Expand Down Expand Up @@ -133,7 +138,7 @@ function MoneyRequestReportTransactionItem({
shouldUseNarrowLayout={shouldUseNarrowLayout || isMediumScreenWidth}
shouldShowCheckbox={!!isSelectionModeEnabled || !isSmallScreenWidth}
onCheckboxPress={toggleTransaction}
columns={columns as Array<ValueOf<typeof CONST.REPORT.TRANSACTION_LIST.COLUMNS>>}
columns={allReportColumns}
isDisabled={isPendingDelete}
/>
</PressableWithFeedback>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import {convertToDisplayString} from '@libs/CurrencyUtils';
import {getThreadReportIDsForTransactions} from '@libs/MoneyRequestReportUtils';
import {navigationRef} from '@libs/Navigation/Navigation';
import {getIOUActionForTransactionID} from '@libs/ReportActionsUtils';
import {getMoneyRequestSpendBreakdown} from '@libs/ReportUtils';
import {compareValues, getColumnsToShow, isTransactionAmountTooLong, isTransactionTaxAmountTooLong} from '@libs/SearchUIUtils';
import {getMoneyRequestSpendBreakdown, isIOUReport} from '@libs/ReportUtils';
import {compareValues, isTransactionAmountTooLong, isTransactionTaxAmountTooLong} from '@libs/SearchUIUtils';
import {getTransactionPendingAction, isTransactionPendingDelete} from '@libs/TransactionUtils';
import shouldShowTransactionYear from '@libs/TransactionUtils/shouldShowTransactionYear';
import Navigation from '@navigation/Navigation';
Expand Down Expand Up @@ -160,11 +160,6 @@ function MoneyRequestReportTransactionList({
}));
}, [newTransactions, sortBy, sortOrder, transactions, localeCompare]);

const columnsToShow = useMemo(() => {
const columns = getColumnsToShow(transactions, true);
return (Object.keys(columns) as SortableColumnName[]).filter((column) => columns[column]);
}, [transactions]);

const navigateToTransaction = useCallback(
(activeTransactionID: string) => {
const iouAction = getIOUActionForTransactionID(reportActions, activeTransactionID);
Expand Down Expand Up @@ -267,7 +262,6 @@ function MoneyRequestReportTransactionList({
shouldShowSorting
sortBy={sortBy}
sortOrder={sortOrder}
columns={columnsToShow}
dateColumnSize={dateColumnSize}
amountColumnSize={amountColumnSize}
taxAmountColumnSize={taxAmountColumnSize}
Expand All @@ -278,6 +272,7 @@ function MoneyRequestReportTransactionList({

setSortConfig((prevState) => ({...prevState, sortBy: selectedSortBy, sortOrder: selectedSortOrder}));
}}
isIOUReport={isIOUReport(report)}
/>
)}
</View>
Expand All @@ -288,7 +283,6 @@ function MoneyRequestReportTransactionList({
<MoneyRequestReportTransactionItem
key={transaction.transactionID}
transaction={transaction}
columns={columnsToShow}
report={report}
isSelectionModeEnabled={isMobileSelectionModeEnabled}
toggleTransaction={toggleTransaction}
Expand Down
17 changes: 2 additions & 15 deletions src/components/Search/SearchList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ import type ChatListItem from '@components/SelectionList/ChatListItem';
import type TaskListItem from '@components/SelectionList/Search/TaskListItem';
import type TransactionGroupListItem from '@components/SelectionList/Search/TransactionGroupListItem';
import type TransactionListItem from '@components/SelectionList/Search/TransactionListItem';
import type {
ExtendedTargetedEvent,
ReportActionListItemType,
SortableColumnName,
TaskListItemType,
TransactionGroupListItemType,
TransactionListItemType,
} from '@components/SelectionList/types';
import type {ExtendedTargetedEvent, ReportActionListItemType, TaskListItemType, TransactionGroupListItemType, TransactionListItemType} from '@components/SelectionList/types';
import Text from '@components/Text';
import useArrowKeyFocusManager from '@hooks/useArrowKeyFocusManager';
import useInitialWindowDimensions from '@hooks/useInitialWindowDimensions';
Expand Down Expand Up @@ -87,9 +80,6 @@ type SearchListProps = Pick<FlashListProps<SearchListItem>, 'onScroll' | 'conten
/** The search query */
queryJSON: SearchQueryJSON;

/** Columns to show */
columns: SortableColumnName[];

/** Called when the viewability of rows changes, as defined by the viewabilityConfig prop. */
onViewableItemsChanged?: (info: {changed: ViewToken[]; viewableItems: ViewToken[]}) => void;

Expand Down Expand Up @@ -134,7 +124,6 @@ function SearchList(
shouldPreventDefaultFocusOnSelectRow,
shouldPreventLongPressRow,
queryJSON,
columns,
onViewableItemsChanged,
onLayout,
estimatedItemSize = ITEM_HEIGHTS.NARROW_WITHOUT_DRAWER.STANDARD,
Expand Down Expand Up @@ -350,7 +339,6 @@ function SearchList(
}}
shouldPreventDefaultFocusOnSelectRow={shouldPreventDefaultFocusOnSelectRow}
queryJSONHash={hash}
columns={columns}
policies={policies}
isDisabled={isDisabled}
allReports={allReports}
Expand All @@ -371,7 +359,6 @@ function SearchList(
onCheckboxPress,
onSelectRow,
policies,
columns,
hash,
groupBy,
setFocusedIndex,
Expand Down Expand Up @@ -473,7 +460,7 @@ function SearchList(
onScroll={onScroll}
showsVerticalScrollIndicator={false}
ref={listRef}
extraData={[focusedIndex, isFocused, columns]}
extraData={[focusedIndex, isFocused]}
onEndReached={onEndReached}
onEndReachedThreshold={onEndReachedThreshold}
ListFooterComponent={ListFooterComponent}
Expand Down
Loading
Loading