From 43d0640aba7bf351bb7be37b194bbe89075ac1e2 Mon Sep 17 00:00:00 2001 From: Matt Husby Date: Wed, 2 Dec 2015 17:06:38 -0500 Subject: [PATCH 1/2] Bump the number of email forwards allowed for business users. --- .../email-forwarding/email-forwarding-add-new.jsx | 5 +++-- .../email-forwarding/email-forwarding-limit.jsx | 10 +++++++++- .../domain-management/email-forwarding/index.jsx | 12 +++++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-add-new.jsx b/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-add-new.jsx index 0585d557d65af..250590b707f14 100644 --- a/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-add-new.jsx +++ b/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-add-new.jsx @@ -38,7 +38,7 @@ const EmailForwardingAddNew = React.createClass( { }, hasReachedLimit() { - return this.props.emailForwarding.list.length >= 5; + return this.props.emailForwarding.list.length >= this.props.maxForwards; }, onAddEmailForward( event ) { @@ -160,7 +160,8 @@ const EmailForwardingAddNew = React.createClass( { return (
+ emailForwarding={ this.props.emailForwarding } + maxForwards={ this.props.maxForwards } /> { this.formFields() } diff --git a/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-limit.jsx b/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-limit.jsx index a6dffd7a5ad2a..189f524540dc8 100644 --- a/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-limit.jsx +++ b/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-limit.jsx @@ -4,6 +4,14 @@ import React from 'react'; const EmailForwardingLimit = React.createClass( { + maxForwards() { + if ( this.props.maxForwards === 500 ) { + return 'unlimited'; + } + + return this.props.maxForwards; + }, + render() { const used = this.props.emailForwarding.list.length; @@ -16,7 +24,7 @@ const EmailForwardingLimit = React.createClass( { 'You are using %(used)s out of %(available)s email forwards.', { args: { used, - available: 5 + available: this.maxForwards() } } ) } ); diff --git a/client/my-sites/upgrades/domain-management/email-forwarding/index.jsx b/client/my-sites/upgrades/domain-management/email-forwarding/index.jsx index 58945e0f5352d..fecefa54047d4 100644 --- a/client/my-sites/upgrades/domain-management/email-forwarding/index.jsx +++ b/client/my-sites/upgrades/domain-management/email-forwarding/index.jsx @@ -16,6 +16,7 @@ import EmailForwardingDetails from './email-forwarding-details'; import paths from 'my-sites/upgrades/paths'; import Card from 'components/card/compact'; import SectionHeader from 'components/section-header'; +import { isBusiness } from 'lib/products-values'; const EmailForwarding = React.createClass( { propTypes: { @@ -27,6 +28,14 @@ const EmailForwarding = React.createClass( { ] ).isRequired }, + maxForwards() { + if ( isBusiness( this.props.selectedSite.plan ) ) { + return 500; + } + + return 5; + }, + render() { if ( this.isDataLoading() ) { return ; @@ -51,7 +60,8 @@ const EmailForwarding = React.createClass( { + selectedSite={ this.props.selectedSite } + maxForwards={ this.maxForwards() } /> ); From 92182fc732df3219c94c1199dc6a573432174e62 Mon Sep 17 00:00:00 2001 From: Matt Husby Date: Fri, 12 Feb 2016 12:34:58 -0500 Subject: [PATCH 2/2] Translate the unlimited text --- .../email-forwarding/email-forwarding-limit.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-limit.jsx b/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-limit.jsx index 189f524540dc8..82453deff851a 100644 --- a/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-limit.jsx +++ b/client/my-sites/upgrades/domain-management/email-forwarding/email-forwarding-limit.jsx @@ -6,7 +6,7 @@ import React from 'react'; const EmailForwardingLimit = React.createClass( { maxForwards() { if ( this.props.maxForwards === 500 ) { - return 'unlimited'; + return this.translate( 'unlimited' ); } return this.props.maxForwards;