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

Initial Port of Jetpack Tiled Gallery Block #4291

Merged
merged 120 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
2840e67
Register Jetpack Tiled Gallery
guarani Sep 1, 2021
2e1badd
Update jest configuration to map WP modules
fluiddot Jun 25, 2021
fb52a9f
Add test helper to module name mapper
fluiddot Jun 25, 2021
fca8b9c
Add Tiled Gallery Block integration test
guarani Sep 1, 2021
ff0aff6
Fix failing Jetpack editor setup test
guarani Sep 2, 2021
a45bef9
Add Tiled Gallery to the list of supported blocks
guarani Sep 2, 2021
3b508c4
Bump Gutenberg submodule hash
guarani Sep 9, 2021
6dec2ef
Bump Gutenberg & Jetpack submodule refs
guarani Sep 10, 2021
95c1951
Bump gutenberg submodule ref
guarani Sep 14, 2021
b4af65e
Bump Gutenberg and Jetpack to merge commits
guarani Sep 14, 2021
1bd7d90
Merge pull request #3903 from wordpress-mobile/add/tiled-gallery-bloc…
guarani Sep 14, 2021
b8ff4f6
Bump Jetpack submodule ref to include inner block implementation
guarani Sep 20, 2021
3a3a81e
Trigger build
guarani Sep 20, 2021
abc491c
Bump Jetpack submodule
guarani Sep 21, 2021
b15c45d
Trigger new build
guarani Sep 21, 2021
1f0ecc8
Point Jetpack submodule to merge commit
guarani Sep 21, 2021
b5f8afc
Merge pull request #3999 from wordpress-mobile/add/tiled-gallery-bloc…
guarani Sep 21, 2021
165437f
Update Jetpack submodule ref
guarani Sep 23, 2021
8925973
Update Jetpack submodule
guarani Sep 23, 2021
c9266b1
Update Gutenberg reference
Sep 23, 2021
7539d1e
Update Jetpack reference
Sep 23, 2021
769e7f5
Merge pull request #4015 from wordpress-mobile/add/tiled-gallery-bloc…
guarani Sep 23, 2021
1effda7
Update Jetpack reference
Sep 28, 2021
79ba857
Update reference to Gutenberg
Sep 29, 2021
5231b63
Update Gutenberg reference
Oct 4, 2021
e9a2eab
Bringing columns attributes changes for Jetpack Tiled Gallery to gbmo…
Oct 20, 2021
c4c30ad
Merge pull request #4141 from wordpress-mobile/tiled-gallery-columns
illusaen Oct 20, 2021
c189092
Updating submodule hash for jetpack -- Jetpack Tiled Gallery save wor…
Oct 21, 2021
4421546
Skippiing jetpack tiled gallery unit test for now as the infinite rec…
Oct 27, 2021
f647bb2
Merge branch 'develop' into add/tiled-gallery-block
Oct 28, 2021
a4de645
Merge branch 'add/tiled-gallery-block' into add/squared-aspect-ratio
Oct 28, 2021
47b351c
Updating jetpack hash for merge conflict.
Oct 28, 2021
a281afa
Update Jetpack reference
Oct 29, 2021
8b7374e
Merge branch 'develop' into tiled-gallery-save-workaround
Oct 29, 2021
4cf52c1
Merge branch 'add/tiled-gallery-block' into tiled-gallery-save-workar…
Oct 29, 2021
2089328
Updating hash
Nov 1, 2021
cc4977b
update gutenberg submodule ref
guarani Nov 2, 2021
0d2e9ea
Merge branch 'develop' into add/tiled-gallery-block
guarani Nov 2, 2021
175cf65
Merged in latest from feature branch
guarani Nov 2, 2021
1eba9e8
Update to Gutenberg feature branch
guarani Nov 2, 2021
123fda4
Merge pull request #4143 from wordpress-mobile/tiled-gallery-save-wor…
guarani Nov 2, 2021
ce1d870
Update latest reference to Jetpack
Nov 2, 2021
d935709
Merge branch 'add/tiled-gallery-block' into add/squared-aspect-ratio
Nov 2, 2021
cb131a1
Update reference to Jetpack
Nov 2, 2021
392c454
Merge pull request #4017 from wordpress-mobile/add/squared-aspect-ratio
Nov 2, 2021
e17bba2
Update reference to Jetpack
Nov 2, 2021
c1815d9
Update reference to Jetpack
Nov 2, 2021
6cc83e5
Update Jetpack submodule ref
guarani Nov 2, 2021
01d3700
Update reference to Jetpack
Nov 3, 2021
e60ce19
Merge pull request #4194 from wordpress-mobile/update/tiled-gallery-p…
Nov 3, 2021
da045bc
Update Jetpack submodule hash
guarani Nov 3, 2021
2886706
Merge branch 'add/tiled-gallery-block' into fix/tiled-gallery-inner-b…
guarani Nov 3, 2021
6d145bc
Merge pull request #4196 from wordpress-mobile/fix/tiled-gallery-inne…
guarani Nov 3, 2021
bf98f1c
Updating submodule hash for jetpack for removing save workaround.
Nov 4, 2021
0df518a
Update Jetpack reference
Nov 5, 2021
1ff00a2
Merge branch 'add/tiled-gallery-block' into fix/block-icon-colour
Nov 5, 2021
8c37fa9
Merge pull request #4193 from wordpress-mobile/fix/block-icon-colour
Nov 5, 2021
cdc521d
Updating hash.
Nov 5, 2021
d94b390
Merge branch 'add/tiled-gallery-block' into tiled-gallery-removing-wo…
Nov 5, 2021
a0b6626
Merge pull request #4205 from wordpress-mobile/tiled-gallery-removing…
illusaen Nov 5, 2021
2bea4ca
Update Jetpack hash
guarani Nov 9, 2021
800c516
Update submodule hash
guarani Nov 10, 2021
d27f566
Merge pull request #4221 from wordpress-mobile/add/tiled-gallery-bloc…
guarani Nov 10, 2021
b2f3322
Merge branch 'develop' into add/tiled-gallery-block
Nov 16, 2021
065b950
Update reference to Gutenberg
Nov 16, 2021
d506905
Update reference to Jetpack
Nov 16, 2021
4400337
Merge branch 'develop' into try/hide-child-block-controls
Nov 16, 2021
69a694d
Merge branch 'add/tiled-gallery-block' into try/hide-child-block-cont…
Nov 16, 2021
dd1e456
Merge pull request #4246 from wordpress-mobile/try/hide-child-block-c…
Nov 16, 2021
a6155a4
'registerJetpackBlocks' before running tests
Nov 18, 2021
0e1c9ba
Merge pull request #4255 from wordpress-mobile/fix/tiled-gallery/fail…
Nov 18, 2021
82b1ea4
Update Gutenberg and Jetpack references
Nov 25, 2021
908a327
Merge branch 'develop' into add/tiled-gallery-block
Nov 25, 2021
ac1c22c
Update Jetpack submodule ref
guarani Nov 16, 2021
9cd6271
Merge pull request #4249 from wordpress-mobile/add/tiled-gallery-bloc…
guarani Nov 25, 2021
342bc46
Update reference to Jetpack
Nov 26, 2021
c716a26
Update reference to Jetpack
Nov 29, 2021
96d1a0d
Merge pull request #4304 from wordpress-mobile/update/tiled-gallery-l…
Nov 29, 2021
c9b3202
Update bundle for iOS build
Dec 3, 2021
0520b72
Merge branch 'develop' into add/tiled-gallery-block
guarani Jan 5, 2022
de7cbda
Update Jetpack submodule
guarani Jan 5, 2022
c07e890
Update Jetpack submodule ref
guarani Jan 5, 2022
78d7fed
Update Jetpack submodule ref
guarani Jan 7, 2022
fee0e59
Add Tiled Gallery to Jetpack test setup
guarani Jan 7, 2022
25730b1
Merge pull request #4439 from wordpress-mobile/fix/tiled-gallery-bloc…
guarani Jan 7, 2022
9008dbd
Merge branch 'add/tiled-gallery-block' into fix/tiled-gallery-block-p…
guarani Jan 7, 2022
19053a8
Update Jetpack reference
Jan 7, 2022
ec0f28c
Merge branch 'add/tiled-gallery-block' into tiled-gallery/set-max-col…
Jan 7, 2022
e5d4dda
Update Jetpack reference
Jan 7, 2022
bd6e430
Merge pull request #4441 from wordpress-mobile/tiled-gallery/set-max-…
Jan 7, 2022
3e818b9
Make Tiled Gallery unavailable on prod
guarani Jan 7, 2022
c896b94
Remove git conflict resolution markers
Jan 7, 2022
9a78ea8
Revert accidental whitespace change
Jan 7, 2022
089c867
Update Jetpack submodule ref
guarani Jan 7, 2022
89a1eab
Merge branch 'add/tiled-gallery-block' into fix/tiled-gallery-block-p…
guarani Jan 7, 2022
952c88b
Update Jetpack submodule ref
guarani Jan 7, 2022
b014564
Update Jetpack submodule ref
guarani Jan 7, 2022
a161e6b
Merge branch 'add/tiled-gallery-block' into fix/tiled-gallery-block-p…
guarani Jan 7, 2022
ce8a4e2
Merge pull request #4433 from wordpress-mobile/fix/tiled-gallery-bloc…
guarani Jan 7, 2022
657b6d0
Update reference to Jetpack
Jan 11, 2022
b86cf37
Merge branch 'develop' into add/tiled-gallery-block
Jan 11, 2022
bfa74ef
Update Jetpack submodule ref
guarani Jan 13, 2022
642e4ba
Merge branch 'develop' into add/tiled-gallery-block
guarani Jan 14, 2022
a83bf5b
Update Gutenberg submodule ref
guarani Jan 14, 2022
4f53695
Update bundle
guarani Jan 14, 2022
4cc7081
Merge branch 'develop' into add/tiled-gallery-block
guarani Jan 14, 2022
3b9cb42
Update Gutenberg submodule ref
guarani Jan 14, 2022
eb435db
Merge branch 'develop' into add/tiled-gallery-block
guarani Jan 17, 2022
96b8ec9
Update Gutenberg submodule ref
guarani Jan 17, 2022
05632ad
Updated bundle
guarani Jan 17, 2022
114db7b
Update submodule references
Jan 19, 2022
68f5386
Merge branch 'develop' into add/tiled-gallery-block
Jan 19, 2022
a094b39
Apply bundle changes
Jan 19, 2022
fb4f225
Revert changes to JSON files
Jan 19, 2022
bc18ab0
Revert accidental deletion of json files
Jan 19, 2022
dab3005
Update Gutenberg submodule ref
guarani Jan 19, 2022
b4525c7
Fix Tiled Gallery capability
guarani Jan 19, 2022
3af4c54
Merge branch 'develop' into add/tiled-gallery-block
guarani Jan 19, 2022
9df7385
Point to latest Gutenberg submodule
guarani Jan 19, 2022
2a4997b
Updated Tiled Gallery test
guarani Jan 19, 2022
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions bundle/android/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
<string name="gutenberg_native_from_clipboard" tools:ignore="UnusedResources">From clipboard</string>
<!-- translators: accessibility text. %s: gallery caption. -->
<string name="gutenberg_native_gallery_caption_s" tools:ignore="UnusedResources">Gallery caption. %s</string>
<string name="gutenberg_native_gallery_style" tools:ignore="UnusedResources">Gallery style</string>
<string name="gutenberg_native_get_support" tools:ignore="UnusedResources">Get support</string>
<string name="gutenberg_native_give_it_a_try_by_adding_a_few_blocks_to_your_post_or_page" tools:ignore="UnusedResources">Give it a try by adding a few blocks to your post or page!</string>
<string name="gutenberg_native_go_back" tools:ignore="UnusedResources">Go back</string>
Expand Down Expand Up @@ -220,6 +221,7 @@
<string name="gutenberg_native_navigate_up" tools:ignore="UnusedResources">Navigate Up</string>
<string name="gutenberg_native_navigates_to_custom_color_picker" tools:ignore="UnusedResources">Navigates to custom color picker</string>
<string name="gutenberg_native_navigates_to_customize_the_gradient" tools:ignore="UnusedResources">Navigates to customize the gradient</string>
<string name="gutenberg_native_navigates_to_layout_selection_screen" tools:ignore="UnusedResources">Navigates to layout selection screen</string>
<!-- translators: %s: Select control button label e.g. Small
translators: %s: Select control button label e.g. "Button width" -->
<string name="gutenberg_native_navigates_to_select_s" tools:ignore="UnusedResources">Navigates to select %s</string>
Expand Down Expand Up @@ -326,6 +328,7 @@ translators: %s: Select control option value e.g: "Auto, 25%". -->
<string name="gutenberg_native_text_formatting_controls_are_located_within_the_toolbar_positione" tools:ignore="UnusedResources">Text formatting controls are located within the toolbar positioned above the keyboard while editing a text block</string>
<string name="gutenberg_native_the_basics" tools:ignore="UnusedResources">The basics</string>
<string name="gutenberg_native_three" tools:ignore="UnusedResources">Three</string>
<string name="gutenberg_native_tiled_gallery_settings" tools:ignore="UnusedResources">Tiled gallery settings</string>
<string name="gutenberg_native_to_remove_a_block_select_the_block_and_click_the_three_dots_in_th" tools:ignore="UnusedResources">To remove a block, select the block and click the three dots in the bottom right of the block to view the settings. From there, choose the option to remove the block.</string>
<string name="gutenberg_native_transform_block" tools:ignore="UnusedResources">Transform block…</string>
<!-- translators: %s: block title e.g: "Paragraph". -->
Expand Down
1,592 changes: 839 additions & 753 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 @@ -163,6 +163,7 @@ private func dummy() {
_ = NSLocalizedString("Four", comment: "")
_ = NSLocalizedString("From clipboard", comment: "")
_ = NSLocalizedString("Gallery caption. %s", comment: "translators: accessibility text. %s: gallery caption.")
_ = NSLocalizedString("Gallery style", comment: "")
_ = NSLocalizedString("Get support", comment: "")
_ = NSLocalizedString("Give it a try by adding a few blocks to your post or page!", comment: "")
_ = NSLocalizedString("Go back", comment: "")
Expand Down Expand Up @@ -205,6 +206,7 @@ private func dummy() {
_ = NSLocalizedString("Navigate Up", comment: "")
_ = NSLocalizedString("Navigates to custom color picker", comment: "")
_ = NSLocalizedString("Navigates to customize the gradient", comment: "")
_ = NSLocalizedString("Navigates to layout selection screen", comment: "")
_ = NSLocalizedString("Navigates to select %s", comment: "translators: %s: Select control button label e.g. Small\ntranslators: %s: Select control button label e.g. \"Button width\"")
_ = NSLocalizedString("Navigates to the previous content sheet", comment: "")
_ = NSLocalizedString("No application can handle this request.", comment: "")
Expand Down Expand Up @@ -274,6 +276,7 @@ private func dummy() {
_ = NSLocalizedString("Text formatting controls are located within the toolbar positioned above the keyboard while editing a text block", comment: "")
_ = NSLocalizedString("The basics", comment: "")
_ = NSLocalizedString("Three", comment: "")
_ = NSLocalizedString("Tiled gallery settings", comment: "")
_ = NSLocalizedString("To remove a block, select the block and click the three dots in the bottom right of the block to view the settings. From there, choose the option to remove the block.", comment: "")
_ = NSLocalizedString("Transform %s to", comment: "translators: %s: block title e.g: \"Paragraph\".")
_ = NSLocalizedString("Transform block…", comment: "")
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion jetpack
Submodule jetpack updated 2599 files
3 changes: 2 additions & 1 deletion src/block-support/supported-blocks.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"jetpack/contact-info",
"jetpack/email",
"jetpack/phone",
"jetpack/address"
"jetpack/address",
"jetpack/tiled-gallery"
],
"devOnly": [ "core/code" ],
"iOSOnly": [],
Expand Down
7 changes: 7 additions & 0 deletions src/jetpack-editor-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const supportedJetpackBlocks = {
story: {
available: true,
},
'tiled-gallery': {
available: __DEV__,
},
};

const setJetpackData = ( {
Expand Down Expand Up @@ -76,6 +79,10 @@ export function registerJetpackBlocks( { capabilities } ) {
capabilities.contactInfoBlock,
'jetpack/contact-info'
);
hideBlockByCapability(
capabilities.tiledGalleryBlock,
'jetpack/tiled-gallery'
);

// Register Jetpack blocks
require( '../jetpack/projects/plugins/jetpack/extensions/editor' );
Expand Down
84 changes: 84 additions & 0 deletions src/jetpack/test/tiled-gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* External dependencies
*/
import {
getEditorHtml,
initializeEditor,
fireEvent,
waitFor,
within,
} from 'test/helpers';

/**
* WordPress dependencies
*/
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
import { registerCoreBlocks } from '@wordpress/block-library';

/**
* Internal dependencies
*/
import {
registerJetpackBlocks,
setupJetpackEditor,
} from '../../jetpack-editor-setup';

const defaultProps = {
capabilities: {
tiledGalleryBlock: true,
},
};

beforeAll( () => {
// Register all core blocks
registerCoreBlocks();
// Register Jetpack blocks
setupJetpackEditor( { blogId: 1, isJetpackActive: true } );
registerJetpackBlocks( defaultProps );
} );

afterAll( () => {
// Clean up registered blocks
getBlockTypes().forEach( ( block ) => {
unregisterBlockType( block.name );
} );
} );

describe.skip( 'Tiled Gallery block', () => {
it( 'inserts the block', async () => {
const {
getByA11yLabel,
getByTestId,
getByText,
debug,
} = await initializeEditor( {
initialHtml: '',
capabilities: { tiledGalleryBlock: true },
} );

// Open the inserter menu
fireEvent.press( await waitFor( () => getByA11yLabel( 'Add block' ) ) );

const blockList = getByTestId( 'InserterUI-Blocks' );
// onScroll event used to force the FlatList to render all items
fireEvent.scroll( blockList, {
nativeEvent: {
contentOffset: { y: 0, x: 0 },
contentSize: { width: 100, height: 100 },
layoutMeasurement: { width: 100, height: 100 },
},
} );

// Insert the block
fireEvent.press( await waitFor( () => getByText( 'Tiled Gallery' ) ) );

// Get the block
const block = await waitFor( () =>
getByA11yLabel( /Tiled Gallery Block\. Row 1/ )
);

expect( block ).toBeDefined();
const expectedHtml = `<!-- wp:jetpack/tiled-gallery /-->`;
expect( getEditorHtml() ).toBe( expectedHtml );
} );
} );
8 changes: 7 additions & 1 deletion src/test/jetpack-editor-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ const defaultProps = {
smartframeEmbed: true,
},
};
const jetpackBlocks = [ 'jetpack/contact-info', 'jetpack/story' ];
const jetpackBlocks = [
'jetpack/contact-info',
'jetpack/story',
'jetpack/tiled-gallery',
];
const jetpackEmbedVariations = [
'facebook',
'instagram',
Expand Down Expand Up @@ -74,6 +78,7 @@ describe( 'Jetpack blocks', () => {
available_blocks: {
'contact-info': { available: true },
story: { available: true },
'tiled-gallery': { available: true },
},
jetpack: { is_active: true },
siteFragment: null,
Expand Down Expand Up @@ -109,6 +114,7 @@ describe( 'Jetpack blocks', () => {
capabilities: {
mediaFilesCollectionBlock: true,
contactInfoBlock: false,
tiledGalleryBlock: true,
},
} );

Expand Down