Videopress Block: Fix video width and lack of alignment classes#18006
Conversation
|
Caution: This PR has changes that must be merged to WordPress.com |
|
Scheduled Jetpack release: February 2, 2021. Thank you for the great PR description! When this PR is ready for review, please apply the |
|
I think we might not be able to use |
apeatling
left a comment
There was a problem hiding this comment.
We chatted about this, but I think you could check for the presence of useblockProps and fall back to manual if not present. Or go with manual until Jetpack catches up to this.
|
Stumbled across this PR, thanks for fixing @aaronrobertshaw 😄 |
260217c to
f130da7
Compare
|
This has been updated to check for I've tested this using the latest Gutenberg release and v9.1.1 just prior to when commit WordPress/gutenberg#25642 stabilised the block API involving |
jeherve
left a comment
There was a problem hiding this comment.
Since we're changing the saved markup of our blocks, we'll need to handle block deprecation to avoid block validation errors when editing existing posts. Could you add this?
f130da7 to
0f99a44
Compare
922a185 to
880866d
Compare
|
I've rebased this PR and updated it to address the issue where newer versions of Gutenberg caused all the deprecations to be invalid. Tested with WordPress 5.5.3 and 5.6 as well as latest Gutenberg. The issue with the If anyone has any suggestions as to a better approach, I'd be happy to hear them. |
|
This tests well for me now, and the migrations run correctly for the previous versions. |
* Fixes missing alignment CSS classes * Fixes deprecations after Gutenberg introduction of wp-block-video CSS class * Fixes bug introduced in prior patch addressing aspect ratio classes
Improves the clarity of the attribute naming to distinguish what was `classNames` from `className`.
00ee06d to
62a7598
Compare
This shouldn't be necessary anymore, we now have that rule set for all the extensions at once.
jeherve
left a comment
There was a problem hiding this comment.
This works well for me now; it should be good to merge!
|
r220372-wpcom |
Fixes Automattic/wp-calypso#46889
Fixes #17925
VideoPress block on WordPress.com doesn't get the alignment CSS classes applied to it on save. This leads to the video appearing to be different widths in editor vs frontend.
Changes proposed in this Pull Request:
classNamesattribute out of therender()function to avoidUnsavedChangesWarningerror.classNamessaved due to bug.Does this pull request change what data or activity we track or use?
No.
Unit test for attribute migrations
yarn test-extensionsextensions/blocks/videopress/test/index.jsran successfully.Testing instructions - Local:
wideand add a custom CSS class name via sidebar > advanced controlsalignwideCSS class)Testing instructions - Sandbox:
alignwideCSS class.alignfullCSS class.Screenshots
Proposed changelog entry for your changes: