Remove unpublished wc-admin-settings package and update getSetting usage (https://github.com/woocommerce/woocommerce-admin/pull/8057)
* Remove use of wc-admin-settings from packages * Move getSetting to getAdminSetting and remove wc-admin-settings package * Add changelog * Update package.json and remove last use of wc-admin-settings
This commit is contained in:
parent
0c028b4a87
commit
3998f88597
|
@ -5,6 +5,8 @@ module.exports = {
|
||||||
extends: [ 'plugin:@woocommerce/eslint-plugin/recommended' ],
|
extends: [ 'plugin:@woocommerce/eslint-plugin/recommended' ],
|
||||||
settings: {
|
settings: {
|
||||||
'import/resolver': 'typescript',
|
'import/resolver': 'typescript',
|
||||||
|
// List of modules that are externals in our webpack config.
|
||||||
|
'import/core-modules': [ '@woocommerce/settings', 'lodash', 'react' ],
|
||||||
react: {
|
react: {
|
||||||
pragma: 'createElement',
|
pragma: 'createElement',
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: Dev
|
||||||
|
|
||||||
|
Remove wc-admin-settings package and rename getSetting to getAdminSetting. #8057
|
|
@ -6,7 +6,7 @@ import { lazy, useState } from '@wordpress/element';
|
||||||
import { useDispatch, useSelect } from '@wordpress/data';
|
import { useDispatch, useSelect } from '@wordpress/data';
|
||||||
import { uniqueId, find } from 'lodash';
|
import { uniqueId, find } from 'lodash';
|
||||||
import { Icon, help as helpIcon, external } from '@wordpress/icons';
|
import { Icon, help as helpIcon, external } from '@wordpress/icons';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink, getSetting } from '@woocommerce/settings';
|
||||||
import { H, Section } from '@woocommerce/components';
|
import { H, Section } from '@woocommerce/components';
|
||||||
import {
|
import {
|
||||||
ONBOARDING_STORE_NAME,
|
ONBOARDING_STORE_NAME,
|
||||||
|
|
|
@ -6,12 +6,12 @@ import {
|
||||||
USER_STORE_NAME,
|
USER_STORE_NAME,
|
||||||
QUERY_DEFAULTS,
|
QUERY_DEFAULTS,
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { getUnreadNotesCount } from '~/inbox-panel/utils';
|
import { getUnreadNotesCount } from '~/inbox-panel/utils';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const UNREAD_NOTES_QUERY = {
|
const UNREAD_NOTES_QUERY = {
|
||||||
page: 1,
|
page: 1,
|
||||||
|
@ -55,5 +55,5 @@ export function isNotesPanelVisible( select ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLowStockCount() {
|
export function getLowStockCount() {
|
||||||
return getSetting( 'lowStockCount', 0 );
|
return getAdminSetting( 'lowStockCount', 0 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import { numberFormat } from '@woocommerce/number';
|
import { numberFormat } from '@woocommerce/number';
|
||||||
import CurrencyFactory from '@woocommerce/currency';
|
import CurrencyFactory from '@woocommerce/currency';
|
||||||
import { CURRENCY } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { Leaderboard } from '../';
|
import { Leaderboard } from '../';
|
||||||
import mockData from '../data/top-selling-products-mock-data';
|
import mockData from '../data/top-selling-products-mock-data';
|
||||||
|
import { CURRENCY } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const { formatAmount, formatDecimal } = CurrencyFactory( CURRENCY );
|
const { formatAmount, formatDecimal } = CurrencyFactory( CURRENCY );
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import PropTypes from 'prop-types';
|
||||||
import { omitBy, isUndefined, snakeCase } from 'lodash';
|
import { omitBy, isUndefined, snakeCase } from 'lodash';
|
||||||
import { withSelect, withDispatch } from '@wordpress/data';
|
import { withSelect, withDispatch } from '@wordpress/data';
|
||||||
import { ReportFilters as Filters } from '@woocommerce/components';
|
import { ReportFilters as Filters } from '@woocommerce/components';
|
||||||
import { LOCALE } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||||
import {
|
import {
|
||||||
getCurrentDates,
|
getCurrentDates,
|
||||||
|
@ -21,6 +20,7 @@ import { recordEvent } from '@woocommerce/tracks';
|
||||||
*/
|
*/
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
import { STORE_KEY as CES_STORE_KEY } from '../../../customer-effort-score-tracks/data/constants';
|
import { STORE_KEY as CES_STORE_KEY } from '../../../customer-effort-score-tracks/data/constants';
|
||||||
|
import { LOCALE } from '~/utils/admin-settings';
|
||||||
|
|
||||||
class ReportFilters extends Component {
|
class ReportFilters extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { map } from 'lodash';
|
||||||
import { Date, Link } from '@woocommerce/components';
|
import { Date, Link } from '@woocommerce/components';
|
||||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { defaultTableDateFormat } from '@woocommerce/date';
|
import { defaultTableDateFormat } from '@woocommerce/date';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,6 +14,7 @@ import { defaultTableDateFormat } from '@woocommerce/date';
|
||||||
*/
|
*/
|
||||||
import ReportTable from '../../components/report-table';
|
import ReportTable from '../../components/report-table';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
class CouponsReportTable extends Component {
|
class CouponsReportTable extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -66,7 +66,10 @@ class CouponsReportTable extends Component {
|
||||||
getRowsContent( coupons ) {
|
getRowsContent( coupons ) {
|
||||||
const { query } = this.props;
|
const { query } = this.props;
|
||||||
const persistedQuery = getPersistedQuery( query );
|
const persistedQuery = getPersistedQuery( query );
|
||||||
const dateFormat = getSetting( 'dateFormat', defaultTableDateFormat );
|
const dateFormat = getAdminSetting(
|
||||||
|
'dateFormat',
|
||||||
|
defaultTableDateFormat
|
||||||
|
);
|
||||||
const {
|
const {
|
||||||
formatAmount,
|
formatAmount,
|
||||||
formatDecimal: getCurrencyFormatDecimal,
|
formatDecimal: getCurrencyFormatDecimal,
|
||||||
|
|
|
@ -4,10 +4,9 @@
|
||||||
import { __, _x } from '@wordpress/i18n';
|
import { __, _x } from '@wordpress/i18n';
|
||||||
import { decodeEntities } from '@wordpress/html-entities';
|
import { decodeEntities } from '@wordpress/html-entities';
|
||||||
import { applyFilters } from '@wordpress/hooks';
|
import { applyFilters } from '@wordpress/hooks';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { NAMESPACE } from '@woocommerce/data';
|
import { NAMESPACE } from '@woocommerce/data';
|
||||||
|
|
||||||
const { countries } = getSetting( 'dataEndpoints', { countries: {} } );
|
const { countries } = getAdminSetting( 'dataEndpoints', { countries: {} } );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
@ -16,6 +15,7 @@ import {
|
||||||
getCustomerLabels,
|
getCustomerLabels,
|
||||||
getRequestByIdString,
|
getRequestByIdString,
|
||||||
} from '../../../lib/async-requests';
|
} from '../../../lib/async-requests';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const CUSTOMERS_REPORT_FILTERS_FILTER =
|
const CUSTOMERS_REPORT_FILTERS_FILTER =
|
||||||
'woocommerce_admin_customers_report_filters';
|
'woocommerce_admin_customers_report_filters';
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { Component, Fragment } from '@wordpress/element';
|
||||||
import { Tooltip } from '@wordpress/components';
|
import { Tooltip } from '@wordpress/components';
|
||||||
import { Date, Link } from '@woocommerce/components';
|
import { Date, Link } from '@woocommerce/components';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { defaultTableDateFormat } from '@woocommerce/date';
|
import { defaultTableDateFormat } from '@woocommerce/date';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,8 +14,9 @@ import { defaultTableDateFormat } from '@woocommerce/date';
|
||||||
*/
|
*/
|
||||||
import ReportTable from '../../components/report-table';
|
import ReportTable from '../../components/report-table';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const { countries } = getSetting( 'dataEndpoints', { countries: {} } );
|
const { countries } = getAdminSetting( 'dataEndpoints', { countries: {} } );
|
||||||
|
|
||||||
class CustomersReportTable extends Component {
|
class CustomersReportTable extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -109,7 +110,10 @@ class CustomersReportTable extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getRowsContent( customers ) {
|
getRowsContent( customers ) {
|
||||||
const dateFormat = getSetting( 'dateFormat', defaultTableDateFormat );
|
const dateFormat = getAdminSetting(
|
||||||
|
'dateFormat',
|
||||||
|
defaultTableDateFormat
|
||||||
|
);
|
||||||
const {
|
const {
|
||||||
formatAmount,
|
formatAmount,
|
||||||
formatDecimal: getCurrencyFormatDecimal,
|
formatDecimal: getCurrencyFormatDecimal,
|
||||||
|
|
|
@ -9,7 +9,7 @@ import moment from 'moment';
|
||||||
import { Date, Link } from '@woocommerce/components';
|
import { Date, Link } from '@woocommerce/components';
|
||||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { getCurrentDates, defaultTableDateFormat } from '@woocommerce/date';
|
import { getCurrentDates, defaultTableDateFormat } from '@woocommerce/date';
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import { getCurrentDates, defaultTableDateFormat } from '@woocommerce/date';
|
||||||
*/
|
*/
|
||||||
import ReportTable from '../../components/report-table';
|
import ReportTable from '../../components/report-table';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
class DownloadsReportTable extends Component {
|
class DownloadsReportTable extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -67,7 +68,10 @@ class DownloadsReportTable extends Component {
|
||||||
getRowsContent( downloads ) {
|
getRowsContent( downloads ) {
|
||||||
const { query } = this.props;
|
const { query } = this.props;
|
||||||
const persistedQuery = getPersistedQuery( query );
|
const persistedQuery = getPersistedQuery( query );
|
||||||
const dateFormat = getSetting( 'dateFormat', defaultTableDateFormat );
|
const dateFormat = getAdminSetting(
|
||||||
|
'dateFormat',
|
||||||
|
defaultTableDateFormat
|
||||||
|
);
|
||||||
|
|
||||||
return map( downloads, ( download ) => {
|
return map( downloads, ( download ) => {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -3,15 +3,12 @@
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { applyFilters } from '@wordpress/hooks';
|
import { applyFilters } from '@wordpress/hooks';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { lazy } from '@wordpress/element';
|
import { lazy } from '@wordpress/element';
|
||||||
|
|
||||||
const manageStock = getSetting( 'manageStock', 'no' );
|
|
||||||
const REPORTS_FILTER = 'woocommerce_admin_reports_list';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
const RevenueReport = lazy( () =>
|
const RevenueReport = lazy( () =>
|
||||||
import( /* webpackChunkName: "analytics-report-revenue" */ './revenue' )
|
import( /* webpackChunkName: "analytics-report-revenue" */ './revenue' )
|
||||||
);
|
);
|
||||||
|
@ -47,6 +44,9 @@ const CustomersReport = lazy( () =>
|
||||||
import( /* webpackChunkName: "analytics-report-customers" */ './customers' )
|
import( /* webpackChunkName: "analytics-report-customers" */ './customers' )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const manageStock = getAdminSetting( 'manageStock', 'no' );
|
||||||
|
const REPORTS_FILTER = 'woocommerce_admin_reports_list';
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const reports = [
|
const reports = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*/
|
*/
|
||||||
import { __, _x } from '@wordpress/i18n';
|
import { __, _x } from '@wordpress/i18n';
|
||||||
import { applyFilters } from '@wordpress/hooks';
|
import { applyFilters } from '@wordpress/hooks';
|
||||||
import { ORDER_STATUSES } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
@ -14,6 +13,7 @@ import {
|
||||||
getTaxRateLabels,
|
getTaxRateLabels,
|
||||||
getVariationLabels,
|
getVariationLabels,
|
||||||
} from '../../../lib/async-requests';
|
} from '../../../lib/async-requests';
|
||||||
|
import { ORDER_STATUSES } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const ORDERS_REPORT_CHARTS_FILTER = 'woocommerce_admin_orders_report_charts';
|
const ORDERS_REPORT_CHARTS_FILTER = 'woocommerce_admin_orders_report_charts';
|
||||||
const ORDERS_REPORT_FILTERS_FILTER = 'woocommerce_admin_orders_report_filters';
|
const ORDERS_REPORT_FILTERS_FILTER = 'woocommerce_admin_orders_report_filters';
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { Component, Fragment } from '@wordpress/element';
|
||||||
import { map } from 'lodash';
|
import { map } from 'lodash';
|
||||||
import { Date, Link, OrderStatus, ViewMoreList } from '@woocommerce/components';
|
import { Date, Link, OrderStatus, ViewMoreList } from '@woocommerce/components';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||||
import { defaultTableDateFormat } from '@woocommerce/date';
|
import { defaultTableDateFormat } from '@woocommerce/date';
|
||||||
|
|
||||||
|
@ -14,6 +13,7 @@ import { defaultTableDateFormat } from '@woocommerce/date';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import ReportTable from '../../components/report-table';
|
import ReportTable from '../../components/report-table';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
|
@ -108,7 +108,10 @@ class OrdersReportTable extends Component {
|
||||||
getRowsContent( tableData ) {
|
getRowsContent( tableData ) {
|
||||||
const { query } = this.props;
|
const { query } = this.props;
|
||||||
const persistedQuery = getPersistedQuery( query );
|
const persistedQuery = getPersistedQuery( query );
|
||||||
const dateFormat = getSetting( 'dateFormat', defaultTableDateFormat );
|
const dateFormat = getAdminSetting(
|
||||||
|
'dateFormat',
|
||||||
|
defaultTableDateFormat
|
||||||
|
);
|
||||||
const { render: renderCurrency, getCurrencyConfig } = this.context;
|
const { render: renderCurrency, getCurrencyConfig } = this.context;
|
||||||
|
|
||||||
return map( tableData, ( row ) => {
|
return map( tableData, ( row ) => {
|
||||||
|
@ -176,7 +179,10 @@ class OrdersReportTable extends Component {
|
||||||
<OrderStatus
|
<OrderStatus
|
||||||
className="woocommerce-orders-table__status"
|
className="woocommerce-orders-table__status"
|
||||||
order={ { status } }
|
order={ { status } }
|
||||||
orderStatusMap={ getSetting( 'orderStatuses', {} ) }
|
orderStatusMap={ getAdminSetting(
|
||||||
|
'orderStatuses',
|
||||||
|
{}
|
||||||
|
) }
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
value: status,
|
value: status,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { map } from 'lodash';
|
||||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||||
import { Link, Tag } from '@woocommerce/components';
|
import { Link, Tag } from '@woocommerce/components';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { ITEMS_STORE_NAME } from '@woocommerce/data';
|
import { ITEMS_STORE_NAME } from '@woocommerce/data';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,10 +20,12 @@ import CategoryBreacrumbs from '../categories/breadcrumbs';
|
||||||
import { isLowStock } from './utils';
|
import { isLowStock } from './utils';
|
||||||
import ReportTable from '../../components/report-table';
|
import ReportTable from '../../components/report-table';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
const manageStock = getSetting( 'manageStock', 'no' );
|
const manageStock = getAdminSetting( 'manageStock', 'no' );
|
||||||
const stockStatuses = getSetting( 'stockStatuses', {} );
|
const stockStatuses = getAdminSetting( 'stockStatuses', {} );
|
||||||
|
|
||||||
class ProductsReportTable extends Component {
|
class ProductsReportTable extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -9,7 +9,6 @@ import { compose } from '@wordpress/compose';
|
||||||
import { get, memoize } from 'lodash';
|
import { get, memoize } from 'lodash';
|
||||||
import { Date, Link } from '@woocommerce/components';
|
import { Date, Link } from '@woocommerce/components';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import {
|
import {
|
||||||
getReportTableQuery,
|
getReportTableQuery,
|
||||||
REPORTS_STORE_NAME,
|
REPORTS_STORE_NAME,
|
||||||
|
@ -27,6 +26,7 @@ import { stringify } from 'qs';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import ReportTable from '../../components/report-table';
|
import ReportTable from '../../components/report-table';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
|
|
||||||
const EMPTY_ARRAY = [];
|
const EMPTY_ARRAY = [];
|
||||||
|
@ -121,7 +121,10 @@ class RevenueReportTable extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getRowsContent( data = [] ) {
|
getRowsContent( data = [] ) {
|
||||||
const dateFormat = getSetting( 'dateFormat', defaultTableDateFormat );
|
const dateFormat = getAdminSetting(
|
||||||
|
'dateFormat',
|
||||||
|
defaultTableDateFormat
|
||||||
|
);
|
||||||
const {
|
const {
|
||||||
formatAmount,
|
formatAmount,
|
||||||
render: renderCurrency,
|
render: renderCurrency,
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
||||||
import { Link } from '@woocommerce/components';
|
import { Link } from '@woocommerce/components';
|
||||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
@ -15,8 +15,9 @@ import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
||||||
import ReportTable from '../../components/report-table';
|
import ReportTable from '../../components/report-table';
|
||||||
import { isLowStock } from './utils';
|
import { isLowStock } from './utils';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const stockStatuses = getSetting( 'stockStatuses', {} );
|
const stockStatuses = getAdminSetting( 'stockStatuses', {} );
|
||||||
|
|
||||||
class StockReportTable extends Component {
|
class StockReportTable extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { map } from 'lodash';
|
||||||
import { Link } from '@woocommerce/components';
|
import { Link } from '@woocommerce/components';
|
||||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||||
import { formatValue } from '@woocommerce/number';
|
import { formatValue } from '@woocommerce/number';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
@ -16,9 +16,10 @@ import ReportTable from '../../components/report-table';
|
||||||
import { isLowStock } from '../products/utils';
|
import { isLowStock } from '../products/utils';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
import { getVariationName } from '../../../lib/async-requests';
|
import { getVariationName } from '../../../lib/async-requests';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const manageStock = getSetting( 'manageStock', 'no' );
|
const manageStock = getAdminSetting( 'manageStock', 'no' );
|
||||||
const stockStatuses = getSetting( 'stockStatuses', {} );
|
const stockStatuses = getAdminSetting( 'stockStatuses', {} );
|
||||||
|
|
||||||
const getFullVariationName = ( rowData ) =>
|
const getFullVariationName = ( rowData ) =>
|
||||||
getVariationName( rowData.extended_info || {} );
|
getVariationName( rowData.extended_info || {} );
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import { applyFilters } from '@wordpress/hooks';
|
import { applyFilters } from '@wordpress/hooks';
|
||||||
import interpolateComponents from 'interpolate-components';
|
import interpolateComponents from 'interpolate-components';
|
||||||
import { getSetting, ORDER_STATUSES } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import DefaultDate from './default-date';
|
import DefaultDate from './default-date';
|
||||||
|
import { getAdminSetting, ORDER_STATUSES } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const SETTINGS_FILTER = 'woocommerce_admin_analytics_settings';
|
const SETTINGS_FILTER = 'woocommerce_admin_analytics_settings';
|
||||||
export const DEFAULT_ACTIONABLE_STATUSES = [ 'processing', 'on-hold' ];
|
export const DEFAULT_ACTIONABLE_STATUSES = [ 'processing', 'on-hold' ];
|
||||||
|
@ -37,7 +37,10 @@ const filteredOrderStatuses = Object.keys( ORDER_STATUSES )
|
||||||
};
|
};
|
||||||
} );
|
} );
|
||||||
|
|
||||||
const unregisteredOrderStatuses = getSetting( 'unregisteredOrderStatuses', {} );
|
const unregisteredOrderStatuses = getAdminSetting(
|
||||||
|
'unregisteredOrderStatuses',
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
const orderStatusOptions = [
|
const orderStatusOptions = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { Button, Modal } from '@wordpress/components';
|
||||||
import { find } from 'lodash';
|
import { find } from 'lodash';
|
||||||
import { decodeEntities } from '@wordpress/html-entities';
|
import { decodeEntities } from '@wordpress/html-entities';
|
||||||
import { withSelect } from '@wordpress/data';
|
import { withSelect } from '@wordpress/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { List } from '@woocommerce/components';
|
import { List } from '@woocommerce/components';
|
||||||
import { ONBOARDING_STORE_NAME, PLUGINS_STORE_NAME } from '@woocommerce/data';
|
import { ONBOARDING_STORE_NAME, PLUGINS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
|
@ -19,6 +18,7 @@ import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { getProductIdsForCart } from '../utils';
|
import { getProductIdsForCart } from '../utils';
|
||||||
import sanitizeHTML from '../../lib/sanitize-html';
|
import sanitizeHTML from '../../lib/sanitize-html';
|
||||||
import { getInAppPurchaseUrl } from '../../lib/in-app-purchase';
|
import { getInAppPurchaseUrl } from '../../lib/in-app-purchase';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
class CartModal extends Component {
|
class CartModal extends Component {
|
||||||
constructor( props ) {
|
constructor( props ) {
|
||||||
|
@ -81,7 +81,7 @@ class CartModal extends Component {
|
||||||
|
|
||||||
renderProducts() {
|
renderProducts() {
|
||||||
const { productIds, productTypes } = this.props;
|
const { productIds, productTypes } = this.props;
|
||||||
const { themes = [] } = getSetting( 'onboarding', {} );
|
const { themes = [] } = getAdminSetting( 'onboarding', {} );
|
||||||
const listItems = [];
|
const listItems = [];
|
||||||
|
|
||||||
productIds.forEach( ( productId ) => {
|
productIds.forEach( ( productId ) => {
|
||||||
|
|
|
@ -5,10 +5,14 @@ import { __ } from '@wordpress/i18n';
|
||||||
import { decodeEntities } from '@wordpress/html-entities';
|
import { decodeEntities } from '@wordpress/html-entities';
|
||||||
import { escapeRegExp } from 'lodash';
|
import { escapeRegExp } from 'lodash';
|
||||||
import { useEffect, useMemo, useState, useRef } from '@wordpress/element';
|
import { useEffect, useMemo, useState, useRef } from '@wordpress/element';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { SelectControl, TextControl } from '@woocommerce/components';
|
import { SelectControl, TextControl } from '@woocommerce/components';
|
||||||
|
|
||||||
const { countries } = getSetting( 'dataEndpoints', { countries: {} } );
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
|
const { countries } = getAdminSetting( 'dataEndpoints', { countries: {} } );
|
||||||
/**
|
/**
|
||||||
* Form validation.
|
* Form validation.
|
||||||
*
|
*
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
getNewPath,
|
getNewPath,
|
||||||
getPersistedQuery,
|
getPersistedQuery,
|
||||||
} from '@woocommerce/navigation';
|
} from '@woocommerce/navigation';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { Text } from '@woocommerce/experimental';
|
import { Text } from '@woocommerce/experimental';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,13 +14,13 @@ import {
|
||||||
SectionHeader,
|
SectionHeader,
|
||||||
} from '@woocommerce/components';
|
} from '@woocommerce/components';
|
||||||
import { useUserPreferences, ITEMS_STORE_NAME } from '@woocommerce/data';
|
import { useUserPreferences, ITEMS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import Leaderboard from '../../analytics/components/leaderboard';
|
import Leaderboard from '../../analytics/components/leaderboard';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
const renderLeaderboardToggles = ( {
|
const renderLeaderboardToggles = ( {
|
||||||
|
@ -175,9 +175,12 @@ Leaderboards.propTypes = {
|
||||||
export default compose(
|
export default compose(
|
||||||
withSelect( ( select ) => {
|
withSelect( ( select ) => {
|
||||||
const { getItems, getItemsError } = select( ITEMS_STORE_NAME );
|
const { getItems, getItemsError } = select( ITEMS_STORE_NAME );
|
||||||
const { leaderboards: allLeaderboards } = getSetting( 'dataEndpoints', {
|
const { leaderboards: allLeaderboards } = getAdminSetting(
|
||||||
leaderboards: [],
|
'dataEndpoints',
|
||||||
} );
|
{
|
||||||
|
leaderboards: [],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
allLeaderboards,
|
allLeaderboards,
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { __ } from '@wordpress/i18n';
|
||||||
import { Component, Fragment } from '@wordpress/element';
|
import { Component, Fragment } from '@wordpress/element';
|
||||||
import { compose } from '@wordpress/compose';
|
import { compose } from '@wordpress/compose';
|
||||||
import { getPersistedQuery } from '@woocommerce/navigation';
|
import { getPersistedQuery } from '@woocommerce/navigation';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { withSelect } from '@wordpress/data';
|
import { withSelect } from '@wordpress/data';
|
||||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||||
import {
|
import {
|
||||||
|
@ -26,10 +25,14 @@ import { recordEvent } from '@woocommerce/tracks';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
import { CurrencyContext } from '../../lib/currency-context';
|
import { CurrencyContext } from '../../lib/currency-context';
|
||||||
import { getIndicatorData, getIndicatorValues } from './utils';
|
import { getIndicatorData, getIndicatorValues } from './utils';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const { performanceIndicators: indicators } = getSetting( 'dataEndpoints', {
|
const { performanceIndicators: indicators } = getAdminSetting(
|
||||||
performanceIndicators: [],
|
'dataEndpoints',
|
||||||
} );
|
{
|
||||||
|
performanceIndicators: [],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
class StorePerformance extends Component {
|
class StorePerformance extends Component {
|
||||||
renderMenu() {
|
renderMenu() {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
import { getNewPath } from '@woocommerce/navigation';
|
import { getNewPath } from '@woocommerce/navigation';
|
||||||
import { calculateDelta, formatValue } from '@woocommerce/number';
|
import { calculateDelta, formatValue } from '@woocommerce/number';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
function getReportUrl( href, persistedQuery, primaryItem ) {
|
function getReportUrl( href, persistedQuery, primaryItem ) {
|
||||||
if ( ! href ) {
|
if ( ! href ) {
|
||||||
|
|
|
@ -3,7 +3,11 @@
|
||||||
*/
|
*/
|
||||||
import { decodeEntities } from '@wordpress/html-entities';
|
import { decodeEntities } from '@wordpress/html-entities';
|
||||||
import { without } from 'lodash';
|
import { without } from 'lodash';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the country code from a country:state value string.
|
* Gets the country code from a country:state value string.
|
||||||
|
@ -23,7 +27,7 @@ export function getCountryCode( countryState ) {
|
||||||
export function getCurrencyRegion( countryState ) {
|
export function getCurrencyRegion( countryState ) {
|
||||||
let region = getCountryCode( countryState );
|
let region = getCountryCode( countryState );
|
||||||
const euCountries = without(
|
const euCountries = without(
|
||||||
getSetting( 'onboarding', { euCountries: [] } ).euCountries,
|
getAdminSetting( 'onboarding', { euCountries: [] } ).euCountries,
|
||||||
'GB'
|
'GB'
|
||||||
);
|
);
|
||||||
if ( euCountries.includes( region ) ) {
|
if ( euCountries.includes( region ) ) {
|
||||||
|
@ -143,7 +147,7 @@ export function getProductList(
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
const onboarding = getSetting( 'onboarding', {} );
|
const onboarding = getAdminSetting( 'onboarding', {} );
|
||||||
let theme = null;
|
let theme = null;
|
||||||
if ( onboarding && onboarding.themes ) {
|
if ( onboarding && onboarding.themes ) {
|
||||||
theme = onboarding.themes.find(
|
theme = onboarding.themes.find(
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { __, sprintf } from '@wordpress/i18n';
|
||||||
import { useEffect, useLayoutEffect, useRef } from '@wordpress/element';
|
import { useEffect, useLayoutEffect, useRef } from '@wordpress/element';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { decodeEntities } from '@wordpress/html-entities';
|
import { decodeEntities } from '@wordpress/html-entities';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
import { getSetting } from '@woocommerce/settings';
|
||||||
import { Text, useSlot } from '@woocommerce/experimental';
|
import { Text, useSlot } from '@woocommerce/experimental';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
jest.mock( '@woocommerce/wc-admin-settings', () => ( {
|
jest.mock( '@woocommerce/settings', () => ( {
|
||||||
...jest.requireActual( '@woocommerce/wc-admin-settings' ),
|
...jest.requireActual( '@woocommerce/settings' ),
|
||||||
getSetting() {
|
getSetting() {
|
||||||
return 'Fake Site Title';
|
return 'Fake Site Title';
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,7 +10,6 @@ import {
|
||||||
PanelRow,
|
PanelRow,
|
||||||
__experimentalText as Text,
|
__experimentalText as Text,
|
||||||
} from '@wordpress/components';
|
} from '@wordpress/components';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { ONBOARDING_STORE_NAME } from '@woocommerce/data';
|
import { ONBOARDING_STORE_NAME } from '@woocommerce/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { useEffect } from '@wordpress/element';
|
import { useEffect } from '@wordpress/element';
|
||||||
|
@ -28,17 +27,21 @@ import {
|
||||||
import { getAllPanels } from './panels';
|
import { getAllPanels } from './panels';
|
||||||
import { getUnapprovedReviews } from './reviews/utils';
|
import { getUnapprovedReviews } from './reviews/utils';
|
||||||
import { getUrlParams } from '../../utils';
|
import { getUrlParams } from '../../utils';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
export const ActivityPanel = () => {
|
export const ActivityPanel = () => {
|
||||||
const panelsData = useSelect( ( select ) => {
|
const panelsData = useSelect( ( select ) => {
|
||||||
const totalOrderCount = getSetting( 'orderCount', 0 );
|
const totalOrderCount = getAdminSetting( 'orderCount', 0 );
|
||||||
const orderStatuses = getOrderStatuses( select );
|
const orderStatuses = getOrderStatuses( select );
|
||||||
const reviewsEnabled = getSetting( 'reviewsEnabled', 'no' );
|
const reviewsEnabled = getAdminSetting( 'reviewsEnabled', 'no' );
|
||||||
const countUnreadOrders = getUnreadOrders( select, orderStatuses );
|
const countUnreadOrders = getUnreadOrders( select, orderStatuses );
|
||||||
const manageStock = getSetting( 'manageStock', 'no' );
|
const manageStock = getAdminSetting( 'manageStock', 'no' );
|
||||||
const countLowStockProducts = getLowStockCount( select );
|
const countLowStockProducts = getLowStockCount( select );
|
||||||
const countUnapprovedReviews = getUnapprovedReviews( select );
|
const countUnapprovedReviews = getUnapprovedReviews( select );
|
||||||
const publishedProductCount = getSetting( 'publishedProductCount', 0 );
|
const publishedProductCount = getAdminSetting(
|
||||||
|
'publishedProductCount',
|
||||||
|
0
|
||||||
|
);
|
||||||
const taskList = select( ONBOARDING_STORE_NAME ).getTaskList( 'setup' );
|
const taskList = select( ONBOARDING_STORE_NAME ).getTaskList( 'setup' );
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import {
|
||||||
Section,
|
Section,
|
||||||
} from '@woocommerce/components';
|
} from '@woocommerce/components';
|
||||||
import { getNewPath } from '@woocommerce/navigation';
|
import { getNewPath } from '@woocommerce/navigation';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { ITEMS_STORE_NAME } from '@woocommerce/data';
|
import { ITEMS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import {
|
||||||
ActivityCard,
|
ActivityCard,
|
||||||
ActivityCardPlaceholder,
|
ActivityCardPlaceholder,
|
||||||
} from '~/activity-panel/activity-card';
|
} from '~/activity-panel/activity-card';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
function recordOrderEvent( eventName ) {
|
function recordOrderEvent( eventName ) {
|
||||||
|
@ -188,7 +189,7 @@ function renderOrders( orders ) {
|
||||||
>
|
>
|
||||||
<OrderStatus
|
<OrderStatus
|
||||||
order={ order }
|
order={ order }
|
||||||
orderStatusMap={ getSetting( 'orderStatuses', {} ) }
|
orderStatusMap={ getAdminSetting( 'orderStatuses', {} ) }
|
||||||
/>
|
/>
|
||||||
</ActivityCard>
|
</ActivityCard>
|
||||||
);
|
);
|
||||||
|
|
|
@ -18,7 +18,7 @@ import {
|
||||||
ProductImage,
|
ProductImage,
|
||||||
Section,
|
Section,
|
||||||
} from '@woocommerce/components';
|
} from '@woocommerce/components';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { get, isNull } from 'lodash';
|
import { get, isNull } from 'lodash';
|
||||||
import { REVIEWS_STORE_NAME } from '@woocommerce/data';
|
import { REVIEWS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { Component, Fragment } from '@wordpress/element';
|
||||||
import { ESCAPE } from '@wordpress/keycodes';
|
import { ESCAPE } from '@wordpress/keycodes';
|
||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
import { Link, ProductImage } from '@woocommerce/components';
|
import { Link, ProductImage } from '@woocommerce/components';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
|
@ -16,6 +15,7 @@ import moment from 'moment';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { ActivityCard } from '~/activity-panel/activity-card';
|
import { ActivityCard } from '~/activity-panel/activity-card';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
export class ProductStockCard extends Component {
|
export class ProductStockCard extends Component {
|
||||||
constructor( props ) {
|
constructor( props ) {
|
||||||
|
@ -194,7 +194,10 @@ export class ProductStockCard extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { product } = this.props;
|
const { product } = this.props;
|
||||||
const { edited, editing } = this.state;
|
const { edited, editing } = this.state;
|
||||||
const notifyLowStockAmount = getSetting( 'notifyLowStockAmount', 0 );
|
const notifyLowStockAmount = getAdminSetting(
|
||||||
|
'notifyLowStockAmount',
|
||||||
|
0
|
||||||
|
);
|
||||||
const lowStockAmount = Number.isFinite( product.low_stock_amount )
|
const lowStockAmount = Number.isFinite( product.low_stock_amount )
|
||||||
? product.low_stock_amount
|
? product.low_stock_amount
|
||||||
: notifyLowStockAmount;
|
: notifyLowStockAmount;
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
import { compose } from '@wordpress/compose';
|
import { compose } from '@wordpress/compose';
|
||||||
import { withSelect } from '@wordpress/data';
|
import { withSelect } from '@wordpress/data';
|
||||||
import { identity } from 'lodash';
|
import { identity } from 'lodash';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import {
|
import {
|
||||||
ONBOARDING_STORE_NAME,
|
ONBOARDING_STORE_NAME,
|
||||||
withOnboardingHydration,
|
withOnboardingHydration,
|
||||||
|
@ -16,6 +15,7 @@ import type { History } from 'history';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import Layout from './layout';
|
import Layout from './layout';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
type HomescreenProps = ReturnType< typeof withSelectHandler > & {
|
type HomescreenProps = ReturnType< typeof withSelectHandler > & {
|
||||||
hasFinishedResolution: boolean;
|
hasFinishedResolution: boolean;
|
||||||
|
@ -39,7 +39,7 @@ const Homescreen = ( {
|
||||||
return <Layout query={ query } />;
|
return <Layout query={ query } />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onboardingData = getSetting( 'onboarding', {} );
|
const onboardingData = getAdminSetting( 'onboarding', {} );
|
||||||
|
|
||||||
const withSelectHandler = ( select: WCDataSelector ) => {
|
const withSelectHandler = ( select: WCDataSelector ) => {
|
||||||
const { getProfileItems, hasFinishedResolution } = select(
|
const { getProfileItems, hasFinishedResolution } = select(
|
||||||
|
|
|
@ -13,7 +13,6 @@ import {
|
||||||
Link,
|
Link,
|
||||||
} from '@woocommerce/components';
|
} from '@woocommerce/components';
|
||||||
import { useUserPreferences, PLUGINS_STORE_NAME } from '@woocommerce/data';
|
import { useUserPreferences, PLUGINS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { getNewPath } from '@woocommerce/navigation';
|
import { getNewPath } from '@woocommerce/navigation';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { Text } from '@woocommerce/experimental';
|
import { Text } from '@woocommerce/experimental';
|
||||||
|
@ -26,8 +25,9 @@ import './style.scss';
|
||||||
import { DEFAULT_STATS, DEFAULT_HIDDEN_STATS } from './defaults';
|
import { DEFAULT_STATS, DEFAULT_HIDDEN_STATS } from './defaults';
|
||||||
import StatsList from './stats-list';
|
import StatsList from './stats-list';
|
||||||
import { InstallJetpackCTA } from './install-jetpack-cta';
|
import { InstallJetpackCTA } from './install-jetpack-cta';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const { performanceIndicators = [] } = getSetting( 'dataEndpoints', {
|
const { performanceIndicators = [] } = getAdminSetting( 'dataEndpoints', {
|
||||||
performanceIndicators: [],
|
performanceIndicators: [],
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
import { H } from '@woocommerce/components';
|
import { H } from '@woocommerce/components';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
|
|
@ -7,12 +7,12 @@ import {
|
||||||
withCurrentUserHydration,
|
withCurrentUserHydration,
|
||||||
withSettingsHydration,
|
withSettingsHydration,
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import './stylesheets/_index.scss';
|
import './stylesheets/_index.scss';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import { PageLayout, EmbedLayout, PrimaryLayout as NoticeArea } from './layout';
|
import { PageLayout, EmbedLayout, PrimaryLayout as NoticeArea } from './layout';
|
||||||
import { CustomerEffortScoreTracksContainer } from './customer-effort-score-tracks';
|
import { CustomerEffortScoreTracksContainer } from './customer-effort-score-tracks';
|
||||||
import { EmbeddedBodyLayout } from './embedded-body-layout';
|
import { EmbeddedBodyLayout } from './embedded-body-layout';
|
||||||
|
@ -24,7 +24,7 @@ __webpack_public_path__ = global.wcAdminAssets.path;
|
||||||
const appRoot = document.getElementById( 'root' );
|
const appRoot = document.getElementById( 'root' );
|
||||||
const embeddedRoot = document.getElementById( 'woocommerce-embedded-root' );
|
const embeddedRoot = document.getElementById( 'woocommerce-embedded-root' );
|
||||||
const settingsGroup = 'wc_admin';
|
const settingsGroup = 'wc_admin';
|
||||||
const hydrateUser = getSetting( 'currentUserData' );
|
const hydrateUser = getAdminSetting( 'currentUserData' );
|
||||||
|
|
||||||
if ( appRoot ) {
|
if ( appRoot ) {
|
||||||
let HydratedPageLayout = withSettingsHydration(
|
let HydratedPageLayout = withSettingsHydration(
|
||||||
|
|
|
@ -13,7 +13,6 @@ import {
|
||||||
getQueryExcludedScreens,
|
getQueryExcludedScreens,
|
||||||
getScreenFromPath,
|
getScreenFromPath,
|
||||||
} from '@woocommerce/navigation';
|
} from '@woocommerce/navigation';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { Spinner } from '@woocommerce/components';
|
import { Spinner } from '@woocommerce/components';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,6 +20,7 @@ import { Spinner } from '@woocommerce/components';
|
||||||
*/
|
*/
|
||||||
import getReports from '../analytics/report/get-reports';
|
import getReports from '../analytics/report/get-reports';
|
||||||
import { isWCAdmin } from '../dashboard/utils';
|
import { isWCAdmin } from '../dashboard/utils';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import { NoMatch } from './NoMatch';
|
import { NoMatch } from './NoMatch';
|
||||||
|
|
||||||
const AnalyticsReport = lazy( () =>
|
const AnalyticsReport = lazy( () =>
|
||||||
|
@ -55,7 +55,7 @@ export const PAGES_FILTER = 'woocommerce_admin_pages_list';
|
||||||
export const getPages = () => {
|
export const getPages = () => {
|
||||||
const pages = [];
|
const pages = [];
|
||||||
const initialBreadcrumbs = [
|
const initialBreadcrumbs = [
|
||||||
[ '', getSetting( 'woocommerceTranslation' ) ],
|
[ '', getAdminSetting( 'woocommerceTranslation' ) ],
|
||||||
];
|
];
|
||||||
|
|
||||||
pages.push( {
|
pages.push( {
|
||||||
|
@ -179,7 +179,7 @@ export const getPages = () => {
|
||||||
path: '/settings/:page',
|
path: '/settings/:page',
|
||||||
breadcrumbs: ( { match } ) => {
|
breadcrumbs: ( { match } ) => {
|
||||||
// @todo This might need to be refactored to retreive groups via data store.
|
// @todo This might need to be refactored to retreive groups via data store.
|
||||||
const settingsPages = getSetting( 'settingsPages' );
|
const settingsPages = getAdminSetting( 'settingsPages' );
|
||||||
const page = settingsPages[ match.params.page ];
|
const page = settingsPages[ match.params.page ];
|
||||||
if ( ! page ) {
|
if ( ! page ) {
|
||||||
return [];
|
return [];
|
||||||
|
|
|
@ -10,7 +10,6 @@ import PropTypes from 'prop-types';
|
||||||
import { get, isFunction, identity } from 'lodash';
|
import { get, isFunction, identity } from 'lodash';
|
||||||
import { parse } from 'qs';
|
import { parse } from 'qs';
|
||||||
import { getHistory, getQuery } from '@woocommerce/navigation';
|
import { getHistory, getQuery } from '@woocommerce/navigation';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import {
|
import {
|
||||||
PLUGINS_STORE_NAME,
|
PLUGINS_STORE_NAME,
|
||||||
useUser,
|
useUser,
|
||||||
|
@ -29,6 +28,7 @@ import { Controller, getPages } from './controller';
|
||||||
import { Header } from '../header';
|
import { Header } from '../header';
|
||||||
import Notices from './notices';
|
import Notices from './notices';
|
||||||
import TransientNotices from './transient-notices';
|
import TransientNotices from './transient-notices';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import '~/activity-panel';
|
import '~/activity-panel';
|
||||||
import '~/mobile-banner';
|
import '~/mobile-banner';
|
||||||
import './navigation';
|
import './navigation';
|
||||||
|
@ -205,10 +205,10 @@ _Layout.propTypes = {
|
||||||
} ).isRequired,
|
} ).isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
const dataEndpoints = getSetting( 'dataEndpoints' );
|
const dataEndpoints = getAdminSetting( 'dataEndpoints' );
|
||||||
const Layout = compose(
|
const Layout = compose(
|
||||||
withPluginsHydration( {
|
withPluginsHydration( {
|
||||||
...getSetting( 'plugins', {} ),
|
...getAdminSetting( 'plugins', {} ),
|
||||||
jetpackStatus:
|
jetpackStatus:
|
||||||
( dataEndpoints && dataEndpoints.jetpackStatus ) || false,
|
( dataEndpoints && dataEndpoints.jetpackStatus ) || false,
|
||||||
} ),
|
} ),
|
||||||
|
@ -264,7 +264,7 @@ const _PageLayout = () => {
|
||||||
export const PageLayout = compose(
|
export const PageLayout = compose(
|
||||||
window.wcSettings.admin
|
window.wcSettings.admin
|
||||||
? withOptionsHydration( {
|
? withOptionsHydration( {
|
||||||
...getSetting( 'preloadOptions', {} ),
|
...getAdminSetting( 'preloadOptions', {} ),
|
||||||
} )
|
} )
|
||||||
: identity
|
: identity
|
||||||
)( _PageLayout );
|
)( _PageLayout );
|
||||||
|
@ -272,16 +272,16 @@ export const PageLayout = compose(
|
||||||
const _EmbedLayout = () => (
|
const _EmbedLayout = () => (
|
||||||
<Layout
|
<Layout
|
||||||
page={ {
|
page={ {
|
||||||
breadcrumbs: getSetting( 'embedBreadcrumbs', [] ),
|
breadcrumbs: getAdminSetting( 'embedBreadcrumbs', [] ),
|
||||||
} }
|
} }
|
||||||
isEmbedded
|
isEmbedded
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
export const EmbedLayout = compose(
|
export const EmbedLayout = compose(
|
||||||
getSetting( 'preloadOptions' )
|
getAdminSetting( 'preloadOptions' )
|
||||||
? withOptionsHydration( {
|
? withOptionsHydration( {
|
||||||
...getSetting( 'preloadOptions' ),
|
...getAdminSetting( 'preloadOptions' ),
|
||||||
} )
|
} )
|
||||||
: identity
|
: identity
|
||||||
)( _EmbedLayout );
|
)( _EmbedLayout );
|
||||||
|
|
|
@ -17,7 +17,6 @@ import { compose } from '@wordpress/compose';
|
||||||
import { withDispatch, withSelect } from '@wordpress/data';
|
import { withDispatch, withSelect } from '@wordpress/data';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';
|
import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { NOTES_STORE_NAME, QUERY_DEFAULTS } from '@woocommerce/data';
|
import { NOTES_STORE_NAME, QUERY_DEFAULTS } from '@woocommerce/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { Text } from '@woocommerce/experimental';
|
import { Text } from '@woocommerce/experimental';
|
||||||
|
@ -27,6 +26,7 @@ import { Text } from '@woocommerce/experimental';
|
||||||
*/
|
*/
|
||||||
import sanitizeHTML from '../../lib/sanitize-html';
|
import sanitizeHTML from '../../lib/sanitize-html';
|
||||||
import StoreAlertsPlaceholder from './placeholder';
|
import StoreAlertsPlaceholder from './placeholder';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ export class StoreAlerts extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const alerts = this.getAlerts();
|
const alerts = this.getAlerts();
|
||||||
const preloadAlertCount = getSetting( 'alertCount', 0, ( count ) =>
|
const preloadAlertCount = getAdminSetting( 'alertCount', 0, ( count ) =>
|
||||||
parseInt( count, 10 )
|
parseInt( count, 10 )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { render, fireEvent } from '@testing-library/react';
|
import { render, fireEvent } from '@testing-library/react';
|
||||||
import { setSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { StoreAlerts } from '../';
|
import { StoreAlerts } from '../';
|
||||||
|
import { setAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const alerts = [
|
const alerts = [
|
||||||
{
|
{
|
||||||
|
@ -39,7 +39,7 @@ describe( 'StoreAlerts', () => {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
it( 'should show the placeholder when loading and preloaded alerts exist', () => {
|
it( 'should show the placeholder when loading and preloaded alerts exist', () => {
|
||||||
setSetting( 'alertCount', 2 );
|
setAdminSetting( 'alertCount', 2 );
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
<StoreAlerts isLoading alerts={ alerts } />
|
<StoreAlerts isLoading alerts={ alerts } />
|
||||||
);
|
);
|
||||||
|
|
|
@ -6,12 +6,12 @@ import apiFetch from '@wordpress/api-fetch';
|
||||||
import { identity } from 'lodash';
|
import { identity } from 'lodash';
|
||||||
import { getIdsFromQuery } from '@woocommerce/navigation';
|
import { getIdsFromQuery } from '@woocommerce/navigation';
|
||||||
import { NAMESPACE } from '@woocommerce/data';
|
import { NAMESPACE } from '@woocommerce/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { getTaxCode } from '../../analytics/report/taxes/utils';
|
import { getTaxCode } from '../../analytics/report/taxes/utils';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a function that accepts ids as they are found in url parameter and
|
* Get a function that accepts ids as they are found in url parameter and
|
||||||
|
@ -96,7 +96,10 @@ export const getTaxRateLabels = getRequestByIdString(
|
||||||
* @return {string} - formatted variation name
|
* @return {string} - formatted variation name
|
||||||
*/
|
*/
|
||||||
export function getVariationName( { attributes, name } ) {
|
export function getVariationName( { attributes, name } ) {
|
||||||
const separator = getSetting( 'variationTitleAttributesSeparator', ' - ' );
|
const separator = getAdminSetting(
|
||||||
|
'variationTitleAttributesSeparator',
|
||||||
|
' - '
|
||||||
|
);
|
||||||
|
|
||||||
if ( name && name.indexOf( separator ) > -1 ) {
|
if ( name && name.indexOf( separator ) > -1 ) {
|
||||||
return name;
|
return name;
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
import { createContext } from '@wordpress/element';
|
import { createContext } from '@wordpress/element';
|
||||||
import { applyFilters } from '@wordpress/hooks';
|
import { applyFilters } from '@wordpress/hooks';
|
||||||
import CurrencyFactory from '@woocommerce/currency';
|
import CurrencyFactory from '@woocommerce/currency';
|
||||||
import { CURRENCY } from '@woocommerce/wc-admin-settings';
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
import { CURRENCY } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const appCurrency = CurrencyFactory( CURRENCY );
|
const appCurrency = CurrencyFactory( CURRENCY );
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { addQueryArgs } from '@wordpress/url';
|
import { addQueryArgs } from '@wordpress/url';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
import { getSetting } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an in-app-purchase URL.
|
* Returns an in-app-purchase URL.
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
@ -10,10 +9,11 @@ import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
import RecommendedExtensions from '../components/recommended-extensions';
|
import RecommendedExtensions from '../components/recommended-extensions';
|
||||||
import KnowledgeBase from '../components/knowledge-base';
|
import KnowledgeBase from '../components/knowledge-base';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import '../data';
|
import '../data';
|
||||||
|
|
||||||
const CouponsOverview = () => {
|
const CouponsOverview = () => {
|
||||||
const allowMarketplaceSuggestions = getSetting(
|
const allowMarketplaceSuggestions = getAdminSetting(
|
||||||
'allowMarketplaceSuggestions',
|
'allowMarketplaceSuggestions',
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
/**
|
/**
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { without } from 'lodash';
|
import { without } from 'lodash';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import TYPES from './action-types';
|
import TYPES from './action-types';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const { installedExtensions } = getSetting( 'marketing', {} );
|
const { installedExtensions } = getAdminSetting( 'marketing', {} );
|
||||||
|
|
||||||
const DEFAULT_STATE = {
|
const DEFAULT_STATE = {
|
||||||
installedPlugins: installedExtensions,
|
installedPlugins: installedExtensions,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { withOptionsHydration } from '@woocommerce/data';
|
import { withOptionsHydration } from '@woocommerce/data';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,10 +11,11 @@ import InstalledExtensions from './installed-extensions';
|
||||||
import RecommendedExtensions from '../components/recommended-extensions';
|
import RecommendedExtensions from '../components/recommended-extensions';
|
||||||
import KnowledgeBase from '../components/knowledge-base';
|
import KnowledgeBase from '../components/knowledge-base';
|
||||||
import WelcomeCard from './welcome-card';
|
import WelcomeCard from './welcome-card';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import '../data';
|
import '../data';
|
||||||
|
|
||||||
const MarketingOverview = () => {
|
const MarketingOverview = () => {
|
||||||
const allowMarketplaceSuggestions = getSetting(
|
const allowMarketplaceSuggestions = getAdminSetting(
|
||||||
'allowMarketplaceSuggestions',
|
'allowMarketplaceSuggestions',
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
@ -33,5 +33,5 @@ const MarketingOverview = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default withOptionsHydration( {
|
export default withOptionsHydration( {
|
||||||
...getSetting( 'preloadOptions', {} ),
|
...getAdminSetting( 'preloadOptions', {} ),
|
||||||
} )( MarketingOverview );
|
} )( MarketingOverview );
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { createElement } from '@wordpress/element';
|
||||||
import { WelcomeCard } from '../index.js';
|
import { WelcomeCard } from '../index.js';
|
||||||
|
|
||||||
jest.mock( '@woocommerce/tracks' );
|
jest.mock( '@woocommerce/tracks' );
|
||||||
jest.mock( '@woocommerce/wc-admin-settings' );
|
jest.mock( '@woocommerce/settings' );
|
||||||
|
|
||||||
describe( 'WelcomeCard hide button', () => {
|
describe( 'WelcomeCard hide button', () => {
|
||||||
it( 'should record an event when clicked', () => {
|
it( 'should record an event when clicked', () => {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { act, render, waitFor } from '@testing-library/react';
|
import { act, render, waitFor } from '@testing-library/react';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { getHistory } from '@woocommerce/navigation';
|
import { getHistory } from '@woocommerce/navigation';
|
||||||
import { useSelect } from '@wordpress/data';
|
import { useSelect } from '@wordpress/data';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n';
|
||||||
import { Button } from '@wordpress/components';
|
import { Button } from '@wordpress/components';
|
||||||
import { decodeEntities } from '@wordpress/html-entities';
|
import { decodeEntities } from '@wordpress/html-entities';
|
||||||
import { Icon, wordpress } from '@wordpress/icons';
|
import { Icon, wordpress } from '@wordpress/icons';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
import { getSetting } from '@woocommerce/settings';
|
||||||
import { useSelect } from '@wordpress/data';
|
import { useSelect } from '@wordpress/data';
|
||||||
import { useEffect, useState } from '@wordpress/element';
|
import { useEffect, useState } from '@wordpress/element';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
|
@ -11,8 +11,8 @@ import Header from '../';
|
||||||
|
|
||||||
global.window.wcNavigation = {};
|
global.window.wcNavigation = {};
|
||||||
|
|
||||||
jest.mock( '@woocommerce/wc-admin-settings', () => ( {
|
jest.mock( '@woocommerce/settings', () => ( {
|
||||||
...jest.requireActual( '@woocommerce/wc-admin-settings' ),
|
...jest.requireActual( '@woocommerce/settings' ),
|
||||||
getSetting: jest.fn( ( setting ) => {
|
getSetting: jest.fn( ( setting ) => {
|
||||||
const settings = {
|
const settings = {
|
||||||
homeUrl: 'https://fake-site-url.com',
|
homeUrl: 'https://fake-site-url.com',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
type MenuId = 'primary' | 'favorites' | 'plugins' | 'secondary';
|
type MenuId = 'primary' | 'favorites' | 'plugins' | 'secondary';
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import ExternalIcon from 'gridicons/dist/external';
|
import ExternalIcon from 'gridicons/dist/external';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import { render, fireEvent, waitFor } from '@testing-library/react';
|
import { render, fireEvent, waitFor } from '@testing-library/react';
|
||||||
import { useSelect, useDispatch } from '@wordpress/data';
|
import { useSelect, useDispatch } from '@wordpress/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
@ -51,7 +51,7 @@ jest.mock(
|
||||||
} )
|
} )
|
||||||
);
|
);
|
||||||
|
|
||||||
jest.mock( '@woocommerce/wc-admin-settings', () => ( {
|
jest.mock( '@woocommerce/settings', () => ( {
|
||||||
getAdminLink: jest
|
getAdminLink: jest
|
||||||
.fn()
|
.fn()
|
||||||
.mockImplementation( ( link: string ) => 'https://test.ca/' + link ),
|
.mockImplementation( ( link: string ) => 'https://test.ca/' + link ),
|
||||||
|
|
|
@ -21,7 +21,7 @@ import {
|
||||||
QUERY_DEFAULTS,
|
QUERY_DEFAULTS,
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
@ -32,6 +32,7 @@ import ProductTypes from './steps/product-types';
|
||||||
import ProfileWizardHeader from './header';
|
import ProfileWizardHeader from './header';
|
||||||
import StoreDetails from './steps/store-details';
|
import StoreDetails from './steps/store-details';
|
||||||
import Theme from './steps/theme';
|
import Theme from './steps/theme';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
const STEPS_FILTER = 'woocommerce_admin_profile_wizard_steps';
|
const STEPS_FILTER = 'woocommerce_admin_profile_wizard_steps';
|
||||||
|
@ -318,10 +319,11 @@ export default compose(
|
||||||
updateProfileItems,
|
updateProfileItems,
|
||||||
};
|
};
|
||||||
} ),
|
} ),
|
||||||
getSetting( 'plugins' )
|
getAdminSetting( 'plugins' )
|
||||||
? withPluginsHydration( {
|
? withPluginsHydration( {
|
||||||
...getSetting( 'plugins' ),
|
...getAdminSetting( 'plugins' ),
|
||||||
jetpackStatus: getSetting( 'dataEndpoints', {} ).jetpackStatus,
|
jetpackStatus: getAdminSetting( 'dataEndpoints', {} )
|
||||||
|
.jetpackStatus,
|
||||||
} )
|
} )
|
||||||
: identity
|
: identity
|
||||||
)( ProfileWizard );
|
)( ProfileWizard );
|
||||||
|
|
|
@ -13,7 +13,6 @@ import {
|
||||||
import { compose } from '@wordpress/compose';
|
import { compose } from '@wordpress/compose';
|
||||||
import { filter, find, findIndex, get } from 'lodash';
|
import { filter, find, findIndex, get } from 'lodash';
|
||||||
import { withDispatch, withSelect } from '@wordpress/data';
|
import { withDispatch, withSelect } from '@wordpress/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { ONBOARDING_STORE_NAME, SETTINGS_STORE_NAME } from '@woocommerce/data';
|
import { ONBOARDING_STORE_NAME, SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { TextControl } from '@woocommerce/components';
|
import { TextControl } from '@woocommerce/components';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
|
@ -23,8 +22,9 @@ import { Text } from '@woocommerce/experimental';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { getCurrencyRegion } from '../../dashboard/utils';
|
import { getCurrencyRegion } from '../../dashboard/utils';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const onboarding = getSetting( 'onboarding', {} );
|
const onboarding = getAdminSetting( 'onboarding', {} );
|
||||||
|
|
||||||
class Industry extends Component {
|
class Industry extends Component {
|
||||||
constructor( props ) {
|
constructor( props ) {
|
||||||
|
|
|
@ -16,7 +16,6 @@ import { Component, useRef } from '@wordpress/element';
|
||||||
import { compose } from '@wordpress/compose';
|
import { compose } from '@wordpress/compose';
|
||||||
import { withDispatch, withSelect } from '@wordpress/data';
|
import { withDispatch, withSelect } from '@wordpress/data';
|
||||||
import { Form, TextControl } from '@woocommerce/components';
|
import { Form, TextControl } from '@woocommerce/components';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import {
|
import {
|
||||||
ONBOARDING_STORE_NAME,
|
ONBOARDING_STORE_NAME,
|
||||||
OPTIONS_STORE_NAME,
|
OPTIONS_STORE_NAME,
|
||||||
|
@ -36,6 +35,7 @@ import {
|
||||||
} from '../../../dashboard/components/settings/general/store-address';
|
} from '../../../dashboard/components/settings/general/store-address';
|
||||||
import UsageModal from '../usage-modal';
|
import UsageModal from '../usage-modal';
|
||||||
import { CurrencyContext } from '../../../lib/currency-context';
|
import { CurrencyContext } from '../../../lib/currency-context';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
// FlexItem is not available until WP version 5.5. This code is safe to remove
|
// FlexItem is not available until WP version 5.5. This code is safe to remove
|
||||||
|
@ -77,7 +77,7 @@ class StoreDetails extends Component {
|
||||||
|
|
||||||
const Currency = this.context;
|
const Currency = this.context;
|
||||||
const country = getCountryCode( countryState );
|
const country = getCountryCode( countryState );
|
||||||
const { currencySymbols = {}, localeInfo = {} } = getSetting(
|
const { currencySymbols = {}, localeInfo = {} } = getAdminSetting(
|
||||||
'onboarding',
|
'onboarding',
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
|
@ -17,7 +17,6 @@ import {
|
||||||
} from '@wordpress/components';
|
} from '@wordpress/components';
|
||||||
import { withDispatch, withSelect } from '@wordpress/data';
|
import { withDispatch, withSelect } from '@wordpress/data';
|
||||||
import { H } from '@woocommerce/components';
|
import { H } from '@woocommerce/components';
|
||||||
import { getSetting, setSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { ONBOARDING_STORE_NAME } from '@woocommerce/data';
|
import { ONBOARDING_STORE_NAME } from '@woocommerce/data';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { Text } from '@woocommerce/experimental';
|
import { Text } from '@woocommerce/experimental';
|
||||||
|
@ -29,6 +28,7 @@ import './style.scss';
|
||||||
import ThemeUploader from './uploader';
|
import ThemeUploader from './uploader';
|
||||||
import ThemePreview from './preview';
|
import ThemePreview from './preview';
|
||||||
import { getPriceValue } from '../../../dashboard/utils';
|
import { getPriceValue } from '../../../dashboard/utils';
|
||||||
|
import { getAdminSetting, setAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
class Theme extends Component {
|
class Theme extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -84,7 +84,7 @@ class Theme extends Component {
|
||||||
onChoose( theme, location = '' ) {
|
onChoose( theme, location = '' ) {
|
||||||
const { updateProfileItems } = this.props;
|
const { updateProfileItems } = this.props;
|
||||||
const { is_installed: isInstalled, price, slug } = theme;
|
const { is_installed: isInstalled, price, slug } = theme;
|
||||||
const { activeTheme = '' } = getSetting( 'onboarding', {} );
|
const { activeTheme = '' } = getAdminSetting( 'onboarding', {} );
|
||||||
|
|
||||||
this.setState( { chosen: slug } );
|
this.setState( { chosen: slug } );
|
||||||
recordEvent( 'storeprofiler_store_theme_choose', {
|
recordEvent( 'storeprofiler_store_theme_choose', {
|
||||||
|
@ -147,8 +147,8 @@ class Theme extends Component {
|
||||||
response.name
|
response.name
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
setSetting( 'onboarding', {
|
setAdminSetting( 'onboarding', {
|
||||||
...getSetting( 'onboarding', {} ),
|
...getAdminSetting( 'onboarding', {} ),
|
||||||
activeTheme: response.slug,
|
activeTheme: response.slug,
|
||||||
} );
|
} );
|
||||||
updateProfileItems( { theme: slug } );
|
updateProfileItems( { theme: slug } );
|
||||||
|
@ -177,7 +177,7 @@ class Theme extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
skipStep() {
|
skipStep() {
|
||||||
const { activeTheme = '' } = getSetting( 'onboarding', {} );
|
const { activeTheme = '' } = getAdminSetting( 'onboarding', {} );
|
||||||
recordEvent( 'storeprofiler_store_theme_skip_step', { activeTheme } );
|
recordEvent( 'storeprofiler_store_theme_skip_step', { activeTheme } );
|
||||||
this.props.goToNextStep();
|
this.props.goToNextStep();
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ class Theme extends Component {
|
||||||
title,
|
title,
|
||||||
} = theme;
|
} = theme;
|
||||||
const { chosen } = this.state;
|
const { chosen } = this.state;
|
||||||
const { activeTheme = '' } = getSetting( 'onboarding', {} );
|
const { activeTheme = '' } = getAdminSetting( 'onboarding', {} );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="woocommerce-profile-wizard__theme" key={ slug }>
|
<Card className="woocommerce-profile-wizard__theme" key={ slug }>
|
||||||
|
@ -267,7 +267,7 @@ class Theme extends Component {
|
||||||
|
|
||||||
getThemeStatus( theme ) {
|
getThemeStatus( theme ) {
|
||||||
const { is_installed: isInstalled, price, slug } = theme;
|
const { is_installed: isInstalled, price, slug } = theme;
|
||||||
const { activeTheme = '' } = getSetting( 'onboarding', {} );
|
const { activeTheme = '' } = getAdminSetting( 'onboarding', {} );
|
||||||
|
|
||||||
if ( activeTheme === slug ) {
|
if ( activeTheme === slug ) {
|
||||||
return __( 'Currently active theme', 'woocommerce-admin' );
|
return __( 'Currently active theme', 'woocommerce-admin' );
|
||||||
|
@ -285,7 +285,7 @@ class Theme extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
doesActiveThemeSupportWooCommerce() {
|
doesActiveThemeSupportWooCommerce() {
|
||||||
const { activeTheme = '' } = getSetting( 'onboarding', {} );
|
const { activeTheme = '' } = getAdminSetting( 'onboarding', {} );
|
||||||
const allThemes = this.getThemes();
|
const allThemes = this.getThemes();
|
||||||
const currentTheme = allThemes.find(
|
const currentTheme = allThemes.find(
|
||||||
( theme ) => theme.slug === activeTheme
|
( theme ) => theme.slug === activeTheme
|
||||||
|
@ -306,7 +306,7 @@ class Theme extends Component {
|
||||||
|
|
||||||
getThemes( activeTab = 'all' ) {
|
getThemes( activeTab = 'all' ) {
|
||||||
const { uploadedThemes } = this.state;
|
const { uploadedThemes } = this.state;
|
||||||
const { activeTheme = '', themes = [] } = getSetting(
|
const { activeTheme = '', themes = [] } = getAdminSetting(
|
||||||
'onboarding',
|
'onboarding',
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
|
@ -6,18 +6,20 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
||||||
import { Button, ExternalLink } from '@wordpress/components';
|
import { Button, ExternalLink } from '@wordpress/components';
|
||||||
import { Pill } from '@woocommerce/components';
|
import { Pill } from '@woocommerce/components';
|
||||||
import { PLUGINS_STORE_NAME } from '@woocommerce/data';
|
import { PLUGINS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import './woocommerce-services-item.scss';
|
import './woocommerce-services-item.scss';
|
||||||
import WooIcon from './woo-icon.svg';
|
import WooIcon from './woo-icon.svg';
|
||||||
|
import { getAdminSetting } from '../utils/admin-settings';
|
||||||
|
|
||||||
const WooCommerceServicesItem: React.FC< {
|
const WooCommerceServicesItem: React.FC< {
|
||||||
pluginsBeingSetup: Array< string >;
|
pluginsBeingSetup: Array< string >;
|
||||||
onSetupClick: ( slugs: string[] ) => PromiseLike< void >;
|
onSetupClick: ( slugs: string[] ) => PromiseLike< void >;
|
||||||
} > = ( { onSetupClick, pluginsBeingSetup } ) => {
|
} > = ( { onSetupClick, pluginsBeingSetup } ) => {
|
||||||
const wcAdminAssetUrl = getSetting( 'wcAdminAssetUrl', '' );
|
const wcAdminAssetUrl = getAdminSetting( 'wcAdminAssetUrl', '' );
|
||||||
const { createSuccessNotice } = useDispatch( 'core/notices' );
|
const { createSuccessNotice } = useDispatch( 'core/notices' );
|
||||||
|
|
||||||
const isSiteConnectedToJetpack = useSelect( ( select ) =>
|
const isSiteConnectedToJetpack = useSelect( ( select ) =>
|
||||||
|
|
|
@ -14,7 +14,6 @@ import {
|
||||||
payment,
|
payment,
|
||||||
pencil,
|
pencil,
|
||||||
} from '@wordpress/icons';
|
} from '@wordpress/icons';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { Text } from '@woocommerce/experimental';
|
import { Text } from '@woocommerce/experimental';
|
||||||
|
|
||||||
|
@ -24,6 +23,7 @@ import { Text } from '@woocommerce/experimental';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
import { QuickLinkCategory } from './quick-link-category';
|
import { QuickLinkCategory } from './quick-link-category';
|
||||||
import { QuickLink } from './quick-link';
|
import { QuickLink } from './quick-link';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
export function getItemsByCategory( shopUrl ) {
|
export function getItemsByCategory( shopUrl ) {
|
||||||
return [
|
return [
|
||||||
|
@ -156,7 +156,7 @@ export const generateExtensionLinks = ( links ) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const StoreManagementLinks = () => {
|
export const StoreManagementLinks = () => {
|
||||||
const shopUrl = getSetting( 'shopUrl' );
|
const shopUrl = getAdminSetting( 'shopUrl' );
|
||||||
|
|
||||||
const extensionQuickLinks = generateExtensionLinks(
|
const extensionQuickLinks = generateExtensionLinks(
|
||||||
applyFilters( 'woocommerce_admin_homescreen_quicklinks', [] )
|
applyFilters( 'woocommerce_admin_homescreen_quicklinks', [] )
|
||||||
|
|
|
@ -3,8 +3,8 @@ jest.mock( '@woocommerce/tracks', () => ( {
|
||||||
recordEvent: jest.fn(),
|
recordEvent: jest.fn(),
|
||||||
} ) );
|
} ) );
|
||||||
|
|
||||||
jest.mock( '@woocommerce/wc-admin-settings', () => ( {
|
jest.mock( '@woocommerce/settings', () => ( {
|
||||||
...jest.requireActual( '@woocommerce/wc-admin-settings' ),
|
...jest.requireActual( '@woocommerce/settings' ),
|
||||||
getSetting: jest.fn( () => 'https://fake-site-url.com' ),
|
getSetting: jest.fn( () => 'https://fake-site-url.com' ),
|
||||||
} ) );
|
} ) );
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import { Button } from '@wordpress/components';
|
import { Button } from '@wordpress/components';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { Text } from '@woocommerce/experimental';
|
import { Text } from '@woocommerce/experimental';
|
||||||
import { Pill } from '@woocommerce/components';
|
import { Pill } from '@woocommerce/components';
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*/
|
*/
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import { Card, CardBody } from '@wordpress/components';
|
import { Card, CardBody } from '@wordpress/components';
|
||||||
import { enqueueScript } from '@woocommerce/wc-admin-settings';
|
|
||||||
import {
|
import {
|
||||||
OPTIONS_STORE_NAME,
|
OPTIONS_STORE_NAME,
|
||||||
PAYMENT_GATEWAYS_STORE_NAME,
|
PAYMENT_GATEWAYS_STORE_NAME,
|
||||||
|
@ -20,6 +19,7 @@ import { useSlot } from '@woocommerce/experimental';
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { createNoticesFromResponse } from '~/lib/notices';
|
import { createNoticesFromResponse } from '~/lib/notices';
|
||||||
|
import { enqueueScript } from '~/utils/enqueue-script';
|
||||||
import { Configure } from './Configure';
|
import { Configure } from './Configure';
|
||||||
import './Setup.scss';
|
import './Setup.scss';
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { act, render } from '@testing-library/react';
|
import { act, render } from '@testing-library/react';
|
||||||
import { enqueueScript } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { Setup } from '../';
|
import { Setup } from '../';
|
||||||
|
import { enqueueScript } from '~/utils/enqueue-script';
|
||||||
|
|
||||||
jest.mock( '@woocommerce/components', () => {
|
jest.mock( '@woocommerce/components', () => {
|
||||||
const originalModule = jest.requireActual( '@woocommerce/components' );
|
const originalModule = jest.requireActual( '@woocommerce/components' );
|
||||||
|
@ -19,7 +19,8 @@ jest.mock( '@woocommerce/components', () => {
|
||||||
};
|
};
|
||||||
} );
|
} );
|
||||||
|
|
||||||
jest.mock( '@woocommerce/wc-admin-settings' );
|
jest.mock( '@woocommerce/settings' );
|
||||||
|
jest.mock( '~/utils/enqueue-script' );
|
||||||
|
|
||||||
const mockGateway = {
|
const mockGateway = {
|
||||||
id: 'mock-gateway',
|
id: 'mock-gateway',
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
PLUGINS_STORE_NAME,
|
PLUGINS_STORE_NAME,
|
||||||
SETTINGS_STORE_NAME,
|
SETTINGS_STORE_NAME,
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,7 +19,7 @@ import {
|
||||||
} from '@woocommerce/data';
|
} from '@woocommerce/data';
|
||||||
import { useSelect } from '@wordpress/data';
|
import { useSelect } from '@wordpress/data';
|
||||||
import { List, Pill } from '@woocommerce/components';
|
import { List, Pill } from '@woocommerce/components';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
import { registerPlugin } from '@wordpress/plugins';
|
import { registerPlugin } from '@wordpress/plugins';
|
||||||
import { WooOnboardingTask } from '@woocommerce/onboarding';
|
import { WooOnboardingTask } from '@woocommerce/onboarding';
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { difference, filter } from 'lodash';
|
||||||
import interpolateComponents from 'interpolate-components';
|
import interpolateComponents from 'interpolate-components';
|
||||||
import { withDispatch, withSelect } from '@wordpress/data';
|
import { withDispatch, withSelect } from '@wordpress/data';
|
||||||
import { Link, Stepper, Plugins } from '@woocommerce/components';
|
import { Link, Stepper, Plugins } from '@woocommerce/components';
|
||||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { getHistory, getNewPath } from '@woocommerce/navigation';
|
import { getHistory, getNewPath } from '@woocommerce/navigation';
|
||||||
import {
|
import {
|
||||||
SETTINGS_STORE_NAME,
|
SETTINGS_STORE_NAME,
|
||||||
|
@ -29,6 +29,7 @@ import { getCountryCode } from '../../../dashboard/utils';
|
||||||
import StoreLocation from '../steps/location';
|
import StoreLocation from '../steps/location';
|
||||||
import ShippingRates from './rates';
|
import ShippingRates from './rates';
|
||||||
import { createNoticesFromResponse } from '../../../lib/notices';
|
import { createNoticesFromResponse } from '../../../lib/notices';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
import './shipping.scss';
|
import './shipping.scss';
|
||||||
|
|
||||||
export class Shipping extends Component {
|
export class Shipping extends Component {
|
||||||
|
@ -367,7 +368,7 @@ const ShippingWrapper = compose(
|
||||||
settings.woocommerce_default_country
|
settings.woocommerce_default_country
|
||||||
);
|
);
|
||||||
|
|
||||||
const { countries = [] } = getSetting( 'dataEndpoints', {} );
|
const { countries = [] } = getAdminSetting( 'dataEndpoints', {} );
|
||||||
const country = countryCode
|
const country = countryCode
|
||||||
? countries.find( ( c ) => c.code === countryCode )
|
? countries.find( ( c ) => c.code === countryCode )
|
||||||
: null;
|
: null;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import interpolateComponents from 'interpolate-components';
|
import interpolateComponents from 'interpolate-components';
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { Card, CardBody, Spinner } from '@wordpress/components';
|
import { Card, CardBody, Spinner } from '@wordpress/components';
|
||||||
import { useDispatch, useSelect } from '@wordpress/data';
|
import { useDispatch, useSelect } from '@wordpress/data';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import {
|
import {
|
||||||
ONBOARDING_STORE_NAME,
|
ONBOARDING_STORE_NAME,
|
||||||
OPTIONS_STORE_NAME,
|
OPTIONS_STORE_NAME,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { WPDataSelectors } from '@woocommerce/data';
|
import { WPDataSelectors } from '@woocommerce/data';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,29 +2,20 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
|
import { getSetting } from '@woocommerce/settings';
|
||||||
|
|
||||||
// Remove mutable data from settings object to prevent access. Data stores should be used instead.
|
// Remove mutable data from settings object to prevent access. Data stores should be used instead.
|
||||||
const mutableSources = [ 'wcAdminSettings', 'preloadSettings' ];
|
const mutableSources = [ 'wcAdminSettings', 'preloadSettings' ];
|
||||||
const settings = typeof wcSettings === 'object' ? wcSettings : {};
|
const adminSettings = getSetting( 'admin', {} );
|
||||||
const SOURCE = Object.keys( settings ).reduce( ( source, key ) => {
|
const ADMIN_SETTINGS_SOURCE = Object.keys( adminSettings ).reduce(
|
||||||
if ( ! mutableSources.includes( key ) ) {
|
( source, key ) => {
|
||||||
source[ key ] = settings[ key ];
|
if ( ! mutableSources.includes( key ) ) {
|
||||||
}
|
source[ key ] = adminSettings[ key ];
|
||||||
return source;
|
}
|
||||||
}, {} );
|
return source;
|
||||||
Object.keys( settings.admin || {} ).forEach( ( key ) => {
|
},
|
||||||
if ( ! mutableSources.includes( key ) ) {
|
{}
|
||||||
SOURCE[ key ] = settings.admin[ key ];
|
);
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
export const ADMIN_URL = SOURCE.adminUrl;
|
|
||||||
export const COUNTRIES = SOURCE.countries;
|
|
||||||
export const CURRENCY = SOURCE.currency;
|
|
||||||
export const LOCALE = SOURCE.locale;
|
|
||||||
export const ORDER_STATUSES = SOURCE.orderStatuses;
|
|
||||||
export const SITE_TITLE = SOURCE.siteTitle;
|
|
||||||
export const WC_ASSET_URL = SOURCE.wcAssetUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a setting value from the setting state.
|
* Retrieves a setting value from the setting state.
|
||||||
|
@ -42,16 +33,30 @@ export const WC_ASSET_URL = SOURCE.wcAssetUrl;
|
||||||
* @return {*} The value present in the settings state for the given
|
* @return {*} The value present in the settings state for the given
|
||||||
* name.
|
* name.
|
||||||
*/
|
*/
|
||||||
export function getSetting( name, fallback = false, filter = ( val ) => val ) {
|
export function getAdminSetting(
|
||||||
|
name,
|
||||||
|
fallback = false,
|
||||||
|
filter = ( val ) => val
|
||||||
|
) {
|
||||||
if ( mutableSources.includes( name ) ) {
|
if ( mutableSources.includes( name ) ) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
__( 'Mutable settings should be accessed via data store.' )
|
__( 'Mutable settings should be accessed via data store.' )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const value = SOURCE.hasOwnProperty( name ) ? SOURCE[ name ] : fallback;
|
const value = ADMIN_SETTINGS_SOURCE.hasOwnProperty( name )
|
||||||
|
? ADMIN_SETTINGS_SOURCE[ name ]
|
||||||
|
: fallback;
|
||||||
return filter( value, fallback );
|
return filter( value, fallback );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const ADMIN_URL = getSetting( 'adminUrl' );
|
||||||
|
export const COUNTRIES = getSetting( 'countries' );
|
||||||
|
export const CURRENCY = getSetting( 'currency' );
|
||||||
|
export const LOCALE = getSetting( 'locale' );
|
||||||
|
export const SITE_TITLE = getSetting( 'siteTitle' );
|
||||||
|
export const WC_ASSET_URL = getSetting( 'wcAssetUrl' );
|
||||||
|
export const ORDER_STATUSES = getAdminSetting( 'orderStatuses' );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a value to a property on the settings state.
|
* Sets a value to a property on the settings state.
|
||||||
*
|
*
|
||||||
|
@ -67,44 +72,11 @@ export function getSetting( name, fallback = false, filter = ( val ) => val ) {
|
||||||
* to sanitize the setting (eg.
|
* to sanitize the setting (eg.
|
||||||
* ensure it's a number)
|
* ensure it's a number)
|
||||||
*/
|
*/
|
||||||
export function setSetting( name, value, filter = ( val ) => val ) {
|
export function setAdminSetting( name, value, filter = ( val ) => val ) {
|
||||||
if ( mutableSources.includes( name ) ) {
|
if ( mutableSources.includes( name ) ) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
__( 'Mutable settings should be mutated via data store.' )
|
__( 'Mutable settings should be mutated via data store.' )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
SOURCE[ name ] = filter( value );
|
ADMIN_SETTINGS_SOURCE[ name ] = filter( value );
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a string with the site's wp-admin URL appended. JS version of `admin_url`.
|
|
||||||
*
|
|
||||||
* @param {string} path Relative path.
|
|
||||||
* @return {string} Full admin URL.
|
|
||||||
*/
|
|
||||||
export function getAdminLink( path ) {
|
|
||||||
return ( ADMIN_URL || '' ) + path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a script to the page if it has not already been loaded. JS version of `wp_enqueue_script`.
|
|
||||||
*
|
|
||||||
* @param {Object} script WP_Script
|
|
||||||
* @param {string} script.handle Script handle.
|
|
||||||
* @param {string} script.src Script URL.
|
|
||||||
*/
|
|
||||||
export function enqueueScript( script ) {
|
|
||||||
return new Promise( ( resolve, reject ) => {
|
|
||||||
if ( document.querySelector( `#${ script.handle }-js` ) ) {
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
|
|
||||||
const domElement = document.createElement( 'script' );
|
|
||||||
domElement.src = script.src;
|
|
||||||
domElement.id = `${ script.handle }-js`;
|
|
||||||
domElement.async = true;
|
|
||||||
domElement.onload = resolve;
|
|
||||||
domElement.onerror = reject;
|
|
||||||
document.body.appendChild( domElement );
|
|
||||||
} );
|
|
||||||
}
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
/**
|
||||||
|
* Adds a script to the page if it has not already been loaded. JS version of `wp_enqueue_script`.
|
||||||
|
*
|
||||||
|
* @param {Object} script WP_Script
|
||||||
|
* @param {string} script.handle Script handle.
|
||||||
|
* @param {string} script.src Script URL.
|
||||||
|
*/
|
||||||
|
export function enqueueScript( script ) {
|
||||||
|
return new Promise( ( resolve, reject ) => {
|
||||||
|
if ( document.querySelector( `#${ script.handle }-js` ) ) {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
const domElement = document.createElement( 'script' );
|
||||||
|
domElement.src = script.src;
|
||||||
|
domElement.id = `${ script.handle }-js`;
|
||||||
|
domElement.async = true;
|
||||||
|
domElement.onload = resolve;
|
||||||
|
domElement.onerror = reject;
|
||||||
|
document.body.appendChild( domElement );
|
||||||
|
} );
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
import { dispatch } from '@wordpress/data';
|
import { dispatch } from '@wordpress/data';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import domReady from '@wordpress/dom-ready';
|
import domReady from '@wordpress/dom-ready';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
import { queueRecordEvent } from '@woocommerce/tracks';
|
import { queueRecordEvent } from '@woocommerce/tracks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import domReady from '@wordpress/dom-ready';
|
import domReady from '@wordpress/dom-ready';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
domReady( () => {
|
domReady( () => {
|
||||||
const actionButtons = document.querySelector( '.wc-actions' );
|
const actionButtons = document.querySelector( '.wc-actions' );
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { dispatch } from '@wordpress/data';
|
import { dispatch } from '@wordpress/data';
|
||||||
import domReady from '@wordpress/dom-ready';
|
import domReady from '@wordpress/dom-ready';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a notice after product creation.
|
* Displays a notice after product creation.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { dispatch } from '@wordpress/data';
|
import { dispatch } from '@wordpress/data';
|
||||||
import domReady from '@wordpress/dom-ready';
|
import domReady from '@wordpress/dom-ready';
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
import { getAdminLink } from '@woocommerce/settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a promise and resolves when the loader overlay no longer exists.
|
* Returns a promise and resolves when the loader overlay no longer exists.
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
*/
|
*/
|
||||||
import { render } from '@wordpress/element';
|
import { render } from '@wordpress/element';
|
||||||
import { withPluginsHydration } from '@woocommerce/data';
|
import { withPluginsHydration } from '@woocommerce/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import ShippingBanner from './shipping-banner';
|
import ShippingBanner from './shipping-banner';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const metaBox = document.getElementById( 'wc-admin-shipping-banner-root' );
|
const metaBox = document.getElementById( 'wc-admin-shipping-banner-root' );
|
||||||
const args =
|
const args =
|
||||||
|
@ -16,7 +16,7 @@ const args =
|
||||||
|
|
||||||
// Render the header.
|
// Render the header.
|
||||||
const HydratedShippingBanner = withPluginsHydration( {
|
const HydratedShippingBanner = withPluginsHydration( {
|
||||||
...getSetting( 'plugins' ),
|
...getAdminSetting( 'plugins' ),
|
||||||
jetpackStatus: getSetting( 'dataEndpoints', {} ).jetpackStatus,
|
jetpackStatus: getAdminSetting( 'dataEndpoints', {} ).jetpackStatus,
|
||||||
} )( ShippingBanner );
|
} )( ShippingBanner );
|
||||||
render( <HydratedShippingBanner itemsCount={ args.items } />, metaBox );
|
render( <HydratedShippingBanner itemsCount={ args.items } />, metaBox );
|
||||||
|
|
|
@ -10,7 +10,6 @@ import PropTypes from 'prop-types';
|
||||||
import { get, isArray } from 'lodash';
|
import { get, isArray } from 'lodash';
|
||||||
import { PLUGINS_STORE_NAME } from '@woocommerce/data';
|
import { PLUGINS_STORE_NAME } from '@woocommerce/data';
|
||||||
import { withDispatch, withSelect } from '@wordpress/data';
|
import { withDispatch, withSelect } from '@wordpress/data';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
import { recordEvent } from '@woocommerce/tracks';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,8 +19,9 @@ import '../style.scss';
|
||||||
import DismissModal from '../dismiss-modal';
|
import DismissModal from '../dismiss-modal';
|
||||||
import SetupNotice, { setupErrorTypes } from '../setup-notice';
|
import SetupNotice, { setupErrorTypes } from '../setup-notice';
|
||||||
import { getWcsAssets, acceptWcsTos } from '../wcs-api';
|
import { getWcsAssets, acceptWcsTos } from '../wcs-api';
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
const wcAdminAssetUrl = getSetting( 'wcAdminAssetUrl', '' );
|
const wcAdminAssetUrl = getAdminSetting( 'wcAdminAssetUrl', '' );
|
||||||
const wcsPluginSlug = 'woocommerce-services';
|
const wcsPluginSlug = 'woocommerce-services';
|
||||||
|
|
||||||
export class ShippingBanner extends Component {
|
export class ShippingBanner extends Component {
|
||||||
|
|
|
@ -17,7 +17,6 @@ jest.mock( '../../wcs-api.js' );
|
||||||
acceptWcsTos.mockReturnValue( Promise.resolve() );
|
acceptWcsTos.mockReturnValue( Promise.resolve() );
|
||||||
|
|
||||||
jest.mock( '@woocommerce/tracks' );
|
jest.mock( '@woocommerce/tracks' );
|
||||||
jest.mock( '@woocommerce/wc-admin-settings' );
|
|
||||||
|
|
||||||
const wcsPluginSlug = 'woocommerce-services';
|
const wcsPluginSlug = 'woocommerce-services';
|
||||||
|
|
||||||
|
|
|
@ -86,10 +86,6 @@ const webpackConfig = {
|
||||||
__dirname,
|
__dirname,
|
||||||
'../../../node_modules/@wordpress/components/src'
|
'../../../node_modules/@wordpress/components/src'
|
||||||
),
|
),
|
||||||
'@woocommerce/wc-admin-settings': path.resolve(
|
|
||||||
__dirname,
|
|
||||||
'../../../client/wc-admin-settings/index.js'
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
|
@ -9420,16 +9420,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz",
|
||||||
"integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw=="
|
"integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw=="
|
||||||
},
|
},
|
||||||
"@types/yauzl": {
|
|
||||||
"version": "2.9.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz",
|
|
||||||
"integrity": "sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==",
|
|
||||||
"dev": true,
|
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
|
||||||
"@types/node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@typescript-eslint/eslint-plugin": {
|
"@typescript-eslint/eslint-plugin": {
|
||||||
"version": "4.22.1",
|
"version": "4.22.1",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.22.1.tgz",
|
||||||
|
@ -13086,13 +13076,6 @@
|
||||||
"debug": "4.3.1"
|
"debug": "4.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@woocommerce/wc-admin-settings": {
|
|
||||||
"version": "file:packages/wc-admin-settings",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@wordpress/i18n": "3.17.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@wordpress/a11y": {
|
"@wordpress/a11y": {
|
||||||
"version": "2.15.3",
|
"version": "2.15.3",
|
||||||
"resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-2.15.3.tgz",
|
"resolved": "https://registry.npmjs.org/@wordpress/a11y/-/a11y-2.15.3.tgz",
|
||||||
|
@ -15659,6 +15642,18 @@
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"get-stream": "^5.1.0",
|
"get-stream": "^5.1.0",
|
||||||
"yauzl": "^2.10.0"
|
"yauzl": "^2.10.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/yauzl": {
|
||||||
|
"version": "2.9.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz",
|
||||||
|
"integrity": "sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==",
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"file-entry-cache": {
|
"file-entry-cache": {
|
||||||
|
@ -16830,6 +16825,36 @@
|
||||||
"tar-fs": "^2.0.0",
|
"tar-fs": "^2.0.0",
|
||||||
"unbzip2-stream": "^1.3.3",
|
"unbzip2-stream": "^1.3.3",
|
||||||
"ws": "^7.2.3"
|
"ws": "^7.2.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"chownr": {
|
||||||
|
"version": "1.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
|
||||||
|
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"tar-fs": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"chownr": "^1.1.1",
|
||||||
|
"mkdirp-classic": "^0.5.2",
|
||||||
|
"pump": "^3.0.0",
|
||||||
|
"tar-stream": "^2.1.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unbzip2-stream": {
|
||||||
|
"version": "1.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",
|
||||||
|
"integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"buffer": "^5.2.1",
|
||||||
|
"through": "^2.3.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"read-pkg": {
|
"read-pkg": {
|
||||||
|
@ -42424,18 +42449,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tar-fs": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
|
|
||||||
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"chownr": "^1.1.1",
|
|
||||||
"mkdirp-classic": "^0.5.2",
|
|
||||||
"pump": "^3.0.0",
|
|
||||||
"tar-stream": "^2.1.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tar-stream": {
|
"tar-stream": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
|
||||||
|
@ -43346,16 +43359,6 @@
|
||||||
"which-boxed-primitive": "^1.0.2"
|
"which-boxed-primitive": "^1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"unbzip2-stream": {
|
|
||||||
"version": "1.4.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",
|
|
||||||
"integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"buffer": "^5.2.1",
|
|
||||||
"through": "^2.3.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"unc-path-regex": {
|
"unc-path-regex": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
|
||||||
|
|
|
@ -185,7 +185,6 @@
|
||||||
"@woocommerce/onboarding": "file:packages/onboarding",
|
"@woocommerce/onboarding": "file:packages/onboarding",
|
||||||
"@woocommerce/style-build": "file:packages/style-build",
|
"@woocommerce/style-build": "file:packages/style-build",
|
||||||
"@woocommerce/tracks": "file:packages/tracks",
|
"@woocommerce/tracks": "file:packages/tracks",
|
||||||
"@woocommerce/wc-admin-settings": "file:packages/wc-admin-settings",
|
|
||||||
"@wordpress/babel-plugin-makepot": "2.1.3",
|
"@wordpress/babel-plugin-makepot": "2.1.3",
|
||||||
"@wordpress/babel-preset-default": "^6.2.0",
|
"@wordpress/babel-preset-default": "^6.2.0",
|
||||||
"@wordpress/browserslist-config": "4.0.1",
|
"@wordpress/browserslist-config": "4.0.1",
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
- Fix select-control component label/value alignment. #8045
|
- Fix select-control component label/value alignment. #8045
|
||||||
- Fix clicking the error message opens the dropdown. #8094
|
- Fix clicking the error message opens the dropdown. #8094
|
||||||
- Fix misaligned "Rows per page" dropdown. #8113
|
- Fix misaligned "Rows per page" dropdown. #8113
|
||||||
|
- Remove dev dependency `@woocommerce/wc-admin-settings`. #8057
|
||||||
|
|
||||||
# 8.1.1
|
# 8.1.1
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,6 @@
|
||||||
"@testing-library/react": "11.2.7",
|
"@testing-library/react": "11.2.7",
|
||||||
"@testing-library/user-event": "13.2.1",
|
"@testing-library/user-event": "13.2.1",
|
||||||
"@woocommerce/style-build": "file:../style-build",
|
"@woocommerce/style-build": "file:../style-build",
|
||||||
"@woocommerce/wc-admin-settings": "file:../wc-admin-settings",
|
|
||||||
"@wordpress/scripts": "12.6.1",
|
"@wordpress/scripts": "12.6.1",
|
||||||
"concurrently": "5.3.0"
|
"concurrently": "5.3.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { AdvancedFilters } from '@woocommerce/components';
|
import { AdvancedFilters } from '@woocommerce/components';
|
||||||
import { CURRENCY } from '@woocommerce/wc-admin-settings';
|
import { getSetting } from '@woocommerce/settings';
|
||||||
|
|
||||||
const ORDER_STATUSES = {
|
const ORDER_STATUSES = {
|
||||||
cancelled: 'Cancelled',
|
cancelled: 'Cancelled',
|
||||||
|
@ -15,7 +15,7 @@ const ORDER_STATUSES = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const siteLocale = 'en_US';
|
const siteLocale = 'en_US';
|
||||||
|
const currency = getSetting( 'currency' );
|
||||||
const path = new URL( document.location ).searchParams.get( 'path' );
|
const path = new URL( document.location ).searchParams.get( 'path' );
|
||||||
const query = {
|
const query = {
|
||||||
component: 'advanced-filters',
|
component: 'advanced-filters',
|
||||||
|
@ -181,7 +181,7 @@ export const Basic = () => (
|
||||||
query={ query }
|
query={ query }
|
||||||
filterTitle="Orders"
|
filterTitle="Orders"
|
||||||
config={ advancedFilters }
|
config={ advancedFilters }
|
||||||
currency={ CURRENCY }
|
currency={ currency }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import { AdvancedFilters } from '@woocommerce/components';
|
import { AdvancedFilters } from '@woocommerce/components';
|
||||||
import { CURRENCY } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { createElement } from '@wordpress/element';
|
import { createElement } from '@wordpress/element';
|
||||||
|
|
||||||
const ORDER_STATUSES = {
|
const ORDER_STATUSES = {
|
||||||
|
@ -20,6 +19,16 @@ const ORDER_STATUSES = {
|
||||||
refunded: 'Refunded',
|
refunded: 'Refunded',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const CURRENCY = {
|
||||||
|
code: 'USD',
|
||||||
|
decimalSeparator: '.',
|
||||||
|
precision: 2,
|
||||||
|
priceFormat: '%1$s%2$s',
|
||||||
|
symbol: '$',
|
||||||
|
symbolPosition: 'left',
|
||||||
|
thousandSeparator: ',',
|
||||||
|
};
|
||||||
|
|
||||||
const advancedFiltersConfig = {
|
const advancedFiltersConfig = {
|
||||||
title: 'Orders Match {{select /}} Filters',
|
title: 'Orders Match {{select /}} Filters',
|
||||||
filters: {
|
filters: {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import { setSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
import { createElement } from '@wordpress/element';
|
import { createElement } from '@wordpress/element';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,15 +73,10 @@ describe( 'ProductImage', () => {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
test( 'should render a placeholder image if no product images are found', () => {
|
test( 'should render a placeholder image if no product images are found', () => {
|
||||||
setSetting(
|
|
||||||
'wcAssetUrl',
|
|
||||||
'https://woocommerce.com/wp-content/plugins/woocommerce/assets/'
|
|
||||||
);
|
|
||||||
const product = {
|
const product = {
|
||||||
name: 'Test Product',
|
name: 'Test Product',
|
||||||
};
|
};
|
||||||
const { container } = render( <ProductImage product={ product } /> );
|
const { container } = render( <ProductImage product={ product } /> );
|
||||||
expect( container ).toMatchSnapshot();
|
expect( container ).toMatchSnapshot();
|
||||||
setSetting( 'wcAssetUrl', '' );
|
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
- Add backwards compability for old function format. #7688
|
- Add backwards compability for old function format. #7688
|
||||||
- Add console warning for inbox note contents exceeding 320 characters and add dompurify dependency. #7869
|
- Add console warning for inbox note contents exceeding 320 characters and add dompurify dependency. #7869
|
||||||
- Fix race condition in data package's options module. #7947
|
- Fix race condition in data package's options module. #7947
|
||||||
|
- Remove dev dependency `@woocommerce/wc-admin-settings`. #8057
|
||||||
|
|
||||||
# 1.4.0
|
# 1.4.0
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,6 @@
|
||||||
"qs": "6.9.6",
|
"qs": "6.9.6",
|
||||||
"rememo": "^3.0.0"
|
"rememo": "^3.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
|
||||||
"@woocommerce/wc-admin-settings": "file:../wc-admin-settings"
|
|
||||||
},
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,11 +2,6 @@
|
||||||
* @jest-environment node
|
* @jest-environment node
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* External dependencies
|
|
||||||
*/
|
|
||||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
jest.mock( '@wordpress/data-controls', () => ( {
|
jest.mock( '@wordpress/data-controls', () => ( {
|
||||||
apiFetch: jest.fn(),
|
apiFetch: jest.fn(),
|
||||||
} ) );
|
} ) );
|
||||||
|
@ -39,6 +34,10 @@ global.window = {
|
||||||
} as Location,
|
} as Location,
|
||||||
} as Window & typeof globalThis;
|
} as Window & typeof globalThis;
|
||||||
|
|
||||||
|
function getAdminLink( path: string ) {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
describe( 'installJetPackAndConnect', () => {
|
describe( 'installJetPackAndConnect', () => {
|
||||||
beforeEach( () => {
|
beforeEach( () => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
# Unreleased
|
||||||
|
|
||||||
|
- Remove dev dependency `@woocommerce/wc-admin-settings`. #8057
|
||||||
|
|
||||||
# 3.1.0
|
# 3.1.0
|
||||||
|
|
||||||
- Fix commonjs module build, allow package to be built in isolation. #7286
|
- Fix commonjs module build, allow package to be built in isolation. #7286
|
||||||
|
|
|
@ -26,9 +26,6 @@
|
||||||
"moment": "2.29.1",
|
"moment": "2.29.1",
|
||||||
"qs": "6.9.6"
|
"qs": "6.9.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
|
||||||
"@woocommerce/wc-admin-settings": "file:../wc-admin-settings"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"lodash": "^4.17.0"
|
"lodash": "^4.17.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* External dependencies
|
* External dependencies
|
||||||
*/
|
*/
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
|
@ -719,7 +718,10 @@ describe( 'getRangeLabel', () => {
|
||||||
} );
|
} );
|
||||||
|
|
||||||
describe( 'loadLocaleData', () => {
|
describe( 'loadLocaleData', () => {
|
||||||
const originalLocale = getSetting( 'locale' );
|
const originalLocale = {
|
||||||
|
siteLocale: 'en_US',
|
||||||
|
userLocale: 'en_US',
|
||||||
|
};
|
||||||
beforeEach( () => {
|
beforeEach( () => {
|
||||||
// Reset to default settings
|
// Reset to default settings
|
||||||
loadLocaleData( originalLocale );
|
loadLocaleData( originalLocale );
|
||||||
|
|
|
@ -6,6 +6,10 @@ const path = require( 'path' );
|
||||||
module.exports = {
|
module.exports = {
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
tinymce: path.resolve( __dirname, 'build/mocks/tinymce' ),
|
tinymce: path.resolve( __dirname, 'build/mocks/tinymce' ),
|
||||||
|
'@woocommerce/settings': path.resolve(
|
||||||
|
__dirname,
|
||||||
|
'build/mocks/woocommerce-settings'
|
||||||
|
),
|
||||||
'~/(.*)': path.resolve( __dirname, '../../client/$1' ),
|
'~/(.*)': path.resolve( __dirname, '../../client/$1' ),
|
||||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
module.exports = {
|
||||||
|
getSetting: ( key, backup ) => {
|
||||||
|
return global.wcSettings[ key ] || backup;
|
||||||
|
},
|
||||||
|
getAdminLink: ( path ) => {
|
||||||
|
if ( global.wcSettings && global.wcSettings.adminUrl ) {
|
||||||
|
return global.wcSettings.adminUrl + path;
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
},
|
||||||
|
};
|
|
@ -54,43 +54,45 @@ global.wcSettings = {
|
||||||
userLocale: 'en_US',
|
userLocale: 'en_US',
|
||||||
weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
|
weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],
|
||||||
},
|
},
|
||||||
orderStatuses: {
|
admin: {
|
||||||
pending: 'Pending payment',
|
orderStatuses: {
|
||||||
processing: 'Processing',
|
pending: 'Pending payment',
|
||||||
'on-hold': 'On hold',
|
processing: 'Processing',
|
||||||
completed: 'Completed',
|
'on-hold': 'On hold',
|
||||||
cancelled: 'Cancelled',
|
completed: 'Completed',
|
||||||
refunded: 'Refunded',
|
cancelled: 'Cancelled',
|
||||||
failed: 'Failed',
|
refunded: 'Refunded',
|
||||||
},
|
failed: 'Failed',
|
||||||
wcAdminSettings: {
|
},
|
||||||
woocommerce_actionable_order_statuses: [],
|
wcAdminSettings: {
|
||||||
woocommerce_excluded_report_order_statuses: [],
|
woocommerce_actionable_order_statuses: [],
|
||||||
},
|
woocommerce_excluded_report_order_statuses: [],
|
||||||
dataEndpoints: {
|
},
|
||||||
countries: [],
|
dataEndpoints: {
|
||||||
performanceIndicators: [
|
countries: [],
|
||||||
{
|
performanceIndicators: [
|
||||||
chart: 'total_sales',
|
{
|
||||||
label: 'Total sales',
|
chart: 'total_sales',
|
||||||
stat: 'revenue/total_sales',
|
label: 'Total sales',
|
||||||
},
|
stat: 'revenue/total_sales',
|
||||||
{
|
},
|
||||||
chart: 'net_revenue',
|
{
|
||||||
label: 'Net sales',
|
chart: 'net_revenue',
|
||||||
stat: 'revenue/net_revenue',
|
label: 'Net sales',
|
||||||
},
|
stat: 'revenue/net_revenue',
|
||||||
{
|
},
|
||||||
chart: 'orders_count',
|
{
|
||||||
label: 'Orders',
|
chart: 'orders_count',
|
||||||
stat: 'orders/orders_count',
|
label: 'Orders',
|
||||||
},
|
stat: 'orders/orders_count',
|
||||||
{
|
},
|
||||||
chart: 'items_sold',
|
{
|
||||||
label: 'Items sold',
|
chart: 'items_sold',
|
||||||
stat: 'products/items_sold',
|
label: 'Items sold',
|
||||||
},
|
stat: 'products/items_sold',
|
||||||
],
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
package-lock=false
|
|
|
@ -1,119 +0,0 @@
|
||||||
{
|
|
||||||
"name": "@woocommerce/wc-admin-settings",
|
|
||||||
"version": "1.1.0",
|
|
||||||
"lockfileVersion": 1,
|
|
||||||
"requires": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/runtime": {
|
|
||||||
"version": "7.15.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz",
|
|
||||||
"integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==",
|
|
||||||
"requires": {
|
|
||||||
"regenerator-runtime": "^0.13.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@tannin/compile": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tannin/compile/-/compile-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-n8m9eNDfoNZoxdvWiTfW/hSPhehzLJ3zW7f8E7oT6mCROoMNWCB4TYtv041+2FMAxweiE0j7i1jubQU4MEC/Gg==",
|
|
||||||
"requires": {
|
|
||||||
"@tannin/evaluate": "^1.2.0",
|
|
||||||
"@tannin/postfix": "^1.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@tannin/evaluate": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tannin/evaluate/-/evaluate-1.2.0.tgz",
|
|
||||||
"integrity": "sha512-3ioXvNowbO/wSrxsDG5DKIMxC81P0QrQTYai8zFNY+umuoHWRPbQ/TuuDEOju9E+jQDXmj6yI5GyejNuh8I+eg=="
|
|
||||||
},
|
|
||||||
"@tannin/plural-forms": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tannin/plural-forms/-/plural-forms-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-xl9R2mDZO/qiHam1AgMnAES6IKIg7OBhcXqy6eDsRCdXuxAFPcjrej9HMjyCLE0DJ/8cHf0i5OQTstuBRhpbHw==",
|
|
||||||
"requires": {
|
|
||||||
"@tannin/compile": "^1.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@tannin/postfix": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tannin/postfix/-/postfix-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-oocsqY7g0cR+Gur5jRQLSrX2OtpMLMse1I10JQBm8CdGMrDkh1Mg2gjsiquMHRtBs4Qwu5wgEp5GgIYHk4SNPw=="
|
|
||||||
},
|
|
||||||
"@wordpress/i18n": {
|
|
||||||
"version": "3.17.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.17.0.tgz",
|
|
||||||
"integrity": "sha512-CTZ0oezI6BT5GlmiE4X0fzRY6i7bNsX6hxiROkGlpREY6q4s1pnwhM8ggLIaP18Bvkb/HDkUEENDrv3iwM/LIQ==",
|
|
||||||
"requires": {
|
|
||||||
"@babel/runtime": "^7.12.5",
|
|
||||||
"gettext-parser": "^1.3.1",
|
|
||||||
"lodash": "^4.17.19",
|
|
||||||
"memize": "^1.1.0",
|
|
||||||
"sprintf-js": "^1.1.1",
|
|
||||||
"tannin": "^1.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"encoding": {
|
|
||||||
"version": "0.1.13",
|
|
||||||
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
|
|
||||||
"integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
|
|
||||||
"requires": {
|
|
||||||
"iconv-lite": "^0.6.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gettext-parser": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==",
|
|
||||||
"requires": {
|
|
||||||
"encoding": "^0.1.12",
|
|
||||||
"safe-buffer": "^5.1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"iconv-lite": {
|
|
||||||
"version": "0.6.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
|
||||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
|
||||||
"requires": {
|
|
||||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.21",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
|
||||||
},
|
|
||||||
"memize": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/memize/-/memize-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-K4FcPETOMTwe7KL2LK0orMhpOmWD2wRGwWWpbZy0fyArwsyIKR8YJVz8+efBAh3BO4zPqlSICu4vsLTRRqtFAg=="
|
|
||||||
},
|
|
||||||
"regenerator-runtime": {
|
|
||||||
"version": "0.13.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
|
|
||||||
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
|
|
||||||
},
|
|
||||||
"safe-buffer": {
|
|
||||||
"version": "5.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
|
||||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
|
||||||
},
|
|
||||||
"safer-buffer": {
|
|
||||||
"version": "2.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
|
||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
|
||||||
},
|
|
||||||
"sprintf-js": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
|
|
||||||
"integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug=="
|
|
||||||
},
|
|
||||||
"tannin": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/tannin/-/tannin-1.2.0.tgz",
|
|
||||||
"integrity": "sha512-U7GgX/RcSeUETbV7gYgoz8PD7Ni4y95pgIP/Z6ayI3CfhSujwKEBlGFTCRN+Aqnuyf4AN2yHL+L8x+TCGjb9uA==",
|
|
||||||
"requires": {
|
|
||||||
"@tannin/plural-forms": "^1.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
"name": "@woocommerce/wc-admin-settings",
|
|
||||||
"version": "1.1.0",
|
|
||||||
"description": "Wrapper around the wcSettings object - used for development.",
|
|
||||||
"author": "Automattic",
|
|
||||||
"license": "GPL-2.0-or-later",
|
|
||||||
"homepage": "https://github.com/woocommerce/woocommerce-admin/tree/main/packages/wc-admin-settings/README.md",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/woocommerce/woocommerce-admin.git",
|
|
||||||
"directory": "packages/wc-admin-settings"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/woocommerce/woocommerce-admin/issues"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"index.js"
|
|
||||||
],
|
|
||||||
"main": "build/index.js",
|
|
||||||
"module": "build-module/index.js",
|
|
||||||
"private": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@wordpress/i18n": "3.17.0"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"clean": "npx rimraf tsconfig.tsbuildinfo build build-*",
|
|
||||||
"build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json",
|
|
||||||
"prepack": "npm run clean && npm run build",
|
|
||||||
"start": "tsc --build --watch"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../tsconfig-cjs",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "build",
|
|
||||||
"declaration": true
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "../tsconfig",
|
|
||||||
"compilerOptions": {
|
|
||||||
"rootDir": "src",
|
|
||||||
"outDir": "build-module",
|
|
||||||
"declaration": true
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue