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

Add introductions seen route #20791

Conversation

igorschoester
Copy link
Member

Context

  • Make it possible to mark an introduction as seen from JS (i.e. create a route).

Summary

This PR can be summarized in the following changelog entry:

  • Adds an introductions seen route.

Relevant technical choices:

  • Rename name to id as that seems like a better name for a "unique name"
  • Use [\w-]+ matcher for the introduction ID in the route URL, as opposed to a query param without such regex limits. Mainly because this is more REST style

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Deactivate Premium, instructions for with Premium are in the Premium PR
  • Either test with Premium or find a way to send a POST request with the right credentials (nonce + cookie) and:
    • Send a request to /wp-json/yoast/v1/introductions/INTRO_ID/seen where INTRO_ID is the ID of your introduction
    • You can add a param is_seen to indicate whether you have seen it or not, if you skip this it will default to seen
    • You can verify the route worked by checking the user metadata: _yoast_wpseo_introductions

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 (Block/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:

  • Introductions mechanism, though the only introductions still are the AI ones: upsell and Premium one. So all tests should be included in these features.

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.

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/141

Interface to access whether the user has seen an introduction
To be able to set whether an introduction was seen
Remove or deprecate name
@igorschoester igorschoester added innovation Innovative issue. Relating to performance, memory or data-flow. changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels Oct 24, 2023
@coveralls
Copy link

coveralls commented Oct 24, 2023

Pull Request Test Coverage Report for Build 6653889266

  • 75 of 76 (98.68%) changed or added relevant lines in 7 files are covered.
  • 591 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 49.199%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/introductions/domain/invalid-user-id-exception.php 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
src/generated/container.php 591 0.0%
Totals Coverage Status
Change from base Build 6624478238: 0.1%
Covered Lines: 13213
Relevant Lines: 26856

💛 - Coveralls

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.

one question 🚧

to include `all` for a clearer distinction between the multiple and single methods
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 👍

@vraja-pro
Copy link
Contributor

ACC ✅

@vraja-pro vraja-pro added this to the feature/enable-ai-products milestone Oct 26, 2023
@vraja-pro vraja-pro merged commit 94ceda9 into feature/ai-plugin-default-on Oct 26, 2023
34 checks passed
@vraja-pro vraja-pro deleted the 141-adapt-ai-introduction-modal-when-feature-is-on-by-default-premium branch October 26, 2023 12:24
@mhkuu mhkuu modified the milestones: feature/enable-ai-products, 21.6 Oct 31, 2023
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.

5 participants