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

Remove usage of select editor from the block editor module #16184

Conversation

@jorgefilipecosta
Copy link
Member

commented Jun 14, 2019

Description

The block editor performed a select to the core/editor store, this causes problems when the editor store is not available e.g. in the widget screen after we merge #16160.

This PR refactors to code to use a block editor setting instead of the editor store.

How has this been tested?

With an admin rule, I pasted the following in a paragraph: <iframe src="httt://www.wordpress.org/" />. I verified an HTML block with the iframe was created.
With a contributor rule I pasted the same code I verified an HTML block with the iframe was not created.

@@ -102,6 +109,7 @@ class EditorProvider extends Component {
__experimentalReusableBlocks: reusableBlocks,
__experimentalMediaUpload: hasUploadPermissions ? mediaUpload : undefined,
__experimentalFetchLinkSuggestions: fetchLinkSuggestions,
__experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML,

This comment has been minimized.

Copy link
@youknowriad

youknowriad Jun 14, 2019

Contributor

Any reason you think this shhould be experimental?
Also these settings are documented in the defaults.js file of the block-editor package in addition to providing the default value.

This comment has been minimized.

Copy link
@jorgefilipecosta

jorgefilipecosta Jun 14, 2019

Author Member

Hi @youknowriad the default.js file was updated, nice catch.
The setting was only marked as experimental because lately all new additions were kept experimental for one version so I followed the same logic, but I can change it.

@jorgefilipecosta jorgefilipecosta force-pushed the refactor/remove-usage-of-select-block-editor-from-the-block-editor-module branch from 8c41ea2 to 5223795 Jun 14, 2019

@jorgefilipecosta jorgefilipecosta requested a review from gziolo as a code owner Jun 14, 2019

@jorgefilipecosta jorgefilipecosta added this to Generic Block Editor Issues in Widgets Jul 9, 2019

@jorgefilipecosta jorgefilipecosta force-pushed the refactor/remove-usage-of-select-block-editor-from-the-block-editor-module branch from 5223795 to 16c677a Jul 9, 2019

@jorgefilipecosta jorgefilipecosta requested a review from etoledom as a code owner Jul 9, 2019

@ellatrix
Copy link
Member

left a comment

Nice! Tested iframe pasting and it still works. :)

@jorgefilipecosta jorgefilipecosta merged commit 5756b29 into master Jul 10, 2019

1 of 3 checks passed

Filter merged Filter merged
Details
Filter merged Filter merged
Details
Travis CI - Pull Request Build Passed
Details

@jorgefilipecosta jorgefilipecosta deleted the refactor/remove-usage-of-select-block-editor-from-the-block-editor-module branch Jul 10, 2019

@aduth aduth referenced this pull request Jul 10, 2019
0 of 1 task complete

jg314 added a commit to jg314/gutenberg that referenced this pull request Jul 19, 2019

@youknowriad youknowriad added this to the Gutenberg 6.2 milestone Jul 26, 2019

sbardian added a commit to sbardian/gutenberg that referenced this pull request Jul 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.