Skip to content

Implement permanent dismiss Site Kit setup widget#22040

Merged
vraja-pro merged 4 commits intotrunkfrom
450-implement-the-permanently-dismiss-in-the-site-kit-setup-widget
Feb 14, 2025
Merged

Implement permanent dismiss Site Kit setup widget#22040
vraja-pro merged 4 commits intotrunkfrom
450-implement-the-permanently-dismiss-in-the-site-kit-setup-widget

Conversation

@igorschoester
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester commented Feb 13, 2025

Context

  • Decision on when to hide etc, see the Specific behaviors section
  • To be implemented in another PR: adding the widgets on granting consent

Summary

This PR can be summarized in the following changelog entry:

  • Implements Site Kit setup widget' Remove permanently functionality.

Relevant technical choices:

  • adds the current value to the site kit configuration
  • don't show the setup widget if permanently dismissed
  • clicking on "Got it!" is non-permanent: so if a user disconnects again, the setup widget should return
  • clicking on "Got it!" should still keep hiding the widget on tab change: so I added a cheat in the widget factory

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Tip

To restore widget after permanently dismissal update option wpseo value of site_kit_configuration_permanently_dismissed to 0.
Or use the following in site-kit.php to_array to undo connected and/or dismissed:

$this->site_kit_consent_repository->set_site_kit_consent( false );
$this->permanently_dismissed_site_kit_configuration_repository->set_site_kit_configuration_dismissal( false );
  • Enable google site kit feature flag.
define( 'YOAST_SEO_GOOGLE_SITE_KIT_FEATURE', true );
  • Go to the dashboard on Yoast SEO->General.
  • Make sure site kit is not connected ( if connected, you can disconnect from integrations page ).
  • Once the site kit set up widget is visible again on the dashboard, connect site kit and click on "Got it".
  • Navigate to the First time configuration tab (do not refresh the page) and return to the dashboard.
  • Check that site kit set up widget is not visible.
  • Disconnect site kit integration on the integration page.
  • Go back to the dashboard and click on the three dots menu and dismiss permanently
  • Navigate to other tabs and return to dashboard
  • Check that the set up widget is not visible.
  • Refresh and check it is still not visible.

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 https://github.com/Yoast/reserved-tasks/issues/450

* adds the current value to the site kit configuration
* don't show the setup widget if permanently dismissed
* clicking on "Got it!" is non-permanent: so if a user disconnects again, the setup widget should return
* clicking on "Got it!" should still keep hiding the widget on tab change: so I added a cheat in the widget factory
@igorschoester igorschoester added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Feb 13, 2025
@igorschoester igorschoester marked this pull request as ready for review February 13, 2025 16:19
@vraja-pro vraja-pro force-pushed the 450-implement-the-permanently-dismiss-in-the-site-kit-setup-widget branch from bd60ed9 to a80e499 Compare February 14, 2025 10:28
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 14, 2025

Pull Request Test Coverage Report for Build b121ac3fc643ff9228c686d499e51803d56ccebd

Details

  • 6 of 22 (27.27%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall first build on 450-implement-the-permanently-dismiss-in-the-site-kit-setup-widget at 42.455%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/dashboard/services/data-provider.js 0 1 0.0%
packages/js/src/general/initialize.js 0 1 0.0%
packages/js/src/dashboard/services/widget-factory.js 0 2 0.0%
src/dashboard/infrastructure/integrations/site-kit.php 0 12 0.0%
Totals Coverage Status
Change from base Build 087732f2047ad5cf21353460a2a6fe9cb60de842: 42.5%
Covered Lines: 20922
Relevant Lines: 46121

💛 - Coveralls

@vraja-pro vraja-pro added this to the 24.6 milestone Feb 14, 2025
@vraja-pro
Copy link
Copy Markdown
Contributor

CR & AC ✅

@vraja-pro vraja-pro merged commit 711656c into trunk Feb 14, 2025
@vraja-pro vraja-pro deleted the 450-implement-the-permanently-dismiss-in-the-site-kit-setup-widget branch February 14, 2025 12:38
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.

3 participants