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

Hides AI buttons when the AI feature is disabled #21503

Conversation

vraja-pro
Copy link
Contributor

@vraja-pro vraja-pro commented Jul 25, 2024

Context

  • We do not want to display the AI Optimize buttons when the AI feature as a whole has been disabled.

Summary

This PR can be summarized in the following changelog entry:

  • Fixes an unreleased bug where the AI buttons would be shown when the AI feature as a whole was disabled.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Enable Yoast SEO premium.
  • Go to the Yoast SEO settings and disable the AI feature.
  • Edit a post with focus keyphrase and content that doesn't contain it.
  • Go to the Premium SEO analysis.
  • Check you don't see the Sparkle AI button.
  • Go back to Yoast SEO settings and enable to the AI feature.
  • Edit the same post and check you see the AI sparkle button.

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:

  • No further impact than disabling the buttons.

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 Major-AI-Sparkle buttons display even if AI feature is off in Yoast Settings

@vraja-pro vraja-pro added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Jul 25, 2024
@vraja-pro vraja-pro force-pushed the 1739-major-ai-sparkle-buttons-display-even-if-ai-feature-is-off-in-yoast-settings branch from e4cdea7 to 63a230b Compare July 26, 2024 10:12
@coveralls
Copy link

coveralls commented Jul 26, 2024

Pull Request Test Coverage Report for Build 1193e9bb4e6fa8da3eb776c7cd592d06ba18cc02

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.006%) to 54.066%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/js/src/components/contentAnalysis/SeoAnalysis.js 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
inc/class-wpseo-utils.php 1 43.06%
packages/js/src/components/contentAnalysis/SeoAnalysis.js 1 0.0%
Totals Coverage Status
Change from base Build bf059a6a0be2b2af74fb1d5fe96ca8bb1f763951: -0.006%
Covered Lines: 29390
Relevant Lines: 54672

💛 - Coveralls

@vraja-pro vraja-pro added this to the 23.2 milestone Jul 26, 2024
@mhkuu mhkuu changed the title Hide Ai sparkle button when ai feature is disabled Hides AI buttons when the AI feature is disabled Jul 26, 2024
Copy link
Contributor

@mhkuu mhkuu left a comment

Choose a reason for hiding this comment

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

CR: Nice solution! 🙌 I saw one possibility for improving the code: we can add the preference selection to withSelect and by doing so remove a linting error. I've gone ahead and updated some more JSDoc while add it. And I also decreased the max-warnings setting in package.json 👍

ACC: Works! 🚀

@mhkuu mhkuu merged commit d3f9379 into release/23.2 Jul 26, 2024
33 checks passed
@mhkuu mhkuu deleted the 1739-major-ai-sparkle-buttons-display-even-if-ai-feature-is-off-in-yoast-settings branch July 26, 2024 13:41
@mhkuu mhkuu added the innovation Innovative issue. Relating to performance, memory or data-flow. label Sep 6, 2024
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 innovation Innovative issue. Relating to performance, memory or data-flow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants