-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Plans: Reduxify Plan Remove component #2952
Conversation
These changes look great. There are a lot though. I think it would have been better to do the Redux stuff in a different PR to the refactoring. |
Thanks for your feedback Ben! I agree this pull request ended up being too long. |
fa0d21a
to
147892a
Compare
type: FETCH_SITE_PLANS, | ||
siteId: siteId | ||
it( 'should return an empty state when original state and action are empty', () => { | ||
const original = Object.freeze( {} ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to wrap the initial state in Object.freeze
in all of these tests. 👍
eec8ebf
to
1ecada0
Compare
I've rebased (this was lots of fun this time sic) and implemented the changes requested. This is ready for another review. |
Changes look good. |
Product 👌 |
…page This fixes an 'Uncaught TypeError: this.props.getSelectedSite is not a function' error thrown when dismissing the notice displayed upon a successful free trial cancelation.
There can be only one.
… naming convention
… naming convention
There is no need to return an action thunk here.
… about This moves from using initial site state constants to using plain objects to describe assertions. The goal is to make these unit tests easier to understand (since the expected results are obvious and don't require any interpretation of Object.assign()) and more flexible (by specifying different original states).
This also fixes the case where isFetching would not be reset in case of failure.
This makes obvious that this action expects a list of plans returned by the API - which will then be converted to a different data structure by the assembler.
This also adds the corresponding unit tests.
… Plans reducer Less is more.
This is the first step to merging this flag with the one for fetching since we don't really need to manage both states after all.
This is the last step to merging this flag with the one used previously for updating - so we only have to manage a single state.
1ecada0
to
16e700e
Compare
Plans: Reduxify Plan Remove component
This pull request addresses #2626 by extracting the part that handles the API call from the
<PlanRemove />
component and connecting this component to the Redux state tree. It also fixes a few things and refactors some code in the process:Fixing
Refactoring
Reduxification
<PlanRemove />
componentAs a reminder the
<PlanRemove />
component is responsible for displaying a new section with a link at the bottom of thePlans Overview
page during the grace period:This link displays a modal that allows users to cancel a free trial:
Users are redirected on the
Plans
page with a message if the cancelation is successful:Testing instructions
git checkout update/reduxify-plan-remove
and start your serverPlan Overview
page with a free trial in grace periodRemove now
link and then click theRemove Now
button in the modalPlans
pageReviews