Skip to content

Commit

Permalink
Merge pull request #3081 from Automattic/fix/jetpack-plans
Browse files Browse the repository at this point in the history
Plans: Fix Jetpack plans in `Plan`
  • Loading branch information
drewblaisdell committed Feb 4, 2016
2 parents 0ecfd7c + 5b35b88 commit 6d13436
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/components/plans/plan/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var abtest = require( 'lib/abtest' ).abtest,
analytics = require( 'analytics' ),
testFeatures = require( 'lib/features-list/test-features' ),
Gridicon = require( 'components/gridicon' ),
isJetpackPlan = require( 'lib/products-values' ).isJetpackPlan,
JetpackPlanDetails = require( 'my-sites/plans/jetpack-plan-details' ),
PlanActions = require( 'components/plans/plan-actions' ),
PlanHeader = require( 'components/plans/plan-header' ),
Expand Down Expand Up @@ -225,6 +226,7 @@ module.exports = React.createClass( {
},

render: function() {
var shouldDisplayFeatureList = this.props.plan && ! isJetpackPlan( this.props.plan ) && abtest( 'plansFeatureList' ) === 'list';
return (
<Card className={ this.getClassNames() } key={ this.getProductSlug() } onClick={ this.showDetails }>
{ this.getPlanDiscountMessage() }
Expand All @@ -238,7 +240,7 @@ module.exports = React.createClass( {
</PlanHeader>
<div className="plan__plan-expand">
<div className="plan__plan-details">
{ abtest( 'plansFeatureList' ) === 'list' ? this.getFeatureList() : this.getDescription() }
{ shouldDisplayFeatureList ? this.getFeatureList() : this.getDescription() }
</div>
{ this.getPlanActions() }
</div>
Expand Down
8 changes: 8 additions & 0 deletions client/lib/products-values/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ function isEnterprise( product ) {
return product.product_slug === 'wpcom-enterprise';
}

function isJetpackPlan( product ) {
product = formatProduct( product );
assertValidProduct( product );

return 'jetpack' === product.product_type;
}

function isPlan( product ) {
product = formatProduct( product );
assertValidProduct( product );
Expand Down Expand Up @@ -263,6 +270,7 @@ module.exports = {
isDomainRedemption,
isDomainRegistration,
isEnterprise,
isJetpackPlan,
isFreePlan,
isFreeTrial,
isGoogleApps,
Expand Down
5 changes: 5 additions & 0 deletions client/my-sites/plans/jetpack-plan-details/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@

.jetpack_premium .plan__plan-details li, .jetpack_business .plan__plan-details li {
opacity: 1.0;

&:before {
@include noticon( '\f418', 16px );
vertical-align: middle;
}
}

0 comments on commit 6d13436

Please sign in to comment.