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

[Enhancement] Introduce left and right float alignment options to latest posts block #8814

Merged
merged 1 commit into from
Feb 1, 2019
Merged

[Enhancement] Introduce left and right float alignment options to latest posts block #8814

merged 1 commit into from
Feb 1, 2019

Conversation

nfmohit
Copy link
Member

@nfmohit nfmohit commented Aug 10, 2018

Description

This PR closes #8777 which request the availability of left and right float alignment options in the Latest Posts block, making it consistent like the Archive, Latest Comments, and Categories blocks.

How has this been tested?

This PR has been tested by going through the following steps:

  1. Started a new post using the Gutenberg editor.
  2. Added the Latest Post block.
  3. Made sure the left and right alignment options are available and functional.

This was tested in WP 4.9.8, Gutenberg 3.5.0, Apache server with PHP 7.2.0 and MySQL 5.6.34. According to initial tests, the code doesn’t seem to affect any other areas.

Screenshots

pull-8777

Types of changes

This PR just omits the controls property in the block alignment toolbar of the Latest Posts block, which specified the center, wide, and full alignments, excluding the left and right ones.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@youknowriad youknowriad added the Needs Design Feedback Needs general design feedback. label Aug 10, 2018
@ZebulanStanphill
Copy link
Member

ZebulanStanphill commented Aug 10, 2018

Looks like the left and right float alignments are working in both editor and front-end to me! Notably, however, the center alignment option is still applied by default for some reason. That bug is tracked in #7911; if you could fix that in this PR, that would be great, but this is already an improvement over master.

@nfmohit
Copy link
Member Author

nfmohit commented Aug 10, 2018

Thank you @ZebulanStanphill ❤️ I've submitted #8847 for #7911.

@kjellr
Copy link
Contributor

kjellr commented Sep 3, 2018

@nfmohit-wpmudev, I'm unable to get this to run at this point — probably needs a rebase. From a design perspective, the mockup you have above (adding those two standard alignment buttons to the block toolbar) is the right thing to do, so I'm going to remove the Needs Design Feedback label. 👍

@kjellr kjellr removed the Needs Design Feedback Needs general design feedback. label Sep 3, 2018
@ZebulanStanphill
Copy link
Member

@nfmohit-wpmudev @kjellr I forgot about this PR and made my own PR adding all alignment options to all widget blocks. But anyway, in case that PR is rejected or something, here is what you need to do to get this PR working:

You need to modify getEditWrapperProps in packages/block-library/src/latest-posts/index.js like so:
https://github.com/WordPress/gutenberg/pull/9557/files#diff-2d2e077be50b91104f564d5e638f0869

@nfmohit
Copy link
Member Author

nfmohit commented Sep 4, 2018

Weird, I was able to build it just fine, it didn't have any conflicts or didn't require a rebase.

Screenshot:
1

2

@kjellr
Copy link
Contributor

kjellr commented Sep 7, 2018

I don't know why it wasn't running before, but it's alright now. I can verify that those buttons are showing up. Thanks @nfmohit-wpmudev! 👍

Since there's another PR open (#9557) that also adds those buttons, we should hold off on merging until we know the status of that one too.

@ZebulanStanphill
Copy link
Member

ZebulanStanphill commented Sep 7, 2018

@kjellr @nfmohit-wpmudev
As I stated before, you need to update getEditWrapperProps in index.js to make sure all the alignments work properly. It also looks like you need to update the tests.

I am splitting #9557 into several smaller PRs, starting with #9696. Feel free to merge this once you have fixed the issues mentioned above.

@nfmohit
Copy link
Member Author

nfmohit commented Sep 14, 2018

@ZebulanStanphill Thank you for the heads up bud ❤️

Don't you think including the center alignment within getEditWrapperProps should be addressed in a different issue and PR as we are not dealing with it here? I'm assuming it was left out initially intentionally.

@ZebulanStanphill
Copy link
Member

@nfmohit-wpmudev It seems like a typo to me, but I am fine if you leave it out of this PR and someone addresses it in another PR.

@gziolo gziolo added this to the 5.0 (Gutenberg) milestone Feb 1, 2019
@gziolo gziolo added the [Block] Latest Posts Affects the Latest Posts Block label Feb 1, 2019
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Good catch, changes look good 👍 Thanks for contribution.

@gziolo gziolo merged commit ba673eb into WordPress:master Feb 1, 2019
daniloercoli added a commit that referenced this pull request Feb 1, 2019
…rnmobile/372-use-RichText-on-Title-block

* 'master' of https://github.com/WordPress/gutenberg:
  Try alternate list item jump fix. (#12941)
  Mobile bottom sheet component (#13612)
  Remove unintentional right-margin on last odd-item. (#12199)
  Introduce left and right float alignment options to latest posts block (#8814)
  Fix Google Docs table paste (#13543)
  Increase bottom padding on gallery image caption (#13623)
  Fix the editor save keyboard shortcut not working in code editor view (#13159)
  Plugin: Deprecate gutenberg_add_admin_body_class (#13572)
  Rnmobile/upload media failed state (#13615)
  Make clickOnMoreMenuItem not dependent on aria labels (#13166)
  Add: className prop support to server side render. (#13568)
  Fix: Categories Block: hierarchical Dropdown (#13567)
  Docs: Add clarification about git workflow (#13534)
  Plugin: Remove `user_can_richedit` filtering (#13608)
  eslint-plugin: Add rule `no-unused-vars-before-return` (#12828)
  Image settings button (#13597)
  Fixed wording for the color picker saturation (#13479)

# Conflicts:
#	packages/block-library/src/image/edit.native.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Posts Affects the Latest Posts Block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest Posts block: Add float alignment options
5 participants