Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/4998 - Make query-panel block available #4999

Closed
wants to merge 1 commit into from

Conversation

amdrew
Copy link
Contributor

@amdrew amdrew commented Feb 11, 2018

Fixes #4998

@amdrew amdrew changed the title Make query-panel block available Issue/4998 - Make query-panel block available Feb 11, 2018
@paulwilde
Copy link
Contributor

It would make sense to rename this component if it were to be exposed, as it doesn't do what I would expect from the name. It's more of an abstraction of logic for the Latest Posts block rather than a standalone component that is very reusable.

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Feb 15, 2018

It's more of an abstraction of logic for the Latest Posts block rather than a standalone component that is very reusable.

Hi @amdrew thank you for creating this PR. I think the component should be exposed, and it was a bug that it was not exposed before.

It's more of an abstraction of logic for the Latest Posts block rather than a standalone component that is very reusable.

Hi @paulwilde, the QueryPanel component was implemented with the intention of being generic in accordance to what was specified in issue #2662. The idea is for the component to be reusable and used outside latest posts.
It allows us to abstract a UI to select the category, number of items and order criteria, with the possibility to hide some of the inputs. The expectation was that querying posts will be a very recurrent pattern in blocks, e.g for custom post types. As a practical use case, using this component we can create a "book" query UI as part of some other block or plugin. The block creator besides this Component can include UI to input other filters. But I agree with you the name is misleading as the component does not query it's just a UI. Maybe we can rename it to something like QueryPanelUI or something similar, I'm totally open to suggestions.

@paulwilde
Copy link
Contributor

paulwilde commented Feb 15, 2018

@jorgefilipecosta Ah that makes more sense. I had a quick look at the file and saw that it was just a couple of controls abstracted into its own file from the Latest Posts block and assumed it was just to make the block file a little more trim. I have used this sort of thing before with widgets, having controls dedicated to selecting a post type, taxonomy & taxonomy term, etc.

I was thinking the name PostQueryControls might make more sense, however I see there is no control which includes the selection of a post type.

@gziolo gziolo added the [Feature] Extensibility The ability to extend blocks or the editing experience label Feb 16, 2018
@gziolo
Copy link
Member

gziolo commented Feb 16, 2018

I was thinking the name PostQueryControls might make more sense, however I see there is no control which includes the selection of a post type.

It probably might be just QueryControls as it abstracts other controls. @jorgefilipecosta shouldn't it be moved to wp.components before it gets exposed? I think we moved a few controls from blocks to components some time ago.

@gziolo
Copy link
Member

gziolo commented Mar 5, 2018

@jorgefilipecosta has the alternative solution that moves this component to wp.components. Let's close this one and help to merge #5319. Thanks for raising this issue and initial explorations 👍

@gziolo gziolo closed this Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants