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

Carousel: Only query posts with thumbnails #440

Merged
merged 5 commits into from
Apr 29, 2020

Conversation

obenland
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Not sure how smart it is to unilaterally open the posts endpoint up to meta queries. I suppose we could pass a custom parameter and "hard-code" the post thumbnail meta query based on that?

Regardless, with this change the carousel in the Editor will now contain the same posts as it does in the front-end. Currently it just displays X number of most recent posts and hopes they have featured images assigned to them.

How to test the changes in this Pull Request:

  1. Add the Carousel block in the editor and play with the post count attribute.
  2. Make sure the carousel contains as many posts with thumbnails as you selected in the attribute
  3. Double-check that posts on the Editor side are the same as in the front-end

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@obenland obenland requested a review from a team April 24, 2020 21:59
@obenland obenland self-assigned this Apr 24, 2020
Copy link
Contributor

@jeffersonrabb jeffersonrabb left a comment

Choose a reason for hiding this comment

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

In my testing I'm getting identical results on this branch and master. Am I testing correctly?

@obenland
Copy link
Member Author

@jeffersonrabb I updated the callback to be more specific about the parameters it expects and acts on. It should now only return posts with associated featured images.

@frontdevde
Copy link
Contributor

I did a functional review and can confirm that there's now the expected difference in behavior between master and this branch:

master

Editor Frontend
Screenshot 2020-04-29 at 10 21 55 Screenshot 2020-04-29 at 10 22 00

this branch

Editor Frontend
Screenshot 2020-04-29 at 10 21 25 Screenshot 2020-04-29 at 10 21 31

Steps I took to reproduce the issue on master:

  • created four posts with featured images
  • removed the featured image on the fourth post
  • created a fifth post without a featured image
  • test with number of items set to 2 and 3

In the above example, there are three posts that could be shown. On master, in the editor they don't. On this branch, they do.

Copy link
Contributor

@jeffersonrabb jeffersonrabb left a comment

Choose a reason for hiding this comment

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

🚢

@frontdevde frontdevde merged commit 03354d0 into master Apr 29, 2020
@frontdevde frontdevde deleted the update/thumbnail-requests branch April 29, 2020 11:29
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.3.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants