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

Gutenpack: Add/contact form to the gutenberg editor #10537

Merged
merged 31 commits into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b48c031
Add the gutenberg contact form gutenberg blocks
enejb Nov 2, 2018
6f40728
Gutenpack: Add contact form block
enejb Nov 2, 2018
def5f70
Update form block to use contact-form
enejb Nov 9, 2018
c9c74fc
Add do_blocks call to the contact render form
enejb Nov 9, 2018
090c448
Add register_contact_form_blocks block method
enejb Nov 9, 2018
bd72cc2
Provide default labels
gititon Nov 9, 2018
3ff74a8
Updates to fix tests
enejb Nov 9, 2018
398eb15
Minor fixes
enejb Nov 12, 2018
14eb99a
Use the jetpack_register_block call to register the contact form blocks
enejb Nov 13, 2018
de6e22b
Bug fix: Only display selections when the option has a value.
enejb Nov 13, 2018
fdf2b5c
Added tests that show what the form doesn't recieve a lavel that we d…
enejb Nov 14, 2018
2b35816
Add tests that shows that we remove empty options when we pass an str…
enejb Nov 14, 2018
0b45ad2
Minor bug fix. Add closing div to the phone field.
enejb Nov 14, 2018
8b50e9c
Add support for class added in gutenberg
enejb Nov 14, 2018
2d585c7
Refactored field Render method so that it is easier to follow.
enejb Nov 14, 2018
66b5b9e
Minor fixes
enejb Nov 14, 2018
655523a
Add unitests for output.
enejb Nov 15, 2018
0fe1a9f
Unit Test fixes so that they work with older version of PHP
enejb Nov 15, 2018
5ab263d
Fix: Add more liberal url validaton
enejb Nov 15, 2018
a80ac64
Improved pattern for the url.
enejb Nov 15, 2018
296df81
Revert "Improved pattern for the url."
enejb Nov 15, 2018
d2650ce
Revert "Fix: Add more liberal url validaton"
enejb Nov 15, 2018
efc76e6
Add support for the defaultValue block attribute
enejb Nov 15, 2018
30deca4
Gutenberg: Conact form
roccotripaldi Nov 16, 2018
dd89d1b
Fix the tests again :P
enejb Nov 16, 2018
1705d28
Fixes indentation of the js code
enejb Nov 16, 2018
ebd7d0a
Remove comment
enejb Nov 16, 2018
d221495
Add php doc block for remove_empty
enejb Nov 16, 2018
53876cf
Fixes ugly quotes.
enejb Nov 16, 2018
dca6d2a
Fix the tests since we are expecting the double quotes now.
enejb Nov 16, 2018
c903b63
With escaped quotes
enejb Nov 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions class.jetpack-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public static function get_preset( $preset ) {

/**
* Filters the results of `apply_filter( 'jetpack_set_available_blocks', array() )`
* using the contents of `_inc/blocks/blocks-manifest.json`
* using the merged contents of `_inc/blocks/blocks-manifest.json` ( $preset_blocks )
* and self::$jetpack_blocks ( $internal_blocks )
*
* @param $blocks The default list.
*
Expand All @@ -111,12 +112,14 @@ public static function get_preset( $preset ) {
public static function jetpack_set_available_blocks( $blocks ) {
$preset_blocks_manifest = self::preset_exists( 'block-manifest' ) ? self::get_preset( 'block-manifest' ) : (object) array( 'blocks' => $blocks );
$preset_blocks = isset( $preset_blocks_manifest->blocks ) ? (array) $preset_blocks_manifest->blocks : array() ;
$internal_blocks = array_keys( self::$jetpack_blocks );

if ( Jetpack_Constants::is_true( 'JETPACK_BETA_BLOCKS' ) ) {
$beta_blocks = isset( $preset_blocks_manifest->betaBlocks ) ? (array) $preset_blocks_manifest->betaBlocks : array();
return array_merge( $preset_blocks, $beta_blocks );
return array_unique( array_merge( $preset_blocks, $beta_blocks, $internal_blocks ) );
}

return $preset_blocks;
return array_unique( array_merge( $preset_blocks, $internal_blocks ) );
}

/**
Expand Down
Loading