[Experimental] Fix: regression introduced in #44757 that breaks the inspector settings of the new attribute filter block (#45276)
Fix: regression introduced in #44757 that breaks the inspector settings of the new attribute filter block
This commit is contained in:
parent
6490682366
commit
91272dde6f
|
@ -18,17 +18,12 @@ import {
|
||||||
* Internal dependencies
|
* Internal dependencies
|
||||||
*/
|
*/
|
||||||
import { AttributeSelectControls } from './attribute-select-controls';
|
import { AttributeSelectControls } from './attribute-select-controls';
|
||||||
import { BlockAttributes } from '../types';
|
import { EditProps } from '../types';
|
||||||
|
|
||||||
export const Inspector = ( {
|
export const Inspector = ( { attributes, setAttributes }: EditProps ) => {
|
||||||
attributes,
|
|
||||||
setAttributeId,
|
|
||||||
}: {
|
|
||||||
attributes: BlockAttributes;
|
|
||||||
setAttributeId: ( id: unknown ) => void;
|
|
||||||
} ) => {
|
|
||||||
const { attributeId, showCounts, queryType, displayStyle, selectType } =
|
const { attributeId, showCounts, queryType, displayStyle, selectType } =
|
||||||
attributes;
|
attributes;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InspectorControls key="inspector">
|
<InspectorControls key="inspector">
|
||||||
<PanelBody title={ __( 'Display Settings', 'woocommerce' ) }>
|
<PanelBody title={ __( 'Display Settings', 'woocommerce' ) }>
|
||||||
|
@ -122,7 +117,11 @@ export const Inspector = ( {
|
||||||
<AttributeSelectControls
|
<AttributeSelectControls
|
||||||
isCompact={ true }
|
isCompact={ true }
|
||||||
attributeId={ attributeId }
|
attributeId={ attributeId }
|
||||||
setAttributeId={ setAttributeId }
|
setAttributeId={ ( id: number ) => {
|
||||||
|
setAttributes( {
|
||||||
|
attributeId: id,
|
||||||
|
} );
|
||||||
|
} }
|
||||||
/>
|
/>
|
||||||
</PanelBody>
|
</PanelBody>
|
||||||
</InspectorControls>
|
</InspectorControls>
|
||||||
|
|
|
@ -241,18 +241,13 @@ const Edit = ( props: EditProps ) => {
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
);
|
);
|
||||||
|
|
||||||
const inspectorProps = {
|
|
||||||
...props,
|
|
||||||
setAttributeId,
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Wrapper
|
<Wrapper
|
||||||
onClickToolbarEdit={ toggleEditing }
|
onClickToolbarEdit={ toggleEditing }
|
||||||
isEditing={ isEditing }
|
isEditing={ isEditing }
|
||||||
blockProps={ blockProps }
|
blockProps={ blockProps }
|
||||||
>
|
>
|
||||||
<Inspector { ...inspectorProps } />
|
<Inspector { ...props } />
|
||||||
<Disabled>
|
<Disabled>
|
||||||
{ displayStyle === 'dropdown' ? (
|
{ displayStyle === 'dropdown' ? (
|
||||||
<AttributeDropdown
|
<AttributeDropdown
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Experimental: Fix: Regression introduced in #44757 that breaks the inspector setting of the new attribute filter block.
|
Loading…
Reference in New Issue