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

merge master back into fork #2

Merged
merged 18 commits into from
Apr 3, 2019
Merged

Conversation

fabiankaegy
Copy link
Owner

Description

How has this been tested?

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

fabiankaegy and others added 18 commits April 2, 2019 11:49
…at' (#14411)

* RichText: unify active formats, 'selectedFormat' and 'placeholderFormat'

* Add extra e2e test

* Only should boundary style when focused

* Update docs
* Add vertical alignment functionality to the media and text block

* Remove duplicate styles

* Add fixture for vertical alignment test

* Add entry to changelog
* added two modes for edit icon and double click as means to enter and exit the edit mode, also there is only one edit mode flow

* added the swap icon and the state toggle

* added a cancel link to the media placeholder

* added image thumbnail to mediaplaceholder in image block edit mode

* wrapped up noisysocks code style review points

* a few a11y fixes

* applies talldan's requested changes

* solves more code review issues

* Changelog updates for affected packages

* added classname back to MediaPlaceholder

* Fixed faulty state check

Co-Authored-By: draganescu <[email protected]>

* removes bogus new line

* corrects an if to make it more readable

* renames mediaPreview to media in the Placeholder component
* Improving accessibility on Mobile button component.

* Fix lint issues
* Docs: Clarify "CSS Naming" coding guidelines

* Docs: Arrange CSS Naming examples as inline
* Remove thick left border for the title in the code editor.

* Remove thick left border from the permalink field in the code editor.

* Move styles into the `edit-post` module.

* Remove no-longer-necessary style change.

* Remove unnecessary styles.
…cks, locking, and child blocks (#14003)

Supersedes: https://github.com/WordPress/gutenberg/pull/7301/files
Uses the select control implemented in #13924.
This PR changes the action creators to be a generator and have all the required validations before yielding the action.

Fixes: #14568;
Fixes: #10186;
Fixes: #13099;

Missing the update to the unit tests.

## How has this been tested?
Test block: [gist.github.com/jorgefilipecosta/b7194daac3ce26827522694fb4252c1c#file-testallowedblocksmiddleware-js](https://gist.github.com/jorgefilipecosta/b7194daac3ce26827522694fb4252c1c#file-testallowedblocksmiddleware-js)

I pasted the test block referred in the browser console.
I added the Product block.
I verified I cannot move using drag & drop the Buy button out of the Product block. (child block restriction.
I verified I cannot move using drag & drop a paragraph created outside of the Product block inside the product block. (allowed blocks restriction).
I verified that if I press enter in the buy button or image inside the product block, a paragraph is not created (allowed blocks restriction).
I added two galleries outside the product block, multi-selected them, and copied them ( ctrl + c ), I pasted them inside the list block inside the Product block and I verified they were not added (allowed blocks restriction).

I verified that when we have a template lock and we press enter on the title we now do not insert unallowed blocks.
Template lock code:

```
add_filter( 'allowed_block_types', function( $allowed_block_types, $post ) {
	if ( $post->post_type === 'post' ) {
	    return $allowed_block_types;
	}
	return [ 'core/image', 'core/button' ];
}, 10, 2 );
```
I verified that if we disable the paragraph, e.g., with a filter or inside the test block, pressing enter on the title or in placeholders does not add paragraph blocks. Pressing the sibling inserter also does not insert the paragraph (PR #7226).
Code to disable paragraph:

```
function myplugin_register_book_lock_post_type() {
    $args = array(
        'public' => true,
	  	'template_lock' => 'all',
        'label'  => 'Books Lock',
        'show_in_rest' => true,
        'template' => array(
            array( 'core/image', array(
            ) ),
            array( 'core/heading', array(
                'placeholder' => 'Add Author...',
            ) ),
            array( 'core/paragraph', array(
                'placeholder' => 'Add Description...',
            ) ),
        ),
    );
    register_post_type( 'book_lock', $args );
}
add_action( 'init', 'myplugin_register_book_lock_post_type' );
```
I added two image blocks, multi-selected them, copied them and tried to paste them on the list inside the test block. I checked the image blocks were not added inside the test block.

All these actions are possible in master.

Todo: If we accept this approach, end 2 end tests will be created before the merge that replicate this manual tests.
* Expose required methods for better unsupported blocks

* Show unsupported block title/icon when possible

* Remove native variant of editor package

* Refactor mobile blocks to fix circle dependencies

* Fix styles for unsupported block

* Remove UnsupportedBlock in favor of core/missing
@fabiankaegy fabiankaegy merged commit 6836c78 into fabiankaegy:master Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.