Skip to content

Conversation

@aduth
Copy link
Member

@aduth aduth commented Sep 27, 2017

Related: #2740 (comment)

This pull request seeks to resolve an error which occurs when trashing a selected block. It also improves the behavior of attributes mapped to meta fields, which currently does not work.

Testing instructions:

No blocks make use of meta fields attribute mapping. Instead, ensure tests pass:

npm test

Verify that an error does not occur when removing a selected block:

  1. Navigate to Gutenberg > New Post
  2. Insert a new block
  3. Select the block
  4. Remove the block using the trash in secondary actions

@aduth aduth added the [Feature] Block API API that allows to express the block paradigm. label Sep 27, 2017
@aduth aduth requested a review from mcsf September 27, 2017 00:43
@aduth aduth force-pushed the fix/get-block-error branch from d43dcf1 to bf70177 Compare September 27, 2017 00:47
@codecov
Copy link

codecov bot commented Sep 27, 2017

Codecov Report

Merging #2805 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2805      +/-   ##
==========================================
+ Coverage   33.73%   33.81%   +0.07%     
==========================================
  Files         190      190              
  Lines        5676     5678       +2     
  Branches      991      992       +1     
==========================================
+ Hits         1915     1920       +5     
+ Misses       3183     3181       -2     
+ Partials      578      577       -1
Impacted Files Coverage Δ
editor/selectors.js 96.75% <100%> (+2.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23f8f05...bf70177. Read the comment docs.

@aduth aduth requested a review from youknowriad September 27, 2017 12:07
expect( getBlock( state, 123 ) ).toBe( null );
} );

it( 'should merge meta attributes for the block', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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.

This fixes the bug for me 👍

@aduth aduth merged commit feccae8 into master Sep 27, 2017
@aduth aduth deleted the fix/get-block-error branch September 27, 2017 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Block API API that allows to express the block paradigm.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants