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

Add back ToggleButtonControl component in WC Blocks 8.9 so it supports WP 5.9 #8101

Merged
merged 5 commits into from
Jan 4, 2023

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Jan 4, 2023

This PR adds back the ToggleButtonControl component and uses it instead of ToggleGroupControl from GB. The reason is that the GB component is not available in WP 5.8, and we need to support it in WC 7.2. In practice, this PR reverts #5967.

The plan is to merge this PR only in release/8.9.x, so we only revert #5967 in the 8.9.x branch, but not in trunk.

Testing

User Facing Testing

  1. In WP 5.8.
  2. Create a post or page.
  3. Add the Filter by Attribute block.
  4. Select one of the attributes.
  5. Verify the block is added correctly, you can publish the post/page and there is no error.
  6. Play around with the block display settings and verify the block honors them:

  1. Test also these blocks (in all of them, interact with the toggles on the sidebar of the editor and verify the block doesn't crash and the settings are applied correctly):
    • Feature Product
    • Featured Category
    • Product Image (you will need to add the All Products block, click on the pencil icon to edit its inner blocks, and select the image)
    • Active Product Filters (you will need to select the Controls inner block)
    • Filter by Price (you will need to select the Controls inner block)
    • Product Categories List
  • Do not include in the Testing Notes

WooCommerce Visibility

  • WooCommerce Core
  • Feature plugin
  • Experimental

Performance Impact

Changelog

Fix Filter by Attribute block crashing in the editor of WordPress 5.8.

@Aljullu Aljullu added this to the 8.9.4 milestone Jan 4, 2023
@Aljullu Aljullu self-assigned this Jan 4, 2023
@Aljullu Aljullu added status: needs review type: bug The issue/PR concerns a confirmed bug. focus: components Work that introduces new or updates existing components. labels Jan 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

The release ZIP for this PR is accessible via:

https://wcblocks.wpcomstaging.com/wp-content/uploads/woocommerce-gutenberg-products-block-8101.zip

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

TypeScript Errors Report

Files with errors: 445
Total errors: 2110

⚠️ ⚠️ This PR introduces new TS errors on 48 files:

assets/js/atomic/blocks/product-elements/image/block.js

assets/js/atomic/blocks/product-elements/image/edit.js

assets/js/atomic/blocks/product-elements/image/index.js

assets/js/atomic/blocks/product-elements/image/test/block.test.js

assets/js/atomic/blocks/product-elements/price/attributes.js

assets/js/atomic/blocks/product-elements/price/block.js

assets/js/atomic/blocks/product-elements/price/edit.js

assets/js/atomic/blocks/product-elements/price/index.js

assets/js/atomic/blocks/product-elements/rating/block.tsx

assets/js/atomic/blocks/product-elements/stock-indicator/block.js

assets/js/atomic/blocks/product-elements/stock-indicator/edit.js

assets/js/atomic/blocks/product-elements/tag-list/index.ts

assets/js/base/components/cart-checkout/address-form/address-form.tsx

assets/js/base/components/cart-checkout/totals/coupon/index.tsx

assets/js/base/components/product-price/index.tsx

assets/js/base/components/reviews/review-list-item/index.js

assets/js/base/components/reviews/review-list/index.js

assets/js/base/components/state-input/state-input.tsx

assets/js/base/components/text-input/text-input.tsx

assets/js/base/components/text-input/validated-text-input.tsx

assets/js/base/context/hooks/use-checkout-submit.js

assets/js/base/context/providers/store-notices/components/store-notices-container.js

assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js

assets/js/blocks/cart/block.js

assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx

assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx

assets/js/blocks/checkout/block.tsx

assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx

assets/js/blocks/checkout/phone-number/index.tsx

assets/js/blocks/mini-cart/frontend.ts

assets/js/blocks/product-query/constants.ts

assets/js/blocks/single-product/block.js

assets/js/blocks/single-product/edit/index.js

assets/js/blocks/single-product/edit/layout-editor.js

assets/js/data/payment/check-payment-methods.ts

assets/js/editor-components/toggle-button-control/index.js

assets/js/types/type-defs/payment-method-interface.ts

assets/js/utils/notices.ts

packages/checkout/blocks-registry/get-registered-blocks.ts

packages/checkout/blocks-registry/index.ts

packages/checkout/blocks-registry/register-checkout-block.ts

packages/checkout/components/index.js

packages/checkout/components/order-meta/index.js

packages/checkout/components/totals/index.js

packages/checkout/index.js

packages/checkout/slot/index.js

packages/checkout/utils/index.js

packages/prices/utils/price.ts

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Size Change: +3.37 kB (0%)

Total Size: 1 MB

Filename Size Change
build/active-filters.js 7.7 kB +374 B (+5%) 🔍
build/all-products.js 34 kB +312 B (+1%)
build/all-reviews.js 8.06 kB +272 B (+3%)
build/attribute-filter.js 12.6 kB +338 B (+3%)
build/cart.js 47.5 kB +4 B (0%)
build/checkout.js 41.2 kB -2 B (0%)
build/featured-category.js 13.5 kB +346 B (+3%)
build/featured-product.js 13.8 kB +363 B (+3%)
build/filter-wrapper.js 2.4 kB +1 B (0%)
build/handpicked-products.js 7.33 kB +5 B (0%)
build/legacy-template.js 2.83 kB -1 B (0%)
build/mini-cart-contents.js 17.2 kB -10 B (0%)
build/mini-cart.js 4.28 kB -2 B (0%)
build/price-filter.js 8.7 kB +327 B (+4%)
build/product-add-to-cart.js 8.59 kB +17 B (0%)
build/product-best-sellers.js 7.7 kB -1 B (0%)
build/product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01.js 438 B +7 B (+2%)
build/product-button.js 3.87 kB +2 B (0%)
build/product-categories.js 2.74 kB +385 B (+16%) ⚠️
build/product-category-list.js 503 B +1 B (0%)
build/product-category.js 8.69 kB +2 B (0%)
build/product-image.js 3.99 kB -3 B (0%)
build/product-on-sale.js 8.02 kB +1 B (0%)
build/product-price.js 1.53 kB +2 B (0%)
build/product-rating.js 786 B -2 B (0%)
build/product-sale-badge.js 814 B +1 B (0%)
build/product-search.js 2.62 kB +3 B (0%)
build/product-stock-indicator.js 623 B -1 B (0%)
build/product-summary.js 918 B -2 B (0%)
build/product-tag-list.js 498 B +1 B (0%)
build/product-tag.js 8.05 kB +2 B (0%)
build/product-title.js 3.36 kB -1 B (0%)
build/product-top-rated.js 7.93 kB +3 B (0%)
build/products-by-attribute.js 8.62 kB +5 B (0%)
build/rating-filter.js 5.78 kB +6 B (0%)
build/reviews-by-category.js 11.6 kB +256 B (+2%)
build/reviews-by-product.js 12.7 kB +264 B (+2%)
build/single-product.js 10.1 kB -1 B (0%)
build/stock-filter.js 6.7 kB +1 B (0%)
build/wc-blocks-editor-style-rtl.css 5.28 kB +40 B (+1%)
build/wc-blocks-editor-style.css 5.28 kB +40 B (+1%)
build/wc-blocks-vendors.js 62.4 kB +9 B (0%)
build/wc-blocks.js 2.63 kB +1 B (0%)
ℹ️ View Unchanged
Filename Size
build/active-filters-frontend.js 7.74 kB
build/active-filters-wrapper-frontend.js 6.02 kB
build/all-products-frontend.js 26.5 kB
build/attribute-filter-frontend.js 22.6 kB
build/attribute-filter-wrapper-frontend.js 7.12 kB
build/blocks-checkout.js 17.5 kB
build/cart-blocks/cart-accepted-payment-methods-frontend.js 1.38 kB
build/cart-blocks/cart-cross-sells-frontend.js 253 B
build/cart-blocks/cart-cross-sells-products--product-add-to-cart-frontend.js 5.63 kB
build/cart-blocks/cart-cross-sells-products-frontend.js 4.68 kB
build/cart-blocks/cart-express-payment--checkout-blocks/express-payment-frontend.js 5.1 kB
build/cart-blocks/cart-express-payment-frontend.js 785 B
build/cart-blocks/cart-items-frontend.js 299 B
build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js 5.31 kB
build/cart-blocks/cart-line-items-frontend.js 1.07 kB
build/cart-blocks/cart-order-summary-frontend.js 1.11 kB
build/cart-blocks/cart-totals-frontend.js 320 B
build/cart-blocks/empty-cart-frontend.js 346 B
build/cart-blocks/filled-cart-frontend.js 783 B
build/cart-blocks/order-summary-coupon-form-frontend.js 2.73 kB
build/cart-blocks/order-summary-discount-frontend.js 2.16 kB
build/cart-blocks/order-summary-fee-frontend.js 272 B
build/cart-blocks/order-summary-heading-frontend.js 456 B
build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js 6.61 kB
build/cart-blocks/order-summary-shipping-frontend.js 428 B
build/cart-blocks/order-summary-subtotal-frontend.js 273 B
build/cart-blocks/order-summary-taxes-frontend.js 433 B
build/cart-blocks/proceed-to-checkout-frontend.js 1.19 kB
build/cart-frontend.js 54.5 kB
build/checkout-blocks/actions-frontend.js 1.79 kB
build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js 4.98 kB
build/checkout-blocks/billing-address-frontend.js 952 B
build/checkout-blocks/contact-information-frontend.js 3.02 kB
build/checkout-blocks/express-payment-frontend.js 1.13 kB
build/checkout-blocks/fields-frontend.js 343 B
build/checkout-blocks/order-note-frontend.js 1.14 kB
build/checkout-blocks/order-summary-cart-items-frontend.js 3.67 kB
build/checkout-blocks/order-summary-coupon-form-frontend.js 2.88 kB
build/checkout-blocks/order-summary-discount-frontend.js 2.28 kB
build/checkout-blocks/order-summary-fee-frontend.js 275 B
build/checkout-blocks/order-summary-frontend.js 1.11 kB
build/checkout-blocks/order-summary-shipping-frontend.js 603 B
build/checkout-blocks/order-summary-subtotal-frontend.js 273 B
build/checkout-blocks/order-summary-taxes-frontend.js 433 B
build/checkout-blocks/payment-frontend.js 7.86 kB
build/checkout-blocks/shipping-address-frontend.js 1.06 kB
build/checkout-blocks/shipping-methods-frontend.js 4.89 kB
build/checkout-blocks/terms-frontend.js 1.64 kB
build/checkout-blocks/totals-frontend.js 323 B
build/checkout-frontend.js 56.7 kB
build/filter-wrapper-frontend.js 13.8 kB
build/general-style-rtl.css 1.29 kB
build/general-style.css 1.29 kB
build/mini-cart-component-frontend.js 20.1 kB
build/mini-cart-contents-block/empty-cart-frontend.js 367 B
build/mini-cart-contents-block/filled-cart-frontend.js 230 B
build/mini-cart-contents-block/footer-frontend.js 2.97 kB
build/mini-cart-contents-block/items-frontend.js 236 B
build/mini-cart-contents-block/products-table-frontend.js 590 B
build/mini-cart-contents-block/shopping-button-frontend.js 287 B
build/mini-cart-contents-block/title-frontend.js 367 B
build/mini-cart-frontend.js 1.94 kB
build/price-filter-frontend.js 13.6 kB
build/price-filter-wrapper-frontend.js 7.01 kB
build/price-format.js 1.19 kB
build/product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00.js 228 B
build/product-add-to-cart--product-button--product-image--product-rating--product-title.js 151 B
build/product-add-to-cart-frontend.js 1.25 kB
build/product-button--product-image--product-rating--product-sale-badge--product-title.js 301 B
build/product-button-frontend.js 1.89 kB
build/product-category-list-frontend.js 884 B
build/product-image-frontend.js 1.92 kB
build/product-new.js 7.69 kB
build/product-price-frontend.js 1.92 kB
build/product-query.js 2.89 kB
build/product-rating-frontend.js 1.2 kB
build/product-sale-badge-frontend.js 1.15 kB
build/product-sku-frontend.js 378 B
build/product-sku.js 377 B
build/product-stock-indicator-frontend.js 1 kB
build/product-summary-frontend.js 1.29 kB
build/product-tag-list-frontend.js 877 B
build/product-title-frontend.js 1.34 kB
build/rating-filter-frontend.js 7.13 kB
build/rating-filter-wrapper-frontend.js 5.39 kB
build/reviews-frontend.js 7.01 kB
build/single-product-frontend.js 32.3 kB
build/stock-filter-frontend.js 7.78 kB
build/stock-filter-wrapper-frontend.js 6.03 kB
build/vendors--attribute-filter-wrapper--mini-cart-contents-block/footer-frontend.js 6.86 kB
build/vendors--attribute-filter-wrapper-frontend.js 8.22 kB
build/vendors--cart-blocks/cart-cross-sells-products--cart-blocks/cart-line-items--cart-blocks/cart-order--671ca56f-frontend.js 5.26 kB
build/vendors--cart-blocks/cart-cross-sells-products--cart-blocks/order-summary-shipping--checkout-blocks--18f9376a-frontend.js 19.1 kB
build/vendors--cart-blocks/cart-cross-sells-products--product-add-to-cart-frontend.js 7.53 kB
build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js 3.14 kB
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b-frontend.js 4.85 kB
build/wc-blocks-data.js 18.3 kB
build/wc-blocks-google-analytics.js 1.56 kB
build/wc-blocks-middleware.js 932 B
build/wc-blocks-registry.js 2.93 kB
build/wc-blocks-shared-context.js 1.52 kB
build/wc-blocks-shared-hocs.js 1.72 kB
build/wc-blocks-style-rtl.css 24.2 kB
build/wc-blocks-style.css 24.2 kB
build/wc-blocks-vendors-style-rtl.css 1.95 kB
build/wc-blocks-vendors-style.css 1.95 kB
build/wc-payment-method-bacs.js 816 B
build/wc-payment-method-cheque.js 811 B
build/wc-payment-method-cod.js 909 B
build/wc-payment-method-paypal.js 837 B
build/wc-settings.js 2.6 kB

compressed-size-action

@Aljullu Aljullu requested review from a team and dinhtungdu and removed request for a team January 4, 2023 14:40
@sunyatasattva sunyatasattva self-requested a review January 4, 2023 16:20
Copy link
Contributor

@sunyatasattva sunyatasattva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as intended!

Copy link
Member

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aljullu Featured Products and Featured Category are still using ToggleGroupControl, which is broken when editing in the Editor. We should fix it there too IMO. Otherwise, this is LGTM.

image

@Aljullu
Copy link
Contributor Author

Aljullu commented Jan 4, 2023

Good catch, @dinhtungdu! I fixed it in c31b3c7 and updated the PR testing steps.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

TypeScript Errors Report

Files with errors: 445
Total errors: 2108

⚠️ ⚠️ This PR introduces new TS errors on 48 files:

assets/js/atomic/blocks/product-elements/image/block.js

assets/js/atomic/blocks/product-elements/image/edit.js

assets/js/atomic/blocks/product-elements/image/index.js

assets/js/atomic/blocks/product-elements/image/test/block.test.js

assets/js/atomic/blocks/product-elements/price/attributes.js

assets/js/atomic/blocks/product-elements/price/block.js

assets/js/atomic/blocks/product-elements/price/edit.js

assets/js/atomic/blocks/product-elements/price/index.js

assets/js/atomic/blocks/product-elements/rating/block.tsx

assets/js/atomic/blocks/product-elements/stock-indicator/block.js

assets/js/atomic/blocks/product-elements/stock-indicator/edit.js

assets/js/atomic/blocks/product-elements/tag-list/index.ts

assets/js/base/components/cart-checkout/address-form/address-form.tsx

assets/js/base/components/cart-checkout/totals/coupon/index.tsx

assets/js/base/components/product-price/index.tsx

assets/js/base/components/reviews/review-list-item/index.js

assets/js/base/components/reviews/review-list/index.js

assets/js/base/components/state-input/state-input.tsx

assets/js/base/components/text-input/text-input.tsx

assets/js/base/components/text-input/validated-text-input.tsx

assets/js/base/context/hooks/use-checkout-submit.js

assets/js/base/context/providers/store-notices/components/store-notices-container.js

assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js

assets/js/blocks/cart/block.js

assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx

assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx

assets/js/blocks/checkout/block.tsx

assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx

assets/js/blocks/checkout/phone-number/index.tsx

assets/js/blocks/mini-cart/frontend.ts

assets/js/blocks/product-query/constants.ts

assets/js/blocks/single-product/block.js

assets/js/blocks/single-product/edit/index.js

assets/js/blocks/single-product/edit/layout-editor.js

assets/js/data/payment/check-payment-methods.ts

assets/js/editor-components/toggle-button-control/index.js

assets/js/types/type-defs/payment-method-interface.ts

assets/js/utils/notices.ts

packages/checkout/blocks-registry/get-registered-blocks.ts

packages/checkout/blocks-registry/index.ts

packages/checkout/blocks-registry/register-checkout-block.ts

packages/checkout/components/index.js

packages/checkout/components/order-meta/index.js

packages/checkout/components/totals/index.js

packages/checkout/index.js

packages/checkout/slot/index.js

packages/checkout/utils/index.js

packages/prices/utils/price.ts

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Script Dependencies Report

The compare-assets action has detected some changed script dependencies between this branch and trunk. Please review and confirm the following are correct before merging.

Script Handle Added Removed
reviews-frontend.js react, wc-settings, wp-a11y, wp-api-fetch, wp-compose, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill ⚠️
all-products-frontend.js lodash, react, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-context, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-block-editor, wp-blocks, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
price-filter-frontend.js lodash, react, wc-blocks-data-store, wc-price-format, wc-settings, wp-data, wp-element, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-url ⚠️
attribute-filter-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-settings, wp-a11y, wp-block-editor, wp-blocks, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-polyfill, wp-primitives, wp-url, wp-warning ⚠️
stock-filter-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-settings, wp-a11y, wp-data, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-url ⚠️
active-filters-frontend.js lodash, react, wc-blocks-data-store, wc-price-format, wc-settings, wp-data, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url ⚠️
rating-filter-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-settings, wp-a11y, wp-data, wp-element, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-url ⚠️
cart-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-context, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-block-editor, wp-blocks, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-plugins, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
checkout-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-plugins, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
mini-cart-frontend.js wc-settings, wp-polyfill ⚠️
single-product-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-blocks-shared-context, wc-blocks-shared-hocs, wc-price-format, wc-settings, wp-a11y, wp-api-fetch, wp-autop, wp-block-editor, wp-blocks, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️
filter-wrapper-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-price-format, wc-settings, wp-a11y, wp-block-editor, wp-blocks, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-polyfill, wp-primitives, wp-url, wp-warning ⚠️
mini-cart-component-frontend.js lodash, react, wc-blocks-checkout, wc-blocks-data-store, wc-blocks-registry, wc-price-format, wc-settings, wp-a11y, wp-autop, wp-components, wp-compose, wp-data, wp-deprecated, wp-dom, wp-element, wp-hooks, wp-html-entities, wp-i18n, wp-is-shallow-equal, wp-keycodes, wp-polyfill, wp-primitives, wp-url, wp-warning, wp-wordcount ⚠️

This comment was automatically generated by the ./github/compare-assets action.

Copy link
Member

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Aljullu Look like we discovered another error. After choosing a category to display for the Featured Category block, I got this, can you reproduce in your end?

image

image

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

TypeScript Errors Report

Files with errors: 445
Total errors: 2108

⚠️ ⚠️ This PR introduces new TS errors on 48 files:

assets/js/atomic/blocks/product-elements/image/block.js

assets/js/atomic/blocks/product-elements/image/edit.js

assets/js/atomic/blocks/product-elements/image/index.js

assets/js/atomic/blocks/product-elements/image/test/block.test.js

assets/js/atomic/blocks/product-elements/price/attributes.js

assets/js/atomic/blocks/product-elements/price/block.js

assets/js/atomic/blocks/product-elements/price/edit.js

assets/js/atomic/blocks/product-elements/price/index.js

assets/js/atomic/blocks/product-elements/rating/block.tsx

assets/js/atomic/blocks/product-elements/stock-indicator/block.js

assets/js/atomic/blocks/product-elements/stock-indicator/edit.js

assets/js/atomic/blocks/product-elements/tag-list/index.ts

assets/js/base/components/cart-checkout/address-form/address-form.tsx

assets/js/base/components/cart-checkout/totals/coupon/index.tsx

assets/js/base/components/product-price/index.tsx

assets/js/base/components/reviews/review-list-item/index.js

assets/js/base/components/reviews/review-list/index.js

assets/js/base/components/state-input/state-input.tsx

assets/js/base/components/text-input/text-input.tsx

assets/js/base/components/text-input/validated-text-input.tsx

assets/js/base/context/hooks/use-checkout-submit.js

assets/js/base/context/providers/store-notices/components/store-notices-container.js

assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js

assets/js/blocks/cart/block.js

assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx

assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx

assets/js/blocks/checkout/block.tsx

assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx

assets/js/blocks/checkout/phone-number/index.tsx

assets/js/blocks/mini-cart/frontend.ts

assets/js/blocks/product-query/constants.ts

assets/js/blocks/single-product/block.js

assets/js/blocks/single-product/edit/index.js

assets/js/blocks/single-product/edit/layout-editor.js

assets/js/data/payment/check-payment-methods.ts

assets/js/editor-components/toggle-button-control/index.js

assets/js/types/type-defs/payment-method-interface.ts

assets/js/utils/notices.ts

packages/checkout/blocks-registry/get-registered-blocks.ts

packages/checkout/blocks-registry/index.ts

packages/checkout/blocks-registry/register-checkout-block.ts

packages/checkout/components/index.js

packages/checkout/components/order-meta/index.js

packages/checkout/components/totals/index.js

packages/checkout/index.js

packages/checkout/slot/index.js

packages/checkout/utils/index.js

packages/prices/utils/price.ts

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

TypeScript Errors Report

Files with errors: 445
Total errors: 2108

⚠️ ⚠️ This PR introduces new TS errors on 48 files:

assets/js/atomic/blocks/product-elements/image/block.js

assets/js/atomic/blocks/product-elements/image/edit.js

assets/js/atomic/blocks/product-elements/image/index.js

assets/js/atomic/blocks/product-elements/image/test/block.test.js

assets/js/atomic/blocks/product-elements/price/attributes.js

assets/js/atomic/blocks/product-elements/price/block.js

assets/js/atomic/blocks/product-elements/price/edit.js

assets/js/atomic/blocks/product-elements/price/index.js

assets/js/atomic/blocks/product-elements/rating/block.tsx

assets/js/atomic/blocks/product-elements/stock-indicator/block.js

assets/js/atomic/blocks/product-elements/stock-indicator/edit.js

assets/js/atomic/blocks/product-elements/tag-list/index.ts

assets/js/base/components/cart-checkout/address-form/address-form.tsx

assets/js/base/components/cart-checkout/totals/coupon/index.tsx

assets/js/base/components/product-price/index.tsx

assets/js/base/components/reviews/review-list-item/index.js

assets/js/base/components/reviews/review-list/index.js

assets/js/base/components/state-input/state-input.tsx

assets/js/base/components/text-input/text-input.tsx

assets/js/base/components/text-input/validated-text-input.tsx

assets/js/base/context/hooks/use-checkout-submit.js

assets/js/base/context/providers/store-notices/components/store-notices-container.js

assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js

assets/js/blocks/cart/block.js

assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx

assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx

assets/js/blocks/checkout/block.tsx

assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx

assets/js/blocks/checkout/phone-number/index.tsx

assets/js/blocks/mini-cart/frontend.ts

assets/js/blocks/product-query/constants.ts

assets/js/blocks/single-product/block.js

assets/js/blocks/single-product/edit/index.js

assets/js/blocks/single-product/edit/layout-editor.js

assets/js/data/payment/check-payment-methods.ts

assets/js/editor-components/toggle-button-control/index.js

assets/js/types/type-defs/payment-method-interface.ts

assets/js/utils/notices.ts

packages/checkout/blocks-registry/get-registered-blocks.ts

packages/checkout/blocks-registry/index.ts

packages/checkout/blocks-registry/register-checkout-block.ts

packages/checkout/components/index.js

packages/checkout/components/order-meta/index.js

packages/checkout/components/totals/index.js

packages/checkout/index.js

packages/checkout/slot/index.js

packages/checkout/utils/index.js

packages/prices/utils/price.ts

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

TypeScript Errors Report

Files with errors: 445
Total errors: 2108

⚠️ ⚠️ This PR introduces new TS errors on 48 files:

assets/js/atomic/blocks/product-elements/image/block.js

assets/js/atomic/blocks/product-elements/image/edit.js

assets/js/atomic/blocks/product-elements/image/index.js

assets/js/atomic/blocks/product-elements/image/test/block.test.js

assets/js/atomic/blocks/product-elements/price/attributes.js

assets/js/atomic/blocks/product-elements/price/block.js

assets/js/atomic/blocks/product-elements/price/edit.js

assets/js/atomic/blocks/product-elements/price/index.js

assets/js/atomic/blocks/product-elements/rating/block.tsx

assets/js/atomic/blocks/product-elements/stock-indicator/block.js

assets/js/atomic/blocks/product-elements/stock-indicator/edit.js

assets/js/atomic/blocks/product-elements/tag-list/index.ts

assets/js/base/components/cart-checkout/address-form/address-form.tsx

assets/js/base/components/cart-checkout/totals/coupon/index.tsx

assets/js/base/components/product-price/index.tsx

assets/js/base/components/reviews/review-list-item/index.js

assets/js/base/components/reviews/review-list/index.js

assets/js/base/components/state-input/state-input.tsx

assets/js/base/components/text-input/text-input.tsx

assets/js/base/components/text-input/validated-text-input.tsx

assets/js/base/context/hooks/use-checkout-submit.js

assets/js/base/context/providers/store-notices/components/store-notices-container.js

assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js

assets/js/blocks/cart/block.js

assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx

assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx

assets/js/blocks/checkout/block.tsx

assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx

assets/js/blocks/checkout/phone-number/index.tsx

assets/js/blocks/mini-cart/frontend.ts

assets/js/blocks/product-query/constants.ts

assets/js/blocks/single-product/block.js

assets/js/blocks/single-product/edit/index.js

assets/js/blocks/single-product/edit/layout-editor.js

assets/js/data/payment/check-payment-methods.ts

assets/js/editor-components/toggle-button-control/index.js

assets/js/types/type-defs/payment-method-interface.ts

assets/js/utils/notices.ts

packages/checkout/blocks-registry/get-registered-blocks.ts

packages/checkout/blocks-registry/index.ts

packages/checkout/blocks-registry/register-checkout-block.ts

packages/checkout/components/index.js

packages/checkout/components/order-meta/index.js

packages/checkout/components/totals/index.js

packages/checkout/index.js

packages/checkout/slot/index.js

packages/checkout/utils/index.js

packages/prices/utils/price.ts

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

TypeScript Errors Report

Files with errors: 445
Total errors: 2108

⚠️ ⚠️ This PR introduces new TS errors on 48 files:

assets/js/atomic/blocks/product-elements/image/block.js

assets/js/atomic/blocks/product-elements/image/edit.js

assets/js/atomic/blocks/product-elements/image/index.js

assets/js/atomic/blocks/product-elements/image/test/block.test.js

assets/js/atomic/blocks/product-elements/price/attributes.js

assets/js/atomic/blocks/product-elements/price/block.js

assets/js/atomic/blocks/product-elements/price/edit.js

assets/js/atomic/blocks/product-elements/price/index.js

assets/js/atomic/blocks/product-elements/rating/block.tsx

assets/js/atomic/blocks/product-elements/stock-indicator/block.js

assets/js/atomic/blocks/product-elements/stock-indicator/edit.js

assets/js/atomic/blocks/product-elements/tag-list/index.ts

assets/js/base/components/cart-checkout/address-form/address-form.tsx

assets/js/base/components/cart-checkout/totals/coupon/index.tsx

assets/js/base/components/product-price/index.tsx

assets/js/base/components/reviews/review-list-item/index.js

assets/js/base/components/reviews/review-list/index.js

assets/js/base/components/state-input/state-input.tsx

assets/js/base/components/text-input/text-input.tsx

assets/js/base/components/text-input/validated-text-input.tsx

assets/js/base/context/hooks/use-checkout-submit.js

assets/js/base/context/providers/store-notices/components/store-notices-container.js

assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js

assets/js/blocks/cart/block.js

assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx

assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx

assets/js/blocks/checkout/block.tsx

assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx

assets/js/blocks/checkout/phone-number/index.tsx

assets/js/blocks/mini-cart/frontend.ts

assets/js/blocks/product-query/constants.ts

assets/js/blocks/single-product/block.js

assets/js/blocks/single-product/edit/index.js

assets/js/blocks/single-product/edit/layout-editor.js

assets/js/data/payment/check-payment-methods.ts

assets/js/editor-components/toggle-button-control/index.js

assets/js/types/type-defs/payment-method-interface.ts

assets/js/utils/notices.ts

packages/checkout/blocks-registry/get-registered-blocks.ts

packages/checkout/blocks-registry/index.ts

packages/checkout/blocks-registry/register-checkout-block.ts

packages/checkout/components/index.js

packages/checkout/components/order-meta/index.js

packages/checkout/components/totals/index.js

packages/checkout/index.js

packages/checkout/slot/index.js

packages/checkout/utils/index.js

packages/prices/utils/price.ts

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

TypeScript Errors Report

Files with errors: 445
Total errors: 2108

⚠️ ⚠️ This PR introduces new TS errors on 48 files:

assets/js/atomic/blocks/product-elements/image/block.js

assets/js/atomic/blocks/product-elements/image/edit.js

assets/js/atomic/blocks/product-elements/image/index.js

assets/js/atomic/blocks/product-elements/image/test/block.test.js

assets/js/atomic/blocks/product-elements/price/attributes.js

assets/js/atomic/blocks/product-elements/price/block.js

assets/js/atomic/blocks/product-elements/price/edit.js

assets/js/atomic/blocks/product-elements/price/index.js

assets/js/atomic/blocks/product-elements/rating/block.tsx

assets/js/atomic/blocks/product-elements/stock-indicator/block.js

assets/js/atomic/blocks/product-elements/stock-indicator/edit.js

assets/js/atomic/blocks/product-elements/tag-list/index.ts

assets/js/base/components/cart-checkout/address-form/address-form.tsx

assets/js/base/components/cart-checkout/totals/coupon/index.tsx

assets/js/base/components/product-price/index.tsx

assets/js/base/components/reviews/review-list-item/index.js

assets/js/base/components/reviews/review-list/index.js

assets/js/base/components/state-input/state-input.tsx

assets/js/base/components/text-input/text-input.tsx

assets/js/base/components/text-input/validated-text-input.tsx

assets/js/base/context/hooks/use-checkout-submit.js

assets/js/base/context/providers/store-notices/components/store-notices-container.js

assets/js/base/context/providers/store-snackbar-notices/components/snackbar-notices-container.js

assets/js/blocks/cart/block.js

assets/js/blocks/cart/cart-cross-sells-product-list/cart-cross-sells-product.tsx

assets/js/blocks/cart/cart-line-items-table/cart-line-item-row.tsx

assets/js/blocks/checkout/block.tsx

assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/block.tsx

assets/js/blocks/checkout/phone-number/index.tsx

assets/js/blocks/mini-cart/frontend.ts

assets/js/blocks/product-query/constants.ts

assets/js/blocks/single-product/block.js

assets/js/blocks/single-product/edit/index.js

assets/js/blocks/single-product/edit/layout-editor.js

assets/js/data/payment/check-payment-methods.ts

assets/js/editor-components/toggle-button-control/index.js

assets/js/types/type-defs/payment-method-interface.ts

assets/js/utils/notices.ts

packages/checkout/blocks-registry/get-registered-blocks.ts

packages/checkout/blocks-registry/index.ts

packages/checkout/blocks-registry/register-checkout-block.ts

packages/checkout/components/index.js

packages/checkout/components/order-meta/index.js

packages/checkout/components/totals/index.js

packages/checkout/index.js

packages/checkout/slot/index.js

packages/checkout/utils/index.js

packages/prices/utils/price.ts

@Aljullu
Copy link
Contributor Author

Aljullu commented Jan 4, 2023

@Aljullu Look like we discovered another error. After choosing a category to display for the Featured Category block, I got this, can you reproduce in your end?

This should be fixed in addac8e. Thanks for catching it, @dinhtungdu!

I noticed there is an issue with the button alignment when inserting the block: it defaults to left alignment.

imatge

This can be changed directly from the editor, so I consider it not a blocker. Also, I'm uncertain whether there is an easy way to fix it without breaking it in newer WP installs.

@Aljullu Aljullu requested a review from dinhtungdu January 4, 2023 17:30
Copy link
Contributor

@sunyatasattva sunyatasattva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, as discussed in Slack, all provided testing steps work for me as intended. Thanks for this patch!

@Aljullu Aljullu merged commit af66736 into release/8.9.4 Jan 4, 2023
@Aljullu Aljullu deleted the revert/5967 branch January 4, 2023 18:11
Aljullu added a commit that referenced this pull request Jan 5, 2023
* Empty commit for release pull request

* Refactor Filter Wrapper to remove usage of useInnerBlocksProps (#8095)

* Add WC Blocks 8.9.4 changelog

* Add 8.9.4 testing steps

* bot: update checkstyle.xml

* Add back ToggleButtonControl component in WC Blocks 8.9 so it supports WP 5.9 (#8101)

* Add back ToggleButtonControl component in WC Blocks 8.9 so it supports WP 5.9

* bot: update checkstyle.xml

* Update Featured Product/Category to use ToggleButtonControl as well

* bot: update checkstyle.xml

* Only use getSpacingClassesAndStyles if available

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update testing steps

* Bumping version strings to new version.

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Tung Du <[email protected]>
Co-authored-by: Albert Juhé Lluveras <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: components Work that introduces new or updates existing components. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants