-
Notifications
You must be signed in to change notification settings - Fork 800
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
Eventbrite block #14075
Eventbrite block #14075
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: February 11, 2020. |
creativecoder, Your synced wpcom patch D35679-code has been updated. |
2 similar comments
creativecoder, Your synced wpcom patch D35679-code has been updated. |
creativecoder, Your synced wpcom patch D35679-code has been updated. |
@pento I'm haven't yet successfully generated the embed output from the
(I suppose we could always fall back to a PHP rendered, if necessary) |
creativecoder, Your synced wpcom patch D35679-code has been updated. |
We need to render this block in PHP, as the Using a combination of |
Of course 🤦♂ ! |
creativecoder, Your synced wpcom patch D35679-code has been updated. |
4 similar comments
creativecoder, Your synced wpcom patch D35679-code has been updated. |
creativecoder, Your synced wpcom patch D35679-code has been updated. |
creativecoder, Your synced wpcom patch D35679-code has been updated. |
creativecoder, Your synced wpcom patch D35679-code has been updated. |
I've been playing around with WordPress/gutenberg#19113 today, which would expose Gutenberg's embed block scaffolding, which we could then make use of here. Of course, Jetpack has back compat requirements, so we can't just start using it, but as this is a new package, I was thinking it would be worth investigating whether we could ship it with Jetpack, and load it on older WordPress versions, where |
@pento Given the number of embeds we're working on, that seems like a great idea. I tried all manner of I ended up symlinking I started with importing the |
I've updated the PR to use Note that, at the moment, this PR requires the Gutenberg plugin to be installed and activated: loading For running a Docker environment with Jetpack and Gutenberg, I use the Jetpack environment, with a custom version: '3.3'
services:
wordpress:
volumes:
- /Users/pento/Projects/gutenberg:/var/www/html/wp-content/plugins/gutenberg I start the environment with this command in the Jetpack directory:
|
* @param WP_REST_Request $request Request used to generate the response. | ||
* @return WP_HTTP_Response|object|WP_Error The REST Request response. | ||
*/ | ||
function jetpack_filter_oembed_result( $response, $handler, $request ) { |
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.
This is copied from the Gutenberg plugin, because embeds fail when the plugin isn't enabled, as Core currently only allows proper oEmbeds to use this REST API endpoint.
I've left it in for now, (even though the PR doesn't run without the plugin), so I don't forget and wonder why everything doesn't work sometime later. 🙃
@pento Thanks for the instructions--this worked for me without issue. (I wasn't thinking about the Here's a quick screen capture of how this works, for posterity. |
@davemart-in See above. Moving to the embed block style means we're using the event URL rather than an embed code snippet--my hunch is that this will be easier for users, but wanted to flag for you since it's different than the original design mockup. Options, like to use the checkout embed as a modal or inline, will be in the sidebar. |
@pento I've updated with a Pinterest copy/paste 😄 Still to do
|
Thanks for the start, @creativecoder! Here's what I got done today:
Some issues I didn't get to address during my day:
|
I think I've addressed all the things! ✨ |
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.
I think 25e0fb9 may have broken things a bit. I can't seem to get a matching event ID from links like:
https://www.eventbrite.com/e/dex-songwriting-expo-tickets-71249967571?aff=ebdshpfprimarybucket
Does it work for you?
The redirect returns the expected response:
{"url":"https:\/\/www.eventbrite.com\/e\/dex-songwriting-expo-tickets-71249967571","status":200}
But no event ID gets set as a block attribute after that.
Oooh awesome catch @jeherve! The My update instead used the regex as soon as the URL was inserted in the input field, which is before In 338da38 I've added |
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.
I have a few last comments, but I don't think any of those are blockers for a first release. Let's try to address those in follow-up PRs?
import './editor.scss'; | ||
|
||
const MODAL_BUTTON_STYLES = [ | ||
{ name: 'fill', label: __( 'Fill' ), isDefault: true }, |
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.
You'll probably want to make those strings translatable. That's not a blocker though, can be done later.
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.
Tracked by #14458
</form> | ||
|
||
<div className="components-placeholder__learn-more"> | ||
<ExternalLink href="http://en.support.wordpress.com/wordpress-editor/blocks/eventbrite-block/"> |
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.
We'll need a conditional here so we can have 2 support links, e.g.
const supportLink = |
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.
Tracked by #14459
}, | ||
edit, | ||
save, | ||
transforms: { |
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.
This is not working for me for some reason:
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.
Tracked by #14460
); | ||
} | ||
|
||
export default function save( { attributes } ) { |
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.
I think it would be nice to return a link to the event inside the div / button. Right now, the empty container won't be of much help in subscription emails or if Jetpack gets deactivated.
<div class="wp-block-jetpack-eventbrite"><button id="eventbrite-widget-88665223069" class="wp-block-button__link" type="button">Test one two</button></div>
<div id="eventbrite-widget-88665223069" class="wp-block-jetpack-eventbrite"></div>
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.
Tracked by #14462
Ran into another issue when testing: |
r202093-wpcom |
* [not verified] Remove empty readme section * Initial changelog for 8.2 * Changelog: add #14220 * Changelog: add #14252 * Changelog: add #14291 * Changelog: add #14309 * Changelog: add #14304 * Changelog: add general connection log. * Changelog: add #14275 * Changelog: add #14313 * Changelog: add #14213 * Changelog: add #14357 * Add sync testing instructions * Add 8.1.1 changelog back See eeaafab and 61757eb * Changelog: add #14371 * Changelog: add #14386 * Changelog: add #14471 * Changelog: add #14325 * Changelog: add #14194 * Changelog: add #14340 * Changelog: add #14418 * Changelog: add #14417 * Changelog: add #14075 * Changelog: add #14467 * Changelog: add #14307 * Changelog: add #14326
Changes proposed in this Pull Request:
jetpack/eventbrite
blockIs this a new feature or does it add/remove features to an existing part of Jetpack?
The goal is to release it as a beta block first, in Jetpack 8.2.
Testing instructions:
Inserting the block
define( 'JETPACK_BETA_BLOCKS', true );
Transforms
Invalid URLs
Proposed changelog entry for your changes: