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

Reusable Blocks: Add reusable blocks effects #3377

Merged
merged 5 commits into from Nov 21, 2017

Conversation

Projects
None yet
4 participants
@noisysocks
Member

noisysocks commented Nov 7, 2017

Adds the effects necessary for supporting reusable blocks. There are 4:

  • FETCH_REUSABLE_BLOCKS: Loads reusable blocks from the API and inserts
    them into the store.
  • SAVE_REUSABLE_BLOCK: Persists a reusable block that's in the store to
    the API.
  • MAKE_BLOCK_STATIC: Transforms a reusable block on the page into a
    regular block.
  • MAKE_BLOCK_REUSABLE: Transforms a regular block on the page into a
    reusable block.
Show outdated Hide outdated lib/client-assets.php Outdated
Show outdated Hide outdated lib/client-assets.php Outdated
Show outdated Hide outdated lib/client-assets.php Outdated
Add reusable blocks effects
Adds the effects necessary for supporting reusable blocks. There are 4:

- FETCH_REUSABLE_BLOCKS: Loads reusable blocks from the API and inserts
  them into the store.
- SAVE_REUSABLE_BLOCK: Persists a reusable block that's in the store to
  the API.
- MAKE_BLOCK_STATIC: Transforms a reusable block on the page into a
  regular block.
- MAKE_BLOCK_REUSABLE: Transforms a regular block on the page into a
  reusable block.
@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Nov 20, 2017

Codecov Report

Merging #3377 into master will increase coverage by 2.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3377      +/-   ##
==========================================
+ Coverage    34.9%   36.92%   +2.01%     
==========================================
  Files         263      267       +4     
  Lines        6727     6663      -64     
  Branches     1227     1203      -24     
==========================================
+ Hits         2348     2460     +112     
+ Misses       3694     3551     -143     
+ Partials      685      652      -33
Impacted Files Coverage Δ
editor/effects.js 60.16% <100%> (+14.82%) ⬆️
blocks/api/validation.js 91.46% <0%> (-3.7%) ⬇️
editor/components/inserter/menu.js 85.54% <0%> (-1.79%) ⬇️
editor/components/inserter/index.js 0% <0%> (ø) ⬆️
blocks/library/button/index.js 9.3% <0%> (ø) ⬆️
editor/components/block-settings-menu/index.js 0% <0%> (ø) ⬆️
editor/header/fixed-toolbar-toggle/index.js 0% <0%> (ø) ⬆️
blocks/block-alignment-toolbar/index.js 33.33% <0%> (ø) ⬆️
editor/utils/with-change-detection/index.js 100% <0%> (ø) ⬆️
editor/header/mode-switcher/index.js 0% <0%> (ø) ⬆️
... and 52 more

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 1709207...e156849. Read the comment docs.

codecov bot commented Nov 20, 2017

Codecov Report

Merging #3377 into master will increase coverage by 2.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3377      +/-   ##
==========================================
+ Coverage    34.9%   36.92%   +2.01%     
==========================================
  Files         263      267       +4     
  Lines        6727     6663      -64     
  Branches     1227     1203      -24     
==========================================
+ Hits         2348     2460     +112     
+ Misses       3694     3551     -143     
+ Partials      685      652      -33
Impacted Files Coverage Δ
editor/effects.js 60.16% <100%> (+14.82%) ⬆️
blocks/api/validation.js 91.46% <0%> (-3.7%) ⬇️
editor/components/inserter/menu.js 85.54% <0%> (-1.79%) ⬇️
editor/components/inserter/index.js 0% <0%> (ø) ⬆️
blocks/library/button/index.js 9.3% <0%> (ø) ⬆️
editor/components/block-settings-menu/index.js 0% <0%> (ø) ⬆️
editor/header/fixed-toolbar-toggle/index.js 0% <0%> (ø) ⬆️
blocks/block-alignment-toolbar/index.js 33.33% <0%> (ø) ⬆️
editor/utils/with-change-detection/index.js 100% <0%> (ø) ⬆️
editor/header/mode-switcher/index.js 0% <0%> (ø) ⬆️
... and 52 more

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 1709207...e156849. Read the comment docs.

Remove extraneous createEditorInstance
This unnecessary line probably came as a result of a bad merge conflict
resolution.

@noisysocks noisysocks changed the title from Add reusable blocks effects to Reusable Blocks: Add reusable blocks effects Nov 20, 2017

noisysocks added some commits Nov 20, 2017

Fix 'cannot call initializeMetaBoxes on undefined' error
`gutenberg_collect_meta_box_data` expected that
`window._wpGutenbergEditor` would always be instantiated, but this is
only true for when `wp.api.init()` returns quickly because of the API
schema being cached.

The fix is to use a Promise to store `window._wpGutenbergEditor`.

(Well, a jQuery.Deferred, since we have to support IE 11 which doesn't
support promises.)
Replace jQuery.Deferred with Promise
Remove jQuery.Deferred and jQuery.when in our editor initialization in
lieu of Promise and Promise.all.
Show outdated Hide outdated lib/register.php Outdated
@youknowriad

Nice work

Rename _wpGutenbergEditor -> _wpLoadGutenbergEditor
Make it clear that this variable is a promise by giving it a non-noun
name.

@noisysocks noisysocks merged commit 981c22a into WordPress:master Nov 21, 2017

2 checks passed

codecov/project 36.92% (+2.01%) compared to 1709207
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@noisysocks noisysocks deleted the noisysocks:add/reusable-blocks-effects branch Nov 21, 2017

@georgeh georgeh referenced this pull request Nov 27, 2017

Closed

Replace hard-coded API version with global config #3042

3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment