Commit c0bbfd4f by Jason Zhou

update old files for wildcat restore

parent ad2fb06b
...@@ -57,6 +57,7 @@ Promise.all([p1()]) ...@@ -57,6 +57,7 @@ Promise.all([p1()])
const ReactDOM = require('react-dom') const ReactDOM = require('react-dom')
const SupportWidget = require('js/components/support_widget/SupportWidget') const SupportWidget = require('js/components/support_widget/SupportWidget')
const PurchaseBridge = require('../../nextgen/domain/PurchaseBridge') const PurchaseBridge = require('../../nextgen/domain/PurchaseBridge')
.default
const SupportWidgetWithComponentKit = ComponentKitContext(SupportWidget) const SupportWidgetWithComponentKit = ComponentKitContext(SupportWidget)
const PublishManager = require('nextgen/subApps/publishManager') const PublishManager = require('nextgen/subApps/publishManager')
......
...@@ -21,7 +21,7 @@ import 'js/reactInit.es6' ...@@ -21,7 +21,7 @@ import 'js/reactInit.es6'
import * as UrlConstants from 'js/constants/url_constants' import * as UrlConstants from 'js/constants/url_constants'
import ProductPanel from 'nextgen/ecommerce/manager/components/productPanel' import ProductPanelWrapper from 'nextgen/ecommerce/manager/components/productPanelWrapper'
import CategoryManagerWrapper from 'nextgen/ecommerce/manager/components/settings/categoryManagerWrapper' import CategoryManagerWrapper from 'nextgen/ecommerce/manager/components/settings/categoryManagerWrapper'
import MembershipManager from 'nextgen/ecommerce/manager/components/settings/membershipManager' import MembershipManager from 'nextgen/ecommerce/manager/components/settings/membershipManager'
import PaymentGatewaySettingsPanel from 'nextgen/ecommerce/manager/components/settings/paymentChannel/PaymentGatewaySettingsPanel' import PaymentGatewaySettingsPanel from 'nextgen/ecommerce/manager/components/settings/paymentChannel/PaymentGatewaySettingsPanel'
...@@ -255,7 +255,7 @@ const supportedChannels = () => { ...@@ -255,7 +255,7 @@ const supportedChannels = () => {
return supportedChannelsConf return supportedChannelsConf
} }
const KitWrappedProductPanel = ComponentKitContext(ProductPanel) const KitWrappedProductPanel = ComponentKitContext(ProductPanelWrapper)
class ProductsContainer extends React.Component { class ProductsContainer extends React.Component {
componentWillMount() { componentWillMount() {
......
...@@ -10,6 +10,7 @@ import { Provider } from 'react-redux' ...@@ -10,6 +10,7 @@ import { Provider } from 'react-redux'
import ComponentKitContext from 'js/utils/ComponentKitContext' import ComponentKitContext from 'js/utils/ComponentKitContext'
import { createStore, applyMiddleware, compose } from 'redux' import { createStore, applyMiddleware, compose } from 'redux'
import thunkMiddleware from 'redux-thunk' import thunkMiddleware from 'redux-thunk'
import PaypalPopupDialog from 'js/components/dialogs/PaypalPopupDialog'
import { import {
Router, Router,
Route, Route,
...@@ -26,6 +27,10 @@ import Domains from 'nextgen/app/scenes/Domains' ...@@ -26,6 +27,10 @@ import Domains from 'nextgen/app/scenes/Domains'
import Domain from 'nextgen/app/scenes/Domain' import Domain from 'nextgen/app/scenes/Domain'
import DomainPurchase from 'nextgen/app/scenes/DomainPurchase' import DomainPurchase from 'nextgen/app/scenes/DomainPurchase'
import { initTrack } from 'js/utils/track'
initTrack() // analytics track init
const middleware = [thunkMiddleware] const middleware = [thunkMiddleware]
const composeEnhancers = const composeEnhancers =
(localStorage && (localStorage &&
...@@ -123,6 +128,7 @@ Promise.all([p1()]) ...@@ -123,6 +128,7 @@ Promise.all([p1()])
<DashboardRouterWithContext /> <DashboardRouterWithContext />
</Provider> </Provider>
</AppContainer> </AppContainer>
<PaypalPopupDialog />
</ErrorBoundary>, </ErrorBoundary>,
document.getElementById('mainDashboard'), document.getElementById('mainDashboard'),
) )
......
...@@ -189,6 +189,14 @@ class DomainsTab extends React.Component { ...@@ -189,6 +189,14 @@ class DomainsTab extends React.Component {
} }
_onConnectDomainAfterRegister(newDomain) { _onConnectDomainAfterRegister(newDomain) {
// free user won't connect domain
if (CurrentUserStore.isFreeMembership()) {
this.getDefaultBinding().set('showPurchaseSuccessMsg', true)
this._onBackToTab()
return
}
//
EditorActions.addDomainToPool(newDomain) EditorActions.addDomainToPool(newDomain)
newDomain = `www.${newDomain}` newDomain = `www.${newDomain}`
...@@ -615,22 +623,30 @@ class DomainsTab extends React.Component { ...@@ -615,22 +623,30 @@ class DomainsTab extends React.Component {
const forceShowKB = const forceShowKB =
v2DomainConnection && !v2DomainConnection.get('domain_id') v2DomainConnection && !v2DomainConnection.get('domain_id')
const isSiteOfResellerClient = PageMetaStore.isSiteOfResellerClient() const isSiteOfResellerClient = PageMetaStore.isSiteOfResellerClient()
const canBuyAllDomains = ConfStore.getCanBuyAllDomains()
let registerDomainContainer let registerDomainContainer
if (!isSxl) { if (!isSxl) {
// rollout for new domain project v1
if (!canBuyAllDomains) {
if (domainPurchaseStatus === 'free') { if (domainPurchaseStatus === 'free') {
registerDomainContainer = ( registerDomainContainer = (
<div className="register-domain"> <div className="register-domain">
{tct( {tct(
__( __(
"Only premium users can register a new domain through our system. If you [link: purchase a yearly subscription plan] to Strikingly, we'll give you a domain for free!", "If you [link: purchase a yearly subscription plan] to Strikingly, we'll give you a domain for free for the first year!",
), ),
{ {
root: <div className="field-hint" />, root: <div className="field-hint" />,
link: <a href={ link: (
<a
href={
UserMetaStore.isZbjUser() UserMetaStore.isZbjUser()
? 'javascript: alert("八戒云站暂不支持升级,请添加新的套餐。")' ? 'javascript: alert("八戒云站暂不支持升级,请添加新的套餐。")'
: '/s/pricing?ref=free_domain' : '/s/pricing?ref=free_domain'
} />, }
/>
),
}, },
)} )}
<div <div
...@@ -672,6 +688,38 @@ class DomainsTab extends React.Component { ...@@ -672,6 +688,38 @@ class DomainsTab extends React.Component {
</div> </div>
) )
} }
} else if (
CurrentUserStore.hasFreeDomain() &&
v2DomainSetting.entitledToFreeDomain
) {
registerDomainContainer = (
<div className="register-domain">
<div className="field-hint">
{__(
`You're on a yearly plan and can register a new domain for free!`,
)}
</div>
<div
className="s-btn big basic-blue"
onClick={this._onRegisterNewDomain}>
{__('Claim My Free Domain!')}
</div>
</div>
)
} else {
registerDomainContainer = (
<div className="register-domain">
<div className="field-hint">
{__(`Don't own a domain yet? Grab one here.`)}
</div>
<div
className="s-btn big basic-blue"
onClick={this._onRegisterNewDomain}>
{__('Register New Domain')}
</div>
</div>
)
}
} }
let permalinkInner let permalinkInner
...@@ -722,28 +770,15 @@ class DomainsTab extends React.Component { ...@@ -722,28 +770,15 @@ class DomainsTab extends React.Component {
<div <div
key="first-step" key="first-step"
className="page-settings-content s-dialog-content domains-tab"> className="page-settings-content s-dialog-content domains-tab">
{
<PremiumFeature
featureName="custom_domain"
overlayStyle="fieldOverlay"
title={__(
'Domain|Register for or connect to a custom domain for this site.',
)}
hint={__(
'Upgrade your account to either Limited or Pro to access this feature!',
)}
source="cd">
{!isSxl && ( {!isSxl && (
<div> <div>
{showPurchaseSuccessMsg && ( {showPurchaseSuccessMsg && (
<ReactTransitionGroup> <ReactTransitionGroup>
<JQSlide <JQSlide component={DOM.div} className="s-box green small fist">
component={DOM.div}
className="s-box green small fist">
<i className="fa fa-check" /> <i className="fa fa-check" />
{tct( {tct(
__( __(
"Domain|[placeholderStrong: You just got a new domain!] And we've already connected it to your site. Remember, you must check your email to validate your domain.", 'Domain|[placeholderStrong: You just got a new domain!]',
), ),
{ {
root: <span />, root: <span />,
...@@ -751,10 +786,14 @@ class DomainsTab extends React.Component { ...@@ -751,10 +786,14 @@ class DomainsTab extends React.Component {
}, },
)} )}
&nbsp; &nbsp;
{!CurrentUserStore.isFreeMembership() &&
__("Domain|And we've already connected it to your site.")}
{__(
'Domain|Remember, you must check your email to validate your domain.',
)}
&nbsp;
<a <a
href={ href={v2DomainSetting ? '/s/v2_domains/' : '/s#/domains'}
v2DomainSetting ? '/s/v2_domains/' : '/s#/domains'
}
target="_blank"> target="_blank">
{__('Domain|View your new domain in domain dashboard.')} {__('Domain|View your new domain in domain dashboard.')}
</a> </a>
...@@ -767,6 +806,8 @@ class DomainsTab extends React.Component { ...@@ -767,6 +806,8 @@ class DomainsTab extends React.Component {
</ReactTransitionGroup> </ReactTransitionGroup>
)} )}
{!isSiteOfResellerClient && {!isSiteOfResellerClient &&
(canBuyAllDomains ||
(!canBuyAllDomains && !CurrentUserStore.isFreeMembership())) &&
(showRegisterBtn ? ( (showRegisterBtn ? (
<div className="form-field"> <div className="form-field">
<div className="field-title"> <div className="field-title">
...@@ -784,6 +825,15 @@ class DomainsTab extends React.Component { ...@@ -784,6 +825,15 @@ class DomainsTab extends React.Component {
<div className="hr" /> <div className="hr" />
</div> </div>
)} )}
{
<PremiumFeature
featureName="custom_domain"
overlayStyle="fieldOverlay"
title={__('Domain|Connect to a custom domain for this site.')}
hint={__(
'Upgrade your account to either Limited or Pro to access this feature!',
)}
source="cd">
<div className="form-field custom-domain-field"> <div className="form-field custom-domain-field">
<div className="field-title"> <div className="field-title">
{__('Custom Domain/Subdomain')} {__('Custom Domain/Subdomain')}
...@@ -812,7 +862,10 @@ class DomainsTab extends React.Component { ...@@ -812,7 +862,10 @@ class DomainsTab extends React.Component {
value={currentDomain} value={currentDomain}
onChange={this._onChangeCustomDomain} onChange={this._onChangeCustomDomain}
/> />
<div className="s-btn" onClick={this._onSaveCustomDomain}> <div
className="s-btn"
onClick={this._onSaveCustomDomain}
data-track-id="Update Custom Domain Button">
{__('Update')} {__('Update')}
{['updating', 'checking'].includes(customDomainStatus) ? ( {['updating', 'checking'].includes(customDomainStatus) ? (
<i className="fa fa-spinner fa-pulse right-icon" /> <i className="fa fa-spinner fa-pulse right-icon" />
......
...@@ -15,6 +15,11 @@ import * as editorStoreCreator from 'js/reducers/editorStoreCreator' ...@@ -15,6 +15,11 @@ import * as editorStoreCreator from 'js/reducers/editorStoreCreator'
import ComponentKitContext from 'js/utils/ComponentKitContext' import ComponentKitContext from 'js/utils/ComponentKitContext'
import wrapErrorBoundary from 'js/components/ErrorBoundary' import wrapErrorBoundary from 'js/components/ErrorBoundary'
import 'js/reactInit.es6' import 'js/reactInit.es6'
import { initTrack } from 'js/utils/track'
initTrack() // analytics track init
// These two are direct reads so promises can be fired quicker // These two are direct reads so promises can be fired quicker
const supportedVerticals = ['personal'] const supportedVerticals = ['personal']
const themeName = $S.stores.pageMeta.theme.name const themeName = $S.stores.pageMeta.theme.name
......
...@@ -87,7 +87,7 @@ module.exports = class EntriesGenerationWebpackPlugin { ...@@ -87,7 +87,7 @@ module.exports = class EntriesGenerationWebpackPlugin {
} }
if (this.opts.appendMode && fse.existsSync(outputFile)) { if (this.opts.appendMode && fse.existsSync(outputFile)) {
const previousJson = JSON.parse( const previousJson = JSON.parse(
fse.readFileSync(outputFile).toString() fse.readFileSync(outputFile).toString() || '{}'
) )
json = JSON.stringify(Object.assign(previousJson, manifest), null, 2) json = JSON.stringify(Object.assign(previousJson, manifest), null, 2)
} }
......
...@@ -64,10 +64,11 @@ ...@@ -64,10 +64,11 @@
"@types/jest": "^21.1.2", "@types/jest": "^21.1.2",
"@types/lodash": "^4.14.61", "@types/lodash": "^4.14.61",
"@types/normalizr": "^2.0.18", "@types/normalizr": "^2.0.18",
"@types/react": "^16.0.4", "@types/ramda": "^0.25.36",
"@types/react": "16.0.40",
"@types/react-dom": "^16.0.4", "@types/react-dom": "^16.0.4",
"@types/react-native": "^0.42.14", "@types/react-native": "^0.42.14",
"@types/react-redux": "^4.4.38", "@types/react-redux": "^5.0.6",
"@types/react-router": "^2.0.49", "@types/react-router": "^2.0.49",
"@types/react-test-renderer": "^16.0.1", "@types/react-test-renderer": "^16.0.1",
"@types/redux-form": "^6.3.6", "@types/redux-form": "^6.3.6",
...@@ -214,6 +215,7 @@ ...@@ -214,6 +215,7 @@
"hypernova-morearty": "git://github.com/strikingly/hypernova-morearty", "hypernova-morearty": "git://github.com/strikingly/hypernova-morearty",
"hypernova-react": "^2.0.0", "hypernova-react": "^2.0.0",
"ie-version": "^0.1.0", "ie-version": "^0.1.0",
"immer": "^1.5.0",
"immutable": "github:strikingly/immutable-js#6fecef1e909bfe8eba4908c3f5aa4f8e126ce163", "immutable": "github:strikingly/immutable-js#6fecef1e909bfe8eba4908c3f5aa4f8e126ce163",
"in-viewport": "^3.4.1", "in-viewport": "^3.4.1",
"invariant": "^2.2.1", "invariant": "^2.2.1",
...@@ -296,8 +298,9 @@ ...@@ -296,8 +298,9 @@
"sha1": "^1.1.1", "sha1": "^1.1.1",
"shallow-equal": "^1.0.0", "shallow-equal": "^1.0.0",
"sw-toolbox": "^3.6.0", "sw-toolbox": "^3.6.0",
"typescript": "^2.2.2", "typescript": "^3.0.3",
"uglify-js": "2.7.5", "uglify-js": "2.7.5",
"url-join": "^4.0.0",
"uuid": "^2.0.1", "uuid": "^2.0.1",
"validator": "^9.1.1", "validator": "^9.1.1",
"walk": "^2.3.9", "walk": "^2.3.9",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment