Skip to content

Commit

Permalink
Fix: Show wpcom eCommerce plan on dev/stage environments, and hide Je…
Browse files Browse the repository at this point in the history
…tpack Personal on production (#44512)

* Add a new jetpack/personal-plan config flag to distinguish it from wpcom personal plans. Set it to false for all environments

* Replace plans/personal-plan with jetpack/personal-plan; also use the right comparison value by changing TYPE_PERSONAL to PLAN_PERSONAL

* Show Jetpack Personal on production and horizon, since the plan is to hide them next week along with 8.8 release
  • Loading branch information
niranjan-uma-shankar authored Jul 31, 2020
1 parent 2382da6 commit 13f4c55
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client/lib/plans/plans-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ export const PLANS_LIST = {
] ),
getSignupFeatures: ( currentPlan ) => {
const showPersonalPlan =
isEnabled( 'plans/personal-plan' ) || constants.PLAN_JETPACK_PERSONAL === currentPlan;
isEnabled( 'jetpack/personal-plan' ) || constants.PLAN_JETPACK_PERSONAL === currentPlan;

return compact( [
! showPersonalPlan && constants.FEATURE_OFFSITE_BACKUP_VAULTPRESS_DAILY,
Expand Down Expand Up @@ -796,7 +796,7 @@ export const PLANS_LIST = {
] ),
getSignupFeatures: ( currentPlan ) => {
const showPersonalPlan =
isEnabled( 'plans/personal-plan' ) || constants.PLAN_JETPACK_PERSONAL === currentPlan;
isEnabled( 'jetpack/personal-plan' ) || constants.PLAN_JETPACK_PERSONAL === currentPlan;

return compact( [
! showPersonalPlan && constants.FEATURE_OFFSITE_BACKUP_VAULTPRESS_DAILY,
Expand Down
5 changes: 3 additions & 2 deletions client/my-sites/plans-features-main/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
TERM_BIENNIALLY,
GROUP_WPCOM,
GROUP_JETPACK,
PLAN_PERSONAL,
} from 'lib/plans/constants';
import {
JETPACK_PRODUCTS_LIST,
Expand Down Expand Up @@ -254,7 +255,7 @@ export class PlansFeaturesMain extends Component {
} else if ( group === GROUP_JETPACK ) {
plans = compact( [
findPlansKeys( { group, type: TYPE_FREE } )[ 0 ],
( isEnabled( 'plans/personal-plan' ) || PLAN_JETPACK_PERSONAL === sitePlanSlug ) &&
( isEnabled( 'jetpack/personal-plan' ) || PLAN_JETPACK_PERSONAL === sitePlanSlug ) &&
findPlansKeys( { group, term, type: TYPE_PERSONAL } )[ 0 ],
findPlansKeys( { group, term, type: TYPE_PREMIUM } )[ 0 ],
findPlansKeys( { group, term, type: TYPE_BUSINESS } )[ 0 ],
Expand Down Expand Up @@ -283,7 +284,7 @@ export class PlansFeaturesMain extends Component {
}

if ( ! isEnabled( 'plans/personal-plan' ) && ! displayJetpackPlans ) {
plans.splice( plans.indexOf( plans.filter( ( p ) => p.type === TYPE_PERSONAL )[ 0 ] ), 1 );
plans.splice( plans.indexOf( plans.filter( ( p ) => p === PLAN_PERSONAL )[ 0 ] ), 1 );
}

return plans;
Expand Down
3 changes: 2 additions & 1 deletion config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"jetpack/anti-spam-product": true,
"jetpack/backups-restore": true,
"jetpack/on-demand-scan": true,
"jetpack/personal-plan": false,
"jitms": true,
"keyboard-shortcuts": true,
"lasagna": true,
Expand Down Expand Up @@ -143,7 +144,7 @@
"page/export": true,
"perfmon": false,
"persist-redux": true,
"plans/personal-plan": false,
"plans/personal-plan": true,
"post-editor-github-link": false,
"post-editor/html-toolbar": true,
"post-editor/image-editor": true,
Expand Down
1 change: 1 addition & 0 deletions config/horizon.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"jetpack/backups-restore": true,
"jetpack/anti-spam-product": true,
"jetpack/on-demand-scan": true,
"jetpack/personal-plan": true,
"jitms": true,
"keyboard-shortcuts": true,
"lasagna": true,
Expand Down
1 change: 1 addition & 0 deletions config/production.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"jetpack/anti-spam-product": true,
"jetpack/on-demand-scan": true,
"jetpack/backups-restore": true,
"jetpack/personal-plan": true,
"jitms": true,
"lasagna": true,
"layout/app-banner": true,
Expand Down
3 changes: 2 additions & 1 deletion config/stage.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"jetpack/anti-spam-product": true,
"jetpack/on-demand-scan": true,
"jetpack/backups-restore": true,
"jetpack/personal-plan": false,
"jitms": true,
"lasagna": true,
"layout/app-banner": true,
Expand Down Expand Up @@ -114,7 +115,7 @@
"page/export": true,
"perfmon": true,
"persist-redux": true,
"plans/personal-plan": false,
"plans/personal-plan": true,
"post-editor/html-toolbar": true,
"post-editor/image-editor": true,
"press-this": true,
Expand Down

0 comments on commit 13f4c55

Please sign in to comment.