Skip to content
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

Domain Management: add unlimited email forwarding #3156

Merged
merged 1 commit into from
Feb 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions client/lib/domains/email-forwarding/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Internal dependencies
*/
import { isBusiness } from 'lib/products-values';

function emailForwardingPlanLimit( plan ) {
return ( isBusiness( plan ) ? 100 : 5 );
}

module.exports = { emailForwardingPlanLimit };
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { bindActionCreators } from 'redux';
* Internal dependencies
*/
import EmailForwardingLimit from './email-forwarding-limit';
import { emailForwardingPlanLimit } from 'lib/domains/email-forwarding';
import FormButton from 'components/forms/form-button';
import FormFieldset from 'components/forms/form-fieldset';
import FormFooter from 'my-sites/upgrades/domain-management/components/form-footer';
Expand All @@ -20,7 +21,6 @@ import notices from 'notices';
import * as upgradesActions from 'lib/upgrades/actions';
import { successNotice } from 'state/notices/actions';


const EmailForwardingAddNew = React.createClass( {
propTypes: {
initialShowForm: React.PropTypes.bool
Expand All @@ -42,7 +42,7 @@ const EmailForwardingAddNew = React.createClass( {
},

hasReachedLimit() {
return this.props.emailForwarding.list.length >= 5;
return this.props.emailForwarding.list.length >= emailForwardingPlanLimit( this.props.selectedSite.plan );
},

onAddEmailForward( event ) {
Expand Down Expand Up @@ -164,6 +164,7 @@ const EmailForwardingAddNew = React.createClass( {
return (
<form className="email-forwarding__add-new">
<EmailForwardingLimit
selectedSite= { this.props.selectedSite }
emailForwarding={ this.props.emailForwarding } />

{ this.formFields() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
*/
import React from 'react';

/**
* Internal dependencies
*/
import { emailForwardingPlanLimit } from 'lib/domains/email-forwarding';

const EmailForwardingLimit = React.createClass( {
render() {
const used = this.props.emailForwarding.list.length;
Expand All @@ -16,7 +21,7 @@ const EmailForwardingLimit = React.createClass( {
'You are using %(used)s out of %(available)s email forwards.', {
args: {
used,
available: 5
available: emailForwardingPlanLimit( this.props.selectedSite.plan )
}
} ) }</div>
);
Expand Down