Skip to content

Commit 4c417bc

Browse files
authored
Temporarily revert #9439 multi-currency v2 (#9468)
1 parent 30a1d96 commit 4c417bc

File tree

204 files changed

+1365
-1927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+1365
-1927
lines changed

changelog/multi-currency-v2

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: dev
3+
Comment: Revert "Decoupled Multi-currency module from gateway dependencies."
4+
5+

client/additional-methods-setup/upe-preview-methods-selector/add-payment-methods-task.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import PaymentMethodCheckbox from '../../components/payment-methods-checkboxes/p
3636
import { LoadableBlock } from '../../components/loadable';
3737
import LoadableSettingsSection from '../../settings/loadable-settings-section';
3838
import CurrencyInformationForMethods from './currency-information-for-methods';
39-
import { getMissingCurrenciesTooltipMessage } from 'multi-currency/interface/functions';
39+
import { getMissingCurrenciesTooltipMessage } from 'wcpay/multi-currency/missing-currencies-message';
4040
import { upeCapabilityStatuses, upeMethods } from '../constants';
4141
import paymentMethodsMap from '../../payment-methods-map';
4242
import ConfirmPaymentMethodActivationModal from 'wcpay/settings/payment-methods-list/activation-modal';

client/additional-methods-setup/upe-preview-methods-selector/currency-information-for-methods.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import interpolateComponents from '@automattic/interpolate-components';
99
/**
1010
* Internal dependencies
1111
*/
12-
import { useAccountDomesticCurrency } from '../../data';
1312
import {
13+
useAccountDomesticCurrency,
1414
useCurrencies,
1515
useEnabledCurrencies,
16-
} from 'multi-currency/interface/data';
16+
} from '../../data';
1717
import WCPaySettingsContext from '../../settings/wcpay-settings-context';
1818
import InlineNotice from 'components/inline-notice';
1919
import PaymentMethodsMap from '../../payment-methods-map';

client/additional-methods-setup/upe-preview-methods-selector/test/add-payment-methods-task.test.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,25 @@ import {
2222
useEnabledPaymentMethodIds,
2323
useGetPaymentMethodStatuses,
2424
useSettings,
25+
useCurrencies,
26+
useEnabledCurrencies,
2527
useManualCapture,
2628
useAccountDomesticCurrency,
2729
} from '../../../data';
28-
import {
29-
useCurrencies,
30-
useEnabledCurrencies,
31-
} from 'multi-currency/interface/data';
32-
3330
import WCPaySettingsContext from '../../../settings/wcpay-settings-context';
3431
import { upeCapabilityStatuses } from 'wcpay/additional-methods-setup/constants';
3532

3633
jest.mock( '../../../data', () => ( {
3734
useGetAvailablePaymentMethodIds: jest.fn(),
3835
useEnabledPaymentMethodIds: jest.fn(),
3936
useSettings: jest.fn(),
37+
useCurrencies: jest.fn(),
38+
useEnabledCurrencies: jest.fn(),
4039
useGetPaymentMethodStatuses: jest.fn(),
4140
useManualCapture: jest.fn(),
4241
useAccountDomesticCurrency: jest.fn(),
4342
} ) );
4443

45-
jest.mock( 'multi-currency/interface/data', () => ( {
46-
useCurrencies: jest.fn(),
47-
useEnabledCurrencies: jest.fn(),
48-
} ) );
49-
5044
jest.mock( '@wordpress/a11y', () => ( {
5145
...jest.requireActual( '@wordpress/a11y' ),
5246
speak: jest.fn(),

client/additional-methods-setup/upe-preview-methods-selector/test/currency-information-for-methods.test.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,18 @@ import { render, screen } from '@testing-library/react';
77
/**
88
* Internal dependencies
99
*/
10-
import { useAccountDomesticCurrency } from '../../../data';
1110
import {
1211
useCurrencies,
1312
useEnabledCurrencies,
14-
} from 'multi-currency/interface/data';
13+
useAccountDomesticCurrency,
14+
} from 'wcpay/data';
1515
import CurrencyInformationForMethods from '../currency-information-for-methods';
1616
import WCPaySettingsContext from '../../../settings/wcpay-settings-context';
1717

18-
jest.mock( '../../../data', () => ( {
19-
useAccountDomesticCurrency: jest.fn(),
20-
} ) );
21-
22-
jest.mock( 'multi-currency/interface/data', () => ( {
18+
jest.mock( 'wcpay/data', () => ( {
2319
useCurrencies: jest.fn(),
2420
useEnabledCurrencies: jest.fn(),
21+
useAccountDomesticCurrency: jest.fn(),
2522
} ) );
2623

2724
jest.mock( '@wordpress/a11y', () => ( {

client/additional-methods-setup/wizard/task-item.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ import { Icon, check } from '@wordpress/icons';
1111
import WizardTaskContext from './task/context';
1212
import './task-item.scss';
1313

14-
const WizardTaskItem = ( {
15-
children,
16-
title,
17-
index,
18-
className,
19-
visibleDescription,
20-
} ) => {
14+
const WizardTaskItem = ( { children, title, index, className } ) => {
2115
const { isCompleted, isActive } = useContext( WizardTaskContext );
2216

2317
return (
@@ -45,16 +39,6 @@ const WizardTaskItem = ( {
4539
</div>
4640
<span className="wcpay-wizard-task__title">{ title }</span>
4741
</div>
48-
{ visibleDescription && ! isActive && (
49-
<span
50-
className={ classNames(
51-
'wcpay-wizard-task__visible-description-element',
52-
'is-muted-color'
53-
) }
54-
>
55-
{ visibleDescription }
56-
</span>
57-
) }
5842
<div className="wcpay-wizard-task__body">{ children }</div>
5943
</li>
6044
);

client/additional-methods-setup/wizard/task-item.scss

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,6 @@
117117
}
118118
}
119119

120-
&__visible-description-element {
121-
position: absolute;
122-
margin-left: 40px;
123-
margin-top: 0;
124-
margin-bottom: 1em;
125-
126-
&.is-muted-color {
127-
color: $gray-700;
128-
}
129-
130-
.components-external-link svg {
131-
width: 1em;
132-
height: 1em;
133-
}
134-
}
135-
136120
.add-payment-methods-task {
137121
&__payment-selector {
138122
&-wrapper {

client/capital/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ import Page from 'components/page';
1515
import { TestModeNotice } from 'components/test-mode-notice';
1616
import ErrorBoundary from 'components/error-boundary';
1717
import ActiveLoanSummary from 'components/active-loan-summary';
18-
import {
19-
formatExplicitCurrency,
20-
isZeroDecimalCurrency,
21-
} from 'multi-currency/interface/functions';
18+
import { formatExplicitCurrency, isZeroDecimalCurrency } from 'utils/currency';
2219
import { CapitalLoan } from 'data/capital/types';
2320
import ClickableCell from 'components/clickable-cell';
2421
import Chip from 'components/chip';

client/checkout/woopay/email-input-iframe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import { buildAjaxURL } from 'utils/express-checkout';
99
import { getAppearance } from 'checkout/upe-styles';
1010
import {
1111
getTargetElement,
12+
getAppearanceType,
1213
validateEmail,
1314
appendRedirectionParams,
1415
shouldSkipWooPay,
1516
deleteSkipWooPayCookie,
1617
} from './utils';
17-
import { getAppearanceType } from '../utils';
1818

1919
export const handleWooPayEmailInput = async (
2020
field,

0 commit comments

Comments
 (0)