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

Purchases: Reduxify notices in payment method forms #49541

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Feb 1, 2021

Changes proposed in this Pull Request

This PR reduxifies notices in PaymentMethodForm.

Note: This updates both the "add" and "update" functionality, but the "update" functionality is not in-use since this component is in the process of being removed.

Testing instructions

  • Go to /purchases. (Note: this will not work if you test /me/purchases since that uses a different component.)
  • Click on "Payment methods" in the header navigation.
  • Click the "Add payment method" button in the header.
  • Add a new credit card and verify that you see a success message.

Part of #48408.

@tyxla tyxla added [Type] Enhancement [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. Payment Methods labels Feb 1, 2021
@tyxla tyxla requested review from sirbrillig and a team February 1, 2021 13:21
@tyxla tyxla self-assigned this Feb 1, 2021
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Feb 1, 2021

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~5 bytes added 📈 [gzipped])

name            parsed_size           gzip_size
woocommerce           +76 B  (+0.0%)      +11 B  (+0.0%)
site-purchases        +76 B  (+0.0%)       -6 B  (-0.0%)
purchases             +76 B  (+0.0%)       -6 B  (-0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@tyxla tyxla mentioned this pull request Feb 1, 2021
@sirbrillig
Copy link
Member

Thanks! I'll test it out soon. The reason this may seem tricky to test is because we're in the process of removing PaymentMethodForm so I may delay on this a bit over other PRs.

@tyxla tyxla force-pushed the reduxify/purchases-payment-method-notices branch from 1130a89 to cb52544 Compare February 3, 2021 10:20
@tyxla
Copy link
Member Author

tyxla commented Feb 3, 2021

Thanks, @sirbrillig. I've rebased in the meantime. This seems to be a bit easier to review now, partially because some of the code doesn't seem to be used anywhere 😉

@tyxla
Copy link
Member Author

tyxla commented Feb 8, 2021

@sirbrillig what can I do to help escalate this PR? It seems to be the last one that blocks the removal of the good ol' notices library.

Copy link
Member

@sirbrillig sirbrillig left a comment

Choose a reason for hiding this comment

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

I updated the testing instructions because this is tricky to test. Notably, this component is not used at the account-level, only the site-level, so I changed the URL to /purchases; also the "update" functionality is no longer in use anywhere, so I removed that test case.

Works as described!

Screen Shot 2021-02-08 at 7 29 08 PM

@tyxla
Copy link
Member Author

tyxla commented Feb 9, 2021

Thanks a bunch, @sirbrillig 🙌

@tyxla tyxla merged commit 227d59b into trunk Feb 9, 2021
@tyxla tyxla deleted the reduxify/purchases-payment-method-notices branch February 9, 2021 11:16
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. Payment Methods [Type] Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants