Commit c0bbfd4f by Jason Zhou

update old files for wildcat restore

parent ad2fb06b
......@@ -57,6 +57,7 @@ Promise.all([p1()])
const ReactDOM = require('react-dom')
const SupportWidget = require('js/components/support_widget/SupportWidget')
const PurchaseBridge = require('../../nextgen/domain/PurchaseBridge')
.default
const SupportWidgetWithComponentKit = ComponentKitContext(SupportWidget)
const PublishManager = require('nextgen/subApps/publishManager')
......
......@@ -21,7 +21,7 @@ import 'js/reactInit.es6'
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 MembershipManager from 'nextgen/ecommerce/manager/components/settings/membershipManager'
import PaymentGatewaySettingsPanel from 'nextgen/ecommerce/manager/components/settings/paymentChannel/PaymentGatewaySettingsPanel'
......@@ -255,7 +255,7 @@ const supportedChannels = () => {
return supportedChannelsConf
}
const KitWrappedProductPanel = ComponentKitContext(ProductPanel)
const KitWrappedProductPanel = ComponentKitContext(ProductPanelWrapper)
class ProductsContainer extends React.Component {
componentWillMount() {
......
......@@ -10,6 +10,7 @@ import { Provider } from 'react-redux'
import ComponentKitContext from 'js/utils/ComponentKitContext'
import { createStore, applyMiddleware, compose } from 'redux'
import thunkMiddleware from 'redux-thunk'
import PaypalPopupDialog from 'js/components/dialogs/PaypalPopupDialog'
import {
Router,
Route,
......@@ -26,6 +27,10 @@ import Domains from 'nextgen/app/scenes/Domains'
import Domain from 'nextgen/app/scenes/Domain'
import DomainPurchase from 'nextgen/app/scenes/DomainPurchase'
import { initTrack } from 'js/utils/track'
initTrack() // analytics track init
const middleware = [thunkMiddleware]
const composeEnhancers =
(localStorage &&
......@@ -123,6 +128,7 @@ Promise.all([p1()])
<DashboardRouterWithContext />
</Provider>
</AppContainer>
<PaypalPopupDialog />
</ErrorBoundary>,
document.getElementById('mainDashboard'),
)
......
......@@ -189,6 +189,14 @@ class DomainsTab extends React.Component {
}
_onConnectDomainAfterRegister(newDomain) {
// free user won't connect domain
if (CurrentUserStore.isFreeMembership()) {
this.getDefaultBinding().set('showPurchaseSuccessMsg', true)
this._onBackToTab()
return
}
//
EditorActions.addDomainToPool(newDomain)
newDomain = `www.${newDomain}`
......@@ -615,22 +623,30 @@ class DomainsTab extends React.Component {
const forceShowKB =
v2DomainConnection && !v2DomainConnection.get('domain_id')
const isSiteOfResellerClient = PageMetaStore.isSiteOfResellerClient()
const canBuyAllDomains = ConfStore.getCanBuyAllDomains()
let registerDomainContainer
if (!isSxl) {
// rollout for new domain project v1
if (!canBuyAllDomains) {
if (domainPurchaseStatus === 'free') {
registerDomainContainer = (
<div className="register-domain">
{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" />,
link: <a href={
link: (
<a
href={
UserMetaStore.isZbjUser()
? 'javascript: alert("八戒云站暂不支持升级,请添加新的套餐。")'
: '/s/pricing?ref=free_domain'
} />,
}
/>
),
},
)}
<div
......@@ -672,6 +688,38 @@ class DomainsTab extends React.Component {
</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
......@@ -722,28 +770,15 @@ class DomainsTab extends React.Component {
<div
key="first-step"
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 && (
<div>
{showPurchaseSuccessMsg && (
<ReactTransitionGroup>
<JQSlide
component={DOM.div}
className="s-box green small fist">
<JQSlide component={DOM.div} className="s-box green small fist">
<i className="fa fa-check" />
{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 />,
......@@ -751,10 +786,14 @@ class DomainsTab extends React.Component {
},
)}
&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
href={
v2DomainSetting ? '/s/v2_domains/' : '/s#/domains'
}
href={v2DomainSetting ? '/s/v2_domains/' : '/s#/domains'}
target="_blank">
{__('Domain|View your new domain in domain dashboard.')}
</a>
......@@ -767,6 +806,8 @@ class DomainsTab extends React.Component {
</ReactTransitionGroup>
)}
{!isSiteOfResellerClient &&
(canBuyAllDomains ||
(!canBuyAllDomains && !CurrentUserStore.isFreeMembership())) &&
(showRegisterBtn ? (
<div className="form-field">
<div className="field-title">
......@@ -784,6 +825,15 @@ class DomainsTab extends React.Component {
<div className="hr" />
</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="field-title">
{__('Custom Domain/Subdomain')}
......@@ -812,7 +862,10 @@ class DomainsTab extends React.Component {
value={currentDomain}
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')}
{['updating', 'checking'].includes(customDomainStatus) ? (
<i className="fa fa-spinner fa-pulse right-icon" />
......
......@@ -15,6 +15,11 @@ import * as editorStoreCreator from 'js/reducers/editorStoreCreator'
import ComponentKitContext from 'js/utils/ComponentKitContext'
import wrapErrorBoundary from 'js/components/ErrorBoundary'
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
const supportedVerticals = ['personal']
const themeName = $S.stores.pageMeta.theme.name
......
......@@ -87,7 +87,7 @@ module.exports = class EntriesGenerationWebpackPlugin {
}
if (this.opts.appendMode && fse.existsSync(outputFile)) {
const previousJson = JSON.parse(
fse.readFileSync(outputFile).toString()
fse.readFileSync(outputFile).toString() || '{}'
)
json = JSON.stringify(Object.assign(previousJson, manifest), null, 2)
}
......
......@@ -64,10 +64,11 @@
"@types/jest": "^21.1.2",
"@types/lodash": "^4.14.61",
"@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-native": "^0.42.14",
"@types/react-redux": "^4.4.38",
"@types/react-redux": "^5.0.6",
"@types/react-router": "^2.0.49",
"@types/react-test-renderer": "^16.0.1",
"@types/redux-form": "^6.3.6",
......@@ -214,6 +215,7 @@
"hypernova-morearty": "git://github.com/strikingly/hypernova-morearty",
"hypernova-react": "^2.0.0",
"ie-version": "^0.1.0",
"immer": "^1.5.0",
"immutable": "github:strikingly/immutable-js#6fecef1e909bfe8eba4908c3f5aa4f8e126ce163",
"in-viewport": "^3.4.1",
"invariant": "^2.2.1",
......@@ -296,8 +298,9 @@
"sha1": "^1.1.1",
"shallow-equal": "^1.0.0",
"sw-toolbox": "^3.6.0",
"typescript": "^2.2.2",
"typescript": "^3.0.3",
"uglify-js": "2.7.5",
"url-join": "^4.0.0",
"uuid": "^2.0.1",
"validator": "^9.1.1",
"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