diff --git a/client/me/billing-history/index.jsx b/client/me/billing-history/index.jsx index 62d1f00836964..37be195030c22 100644 --- a/client/me/billing-history/index.jsx +++ b/client/me/billing-history/index.jsx @@ -71,7 +71,7 @@ module.exports = React.createClass( { } - { config.isEnabled( 'me/credit-cards' ) && + { config.isEnabled( 'upgrades/credit-cards' ) && } diff --git a/client/me/purchases/manage-purchase/index.jsx b/client/me/purchases/manage-purchase/index.jsx index 4717beebefd05..4a7c893b6bbef 100644 --- a/client/me/purchases/manage-purchase/index.jsx +++ b/client/me/purchases/manage-purchase/index.jsx @@ -12,6 +12,7 @@ import analytics from 'analytics'; import Button from 'components/button'; import Card from 'components/card'; import { cartItems } from 'lib/cart-values'; +import config from 'config'; import { domainManagementEdit } from 'my-sites/upgrades/paths'; import { googleAppsSettingsUrl } from 'lib/google-apps'; import HeaderCake from 'components/header-cake'; @@ -48,7 +49,7 @@ import { getPurchase, getSelectedSite, goToList, isDataLoading, recordPageView } import { isDomainProduct, isGoogleApps, isPlan, isSiteRedirect, isTheme } from 'lib/products-values'; function canEditPaymentDetails( purchase ) { - return ! isExpired( purchase ) && ! isOneTimePurchase( purchase ) && ! isIncludedWithPlan( purchase ); + return config.isEnabled( 'upgrades/credit-cards' ) && ! isExpired( purchase ) && ! isOneTimePurchase( purchase ) && ! isIncludedWithPlan( purchase ); } const ManagePurchase = React.createClass( { @@ -125,13 +126,23 @@ const ManagePurchase = React.createClass( { } } ) }> - - { this.translate( 'Renew Now' ) } - + { this.renderRenewNoticeAction() } ); }, + renderRenewNoticeAction() { + if ( ! config.isEnabled( 'upgrades/checkout' ) ) { + return null; + } + + return ( + + { this.translate( 'Renew Now' ) } + + ); + }, + renderCreditCardExpiringNotice() { const purchase = getPurchase( this.props ), { id, payment: { creditCard } } = purchase; @@ -155,7 +166,9 @@ const ManagePurchase = React.createClass( { cardExpiry: creditCard.expiryMoment.format( 'MMMM YYYY' ) }, components: { - a: + a: canEditPaymentDetails() ? + : + } } ) @@ -378,7 +391,7 @@ const ManagePurchase = React.createClass( { renderRenewButton() { const purchase = getPurchase( this.props ); - if ( ! isRenewable( purchase ) || isExpired( purchase ) || isExpiring( purchase ) ) { + if ( ! config.isEnabled( 'upgrades/checkout' ) || ! isRenewable( purchase ) || isExpired( purchase ) || isExpiring( purchase ) ) { return null; } @@ -403,9 +416,7 @@ const ManagePurchase = React.createClass( { showDismiss={ false } status="is-error" text={ this.translate( 'This purchase has expired and is no longer in use.' ) }> - - { this.translate( 'Renew Now' ) } - + { this.renderRenewNoticeAction() } ); }, diff --git a/client/my-sites/sidebar/sidebar.jsx b/client/my-sites/sidebar/sidebar.jsx index 6cb55885cd5ff..d0dad89602e04 100644 --- a/client/my-sites/sidebar/sidebar.jsx +++ b/client/my-sites/sidebar/sidebar.jsx @@ -284,7 +284,7 @@ module.exports = React.createClass( { return null; } - if ( abtest( 'domainsAddButton' ) === 'button' ) { + if ( config.isEnabled( 'upgrades/domain-search' ) && abtest( 'domainsAddButton' ) === 'button' ) { addDomainButton = { this.translate( 'Add' ) }; } diff --git a/client/my-sites/site-settings/delete-site-options/index.jsx b/client/my-sites/site-settings/delete-site-options/index.jsx index eac8da1a3ef3e..e7146239b6c57 100644 --- a/client/my-sites/site-settings/delete-site-options/index.jsx +++ b/client/my-sites/site-settings/delete-site-options/index.jsx @@ -58,7 +58,6 @@ module.exports = React.createClass( { changeAddressLink = '/domains/manage/' + selectedSite.slug, startOverLink = '/settings/start-over/' + selectedSite.slug, deleteSiteLink = '/settings/delete-site/' + selectedSite.slug, - changeAddressLinkExternal = false, changeAddressLinkText = this.translate( 'Register a new domain or change your site\'s address.' ), strings, dialogButtons; @@ -73,8 +72,6 @@ module.exports = React.createClass( { } if ( ! config.isEnabled( 'upgrades/domain-search' ) ) { - changeAddressLink = `https://${ selectedSite.domain }/wp-admin/index.php?page=my-blogs#blog_row_${ selectedSite.ID }`; - changeAddressLinkExternal = true; changeAddressLinkText = this.translate( 'Change your site\'s address.' ); } @@ -87,7 +84,7 @@ module.exports = React.createClass( { return (
- +

{ strings.changeSiteAddress }

{ changeAddressLinkText }

diff --git a/client/my-sites/upgrades/domain-management/email/index.jsx b/client/my-sites/upgrades/domain-management/email/index.jsx index 88d4eee756562..b99a6d9b085c8 100644 --- a/client/my-sites/upgrades/domain-management/email/index.jsx +++ b/client/my-sites/upgrades/domain-management/email/index.jsx @@ -7,7 +7,8 @@ const React = require( 'react' ), /** * Internal dependencies */ -const Main = require( 'components/main' ), +const config = require( 'config' ), + Main = require( 'components/main' ), Header = require( 'my-sites/upgrades/domain-management/components/header' ), SidebarNavigation = require( 'my-sites/sidebar-navigation' ), AddGoogleAppsCard = require( './add-google-apps-card' ), @@ -95,17 +96,25 @@ const Email = React.createClass( { }, emptyContent() { + let props = { + title: this.translate( "You don't have any domains yet." ), + line: this.translate( + 'Add a domain to your site to make it easier ' + + 'to remember and easier to share, and get access to email ' + + 'forwarding, Google Apps for Work, and other email services.' + ), + illustration: '/calypso/images/drake/drake-whoops.svg' + }; + + if ( config.isEnabled( 'upgrades/domain-search' ) ) { + props = Object.assign( props, { + action: this.translate( 'Add a Custom Domain' ), + actionURL: '/domains/add/' + this.props.selectedSite.domain + } ); + } + return ( - } - } ) } - line={ this.translate( 'Add a domain to your site to make it easier ' + - 'to remember and easier to share, and get access to email ' + - 'forwarding, Google Apps for Work, and other email services.' ) } - action={ this.translate( 'Add a Custom Domain' ) } - actionURL={ '/domains/add/' + this.props.selectedSite.domain } - illustration="/calypso/images/drake/drake-whoops.svg" /> + ); }, diff --git a/client/my-sites/upgrades/domain-management/list/index.jsx b/client/my-sites/upgrades/domain-management/list/index.jsx index d037f0d843af5..ea4cb8bcfc34b 100644 --- a/client/my-sites/upgrades/domain-management/list/index.jsx +++ b/client/my-sites/upgrades/domain-management/list/index.jsx @@ -9,6 +9,7 @@ import times from 'lodash/utility/times'; * Internal dependencies */ import analyticsMixin from 'lib/mixins/analytics'; +import config from 'config'; import DomainWarnings from 'my-sites/upgrades/components/domain-warnings'; import ListItem from './item'; import ListItemPlaceholder from './item-placeholder'; @@ -66,6 +67,10 @@ const List = React.createClass( { }, addDomainButton() { + if ( ! config.isEnabled( 'upgrades/domain-search' ) ) { + return null; + } + return (