Revert woocommerce/woocommerce-blocks#10032 so All Products renders in the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/11263)
This commit is contained in:
parent
ce6c7e460a
commit
276556a47c
|
@ -33,32 +33,4 @@ const v1 = {
|
|||
},
|
||||
};
|
||||
|
||||
const v2 = {
|
||||
attributes: Object.assign( {}, attributeDefinitions, {
|
||||
rows: { type: 'number', default: 1 },
|
||||
} ),
|
||||
save( { attributes } ) {
|
||||
const dataAttributes = {};
|
||||
Object.keys( attributes )
|
||||
.sort()
|
||||
.forEach( ( key ) => {
|
||||
dataAttributes[ key ] = attributes[ key ];
|
||||
} );
|
||||
const data = {
|
||||
'data-attributes': JSON.stringify( dataAttributes ),
|
||||
};
|
||||
return (
|
||||
<div
|
||||
className={ getBlockClassName(
|
||||
'wc-block-all-products',
|
||||
attributes
|
||||
) }
|
||||
{ ...data }
|
||||
>
|
||||
<InnerBlocks.Content />
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default [ v2, v1 ];
|
||||
export default [ v1 ];
|
||||
|
|
|
@ -9,12 +9,22 @@ import { InnerBlocks } from '@wordpress/block-editor';
|
|||
import { getBlockClassName } from '../utils.js';
|
||||
|
||||
export default function save( { attributes } ) {
|
||||
const dataAttributes = {};
|
||||
Object.keys( attributes )
|
||||
.sort()
|
||||
.forEach( ( key ) => {
|
||||
dataAttributes[ key ] = attributes[ key ];
|
||||
} );
|
||||
const data = {
|
||||
'data-attributes': JSON.stringify( dataAttributes ),
|
||||
};
|
||||
return (
|
||||
<div
|
||||
className={ getBlockClassName(
|
||||
'wc-block-all-products',
|
||||
attributes
|
||||
) }
|
||||
{ ...data }
|
||||
>
|
||||
<InnerBlocks.Content />
|
||||
</div>
|
||||
|
|
|
@ -42,8 +42,7 @@ test.describe( `${ blockData.name } Block - with All products Block`, () => {
|
|||
await page.goto( `/?p=${ postId }`, { waitUntil: 'commit' } );
|
||||
} );
|
||||
|
||||
// eslint-disable-next-line playwright/no-skipped-test
|
||||
test.skip( 'should show all products', async ( { frontendUtils } ) => {
|
||||
test( 'should show all products', async ( { frontendUtils } ) => {
|
||||
const allProductsBlock = await frontendUtils.getBlockByName(
|
||||
'woocommerce/all-products'
|
||||
);
|
||||
|
@ -60,8 +59,7 @@ test.describe( `${ blockData.name } Block - with All products Block`, () => {
|
|||
expect( products ).toHaveLength( 9 );
|
||||
} );
|
||||
|
||||
// eslint-disable-next-line playwright/no-skipped-test
|
||||
test.skip( 'should show only products that match the filter', async ( {
|
||||
test( 'should show only products that match the filter', async ( {
|
||||
page,
|
||||
frontendUtils,
|
||||
} ) => {
|
||||
|
|
Loading…
Reference in New Issue