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

Convert list block to component with bound controls #1059

Merged
merged 1 commit into from
Jun 7, 2017

Conversation

aduth
Copy link
Member

@aduth aduth commented Jun 7, 2017

Fixes #919
Related: #830

This pull request seeks to update the list block to track internal list type as component state, and the TinyMCE editor instance as an instance property on the class. Previously they were assigned into attributes which would both be serialized, but also caused Redux DevTools to crash the page. It takes advantage of controls rendering introduced in #830 to reference these component instance values in control click handlers.

Testing instructions:

There should be no regression in list behavior.

Confirm you are able to use Redux DevTools extension.

@aduth aduth added the [Feature] Blocks Overall functionality of blocks label Jun 7, 2017
@aduth
Copy link
Member Author

aduth commented Jun 7, 2017

Incidentally this appears to resolve #916

controls={ [
{
icon: 'editor-ul',
title: wp.i18n.__( 'Convert to unordered' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

aside: should we import those import { __ } from 'i18n';

const { nodeName = 'OL', values = [] } = attributes;

return [
<BlockControls
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you missed the focus check here ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you missed the focus check here ;)

How embarrassing considering I'd just remarked on how I'd been okay with it in the previous pull request 😄

@aduth aduth force-pushed the fix/919-list-tinymce-attribute branch from 462310a to ab8523b Compare June 7, 2017 15:41
@aduth
Copy link
Member Author

aduth commented Jun 7, 2017

Rebased to resolve conflicts and in doing so addressed the two points of feedback.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@aduth aduth merged commit f7d2b3e into master Jun 7, 2017
@aduth aduth deleted the fix/919-list-tinymce-attribute branch June 7, 2017 15:47
@aduth aduth mentioned this pull request Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants