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

Allow WC Shipping to use larger migration state machine enums #2804

Merged
merged 3 commits into from
Aug 29, 2024

Conversation

kallehauge
Copy link
Contributor

@kallehauge kallehauge commented Aug 29, 2024

Description

We'll start using the "state machine" in WC Shipping as well to make the overall structure a bit more consistent.

That means we cannot guarantee that WCS&T will know all states anymore, so this PR aims to disable our migration banner / feature announcement modal when the value is greater than COMPLETED.

I also sneaked in a few __().

Related issue(s)

Steps to reproduce & screenshots/GIFs

  1. Checkout trunk
  2. Disable WC Shipping (if it's enabled)
  3. Run wp option set wcshipping_migration_state 13 ("COMPLETE" is 12, so 13 or anything higher will be good for testing)
  4. Go to /wp-admin/admin.php?page=wc-orders
  5. Verify you see the migration banner
  6. Go to any shippable order
  7. Open the Create shipping label modal
  8. Verify you see the Feature Announcement modal
  9. Checkout this branch
  10. Refresh the order page
  11. Open the Create shipping label modal
  12. Verify the Feature Announcement is no longer showing
  13. Go to /wp-admin/admin.php?page=wc-orders
  14. Verify the banner is no longer showing
  15. Bonus!
    • Run wp option set wcshipping_migration_state 1 and verify the banner and feature announcement modal is showing since it's in a "not begun" state.
    • Run wp option set wcshipping_migration_state 12 and verify the banner and feature announcement modal is hidden since it's in a "COMPLETED" state.

Note: you might have issues seeing any of the migration banners/modals if you have the wcst-wcshipping-migration-dismissed cookie that temporarily hides everything.

Checklist

  • unit tests
  • changelog.txt entry added
  • readme.txt entry added

@kallehauge kallehauge self-assigned this Aug 29, 2024
@kallehauge kallehauge requested review from kloon and harriswong August 29, 2024 00:42
@kallehauge kallehauge marked this pull request as ready for review August 29, 2024 00:50
@kallehauge kallehauge changed the title Update/allow wc shipping to use larger state enums Allow WC Shipping to use larger migration state machine enums Aug 29, 2024
Copy link
Contributor

@kloon kloon left a comment

Choose a reason for hiding this comment

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

Works as described, thanks for thinking pro-actively about the changes we make in WC Shipping and how it affects WCS&T.

@kallehauge kallehauge merged commit 92ce537 into trunk Aug 29, 2024
9 checks passed
@kallehauge kallehauge deleted the update/allow-wc-shipping-to-use-larger-state-enums branch August 29, 2024 10:37
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.

2 participants