-
Notifications
You must be signed in to change notification settings - Fork 799
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: Replace SubmitButton with new button block #15863
Calendly Block: Replace SubmitButton with new button block #15863
Conversation
This is an automated check which relies on E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-15863 |
This works well! @aaronrobertshaw Just one thing:
This is happening to me regardless. 🤔 I've took the liberty of assigning you to #15498, which is directly related to this PR. As it is right now, the button doesn't work in AMP. The idea proposed in #15498 was to replace the button with a link when in AMP. There is a gotcha though: to pass the Calendly link from the parent block to the child Button, and keep the value in sync, we need a small update to the Button block, based upon an old discussion. |
Thanks @Copons, appreciate all the suggestions and direction on this one. Especially the AMP side of things, I was a little at a loss on how to test that.
I agree regarding this block only needing to render as a link. I've updated it accordingly and also tweaked it to pass those attributes through to the button block. Happy to come back, rebase this and update to use the While making these updates I found I'd missed updating the button block's attributes when the embed URL from the sidebar calendar settings section was changed and contained embedded styles. These sound like another candidate to use the The buttons work ok for me now via AMP although if there are no custom colors used to provide inline styles, their appearance could be sketchy. The block's inline style, that embeds an iframe, obviously wasn't working either, so I've made that just fallback to a simple link. Do you think it's worth just making the block render a simple link for all AMP requests to avoid styling inconsistencies?
I might not have been clear on that one, sorry. The spinner was just appearing outside the bounds of the block's container for me. The fix was just adding a simple Can you confirm it's still an issue? |
As mentioned internally, I've noticed that for some reasons using the Button with
I see, and yes, the spinner is not in that awkward position anymore. I guess we could reposition it where it would always be covered by the widget. (In the screenshot I've also changed the z-index to make it appear above the widget) |
Thanks for highlighting the issue with the spinner, I hadn't tried the inline widget with fewer than 2 meeting durations. I've tidied that up.
I'm not sure I follow regarding the Calendly blocks not being selectable. In the editor, for me, clicking the blank space beside the button block selects the Calendly block itself. Alternatively, moving between the blocks with the arrow keys still lets me select the Calendly block. On the frontend, I found an inconsistency with which element the block ID was added to, between the deprecated and current versions of the link style blocks. I've fixed that up. Hopefully, that sorts out the issue. |
@aaronrobertshaw Apparently the broken selection only happens with the Guten plugin activated. Tested with 8.1 and 8.2 (freshly checked out this morning). |
@aaronrobertshaw I've finally run a |
@Copons Thanks for taking the time to look into that one. I understand the issue you were highlighting now, the new commit also has it working properly for me too. |
Just a heads up that I've merged #15931 (the |
The new shared button offers a few extra features and an oportunity to make multiple components more consistent. As such, the SubmitButton in the Calendly block is being replaced.
Caution: This PR has changes that must be merged to WordPress.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my tests, I seem to be losing the color of the existing buttons when I update to this branch.
Steps to reproduce
- On
master
, create a new Calendly block with a button style
2 Give a custom background color to your button, something that's not among the predefined options. - Publish your post.
- Switch to this branch.
- On the frontend of your site, the button color is back to the default.
<div class="wp-block-jetpack-calendly aligncenter calendly-style-link"><a id="calendly-block-2" class="wp-block-button__link has-background" href="https://href.li/?https://calendly.com/jeherve?hide_event_type_details=0&background_color=ffffff&text_color=4D5055&primary_color=00A2FF" role="button" rel="noreferrer">Click to book a time slot</a></div>
- In the editor, the color is visible.
<div aria-label="Block: Button" role="group" id="block-77202acd-6fb7-4965-b6be-04819eb3a9b8" class="block-editor-block-list__block wp-block" data-block="77202acd-6fb7-4965-b6be-04819eb3a9b8" data-type="jetpack/button" data-title="Button" tabindex="0" style="transform-origin: center center;"><div> <div class="wp-block-button wp-block-jetpack-button"><div role="textbox" aria-multiline="true" aria-label="Add text…" class="rich-text block-editor-rich-text__editable wp-block-button__link has-background" contenteditable="true" style="background-color: rgb(6, 172, 9); white-space: pre-wrap;">Click to book a time slot</div></div> </div></div>
- Opening that post in the editor triggers the migration and we get our color back:
<a class="wp-block-button__link has-background" style="background-color: #06ac09;" data-id-attr="calendly-block-2" id="calendly-block-2" href="https://href.li/?https://calendly.com/jeherve" target="_blank" role="button" rel="noopener noreferrer noreferrer">Click to book a time slot</a>
Is there any way to avoid that?
Other than that, everything seems to work well in my tests.
Please note the following as well: I tried to add a new Calendly block using customized embed code with custom page settings, like: The custom page settings were lost. |
Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>
After switch to using the block button and passing through the url attribute, the embed params for background, text and primary color were lost. The original approach to parsing embed code strips the url back to basics and only adds the query string params when generating markup. This change simply replaces the base url with the one containing query string params as this had the least impact on existing approach.
After the switch to the shared button block, the default color provided by the .wp-block wrapper element was lost this sets the same color.
The custom styles are now correctly applied to the deprecated button element and custom page settings for embed codes have been fixed. I also added a style to provide the default font color, that a wrapping |
Thanks for the fixes @aaronrobertshaw |
r210102-wpcom |
Fixes #15711, Fixes #14564
Changes proposed in this Pull Request:
Prerequisites:
link
style.Testing instructions:
Should still be using simple
<a>
markup.https://calendly.com/<username>
( inline style block will show as a simple link )
extensions/blocks/calendly/test/utils.js
Before:
After:
Proposed changelog entry for your changes: