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

Ecommerce Segmentation Survey: Create Survey main component and routing provider #88922

Merged
merged 5 commits into from
Apr 2, 2024

Conversation

phcp
Copy link
Contributor

@phcp phcp commented Mar 26, 2024

Closes #88920

Proposed Changes

  • Create SurveyContainer component: this is the main component that will receive the list of questions and render using the stepper layout and calling pagination functions. It depends on a context that handles pagination, and each survey should implement its own provider.
  • Create EcommerceSegmentationSurvey step: this is the Step implementation. Its folder also contains the questions file, where the questions are defined (for now just a mock survey). Under a feature flag ecommerce-segmentation-survey.
image

TODOs

  • Design details not fully covered as part of this PR
  • Missing to apply on the e-commerce flow (under a feature flag)

Testing Instructions

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@phcp phcp self-assigned this Mar 26, 2024
@matticbot
Copy link
Contributor

matticbot commented Mar 26, 2024

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@phcp phcp force-pushed the add/survey-master-component branch 3 times, most recently from eba5699 to 0b2b198 Compare March 28, 2024 18:52
<QuestionStep
previousPage={ previousPage }
nextPage={ nextPage }
skip={ nextPage }
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we want to know if the questions have been skipped, but this is more on the storing the answers part (cc @JuanLucha).

Copy link
Contributor

Choose a reason for hiding this comment

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

We want to know, but I'm not sure if we are going to find out by comparing the questions with their answers instead of specifically storing a "skipped" status. Something to think about, indeed.


export const questions: Question[] = [
{
headerText: translate( 'What is your favorite color?' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a mock, but I think the questions should be moved to server-side (cc @JuanLucha).

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, something to think about. I'm doing a test for that at the moment.

@phcp phcp changed the title [WIP] Create Survey master component [WIP] Create Survey main component and routing provider Apr 1, 2024
@phcp phcp changed the title [WIP] Create Survey main component and routing provider Ecommerce Segmentation Survey: Create Survey main component and routing provider Apr 1, 2024
@phcp phcp marked this pull request as ready for review April 1, 2024 18:02
@phcp phcp force-pushed the add/survey-master-component branch from 52284b5 to cfe3816 Compare April 1, 2024 18:03
@phcp phcp requested a review from a team April 1, 2024 18:03
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 1, 2024
Copy link
Contributor

@JuanLucha JuanLucha left a comment

Choose a reason for hiding this comment

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

Very nice with the changes implemented 👌

@phcp phcp merged commit 375cefa into trunk Apr 2, 2024
14 checks passed
@phcp phcp deleted the add/survey-master-component branch April 2, 2024 12:56
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Survey main component (including pagination context)
4 participants