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

364 add the integration card for google site kit #21946

Merged
merged 30 commits into from
Jan 24, 2025

Conversation

vraja-pro
Copy link
Contributor

@vraja-pro vraja-pro commented Jan 3, 2025

Context

  • We want to add the integration card for the GSK without the consent modal since the design for the modal is not final yet. There is a separate issue for the modal.

Summary

This PR can be summarized in the following changelog entry:

  • Removes "New" badges from the integration page.
  • Enables translation for the "Learn more" in the integration cards.
  • Adds unreleased integration card for Google Site Kit.
  • Adds link params to the learn more and card headers links.

Relevant technical choices:

  • Moved the check for is premium from the window object to a function. That way it's not running on import, also better for testing.
  • Moved elementor, jetpack and google site kit conditionals to construct, and mocked the response in the test, that also fixed the tests that were failing when running in a separate process.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Go to Yoast integrations page, check you no longer see "New" badges on the cards.
  • Check you don't see a card for Google Site Kit (GSK)
  • Enable the feature flag by adding this code ( use Snippets plugin or add to wp-config.php ):
define( 'YOAST_SEO_GOOGLE_SITE_KIT_FEATURE', true );
  • Check you now see a card for Google Site Kit (GSK) on Yoast SEO -> Integrations
  • Without GSK installed, go to integrations page and check you see a card in the recommended integrations section:
    • Check the card header is greyed out.
    • Check it has a button to install GSK in the card footer.
    • Click on the install button and check the plugin is installed and you are redirected to activate GSK.
  • With GSK installed but not activate go back to Yoast integrations page
    • Check the card header is greyed out.
    • Check you see a button on GSK to activate in the card's footer.
    • Click on the "activate" button and check you are redirected to the plugins page where it is automatically activated.
  • With GSK activated but not configured go back to Yoast integrations page
    • Check the card header is greyed out.
    • There is a button to set up GSK in the card's footer.
    • Click on the button and check you re redirected to GSK settings page.
  • With GSK configured go back to Yoast integrations page
    • Check the card header is greyed out.
    • Check the button is to connect in the card's footer
    • Click on the button and check you see a modal ( design for the modal would be added in a later stage )
  • With GSK configured and connected.
    • Apply the following patch integration-active-gsk.patch
    • Check the card header is not greyed out.
    • Go back to integration page and check that the status is "Successfully connected" with a green check mark
    • Check you have a white button to disconnect bellow the status.
    • [ ]Deactivate the GSK and check you get the "activate" button label and greyed header from before.
  • Disable Yoast SEO Premium and check you see upsell button on the mastodon and "easy digital downloads" cards.
  • Enable Yoast SEO Premium and check you don't see the upsell buttons on those cards.
  • Check all the cards header links and the learn more links have link params.

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes Figure out how we can detect if Site Kit is configured and add the integration card

@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Jan 3, 2025
@vraja-pro vraja-pro force-pushed the 364-add-the-integration-card-for-google-site-kit branch from c304683 to 4c3bbdd Compare January 6, 2025 07:23
@coveralls
Copy link

coveralls commented Jan 6, 2025

Pull Request Test Coverage Report for Build 1cff656fe99978e6cdf813a8e4018c9fc7928564

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 53 of 58 (91.38%) changed or added relevant lines in 6 files are covered.
  • 699 unchanged lines in 54 files lost coverage.
  • Overall coverage increased (+20.1%) to 54.702%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/integrations-page/recommended-integrations.js 0 5 0.0%
Files with Coverage Reduction New Missed Lines %
packages/components/src/Logo.js 1 50.0%
packages/js/src/block-editor.js 1 0.0%
packages/js/src/classic-editor.js 1 0.0%
packages/js/src/filter-explanation.js 1 0.0%
packages/js/src/redux/reducers/editorContext.js 1 0.0%
packages/js/src/settings/routes/templates/taxonomy.js 1 0.0%
packages/js/src/workouts/components/WorkoutsPage.js 1 0.0%
packages/js/src/components/IntlProvider.js 2 0.0%
packages/js/src/components/modals/WincherNoTrackedKeyphrasesAlert.js 2 0.0%
packages/js/src/components/WincherPostPublish.js 2 0.0%
Totals Coverage Status
Change from base Build 870b6c8a8759df89487e8bbc077b82dd90e470a4: 20.1%
Covered Lines: 30169
Relevant Lines: 55523

💛 - Coveralls

Copy link
Member

@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

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

CR 🏗️

About the changelog entries

Removes "New" badges from the integration page.

That is for sure user-facing. Whether that is worth mentioning is another. But I don't see any decisions, so I mention it.

Enables translation for the "Learn more" in the integration cards.

Isn't that a bugfix? E.g. something like

  • Fixes a bug where Learn more on the integrations page would not be translated.

Adds unreleased integration card for Google Site Kit.
Unreleased? You mean behind feature flag.

Copy link
Member

@igorschoester igorschoester left a comment

Choose a reason for hiding this comment

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

CR/AT 🏗️

@vraja-pro vraja-pro force-pushed the 364-add-the-integration-card-for-google-site-kit branch from dd67b6e to 037e76c Compare January 21, 2025 12:32
Comment on lines 24 to 26
const linkParams = useSelect( select => select( "yoast-seo/settings" ).selectLinkParams(), [] );
const learnMoreLink = addQueryArgs( integration.learnMoreLink, linkParams );
const logoLink = addQueryArgs( integration.logoLink, linkParams );
Copy link
Member

Choose a reason for hiding this comment

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

  • The selectLink selector could do the query params adding for you. With the benefit of caching
  • This store actually has a condition (and probably more in PHP) before it is created. Are we sure that we can rely on that?

Copy link
Contributor Author

@vraja-pro vraja-pro Jan 22, 2025

Choose a reason for hiding this comment

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

This store is loaded for admin pages, so i think we can rely on that ( link params is used for notices that appear across all admin pages.

Copy link
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

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

CR + ACC 👍 We decided to wait with abstracting the sitekit config setting to another PR.

@thijsoo thijsoo added this to the 24.4 milestone Jan 24, 2025
@thijsoo thijsoo merged commit 765f7f7 into trunk Jan 24, 2025
36 checks passed
@thijsoo thijsoo deleted the 364-add-the-integration-card-for-google-site-kit branch January 24, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants