From dffbf9c9a8a9cac3a80e821041e8e2ae41c882ab Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Thu, 19 Dec 2024 17:56:04 +0530 Subject: [PATCH 01/15] Transactions - set site settings language for export --- client/transactions/list/index.tsx | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/client/transactions/list/index.tsx b/client/transactions/list/index.tsx index a5206ae0e5e..867a49db98d 100644 --- a/client/transactions/list/index.tsx +++ b/client/transactions/list/index.tsx @@ -31,11 +31,7 @@ import apiFetch from '@wordpress/api-fetch'; /** * Internal dependencies */ -import { - useTransactions, - useTransactionsSummary, - useReportingExportLanguage, -} from 'data/index'; +import { useTransactions, useTransactionsSummary } from 'data/index'; import { Transaction } from 'data/transactions/hooks'; import OrderLink from 'components/order-link'; import RiskLevel, { calculateRiskMapping } from 'components/risk-level'; @@ -46,7 +42,6 @@ import { depositStatusLabels } from 'deposits/strings'; import { formatStringValue, isExportModalDismissed, - getExportLanguage, isDefaultSiteLanguage, applyThousandSeparator, } from 'wcpay/utils'; @@ -69,7 +64,6 @@ import { getTransactionsCSV } from '../../data/transactions/resolvers'; import p24BankList from '../../payment-details/payment-method/p24/bank-list'; import { HoverTooltip } from 'components/tooltip'; import { PAYMENT_METHOD_TITLES } from 'wcpay/constants/payment-method'; -import { ReportingExportLanguageHook } from 'wcpay/settings/reporting-settings/interfaces'; interface TransactionsListProps { depositId?: string; @@ -319,10 +313,6 @@ export const TransactionsList = ( const [ isCSVExportModalOpen, setCSVExportModalOpen ] = useState( false ); - const [ - exportLanguage, - ] = useReportingExportLanguage() as ReportingExportLanguageHook; - const columnsToDisplay = useMemo( () => getColumns( @@ -601,13 +591,13 @@ export const TransactionsList = ( const downloadable = !! rows.length; - const endpointExport = async ( language: string ) => { + const endpointExport = async () => { // We destructure page and path to get the right params. // eslint-disable-next-line @typescript-eslint/no-unused-vars const { page, path, ...params } = getQuery(); const userEmail = wcpaySettings.currentUserEmail; - const locale = getExportLanguage( language, exportLanguage ); + const locale = wcpaySettings.locale.code; const { date_after: dateAfter, date_before: dateBefore, @@ -727,7 +717,7 @@ export const TransactionsList = ( if ( ! isDefaultSiteLanguage() && ! isExportModalDismissed() ) { setCSVExportModalOpen( true ); } else { - endpointExport( '' ); + endpointExport(); } } else { const columnsToDisplayInCsv = columnsToDisplay.map( ( column ) => { @@ -816,8 +806,8 @@ export const TransactionsList = ( setCSVExportModalOpen( false ); }; - const exportTransactions = ( language: string ) => { - endpointExport( language ); + const exportTransactions = () => { + endpointExport(); closeModal(); }; From 590e0ec16f00d2593ba844f34a42983948a8bc41 Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Thu, 19 Dec 2024 19:13:31 +0530 Subject: [PATCH 02/15] 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' }, }; } ); From 81d858956914b33ddbddb92522221ca9ba5271f7 Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Thu, 19 Dec 2024 20:15:15 +0530 Subject: [PATCH 03/15] Deposits - set site language for CSV exports --- client/deposits/list/index.tsx | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/client/deposits/list/index.tsx b/client/deposits/list/index.tsx index 1ac643d31dc..1b299ddf0d1 100644 --- a/client/deposits/list/index.tsx +++ b/client/deposits/list/index.tsx @@ -25,7 +25,6 @@ import { parseInt } from 'lodash'; */ import type { DepositsTableHeader } from 'wcpay/types/deposits'; import { useDeposits, useDepositsSummary } from 'wcpay/data'; -import { useReportingExportLanguage } from 'data/index'; import { displayType, depositStatusLabels } from '../strings'; import { formatExplicitCurrency, @@ -39,13 +38,8 @@ import DownloadButton from 'components/download-button'; import { getDepositsCSV } from 'wcpay/data/deposits/resolvers'; import { applyThousandSeparator } from '../../utils/index.js'; import DepositStatusChip from 'components/deposit-status-chip'; -import { - isExportModalDismissed, - getExportLanguage, - isDefaultSiteLanguage, -} from 'utils'; +import { isExportModalDismissed, isDefaultSiteLanguage } from 'utils'; import CSVExportModal from 'components/csv-export-modal'; -import { ReportingExportLanguageHook } from 'wcpay/settings/reporting-settings/interfaces'; import './style.scss'; @@ -105,10 +99,6 @@ const getColumns = ( sortByDate?: boolean ): DepositsTableHeader[] => [ ]; export const DepositsList = (): JSX.Element => { - const [ - exportLanguage, - ] = useReportingExportLanguage() as ReportingExportLanguageHook; - const [ isDownloading, setIsDownloading ] = useState( false ); const { createNotice } = useDispatch( 'core/notices' ); const { deposits, isLoading } = useDeposits( getQuery() ); @@ -225,12 +215,12 @@ export const DepositsList = (): JSX.Element => { const downloadable = !! rows.length; - const endpointExport = async ( language: string ) => { + const endpointExport = async () => { // We destructure page and path to get the right params. // eslint-disable-next-line @typescript-eslint/no-unused-vars const { page, path, ...params } = getQuery(); const userEmail = wcpaySettings.currentUserEmail; - const locale = getExportLanguage( language, exportLanguage ); + const locale = wcpaySettings.locale.code; const { date_before: dateBefore, @@ -318,7 +308,7 @@ export const DepositsList = (): JSX.Element => { if ( ! isDefaultSiteLanguage() && ! isExportModalDismissed() ) { setCSVExportModalOpen( true ); } else { - endpointExport( '' ); + endpointExport(); } } else { const params = getQuery(); @@ -363,8 +353,8 @@ export const DepositsList = (): JSX.Element => { setCSVExportModalOpen( false ); }; - const exportDeposits = ( language: string ) => { - endpointExport( language ); + const exportDeposits = () => { + endpointExport(); closeModal(); }; From cc07f509120501f6199704f9a467b2329018f14e Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Thu, 19 Dec 2024 20:26:44 +0530 Subject: [PATCH 04/15] Payouts - remove language modal code --- client/deposits/list/index.tsx | 30 +---------------------------- client/deposits/list/test/index.tsx | 2 ++ 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/client/deposits/list/index.tsx b/client/deposits/list/index.tsx index 1b299ddf0d1..0b1f54479fb 100644 --- a/client/deposits/list/index.tsx +++ b/client/deposits/list/index.tsx @@ -38,8 +38,6 @@ import DownloadButton from 'components/download-button'; import { getDepositsCSV } from 'wcpay/data/deposits/resolvers'; import { applyThousandSeparator } from '../../utils/index.js'; import DepositStatusChip from 'components/deposit-status-chip'; -import { isExportModalDismissed, isDefaultSiteLanguage } from 'utils'; -import CSVExportModal from 'components/csv-export-modal'; import './style.scss'; @@ -106,8 +104,6 @@ export const DepositsList = (): JSX.Element => { getQuery() ); - const [ isCSVExportModalOpen, setCSVExportModalOpen ] = useState( false ); - const sortByDate = ! getQuery().orderby || 'date' === getQuery().orderby; const columns = useMemo( () => getColumns( sortByDate ), [ sortByDate ] ); const totalRows = depositsSummary.count || 0; @@ -305,11 +301,7 @@ export const DepositsList = (): JSX.Element => { const downloadType = totalRows > rows.length ? 'endpoint' : 'browser'; if ( 'endpoint' === downloadType ) { - if ( ! isDefaultSiteLanguage() && ! isExportModalDismissed() ) { - setCSVExportModalOpen( true ); - } else { - endpointExport(); - } + endpointExport(); } else { const params = getQuery(); @@ -349,16 +341,6 @@ export const DepositsList = (): JSX.Element => { setIsDownloading( false ); }; - const closeModal = () => { - setCSVExportModalOpen( false ); - }; - - const exportDeposits = () => { - endpointExport(); - - closeModal(); - }; - return ( @@ -383,16 +365,6 @@ export const DepositsList = (): JSX.Element => { ), ] } /> - { ! isDefaultSiteLanguage() && - ! isExportModalDismissed() && - isCSVExportModalOpen && ( - - ) } ); }; diff --git a/client/deposits/list/test/index.tsx b/client/deposits/list/test/index.tsx index 8eb1c3b9f78..f39047a10f9 100644 --- a/client/deposits/list/test/index.tsx +++ b/client/deposits/list/test/index.tsx @@ -88,6 +88,7 @@ declare const global: { reporting?: { exportModalDismissed: boolean; }; + locale: { code: string }; }; }; @@ -153,6 +154,7 @@ describe( 'Deposits list', () => { reporting: { exportModalDismissed: true, }, + locale: { code: 'en' }, }; } ); From 71db08e5631e24159fd337afcdc9bb35567d6fbb Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Thu, 19 Dec 2024 21:00:43 +0530 Subject: [PATCH 05/15] Disputes - Remove CSV language modal and set language to site settings --- client/deposits/list/test/index.tsx | 8 +++- client/disputes/index.tsx | 51 +++---------------------- client/disputes/test/index.tsx | 6 +++ client/transactions/list/test/index.tsx | 4 +- 4 files changed, 20 insertions(+), 49 deletions(-) diff --git a/client/deposits/list/test/index.tsx b/client/deposits/list/test/index.tsx index f39047a10f9..70c8af13f59 100644 --- a/client/deposits/list/test/index.tsx +++ b/client/deposits/list/test/index.tsx @@ -88,7 +88,9 @@ declare const global: { reporting?: { exportModalDismissed: boolean; }; - locale: { code: string }; + locale: { + code: string; + }; }; }; @@ -154,7 +156,9 @@ describe( 'Deposits list', () => { reporting: { exportModalDismissed: true, }, - locale: { code: 'en' }, + locale: { + code: 'en', + }, }; } ); diff --git a/client/disputes/index.tsx b/client/disputes/index.tsx index cdb85131f5d..0a54ecc945f 100644 --- a/client/disputes/index.tsx +++ b/client/disputes/index.tsx @@ -24,11 +24,7 @@ import NoticeOutlineIcon from 'gridicons/dist/notice-outline'; /** * Internal dependencies. */ -import { - useDisputes, - useDisputesSummary, - useReportingExportLanguage, -} from 'data/index'; +import { useDisputes, useDisputesSummary } from 'data/index'; import OrderLink from 'components/order-link'; import DisputeStatusChip from 'components/dispute-status-chip'; import ClickableCell from 'components/clickable-cell'; @@ -46,16 +42,9 @@ import DownloadButton from 'components/download-button'; import disputeStatusMapping from 'components/dispute-status-chip/mappings'; import { CachedDispute, DisputesTableHeader } from 'wcpay/types/disputes'; import { getDisputesCSV } from 'wcpay/data/disputes/resolvers'; -import { - applyThousandSeparator, - isExportModalDismissed, - getExportLanguage, - isDefaultSiteLanguage, -} from 'wcpay/utils'; +import { applyThousandSeparator } from 'wcpay/utils'; import { useSettings } from 'wcpay/data'; import { isAwaitingResponse } from 'wcpay/disputes/utils'; -import CSVExportModal from 'components/csv-export-modal'; -import { ReportingExportLanguageHook } from 'wcpay/settings/reporting-settings/interfaces'; import './style.scss'; @@ -219,12 +208,6 @@ export const DisputesList = (): JSX.Element => { getQuery() ); - const [ isCSVExportModalOpen, setCSVExportModalOpen ] = useState( false ); - - const [ - exportLanguage, - ] = useReportingExportLanguage() as ReportingExportLanguageHook; - const headers = getHeaders( getQuery().orderby ); const totalRows = disputesSummary.count || 0; @@ -360,13 +343,13 @@ export const DisputesList = (): JSX.Element => { const downloadable = !! rows.length; - const endpointExport = async ( language: string ) => { + const endpointExport = async () => { // We destructure page and path to get the right params. // eslint-disable-next-line @typescript-eslint/no-unused-vars const { page, path, ...params } = getQuery(); const userEmail = wcpaySettings.currentUserEmail; - const locale = getExportLanguage( language, exportLanguage ); + const locale = wcpaySettings.locale.code; const { date_before: dateBefore, date_after: dateAfter, @@ -450,11 +433,7 @@ export const DisputesList = (): JSX.Element => { const downloadType = totalRows > rows.length ? 'endpoint' : 'browser'; if ( 'endpoint' === downloadType ) { - if ( ! isDefaultSiteLanguage() && ! isExportModalDismissed() ) { - setCSVExportModalOpen( true ); - } else { - endpointExport( '' ); - } + endpointExport(); } else { const csvColumns = [ { @@ -541,16 +520,6 @@ export const DisputesList = (): JSX.Element => { disputesSummary.currencies || ( isCurrencyFiltered ? [ getQuery().store_currency_is ?? '' ] : [] ); - const closeModal = () => { - setCSVExportModalOpen( false ); - }; - - const exportDisputes = ( language: string ) => { - endpointExport( language ); - - closeModal(); - }; - return ( @@ -576,16 +545,6 @@ export const DisputesList = (): JSX.Element => { ), ] } /> - { ! isDefaultSiteLanguage() && - ! isExportModalDismissed() && - isCSVExportModalOpen && ( - - ) } ); }; diff --git a/client/disputes/test/index.tsx b/client/disputes/test/index.tsx index 1409bfc852d..eb163062512 100644 --- a/client/disputes/test/index.tsx +++ b/client/disputes/test/index.tsx @@ -100,6 +100,9 @@ declare const global: { reporting?: { exportModalDismissed: boolean; }; + locale: { + code: string; + }; }; }; @@ -198,6 +201,9 @@ describe( 'Disputes list', () => { reporting: { exportModalDismissed: true, }, + locale: { + code: 'en', + }, }; } ); diff --git a/client/transactions/list/test/index.tsx b/client/transactions/list/test/index.tsx index 80cf368e5c3..b6e38c2ab4b 100644 --- a/client/transactions/list/test/index.tsx +++ b/client/transactions/list/test/index.tsx @@ -246,7 +246,9 @@ describe( 'Transactions list', () => { reporting: { exportModalDismissed: true, }, - locale: { code: 'en' }, + locale: { + code: 'en', + }, }; } ); From 17c26ef4a504d7aab66ad9f104b239574ee4e264 Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Thu, 19 Dec 2024 21:59:58 +0530 Subject: [PATCH 06/15] Fix TS declaration --- client/deposits/list/index.tsx | 32 ++++++++++++++++---------------- client/disputes/index.tsx | 32 ++++++++++++++++---------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/client/deposits/list/index.tsx b/client/deposits/list/index.tsx index 0b1f54479fb..dc1e555a98c 100644 --- a/client/deposits/list/index.tsx +++ b/client/deposits/list/index.tsx @@ -251,22 +251,22 @@ export const DepositsList = (): JSX.Element => { window.confirm( confirmMessage ) ) { try { - const { exported_deposits: exportedDeposits } = await apiFetch( - { - path: getDepositsCSV( { - userEmail, - locale, - dateAfter, - dateBefore, - dateBetween, - match, - statusIs, - statusIsNot, - storeCurrencyIs, - } ), - method: 'POST', - } - ); + const { + exported_deposits: exportedDeposits, + }: { exported_deposits: number } = await apiFetch( { + path: getDepositsCSV( { + userEmail, + locale, + dateAfter, + dateBefore, + dateBetween, + match, + statusIs, + statusIsNot, + storeCurrencyIs, + } ), + method: 'POST', + } ); createNotice( 'success', diff --git a/client/disputes/index.tsx b/client/disputes/index.tsx index 0a54ecc945f..cdb82bacaaf 100644 --- a/client/disputes/index.tsx +++ b/client/disputes/index.tsx @@ -382,22 +382,22 @@ export const DisputesList = (): JSX.Element => { window.confirm( confirmMessage ) ) { try { - const { exported_disputes: exportedDisputes } = await apiFetch( - { - path: getDisputesCSV( { - userEmail, - locale, - dateAfter, - dateBefore, - dateBetween, - match, - filter, - statusIs, - statusIsNot, - } ), - method: 'POST', - } - ); + const { + exported_disputes: exportedDisputes, + }: { exported_disputes: number } = await apiFetch( { + path: getDisputesCSV( { + userEmail, + locale, + dateAfter, + dateBefore, + dateBetween, + match, + filter, + statusIs, + statusIsNot, + } ), + method: 'POST', + } ); createNotice( 'success', From 108786c33cb08e474686ea7a71ae31584497da90 Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Thu, 19 Dec 2024 22:14:23 +0530 Subject: [PATCH 07/15] Remove CSV Export modal component --- client/components/csv-export-modal/index.tsx | 227 ------------------ .../components/csv-export-modal/styles.scss | 51 ---- .../test/__snapshots__/index.test.tsx.snap | 7 - .../csv-export-modal/test/index.test.tsx | 72 ------ 4 files changed, 357 deletions(-) delete mode 100644 client/components/csv-export-modal/index.tsx delete mode 100644 client/components/csv-export-modal/styles.scss delete mode 100644 client/components/csv-export-modal/test/__snapshots__/index.test.tsx.snap delete mode 100644 client/components/csv-export-modal/test/index.test.tsx diff --git a/client/components/csv-export-modal/index.tsx b/client/components/csv-export-modal/index.tsx deleted file mode 100644 index 2cddf0908ab..00000000000 --- a/client/components/csv-export-modal/index.tsx +++ /dev/null @@ -1,227 +0,0 @@ -/** @format */ -/** - * External dependencies - */ -import React, { useState } from 'react'; -import { __ } from '@wordpress/i18n'; -import { - Button, - SelectControl, - CheckboxControl, - ExternalLink, -} from '@wordpress/components'; -import interpolateComponents from '@automattic/interpolate-components'; -import { useDispatch } from '@wordpress/data'; -import DomainsIcon from 'gridicons/dist/domains'; - -/** - * Internal dependencies - */ -import { ReportingExportLanguageHook } from 'wcpay/settings/reporting-settings/interfaces'; -import { useReportingExportLanguage, useSettings } from 'wcpay/data'; -import ConfirmationModal from 'wcpay/components/confirmation-modal'; -import { getAdminUrl, getExportLanguageOptions } from 'wcpay/utils'; -import './styles.scss'; - -interface CSVExportModalProps { - totalItems: number; - exportType: 'transactions' | 'deposits' | 'disputes'; - onClose: () => void; - onSubmit: ( language: string ) => void; -} - -interface SettingsHook { - isSaving: boolean; - isLoading: boolean; - saveSettings: () => void; -} - -const CVSExportModal: React.FunctionComponent< CSVExportModalProps > = ( { - totalItems, - exportType, - onClose, - onSubmit, -} ) => { - const { updateOptions } = useDispatch( 'wc/admin/options' ); - const { saveSettings } = useSettings() as SettingsHook; - - const [ - exportLanguage, - updateExportLanguage, - ] = useReportingExportLanguage() as ReportingExportLanguageHook; - - const [ modalLanguage, setModalLanguage ] = useState( exportLanguage ); - const [ modalRemember, setModalRemember ] = useState( true ); - - const onDownload = async () => { - onSubmit( modalLanguage ); - - // If the Remember checkbox is checked, dismiss the modal. - if ( modalRemember ) { - await updateOptions( { - wcpay_reporting_export_modal_dismissed: modalRemember, - } ); - - updateExportLanguage( modalLanguage ); - saveSettings(); - - wcpaySettings.reporting.exportModalDismissed = true; - } - }; - - const buttonContent = ( - <> - - - - ); - - const getModalTitle = ( type: string ): string => { - switch ( type ) { - case 'transactions': - return __( - 'Export transactions report', - 'woocommerce-payments' - ); - case 'deposits': - return __( 'Export deposits report', 'woocommerce-payments' ); - case 'disputes': - return __( 'Export disputes report', 'woocommerce-payments' ); - default: - return __( 'Export report', 'woocommerce-payments' ); - } - }; - - const getExportNumberText = ( type: string ): string => { - switch ( type ) { - case 'transactions': - return __( - 'Exporting {{total/}} transactions…', - 'woocommerce-payments' - ); - case 'deposits': - return __( - 'Exporting {{total/}} deposits…', - 'woocommerce-payments' - ); - case 'disputes': - return __( - 'Exporting {{total/}} disputes…', - 'woocommerce-payments' - ); - default: - return __( - 'Exporting {{total/}} rows…', - 'woocommerce-payments' - ); - } - }; - - const getExportLabel = ( type: string ): string => { - switch ( type ) { - case 'transactions': - return __( - 'Export transactions report in', - 'woocommerce-payments' - ); - case 'deposits': - return __( - 'Export deposits report in', - 'woocommerce-payments' - ); - case 'disputes': - return __( - 'Export disputes report in', - 'woocommerce-payments' - ); - default: - return __( 'Export report in', 'woocommerce-payments' ); - } - }; - - const handleExportLanguageChange = ( language: string ) => { - setModalLanguage( language ); - }; - - const handleExportLanguageRememberChange = ( value: boolean ) => { - setModalRemember( value ); - }; - - return ( - { - return false; - } } - > -
- { interpolateComponents( { - mixedString: getExportNumberText( exportType ), - components: { - total: { totalItems }, - }, - } ) } -
- -
-

Settings

- -
-
- - - { getExportLabel( exportType ) } - -
-
- -
-
- -
- - ), - }, - } ) } - checked={ modalRemember } - onChange={ handleExportLanguageRememberChange } - data-testid="export-modal-remember" - /> -
-
-
- ); -}; - -export default CVSExportModal; diff --git a/client/components/csv-export-modal/styles.scss b/client/components/csv-export-modal/styles.scss deleted file mode 100644 index 600a6d2a18a..00000000000 --- a/client/components/csv-export-modal/styles.scss +++ /dev/null @@ -1,51 +0,0 @@ -.reporting-export-modal { - .components-modal__header { - border-bottom: 1px solid #dcdcde !important; - } - - .wcpay-confirmation-modal__footer { - .is-secondary { - box-shadow: none; - } - } - - &__items-number { - border-bottom: 1px solid #dcdcde; - padding: 15px 0; - } - - &__settings { - @include breakpoint( '>660px' ) { - min-width: 500px; - } - - &--language { - display: flex; - flex-wrap: wrap; - } - - &--language-label { - flex: 1 1 200px; - display: flex; - - .domains-icon { - width: 16px; - margin: 7px 0; - } - - .export-label { - padding: 10px 0 0 8px; - } - } - - &--language-select { - flex: 1 1 200px; - } - - &--remember { - p { - padding-top: 0 !important; - } - } - } -} diff --git a/client/components/csv-export-modal/test/__snapshots__/index.test.tsx.snap b/client/components/csv-export-modal/test/__snapshots__/index.test.tsx.snap deleted file mode 100644 index 251b5f8438f..00000000000 --- a/client/components/csv-export-modal/test/__snapshots__/index.test.tsx.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`RefundModal it renders correctly 1`] = ` -