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

FeatureUpsell story: Allow toggling upsell state within the story #20263

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

d-claassen
Copy link
Contributor

@d-claassen d-claassen commented May 5, 2023

Context

  • Allow anyone interested in our FeatureUpsell to switch between the upsell and non-upsell state.

Summary

This PR can be summarized in the following changelog entry:

  • Allows anyone interested in our FeatureUpsell to switch between the upsell and non-upsell state.

Relevant technical choices:

  • Start with the initial args.shouldUpsell to allow switching from the Storybook controls.
  • Adding an onClick to an <a> tag, so that callback needs event.preventDefault etc.
  • Only show the "back to upsell state" when it's actually relevant.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Pull this PR,
  • Start the storybook with $ yarn workspace @yoast/ui-library storybook
  • Navigate to the "Feature upsell" component stories,
  • Try clicking the upsell buttons in any of the stories,
  • Expect to see the content as usual,
  • Play around with the options in the controls and ensure all still work correctly and render the FeatureUpsell component as expected.
Screen.Recording.2023-05-05.at.14.07.30.mov

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:

  • Only affects the Storybook of the UI library.

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 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.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label and noted the work hours.

Fixes Yoast/ui-library-storybook#12

@d-claassen d-claassen added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label May 5, 2023
@d-claassen d-claassen requested a review from a team as a code owner May 5, 2023 12:03
@vraja-pro vraja-pro self-assigned this May 29, 2023
@vraja-pro
Copy link
Contributor

I think adding a story that is the same as the factory component is maybe redundant?
Maybe adding a story with active and locked content side by side and then you don't need the button for returning to the upsell state? You could also adjust the text to be "Content that would be grayscaled" and "Active content".
I also think the blue is a bit out of place with the package UI colors, maybe it's better to use a more subtle color.

@vraja-pro vraja-pro assigned d-claassen and unassigned vraja-pro May 29, 2023
Copy link

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

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 merge conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve FeatureUpsell stories by showing the state without upsell
2 participants