Skip to content

Forms: Add integrations status to block sidebar #43178

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

Merged
merged 18 commits into from
Apr 23, 2025

Conversation

edanzer
Copy link
Contributor

@edanzer edanzer commented Apr 21, 2025

Proposed changes:

Adds an integration icon to the Manage Integrations panel when an integration is enabled for a particular form. This is based on designs at p1HpG7-wqy-p2

form-status-icon

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

P2: p1HpG7-wqy-p2

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

No.

Testing instructions:

  • Add a form to a page
  • On the block sidebar, in the Integrations panel, confirm you see icons for any integrations that are active and enabled for this particular form.
  • Try deactivating Akismet or toggling off the Jetpack CRM connection and confirm status correctly updates on the sidebar.

@edanzer edanzer added [Status] In Progress [Type] Task [Pri] Normal [Block] Contact Form Form block (also see Contact Form label) [Package] Forms [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. labels Apr 21, 2025
@edanzer edanzer self-assigned this Apr 21, 2025
Copy link
Contributor

github-actions bot commented Apr 21, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the add/form-block-sidebar-icons branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/form-block-sidebar-icons

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

Copy link

jp-launch-control bot commented Apr 21, 2025

Code Coverage Summary

1 file is newly checked for coverage.

File Coverage
projects/packages/forms/src/blocks/contact-form/components/jetpack-integrations-modal/active-integrations/index.js 0/16 (0.00%) 💔

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

@edanzer edanzer force-pushed the add/form-block-sidebar-icons branch 2 times, most recently from aac437d to d2d1094 Compare April 22, 2025 18:59
@edanzer edanzer force-pushed the add/form-block-sidebar-icons branch from d2d1094 to 9734ea7 Compare April 22, 2025 22:34
@@ -13,7 +13,7 @@ const AkismetCard = ( { isExpanded, onToggle, data, refreshStatus } ) => {
const cardData = {
...data,
showHeaderToggle: true,
headerToggleValue: data?.isConnected,
headerToggleValue: akismetActiveWithKey,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is unrelated. It's just a small improvement I saw that didn't warrant it's own PR. We already define akismetActiveWithKey as data.isConnected further up in the component, and use it elsewhere. For consistency, we should use it here.

break;
}
return acc;
}, [] );
Copy link
Contributor Author

@edanzer edanzer Apr 23, 2025

Choose a reason for hiding this comment

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

The reduce method takes in the list of integrations, and returns:
(a) just those that are active/enabled for this form and
(b) includes the icon so it can be output below
(c) the tooltip text for each active integration

@edanzer edanzer marked this pull request as ready for review April 23, 2025 00:22
@edanzer edanzer requested review from ilonagl and a team April 23, 2025 00:22
ilonagl
ilonagl previously approved these changes Apr 23, 2025
Copy link

@ilonagl ilonagl 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 great! Thanks for working on this, Erick!

Could we add on-hover tooltips that would say "Connected – sending data" or something similar? Thanks!

Screenshot 2025-04-23 at 09 49 03

@@ -0,0 +1,19 @@
.active-integrations {
Copy link
Member

@simison simison Apr 23, 2025

Choose a reason for hiding this comment

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

Since this will end up at global scope in WP with all kinds of other plugins, let's have something less generic. Basically just prefix with jetpack_ or jetpack_forms_ :-)

@simison
Copy link
Member

simison commented Apr 23, 2025

@ilonagl — Should we add the product name to the tooltip?

Jetpack CRM can be confusing since it's just the Jetpack logo (perhaps we have CRM-specific logo somewhere?)

@ilonagl
Copy link

ilonagl commented Apr 23, 2025

@ilonagl — Should we add the product name to the tooltip?

Yes, that would be good! E.g., "Jetpack CRM connected - sending data"; I do wonder if we need the 'sending data' piece if we include the product name? I don't want this to be too long; it does add some reassurance that it's working. Thoughts?

@ilonagl
Copy link

ilonagl commented Apr 23, 2025

perhaps we have CRM-specific logo somewhere?

No, not really. It acts as all of the Jetpack plugins: jetpack logo + name, or general icon + jetpack logo.

Screenshot 2025-04-23 at 16 09 59 Screenshot 2025-04-23 at 16 10 23

https://wordpress.org/plugins/zero-bs-crm/

@simison
Copy link
Member

simison commented Apr 23, 2025

That's tricky. 🤔 Eventually, we'll have integrations to other Jetpack functionality like Newsletters, Payments, so we'll need to solve it somehow. Likely would mean adding labels?

@ilonagl
Copy link

ilonagl commented Apr 23, 2025

Likely would mean adding labels?

Full name (e.g., Jetpack Newsletters connected) in the on-hover tooltip would be the easiest solution for now. I'll think about other ways, but i doubt we will have specific for each product.

@edanzer
Copy link
Contributor Author

edanzer commented Apr 23, 2025

@simison @ilonagl - I've added tooltips. For now, looks like this:

akismet-connected-tooltip

I used "Akismet is connected for this form" and "Jetpack CRM is connected for this form". Those are big longer but I was thinking it's clear to be specific that the integration is (a) generally connected and (b) active for the current form. If we'd like that to be shorter let me know. Happy to adjust it.

@simison I also namespaced the CSS classes.

@edanzer edanzer merged commit c8d46b0 into trunk Apr 23, 2025
66 of 67 checks passed
@edanzer edanzer deleted the add/form-block-sidebar-icons branch April 23, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Package] Forms [Pri] Normal [Type] Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants