Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix Price Block Inserter Visibility (#7559)
Browse files Browse the repository at this point in the history
* Remove `parent` from block config.

By removing the `parent` property from the block config, we can have
more flexibility to where we can use the pricing block - i.e., it does
not need to be a direct descendent of a `core/group` block.

* Remove unused save function/file.

* bot: update checkstyle.xml

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2022
1 parent a752b77 commit da19ff8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
1 change: 0 additions & 1 deletion assets/js/atomic/blocks/product-elements/price/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const blockConfig = {
apiVersion: 2,
title,
description,
parent: [ 'core/group' ],
ancestor: [
'@woocommerce/all-products',
'@woocommerce/single-product',
Expand Down
21 changes: 0 additions & 21 deletions assets/js/atomic/blocks/product-elements/price/save.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1479,13 +1479,13 @@
Object literal may only specify known properties, and &apos;textAlign&apos; does not exist in type &apos;{ productId: { type: string; default: number; }; isDescendentOfQueryLoop: { type: string; default: boolean; }; }&apos;." source="TS2322" />
</file>
<file name="assets/js/atomic/blocks/product-elements/price/index.js">
<error line="54" column="1" severity="error" message="No overload matches this call.
<error line="53" column="1" severity="error" message="No overload matches this call.
Overload 1 of 2, &apos;(metadata: BlockConfiguration&lt;{}&gt;, settings?: Partial&lt;BlockConfiguration&lt;{}&gt;&gt; | undefined): Block&lt;{}&gt; | undefined&apos;, gave the following error.
Argument of type &apos;string&apos; is not assignable to parameter of type &apos;BlockConfiguration&lt;{}&gt;&apos;.
Type &apos;string&apos; is not assignable to type &apos;Pick&lt;Block&lt;{}&gt;, &quot;title&quot; | &quot;category&quot; | &quot;attributes&quot;&gt;&apos;.
Overload 2 of 2, &apos;(name: string, settings: BlockConfiguration&lt;{}&gt;): Block&lt;{}&gt; | undefined&apos;, gave the following error.
Argument of type &apos;{ apiVersion: number; title: string; description: string; parent: string[]; ancestor: string[]; usesContext: string[]; icon: { src: JSX.Element; }; attributes: { productId: { type: string; default: number; }; isDescendentOfQueryLoop: { ...; }; }; ... 18 more ...; merge?: ((attributes: {}, attributesToMerge: {}) =&gt; P...&apos; is not assignable to parameter of type &apos;BlockConfiguration&lt;{}&gt;&apos; with &apos;exactOptionalPropertyTypes: true&apos;. Consider adding &apos;undefined&apos; to the types of the target&apos;s properties.
Type &apos;{ apiVersion: number; title: string; description: string; parent: string[]; ancestor: string[]; usesContext: string[]; icon: { src: JSX.Element; }; attributes: { productId: { type: string; default: number; }; isDescendentOfQueryLoop: { ...; }; }; ... 18 more ...; merge?: ((attributes: {}, attributesToMerge: {}) =&gt; P...&apos; is not assignable to type &apos;Partial&lt;Omit&lt;Block&lt;{}&gt;, &quot;icon&quot;&gt;&gt;&apos; with &apos;exactOptionalPropertyTypes: true&apos;. Consider adding &apos;undefined&apos; to the types of the target&apos;s properties.
Argument of type &apos;{ apiVersion: number; title: string; description: string; ancestor: string[]; usesContext: string[]; icon: { src: JSX.Element; }; attributes: { productId: { type: string; default: number; }; isDescendentOfQueryLoop: { ...; }; }; ... 19 more ...; merge?: ((attributes: {}, attributesToMerge: {}) =&gt; Partial&lt;...&gt;) | und...&apos; is not assignable to parameter of type &apos;BlockConfiguration&lt;{}&gt;&apos; with &apos;exactOptionalPropertyTypes: true&apos;. Consider adding &apos;undefined&apos; to the types of the target&apos;s properties.
Type &apos;{ apiVersion: number; title: string; description: string; ancestor: string[]; usesContext: string[]; icon: { src: JSX.Element; }; attributes: { productId: { type: string; default: number; }; isDescendentOfQueryLoop: { ...; }; }; ... 19 more ...; merge?: ((attributes: {}, attributesToMerge: {}) =&gt; Partial&lt;...&gt;) | und...&apos; is not assignable to type &apos;Partial&lt;Omit&lt;Block&lt;{}&gt;, &quot;icon&quot;&gt;&gt;&apos; with &apos;exactOptionalPropertyTypes: true&apos;. Consider adding &apos;undefined&apos; to the types of the target&apos;s properties.
The types of &apos;supports.color&apos; are incompatible between these types.
Type &apos;Partial&lt;ColorProps&gt; | { text: boolean; background: boolean; link: boolean; __experimentalSkipSerialization: boolean; } | undefined&apos; is not assignable to type &apos;Partial&lt;ColorProps&gt; | undefined&apos;.
Type &apos;{ text: boolean; background: boolean; link: boolean; __experimentalSkipSerialization: boolean; }&apos; is not assignable to type &apos;Partial&lt;ColorProps&gt;&apos;.
Expand Down

0 comments on commit da19ff8

Please sign in to comment.