Fix for gutenberg 3.4

This commit is contained in:
Timmy Crawford 2018-08-01 12:07:17 -07:00
parent 8141a9f66d
commit 3f2a6a2fd6
5 changed files with 3587 additions and 3605 deletions

View File

@ -3,9 +3,8 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { ToggleControl, withAPIData } from '@wordpress/components';
import { ToggleControl } from '@wordpress/components';
import { Component } from '@wordpress/element';
import { compose } from '@wordpress/compose';
/**
* Internal dependencies
@ -63,9 +62,8 @@ class StorePerformance extends Component {
}
render() {
const { orders, products } = this.props;
const totalOrders = ( orders.data && orders.data.length ) || 0;
const totalProducts = ( products.data && products.data.length ) || 0;
const totalOrders = 10;
const totalProducts = 1000;
const { showCustomers, showProducts, showOrders } = this.state;
return (
@ -108,9 +106,4 @@ class StorePerformance extends Component {
}
}
export default compose( [
withAPIData( () => ( {
orders: '/wc/v3/orders?status=processing',
products: '/wc/v3/products',
} ) ),
] )( StorePerformance );
export default StorePerformance;

View File

@ -3,8 +3,7 @@
* External dependencies
*/
import { __, _n, sprintf } from '@wordpress/i18n';
import { Button, withAPIData } from '@wordpress/components';
import { compose } from '@wordpress/compose';
import { Button } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import PropTypes from 'prop-types';
import { noop } from 'lodash';
@ -112,8 +111,4 @@ OrdersPanel.propTypes = {
orders: PropTypes.object.isRequired,
};
export default compose( [
withAPIData( () => ( {
orders: '/wc/v3/orders',
} ) ),
] )( OrdersPanel );
export default OrdersPanel;

View File

@ -66,11 +66,7 @@ class Header extends Component {
.join( ' ‹ ' );
document.title = decodeEntities(
sprintf(
__( '%1$s ‹ %2$s — WooCommerce', 'wc-admin' ),
documentTitle,
wpApiSettings.schema.name
)
sprintf( __( '%1$s ‹ %2$s — WooCommerce', 'wc-admin' ), documentTitle, 'wc/v2' )
);
const className = classnames( 'woocommerce-layout__header', {

View File

@ -35,7 +35,6 @@ function wc_admin_register_script() {
wp_add_inline_script( WC_ADMIN_APP, $content, 'before' );
wp_enqueue_script( 'wp-api' );
gutenberg_extend_wp_api_backbone_client();
// Settings and variables can be passed here for access in the app
$settings = array(

File diff suppressed because it is too large Load Diff