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

Disable Cart, Checkout, All Products & filters blocks from the widgets screen #4646

Merged
merged 1 commit into from
Aug 30, 2021

Conversation

Aljullu
Copy link
Contributor

@Aljullu Aljullu commented Aug 27, 2021

Fixes #4640.

Regression from #3737. Currently, we are relying on a work-around to prevent some blocks being added to widget areas until a Gutenberg-supported solution is implemented (see WordPress/gutenberg#28517). It works detecting which is the current screen and based on that not registering some blocks.

Adding this PR to the 5.8 milestone and with label blocker because I consider this regression to be important enough. I'm on the fence on whether this deserves a point release of WC Blocks 5.7 and WC core 5.7. Thoughts @nerrad @frontdevde?

I also created an issue to add automated testing for this so we can detect if this work-around stops working in the future: #4645.

How to test the changes in this Pull Request:

With Storefront and WP 5.8:

  1. Go to Appearance > Widgets and verify you can't add the Cart, Checkout, All Products & filters blocks.
  2. Go to Appearance > Customizer > Widgets and verify you can't add those blocks either.
  3. Create a new post or page and verify those blocks can be added without problems.

Changelog

Disable Cart, Checkout, All Products & filters blocks from the widgets screen

@Aljullu Aljullu added status: needs review status: blocker Used on issues or pulls that block work from being released. focus: FSE Work related to prepare WooCommerce for FSE. labels Aug 27, 2021
@Aljullu Aljullu added this to the 5.8.0 milestone Aug 27, 2021
@Aljullu Aljullu requested a review from frontdevde August 27, 2021 09:10
@Aljullu Aljullu requested a review from a team as a code owner August 27, 2021 09:10
@Aljullu Aljullu self-assigned this Aug 27, 2021
@Aljullu Aljullu removed the request for review from a team August 27, 2021 09:10
@Aljullu Aljullu added the type: bug The issue/PR concerns a confirmed bug. label Aug 27, 2021
@github-actions
Copy link
Contributor

Size Change: 0 B

Total Size: 1.19 MB

ℹ️ View Unchanged
Filename Size
build/active-filters-frontend.js 8.38 kB
build/active-filters.js 8.01 kB
build/all-products-frontend.js 23 kB
build/all-products.js 37 kB
build/all-reviews.js 9.58 kB
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js 2.65 kB
build/atomic-block-components/add-to-cart--atomic-block-components/button.js 1.81 kB
build/atomic-block-components/add-to-cart--atomic-block-components/image--atomic-block-components/title.js 334 B
build/atomic-block-components/add-to-cart-frontend.js 8.38 kB
build/atomic-block-components/add-to-cart.js 7.74 kB
build/atomic-block-components/button-frontend.js 1.74 kB
build/atomic-block-components/button.js 876 B
build/atomic-block-components/category-list-frontend.js 470 B
build/atomic-block-components/category-list.js 476 B
build/atomic-block-components/image-frontend.js 1.88 kB
build/atomic-block-components/image.js 1.35 kB
build/atomic-block-components/price-frontend.js 2.09 kB
build/atomic-block-components/price.js 2.11 kB
build/atomic-block-components/rating-frontend.js 562 B
build/atomic-block-components/rating.js 566 B
build/atomic-block-components/sale-badge-frontend.js 859 B
build/atomic-block-components/sale-badge.js 868 B
build/atomic-block-components/sku-frontend.js 388 B
build/atomic-block-components/sku.js 395 B
build/atomic-block-components/stock-indicator-frontend.js 611 B
build/atomic-block-components/stock-indicator.js 612 B
build/atomic-block-components/summary-frontend.js 906 B
build/atomic-block-components/summary.js 911 B
build/atomic-block-components/tag-list-frontend.js 466 B
build/atomic-block-components/tag-list.js 472 B
build/atomic-block-components/title-frontend.js 1.44 kB
build/atomic-block-components/title.js 1.29 kB
build/attribute-filter-frontend.js 18.2 kB
build/attribute-filter.js 12.2 kB
build/blocks-checkout.js 21.2 kB
build/cart-frontend.js 91 kB
build/cart.js 45.8 kB
build/checkout-blocks/sample.js 174 B
build/checkout-frontend.js 95.1 kB
build/checkout-i2-frontend.js 51.7 kB
build/checkout-i2.js 48.9 kB
build/checkout.js 48.8 kB
build/featured-category.js 7.81 kB
build/featured-product.js 9.51 kB
build/handpicked-products.js 6.35 kB
build/mini-cart-component-frontend.js 35.4 kB
build/mini-cart-frontend.js 1.67 kB
build/mini-cart.js 2.35 kB
build/price-filter-frontend.js 14.5 kB
build/price-filter.js 9.7 kB
build/price-format.js 1.37 kB
build/product-best-sellers.js 6.69 kB
build/product-categories.js 3.38 kB
build/product-category.js 7.56 kB
build/product-new.js 6.85 kB
build/product-on-sale.js 7.21 kB
build/product-search.js 2.66 kB
build/product-tag.js 6.67 kB
build/product-top-rated.js 6.82 kB
build/products-by-attribute.js 7.79 kB
build/reviews-by-category.js 11.6 kB
build/reviews-by-product.js 13 kB
build/reviews-frontend.js 9.02 kB
build/single-product-frontend.js 26 kB
build/single-product.js 9.79 kB
build/stock-filter-frontend.js 8.74 kB
build/stock-filter.js 7.73 kB
build/vendors--atomic-block-components/add-to-cart-frontend.js 20.3 kB
build/vendors--atomic-block-components/price-frontend.js 5.71 kB
build/wc-blocks-data.js 11 kB
build/wc-blocks-editor-style-rtl.css 15.4 kB
build/wc-blocks-editor-style.css 15.5 kB
build/wc-blocks-google-analytics.js 1.98 kB
build/wc-blocks-middleware.js 1.47 kB
build/wc-blocks-registry.js 2.74 kB
build/wc-blocks-shared-context.js 1.54 kB
build/wc-blocks-shared-hocs.js 1.75 kB
build/wc-blocks-style-rtl.css 20.3 kB
build/wc-blocks-style.css 20.2 kB
build/wc-blocks-vendors-style-rtl.css 1.37 kB
build/wc-blocks-vendors-style.css 1.37 kB
build/wc-blocks-vendors.js 253 kB
build/wc-blocks.js 3.5 kB
build/wc-payment-method-bacs.js 806 B
build/wc-payment-method-cheque.js 806 B
build/wc-payment-method-cod.js 898 B
build/wc-payment-method-paypal.js 839 B
build/wc-payment-method-stripe.js 12.2 kB
build/wc-settings.js 2.91 kB

compressed-size-action

@nerrad
Copy link
Contributor

nerrad commented Aug 27, 2021

Adding this PR to the 5.8 milestone and with label blocker because I consider this regression to be important enough. I'm on the fence on whether this deserves a point release of WC Blocks 5.7 and WC core 5.7. Thoughts @nerrad @frontdevde?

The question for me is whether another ~1.5 months wait is too long for this UX regression (and potential additional confusion for end users). Might be good to bring it up with the WC 5.7 release team and get their thoughts as well.

@Aljullu Aljullu added block: all products Issues related to the all products block. block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. block-type: filter blocks Issues related to all of the filter blocks. labels Aug 27, 2021
Copy link
Contributor

@frontdevde frontdevde left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this so quickly! ❤️

I tested as per testing instructions and can confirm:

  • The blocks aren't available in the inserter in Appearance > Widgets
  • The blocks aren't available in the inserter in the Customizer
  • The blocks are available in the inserter on posts and pages

LGTM 👍

@Aljullu Aljullu modified the milestones: 5.8.0, 4.7.1 Aug 30, 2021
@Aljullu Aljullu merged commit 58f96d6 into trunk Aug 30, 2021
@Aljullu Aljullu deleted the fix/4138-hide-blocks-in-widgets-screen branch August 30, 2021 07:10
@Aljullu Aljullu added the release: cherry-pick Cherry picked into the relevant release branch. label Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: all products Issues related to the all products block. block: cart Issues related to the cart block. block: checkout Issues related to the checkout block. block-type: filter blocks Issues related to all of the filter blocks. focus: FSE Work related to prepare WooCommerce for FSE. release: cherry-pick Cherry picked into the relevant release branch. status: blocker Used on issues or pulls that block work from being released. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter products by price block not applying filter
3 participants