-
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: Remove siteSpecificPlansDetailsList
and siteSpecificPlansDetailsMixin
in favor of new actions/reducers
#1649
Conversation
6895799
to
b38c5b0
Compare
Forgive me if I have misunderstood, but isn't one of the strengths of Redux that we don't have to pass the state down through the props any more? I guess that's an option we have, but we can still do it the old way too? |
plansList, | ||
currentPlan; | ||
|
||
if ( plans.length === 0 || ( ! this.props.isInSignup && ! this.props.sitePlans.hasLoadedFromServer ) ) { |
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.
This condition looks long and ugly. Is it worth extracting it?
This looks great to me. It would probably be good for @stephanethomas and @Tug to take a look too... |
3b43eb9
to
0037d0e
Compare
I'll have a look but don't wait for me to merge this ;) |
0037d0e
to
6de9d86
Compare
👍 LGTM everything works as expected |
return ( | ||
<Plan placeholder={ true } | ||
isInSignup={ this.props.isInSignup } | ||
key={ 'plan-' + n } /> |
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.
Not a huge deal but we could have used a template string here.
I've just found another issue on the |
22a3f8a
to
6ef6be0
Compare
Thanks for catching that, @stephanethomas. I updated and added to the PR to address your feedback.
This is unrelated to this PR, and is because we don't never remove purchases from |
0f6d759
to
9d485fc
Compare
Note: if this is merged after #1780, the changes to the |
13b7b83
to
497b692
Compare
@Tug pointed out that we should indicate the disparity between `subscribedDate` and `subscribedMoment` here, because the latter is set to the start of the day.
@@ -99,3 +113,18 @@ module.exports = React.createClass( { | |||
); | |||
} | |||
} ); | |||
|
|||
module.exports = connect( | |||
( state, props ) => { |
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.
Could we use named functions here? Just to make it easier for us who are starting with redux.
Code looks good 💥 |
Plans: Remove `siteSpecificPlansDetailsList` and `siteSpecificPlansDetailsMixin` in favor of new actions/reducers
This PR updates the components in
client/my-sites/plans/
to use site plans data in the global state.Previously, the
/plans
components usedsiteSpecificPlansDetailsList
, which:site.domain
instead ofsite.slug
to namespace plans, which causes namespace conflicts for sites that share adomain
property.siteSpecificPlansDetailsMixin
.This PR:
siteSpecificPlansDetailsList
andsiteSpecificPlansDetailsMixin
.Testing
The plans components are used in both
/plans
and on the plans step in signup, so it is important that we assert that the behavior of both places remains unchanged.Signup
Plans
:site
is the slug of a site with the free plan.:site
is the slug of a site with a free trial.PlanOverview
component indicating the amount of time remaining for the trial.:site
is the slug of a site with a premium/business plan.Reviews