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: Make credit card page more flexible #7499

Closed

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Aug 16, 2016

This is a follow up for #7484.

In this PR I added another couple of refactorings:

  • we have now 2 entry React components to distinguish Add Card Details (<AddCardDetails />) and Edit Card Details (<EditCardDetails />) pages
  • <PurchaseCardDetails /> was extracted and contains shared logic for Card components that operates on purchases
  • .../payment/edit url was updated to better reflect functionality of the page - .../payment/add

With that in place we should be ready to work on new flow for Connect for WooCommerce.

Testing.

  1. Go to Manage Purchases page (http://calypso.localhost:3000/purchases).
  2. Select a purchase paid with credit card.
  3. Click on Edit Payment Method link.
  4. You should see loading placeholder when page is loading (you can refresh a page if you missed loading step).
  5. When page is loaded you should see a form with a cardholder name provided.
  6. Play with the form to make sure it works as before.
  7. You can also try to click back button while validation is pending to make sure isMounted change is working properly. There should be no warnings on JS console complaining about incorrectsetState usage.
  8. Go back to Manage Purchases page.
  9. Pick a purchase paid with credits.
  10. Click on Add Payment Method link.
  11. You should see loading placeholder when page is loading (you can refresh a page if you missed loading step).
  12. When page is loaded you should see a form with no fields filled in.
  13. Play with the form to make sure it works as before.

Test live: https://calypso.live/?branch=update/improve-credit-card-page

ryelle and others added 30 commits August 15, 2016 10:45
…consider it initialized when the correct number of sites is loaded.
This is to ensure we have the site selected before continuing on with the other page components.
- Add 200ms delay to show Popover
@prettyboymp
Copy link
Contributor

You can also try to click back button while validation is pending to make sure isMounted change is working properly. There should be no warnings on JS console complaining about incorrectsetState usage.

I'm receiving the following error when submitting a AUTH_DECLINE card:
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the CreditCardPage component.

Other than that the changes look good.

When using Calypso components within a wp-admin page, the scss imports
have to be done within a nested context. Otherwise, one gets css class
naming conflicts.  In order to make this work, all Calypso components
need to exist under an html element with the given class.

This commit allows RootChild to be set with the css class needed to
support the nested context for scss imports.
@gziolo
Copy link
Member Author

gziolo commented Aug 17, 2016

@prettyboymp Thanks for a review! Good catch, we probably need to add a check when submitting form :) I'll fix that one.

@gziolo gziolo added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Aug 17, 2016
ockham and others added 20 commits August 17, 2016 18:22
…n-omit

Card Component: Tighten Child Props Omissions
Component [Popover] Enable setting of className for RootChild
…rm-selector

Editor: use EditorTermSelector for categories
* Define initial structure for plan-purchase-features

* Add initial plan-purchase-features/features-list

* Add initial render logic to PlanPurchaseFeatures

* Add PlanPurchaseFeatures to devdocs

* Fix displayName in devdocs of PlanPurchaseFeatures

* Add styles to PlanPurchaseFeatures

* Add more plan purchase features to features-list

* Add custom domain feature

This will need to be refactored once #7311 lands in.

* Add GoogleVoucher to plan purchase features list

* Connect PlanPurchaseFeatures to Redux Store

* Add getPremiumFeatures method to PlanPurchaseFeatures

* Complete getBusinessFeatures in PlanPurchaseFeatures

* Add getPersonalFeatures to PlanPurchaseFeatures

* Add JetpackFeatures to PlanPurchaseFeatures list

* Add Jetpack plans to PlanPurchaseFeatures

* Add basic styling and flex alignment

* Add wrapping <div> around PurchaseDetail and re-style

* Add HappinessSupportFeature to PlanPurchaseFeatures

Needs styling tweaks and/or HappinessSupport component tweaks. Maybe we
should create brand new component for PlanPurchaseFeatures?

* Add CurrentPlanHeaderFeature to PlanPurchaseFeatures

* Add placeholder CSS styles for header feature

Copy-edited from checkout-thank-you/style.scss

* Fix PlanPurchaseFeatuers devdocs errors

Props @gwwar for the `<QuerySites siteId={ myPrimarySite } />`
suggestion.

* Use column-count instead of flexbox

Props @rralian for the suggestion.

* Move plan purchase features to their own files

* Move plan purchase featuers logic into feature files

* Split Jetpack featuers to own files

* Use selectedSite from Redux site if not null

* Divide Jetpack features to Free, Premium and Business

* Add responsive styling for smaller devices

* Reorder plan purchase features to match My Plan page

* Make btns 100% width and center text on mobile

* Import find from lodash (fix IE11 error with native find)
Add warning for ES6 instance functions in development environment
* Signup: Add eCommerce partners to store options for AB testing

Adds BlueHost and SiteGround as store options of design type step.
We need them in order to enable AB testing of eCommerce partner hosts.
* Wordads status redux

Redux site stickers

Add missing bracket after rebase

Add tests to stickers reducer tree

Fix notice

Modify stickers to wordads status

* Fixes

* Add required proptypes

* selector siteWordadsUnsafe -> isSiteWordadsUnsafe

* New and shiny schema

* Murican!

* comments

* Schema get rid of required

* Schema again

* Remove extra import
Delete Site: toLowerCase() before validating domain
Purchases: Extract CreditCardPage component
@gziolo gziolo force-pushed the update/improve-credit-card-page branch from 8c104d8 to 3105c04 Compare August 18, 2016 09:09
@gziolo
Copy link
Member Author

gziolo commented Aug 18, 2016

I rebases with master and can't change this PR to diff with master. Closing this one in favor of #7537.

@gziolo gziolo closed this Aug 18, 2016
@gziolo gziolo deleted the update/improve-credit-card-page branch August 18, 2016 10:38
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. [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.