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

Filter patterns preview showing Filter by Attribute in Edit view. #7190

Closed
tjcafferkey opened this issue Sep 21, 2022 · 4 comments · Fixed by #9812
Closed

Filter patterns preview showing Filter by Attribute in Edit view. #7190

tjcafferkey opened this issue Sep 21, 2022 · 4 comments · Fixed by #9812
Labels
block-type: filter blocks Issues related to all of the filter blocks. status: stale Stale issues and PRs have had no updates for 60 days. type: bug The issue/PR concerns a confirmed bug. type: cooldown Things that are queued for a cooldown period (assists with planning).

Comments

@tjcafferkey
Copy link
Contributor

Describe the bug

When you search the Block Inserter > Patterns library for WooCommerce patterns, when you come to the WooCommerce Product Filters pattern you are able to see in the preview that the Filter by Attribute block is rendered in Edit mode. Because of this the preview does not look appealing.

To reproduce

Steps to reproduce the behavior:

  1. Go to Appearance > Editor > All Templates > Product Catalogue
  2. Open the Block Inserter, then select Patterns tab
  3. On the dropdown click WooCommerce to view WC available patterns.
  4. See the pattern rendering the Filter by Attribute block in Edit mode.

Expected behavior

The Filter by Attribute block should render an example preview.

Screenshots

Screenshot 2022-09-21 at 12 35 40

@tjcafferkey tjcafferkey added type: bug The issue/PR concerns a confirmed bug. type: cooldown Things that are queued for a cooldown period (assists with planning). block-type: filter blocks Issues related to all of the filter blocks. labels Sep 21, 2022
@tjcafferkey
Copy link
Contributor Author

I am wondering if we are able to detect within the block itself if it is being rendered in a "Preview" pane and if so, render it with some dummy data in this context.

@Aljullu
Copy link
Contributor

Aljullu commented Sep 21, 2022

I am wondering if we are able to detect within the block itself if it is being rendered in a "Preview" pane and if so, render it with some dummy data in this context.

block.json has an example attribute which might be helpful. We are using it in some blocks, ie: All Products.

@tjcafferkey
Copy link
Contributor Author

@Aljullu This looks useful thank you! Only problem is that we would need to know the attribute_id we are using as an example actually exists somehow.

@github-actions
Copy link
Contributor

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

@github-actions github-actions bot added the status: stale Stale issues and PRs have had no updates for 60 days. label Nov 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block-type: filter blocks Issues related to all of the filter blocks. status: stale Stale issues and PRs have had no updates for 60 days. type: bug The issue/PR concerns a confirmed bug. type: cooldown Things that are queued for a cooldown period (assists with planning).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants