Cherry pick 52432 into release/9.4 (#52538)
* [WordPress 6.7] Make sure Product Image Gallery renders placeholder in Editor (#52432) * Render placeholder of Product Image Gallery every time * Add changelog * Fix lint * Prep for cherry pick 52432 --------- Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com> Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
This commit is contained in:
parent
db8deb21a8
commit
43af839298
|
@ -2,11 +2,8 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { WC_BLOCKS_IMAGE_URL } from '@woocommerce/block-settings';
|
||||
import { isEmptyObject } from '@woocommerce/types';
|
||||
import { useBlockProps } from '@wordpress/block-editor';
|
||||
import { BlockAttributes } from '@wordpress/blocks';
|
||||
import { Disabled } from '@wordpress/components';
|
||||
import type { BlockEditProps } from '@wordpress/blocks';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -35,30 +32,16 @@ const Placeholder = () => {
|
|||
);
|
||||
};
|
||||
|
||||
type Context = {
|
||||
postId: string;
|
||||
postType: string;
|
||||
queryId: string;
|
||||
};
|
||||
|
||||
interface Props extends BlockEditProps< BlockAttributes > {
|
||||
context: Context;
|
||||
}
|
||||
|
||||
const Edit = ( { context }: Props ) => {
|
||||
const Edit = () => {
|
||||
const blockProps = useBlockProps();
|
||||
|
||||
if ( isEmptyObject( context ) ) {
|
||||
return (
|
||||
<div { ...blockProps }>
|
||||
<Disabled>
|
||||
<Placeholder />
|
||||
</Disabled>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// We have work on this case when we will work on the Single Product block.
|
||||
return <></>;
|
||||
return (
|
||||
<div { ...blockProps }>
|
||||
<Disabled>
|
||||
<Placeholder />
|
||||
</Disabled>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Edit;
|
||||
|
|
|
@ -173,6 +173,7 @@ WooCommerce comes with some sample data you can use to see how products look; im
|
|||
|
||||
**WooCommerce**
|
||||
|
||||
* Fix - Product Image Gallery: Render placeholder in Editor in WordPress 6.7 [#52432](https://github.com/woocommerce/woocommerce/pull/52432)
|
||||
* Fix - Support situations in which (WooCommerce) translations are inadvertently loaded too early. [#52199](https://github.com/woocommerce/woocommerce/pull/52199)
|
||||
* Fix - Add a retry mechanism to the query to obtain the SKU lock for product creation through the API. [#51735](https://github.com/woocommerce/woocommerce/pull/51735)
|
||||
* Fix - Fix `Error: Failed opening required '.../wp-content/plugins/woocommerce/src/StoreApi/Schemas/V1/AI/ProductsSchema.php` fatal error [#51912](https://github.com/woocommerce/woocommerce/pull/51912)
|
||||
|
|
Loading…
Reference in New Issue