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

JetpackFooter: add About, Privacy and Terms links #31627

Merged
merged 20 commits into from
Jul 20, 2023

Conversation

monsieur-z
Copy link
Contributor

@monsieur-z monsieur-z commented Jun 28, 2023

Fixes #31598

Proposed changes:

The JetpackFooter component is used in the Jetpack flagship plugin and many other Jetpack plugins. In the former, it contains links to about, TOS, and privacy pages that are not included in the latter, though they can provide value in those instances as well. This PR integrates the About, Terms, and Privacy links into the JetpackFooter component directly.

It also removes from the props the URL to which the Automattic logo links to since all instances using JetpackFooter would pass the same URL.

In more detail:

  • it makes the About, Terms, and Privacy links part of JetpackFooter
  • it passes click handlers to these links as props of JetpackFooter
  • it removes the prop a8cLogoHref from JetpackFooter
  • when applicable, it links the Privacy and An Automattic Airline links to internal pages
  • makes the Jetpack logo on the My Jetpack footer match the size of the same logo in other sections

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

p1687876101340969-slack-C01264051NE
p1687874518864269-slack-C02TQF5VAJD

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

No.

Testing instructions:

  • Spin up a test site with this branch
  • Make sure your site is not connected to Jetpack
  • Visit the Jetpack section
  • In the footer, check the following links:
    • Jetpack: https://jetpack.com/
    • About: https://jetpack.com/about/
    • Privacy: https://automattic.com/privacy/
    • Terms: https://wordpress.com/tos/
    • An Automattic Airline: https://automattic.com/about/
  • Visit the My Jetpack section
    • In the footer, check the following links:
    • Jetpack: https://jetpack.com/
    • About: https://jetpack.com/about/
    • Privacy: https://automattic.com/privacy/
    • Terms: https://wordpress.com/tos/
    • An Automattic Airline: https://automattic.com/about/
  • Connect your site to Jetpack
  • In the footer, check the following links:
    • Jetpack: https://jetpack.com/
    • About: https://jetpack.com/about/
    • Privacy: /wp-admin/admin.php?page=jetpack#/privacy
    • Terms: https://wordpress.com/tos/
    • An Automattic Airline: /wp-admin/admin.php?page=jetpack_about

@github-actions github-actions bot added [JS Package] Components [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin [Status] In Progress [Tests] Includes Tests Admin Page React-powered dashboard under the Jetpack menu RNA labels Jun 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2023

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.
  • ⚠️ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ 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 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

  • Next scheduled release: August 1, 2023.
  • Scheduled code freeze: July 25, 2023.

Social plugin:

  • Next scheduled release: August 1, 2023.
  • Scheduled code freeze: July 25, 2023.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2023

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 WordPress.com Simple 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 > Jetpack and enable the add/jetpack-footer-generic-links branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack add/jetpack-footer-generic-links
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/jetpack-footer-generic-links
    

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

@monsieur-z monsieur-z force-pushed the add/jetpack-footer-generic-links branch from a2107bf to 92bf77b Compare June 29, 2023 13:17
@monsieur-z monsieur-z changed the title Add/jetpack footer generic links JetpackFooter: add About, Privacy and Terms links Jun 29, 2023
@github-actions github-actions bot added [Package] Ad aka WordAds [Package] Search Contains core Search functionality for Jetpack and Search plugins Docs labels Jun 29, 2023
a8cLogoHref={ a8cLogoHref }
moduleNameHref={ moduleNameHref }
/>
<JetpackFooter moduleName={ moduleName } moduleNameHref={ moduleNameHref } />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

href of the Automattic logo is set in JetpackFooter directly.

@monsieur-z monsieur-z marked this pull request as ready for review June 29, 2023 15:35
@monsieur-z monsieur-z force-pushed the add/jetpack-footer-generic-links branch from c6b92e6 to 53250cb Compare July 3, 2023 14:02
import { Icon, external } from '@wordpress/icons';
import classnames from 'classnames';
import React from 'react';
import { getRedirectUrl } from '../..';
import { STORE_ID as CONNECTION_STORE_ID } from '../../../../js-packages/connection/state/store';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Importing from @automattic/jetpack-connection directly made the build fail because of some circular dependency. This import seems fine, but let me know if there's a better approach. Hardcoding the store id seemed error-prone.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this may prove problematic in the version of the package that we ship to npm.

Couldn't we bring in that data as a new component prop, to keep the component a bit simpler?

Hardcoding the store id seemed error-prone.

That'd be my next suggestion, with a comment in the original file mentioning that it's copied there, but I'm not a regular component maintainer so I'll let others weigh in on this. :)

Copy link
Member

Choose a reason for hiding this comment

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

Now that the connection package js is loaded externally and not bundled into any plugin after #38877, this import here can be problematic and result in duplicate store registration.

We should fix this in a better way. A few options we have:

  • Let the consumer component pass the needed connection related information
  • Make the component composable, which means the consumer component passes in the final output without this component here knowing anything about the connection data

Copy link
Member

@manzoorwanijk manzoorwanijk Sep 5, 2024

Choose a reason for hiding this comment

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

Another solution would be to use the data from the scrip-data package as explained in this thread.

Copy link
Member

Choose a reason for hiding this comment

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

That said, composability is still better because that will not make the component dependent upon anything related to jetpack connection or its logic.

);

const areAdminLinksEnabled =
siteAdminUrl &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally, siteAdminUrl would be retrieved from an initial state, as is connectedPlugins. I haven't found a way of retrieving basic site information that works across packages yet.

Copy link
Member

Choose a reason for hiding this comment

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

We now have getAdminUrl and other such utils available in @automattic/jetpack-script-data

import { getAdminUrl, getJetpackAdminPageUrl } from '@automattic/jetpack-script-data';

const aboutPageUrl = getAdminUrl( 'admin.php?page=jetpack_about' );

const privacyPageUrl = getJetpackAdminPageUrl( '#/privacy' );

Copy link
Member

Choose a reason for hiding this comment

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

Likewise, you can use the same package to get the list of connected plugins and the status.

import { getScriptData } from '@automattic/jetpack-script-data';

const { connectedPlugins, connectionStatus } = getScriptData().connection;

@monsieur-z monsieur-z force-pushed the add/jetpack-footer-generic-links branch from 3a22723 to 9e01c1b Compare July 3, 2023 15:24
@andrii-lysenko
Copy link
Contributor

@jeherve the about link should be fixed now. As per STORE_ID import I don't see a problem there, and passing it as a parameter also might be not ideal as one of the renders of JetpackFooter is from AdminPage which is also in same package. We would then need to pass it through additional component. However, I'm also not an expert in components and may be there's some other ways.

@bindlegirl bindlegirl added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jul 13, 2023
@andrii-lysenko andrii-lysenko added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jul 13, 2023
@bindlegirl
Copy link
Contributor

The logged-in About link on the Jetpack dashboard (and other) pages shows up as an external link, although it's not. However, it loads the About page in a new tab, which differs from the Terms and Airline pages.

There are inconsistencies between the MyJetpack footer and other pages. This is what I see:

  1. Logged out About link on the Jetpack page will load https://jetpack.com/about/?site=nutritious-fairy.jurassic.ninja and MyJetpack https://jetpack.com/about
  2. Logged in About link on the Jetpack page will load /wp-admin/admin.php?page=jetpack_about and MyJetpack will load https://jetpack.com/about/

Privacy on connected MyJetpack is still an external link.

I'm unsure if aligning these should be a part of another PR.

@kraftbj
Copy link
Contributor

kraftbj commented Jul 19, 2023

I'm unsure if aligning these should be a part of another PR.

Yeah, let's land this and open an issue to track the variations.

@andrii-lysenko
Copy link
Contributor

@bindlegirl I think the idea of shipping as is, but, creating a follow up issue sounds as a good idea to me.
@jeherve do you want to take a second look?

@bindlegirl
Copy link
Contributor

Sounds good to me 👍
Other than noted details, the PR looks good

bindlegirl
bindlegirl previously approved these changes Jul 19, 2023
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jul 20, 2023
@jeherve jeherve enabled auto-merge (squash) July 20, 2023 11:31
@jeherve jeherve merged commit 204cd1b into trunk Jul 20, 2023
@jeherve jeherve deleted the add/jetpack-footer-generic-links branch July 20, 2023 11:57
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu Docs [JS Package] Components [Package] Ad aka WordAds [Package] My Jetpack [Package] Search Contains core Search functionality for Jetpack and Search plugins [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin RNA [Tests] Includes Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

My Jetpack: Apply new footer
6 participants