From aaa8fd3535cfc951fd2bb84c99e88c29dd3a9ef3 Mon Sep 17 00:00:00 2001 From: Rish Date: Fri, 19 Jun 2020 20:02:53 +0530 Subject: [PATCH] Updated new portal settings naming no issue - Previously, the settings used for customization were `show_beacon`, `show_signup_name` and `allowed_plans` - These settings were renamed to `portal_button`, `portal_name` and `portal_plans` respectively - Updates usage of settings to new names --- ghost/portal/src/App.js | 6 +++--- .../src/components/pages/AccountHomePage.js | 4 ++-- ghost/portal/src/components/pages/SignupPage.js | 15 ++++++++++----- ghost/portal/src/utils/fixtures.js | 7 +++++-- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ghost/portal/src/App.js b/ghost/portal/src/App.js index 566d41d8c3..a6d993d662 100644 --- a/ghost/portal/src/App.js +++ b/ghost/portal/src/App.js @@ -83,7 +83,7 @@ export default class App extends React.Component { try { this.GhostApi = setupGhostApi({siteUrl}); const {site, member} = await this.GhostApi.init(); - site.isStripeConfigured = (site.isStripeConfigured === undefined) || site.isStripeConfigured; + site.is_stripe_configured = (site.is_stripe_configured === undefined) || site.is_stripe_configured; const stripeParam = this.getStripeUrlParam(); const {page, showPopup = false} = this.getDefaultPage({member, stripeParam}); this.setState({ @@ -245,8 +245,8 @@ export default class App extends React.Component { } renderTriggerButton() { - const {site} = this.state; - if (site.show_beacon === undefined || site.show_beacon) { + const {portal_button: portalButton} = this.state.site; + if (portalButton === undefined || portalButton) { return ( { - if (allowedPlans === undefined || allowedPlans.includes(plan.name.toLowerCase())) { + if (portalPlans === undefined || portalPlans.includes(plan.name.toLowerCase())) { plansData.push(plan); } }); @@ -132,8 +137,8 @@ class SignupPage extends React.Component { } renderNameField() { - const {site} = this.context; - if (site.show_signup_name === undefined || site.show_signup_name) { + const {portal_name: portalName} = this.context.site; + if (portalName === undefined || portalName) { return this.renderInputField('name'); } return null; diff --git a/ghost/portal/src/utils/fixtures.js b/ghost/portal/src/utils/fixtures.js index 4bb1724067..53644bf674 100644 --- a/ghost/portal/src/utils/fixtures.js +++ b/ghost/portal/src/utils/fixtures.js @@ -12,8 +12,11 @@ export const site = { currency: 'USD', currency_symbol: '$' }, - allowSelfSignup: true, - isStripeConfigured: true + allow_self_signup: true, + is_stripe_configured: true, + portal_button: true, + portal_name: true, + portal_plans: ['free', 'monthly', 'yearly'] }; export const member = {