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

Apply AdaptiveForm and its abilities to steps 2 and 3 of the onboarding flow for higher code consistent #2015

Merged
merged 4 commits into from
Jul 18, 2023

Conversation

eason9487
Copy link
Member

Changes proposed in this Pull Request:

With #2014, this is another pre-processing PR for #634 and for 📌 Display form validation errors in #1993.

To apply AdaptiveForm and its abilities to steps 2 and 3 of the onboarding flow, and make the uses of formContext ( the former formProps) higher consistent, this PR:

  • Change to use the adapter.isSubmitting of AdaptiveForm as the loading state of submit button in SetupFreeListings and StoreRequirements
  • Apply useAdaptiveFormContext instead of formProps prop drilling for SetupFreeListings and the relevant components.
  • Apply AdaptiveForm and useAdaptiveFormContext instead of Form and formProps for StoreRequirements and the relevant components
  • Extend the adapter to avoid audienceCountries prop drilling for SetupFreeListings and the relevant components.

💡 It's possible to continue the subsequent implementation without this PR, but the uses of form and the relevant states will become scattered and more difficult to maintain. Therefore, I would like to tweak the codebase first.

Detailed test instructions:

This PR only changes the code used in steps 2 and 3 of the onboarding flow but doesn't change the UI behaviors.

  1. Go to step 2 of the onboarding flow.
  2. Repeatedly fill in and clean up the audience countries and shipping settings.
  3. Check if the form-related behaviors are still the same as before.
  4. Proceed to step 3.
  5. Similar to above, check if the form-related behaviors are still the same as before.
  6. Click "Continue" button to go to step 4 and see if the loading state work well.

The SetupFreeListings component is used in the Edit free listings page as well.

  1. Go to the Edit free listings page.
  2. Repeatedly fill in and clean up the audience countries and shipping settings.
  3. Check if the form-related behaviors are still the same as before.
  4. Click "Save changes" button and see if the loading state work well.

Changelog entry

…or `SetupFreeListings` and the relevant components
…nd `formProps` for `StoreRequirements` and the relevant components
…ding state of submit button in `SetupFreeListings` and `StoreRequirements`
…tupFreeListings` and the relevant components
@eason9487 eason9487 requested a review from a team July 17, 2023 10:44
@eason9487 eason9487 self-assigned this Jul 17, 2023
@github-actions github-actions bot added the changelog: dev Developer-facing only change. label Jul 17, 2023
@eason9487 eason9487 changed the title Dev/634 apply adaptive form Apply AdaptiveForm and its abilities to steps 2 and 3 of the onboarding flow for higher code consistent Jul 17, 2023
Copy link
Contributor

@ianlin ianlin left a comment

Choose a reason for hiding this comment

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

Thanks for the refactoring, it looks much cleaner by removing prop drilling. The form behaviour in onboarding steps and edit free listing pages work as expected, LGTM.

Base automatically changed from dev/634-elevate-form-validation-request to develop July 18, 2023 09:48
@eason9487 eason9487 merged commit e4bf29e into develop Jul 18, 2023
6 checks passed
@eason9487 eason9487 deleted the dev/634-apply-adaptive-form branch July 18, 2023 10:07
@martynmjones martynmjones mentioned this pull request Aug 1, 2023
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: dev Developer-facing only change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants