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

Onboarding: Remove Pre-Launch checklist UI #2492

Closed
3 tasks
Tracked by #2458
joemcgill opened this issue Aug 5, 2024 · 3 comments · Fixed by #2532
Closed
3 tasks
Tracked by #2458

Onboarding: Remove Pre-Launch checklist UI #2492

joemcgill opened this issue Aug 5, 2024 · 3 comments · Fixed by #2532

Comments

@joemcgill
Copy link
Collaborator

joemcgill commented Aug 5, 2024

Part of #2458

The 3rd step of the onboarding process includes this pre-launch check list at the bottom of the screen.

Image

This checklist doesn't really add value to the user experience and can lead to someone either abandoning the onboarding process or just checking everything in order to move on. Let's remove this section to streamline the onboarding experience.

Acceptance Criteria

  • On the 3rd step of onboarding, "Confirm store requirements", the pre-launch section is no longer shown
  • The PreLaunchChecklist component is removed from the codebase (js/src/setup-mc/setup-stepper/store-requirements/pre-launch-checklist/index.js)
  • Options related to the pre launch checklist should no longer be updated during this onboarding step once the PreLaunchChecklist is removed.

Implementation Brief

The PreLaunchChecklist component is defined in js/src/setup-mc/setup-stepper/store-requirements/pre-launch-checklist/index.js and imported into the StoreRequirements page in js/src/setup-mc/setup-stepper/store-requirements/index.js. We can likely just remove the PreLaunchChecklist component from the the StoreRequirements page and delete the file where it's defined, since it doesn't seem to be used anywhere else. This useEffect() hook (link) that updates the saved settings based on policyCheckData can also be removed.

Test Coverage

  • Update E2E tests in tests/e2e/specs/setup-mc/step-3-confirm-store-requirements.test.js to remove tests related to the Pre-Launch Checklist.

Definition Questions

  1. It looks like these checkboxes do actually trigger an HTTP request to the /wp-json/wc/gla/mc/settings endpoint, which ends up updating the DB option stored in gla_merchant_center but these values don't persist when the page is reloaded. Is there any other JS code that needs to be cleaned up when this is removed so the onboarding process doesn't affect the stored DB values if previously set?
  2. The JEST tests for the pre-launch-checker would be removed. Are there other JEST tests or storybook snapshots that we need to plan to update?
@eason9487
Copy link
Member

1. It looks like these checkboxes do actually trigger an HTTP request to the /wp-json/wc/gla/mc/settings endpoint, which ends up updating the DB option stored in gla_merchant_center but these values don't persist when the page is reloaded. Is there any other JS code that needs to be cleaned up when this is removed so the onboarding process doesn't affect the stored DB values if previously set?

Perhaps the JS codes related to the usePolicyCheck hook could be removed as well. For example, this code will no longer override the gla_merchant_center WP option.

// Preprocess the auto-checked state and data saving.
useEffect( () => {
if ( preprocessed || ! settings || ! policyCheckData ) {
return;
}
const newSettings = { ...settings };
const websiteLive =
policyCheckData.allowed_countries &&
! policyCheckData.robots_restriction &&
! policyCheckData.page_not_found_error &&
! policyCheckData.page_redirects;
if ( websiteLive !== settings.website_live ) {
newSettings.website_live = websiteLive;
}
if ( policyCheckData.store_ssl !== settings.checkout_process_secure ) {
newSettings.checkout_process_secure = policyCheckData.store_ssl;
}
if ( policyCheckData.refund_returns !== settings.refund_tos_visible ) {
newSettings.refund_tos_visible = policyCheckData.refund_returns;
}
if (
policyCheckData.payment_gateways !==
newSettings.payment_methods_visible
) {
newSettings.payment_methods_visible =
policyCheckData.payment_gateways;
}
const promise = isEqual( newSettings, settings )
? Promise.resolve()
: saveSettings( newSettings );
promise.finally( () => setPreprocessed( true ) );
}, [ preprocessed, policyCheckData, settings, saveSettings ] );

2. The JEST tests for the pre-launch-checker would be removed. Are there other JEST tests or storybook snapshots that we need to plan to update?

I think there are no other jest tests that need to be update, and this should be clear when running jest tests after removal..

@joemcgill
Copy link
Collaborator Author

Perhaps the JS codes related to the usePolicyCheck hook could be removed as well. For example, this code will no longer override the gla_merchant_center WP option.

Thanks @eason9487, makes sense to me.

@asvinb asvinb self-assigned this Aug 16, 2024
@asvinb asvinb assigned joemcgill and unassigned asvinb Aug 16, 2024
@joemcgill joemcgill assigned asvinb and unassigned joemcgill Aug 16, 2024
@asvinb asvinb assigned joemcgill and unassigned asvinb Aug 20, 2024
@asvinb asvinb assigned ankitguptaindia and unassigned asvinb Aug 22, 2024
@ankitguptaindia ankitguptaindia removed their assignment Aug 22, 2024
@asvinb asvinb assigned joemcgill and unassigned asvinb Aug 29, 2024
@joemcgill joemcgill assigned asvinb and unassigned joemcgill and eason9487 Sep 1, 2024
@mikkamp
Copy link
Contributor

mikkamp commented Dec 2, 2024

Closing this as completed since it was part of the 2.9 release.

@mikkamp mikkamp closed this as completed Dec 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 a pull request may close this issue.

8 participants