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

Change the selector to target blocks that have a warning class #14732

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

scruffian
Copy link
Member

@scruffian scruffian commented Feb 19, 2020

Dependent on #14730

Changes proposed in this Pull Request:

  • This updates the CSS selectors used by the with-has-warning-is-interactive-class-names component, so that they still target the block in edit mode.

Is this a new feature or does it add/remove features to an existing part of Jetpack?

  • Bug fix

Testing instructions:

  • Apply this patch D39099-code on your sandbox
  • Add a Calendly block on a free site
  • Check that you can interact with the block, and add a URL
  • Deselect the block
  • Check that you can reselect 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 Feb 19, 2020
@scruffian scruffian requested review from a team February 19, 2020 17:53
@scruffian scruffian self-assigned this Feb 19, 2020
@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 D39099-code before merging this PR. Thank you!

@jetpackbot
Copy link

jetpackbot commented Feb 19, 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: March 3, 2020.
Scheduled code freeze: February 25, 2020

Generated by 🚫 dangerJS against 9606e68

@Copons
Copy link
Contributor

Copons commented Feb 19, 2020

The change here works as advertised, but when I try to insert a link the block breaks with this error:

This block has encountered an error and cannot be previewed.

Screenshot 2020-02-19 at 18 18 59

@scruffian
Copy link
Member Author

@Copons thanks for the review. I think that bug is being caused by #14730

@Copons
Copy link
Contributor

Copons commented Feb 19, 2020

@Copons thanks for the review. I think that bug is being caused by #14730

I haven't had the chance to look at that yet, but in this case I'd probably note here that this PR is dependent on that other one.
Otherwise, when the pointer event will let users be able to trigger the embed, they will end up with broken blocks.

@scruffian scruffian added [Status] In Progress and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Feb 19, 2020
pablinos added a commit that referenced this pull request Feb 19, 2020
As the HOC was used as part of a filter, the className was getting set
by the last filter that was run. This was a lucky accident for OpenTable
as it meant that it wasn't affected by the bug being fixed in #14732

This change passes through the className prop when the block names don't
match, which means that if it's been set by a previous filter, it is
preserved.
@pablinos
Copy link
Contributor

@Copons thanks for the review. I think that bug is being caused by #14730

It's being fixed by #14730!

This does fix the problem and I think it was caused by the wrapper div that was removed in WordPress/gutenberg#19593

I've discovered the reason OpenTable wasn't affected by this, and fixed it in #14738, but this should be merged first

@scruffian scruffian added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] In Progress labels Feb 20, 2020
@jeherve jeherve added this to the 8.3 milestone Feb 20, 2020
@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 Feb 20, 2020
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.

Do you think you could rebase this PR so we can test it with the fix that has now been merged?

Thank you!

@scruffian scruffian force-pushed the fix/is-interactive-class branch from 1bc4bc7 to 9606e68 Compare February 20, 2020 19:02
@scruffian
Copy link
Member Author

Rebased ✅

@matticbot
Copy link
Contributor

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

@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 Feb 20, 2020
Copy link
Contributor

@Copons Copons left a comment

Choose a reason for hiding this comment

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

Works for me! ✨

Unrelated to this PR, I've noticed that, when unavailable, the block outputs just a link.
Anchors being inline elements, they might not respect some theme styles setting the blocks' width and margins.

I've incidentally tried this diff on a site using the Maywood theme and it looks like this:

Screenshot 2020-02-21 at 12 14 16

The green box is the intended post content width (set with max-width and margin: auto), while the red box with the Calendly link is the screen's 100% width.

I think we should do something like this 🤔

{
  save: () => (<div><a href={ url }>{ url }</a></div> ),
}

Copy link
Member

@apeatling apeatling left a comment

Choose a reason for hiding this comment

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

Works for me. I was able to add a calendly URL and see the correct embed. I deselected the block and reselected and was able to change all settings and interact with the block.

@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 Feb 21, 2020
jeherve pushed a commit that referenced this pull request Feb 24, 2020
As the HOC was used as part of a filter, the className was getting set
by the last filter that was run. This was a lucky accident for OpenTable
as it meant that it wasn't affected by the bug being fixed in #14732

This change passes through the className prop when the block names don't
match, which means that if it's been set by a previous filter, it is
preserved.
@jeherve jeherve merged commit 3b98fd0 into master Feb 24, 2020
@jeherve jeherve deleted the fix/is-interactive-class branch February 24, 2020 07:12
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Feb 24, 2020
@scruffian
Copy link
Member Author

r203259-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.

7 participants