Skip to content

Introduce Event Query Block Variation#962

Merged
mauteri merged 67 commits intoGatherPress:developfrom
carstingaxion:feature/blockvariation-event-query
Aug 2, 2025
Merged

Introduce Event Query Block Variation#962
mauteri merged 67 commits intoGatherPress:developfrom
carstingaxion:feature/blockvariation-event-query

Conversation

@carstingaxion
Copy link
Copy Markdown
Collaborator

@carstingaxion carstingaxion commented Nov 19, 2024

This PR introduces a block-variation of the core/query block, called Event Query. This block allows for everything a normal query block can do including the following:

  1. Allows endless customisation in terms of layout & style, incl. the use of interactive blocks.
  2. Allows users to select from explicit compositions of block-patterns directly via the blocks Choose (layout) button and the Replace button in the top toolbar. (Planned in Add 'Start blank' patterns for the gatherpress query loop variation. #1124)
  3. Allows users to choose starter-content via the blocks Start blank button and the underlying Block Variation Picker. (Planned in Add 'Start blank' patterns for the gatherpress query loop variation. #1124)
  4. Allows to query either past or upcoming events.
  5. Allows to select for the inclusion or exclusion of started, but not yet finished, events.
  6. If used within a gatherpress_event post, the editor can choose to "Exclude current Event"
  7. Allows for custom ordering (ORDER BY) of the events by:
    • datetime (default)
    • random
    • title
    • post_id
    • last modified date
  8. ... in either ASC or DESC ORDER
  9. The variation is automatically loaded, when an editor chooses the „Event“ post type in a regular core/query block.

image

Description of the Change

Closes #414, closes #599

How to test the Change

Changelog Entry

Added - New Event Query Block based on the core query block

Credits

Props @carstingaxion

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added updated tests to cover my change.
  • All new and existing tests pass.

@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Nov 19, 2024

PR Summary

  • Introduction of Event Query Class: A new Event_Query class has been incorporated. It caters to the Event Query block functionality, allowing the system to manage events more systematically. This class encompasses methods for pre-rendering blocks, querying events, and filtering collection parameters, fostering overall control over event execution and management.

  • Creation of New React Components for Event Queries: New React components have been developed specifically for the event query interface. These controls provide users with control over various aspects of event management like setting the event count, excluding or including certain events, managing the event offset, and selecting the order of the events.

  • File controls.js Addition: A new file termed controls.js has been created, which observes post type changes and dynamically adjusts attributes for event queries.

  • File index.js Creation: This new file registers the "Event Query" block variation. It sets out the structure regarding attributes and inner block, enhancing the versatility of event queries.

  • Page Navigation through pagination.js: This new feature focuses on previous and next events, giving a more event-oriented feel to it rather than a generalized post.

  • Addition of 'Gpql-controls' Files: Two new files have been added that house components for custom controls specific to inherited queries and general controls.

  • Creation of Template Structures through templates.js: To handle situations where no results are found, specific templates have been designed. These specialized templates are tailored for event-related queries.

@carstingaxion
Copy link
Copy Markdown
Collaborator Author

I'm sorry, this took so long, is not well described and was not a very „friendly“ PR for anyone to contribute to.

I’m willing to finish this, if it’s not already obsolete because you did something better in the last couple of months.

Let me know if you (as the GatherPress community) are still interested in this piece of code?

@carstingaxion carstingaxion changed the title Introduce files from https://github.com/carstingaxion/additional-adva… Introduce Event Query Block Variation Jul 7, 2025
@carstingaxion carstingaxion marked this pull request as ready for review July 7, 2025 22:02
@carstingaxion

This comment was marked as outdated.

@carstingaxion

This comment was marked as outdated.

@carstingaxion
Copy link
Copy Markdown
Collaborator Author

carstingaxion commented Jul 9, 2025

Bildschirmaufzeichnung.vom.09.07.2025.14.01.05.mp4

When I try to update the unit tests, I constantly run into merge conflicts, thats why I left them failing. Maybe I could update them in a future PR.

Ignoring the fact, that none of the existing GatherPress blocks do work with the Event Query block, it's finished.

What will or have to happen now @mauteri, @MervinHernandez and @patriciabt ?

@carstingaxion carstingaxion requested a review from mauteri July 22, 2025 13:37
@carstingaxion
Copy link
Copy Markdown
Collaborator Author

Sometimes I can understand your confusion about the GitHub UI @mauteri

Like currently where it says:

Changes reviewed
1 change requested by reviewers with write access.

and shows that there are no open conversations.

Bildschirmfoto vom 2025-07-31 17-50-45

How do I get this PR into the final stage and where is this 1 change requested by reviewers with write access?

@github-actions
Copy link
Copy Markdown
Contributor

Preview changes with Playground

You can preview the recent changes for PR#962 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Aug 1, 2025

@carstingaxion I'll look to do final review and get this merged within next few days.

@mauteri mauteri merged commit f04e01d into GatherPress:develop Aug 2, 2025
18 checks passed
@carstingaxion
Copy link
Copy Markdown
Collaborator Author

I can't believe it is merged. Finally and even without additional change-requests. Thanks @mauteri .

@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Aug 2, 2025

@carstingaxion you're acting like I didn't already leave you a couple rounds of feedback 😂 Nice job on this!

@carstingaxion
Copy link
Copy Markdown
Collaborator Author

@carstingaxion you're acting like I didn't already leave you a couple rounds of feedback 😂 Nice job on this!

I'm sorry @mauteri, I meant this in reply to your last comment, where you said 'it'll take some days to prepare a final review'. I was absolutely sure, that there will be some things to change. That's why I -totally surprised- said, there were no changes requested.

Thank you very much for all the many feedback you gave @mauteri, it helped me and the result a lot!

@mauteri
Copy link
Copy Markdown
Contributor

mauteri commented Aug 3, 2025

@carstingaxion you're acting like I didn't already leave you a couple rounds of feedback 😂 Nice job on this!

I'm sorry @mauteri, I meant this in reply to your last comment, where you said 'it'll take some days to prepare a final review'. I was absolutely sure, that there will be some things to change. That's why I -totally surprised- said, there were no changes requested.

Thank you very much for all the many feedback you gave @mauteri, it helped me and the result a lot!

Haha, no problem. I found some time so I seized it to review your PR :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert Event-List block into query block-variation Add alignment settings to Events List block

3 participants