Skip to content

Commit

Permalink
Remove CSV export language modal from transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagesh Pai committed Dec 19, 2024
1 parent dffbf9c commit 590e0ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 35 deletions.
37 changes: 2 additions & 35 deletions client/transactions/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ import ClickableCell from 'components/clickable-cell';
import { getDetailsURL } from 'components/details-link';
import { displayType } from 'transactions/strings';
import { depositStatusLabels } from 'deposits/strings';
import {
formatStringValue,
isExportModalDismissed,
isDefaultSiteLanguage,
applyThousandSeparator,
} from 'wcpay/utils';
import { formatStringValue, applyThousandSeparator } from 'wcpay/utils';
import {
formatCurrency,
formatExplicitCurrency,
Expand All @@ -59,7 +54,6 @@ import TransactionsFilters from '../filters';
import Page from '../../components/page';
import { recordEvent } from 'tracks';
import DownloadButton from 'components/download-button';
import CSVExportModal from 'components/csv-export-modal';
import { getTransactionsCSV } from '../../data/transactions/resolvers';
import p24BankList from '../../payment-details/payment-method/p24/bank-list';
import { HoverTooltip } from 'components/tooltip';
Expand Down Expand Up @@ -311,8 +305,6 @@ export const TransactionsList = (
isLoading: isSummaryLoading,
} = useTransactionsSummary( getQuery(), props.depositId ?? '' );

const [ isCSVExportModalOpen, setCSVExportModalOpen ] = useState( false );

const columnsToDisplay = useMemo(
() =>
getColumns(
Expand Down Expand Up @@ -714,11 +706,7 @@ export const TransactionsList = (
} );

if ( 'endpoint' === downloadType ) {
if ( ! isDefaultSiteLanguage() && ! isExportModalDismissed() ) {
setCSVExportModalOpen( true );
} else {
endpointExport();
}
endpointExport();
} else {
const columnsToDisplayInCsv = columnsToDisplay.map( ( column ) => {
if ( column.labelInCsv ) {
Expand Down Expand Up @@ -802,16 +790,6 @@ export const TransactionsList = (
}
}

const closeModal = () => {
setCSVExportModalOpen( false );
};

const exportTransactions = () => {
endpointExport();

closeModal();
};

const showFilters = ! props.depositId;
const storeCurrencies =
transactionsSummary.store_currencies ||
Expand Down Expand Up @@ -862,17 +840,6 @@ export const TransactionsList = (
),
] }
/>

{ ! isDefaultSiteLanguage() &&
! isExportModalDismissed() &&
isCSVExportModalOpen && (
<CSVExportModal
onClose={ closeModal }
onSubmit={ exportTransactions }
totalItems={ totalRows }
exportType={ 'transactions' }
/>
) }
</Page>
);
};
Expand Down
4 changes: 4 additions & 0 deletions client/transactions/list/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ declare const global: {
reporting?: {
exportModalDismissed: boolean;
};
locale: {
code: string;
};
};
};

Expand Down Expand Up @@ -243,6 +246,7 @@ describe( 'Transactions list', () => {
reporting: {
exportModalDismissed: true,
},
locale: { code: 'en' },
};
} );

Expand Down

0 comments on commit 590e0ec

Please sign in to comment.