Fix dependency declarations (https://github.com/woocommerce/woocommerce-admin/pull/4972)
* renmove WC comment block * client routes * more fixes * moar search * getting there * by hand now * david beating goliath * mission accomplished * client filepath * save * got it * remove script * fixes * deal with package internal dep * remove webpack alias * fix webpack relative paths * remove commented rule * remove extra line * remove unused modules entry
This commit is contained in:
parent
d5abba63f7
commit
c145783e0a
|
@ -15,7 +15,6 @@ module.exports = {
|
|||
'jsdoc/require-property-name': 'warn',
|
||||
'jsdoc/check-property-names': 'warn',
|
||||
'jsdoc/require-property-type': 'warn',
|
||||
'@woocommerce/dependency-group': 'warn',
|
||||
'jsdoc/valid-types': 'warn',
|
||||
'jsdoc/check-tag-names': 'warn',
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@ const { get, map } = require( 'lodash' );
|
|||
const babel = require( '@babel/core' );
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
* External dependencies
|
||||
*/
|
||||
const { options: babelDefaultConfig } = babel.loadPartialConfig( {
|
||||
configFile: '@wordpress/babel-preset-default',
|
||||
|
@ -14,47 +14,32 @@ const plugins = babelDefaultConfig.plugins;
|
|||
|
||||
const overrideOptions = ( target, targetName, options ) => {
|
||||
if ( get( target, [ 'file', 'request' ] ) === targetName ) {
|
||||
return [ targetName, Object.assign(
|
||||
{},
|
||||
target.options,
|
||||
options
|
||||
) ];
|
||||
return [ targetName, Object.assign( {}, target.options, options ) ];
|
||||
}
|
||||
return target;
|
||||
};
|
||||
|
||||
const babelConfigs = {
|
||||
main: Object.assign(
|
||||
{},
|
||||
babelDefaultConfig,
|
||||
{
|
||||
plugins,
|
||||
presets: map(
|
||||
babelDefaultConfig.presets,
|
||||
( preset ) => overrideOptions( preset, '@babel/preset-env', {
|
||||
modules: 'commonjs',
|
||||
} )
|
||||
),
|
||||
}
|
||||
),
|
||||
module: Object.assign(
|
||||
{},
|
||||
babelDefaultConfig,
|
||||
{
|
||||
plugins: map(
|
||||
plugins,
|
||||
( plugin ) => overrideOptions( plugin, '@babel/plugin-transform-runtime', {
|
||||
useESModules: true,
|
||||
} )
|
||||
),
|
||||
presets: map(
|
||||
babelDefaultConfig.presets,
|
||||
( preset ) => overrideOptions( preset, '@babel/preset-env', {
|
||||
modules: false,
|
||||
} )
|
||||
),
|
||||
}
|
||||
),
|
||||
main: Object.assign( {}, babelDefaultConfig, {
|
||||
plugins,
|
||||
presets: map( babelDefaultConfig.presets, ( preset ) =>
|
||||
overrideOptions( preset, '@babel/preset-env', {
|
||||
modules: 'commonjs',
|
||||
} )
|
||||
),
|
||||
} ),
|
||||
module: Object.assign( {}, babelDefaultConfig, {
|
||||
plugins: map( plugins, ( plugin ) =>
|
||||
overrideOptions( plugin, '@babel/plugin-transform-runtime', {
|
||||
useESModules: true,
|
||||
} )
|
||||
),
|
||||
presets: map( babelDefaultConfig.presets, ( preset ) =>
|
||||
overrideOptions( preset, '@babel/preset-env', {
|
||||
modules: false,
|
||||
} )
|
||||
),
|
||||
} ),
|
||||
};
|
||||
|
||||
function getBabelConfig( environment ) {
|
||||
|
|
|
@ -5,10 +5,6 @@ import { __ } from '@wordpress/i18n';
|
|||
import { Component } from '@wordpress/element';
|
||||
import { compose } from '@wordpress/compose';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Card, EmptyTable, TableCard } from '@woocommerce/components';
|
||||
import { getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||
|
@ -16,11 +12,11 @@ import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getLeaderboard } from 'wc-api/items/utils';
|
||||
import ReportError from 'analytics/components/report-error';
|
||||
import sanitizeHTML from 'lib/sanitize-html';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { getFilterQuery } from 'wc-api/reports/utils';
|
||||
import { getLeaderboard } from '../../../wc-api/items/utils';
|
||||
import ReportError from '../report-error';
|
||||
import sanitizeHTML from '../../../lib/sanitize-html';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { getFilterQuery } from '../../../wc-api/reports/utils';
|
||||
import './style.scss';
|
||||
|
||||
export class Leaderboard extends Component {
|
||||
|
|
|
@ -2,19 +2,15 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { mount, shallow } from 'enzyme';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { numberFormat } from '@woocommerce/number';
|
||||
import CurrencyFactory from '@woocommerce/currency';
|
||||
import { CURRENCY } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { Leaderboard } from '../';
|
||||
import mockData from '../data/top-selling-products-mock-data';
|
||||
import { CURRENCY } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
const { formatAmount, formatDecimal } = CurrencyFactory( CURRENCY );
|
||||
|
||||
|
|
|
@ -7,9 +7,11 @@ import { compose } from '@wordpress/compose';
|
|||
import { format as formatDate } from '@wordpress/date';
|
||||
import { get, isEqual } from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Chart } from '@woocommerce/components';
|
||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
* Internal dependencies
|
||||
*/
|
||||
import {
|
||||
getAllowedIntervalsForQuery,
|
||||
|
@ -18,20 +20,14 @@ import {
|
|||
getIntervalForQuery,
|
||||
getChartTypeForQuery,
|
||||
getPreviousDate,
|
||||
} from 'lib/date';
|
||||
import { Chart } from '@woocommerce/components';
|
||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
} from '../../../lib/date';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
import {
|
||||
getReportChartData,
|
||||
getTooltipValueFormat,
|
||||
} from 'wc-api/reports/utils';
|
||||
import ReportError from 'analytics/components/report-error';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
} from '../../../wc-api/reports/utils';
|
||||
import ReportError from '../report-error';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { getChartMode, getSelectedFilter } from './utils';
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { find, get } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { flattenFilters } from '@woocommerce/navigation';
|
||||
|
||||
export const DEFAULT_FILTER = 'all';
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { Component } from '@wordpress/element';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { EmptyContent } from '@woocommerce/components';
|
||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
|
|
|
@ -5,10 +5,6 @@ import { Component } from '@wordpress/element';
|
|||
import PropTypes from 'prop-types';
|
||||
import { omitBy, isUndefined, snakeCase } from 'lodash';
|
||||
import { withSelect } from '@wordpress/data';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { ReportFilters as Filters } from '@woocommerce/components';
|
||||
import { LOCALE } from '@woocommerce/wc-admin-settings';
|
||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||
|
@ -16,13 +12,13 @@ import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
import {
|
||||
getCurrentDates,
|
||||
getDateParamsFromQuery,
|
||||
isoDateFormat,
|
||||
} from 'lib/date';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
} from '../../../lib/date';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
class ReportFilters extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -5,11 +5,6 @@ import { __ } from '@wordpress/i18n';
|
|||
import { Component } from '@wordpress/element';
|
||||
import { compose } from '@wordpress/compose';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getDateParamsFromQuery } from 'lib/date';
|
||||
import { getNewPath } from '@woocommerce/navigation';
|
||||
import {
|
||||
SummaryList,
|
||||
|
@ -22,11 +17,12 @@ import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getSummaryNumbers } from 'wc-api/reports/utils';
|
||||
import ReportError from 'analytics/components/report-error';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { getDateParamsFromQuery } from '../../../lib/date';
|
||||
import { getSummaryNumbers } from '../../../wc-api/reports/utils';
|
||||
import ReportError from '../report-error';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
/**
|
||||
* Component to render summary numbers in reports.
|
||||
|
|
|
@ -11,12 +11,7 @@ import { get, noop, partial, uniq } from 'lodash';
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import classnames from 'classnames';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { CompareButton, Search, TableCard } from '@woocommerce/components';
|
||||
import DownloadIcon from './download-icon';
|
||||
import {
|
||||
getIdsFromQuery,
|
||||
getSearchWords,
|
||||
|
@ -33,12 +28,16 @@ import { SETTINGS_STORE_NAME, useUserPreferences } from '@woocommerce/data';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportError from 'analytics/components/report-error';
|
||||
import { getReportChartData, getReportTableData } from 'wc-api/reports/utils';
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import DownloadIcon from './download-icon';
|
||||
import ReportError from '../report-error';
|
||||
import {
|
||||
getReportChartData,
|
||||
getReportTableData,
|
||||
} from '../../../wc-api/reports/utils';
|
||||
import { QUERY_DEFAULTS } from '../../../wc-api/constants';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { extendTableData } from './utils';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
import './style.scss';
|
||||
|
||||
const TABLE_FILTER = 'woocommerce_admin_report_table';
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
import { Component } from '@wordpress/element';
|
||||
import { first, last } from 'lodash';
|
||||
import { Spinner } from '@wordpress/components';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Link } from '@woocommerce/components';
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import { applyFilters } from '@wordpress/hooks';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getCategoryLabels } from 'lib/async-requests';
|
||||
import { getCategoryLabels } from '../../../lib/async-requests';
|
||||
|
||||
const CATEGORY_REPORT_CHARTS_FILTER =
|
||||
'woocommerce_admin_categories_report_charts';
|
||||
|
|
|
@ -10,11 +10,11 @@ import { __ } from '@wordpress/i18n';
|
|||
*/
|
||||
import { advancedFilters, charts, filters } from './config';
|
||||
import CategoriesReportTable from './table';
|
||||
import getSelectedChart from 'lib/get-selected-chart';
|
||||
import ReportChart from 'analytics/components/report-chart';
|
||||
import ReportSummary from 'analytics/components/report-summary';
|
||||
import getSelectedChart from '../../../lib/get-selected-chart';
|
||||
import ReportChart from '../../components/report-chart';
|
||||
import ReportSummary from '../../components/report-summary';
|
||||
import ProductsReportTable from '../products/table';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
export default class CategoriesReport extends Component {
|
||||
getChartMeta() {
|
||||
|
|
|
@ -5,10 +5,6 @@ import { __, _n } from '@wordpress/i18n';
|
|||
import { Component } from '@wordpress/element';
|
||||
import { compose } from '@wordpress/compose';
|
||||
import { map } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { Link } from '@woocommerce/components';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
|
@ -17,9 +13,9 @@ import { formatValue } from '@woocommerce/number';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import CategoryBreacrumbs from './breadcrumbs';
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
class CategoriesReportTable extends Component {
|
||||
constructor( props ) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import { applyFilters } from '@wordpress/hooks';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getCouponLabels } from 'lib/async-requests';
|
||||
import { getCouponLabels } from '../../../lib/async-requests';
|
||||
|
||||
const COUPON_REPORT_CHARTS_FILTER = 'woocommerce_admin_coupons_report_charts';
|
||||
const COUPON_REPORT_FILTERS_FILTER = 'woocommerce_admin_coupons_report_filters';
|
||||
|
|
|
@ -10,10 +10,10 @@ import { __ } from '@wordpress/i18n';
|
|||
*/
|
||||
import { advancedFilters, charts, filters } from './config';
|
||||
import CouponsReportTable from './table';
|
||||
import getSelectedChart from 'lib/get-selected-chart';
|
||||
import ReportChart from 'analytics/components/report-chart';
|
||||
import ReportSummary from 'analytics/components/report-summary';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import getSelectedChart from '../../../lib/get-selected-chart';
|
||||
import ReportChart from '../../components/report-chart';
|
||||
import ReportSummary from '../../components/report-summary';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
export default class CouponsReport extends Component {
|
||||
getChartMeta() {
|
||||
|
|
|
@ -4,12 +4,7 @@
|
|||
import { __, _n } from '@wordpress/i18n';
|
||||
import { Component } from '@wordpress/element';
|
||||
import { map } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Date, Link } from '@woocommerce/components';
|
||||
import { defaultTableDateFormat } from 'lib/date';
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
@ -17,8 +12,9 @@ import { getSetting } from '@woocommerce/wc-admin-settings';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { defaultTableDateFormat } from '../../../lib/date';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
class CouponsReportTable extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -11,8 +11,11 @@ const { countries } = getSetting( 'dataEndpoints', { countries: {} } );
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getCustomerLabels, getRequestByIdString } from 'lib/async-requests';
|
||||
import { NAMESPACE } from 'wc-api/constants';
|
||||
import {
|
||||
getCustomerLabels,
|
||||
getRequestByIdString,
|
||||
} from '../../../lib/async-requests';
|
||||
import { NAMESPACE } from '../../../wc-api/constants';
|
||||
|
||||
const CUSTOMERS_REPORT_FILTERS_FILTER =
|
||||
'woocommerce_admin_customers_report_filters';
|
||||
|
|
|
@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
|
|||
*/
|
||||
import { filters, advancedFilters } from './config';
|
||||
import CustomersReportTable from './table';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
export default class CustomersReport extends Component {
|
||||
render() {
|
||||
|
|
|
@ -4,22 +4,18 @@
|
|||
import { __, _n } from '@wordpress/i18n';
|
||||
import { Component, Fragment } from '@wordpress/element';
|
||||
import { Tooltip } from '@wordpress/components';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Date, Link } from '@woocommerce/components';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import { defaultTableDateFormat } from 'lib/date';
|
||||
|
||||
const { countries } = getSetting( 'dataEndpoints', { countries: {} } );
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { defaultTableDateFormat } from '../../../lib/date';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
class CustomersReportTable extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -7,7 +7,10 @@ import { applyFilters } from '@wordpress/hooks';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getCustomerLabels, getProductLabels } from 'lib/async-requests';
|
||||
import {
|
||||
getCustomerLabels,
|
||||
getProductLabels,
|
||||
} from '../../../lib/async-requests';
|
||||
|
||||
const DOWLOADS_REPORT_CHARTS_FILTER =
|
||||
'woocommerce_admin_downloads_report_charts';
|
||||
|
|
|
@ -9,10 +9,10 @@ import PropTypes from 'prop-types';
|
|||
*/
|
||||
import { charts, filters, advancedFilters } from './config';
|
||||
import DownloadsReportTable from './table';
|
||||
import getSelectedChart from 'lib/get-selected-chart';
|
||||
import ReportChart from 'analytics/components/report-chart';
|
||||
import ReportSummary from 'analytics/components/report-summary';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import getSelectedChart from '../../../lib/get-selected-chart';
|
||||
import ReportChart from '../../components/report-chart';
|
||||
import ReportSummary from '../../components/report-summary';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
export default class DownloadsReport extends Component {
|
||||
render() {
|
||||
|
|
|
@ -6,11 +6,6 @@ import { Component } from '@wordpress/element';
|
|||
import { withSelect } from '@wordpress/data';
|
||||
import { map } from 'lodash';
|
||||
import moment from 'moment';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getCurrentDates, defaultTableDateFormat } from 'lib/date';
|
||||
import { Date, Link } from '@woocommerce/components';
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
|
@ -20,8 +15,9 @@ import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { getCurrentDates, defaultTableDateFormat } from '../../../lib/date';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
class CouponsReportTable extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -6,9 +6,11 @@ import { applyFilters } from '@wordpress/hooks';
|
|||
import { lazy } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getSetting } from '../../settings';
|
||||
import { REPORTS_FILTER } from './index';
|
||||
|
||||
const manageStock = getSetting( 'manageStock', 'no' );
|
||||
|
||||
/**
|
||||
|
@ -44,8 +46,6 @@ const CustomersReport = lazy( () =>
|
|||
import( /* webpackChunkName: "analytics-report-customers" */ './customers' )
|
||||
);
|
||||
|
||||
import { REPORTS_FILTER } from './index';
|
||||
|
||||
export default () => {
|
||||
const reports = [
|
||||
{
|
||||
|
|
|
@ -5,10 +5,6 @@ import { Component } from '@wordpress/element';
|
|||
import { compose } from '@wordpress/compose';
|
||||
import PropTypes from 'prop-types';
|
||||
import { find } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { useFilters } from '@woocommerce/components';
|
||||
import { getQuery, getSearchWords } from '@woocommerce/navigation';
|
||||
|
||||
|
@ -16,13 +12,13 @@ import { getQuery, getSearchWords } from '@woocommerce/navigation';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import './style.scss';
|
||||
import ReportError from 'analytics/components/report-error';
|
||||
import { searchItemsByString } from 'wc-api/items/utils';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import ReportError from '../components/report-error';
|
||||
import { searchItemsByString } from '../../wc-api/items/utils';
|
||||
import withSelect from '../../wc-api/with-select';
|
||||
import {
|
||||
CurrencyContext,
|
||||
getFilteredCurrencyInstance,
|
||||
} from 'lib/currency-context';
|
||||
} from '../../lib/currency-context';
|
||||
import getReports from './get-reports';
|
||||
|
||||
export const REPORTS_FILTER = 'woocommerce_admin_reports_list';
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
getCouponLabels,
|
||||
getProductLabels,
|
||||
getTaxRateLabels,
|
||||
} from 'lib/async-requests';
|
||||
} from '../../../lib/async-requests';
|
||||
|
||||
const ORDERS_REPORT_CHARTS_FILTER = 'woocommerce_admin_orders_report_charts';
|
||||
const ORDERS_REPORT_FILTERS_FILTER = 'woocommerce_admin_orders_report_filters';
|
||||
|
|
|
@ -8,11 +8,11 @@ import PropTypes from 'prop-types';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import { advancedFilters, charts, filters } from './config';
|
||||
import getSelectedChart from 'lib/get-selected-chart';
|
||||
import getSelectedChart from '../../../lib/get-selected-chart';
|
||||
import OrdersReportTable from './table';
|
||||
import ReportChart from 'analytics/components/report-chart';
|
||||
import ReportSummary from 'analytics/components/report-summary';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import ReportChart from '../../components/report-chart';
|
||||
import ReportSummary from '../../components/report-summary';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
export default class OrdersReport extends Component {
|
||||
render() {
|
||||
|
|
|
@ -4,21 +4,17 @@
|
|||
import { __, _n, sprintf } from '@wordpress/i18n';
|
||||
import { Component, Fragment } from '@wordpress/element';
|
||||
import { map } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Date, Link, OrderStatus, ViewMoreList } from '@woocommerce/components';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import { defaultTableDateFormat } from 'lib/date';
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { defaultTableDateFormat } from '../../../lib/date';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
import './style.scss';
|
||||
|
||||
class OrdersReportTable extends Component {
|
||||
|
|
|
@ -7,7 +7,10 @@ import { applyFilters } from '@wordpress/hooks';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getProductLabels, getVariationLabels } from 'lib/async-requests';
|
||||
import {
|
||||
getProductLabels,
|
||||
getVariationLabels,
|
||||
} from '../../../lib/async-requests';
|
||||
|
||||
const PRODUCTS_REPORT_CHARTS_FILTER =
|
||||
'woocommerce_admin_products_report_charts';
|
||||
|
|
|
@ -10,14 +10,14 @@ import PropTypes from 'prop-types';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import { advancedFilters, charts, filters } from './config';
|
||||
import getSelectedChart from 'lib/get-selected-chart';
|
||||
import getSelectedChart from '../../../lib/get-selected-chart';
|
||||
import ProductsReportTable from './table';
|
||||
import ReportChart from 'analytics/components/report-chart';
|
||||
import ReportError from 'analytics/components/report-error';
|
||||
import ReportSummary from 'analytics/components/report-summary';
|
||||
import ReportChart from '../../components/report-chart';
|
||||
import ReportError from '../../components/report-error';
|
||||
import ReportSummary from '../../components/report-summary';
|
||||
import VariationsReportTable from './table-variations';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
class ProductsReport extends Component {
|
||||
getChartMeta() {
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
import { __, _n, _x } from '@wordpress/i18n';
|
||||
import { Component } from '@wordpress/element';
|
||||
import { map, get } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Link } from '@woocommerce/components';
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
|
@ -16,9 +12,9 @@ import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import { isLowStock } from './utils';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
const manageStock = getSetting( 'manageStock', 'no' );
|
||||
const stockStatuses = getSetting( 'stockStatuses', {} );
|
||||
|
|
|
@ -6,10 +6,6 @@ import { Component } from '@wordpress/element';
|
|||
import { compose } from '@wordpress/compose';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { map } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { Link, Tag } from '@woocommerce/components';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
|
@ -20,9 +16,9 @@ import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
|||
*/
|
||||
import CategoryBreacrumbs from '../categories/breadcrumbs';
|
||||
import { isLowStock } from './utils';
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
import './style.scss';
|
||||
|
||||
const manageStock = getSetting( 'manageStock', 'no' );
|
||||
|
|
|
@ -8,11 +8,11 @@ import PropTypes from 'prop-types';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import { advancedFilters, charts, filters } from './config';
|
||||
import getSelectedChart from 'lib/get-selected-chart';
|
||||
import ReportChart from 'analytics/components/report-chart';
|
||||
import ReportSummary from 'analytics/components/report-summary';
|
||||
import getSelectedChart from '../../../lib/get-selected-chart';
|
||||
import ReportChart from '../../components/report-chart';
|
||||
import ReportSummary from '../../components/report-summary';
|
||||
import RevenueReportTable from './table';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
export default class RevenueReport extends Component {
|
||||
render() {
|
||||
|
|
|
@ -6,15 +6,6 @@ import { Component } from '@wordpress/element';
|
|||
import { format as formatDate } from '@wordpress/date';
|
||||
import { compose } from '@wordpress/compose';
|
||||
import { get } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
appendTimestamp,
|
||||
defaultTableDateFormat,
|
||||
getCurrentDates,
|
||||
} from 'lib/date';
|
||||
import { Date, Link } from '@woocommerce/components';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
@ -23,11 +14,16 @@ import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { getReportTableQuery } from 'wc-api/reports/utils';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import {
|
||||
appendTimestamp,
|
||||
defaultTableDateFormat,
|
||||
getCurrentDates,
|
||||
} from '../../../lib/date';
|
||||
import { QUERY_DEFAULTS } from '../../../wc-api/constants';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { getReportTableQuery } from '../../../wc-api/reports/utils';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
class RevenueReportTable extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
|
|||
*/
|
||||
import { advancedFilters, showDatePicker, filters } from './config';
|
||||
import StockReportTable from './table';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
export default class StockReport extends Component {
|
||||
render() {
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
import { __, _n, _x } from '@wordpress/i18n';
|
||||
import { Component } from '@wordpress/element';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Link } from '@woocommerce/components';
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
|
@ -16,9 +12,9 @@ import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import { isLowStock } from './utils';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
const stockStatuses = getSetting( 'stockStatuses', {} );
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@ import { applyFilters } from '@wordpress/hooks';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getRequestByIdString } from 'lib/async-requests';
|
||||
import { getRequestByIdString } from '../../../lib/async-requests';
|
||||
import { getTaxCode } from './utils';
|
||||
import { NAMESPACE } from 'wc-api/constants';
|
||||
import { NAMESPACE } from '../../../wc-api/constants';
|
||||
|
||||
const TAXES_REPORT_CHARTS_FILTER = 'woocommerce_admin_taxes_report_charts';
|
||||
const TAXES_REPORT_FILTERS_FILTER = 'woocommerce_admin_taxes_report_filters';
|
||||
|
|
|
@ -9,11 +9,11 @@ import { __ } from '@wordpress/i18n';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import { advancedFilters, charts, filters } from './config';
|
||||
import getSelectedChart from 'lib/get-selected-chart';
|
||||
import ReportChart from 'analytics/components/report-chart';
|
||||
import ReportSummary from 'analytics/components/report-summary';
|
||||
import getSelectedChart from '../../../lib/get-selected-chart';
|
||||
import ReportChart from '../../components/report-chart';
|
||||
import ReportSummary from '../../components/report-summary';
|
||||
import TaxesReportTable from './table';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
import ReportFilters from '../../components/report-filters';
|
||||
|
||||
export default class TaxesReport extends Component {
|
||||
getChartMeta() {
|
||||
|
|
|
@ -4,20 +4,16 @@
|
|||
import { __, _n } from '@wordpress/i18n';
|
||||
import { Component } from '@wordpress/element';
|
||||
import { map } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Link } from '@woocommerce/components';
|
||||
import { getNewPath, getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { getTaxCode } from './utils';
|
||||
import { formatValue } from '@woocommerce/number';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportTable from 'analytics/components/report-table';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { getTaxCode } from './utils';
|
||||
import ReportTable from '../../components/report-table';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
|
||||
class TaxesReportTable extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { parse, stringify } from 'qs';
|
||||
import { DateRangeFilterPicker } from '@woocommerce/components';
|
||||
import { useSettings } from '@woocommerce/data';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -10,13 +12,7 @@ import {
|
|||
getCurrentDates,
|
||||
getDateParamsFromQuery,
|
||||
isoDateFormat,
|
||||
} from 'lib/date';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { DateRangeFilterPicker } from '@woocommerce/components';
|
||||
import { useSettings } from '@woocommerce/data';
|
||||
} from '../../lib/date';
|
||||
|
||||
const DefaultDate = ( { value, onChange } ) => {
|
||||
const { wcAdminSettings } = useSettings( 'wc_admin', [
|
||||
|
|
|
@ -15,9 +15,9 @@ import { withSpokenMessages } from '@wordpress/components';
|
|||
*/
|
||||
import { formatParams } from './utils';
|
||||
import HistoricalDataLayout from './layout';
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { QUERY_DEFAULTS } from '../../../wc-api/constants';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
|
||||
class HistoricalData extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -5,23 +5,19 @@ import { __ } from '@wordpress/i18n';
|
|||
import { Component, Fragment } from '@wordpress/element';
|
||||
import { isNil } from 'lodash';
|
||||
import { SECOND } from '@fresh-data/framework';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { SectionHeader } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { DEFAULT_REQUIREMENT } from 'wc-api/constants';
|
||||
import { DEFAULT_REQUIREMENT } from '../../../wc-api/constants';
|
||||
import { formatParams, getStatus } from './utils';
|
||||
import HistoricalDataActions from './actions';
|
||||
import HistoricalDataPeriodSelector from './period-selector';
|
||||
import HistoricalDataProgress from './progress';
|
||||
import HistoricalDataStatus from './status';
|
||||
import HistoricalDataSkipCheckbox from './skip-checkbox';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import './style.scss';
|
||||
|
||||
class HistoricalDataLayout extends Component {
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import moment from 'moment';
|
||||
import { SelectControl } from '@wordpress/components';
|
||||
import { DatePicker } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { DatePicker } from '@woocommerce/components';
|
||||
import { dateValidationMessages } from 'lib/date';
|
||||
import { dateValidationMessages } from '../../../lib/date';
|
||||
|
||||
function HistoricalDataPeriodSelector( {
|
||||
dateFormat,
|
||||
|
|
|
@ -5,10 +5,6 @@ import { __, sprintf } from '@wordpress/i18n';
|
|||
import { applyFilters } from '@wordpress/hooks';
|
||||
import moment from 'moment';
|
||||
import { Spinner } from '@wordpress/components';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { useFilters } from '@woocommerce/components';
|
||||
|
||||
const HISTORICAL_DATA_STATUS_FILTER = 'woocommerce_admin_import_status';
|
||||
|
|
|
@ -6,10 +6,6 @@ import { Button } from '@wordpress/components';
|
|||
import { Fragment, useEffect, useRef } from '@wordpress/element';
|
||||
import { compose } from '@wordpress/compose';
|
||||
import { withDispatch } from '@wordpress/data';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { SectionHeader, useFilters, ScrollTo } from '@woocommerce/components';
|
||||
import { useSettings } from '@woocommerce/data';
|
||||
|
||||
|
@ -20,7 +16,7 @@ import './index.scss';
|
|||
import { config } from './config';
|
||||
import Setting from './setting';
|
||||
import HistoricalData from './historical-data';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
|
||||
const SETTINGS_FILTER = 'woocommerce_admin_analytics_settings';
|
||||
|
||||
|
|
|
@ -8,10 +8,6 @@ import { Button, Modal } from '@wordpress/components';
|
|||
import { find } from 'lodash';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { withSelect } from '@wordpress/data';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import { List } from '@woocommerce/components';
|
||||
import { ONBOARDING_STORE_NAME, PLUGINS_STORE_NAME } from '@woocommerce/data';
|
||||
|
@ -19,10 +15,10 @@ import { ONBOARDING_STORE_NAME, PLUGINS_STORE_NAME } from '@woocommerce/data';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getProductIdsForCart } from 'dashboard/utils';
|
||||
import sanitizeHTML from 'lib/sanitize-html';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { getInAppPurchaseUrl } from 'lib/in-app-purchase';
|
||||
import { getProductIdsForCart } from '../utils';
|
||||
import sanitizeHTML from '../../lib/sanitize-html';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
import { getInAppPurchaseUrl } from '../../lib/in-app-purchase';
|
||||
|
||||
class CartModal extends Component {
|
||||
constructor( props ) {
|
||||
|
|
|
@ -7,10 +7,6 @@ import { Component, Fragment } from '@wordpress/element';
|
|||
import { compose } from '@wordpress/compose';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withDispatch, withSelect } from '@wordpress/data';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { PLUGINS_STORE_NAME } from '@woocommerce/data';
|
||||
|
||||
class Connect extends Component {
|
||||
|
|
|
@ -7,10 +7,6 @@ import { escapeRegExp } from 'lodash';
|
|||
import { Fragment } from '@wordpress/element';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { SelectControl, TextControl } from '@woocommerce/components';
|
||||
|
||||
const { countries } = getSetting( 'dataEndpoints', { countries: {} } );
|
||||
|
|
|
@ -8,10 +8,6 @@ import { partial } from 'lodash';
|
|||
import { Dropdown, Button, Icon } from '@wordpress/components';
|
||||
import { applyFilters } from '@wordpress/hooks';
|
||||
import { Icon as WPIcon, plusCircleFilled } from '@wordpress/icons';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { H, Spinner } from '@woocommerce/components';
|
||||
import {
|
||||
SETTINGS_STORE_NAME,
|
||||
|
@ -26,19 +22,19 @@ import { getQuery } from '@woocommerce/navigation';
|
|||
import './style.scss';
|
||||
import defaultSections from './default-sections';
|
||||
import Section from './section';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { isOnboardingEnabled } from 'dashboard/utils';
|
||||
import withSelect from '../wc-api/with-select';
|
||||
import { recordEvent } from '../lib/tracks';
|
||||
import { isOnboardingEnabled } from './utils';
|
||||
import {
|
||||
getCurrentDates,
|
||||
getDateParamsFromQuery,
|
||||
isoDateFormat,
|
||||
} from 'lib/date';
|
||||
import ReportFilters from 'analytics/components/report-filters';
|
||||
} from '../lib/date';
|
||||
import ReportFilters from '../analytics/components/report-filters';
|
||||
import {
|
||||
CurrencyContext,
|
||||
getFilteredCurrencyInstance,
|
||||
} from 'lib/currency-context';
|
||||
} from '../lib/currency-context';
|
||||
|
||||
const TaskList = lazy( () =>
|
||||
import( /* webpackChunkName: "task-list" */ '../task-list' )
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
import { Component } from '@wordpress/element';
|
||||
import PropTypes from 'prop-types';
|
||||
import { __, sprintf } from '@wordpress/i18n';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Card } from '@woocommerce/components';
|
||||
import {
|
||||
getHistory,
|
||||
|
@ -19,7 +15,7 @@ import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ReportChart from 'analytics/components/report-chart';
|
||||
import ReportChart from '../../analytics/components/report-chart';
|
||||
import './block.scss';
|
||||
|
||||
class ChartBlock extends Component {
|
||||
|
|
|
@ -7,13 +7,12 @@ import { applyFilters } from '@wordpress/hooks';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
import { charts as ordersCharts } from 'analytics/report/orders/config';
|
||||
import { charts as productsCharts } from 'analytics/report/products/config';
|
||||
import { charts as revenueCharts } from 'analytics/report/revenue/config';
|
||||
import { charts as couponsCharts } from 'analytics/report/coupons/config';
|
||||
import { charts as taxesCharts } from 'analytics/report/taxes/config';
|
||||
import { charts as downloadsCharts } from 'analytics/report/downloads/config';
|
||||
import { charts as ordersCharts } from '../../analytics/report/orders/config';
|
||||
import { charts as productsCharts } from '../../analytics/report/products/config';
|
||||
import { charts as revenueCharts } from '../../analytics/report/revenue/config';
|
||||
import { charts as couponsCharts } from '../../analytics/report/coupons/config';
|
||||
import { charts as taxesCharts } from '../../analytics/report/taxes/config';
|
||||
import { charts as downloadsCharts } from '../../analytics/report/downloads/config';
|
||||
|
||||
const DASHBOARD_CHARTS_FILTER = 'woocommerce_admin_dashboard_charts_filter';
|
||||
|
||||
|
|
|
@ -8,9 +8,6 @@ import Gridicon from 'gridicons';
|
|||
import PropTypes from 'prop-types';
|
||||
import { Button, NavigableMenu, SelectControl } from '@wordpress/components';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
EllipsisMenu,
|
||||
MenuItem,
|
||||
|
@ -18,14 +15,14 @@ import {
|
|||
SectionHeader,
|
||||
} from '@woocommerce/components';
|
||||
import { useUserPreferences } from '@woocommerce/data';
|
||||
import { getAllowedIntervalsForQuery } from 'lib/date';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getAllowedIntervalsForQuery } from '../../lib/date';
|
||||
import ChartBlock from './block';
|
||||
import { uniqCharts } from './config';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
import './style.scss';
|
||||
|
||||
const renderChartToggles = ( { hiddenBlocks, onToggleHiddenBlock } ) => {
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { applyFilters } from '@wordpress/hooks';
|
||||
import { lazy, Suspense } from '@wordpress/element';
|
||||
import { Spinner } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { Spinner } from '@woocommerce/components';
|
||||
const LazyDashboardCharts = lazy( () =>
|
||||
import( /* webpackChunkName: "dashboard-charts" */ './dashboard-charts' )
|
||||
);
|
||||
|
|
|
@ -5,10 +5,6 @@ import { Component, Suspense, lazy } from '@wordpress/element';
|
|||
import { compose } from '@wordpress/compose';
|
||||
import { withSelect } from '@wordpress/data';
|
||||
import { identity } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import {
|
||||
ONBOARDING_STORE_NAME,
|
||||
|
@ -21,7 +17,7 @@ import { getHistory, getNewPath } from '@woocommerce/navigation';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import './style.scss';
|
||||
import { isOnboardingEnabled } from 'dashboard/utils';
|
||||
import { isOnboardingEnabled } from './utils';
|
||||
|
||||
const CustomizableDashboard = lazy( () =>
|
||||
import( /* webpackChunkName: "customizable-dashboard" */ './customizable' )
|
||||
|
|
|
@ -7,9 +7,6 @@ import { compose } from '@wordpress/compose';
|
|||
import PropTypes from 'prop-types';
|
||||
import { SelectControl } from '@wordpress/components';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
EllipsisMenu,
|
||||
MenuItem,
|
||||
|
@ -22,9 +19,9 @@ import { getSetting } from '@woocommerce/wc-admin-settings';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import Leaderboard from 'analytics/components/leaderboard';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import Leaderboard from '../../analytics/components/leaderboard';
|
||||
import withSelect from '../../wc-api/with-select';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
import './style.scss';
|
||||
|
||||
const renderLeaderboardToggles = ( {
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { Icon, TextControl } from '@wordpress/components';
|
||||
import { Component, Fragment } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { MenuItem } from '@woocommerce/components';
|
||||
|
||||
class SectionControls extends Component {
|
||||
|
|
|
@ -4,18 +4,9 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { Component, Fragment } from '@wordpress/element';
|
||||
import { compose } from '@wordpress/compose';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getDateParamsFromQuery } from 'lib/date';
|
||||
import { getPersistedQuery } from '@woocommerce/navigation';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import {
|
||||
EllipsisMenu,
|
||||
MenuItem,
|
||||
|
@ -25,10 +16,15 @@ import {
|
|||
SummaryListPlaceholder,
|
||||
SummaryNumber,
|
||||
} from '@woocommerce/components';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getDateParamsFromQuery } from '../../lib/date';
|
||||
import withSelect from '../../wc-api/with-select';
|
||||
import './style.scss';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
import { CurrencyContext } from '../../lib/currency-context';
|
||||
import { getIndicatorData, getIndicatorValues } from './utils';
|
||||
|
||||
const { performanceIndicators: indicators } = getSetting( 'dataEndpoints', {
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
*/
|
||||
import moment from 'moment';
|
||||
import { find } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getCurrentDates, appendTimestamp } from '@woocommerce/date';
|
||||
import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
||||
import { getNewPath } from '@woocommerce/navigation';
|
||||
import { calculateDelta, formatValue } from '@woocommerce/number';
|
||||
import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
||||
import { getFilterQuery } from 'wc-api/reports/utils';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getFilterQuery } from '../../wc-api/reports/utils';
|
||||
|
||||
function getReportUrl( href, persistedQuery, primaryItem ) {
|
||||
if ( ! href ) {
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
*/
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { without } from 'lodash';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
import classnames from 'classnames';
|
||||
import { Component, Fragment } from '@wordpress/element';
|
||||
import { find, get } from 'lodash';
|
||||
import { Card, Link } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ComponentExample from './example';
|
||||
import ComponentDocs from './docs';
|
||||
import { Card, Link } from '@woocommerce/components';
|
||||
import examples from './examples.json';
|
||||
import './style.scss';
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@ import { cloneElement, Component } from '@wordpress/element';
|
|||
import Gridicon from 'gridicons';
|
||||
import moment from 'moment';
|
||||
import PropTypes from 'prop-types';
|
||||
import { H, Section } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import './style.scss';
|
||||
import { H, Section } from '@woocommerce/components';
|
||||
|
||||
class ActivityCard extends Component {
|
||||
render() {
|
||||
|
|
|
@ -5,12 +5,12 @@ import { Button } from '@wordpress/components';
|
|||
import Gridicon from 'gridicons';
|
||||
import { shallow } from 'enzyme';
|
||||
import moment from 'moment';
|
||||
import { Gravatar } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { ActivityCard } from '../';
|
||||
import { Gravatar } from '@woocommerce/components';
|
||||
|
||||
describe( 'ActivityCard', () => {
|
||||
test( 'should have correct title', () => {
|
||||
|
|
|
@ -5,12 +5,12 @@ import classnames from 'classnames';
|
|||
import { Component } from '@wordpress/element';
|
||||
import PropTypes from 'prop-types';
|
||||
import { __experimentalText as Text } from '@wordpress/components';
|
||||
import { EllipsisMenu } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import './style.scss';
|
||||
import { EllipsisMenu } from '@woocommerce/components';
|
||||
|
||||
class ActivityHeader extends Component {
|
||||
render() {
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import Gridicon from 'gridicons';
|
||||
import { Link } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import './style.scss';
|
||||
import { Link } from '@woocommerce/components';
|
||||
|
||||
const ActivityOutboundLink = ( props ) => {
|
||||
const { href, type, className, children, ...restOfProps } = props;
|
||||
|
|
|
@ -12,10 +12,6 @@ import PagesIcon from 'gridicons/dist/pages';
|
|||
import CrossIcon from 'gridicons/dist/cross-small';
|
||||
import classnames from 'classnames';
|
||||
import { Icon, lifesaver } from '@wordpress/icons';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getSetting, getAdminLink } from '@woocommerce/wc-admin-settings';
|
||||
import { H, Section, Spinner } from '@woocommerce/components';
|
||||
import { OPTIONS_STORE_NAME } from '@woocommerce/data';
|
||||
|
@ -32,8 +28,10 @@ import {
|
|||
getUnapprovedReviews,
|
||||
getUnreadStock,
|
||||
} from './unread-indicators';
|
||||
import { isOnboardingEnabled, isWCAdmin } from 'dashboard/utils';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { isOnboardingEnabled, isWCAdmin } from '../../dashboard/utils';
|
||||
import withSelect from '../../wc-api/with-select';
|
||||
import { Tabs } from './tabs';
|
||||
import { SetupProgress } from './setup-progress';
|
||||
|
||||
const HelpPanel = lazy( () =>
|
||||
import( /* webpackChunkName: "activity-panels-help" */ './panels/help' )
|
||||
|
@ -52,9 +50,6 @@ const ReviewsPanel = lazy( () =>
|
|||
import( /* webpackChunkName: "activity-panels-inbox" */ './panels/reviews' )
|
||||
);
|
||||
|
||||
import { Tabs } from './tabs';
|
||||
import { SetupProgress } from './setup-progress';
|
||||
|
||||
const manageStock = getSetting( 'manageStock', 'no' );
|
||||
const reviewsEnabled = getSetting( 'reviewsEnabled', 'no' );
|
||||
export class ActivityPanel extends Component {
|
||||
|
|
|
@ -8,10 +8,6 @@ import { Fragment, useEffect } from '@wordpress/element';
|
|||
import { applyFilters } from '@wordpress/hooks';
|
||||
import { Icon, chevronRight, page } from '@wordpress/icons';
|
||||
import { partial } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import { List, Section } from '@woocommerce/components';
|
||||
import {
|
||||
|
@ -19,15 +15,15 @@ import {
|
|||
PLUGINS_STORE_NAME,
|
||||
SETTINGS_STORE_NAME,
|
||||
} from '@woocommerce/data';
|
||||
import { compose } from 'redux';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import ActivityHeader from '../activity-header';
|
||||
import { getCountryCode } from 'dashboard/utils';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { getPaymentMethods } from 'task-list/tasks/payments/methods';
|
||||
import { compose } from 'redux';
|
||||
import { getCountryCode } from '../../../dashboard/utils';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
import { getPaymentMethods } from '../../../task-list/tasks/payments/methods';
|
||||
|
||||
export const SETUP_TASK_HELP_ITEMS_FILTER =
|
||||
'woocommerce_admin_setup_task_help_items';
|
||||
|
|
|
@ -6,10 +6,6 @@ import { Component } from '@wordpress/element';
|
|||
import { compose } from '@wordpress/compose';
|
||||
import { withDispatch } from '@wordpress/data';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { ADMIN_URL as adminUrl } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
class InboxNoteAction extends Component {
|
||||
|
|
|
@ -7,17 +7,17 @@ import { Button, Dropdown, Modal } from '@wordpress/components';
|
|||
import PropTypes from 'prop-types';
|
||||
import VisibilitySensor from 'react-visibility-sensor';
|
||||
import moment from 'moment';
|
||||
import classnames from 'classnames';
|
||||
import { H, Section } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import NoteAction from './action';
|
||||
import sanitizeHTML from 'lib/sanitize-html';
|
||||
import classnames from 'classnames';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import sanitizeHTML from '../../../../lib/sanitize-html';
|
||||
import { recordEvent } from '../../../../lib/tracks';
|
||||
import './style.scss';
|
||||
import { H, Section } from '@woocommerce/components';
|
||||
import { getScreenName } from 'utils';
|
||||
import { getScreenName } from '../../../../utils';
|
||||
|
||||
class InboxNoteCard extends Component {
|
||||
constructor( props ) {
|
||||
|
|
|
@ -4,10 +4,7 @@
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { Fragment, useEffect } from '@wordpress/element';
|
||||
import { compose } from '@wordpress/compose';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { EmptyContent, Section } from '@woocommerce/components';
|
||||
import { useUserPreferences } from '@woocommerce/data';
|
||||
|
||||
/**
|
||||
|
@ -17,9 +14,8 @@ import { ActivityCard } from '../../activity-card';
|
|||
import InboxNotePlaceholder from './placeholder';
|
||||
import ActivityHeader from '../../activity-header';
|
||||
import InboxNoteCard from './card';
|
||||
import { EmptyContent, Section } from '@woocommerce/components';
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { QUERY_DEFAULTS } from '../../../../wc-api/constants';
|
||||
import withSelect from '../../../../wc-api/with-select';
|
||||
import { getUnreadNotesCount, hasValidNotes } from './utils';
|
||||
|
||||
const renderEmptyCard = () => (
|
||||
|
|
|
@ -10,9 +10,6 @@ import PropTypes from 'prop-types';
|
|||
import interpolateComponents from 'interpolate-components';
|
||||
import { keyBy, map, merge } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
EmptyContent,
|
||||
Flag,
|
||||
|
@ -30,11 +27,11 @@ import { SETTINGS_STORE_NAME } from '@woocommerce/data';
|
|||
import { ActivityCard, ActivityCardPlaceholder } from '../activity-card';
|
||||
import ActivityHeader from '../activity-header';
|
||||
import ActivityOutboundLink from '../activity-outbound-link';
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import { DEFAULT_ACTIONABLE_STATUSES } from 'analytics/settings/config';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { QUERY_DEFAULTS } from '../../../wc-api/constants';
|
||||
import { DEFAULT_ACTIONABLE_STATUSES } from '../../../analytics/settings/config';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { CurrencyContext } from '../../../lib/currency-context';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
|
||||
class OrdersPanel extends Component {
|
||||
recordOrderEvent( eventName ) {
|
||||
|
|
|
@ -10,9 +10,6 @@ import interpolateComponents from 'interpolate-components';
|
|||
import { get, isNull } from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
EmptyContent,
|
||||
Gravatar,
|
||||
|
@ -29,10 +26,10 @@ import { REVIEWS_STORE_NAME } from '@woocommerce/data';
|
|||
*/
|
||||
import { ActivityCard, ActivityCardPlaceholder } from '../activity-card';
|
||||
import ActivityHeader from '../activity-header';
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import sanitizeHTML from 'lib/sanitize-html';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { QUERY_DEFAULTS } from '../../../wc-api/constants';
|
||||
import sanitizeHTML from '../../../lib/sanitize-html';
|
||||
import withSelect from '../../../wc-api/with-select';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
|
||||
class ReviewsPanel extends Component {
|
||||
constructor() {
|
||||
|
|
|
@ -9,10 +9,6 @@ import { compose } from '@wordpress/compose';
|
|||
import { ESCAPE } from '@wordpress/keycodes';
|
||||
import { get } from 'lodash';
|
||||
import { withDispatch } from '@wordpress/data';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Link, ProductImage } from '@woocommerce/components';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
|
@ -20,7 +16,7 @@ import { getSetting } from '@woocommerce/wc-admin-settings';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import { ActivityCard } from '../../activity-card';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../../../lib/tracks';
|
||||
|
||||
class ProductStockCard extends Component {
|
||||
constructor( props ) {
|
||||
|
|
|
@ -5,10 +5,7 @@ import { __ } from '@wordpress/i18n';
|
|||
import { Component, Fragment } from '@wordpress/element';
|
||||
import { compose } from '@wordpress/compose';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import Gridicon from 'gridicons';
|
||||
import { EmptyContent, Section } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
|
@ -16,10 +13,9 @@ import { EmptyContent, Section } from '@woocommerce/components';
|
|||
*/
|
||||
import { ActivityCard, ActivityCardPlaceholder } from '../../activity-card';
|
||||
import ActivityHeader from '../../activity-header';
|
||||
import Gridicon from 'gridicons';
|
||||
import ProductStockCard from './card';
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { QUERY_DEFAULTS } from '../../../../wc-api/constants';
|
||||
import withSelect from '../../../../wc-api/with-select';
|
||||
|
||||
class StockPanel extends Component {
|
||||
renderEmptyCard() {
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
import '@testing-library/jest-dom';
|
||||
import PagesIcon from 'gridicons/dist/pages';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { Tab } from '../';
|
||||
|
||||
const renderTab = () =>
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { NavigableMenu } from '@wordpress/components';
|
||||
import { useEffect, useState } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { Tab } from '../tab';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
|
||||
export const Tabs = ( {
|
||||
tabs,
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
jest.mock( 'lib/tracks', () => ( { recordEvent: jest.fn() } ) );
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { Tabs } from '../';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../../../lib/tracks';
|
||||
|
||||
jest.mock( 'lib/tracks', () => ( { recordEvent: jest.fn() } ) );
|
||||
const generateTabs = () => {
|
||||
return [ '0', '1', '2', '3' ].map( ( name ) => ( {
|
||||
name,
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
/**
|
||||
* WooCommerce dependencies
|
||||
* External dependencies
|
||||
*/
|
||||
import {
|
||||
SETTINGS_STORE_NAME,
|
||||
USER_STORE_NAME,
|
||||
REVIEWS_STORE_NAME,
|
||||
} from '@woocommerce/data';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { DEFAULT_ACTIONABLE_STATUSES } from 'analytics/settings/config';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import { DEFAULT_ACTIONABLE_STATUSES } from '../../analytics/settings/config';
|
||||
import { QUERY_DEFAULTS } from '../../wc-api/constants';
|
||||
import { getUnreadNotesCount } from './panels/inbox/utils';
|
||||
|
||||
export function getUnreadNotes( select ) {
|
||||
|
|
|
@ -6,10 +6,6 @@ import { Component, createRef } from '@wordpress/element';
|
|||
import classnames from 'classnames';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getNewPath } from '@woocommerce/navigation';
|
||||
import { Link } from '@woocommerce/components';
|
||||
import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
@ -19,7 +15,7 @@ import { getAdminLink, getSetting } from '@woocommerce/wc-admin-settings';
|
|||
*/
|
||||
import './style.scss';
|
||||
import ActivityPanel from './activity-panel';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../lib/tracks';
|
||||
|
||||
class Header extends Component {
|
||||
constructor( props ) {
|
||||
|
|
|
@ -5,9 +5,6 @@ import { compose } from '@wordpress/compose';
|
|||
import { withSelect } from '@wordpress/data';
|
||||
import { identity } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
import {
|
||||
ONBOARDING_STORE_NAME,
|
||||
|
@ -18,8 +15,7 @@ import { getHistory, getNewPath } from '@woocommerce/navigation';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { isOnboardingEnabled } from 'dashboard/utils';
|
||||
|
||||
import { isOnboardingEnabled } from '../dashboard/utils';
|
||||
import Layout from './layout';
|
||||
|
||||
const Homescreen = ( { profileItems, query } ) => {
|
||||
|
|
|
@ -13,10 +13,6 @@ import { compose } from '@wordpress/compose';
|
|||
import { withDispatch } from '@wordpress/data';
|
||||
import classnames from 'classnames';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { OPTIONS_STORE_NAME } from '@woocommerce/data';
|
||||
|
||||
/**
|
||||
|
@ -26,10 +22,10 @@ import QuickLinks from '../quick-links';
|
|||
import StatsOverview from './stats-overview';
|
||||
import './style.scss';
|
||||
import '../dashboard/style.scss';
|
||||
import { isOnboardingEnabled } from 'dashboard/utils';
|
||||
import { isOnboardingEnabled } from '../dashboard/utils';
|
||||
import TaskListPlaceholder from '../task-list/placeholder';
|
||||
import InboxPanel from '../header/activity-panel/panels/inbox';
|
||||
import withWCApiSelect from 'wc-api/with-select';
|
||||
import withWCApiSelect from '../wc-api/with-select';
|
||||
import { WelcomeModal } from './welcome-modal';
|
||||
|
||||
const TaskList = lazy( () =>
|
||||
|
|
|
@ -13,9 +13,6 @@ import {
|
|||
} from '@wordpress/components';
|
||||
import { get, xor } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
EllipsisMenu,
|
||||
MenuItem,
|
||||
|
@ -32,7 +29,7 @@ import { getNewPath } from '@woocommerce/navigation';
|
|||
import './style.scss';
|
||||
import { DEFAULT_STATS, DEFAULT_HIDDEN_STATS } from './defaults';
|
||||
import StatsList from './stats-list';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
import InstallJetpackCta from './install-jetpack-cta';
|
||||
|
||||
const { performanceIndicators } = getSetting( 'dataEndpoints', {
|
||||
|
|
|
@ -8,9 +8,6 @@ import { useState } from 'react';
|
|||
import PropTypes from 'prop-types';
|
||||
import { withDispatch, withSelect } from '@wordpress/data';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
__experimentalResolveSelect,
|
||||
PLUGINS_STORE_NAME,
|
||||
|
@ -22,8 +19,8 @@ import { getAdminLink } from '@woocommerce/wc-admin-settings';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { createNoticesFromResponse } from 'lib/notices';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
import { createNoticesFromResponse } from '../../lib/notices';
|
||||
|
||||
function InstallJetpackCta( {
|
||||
getJetpackConnectUrl,
|
||||
|
|
|
@ -5,9 +5,6 @@ import { useContext } from '@wordpress/element';
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import classnames from 'classnames';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
SummaryNumber,
|
||||
SummaryNumberPlaceholder,
|
||||
|
@ -17,13 +14,13 @@ import { getPersistedQuery } from '@woocommerce/navigation';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { CurrencyContext } from 'lib/currency-context';
|
||||
import withSelect from '../../wc-api/with-select';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
import { CurrencyContext } from '../../lib/currency-context';
|
||||
import {
|
||||
getIndicatorData,
|
||||
getIndicatorValues,
|
||||
} from 'dashboard/store-performance/utils';
|
||||
} from '../../dashboard/store-performance/utils';
|
||||
|
||||
export const StatsList = ( {
|
||||
stats,
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { render, fireEvent, screen, waitFor } from '@testing-library/react';
|
||||
import { useUserPreferences } from '@woocommerce/data';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { StatsOverview } from '../index';
|
||||
import StatsList from '../stats-list';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
|
||||
jest.mock( 'lib/tracks' );
|
||||
// Mock the stats list so that it can be tested separately.
|
||||
|
@ -22,7 +23,6 @@ jest.mock( '../install-jetpack-cta', () => {
|
|||
.mockImplementation( () => <div>mocked install jetpack cta</div> );
|
||||
} );
|
||||
|
||||
import { useUserPreferences } from '@woocommerce/data';
|
||||
jest.mock( '@woocommerce/data' );
|
||||
|
||||
describe( 'StatsOverview tracking', () => {
|
||||
|
|
|
@ -7,7 +7,7 @@ import { render, screen, fireEvent } from '@testing-library/react';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import { StatsList } from '../stats-list';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
|
||||
jest.mock( 'lib/tracks' );
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { render, screen } from '@testing-library/react';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { Layout } from '../layout';
|
||||
|
||||
// Rendering <StatsOverview /> breaks tests.
|
||||
|
|
|
@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
import { LineChartIllustration } from './illustrations/line-chart';
|
||||
import { InboxIllustration } from './illustrations/inbox';
|
||||
import { PieChartIllustration } from './illustrations/pie-chart';
|
||||
|
|
|
@ -8,7 +8,7 @@ import '@testing-library/jest-dom';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import { WelcomeModal } from '../index';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
|
||||
jest.mock( 'lib/tracks', () => ( { recordEvent: jest.fn() } ) );
|
||||
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
*/
|
||||
import '@wordpress/notices';
|
||||
import { render } from '@wordpress/element';
|
||||
import {
|
||||
withCurrentUserHydration,
|
||||
withSettingsHydration,
|
||||
} from '@woocommerce/data';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import './stylesheets/_index.scss';
|
||||
import { PageLayout, EmbedLayout, PrimaryLayout as NoticeArea } from './layout';
|
||||
import 'wc-api/wp-data-store';
|
||||
import {
|
||||
withCurrentUserHydration,
|
||||
withSettingsHydration,
|
||||
} from '@woocommerce/data';
|
||||
import './wc-api/wp-data-store';
|
||||
|
||||
// Modify webpack pubilcPath at runtime based on location of WordPress Plugin.
|
||||
// eslint-disable-next-line no-undef,camelcase
|
||||
|
|
|
@ -6,10 +6,6 @@ import { parse, stringify } from 'qs';
|
|||
import { find, isEqual, last, omit } from 'lodash';
|
||||
import { applyFilters } from '@wordpress/hooks';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
getNewPath,
|
||||
getPersistedQuery,
|
||||
|
@ -20,31 +16,35 @@ import { Spinner } from '@woocommerce/components';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getUrlParams } from 'utils';
|
||||
import { getUrlParams } from '../utils';
|
||||
import getReports from '../analytics/report/get-reports';
|
||||
import { isWCAdmin } from '../dashboard/utils';
|
||||
|
||||
const AnalyticsReport = lazy( () =>
|
||||
import( /* webpackChunkName: "analytics-report" */ 'analytics/report' )
|
||||
import( /* webpackChunkName: "analytics-report" */ '../analytics/report' )
|
||||
);
|
||||
const AnalyticsSettings = lazy( () =>
|
||||
import( /* webpackChunkName: "analytics-settings" */ 'analytics/settings' )
|
||||
import(
|
||||
/* webpackChunkName: "analytics-settings" */ '../analytics/settings'
|
||||
)
|
||||
);
|
||||
const Dashboard = lazy( () =>
|
||||
import( /* webpackChunkName: "dashboard" */ 'dashboard' )
|
||||
import( /* webpackChunkName: "dashboard" */ '../dashboard' )
|
||||
);
|
||||
const DevDocs = lazy( () =>
|
||||
import( /* webpackChunkName: "devdocs" */ 'devdocs' )
|
||||
import( /* webpackChunkName: "devdocs" */ '../devdocs' )
|
||||
);
|
||||
const Homescreen = lazy( () =>
|
||||
import( /* webpackChunkName: "homescreen" */ 'homescreen' )
|
||||
import( /* webpackChunkName: "homescreen" */ '../homescreen' )
|
||||
);
|
||||
const MarketingOverview = lazy( () =>
|
||||
import( /* webpackChunkName: "marketing-overview" */ 'marketing/overview' )
|
||||
import(
|
||||
/* webpackChunkName: "marketing-overview" */ '../marketing/overview'
|
||||
)
|
||||
);
|
||||
const ProfileWizard = lazy( () =>
|
||||
import( /* webpackChunkName: "profile-wizard" */ 'profile-wizard' )
|
||||
import( /* webpackChunkName: "profile-wizard" */ '../profile-wizard' )
|
||||
);
|
||||
import getReports from 'analytics/report/get-reports';
|
||||
import { isWCAdmin } from 'dashboard/utils';
|
||||
|
||||
const TIME_EXCLUDED_SCREENS_FILTER = 'woocommerce_admin_time_excluded_screens';
|
||||
|
||||
|
|
|
@ -8,10 +8,6 @@ import { Router, Route, Switch } from 'react-router-dom';
|
|||
import PropTypes from 'prop-types';
|
||||
import { get, isFunction, identity } from 'lodash';
|
||||
import { parse } from 'qs';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { useFilters, Spinner } from '@woocommerce/components';
|
||||
import { getHistory } from '@woocommerce/navigation';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
@ -26,14 +22,15 @@ import {
|
|||
*/
|
||||
import './style.scss';
|
||||
import { Controller, getPages, PAGES_FILTER } from './controller';
|
||||
import Header from 'header';
|
||||
import Header from '../header';
|
||||
import Notices from './notices';
|
||||
import { recordPageView } from 'lib/tracks';
|
||||
import { recordPageView } from '../lib/tracks';
|
||||
import TransientNotices from './transient-notices';
|
||||
import { REPORTS_FILTER } from '../analytics/report';
|
||||
|
||||
const StoreAlerts = lazy( () =>
|
||||
import( /* webpackChunkName: "store-alerts" */ './store-alerts' )
|
||||
);
|
||||
import { REPORTS_FILTER } from 'analytics/report';
|
||||
|
||||
export class PrimaryLayout extends Component {
|
||||
render() {
|
||||
|
|
|
@ -10,21 +10,17 @@ import { compose } from '@wordpress/compose';
|
|||
import { withDispatch } from '@wordpress/data';
|
||||
import moment from 'moment';
|
||||
import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Card } from '@woocommerce/components';
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import { QUERY_DEFAULTS } from 'wc-api/constants';
|
||||
import sanitizeHTML from 'lib/sanitize-html';
|
||||
import withSelect from '../../wc-api/with-select';
|
||||
import { QUERY_DEFAULTS } from '../../wc-api/constants';
|
||||
import sanitizeHTML from '../../lib/sanitize-html';
|
||||
import StoreAlertsPlaceholder from './placeholder';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { recordEvent } from '../../lib/tracks';
|
||||
|
||||
import './style.scss';
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import { withDispatch } from '@wordpress/data';
|
|||
* Internal dependencies
|
||||
*/
|
||||
import './style.scss';
|
||||
import withSelect from 'wc-api/with-select';
|
||||
import withSelect from '../../wc-api/with-select';
|
||||
|
||||
class TransientNotices extends Component {
|
||||
render() {
|
||||
|
|
|
@ -4,17 +4,13 @@
|
|||
import { addQueryArgs } from '@wordpress/url';
|
||||
import apiFetch from '@wordpress/api-fetch';
|
||||
import { identity } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getIdsFromQuery } from '@woocommerce/navigation';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getTaxCode } from 'analytics/report/taxes/utils';
|
||||
import { NAMESPACE } from 'wc-api/constants';
|
||||
import { getTaxCode } from '../../analytics/report/taxes/utils';
|
||||
import { NAMESPACE } from '../../wc-api/constants';
|
||||
|
||||
/**
|
||||
* Get a function that accepts ids as they are found in url parameter and
|
||||
|
|
|
@ -3,15 +3,7 @@
|
|||
*/
|
||||
import { createContext } from '@wordpress/element';
|
||||
import { applyFilters } from '@wordpress/hooks';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import CurrencyFactory from '@woocommerce/currency';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { CURRENCY } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
const appCurrency = CurrencyFactory( CURRENCY );
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import {
|
||||
isoDateFormat,
|
||||
presetValues,
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { addQueryArgs } from '@wordpress/url';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { getSetting } from '@woocommerce/wc-admin-settings';
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,12 +7,7 @@ import { Spinner } from '@wordpress/components';
|
|||
import classNames from 'classnames';
|
||||
import { withDispatch, withSelect } from '@wordpress/data';
|
||||
import { useState } from '@wordpress/element';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Card, Pagination, EmptyContent } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
|
@ -21,6 +16,7 @@ import { Card, Pagination, EmptyContent } from '@woocommerce/components';
|
|||
import './style.scss';
|
||||
import { Slider } from '../../components';
|
||||
import { STORE_KEY } from '../../data/constants';
|
||||
import { recordEvent } from '../../../lib/tracks';
|
||||
|
||||
const KnowledgeBase = ( {
|
||||
posts,
|
||||
|
|
|
@ -2,17 +2,13 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import { recordEvent } from 'lib/tracks';
|
||||
import { Spinner } from '@wordpress/components';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
*/
|
||||
import { Card, Pagination, EmptyContent } from '@woocommerce/components';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { recordEvent } from '../../../../lib/tracks';
|
||||
import { KnowledgeBase } from '../index.js';
|
||||
import Slider from '../../slider';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* WordPress dependencies
|
||||
* External dependencies
|
||||
*/
|
||||
import { SVG, Path } from '@wordpress/primitives';
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue