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

Calendly Block: Add alignment options #14403

Merged
merged 2 commits into from
Jan 22, 2020
Merged

Calendly Block: Add alignment options #14403

merged 2 commits into from
Jan 22, 2020

Conversation

scruffian
Copy link
Member

@scruffian scruffian commented Jan 20, 2020

Fixes #14367

Changes proposed in this Pull Request:

  • Adds alignment options

Testing instructions:

  • Add a calendly block and set the style to "link".
  • Try each of the alignment options
  • Check that they behave as expected in the editor and the front end:

Screenshot 2020-01-21 at 15 30 58

Screenshot 2020-01-21 at 15 30 54

  • Do the same for the inline version of the block.

Proposed changelog entry for your changes:

  • no changelog

@scruffian scruffian added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack [Block] Calendly labels Jan 20, 2020
@scruffian scruffian requested a review from a team January 20, 2020 21:20
@scruffian scruffian self-assigned this Jan 20, 2020
@jetpackbot
Copy link

jetpackbot commented Jan 20, 2020

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Scheduled Jetpack release: January 23, 2020.
Scheduled code freeze: January 16, 2020

Generated by 🚫 dangerJS against 150d632

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

I wonder if we could simplify this and only do this:
https://github.com/Automattic/jetpack/blob/fix/14367/extensions/blocks/calendly/index.js#L31

We would then let all the styling to the themes, since Jetpack_Gutenberg::block_classes handles adding the necessary classes to the container around the block when you pick an alignment:

$classes = Jetpack_Gutenberg::block_classes( 'calendly', $attr );

@@ -11,6 +11,9 @@ const colourValidator = value => hexRegex.test( value );
const urlValidator = url => ! url || url.startsWith( 'https://calendly.com/' );

export default {
align: {
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if we need this, since we don't set a default value.

Copy link
Member Author

Choose a reason for hiding this comment

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

We do, without it, the alignment attribute doesn't work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I checked this again, and you're right we don't need it. I've removed it.

@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jan 21, 2020
@scruffian
Copy link
Member Author

I'm happy to not add the additonal CSS but I'm not sure if that's very useful. I'd be curious to get feedback from someone on core.

@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello scruffian! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D37949-code before merging this PR. Thank you!

@scruffian
Copy link
Member Author

I removed the wide alignment options

@scruffian scruffian added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jan 21, 2020
@matticbot
Copy link
Contributor

scruffian, Your synced wpcom patch D37949-code has been updated.

@jeherve jeherve added this to the 8.2 milestone Jan 22, 2020
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jan 22, 2020
@scruffian scruffian merged commit aa21400 into master Jan 22, 2020
@scruffian scruffian deleted the fix/14367 branch January 22, 2020 15:41
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Jan 22, 2020
@scruffian
Copy link
Member Author

r201955-wpcom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Calendly [Focus] Blocks Issues related to the block editor, aka Gutenberg, and its extensions developed in Jetpack Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendly Block: add alignment support
4 participants