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

Block Library: Add the Comments Pagination block #36577

Closed

Conversation

DAreRodz
Copy link
Contributor

Description

This block works as a container for other pagination blocks that render links to navigate through the list of comments. It basically works the same as the Query Pagination block, but for comments.

It has the same settings:

  • changing layout and colors
  • choosing different styles for next/prev arrows.

Will close #35007

How has this been tested?

  1. Modify the Single Post template, adding a Comments Query Loop block
  2. Add inside the Comments Pagination block
  3. Check that the layout and color settings work (tested only in the editor)
  4. Check that the arrow setting works as expected (tested only in the editor)

Types of changes

  • New feature

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

Comment on lines +21 to +23
[ 'core/query-pagination-previous' ],
[ 'core/query-pagination-numbers' ],
[ 'core/query-pagination-next' ],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These blocks are meant to be changed once the rest of the comments-pagination blocks are created.

Comment on lines +59 to +61
'core/query-pagination-previous',
'core/query-pagination-numbers',
'core/query-pagination-next',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Again, these blocks should be replaced with the comments-pagination ones.

Copy link
Contributor

@cbravobernal cbravobernal left a comment

Choose a reason for hiding this comment

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

Nice job! It seems that we have to include the schema in order to pass the tests.
Also, do we have to create the fixtures? In order to do that, we have to create the core__comments-pagination-block.html with the content that is created on the code editor. Then paste it and then run npm fixtures:generate

@DAreRodz
Copy link
Contributor Author

Thanks for the review @c4rl0sbr4v0 🙇 You're right, I forgot to add the fixture for the new block. Fixed now. 👍

@cbravobernal
Copy link
Contributor

Next question I have is. Should we merge it before having the other ones (core/comment-pagination-*? How would we approach this?

Leaving as is right now, it does not crash, right?

@gziolo
Copy link
Member

gziolo commented Nov 18, 2021

Next question I have is. Should we merge it before having the other ones (core/comment-pagination-*? How would we approach this?

Yes, we can also land this PR without inner blocks and address that in follow-up PRs. If we take that route we should rather hide this block from the inserter temporarily.

@gziolo gziolo added [Block] Comments Affects the Comments Block - formerly known as Comments Query Loop New Block Suggestion for a new block labels Nov 18, 2021
@aristath
Copy link
Member

The PR needs to be rebased as there are now conflicts with trunk 👍

@cbravobernal
Copy link
Contributor

Yes, we can also land this PR without inner blocks and address that in follow-up PRs. If we take that route we should rather hide this block from the inserter temporarily.
The PR needs to be rebased as there are now conflicts with trunk 👍

I updated the code with the requests and created a new PR, cherry-picking @DAreRodz commits. It is easier for me than making the updates on their repo. And also I included in this PR a Merge commit without wanting to.

#36872 closes this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Comments Affects the Comments Block - formerly known as Comments Query Loop New Block Suggestion for a new block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post Comments Pagination block
4 participants