Added new settings for members modal settings (#11927)

no issue

-  Adds new settings for members modal customization to default settings
- `membersjs_show_beacon` controls the visibility of beacon in members modal
- `membersjs_show_signup_name` controls the visibility of name field in signup
- `membersjs_allowed_plans` controls the visibility of plans allowed for member to signup with
-  Adds stripe connect check to determine if stripe is setup or not
-  Adds the 3 new settings to members site data
This commit is contained in:
Rishabh Garg 2020-06-18 17:11:08 +05:30 committed by GitHub
parent 78bf5d1e21
commit ea7d450a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View File

@ -220,6 +220,23 @@
},
"stripe_connect_integration": {
"defaultValue": "{}"
},
"membersjs_show_signup_name": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [["true", "false"]]
}
},
"membersjs_show_beacon": {
"defaultValue": "true",
"validations": {
"isEmpty": false,
"isIn": [["true", "false"]]
}
},
"membersjs_allowed_plans": {
"defaultValue": "[\"free\", \"monthly\", \"yearly\"]"
}
},
"bulk_email": {

View File

@ -89,7 +89,9 @@ const getMemberSiteData = async function (req, res) {
);
const stripeSecretToken = stripePaymentProcessor && stripePaymentProcessor.config.secret_token;
const stripePublicToken = stripePaymentProcessor && stripePaymentProcessor.config.public_token;
const isStripeConfigured = (!!stripeSecretToken && stripeSecretToken !== '' && !!stripePublicToken && stripePublicToken !== '');
const stripeConnectIntegration = settingsCache.get('stripe_connect_integration');
const isStripeConfigured = (!!stripeSecretToken && !!stripePublicToken) || !!(stripeConnectIntegration && stripeConnectIntegration.account_id);
const response = {
title: settingsCache.get('title'),
description: settingsCache.get('description'),
@ -99,7 +101,10 @@ const getMemberSiteData = async function (req, res) {
version: ghostVersion.safe,
plans: membersService.config.getPublicPlans(),
allowSelfSignup: membersService.config.getAllowSelfSignup(),
isStripeConfigured
isStripeConfigured,
show_beacon: settingsCache.get('membersjs_show_beacon'),
show_signup_name: settingsCache.get('membersjs_show_signup_name'),
allowed_plans: settingsCache.get('membersjs_allowed_plans')
};
// Brand is currently an experimental feature