From 590e0ec16f00d2593ba844f34a42983948a8bc41 Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Thu, 19 Dec 2024 19:13:31 +0530 Subject: [PATCH] Remove CSV export language modal from transactions --- client/transactions/list/index.tsx | 37 ++----------------------- client/transactions/list/test/index.tsx | 4 +++ 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/client/transactions/list/index.tsx b/client/transactions/list/index.tsx index 867a49db98d..f56b7d0f084 100644 --- a/client/transactions/list/index.tsx +++ b/client/transactions/list/index.tsx @@ -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, @@ -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'; @@ -311,8 +305,6 @@ export const TransactionsList = ( isLoading: isSummaryLoading, } = useTransactionsSummary( getQuery(), props.depositId ?? '' ); - const [ isCSVExportModalOpen, setCSVExportModalOpen ] = useState( false ); - const columnsToDisplay = useMemo( () => getColumns( @@ -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 ) { @@ -802,16 +790,6 @@ export const TransactionsList = ( } } - const closeModal = () => { - setCSVExportModalOpen( false ); - }; - - const exportTransactions = () => { - endpointExport(); - - closeModal(); - }; - const showFilters = ! props.depositId; const storeCurrencies = transactionsSummary.store_currencies || @@ -862,17 +840,6 @@ export const TransactionsList = ( ), ] } /> - - { ! isDefaultSiteLanguage() && - ! isExportModalDismissed() && - isCSVExportModalOpen && ( - - ) } ); }; diff --git a/client/transactions/list/test/index.tsx b/client/transactions/list/test/index.tsx index b233b4d5477..80cf368e5c3 100644 --- a/client/transactions/list/test/index.tsx +++ b/client/transactions/list/test/index.tsx @@ -100,6 +100,9 @@ declare const global: { reporting?: { exportModalDismissed: boolean; }; + locale: { + code: string; + }; }; }; @@ -243,6 +246,7 @@ describe( 'Transactions list', () => { reporting: { exportModalDismissed: true, }, + locale: { code: 'en' }, }; } );