Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: moving JS constants around for reuse #9261

Merged
merged 5 commits into from
Aug 15, 2024
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
5 changes: 5 additions & 0 deletions changelog/chore-moving-constants-around
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: chore: moving JS constants around for reuse


Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { upeCapabilityStatuses, upeMethods } from '../constants';
import paymentMethodsMap from '../../payment-methods-map';
import ConfirmPaymentMethodActivationModal from 'wcpay/payment-methods/activation-modal';
import './add-payment-methods-task.scss';
import PAYMENT_METHOD_IDS from 'wcpay/payment-methods/constants';
import PAYMENT_METHOD_IDS from 'wcpay/constants/payment-method';

const usePaymentMethodsCheckboxState = () => {
// For UPE, the card payment method is required and always active.
Expand Down
2 changes: 1 addition & 1 deletion client/components/payment-method-details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Fragment } from 'react';
import './style.scss';
import p24BankList from '../../payment-details/payment-method/p24/bank-list';
import { HoverTooltip } from '../tooltip';
import { PAYMENT_METHOD_TITLES } from 'payment-methods/constants';
import { PAYMENT_METHOD_TITLES } from 'wcpay/constants/payment-method';
/**
*
* @param {Object} payment Payment charge object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react';
* Internal dependencies
*/
import { HoverTooltip } from 'components/tooltip';
import PAYMENT_METHOD_IDS from 'wcpay/payment-methods/constants';
import PAYMENT_METHOD_IDS from 'wcpay/constants/payment-method';

export const DocumentationUrlForDisabledPaymentMethod = {
DEFAULT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react';
/**
* Internal dependencies
*/
import PAYMENT_METHOD_IDS from 'wcpay/payment-methods/constants';
import PAYMENT_METHOD_IDS from 'wcpay/constants/payment-method';
import PaymentMethodDisabledTooltip, {
DocumentationUrlForDisabledPaymentMethod,
getDocumentationUrlForDisabledPaymentMethod,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion client/overview/task-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useCallback, useEffect, useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import { TIME } from '../../constants';
import { TIME } from 'wcpay/constants/time';

const TaskList = ( { overviewTasksVisibility, tasks } ) => {
const { createNotice } = useDispatch( 'core/notices' );
Expand Down
2 changes: 1 addition & 1 deletion client/payment-methods/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
useSelectedPaymentMethod,
useUnselectedPaymentMethod,
} from 'wcpay/data';
import PAYMENT_METHOD_IDS from './constants';
import PAYMENT_METHOD_IDS from 'wcpay/constants/payment-method';

import PaymentMethodsList from 'components/payment-methods-list';
import PaymentMethod from 'components/payment-methods-list/payment-method';
Expand Down
6 changes: 3 additions & 3 deletions client/transactions/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ import {
isExportModalDismissed,
getExportLanguage,
isDefaultSiteLanguage,
} from 'utils';
applyThousandSeparator,
} from 'wcpay/utils';
import {
formatCurrency,
formatExplicitCurrency,
Expand All @@ -66,9 +67,8 @@ 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 { applyThousandSeparator } from '../../utils/index.js';
import { HoverTooltip } from 'components/tooltip';
import { PAYMENT_METHOD_TITLES } from 'payment-methods/constants';
import { PAYMENT_METHOD_TITLES } from 'wcpay/constants/payment-method';
import { ReportingExportLanguageHook } from 'wcpay/settings/reporting-settings/interfaces';

interface TransactionsListProps {
Expand Down
Loading