From dd89a23e7081bd85e882954a5c24e20140ab6842 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Thu, 23 Jan 2020 21:09:35 -0600 Subject: [PATCH 01/11] Add Jetpack blocks collection --- extensions/shared/block-category.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/extensions/shared/block-category.js b/extensions/shared/block-category.js index 571ac1127c29f..1903d04b91bc6 100644 --- a/extensions/shared/block-category.js +++ b/extensions/shared/block-category.js @@ -1,19 +1,27 @@ /** * External dependencies */ -import { getCategories, setCategories } from '@wordpress/blocks'; +import { getCategories, setCategories, registerBlockCollection } from '@wordpress/blocks'; /** * Internal dependencies */ import JetpackLogo from '../shared/jetpack-logo'; -setCategories( [ - ...getCategories().filter( ( { slug } ) => slug !== 'jetpack' ), - // Add a Jetpack block category - { - slug: 'jetpack', +if ( typeof registerBlockCollection === 'function' ) { + registerBlockCollection( 'jetpack', { title: 'Jetpack', icon: , - }, -] ); + } ); +} else { + // This can be removed once G 7.3 is shipped in the Core version that is JP's minimum. + setCategories( [ + ...getCategories().filter( ( { slug } ) => slug !== 'jetpack' ), + // Add a Jetpack block category + { + slug: 'jetpack', + title: 'Jetpack', + icon: , + }, + ] ); +} From 84b277eb5935ddc5667524b98c4054889e72eed7 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Thu, 23 Jan 2020 21:10:14 -0600 Subject: [PATCH 02/11] Change Business Hours block to 'Widgets' category --- extensions/blocks/business-hours/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/blocks/business-hours/index.js b/extensions/blocks/business-hours/index.js index be50d09c721f2..a9fb66ce04fc1 100644 --- a/extensions/blocks/business-hours/index.js +++ b/extensions/blocks/business-hours/index.js @@ -3,6 +3,7 @@ */ import { __, _x } from '@wordpress/i18n'; import { Path } from '@wordpress/components'; +import { registerBlockCollection } from '@wordpress/blocks'; /** * Internal dependencies @@ -82,7 +83,7 @@ export const settings = { title: __( 'Business Hours', 'jetpack' ), description: __( 'Display opening hours for your business.', 'jetpack' ), icon, - category: 'jetpack', + category: typeof registerBlockCollection === 'function' ? 'widgets' : 'jetpack', supports: { html: true, }, From 309586673add3a6e6cdf2a5a036bcd7780c0a945 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Mon, 30 Mar 2020 17:03:08 -0500 Subject: [PATCH 03/11] DRY supportCollections function --- extensions/blocks/business-hours/index.js | 4 ++-- extensions/shared/block-category.js | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/extensions/blocks/business-hours/index.js b/extensions/blocks/business-hours/index.js index a9fb66ce04fc1..3b116a037bb12 100644 --- a/extensions/blocks/business-hours/index.js +++ b/extensions/blocks/business-hours/index.js @@ -3,7 +3,6 @@ */ import { __, _x } from '@wordpress/i18n'; import { Path } from '@wordpress/components'; -import { registerBlockCollection } from '@wordpress/blocks'; /** * Internal dependencies @@ -12,6 +11,7 @@ import './editor.scss'; import './style.scss'; import BusinessHours from './edit'; import renderMaterialIcon from '../../shared/render-material-icon'; +import { supportsCollections } from '../../shared/block-category'; /** * Block Registrations: @@ -83,7 +83,7 @@ export const settings = { title: __( 'Business Hours', 'jetpack' ), description: __( 'Display opening hours for your business.', 'jetpack' ), icon, - category: typeof registerBlockCollection === 'function' ? 'widgets' : 'jetpack', + category: supportsCollections() ? 'widgets' : 'jetpack', supports: { html: true, }, diff --git a/extensions/shared/block-category.js b/extensions/shared/block-category.js index 1903d04b91bc6..b354104c01875 100644 --- a/extensions/shared/block-category.js +++ b/extensions/shared/block-category.js @@ -8,7 +8,19 @@ import { getCategories, setCategories, registerBlockCollection } from '@wordpres */ import JetpackLogo from '../shared/jetpack-logo'; -if ( typeof registerBlockCollection === 'function' ) { +/** + * Return bool depending on registerBlockCollection compatibility. + * + * @return {boolean} Value to indicate function support. + */ +export const supportsCollections = () => { + if ( typeof registerBlockCollection === 'function' ) { + return true; + } + return false; +}; + +if ( supportsCollections() ) { registerBlockCollection( 'jetpack', { title: 'Jetpack', icon: , From d54043cd3233e1da45684058d3b5825662e1addc Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Mon, 30 Mar 2020 17:16:32 -0500 Subject: [PATCH 04/11] Add block categories --- extensions/blocks/calendly/index.js | 3 ++- extensions/blocks/contact-form/index.js | 3 ++- extensions/blocks/contact-info/index.js | 3 ++- extensions/blocks/eventbrite/index.js | 3 ++- extensions/blocks/gif/index.js | 3 ++- extensions/blocks/google-calendar/index.js | 3 ++- extensions/blocks/map/settings.js | 3 ++- extensions/blocks/markdown/index.js | 3 ++- extensions/blocks/opentable/index.js | 3 ++- extensions/blocks/pinterest/index.js | 3 ++- extensions/blocks/rating-star/index.js | 3 ++- extensions/blocks/repeat-visitor/index.js | 3 ++- extensions/blocks/revue/index.js | 3 ++- extensions/blocks/slideshow/index.js | 3 ++- extensions/blocks/tiled-gallery/index.js | 3 ++- 15 files changed, 30 insertions(+), 15 deletions(-) diff --git a/extensions/blocks/calendly/index.js b/extensions/blocks/calendly/index.js index 243d598a9a0e0..b1bf22f463216 100644 --- a/extensions/blocks/calendly/index.js +++ b/extensions/blocks/calendly/index.js @@ -16,6 +16,7 @@ import { getAttributesFromEmbedCode, REGEX } from './utils'; * Style dependencies */ import './editor.scss'; +import { supportsCollections } from '../../shared/block-category'; export const CALENDLY_EXAMPLE_URL = 'https://calendly.com/wordpresscom/jetpack-block-example'; @@ -25,7 +26,7 @@ export const settings = { title, description: __( 'Embed a calendar for customers to schedule appointments', 'jetpack' ), icon, - category: 'jetpack', + category: supportsCollections() ? 'widgets' : 'jetpack', keywords: [ _x( 'calendar', 'block search term', 'jetpack' ), _x( 'schedule', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/contact-form/index.js b/extensions/blocks/contact-form/index.js index 50c52f2005161..dd83a1c188596 100644 --- a/extensions/blocks/contact-form/index.js +++ b/extensions/blocks/contact-form/index.js @@ -18,6 +18,7 @@ import JetpackFieldCheckbox from './components/jetpack-field-checkbox'; import JetpackFieldMultiple from './components/jetpack-field-multiple'; import renderMaterialIcon from '../../shared/render-material-icon'; import colorValidator from '../../shared/colorValidator'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'contact-form'; @@ -32,7 +33,7 @@ export const settings = { _x( 'feedback', 'block search term', 'jetpack' ), _x( 'contact form', 'block search term', 'jetpack' ), ], - category: 'jetpack', + category: supportsCollections() ? 'widgets' : 'jetpack', supports: { html: false, }, diff --git a/extensions/blocks/contact-info/index.js b/extensions/blocks/contact-info/index.js index 9307e8110951d..6ab245aeb6b34 100644 --- a/extensions/blocks/contact-info/index.js +++ b/extensions/blocks/contact-info/index.js @@ -15,6 +15,7 @@ import './style.scss'; import { name as addressName, settings as addressSettings } from './address/'; import { name as emailName, settings as emailSettings } from './email/'; import { name as phoneName, settings as phoneSettings } from './phone/'; +import { supportsCollections } from '../../shared/block-category'; const attributes = {}; @@ -40,7 +41,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: 'jetpack', + category: supportsCollections() ? 'formatting' : 'jetpack', supports: { align: [ 'wide', 'full' ], html: false, diff --git a/extensions/blocks/eventbrite/index.js b/extensions/blocks/eventbrite/index.js index 67a79f1839c13..af3d24e5f8073 100644 --- a/extensions/blocks/eventbrite/index.js +++ b/extensions/blocks/eventbrite/index.js @@ -12,6 +12,7 @@ import attributes from './attributes'; import deprecated from './deprecated/v1'; import edit from './edit'; import save from './save'; +import { supportsCollections } from '../../shared/block-category'; // Example URLs // https://www.eventbrite.com/e/test-event-tickets-123456789 @@ -41,7 +42,7 @@ export const settings = { title, description: __( 'Embed Eventbrite event details and ticket checkout.', 'jetpack' ), icon, - category: 'jetpack', + category: supportsCollections() ? 'widgets' : 'jetpack', keywords: [ _x( 'events', 'block search term', 'jetpack' ), _x( 'tickets', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/gif/index.js b/extensions/blocks/gif/index.js index 17a1967a3a592..97f1dce96f18b 100644 --- a/extensions/blocks/gif/index.js +++ b/extensions/blocks/gif/index.js @@ -12,6 +12,7 @@ import edit from './edit'; // Ordering is important! Editor overrides style! import './style.scss'; import './editor.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'gif'; export const title = __( 'GIF', 'jetpack' ); @@ -26,7 +27,7 @@ export const icon = ( export const settings = { title, icon, - category: 'jetpack', + category: supportsCollections() ? 'formatting' : 'jetpack', keywords: [ _x( 'animated', 'block search term', 'jetpack' ), _x( 'giphy', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/google-calendar/index.js b/extensions/blocks/google-calendar/index.js index 83a606e18f09d..c4cc6cd740651 100644 --- a/extensions/blocks/google-calendar/index.js +++ b/extensions/blocks/google-calendar/index.js @@ -11,6 +11,7 @@ import edit from './edit'; import { extractAttributesFromIframe, URL_REGEX, IFRAME_REGEX } from './utils'; import './editor.scss'; import icon from './icon'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'google-calendar'; export const title = __( 'Google Calendar', 'jetpack' ); @@ -25,7 +26,7 @@ export const settings = { _x( 'appointments', 'block search term', 'jetpack' ), ], icon, - category: 'jetpack', + category: supportsCollections() ? 'embeds' : 'jetpack', supports: { align: true, alignWide: true, diff --git a/extensions/blocks/map/settings.js b/extensions/blocks/map/settings.js index c5bcc22871b51..5617a46eaed83 100644 --- a/extensions/blocks/map/settings.js +++ b/extensions/blocks/map/settings.js @@ -13,6 +13,7 @@ import defaultTheme from './map-theme_default.jpg'; import blackAndWhiteTheme from './map-theme_black_and_white.jpg'; import satelliteTheme from './map-theme_satellite.jpg'; import terrainTheme from './map-theme_terrain.jpg'; +import { supportsCollections } from '../../shared/block-category'; export const settings = { name: 'map', @@ -33,7 +34,7 @@ export const settings = { ), - category: 'jetpack', + category: supportsCollections() ? 'common' : 'jetpack', keywords: [ _x( 'maps', 'block search term', 'jetpack' ), _x( 'location', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/markdown/index.js b/extensions/blocks/markdown/index.js index a8b0bb7b74957..6e1369d28ddd2 100644 --- a/extensions/blocks/markdown/index.js +++ b/extensions/blocks/markdown/index.js @@ -12,6 +12,7 @@ import './editor.scss'; import { isAtomicSite, isSimpleSite } from '../../shared/site-type-utils'; import edit from './edit'; import save from './save'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'markdown'; @@ -57,7 +58,7 @@ export const settings = { ), - category: 'jetpack', + category: supportsCollections() ? 'formatting' : 'jetpack', keywords: [ _x( 'formatting', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/opentable/index.js b/extensions/blocks/opentable/index.js index 01f92767e4e99..fb8e927434bec 100644 --- a/extensions/blocks/opentable/index.js +++ b/extensions/blocks/opentable/index.js @@ -20,12 +20,13 @@ import './view.scss'; export const name = 'opentable'; export const title = __( 'OpenTable', 'jetpack' ); import { getAttributesFromEmbedCode, restRefRegex, ridRegex } from './utils'; +import { supportsCollections } from '../../shared/block-category'; export const settings = { title, description: __( 'Allow visitors to book a reservation with OpenTable', 'jetpack' ), icon, - category: 'jetpack', + category: supportsCollections() ? 'widgets' : 'jetpack', keywords: [ _x( 'booking', 'block search term', 'jetpack' ), _x( 'reservation', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/pinterest/index.js b/extensions/blocks/pinterest/index.js index 2ec5d591dee5b..329e86925ec65 100644 --- a/extensions/blocks/pinterest/index.js +++ b/extensions/blocks/pinterest/index.js @@ -10,6 +10,7 @@ import { createBlock } from '@wordpress/blocks'; */ import edit from './edit'; import { pinType } from './utils'; +import { supportsCollections } from '../../shared/block-category'; export const URL_REGEX = /^\s*https?:\/\/(?:www\.)?(?:[a-z]{2}\.)?(?:pinterest\.[a-z.]+|pin\.it)\/([^/]+)(\/[^/]+)?/i; @@ -32,7 +33,7 @@ export const settings = { icon, - category: 'jetpack', + category: supportsCollections() ? 'embeds' : 'jetpack', keywords: [ _x( 'social', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/rating-star/index.js b/extensions/blocks/rating-star/index.js index cacaf0451b900..727562132e94c 100644 --- a/extensions/blocks/rating-star/index.js +++ b/extensions/blocks/rating-star/index.js @@ -11,6 +11,7 @@ import save from './save'; import { StarIcon, StarBlockIcon } from './icon'; import './editor.scss'; import './style.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'rating-star'; @@ -26,7 +27,7 @@ export const settings = { _x( 'rating', 'block search term', 'jetpack' ), _x( 'review', 'block search term', 'jetpack' ), ], - category: 'jetpack', + category: supportsCollections() ? 'formatting' : 'jetpack', example: {}, styles: [ { diff --git a/extensions/blocks/repeat-visitor/index.js b/extensions/blocks/repeat-visitor/index.js index 25ead8b3376b8..418aba2f431f3 100644 --- a/extensions/blocks/repeat-visitor/index.js +++ b/extensions/blocks/repeat-visitor/index.js @@ -12,6 +12,7 @@ import edit from './components/edit'; import save from './components/save'; import { CRITERIA_AFTER, DEFAULT_THRESHOLD } from './constants'; import './editor.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'repeat-visitor'; export const icon = renderMaterialIcon( @@ -28,7 +29,7 @@ export const settings = { default: DEFAULT_THRESHOLD, }, }, - category: 'jetpack', + category: supportsCollections() ? 'widgets' : 'jetpack', description: __( 'Control block visibility based on how often a visitor has viewed the page.', 'jetpack' diff --git a/extensions/blocks/revue/index.js b/extensions/blocks/revue/index.js index 707b5c457f793..86ee950215374 100644 --- a/extensions/blocks/revue/index.js +++ b/extensions/blocks/revue/index.js @@ -9,6 +9,7 @@ import { __, _x } from '@wordpress/i18n'; import attributes from './attributes'; import edit from './edit'; import icon from './icon'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'revue'; @@ -16,7 +17,7 @@ export const settings = { title: __( 'Revue', 'jetpack' ), description: __( 'Add a subscription form for your Revue newsletter.', 'jetpack' ), icon, - category: 'jetpack', + category: supportsCollections() ? 'widgets' : 'jetpack', keywords: [ _x( 'email', 'block search term', 'jetpack' ), _x( 'subscription', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/slideshow/index.js b/extensions/blocks/slideshow/index.js index 7669de30a4be7..8e0d7975b0a79 100644 --- a/extensions/blocks/slideshow/index.js +++ b/extensions/blocks/slideshow/index.js @@ -10,6 +10,7 @@ import { Path, SVG } from '@wordpress/components'; import edit from './edit'; import save from './save'; import transforms from './transforms'; +import { supportsCollections } from '../../shared/block-category'; /** * Example Images @@ -111,7 +112,7 @@ export const name = 'slideshow'; export const settings = { title: __( 'Slideshow', 'jetpack' ), - category: 'jetpack', + category: supportsCollections() ? 'common' : 'jetpack', keywords: [ _x( 'image', 'block search term', 'jetpack' ), _x( 'gallery', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/tiled-gallery/index.js b/extensions/blocks/tiled-gallery/index.js index a4fca42d5a7e2..a3d510933bf02 100644 --- a/extensions/blocks/tiled-gallery/index.js +++ b/extensions/blocks/tiled-gallery/index.js @@ -36,6 +36,7 @@ import tiledGalleryExample3 from './tiled-gallery_example-3.jpg'; import tiledGalleryExample4 from './tiled-gallery_example-4.jpg'; import tiledGalleryExample5 from './tiled-gallery_example-5.jpg'; import tiledGalleryExample6 from './tiled-gallery_example-6.jpg'; +import { supportsCollections } from '../../shared/block-category'; // Style names are translated. Avoid introducing an i18n dependency elsewhere (view) // by only including the labels here, the only place they're needed. @@ -197,7 +198,7 @@ export const icon = ( export const settings = { attributes: blockAttributes, - category: 'jetpack', + category: supportsCollections() ? 'common' : 'jetpack', description: __( 'Display multiple images in an elegantly organized tiled layout.', 'jetpack' ) + ( ! isSimpleSite() From a98cb035722c41efcc25c2403eca75f23eccbad5 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 3 Apr 2020 09:43:15 -0500 Subject: [PATCH 05/11] Add Earn and Marketing categories --- extensions/shared/block-category.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/extensions/shared/block-category.js b/extensions/shared/block-category.js index b354104c01875..b0713bc4ec1fc 100644 --- a/extensions/shared/block-category.js +++ b/extensions/shared/block-category.js @@ -37,3 +37,23 @@ if ( supportsCollections() ) { }, ] ); } + +setCategories( [ + ...getCategories().filter( ( { slug } ) => slug !== 'earn' ), + // Add a Jetpack block category + { + slug: 'earn', + title: 'Earn', + icon: , + }, +] ); + +setCategories( [ + ...getCategories().filter( ( { slug } ) => slug !== 'marketing' ), + // Add a Jetpack block category + { + slug: 'marketing', + title: 'Marketing', + icon: , + }, +] ); From 03ebd7cd3647d4b3c7bf671a9c25ed68b50daac7 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 3 Apr 2020 10:32:09 -0500 Subject: [PATCH 06/11] Update category names based on spreadsheet mentioned in GH comment --- extensions/blocks/amazon/index.js | 3 ++- extensions/blocks/business-hours/index.js | 2 +- extensions/blocks/calendly/index.js | 2 +- extensions/blocks/contact-form/index.js | 2 +- extensions/blocks/contact-info/address/index.js | 3 ++- extensions/blocks/contact-info/email/index.js | 3 ++- extensions/blocks/contact-info/index.js | 2 +- extensions/blocks/contact-info/phone/index.js | 3 ++- extensions/blocks/eventbrite/index.js | 2 +- extensions/blocks/gif/index.js | 2 +- extensions/blocks/google-calendar/index.js | 2 +- extensions/blocks/instagram-gallery/index.js | 3 ++- extensions/blocks/mailchimp/index.js | 3 ++- extensions/blocks/map/settings.js | 2 +- extensions/blocks/opentable/index.js | 2 +- extensions/blocks/pinterest/index.js | 2 +- extensions/blocks/podcast-player/index.js | 3 ++- extensions/blocks/recurring-payments/index.js | 3 ++- extensions/blocks/related-posts/index.js | 3 ++- extensions/blocks/revue/index.js | 2 +- extensions/blocks/simple-payments/index.js | 3 ++- extensions/blocks/slideshow/index.js | 2 +- extensions/blocks/subscriptions/index.js | 3 ++- extensions/blocks/tiled-gallery/index.js | 2 +- extensions/blocks/wordads/index.js | 3 ++- 25 files changed, 37 insertions(+), 25 deletions(-) diff --git a/extensions/blocks/amazon/index.js b/extensions/blocks/amazon/index.js index 0289b0f0c55e7..61684212d832e 100644 --- a/extensions/blocks/amazon/index.js +++ b/extensions/blocks/amazon/index.js @@ -14,6 +14,7 @@ import edit from './edit'; * Style dependencies */ import './editor.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'amazon'; export const title = __( 'Amazon', 'jetpack' ); @@ -22,7 +23,7 @@ export const settings = { title, description: __( 'Promote Amazon products and earn a commission from sales.', 'jetpack' ), icon, - category: 'jetpack', + category: supportsCollections() ? 'earn' : 'jetpack', keywords: [ __( 'amazon', 'jetpack' ), __( 'affiliate', 'jetpack' ) ], supports: { align: true, diff --git a/extensions/blocks/business-hours/index.js b/extensions/blocks/business-hours/index.js index 3b116a037bb12..b3d4e6869094a 100644 --- a/extensions/blocks/business-hours/index.js +++ b/extensions/blocks/business-hours/index.js @@ -83,7 +83,7 @@ export const settings = { title: __( 'Business Hours', 'jetpack' ), description: __( 'Display opening hours for your business.', 'jetpack' ), icon, - category: supportsCollections() ? 'widgets' : 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', supports: { html: true, }, diff --git a/extensions/blocks/calendly/index.js b/extensions/blocks/calendly/index.js index b1bf22f463216..1d77f4f242314 100644 --- a/extensions/blocks/calendly/index.js +++ b/extensions/blocks/calendly/index.js @@ -26,7 +26,7 @@ export const settings = { title, description: __( 'Embed a calendar for customers to schedule appointments', 'jetpack' ), icon, - category: supportsCollections() ? 'widgets' : 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', keywords: [ _x( 'calendar', 'block search term', 'jetpack' ), _x( 'schedule', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/contact-form/index.js b/extensions/blocks/contact-form/index.js index dd83a1c188596..7a33f85cbd522 100644 --- a/extensions/blocks/contact-form/index.js +++ b/extensions/blocks/contact-form/index.js @@ -33,7 +33,7 @@ export const settings = { _x( 'feedback', 'block search term', 'jetpack' ), _x( 'contact form', 'block search term', 'jetpack' ), ], - category: supportsCollections() ? 'widgets' : 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', supports: { html: false, }, diff --git a/extensions/blocks/contact-info/address/index.js b/extensions/blocks/contact-info/address/index.js index f94259f4577d7..07d624ac65f7a 100644 --- a/extensions/blocks/contact-info/address/index.js +++ b/extensions/blocks/contact-info/address/index.js @@ -11,6 +11,7 @@ import { Path, Circle } from '@wordpress/components'; import edit from './edit'; import save from './save'; import renderMaterialIcon from '../../../shared/render-material-icon'; +import { supportsCollections } from '../../../shared/block-category'; const attributes = { address: { @@ -63,7 +64,7 @@ export const settings = { ), - category: 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', attributes, parent: [ 'jetpack/contact-info' ], edit, diff --git a/extensions/blocks/contact-info/email/index.js b/extensions/blocks/contact-info/email/index.js index db086dd091826..b9400efbbe5fb 100644 --- a/extensions/blocks/contact-info/email/index.js +++ b/extensions/blocks/contact-info/email/index.js @@ -10,6 +10,7 @@ import { Path } from '@wordpress/components'; import edit from './edit'; import renderMaterialIcon from '../../../shared/render-material-icon'; import save from './save'; +import { supportsCollections } from '../../../shared/block-category'; const attributes = { email: { @@ -34,7 +35,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', attributes, edit, save, diff --git a/extensions/blocks/contact-info/index.js b/extensions/blocks/contact-info/index.js index 6ab245aeb6b34..e69a4ee4e961f 100644 --- a/extensions/blocks/contact-info/index.js +++ b/extensions/blocks/contact-info/index.js @@ -41,7 +41,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: supportsCollections() ? 'formatting' : 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', supports: { align: [ 'wide', 'full' ], html: false, diff --git a/extensions/blocks/contact-info/phone/index.js b/extensions/blocks/contact-info/phone/index.js index 17c51924d7cd4..2403465c54c65 100644 --- a/extensions/blocks/contact-info/phone/index.js +++ b/extensions/blocks/contact-info/phone/index.js @@ -10,6 +10,7 @@ import { Path } from '@wordpress/components'; import edit from './edit'; import renderMaterialIcon from '../../../shared/render-material-icon'; import save from './save'; +import { supportsCollections } from '../../../shared/block-category'; const attributes = { phone: { @@ -34,7 +35,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', attributes, parent: [ 'jetpack/contact-info' ], edit, diff --git a/extensions/blocks/eventbrite/index.js b/extensions/blocks/eventbrite/index.js index af3d24e5f8073..2dcccf61ed39d 100644 --- a/extensions/blocks/eventbrite/index.js +++ b/extensions/blocks/eventbrite/index.js @@ -42,7 +42,7 @@ export const settings = { title, description: __( 'Embed Eventbrite event details and ticket checkout.', 'jetpack' ), icon, - category: supportsCollections() ? 'widgets' : 'jetpack', + category: supportsCollections() ? 'embed' : 'jetpack', keywords: [ _x( 'events', 'block search term', 'jetpack' ), _x( 'tickets', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/gif/index.js b/extensions/blocks/gif/index.js index 97f1dce96f18b..2898a3b57b492 100644 --- a/extensions/blocks/gif/index.js +++ b/extensions/blocks/gif/index.js @@ -27,7 +27,7 @@ export const icon = ( export const settings = { title, icon, - category: supportsCollections() ? 'formatting' : 'jetpack', + category: supportsCollections() ? 'embed' : 'jetpack', keywords: [ _x( 'animated', 'block search term', 'jetpack' ), _x( 'giphy', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/google-calendar/index.js b/extensions/blocks/google-calendar/index.js index c4cc6cd740651..39f2e5629e711 100644 --- a/extensions/blocks/google-calendar/index.js +++ b/extensions/blocks/google-calendar/index.js @@ -26,7 +26,7 @@ export const settings = { _x( 'appointments', 'block search term', 'jetpack' ), ], icon, - category: supportsCollections() ? 'embeds' : 'jetpack', + category: supportsCollections() ? 'embed' : 'jetpack', supports: { align: true, alignWide: true, diff --git a/extensions/blocks/instagram-gallery/index.js b/extensions/blocks/instagram-gallery/index.js index 10f5a8d1e7cfe..be8e8b1c869e8 100644 --- a/extensions/blocks/instagram-gallery/index.js +++ b/extensions/blocks/instagram-gallery/index.js @@ -8,6 +8,7 @@ import { __, _x } from '@wordpress/i18n'; */ import attributes from './attributes'; import edit from './edit'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'instagram-gallery'; @@ -15,7 +16,7 @@ export const settings = { title: __( 'Instagram Gallery', 'jetpack' ), description: __( 'Embed posts from your Instagram account', 'jetpack' ), icon: 'instagram', - category: 'jetpack', + category: supportsCollections() ? 'embed' : 'jetpack', keywords: [ _x( 'images', 'block search term', 'jetpack' ), _x( 'photos', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/mailchimp/index.js b/extensions/blocks/mailchimp/index.js index d9e808554ed8d..0a2141068c574 100644 --- a/extensions/blocks/mailchimp/index.js +++ b/extensions/blocks/mailchimp/index.js @@ -9,6 +9,7 @@ import { Path, SVG } from '@wordpress/components'; */ import edit from './edit'; import './editor.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'mailchimp'; @@ -23,7 +24,7 @@ export const settings = { title: __( 'Mailchimp', 'jetpack' ), icon, description: __( 'A form enabling readers to join a Mailchimp list.', 'jetpack' ), - category: 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', keywords: [ _x( 'email', 'block search term', 'jetpack' ), _x( 'subscription', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/map/settings.js b/extensions/blocks/map/settings.js index 5617a46eaed83..8b4a670e4a6f4 100644 --- a/extensions/blocks/map/settings.js +++ b/extensions/blocks/map/settings.js @@ -34,7 +34,7 @@ export const settings = { ), - category: supportsCollections() ? 'common' : 'jetpack', + category: supportsCollections() ? 'embed' : 'jetpack', keywords: [ _x( 'maps', 'block search term', 'jetpack' ), _x( 'location', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/opentable/index.js b/extensions/blocks/opentable/index.js index fb8e927434bec..79bca0cfc8f3c 100644 --- a/extensions/blocks/opentable/index.js +++ b/extensions/blocks/opentable/index.js @@ -26,7 +26,7 @@ export const settings = { title, description: __( 'Allow visitors to book a reservation with OpenTable', 'jetpack' ), icon, - category: supportsCollections() ? 'widgets' : 'jetpack', + category: supportsCollections() ? 'earn' : 'jetpack', keywords: [ _x( 'booking', 'block search term', 'jetpack' ), _x( 'reservation', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/pinterest/index.js b/extensions/blocks/pinterest/index.js index 329e86925ec65..781726be7df61 100644 --- a/extensions/blocks/pinterest/index.js +++ b/extensions/blocks/pinterest/index.js @@ -33,7 +33,7 @@ export const settings = { icon, - category: supportsCollections() ? 'embeds' : 'jetpack', + category: supportsCollections() ? 'embed' : 'jetpack', keywords: [ _x( 'social', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/podcast-player/index.js b/extensions/blocks/podcast-player/index.js index 67401edc77368..41acbf4f8a851 100644 --- a/extensions/blocks/podcast-player/index.js +++ b/extensions/blocks/podcast-player/index.js @@ -19,6 +19,7 @@ import { queueMusic } from './icons/'; */ import './style.scss'; import './editor.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'podcast-player'; export const namespaceName = `jetpack/${ name }`; @@ -27,7 +28,7 @@ export const settings = { title, description: __( 'Select and play episodes from a single podcast.', 'jetpack' ), icon: queueMusic, - category: 'jetpack', + category: supportsCollections() ? 'embed' : 'jetpack', keywords: [ _x( 'audio', 'block search term', 'jetpack' ), _x( 'embed', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/recurring-payments/index.js b/extensions/blocks/recurring-payments/index.js index f199e3c941385..e36ea77353831 100644 --- a/extensions/blocks/recurring-payments/index.js +++ b/extensions/blocks/recurring-payments/index.js @@ -11,6 +11,7 @@ import { trimEnd } from 'lodash'; import { __, _x } from '@wordpress/i18n'; import edit from './edit'; import './editor.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'recurring-payments'; @@ -27,7 +28,7 @@ export const settings = { title: __( 'Recurring Payments', 'jetpack' ), icon, description: __( 'Button allowing you to sell subscription products.', 'jetpack' ), - category: 'jetpack', + category: supportsCollections() ? 'earn' : 'jetpack', keywords: [ _x( 'sell', 'block search term', 'jetpack' ), _x( 'subscriptions', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/related-posts/index.js b/extensions/blocks/related-posts/index.js index 31763fab084b2..d52e81de8eaf3 100644 --- a/extensions/blocks/related-posts/index.js +++ b/extensions/blocks/related-posts/index.js @@ -9,6 +9,7 @@ import { G, Path, SVG } from '@wordpress/components'; */ import edit from './edit'; import './style.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'related-posts'; @@ -23,7 +24,7 @@ export const settings = { ), - category: 'jetpack', + category: supportsCollections() ? 'embed' : 'jetpack', keywords: [ _x( 'similar content', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/revue/index.js b/extensions/blocks/revue/index.js index 86ee950215374..405591dd6d94e 100644 --- a/extensions/blocks/revue/index.js +++ b/extensions/blocks/revue/index.js @@ -17,7 +17,7 @@ export const settings = { title: __( 'Revue', 'jetpack' ), description: __( 'Add a subscription form for your Revue newsletter.', 'jetpack' ), icon, - category: supportsCollections() ? 'widgets' : 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', keywords: [ _x( 'email', 'block search term', 'jetpack' ), _x( 'subscription', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/simple-payments/index.js b/extensions/blocks/simple-payments/index.js index 97a17fad933c5..2eb8d284d20ce 100644 --- a/extensions/blocks/simple-payments/index.js +++ b/extensions/blocks/simple-payments/index.js @@ -22,6 +22,7 @@ import simplePaymentsExample1 from './simple-payments_example-1.jpg'; * Styles */ import './editor.scss'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'simple-payments'; @@ -55,7 +56,7 @@ export const settings = { ), - category: 'jetpack', + category: supportsCollections() ? 'earn' : 'jetpack', keywords: [ _x( 'buy', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/slideshow/index.js b/extensions/blocks/slideshow/index.js index 8e0d7975b0a79..e9444e03107e2 100644 --- a/extensions/blocks/slideshow/index.js +++ b/extensions/blocks/slideshow/index.js @@ -112,7 +112,7 @@ export const name = 'slideshow'; export const settings = { title: __( 'Slideshow', 'jetpack' ), - category: supportsCollections() ? 'common' : 'jetpack', + category: supportsCollections() ? 'layout' : 'jetpack', keywords: [ _x( 'image', 'block search term', 'jetpack' ), _x( 'gallery', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/subscriptions/index.js b/extensions/blocks/subscriptions/index.js index 783c695339eac..39be68ab9495f 100644 --- a/extensions/blocks/subscriptions/index.js +++ b/extensions/blocks/subscriptions/index.js @@ -12,6 +12,7 @@ import { RawHTML } from '@wordpress/element'; import edit from './edit'; import save from './save'; import renderMaterialIcon from '../../shared/render-material-icon'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'subscriptions'; export const settings = { @@ -28,7 +29,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', keywords: [ _x( 'subscribe', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/tiled-gallery/index.js b/extensions/blocks/tiled-gallery/index.js index a3d510933bf02..df86135ff34e6 100644 --- a/extensions/blocks/tiled-gallery/index.js +++ b/extensions/blocks/tiled-gallery/index.js @@ -198,7 +198,7 @@ export const icon = ( export const settings = { attributes: blockAttributes, - category: supportsCollections() ? 'common' : 'jetpack', + category: supportsCollections() ? 'layout' : 'jetpack', description: __( 'Display multiple images in an elegantly organized tiled layout.', 'jetpack' ) + ( ! isSimpleSite() diff --git a/extensions/blocks/wordads/index.js b/extensions/blocks/wordads/index.js index 2ec3769ee01ae..f83a5450462ff 100644 --- a/extensions/blocks/wordads/index.js +++ b/extensions/blocks/wordads/index.js @@ -10,6 +10,7 @@ import { Fragment } from '@wordpress/element'; */ import edit from './edit'; import { DEFAULT_FORMAT } from './constants'; +import { supportsCollections } from '../../shared/block-category'; export const name = 'wordads'; export const title = __( 'Ad', 'jetpack' ); @@ -56,7 +57,7 @@ export const settings = { attributes: {}, }, - category: 'jetpack', + category: supportsCollections() ? 'earn' : 'jetpack', keywords: [ _x( 'ads', 'block search term', 'jetpack' ), From 1ff0eb803566356825e71653d8f0b5a3ba5351ae Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 3 Apr 2020 10:38:12 -0500 Subject: [PATCH 07/11] Improve notes re 5.4 minimum and simplify supportsCollections --- extensions/shared/block-category.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/extensions/shared/block-category.js b/extensions/shared/block-category.js index b0713bc4ec1fc..7026583022dcd 100644 --- a/extensions/shared/block-category.js +++ b/extensions/shared/block-category.js @@ -11,13 +11,12 @@ import JetpackLogo from '../shared/jetpack-logo'; /** * Return bool depending on registerBlockCollection compatibility. * + * @todo When Jetpack's minimum is WP 5.4. Remove this function and update all block categories. + * * @return {boolean} Value to indicate function support. */ export const supportsCollections = () => { - if ( typeof registerBlockCollection === 'function' ) { - return true; - } - return false; + return typeof registerBlockCollection === 'function'; }; if ( supportsCollections() ) { @@ -26,7 +25,7 @@ if ( supportsCollections() ) { icon: , } ); } else { - // This can be removed once G 7.3 is shipped in the Core version that is JP's minimum. + // This can be removed once Jetpack's minimum is Core 5.4. setCategories( [ ...getCategories().filter( ( { slug } ) => slug !== 'jetpack' ), // Add a Jetpack block category @@ -40,7 +39,7 @@ if ( supportsCollections() ) { setCategories( [ ...getCategories().filter( ( { slug } ) => slug !== 'earn' ), - // Add a Jetpack block category + // Add a Earn block category { slug: 'earn', title: 'Earn', @@ -50,7 +49,7 @@ setCategories( [ setCategories( [ ...getCategories().filter( ( { slug } ) => slug !== 'marketing' ), - // Add a Jetpack block category + // Add a Marketing block category { slug: 'marketing', title: 'Marketing', From ef1f1477f4bb5792aaec3355b6d8bda84bec3053 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 3 Apr 2020 11:32:26 -0500 Subject: [PATCH 08/11] Make new categories translatable --- extensions/shared/block-category.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/shared/block-category.js b/extensions/shared/block-category.js index 7026583022dcd..d411e2fe44818 100644 --- a/extensions/shared/block-category.js +++ b/extensions/shared/block-category.js @@ -2,6 +2,7 @@ * External dependencies */ import { getCategories, setCategories, registerBlockCollection } from '@wordpress/blocks'; +import { __ } from '@wordpress/i18n'; /** * Internal dependencies @@ -42,7 +43,7 @@ setCategories( [ // Add a Earn block category { slug: 'earn', - title: 'Earn', + title: __( 'Earn' ), icon: , }, ] ); @@ -52,7 +53,7 @@ setCategories( [ // Add a Marketing block category { slug: 'marketing', - title: 'Marketing', + title: __( 'Marketing' ), icon: , }, ] ); From 74f11ddafb2778133e2e16a46471b8144568e3b1 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 3 Apr 2020 12:09:03 -0500 Subject: [PATCH 09/11] Add categories to form field child blocks --- extensions/blocks/contact-form/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/blocks/contact-form/index.js b/extensions/blocks/contact-form/index.js index 7a33f85cbd522..ca8873ffca8d9 100644 --- a/extensions/blocks/contact-form/index.js +++ b/extensions/blocks/contact-form/index.js @@ -175,7 +175,7 @@ export const settings = { }; const FieldDefaults = { - category: 'jetpack', + category: supportsCollections() ? 'marketing' : 'jetpack', parent: [ 'jetpack/contact-form' ], supports: { reusable: false, From e6e2bd25a4ef1a821f548a97294e35312599de2f Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 3 Apr 2020 13:54:04 -0500 Subject: [PATCH 10/11] Rename Marketing to Grow --- extensions/blocks/business-hours/index.js | 2 +- extensions/blocks/calendly/index.js | 2 +- extensions/blocks/contact-form/index.js | 4 ++-- extensions/blocks/contact-info/address/index.js | 2 +- extensions/blocks/contact-info/email/index.js | 2 +- extensions/blocks/contact-info/index.js | 2 +- extensions/blocks/contact-info/phone/index.js | 2 +- extensions/blocks/mailchimp/index.js | 2 +- extensions/blocks/revue/index.js | 2 +- extensions/blocks/subscriptions/index.js | 2 +- extensions/shared/block-category.js | 8 ++++---- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/extensions/blocks/business-hours/index.js b/extensions/blocks/business-hours/index.js index b3d4e6869094a..66bfe769ece44 100644 --- a/extensions/blocks/business-hours/index.js +++ b/extensions/blocks/business-hours/index.js @@ -83,7 +83,7 @@ export const settings = { title: __( 'Business Hours', 'jetpack' ), description: __( 'Display opening hours for your business.', 'jetpack' ), icon, - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', supports: { html: true, }, diff --git a/extensions/blocks/calendly/index.js b/extensions/blocks/calendly/index.js index 1d77f4f242314..b449f0ab9df6c 100644 --- a/extensions/blocks/calendly/index.js +++ b/extensions/blocks/calendly/index.js @@ -26,7 +26,7 @@ export const settings = { title, description: __( 'Embed a calendar for customers to schedule appointments', 'jetpack' ), icon, - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', keywords: [ _x( 'calendar', 'block search term', 'jetpack' ), _x( 'schedule', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/contact-form/index.js b/extensions/blocks/contact-form/index.js index ca8873ffca8d9..9423ba570f521 100644 --- a/extensions/blocks/contact-form/index.js +++ b/extensions/blocks/contact-form/index.js @@ -33,7 +33,7 @@ export const settings = { _x( 'feedback', 'block search term', 'jetpack' ), _x( 'contact form', 'block search term', 'jetpack' ), ], - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', supports: { html: false, }, @@ -175,7 +175,7 @@ export const settings = { }; const FieldDefaults = { - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', parent: [ 'jetpack/contact-form' ], supports: { reusable: false, diff --git a/extensions/blocks/contact-info/address/index.js b/extensions/blocks/contact-info/address/index.js index 07d624ac65f7a..6f8b64b94372b 100644 --- a/extensions/blocks/contact-info/address/index.js +++ b/extensions/blocks/contact-info/address/index.js @@ -64,7 +64,7 @@ export const settings = { ), - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', attributes, parent: [ 'jetpack/contact-info' ], edit, diff --git a/extensions/blocks/contact-info/email/index.js b/extensions/blocks/contact-info/email/index.js index b9400efbbe5fb..c2a4e6a0ba024 100644 --- a/extensions/blocks/contact-info/email/index.js +++ b/extensions/blocks/contact-info/email/index.js @@ -35,7 +35,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', attributes, edit, save, diff --git a/extensions/blocks/contact-info/index.js b/extensions/blocks/contact-info/index.js index e69a4ee4e961f..8d6f907c07f61 100644 --- a/extensions/blocks/contact-info/index.js +++ b/extensions/blocks/contact-info/index.js @@ -41,7 +41,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', supports: { align: [ 'wide', 'full' ], html: false, diff --git a/extensions/blocks/contact-info/phone/index.js b/extensions/blocks/contact-info/phone/index.js index 2403465c54c65..133bc7750de79 100644 --- a/extensions/blocks/contact-info/phone/index.js +++ b/extensions/blocks/contact-info/phone/index.js @@ -35,7 +35,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', attributes, parent: [ 'jetpack/contact-info' ], edit, diff --git a/extensions/blocks/mailchimp/index.js b/extensions/blocks/mailchimp/index.js index 0a2141068c574..e1ce8168e30d6 100644 --- a/extensions/blocks/mailchimp/index.js +++ b/extensions/blocks/mailchimp/index.js @@ -24,7 +24,7 @@ export const settings = { title: __( 'Mailchimp', 'jetpack' ), icon, description: __( 'A form enabling readers to join a Mailchimp list.', 'jetpack' ), - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', keywords: [ _x( 'email', 'block search term', 'jetpack' ), _x( 'subscription', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/revue/index.js b/extensions/blocks/revue/index.js index 405591dd6d94e..68d44a4fb5942 100644 --- a/extensions/blocks/revue/index.js +++ b/extensions/blocks/revue/index.js @@ -17,7 +17,7 @@ export const settings = { title: __( 'Revue', 'jetpack' ), description: __( 'Add a subscription form for your Revue newsletter.', 'jetpack' ), icon, - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', keywords: [ _x( 'email', 'block search term', 'jetpack' ), _x( 'subscription', 'block search term', 'jetpack' ), diff --git a/extensions/blocks/subscriptions/index.js b/extensions/blocks/subscriptions/index.js index 39be68ab9495f..805615fdbfaad 100644 --- a/extensions/blocks/subscriptions/index.js +++ b/extensions/blocks/subscriptions/index.js @@ -29,7 +29,7 @@ export const settings = { icon: renderMaterialIcon( ), - category: supportsCollections() ? 'marketing' : 'jetpack', + category: supportsCollections() ? 'grow' : 'jetpack', keywords: [ _x( 'subscribe', 'block search term', 'jetpack' ), diff --git a/extensions/shared/block-category.js b/extensions/shared/block-category.js index d411e2fe44818..c475141505e80 100644 --- a/extensions/shared/block-category.js +++ b/extensions/shared/block-category.js @@ -49,11 +49,11 @@ setCategories( [ ] ); setCategories( [ - ...getCategories().filter( ( { slug } ) => slug !== 'marketing' ), - // Add a Marketing block category + ...getCategories().filter( ( { slug } ) => slug !== 'grow' ), + // Add a Grow block category { - slug: 'marketing', - title: __( 'Marketing' ), + slug: 'grow', + title: __( 'Grow' ), icon: , }, ] ); From 3cdc453a120d9ebc2ce2618fb40732ec492641d5 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Mon, 6 Apr 2020 09:32:13 +0200 Subject: [PATCH 11/11] Add missing textdomains --- extensions/shared/block-category.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/shared/block-category.js b/extensions/shared/block-category.js index c475141505e80..abe0ec106026f 100644 --- a/extensions/shared/block-category.js +++ b/extensions/shared/block-category.js @@ -43,7 +43,7 @@ setCategories( [ // Add a Earn block category { slug: 'earn', - title: __( 'Earn' ), + title: __( 'Earn', 'jetpack' ), icon: , }, ] ); @@ -53,7 +53,7 @@ setCategories( [ // Add a Grow block category { slug: 'grow', - title: __( 'Grow' ), + title: __( 'Grow', 'jetpack' ), icon: , }, ] );