Skip to content

Conversation

@jeherve
Copy link
Member

@jeherve jeherve commented Aug 11, 2020

This is a replay of #16723 against master as we're running into some rebase problems with the other branch.

Changes proposed in this Pull Request:

This PR extends the form block with some new settings and options:

  • A new consent field you can add to any form:

image

  • A new Newsletter settings panel appearing in the form block sidebar:

image

  • A new newsletter variation you can choose when you create a new form:

image

To do

In follow-up PRs, there are a few additional things we can do:

Jetpack product discussion

  • Internal references:
    • p1HpG7-9NB-p2
    • pbtFPC-GX-p2
    • pbtFPC-H5-p2

Does this pull request change what data or activity we track or use?

  • No

Testing instructions:

test case 1

  1. Go to Posts > Add New
  2. Search for ‘form’.
  3. Select any of the form types
    image

test case 2

  1. Perform test case 1.
  2. Select the form block.
  3. Click on add “add email permission request”.
    image
  4. Select the “Mention that you can email”
    image
  5. See the new implicit “consent” form element is added to your form.
    image
  6. Go to the preview, see the new implicit “consent” form element is added to your form.
    /Todo WIP/
  7. Fill in a form entry, select the consent.
  8. Find the new entry on the feedback page.
    /Todo WIP/

test case 3

  1. Perform test case 1.
  2. Select the form block.
  3. Click on add “add email permission request”.
  4. Select the “Add a privacy checkbox”
    image
  5. See the new explicit “consent” form element is added to your form.
    image
  6. Go to the preview, see the new implicit “consent” form element is added to your form.
    /Todo WIP/
  7. Fill in a form entry, select the consent.
  8. Find the new entry on the feedback page.
    /Todo WIP/

Proposed changelog entry for your changes:

  • TBD

@jeherve jeherve added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Contact Form [Status] Needs Review This PR is ready for review. [Pri] Normal labels Aug 11, 2020
@jeherve jeherve added this to the 8.9 milestone Aug 11, 2020
@jeherve jeherve requested a review from kbrown9 August 11, 2020 16:02
@jeherve jeherve self-assigned this Aug 11, 2020
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello jeherve! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D47965-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@jetpackbot
Copy link
Collaborator

jetpackbot commented Aug 11, 2020

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-16808

Scheduled Jetpack release: September 1, 2020.
Scheduled code freeze: August 25, 2020

Generated by 🚫 dangerJS against 658f03f

Copy link
Member Author

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice start!

Here is a first bit of feedback.


I find it a bit odd that I can still pick the "Required" field even with the implicit option for the consent field:

image


I'm able to customize the text and add extra formatting to the consent text, but that formatting will not appear on the frontend:

image
image

@jeherve
Copy link
Member Author

jeherve commented Aug 11, 2020

cc @reintjanhoiting1

@jeherve jeherve added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Aug 11, 2020
@reintjanhoiting1
Copy link
Contributor

That's a nice start!

Here is a first bit of feedback.

I find it a bit odd that I can still pick the "Required" field even with the implicit option for the consent field:

image

I'm able to customize the text and add extra formatting to the consent text, but that formatting will not appear on the frontend:

image
image

I think we have to log a separate bug for this issue, it's impacting all of the form/field labels.
editor:
image
preview:
image

@jeherve
Copy link
Member Author

jeherve commented Aug 13, 2020

I think we have to log a separate bug for this issue, it's impacting all of the form/field labels.

Good catch. I logged this here: #16822

In our case though, we'd still want to handle the text changes for that field. A change like this:

Screen Recording 2020-08-13 at 11 46 AM

should be reflected on the frontend but it's not at the moment:

image

@jeherve jeherve added [Status] Needs Copy Review Copy has been added. Marketing will be notified for a copy review. and removed [Status] Needs Copy Review Copy has been added. Marketing will be notified for a copy review. labels Aug 13, 2020
@kristastevens
Copy link

Hello, @jeherve, thanks for the ping! I went through the process of creating a new post and adding the newsletter sign-up element to it.

Here are some thoughts I had on copy as I went through the process.

In the first step, I'm presented with a set of options from which to make a selection:
Screen Shot 2020-08-13 at 8 14 02 AM
Instead of "Newsletter Form" I'd suggest "Newsletter Sign-up" to make it clear that as a user, you're adding an element that will allow visitors to sign up for your newsletter, rather than a form which some might infer is something that you would use to build the content of the newsletter itself.

In the next step, I'm presented with the draft form:
Screen Shot 2020-08-13 at 8 27 43 AM

I have a small suggestion to tighten the disclaimer copy:

Original:

By submitting your information, you are granting us permission to email you. You may unsubscribe at any time.

Suggested:

By submitting your information, you're giving us permission to email you. You may unsubscribe at any time.

I'm not sure if the Form Settings copy can be customized for the Newsletter Sign-up, though here are some thoughts:

Screen Shot 2020-08-13 at 8 39 16 AM

The descriptor for a regular form, "A simple way to get feedback from folks visiting your site" might be a little confusing within this context.

Suggest:

This form allows visitors to sign up for your newsletter.

If it's not possible to customize to this degree, another option which fits this scenario is:

A simple way to collect information from folks visiting your site.

For "Email address to send to" within this context, how about:

Suggest:

Receive an email when someone signs up for the newsletter.

For "A new message from your website"

Suggest:

New newsletter subscription!

Thanks again for asking us to have a look! If you have any questions, please let me know!

@jeherve jeherve removed the [Status] Needs Copy Review Copy has been added. Marketing will be notified for a copy review. label Aug 13, 2020
@reintjanhoiting1
Copy link
Contributor

Hello, @jeherve, thanks for the ping! I went through the process of creating a new post and adding the newsletter sign-up element to it.

.....

Thanks again for asking us to have a look! If you have any questions, please let me know!

updated the PR:

image

image

I'm afraid that changing the description of the "form" is a generic text for every form variation.

Thanks for the feedback!

@reintjanhoiting1
Copy link
Contributor

In our case though, we'd still want to handle the text changes for that field. A change like this:

defaultvaluebug

Copy link
Member Author

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works well overall! 👍 I only have some minor remarks left.

Copy link
Member Author

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I think it should be good to merge now!

I can't approve that PR myself since I opened it, so I'll let someone else on the team take a stab at it.

Once this first iteration is merged, and once #16713 is also merged, we should be able to iterate on the settings panel to allow installing the plugin straight from the editor, instead of just linking to it.

@leogermani
Copy link
Contributor

@leogermani
Yes, that is correct. You have to click on the Edit on the Feedback record, that is the only way to see the field, the contact form feature does not offer any UI to view fields in the all Feedback wp-admin page.

About the CSV Export:
The existing export code only exports the "real data". For this feature, the real field is "Consent", and exists in the export:
image

I can't reproduce it. Every time I export the CSV I'm not able to see the consent field.

I've tried different form types and both with the checkbox or just the message. Here are 2 examples:

Captura de Tela 2020-08-18 às 10 38 04

Captura de Tela 2020-08-18 às 10 38 55

Captura de Tela 2020-08-18 às 10 44 46

Captura de Tela 2020-08-18 às 10 45 11

@leogermani leogermani added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Aug 18, 2020
@reintjanhoiting1
Copy link
Contributor

@leogermani i just pushed a commit fixing the CSV export
image

@leogermani
Copy link
Contributor

@leogermani i just pushed a commit fixing the CSV export
image

Thanks, it works now!

As a suggestion, I'd just say it would be awesome to have the Consent information on the Feedback listing in the admin panel.

I can approve the PR as soon as all the tests are passing... I think first thing to do is to update it against master.

@jeherve
Copy link
Member Author

jeherve commented Aug 19, 2020

Looks like this test will need to be updated:

1) WP_Test_Grunion_Contact_Form::test_personal_data_exporter
has total expected data keys
Failed asserting that 9 is identical to 8.
wp-content/plugins/jetpack/tests/php/modules/contact-form/test-class.grunion-contact-form.php:1405

@jeherve jeherve added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Aug 19, 2020
@reintjanhoiting1
Copy link
Contributor

The unit tests are fixed, And I notice that the codeclimate/diff-coverage — 10% (80% threshold) is not passing yet. It looks like it's not passing on the code that was already created a long time ago, do you have any suggestions for this?

@jeherve
Copy link
Member Author

jeherve commented Aug 19, 2020

It looks like it's not passing on the code that was already created a long time ago, do you have any suggestions for this?

That is something we can ignore in this case, since we're touching existing code.

Copy link
Contributor

@leogermani leogermani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it looks like we are good to go! :)

@leogermani leogermani added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Aug 19, 2020
@jeherve jeherve merged commit de24da3 into master Aug 19, 2020
@jeherve jeherve deleted the add/form-consent-field branch August 19, 2020 14:32
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Aug 19, 2020
@atanas-dev
Copy link
Member

A bit late but here's how my testing went:

  • Got through the test cases with no issues.
  • Switched the type of the consent block, made sure the Newsletter Integration settings section of the form block updated and provided the ability to add a new consent field now that one is not present as expected.
  • Exported feedback entries to CSV, confirming all entries are present and contain the consent value (with an explicit consent field, implicit consent field and no consent field).
  • Installing the Creative Email plugin via the CTA at the top of the feedback page worked seamlessly.
  • Contact Synchronization does not seem to list Jetpack but this may be simply because the required changes have not been published on the Creative Email app side.

@jeherve
Copy link
Member Author

jeherve commented Aug 19, 2020

r212360-wpcom

davidlonjon added a commit that referenced this pull request Aug 20, 2020
* master: (23 commits)
  Premium Blocks: set blocks availability (#16898)
  Compat Package: Fix method declaration compatibility (#16900)
  Jetpack Dashboard: More meaningful error notices. (#16883)
  Connection REST API: Unit test for the `remote_authorize` request. (#16879)
  use blog token to request jetpack.updateBlog (#16698)
  Improve Story block media loading (#16663)
  Simplify error notices for broken connections (#16655)
  Use new heartbeat package (#16285)
  wrap-paid-block: remove component. deprecated. (#16895)
  Social Previews: improve preview description handling (#16889)
  Stats module use blog token (#16727)
  Form Block: add a new Consent Field, a new Newsletter setting, and a new newsletter variation (#16808)
  AAG: Backup card, fall back to VP content in case of /rewind API error. (#16867)
  Donations: Fix dependencies (#16892)
  Creative Mail: update option to lowercase (#16861)
  Premium Blocks: Implement the new design (#16611)
  Requests to Stats CSV use the blog token (#16716)
  Update spacing around sharing buttons to avoid no bottom margin below the customize link. (#16811)
  Jetpack SSO: Cleaning up the `requestNonce` API request. (#16830)
  Donations: Update plans when currency changes (#16844)
  ...
jeherve added a commit that referenced this pull request Aug 25, 2020
pereirinha pushed a commit that referenced this pull request Sep 10, 2020
…setting, and a new newsletter variation (#16808)

Co-authored-by: Reint-Jan Hoiting <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Contact Form [Pri] Normal [Status] Needs Tracks Review Added/removed/modified a tracks event. Touches WP.com Files [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants