Skip to content

Commit

Permalink
Merge pull request #3001 from wordpress-mobile/contact-info-api-jetpack
Browse files Browse the repository at this point in the history
Contact Info - Adding Feature Flag + Jetpack API Version Check
  • Loading branch information
illusaen authored Feb 9, 2021
2 parents 6545fab + 946a941 commit f328485
Show file tree
Hide file tree
Showing 55 changed files with 1,618 additions and 1,496 deletions.
3 changes: 3 additions & 0 deletions bundle/android/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
<string name="gutenberg_native_double_tap_to_move_the_block_to_the_left" tools:ignore="UnusedResources">Double tap to move the block to the left</string>
<string name="gutenberg_native_double_tap_to_move_the_block_to_the_right" tools:ignore="UnusedResources">Double tap to move the block to the right</string>
<string name="gutenberg_native_double_tap_to_move_the_block_up" tools:ignore="UnusedResources">Double tap to move the block up</string>
<string name="gutenberg_native_double_tap_to_open_action_sheet_to_edit_or_replace_the_image" tools:ignore="UnusedResources">Double tap to open Action Sheet to edit or replace the image</string>
<string name="gutenberg_native_double_tap_to_open_action_sheet_with_available_options" tools:ignore="UnusedResources">Double tap to open Action Sheet with available options</string>
<string name="gutenberg_native_double_tap_to_open_bottom_sheet_to_edit_or_replace_the_image" tools:ignore="UnusedResources">Double tap to open Bottom Sheet to edit or replace the image</string>
<string name="gutenberg_native_double_tap_to_open_bottom_sheet_with_available_options" tools:ignore="UnusedResources">Double tap to open Bottom Sheet with available options</string>
<string name="gutenberg_native_double_tap_to_redo_last_change" tools:ignore="UnusedResources">Double tap to redo last change</string>
<string name="gutenberg_native_double_tap_to_select" tools:ignore="UnusedResources">Double tap to select</string>
Expand All @@ -85,6 +87,7 @@
<string name="gutenberg_native_double_tap_to_undo_last_change" tools:ignore="UnusedResources">Double tap to undo last change</string>
<string name="gutenberg_native_duplicate_block" tools:ignore="UnusedResources">Duplicate block</string>
<string name="gutenberg_native_edit_file" tools:ignore="UnusedResources">Edit file</string>
<string name="gutenberg_native_edit_the_cover_image" tools:ignore="UnusedResources">Edit the cover image</string>
<string name="gutenberg_native_edit_using_web_editor" tools:ignore="UnusedResources">Edit using web editor</string>
<string name="gutenberg_native_edit_video" tools:ignore="UnusedResources">Edit video</string>
<string name="gutenberg_native_error" tools:ignore="UnusedResources">Error</string>
Expand Down
2,882 changes: 1,444 additions & 1,438 deletions bundle/ios/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/ios/App.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions bundle/ios/GutenbergNativeTranslations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ private func dummy() {
_ = NSLocalizedString("Double tap to move the block to the left", comment: "")
_ = NSLocalizedString("Double tap to move the block to the right", comment: "")
_ = NSLocalizedString("Double tap to move the block up", comment: "")
_ = NSLocalizedString("Double tap to open Action Sheet to edit or replace the image", comment: "")
_ = NSLocalizedString("Double tap to open Action Sheet with available options", comment: "")
_ = NSLocalizedString("Double tap to open Bottom Sheet to edit or replace the image", comment: "")
_ = NSLocalizedString("Double tap to open Bottom Sheet with available options", comment: "")
_ = NSLocalizedString("Double tap to redo last change", comment: "")
_ = NSLocalizedString("Double tap to select", comment: "")
Expand All @@ -75,6 +77,7 @@ private func dummy() {
_ = NSLocalizedString("Double tap to undo last change", comment: "")
_ = NSLocalizedString("Duplicate block", comment: "")
_ = NSLocalizedString("Edit file", comment: "")
_ = NSLocalizedString("Edit the cover image", comment: "")
_ = NSLocalizedString("Edit using web editor", comment: "")
_ = NSLocalizedString("Edit video", comment: "")
_ = NSLocalizedString("Error", comment: "")
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions src/jetpack-editor-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ export default ( jetpackState ) => {

const jetpackData = setJetpackData( jetpackState );

const toggleBlock = ( capability, blockName ) => {
if ( capability !== true ) {
dispatch( 'core/edit-post' ).hideBlockTypes( [ blockName ] );
} else {
dispatch( 'core/edit-post' ).showBlockTypes( [ blockName ] );
}
};

// Note on the use of setTimeout() here:
// We observed the settings may not be ready exactly when the native.render hooks get run but rather
// right after that execution cycle (because state hasn't changed yet). Hence, we're only checking for
Expand All @@ -53,15 +61,12 @@ export default ( jetpackState ) => {

// eslint-disable-next-line @wordpress/react-no-unsafe-timeout
setTimeout( () => {
const mediaFilesCollectionBlock = select(
'core/block-editor'
).getSettings( 'capabilities' ).mediaFilesCollectionBlock;
const capabilities = select( 'core/block-editor' ).getSettings(
'capabilities'
);

if ( mediaFilesCollectionBlock !== true ) {
dispatch( 'core/edit-post' ).hideBlockTypes( [ 'jetpack/story' ] );
} else {
dispatch( 'core/edit-post' ).showBlockTypes( [ 'jetpack/story' ] );
}
toggleBlock( capabilities.mediaFilesCollectionBlock, 'jetpack/story' );
toggleBlock( capabilities.contactInfoBlock, 'jetpack/contact-info' );
} );

require( '../jetpack/projects/plugins/jetpack/extensions/editor' );
Expand Down

0 comments on commit f328485

Please sign in to comment.