Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
80ceab3
New class to handle async XML-RPC requests (#16674)
leogermani Aug 5, 2020
c07b42b
Lodash: Revert to previous version (#16735)
kraftbj Aug 5, 2020
e3860aa
Donations: Save block content (#16705)
mmtr Aug 6, 2020
11f81f1
UI changes to prepare to make Social Previews a gated feature on WPCo…
getdave Aug 6, 2020
dbc8291
Jetpack Monitor: Switch from `user_token` to `blog_token`. (#16736)
sergeymitr Aug 7, 2020
b96e08f
Jetpack Protect: Replace `user_token` with `blog_token`. (#16758)
sergeymitr Aug 7, 2020
12f82ed
adds tracking for deleted but active master users (#16750)
leogermani Aug 7, 2020
10d037a
Add Slim SEO to list of SEO plugins (#16778)
rilwis Aug 10, 2020
c2ea60d
Donations: Remove feature from Personal plans (#16742)
mmtr Aug 10, 2020
917261a
avoid warning on wp cli (#16760)
leogermani Aug 10, 2020
abc6741
Update jest monorepo to v26 (#16774)
renovate[bot] Aug 10, 2020
ae5f858
Update dependency url-loader to v4 (#16772)
renovate[bot] Aug 10, 2020
60fbb28
CC me only on master failures; (#16780)
brbrr Aug 10, 2020
b4e342d
E2E test job will fail CI builds from now (#16757)
brbrr Aug 10, 2020
b0348d5
E2E tests: Add retry to .org login method (#16756)
brbrr Aug 10, 2020
3204915
Donations: Avoid using buttons elements in block output (#16743)
mmtr Aug 10, 2020
f0ce304
Update dependency css-loader to v4 (#16771)
renovate[bot] Aug 10, 2020
e711bda
Update dependency sass-loader to v9.0.3 (#16769)
renovate[bot] Aug 10, 2020
f75e498
add email marketing consent field
Aug 5, 2020
1ebef75
remove the conditional text
Aug 6, 2020
c170c7c
add the consent field to the contact from in preview and live.
Aug 6, 2020
2f6808e
Add default values
Aug 10, 2020
3cb9b52
Add news letter variation
Aug 10, 2020
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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ matrix:
- name: "PHP Nightly"
- name: "Spell check Markdown files"
- name: "Code Coverage"
- name: "E2E tests"
- name: "E2E tests with latest Gutenberg"

cache:
Expand Down
2 changes: 1 addition & 1 deletion class.jetpack-plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Jetpack_Plan {
),
'supports' => array(
'akismet',
'donations',
'recurring-payments',
),
),
Expand All @@ -58,6 +57,7 @@ class Jetpack_Plan {
'value_bundle-2y',
),
'supports' => array(
'donations',
'simple-payments',
'vaultpress',
'videopress',
Expand Down
5 changes: 5 additions & 0 deletions class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class Jetpack {
'All in One SEO Pack Pro' => 'all-in-one-seo-pack-pro/all_in_one_seo_pack.php',
'The SEO Framework' => 'autodescription/autodescription.php',
'Rank Math' => 'seo-by-rank-math/rank-math.php',
'Slim SEO' => 'slim-seo/slim-seo.php',
),
'verification-tools' => array(
'WordPress SEO by Yoast' => 'wordpress-seo/wp-seo.php',
Expand All @@ -220,6 +221,7 @@ class Jetpack {
'All in One SEO Pack Pro' => 'all-in-one-seo-pack-pro/all_in_one_seo_pack.php',
'The SEO Framework' => 'autodescription/autodescription.php',
'Rank Math' => 'seo-by-rank-math/rank-math.php',
'Slim SEO' => 'slim-seo/slim-seo.php',
),
'widget-visibility' => array(
'Widget Logic' => 'widget-logic/widget_logic.php',
Expand All @@ -242,6 +244,7 @@ class Jetpack {
'XML Sitemaps' => 'xml-sitemaps/xml-sitemaps.php',
'MSM Sitemaps' => 'msm-sitemap/msm-sitemap.php',
'Rank Math' => 'seo-by-rank-math/rank-math.php',
'Slim SEO' => 'slim-seo/slim-seo.php',
),
'lazy-images' => array(
'Lazy Load' => 'lazy-load/lazy-load.php',
Expand Down Expand Up @@ -310,6 +313,7 @@ class Jetpack {
'wp-fb-share-like-button/wp_fb_share-like_widget.php', // WP Facebook Like Button
'open-graph-metabox/open-graph-metabox.php', // Open Graph Metabox
'seo-by-rank-math/rank-math.php', // Rank Math.
'slim-seo/slim-seo.php', // Slim SEO
);

/**
Expand All @@ -328,6 +332,7 @@ class Jetpack {
'wp-to-twitter/wp-to-twitter.php', // WP to Twitter
'wp-twitter-cards/twitter_cards.php', // WP Twitter Cards
'seo-by-rank-math/rank-math.php', // Rank Math.
'slim-seo/slim-seo.php', // Slim SEO
);

/**
Expand Down
3 changes: 3 additions & 0 deletions docker/mu-plugins/avoid-plugin-deletion.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ function jetpack_docker_disable_delete_plugin( $plugin_file ) {
*/
function jetpack_docker_disable_plugin_update( $plugins ) {
global $jetpack_docker_avoided_plugins;
if ( ! is_array( $jetpack_docker_avoided_plugins ) ) {
return $plugins;
}
foreach ( $jetpack_docker_avoided_plugins as $avoided_plugin ) {
if ( isset( $plugins->response[ $avoided_plugin ] ) ) {
unset( $plugins->response[ $avoided_plugin ] );
Expand Down
73 changes: 73 additions & 0 deletions extensions/blocks/contact-form/components/jetpack-field-consent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* External dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import { BaseControl, ExternalLink, PanelBody, SelectControl } from '@wordpress/components';
import { InspectorControls } from '@wordpress/block-editor';
import { withInstanceId } from '@wordpress/compose';

/**
* Internal dependencies
*/
import JetpackFieldLabel from './jetpack-field-label';
import JetpackFieldControls from './jetpack-field-controls';

const JetpackFieldConsent = ( {
id,
instanceId,
required,
width,
consentType,
implicitConsentMessage,
explicitConsentMessage,
setAttributes,
} ) => {
return (
<BaseControl
id={ `jetpack-field-consent-${ instanceId }` }
className="jetpack-field jetpack-field-consent"
label={
<>
{ consentType === 'explicit' && (
<input className="jetpack-field-consent__checkbox" type="checkbox" disabled />
) }
<JetpackFieldLabel
required={ required }
label={
{
implicit: implicitConsentMessage,
explicit: explicitConsentMessage,
}[ consentType ] ?? ''
}
setAttributes={ setAttributes }
labelFieldName={ `${ consentType }ConsentMessage` }
placeholder={ sprintf( __( 'Add %s consent message…', 'jetpack' ), consentType ) }
/>
<JetpackFieldControls
id={ id }
required={ required }
width={ width }
setAttributes={ setAttributes }
/>
<InspectorControls>
<PanelBody title={ __( 'Consent Settings', 'jetpack' ) }>
<BaseControl>
<SelectControl
label={ __( 'Permission to email', 'jetpack' ) }
value={ consentType }
options={ [
{ label: __( 'Mention that you can email', 'jetpack' ), value: 'implicit' },
{ label: __( 'Add a privacy checkbox', 'jetpack' ), value: 'explicit' },
] }
onChange={ value => setAttributes( { consentType: value } ) }
/>
</BaseControl>
</PanelBody>
</InspectorControls>
</>
}
/>
);
};

export default withInstanceId( JetpackFieldConsent );
11 changes: 9 additions & 2 deletions extensions/blocks/contact-form/components/jetpack-field-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
import { __ } from '@wordpress/i18n';
import { RichText } from '@wordpress/block-editor';

const JetpackFieldLabel = ( { setAttributes, label, labelFieldName, resetFocus, required } ) => {
const JetpackFieldLabel = ( {
setAttributes,
label,
labelFieldName,
placeholder,
resetFocus,
required,
} ) => {
return (
<div className="jetpack-field-label">
<RichText
Expand All @@ -19,7 +26,7 @@ const JetpackFieldLabel = ( { setAttributes, label, labelFieldName, resetFocus,
}
setAttributes( { label: value } );
} }
placeholder={ __( 'Add label…', 'jetpack' ) }
placeholder={ placeholder ?? __( 'Add label…', 'jetpack' ) }
withoutInteractiveFormatting
allowedFormats={ [ 'core/bold', 'core/italic' ] }
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/**
* External dependencies
*/
import { BaseControl, Button, ExternalLink, PanelBody } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { useCallback, useMemo } from '@wordpress/element';
import { useDispatch, useSelect } from '@wordpress/data';
import { createBlock } from '@wordpress/blocks';

const useInsertConsentBlock = () => {
const selectedBlock = useSelect( select => select( 'core/block-editor' ).getSelectedBlock(), [] );
const { insertBlock } = useDispatch( 'core/block-editor' );

const insertConsentBlock = useCallback( async () => {
const buttonBlockIndex = ( selectedBlock.innerBlocks ?? [] ).findIndex(
( { name } ) => name === 'jetpack/button'
);
if ( buttonBlockIndex === -1 ) {
return;
}

const newConsentBlock = await createBlock( 'jetpack/field-consent' );
await insertBlock( newConsentBlock, buttonBlockIndex, selectedBlock.clientId, false );
}, [ insertBlock, selectedBlock.clientId, selectedBlock.innerBlocks ] );

return { insertConsentBlock };
};

const NoConsentBlockSettings = () => {
const { insertConsentBlock } = useInsertConsentBlock();

return (
<>
<p>
{ __(
'You’re already collecting email contacts. Why not make sure you have permission to email them too?',
'jetpack'
) }
</p>
<Button isSecondary onClick={ insertConsentBlock } style={ { marginBottom: '1em' } }>
{ __( 'Add email permission request', 'jetpack' ) }
</Button>
</>
);
};

const NewsletterIntegrationSettings = () => {
const selectedBlock = useSelect( select => select( 'core/block-editor' ).getSelectedBlock(), [] );

const hasConsentBlock = useMemo(
() => selectedBlock.innerBlocks.some( ( { name } ) => name === 'jetpack/field-consent' ),
[ selectedBlock.innerBlocks ]
);

return (
<PanelBody title={ __( 'Newsletter Integration', 'jetpack' ) } initialOpen={ false }>
<BaseControl>
{ ! hasConsentBlock && <NoConsentBlockSettings /> }
<p>
<em>
{ __(
'To start sending email campaigns, install the Creative Mail plugin for WordPress. ',
'jetpack'
) }
<ExternalLink href="https://wordpress.org/plugins/creative-mail-by-constant-contact/">
{ __( 'Get the plugin now', 'jetpack' ) }
</ExternalLink>
</em>
</p>
</BaseControl>
</PanelBody>
);
};

export default NewsletterIntegrationSettings;
2 changes: 2 additions & 0 deletions extensions/blocks/contact-form/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
import HelpMessage from '../../shared/help-message';
import defaultVariations from './variations';
import CRMConnectionSettings from './components/jetpack-crm-connection-settings';
import NewsletterIntegrationSettings from './components/jetpack-newsletter-integration-settings';
import { isSimpleSite } from '../../shared/site-type-utils';

const ALLOWED_BLOCKS = [
Expand Down Expand Up @@ -323,6 +324,7 @@ function JetpackContactFormEdit( {
{ ! isSimpleSite() && (
<CRMConnectionSettings jetpackCRM={ jetpackCRM } setAttributes={ setAttributes } />
) }
{ ! isSimpleSite() && <NewsletterIntegrationSettings /> }
</InspectorControls>

<div className={ formClassnames }>
Expand Down
31 changes: 19 additions & 12 deletions extensions/blocks/contact-form/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.wp-block-jetpack-contact-form {
.block-editor-block-variation-picker__variations > li {
max-width: none;
width: 85px;
width: 68px;
margin-right: 15px;

.block-editor-block-variation-picker__variation {
Expand Down Expand Up @@ -44,7 +44,7 @@
flex: 0 0 75%;
}

&[data-type="jetpack/field-checkbox"] {
&[data-type="jetpack/field-checkbox"], &[data-type="jetpack/field-consent"] {
align-self: center;
}
}
Expand Down Expand Up @@ -180,6 +180,11 @@ input.components-text-control__input {
margin: 3px 5px 0 0;
}

.jetpack-field-consent__checkbox.jetpack-field-consent__checkbox.jetpack-field-consent__checkbox {
float: left;
margin: 0 5px 0 0;
}

// Duplicated to elevate specificity in order to overwrite core styles
.jetpack-field-multiple__list.jetpack-field-multiple__list {
list-style-type: none;
Expand Down Expand Up @@ -245,18 +250,20 @@ input.components-text-control__input {
display: block;
}

.jetpack-field-checkbox .components-base-control__label {
display: flex;
align-items: center;
.jetpack-field-checkbox, .jetpack-field-consent {
.components-base-control__label {
display: flex;
align-items: center;

.jetpack-field-label {
flex-grow:1;
}
.jetpack-field-label {
flex-grow:1;
}

.jetpack-field-label__input {
font-size: 13px;
font-weight: 400;
padding-left: 10px;
.jetpack-field-label__input {
font-size: 13px;
font-weight: 400;
padding-left: 10px;
}
}
}

Expand Down
Loading