mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Added new settings for members modal
no issue
- reverts commit 87c31444fd
but with modifications to settings naming
- Adds new settings for members modal customization to default settings
- `portal_button` controls the visibility of beacon in members modal
- `portal_name` controls the visibility of name field in signup
- `portal_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
- Updates to snake case naming for members site API data
This commit is contained in:
parent
4b145df42b
commit
77e1ada6c6
3 changed files with 28 additions and 4 deletions
|
@ -222,6 +222,25 @@
|
|||
"defaultValue": "{}"
|
||||
}
|
||||
},
|
||||
"portal" : {
|
||||
"portal_name": {
|
||||
"defaultValue": "true",
|
||||
"validations": {
|
||||
"isEmpty": false,
|
||||
"isIn": [["true", "false"]]
|
||||
}
|
||||
},
|
||||
"portal_button": {
|
||||
"defaultValue": "true",
|
||||
"validations": {
|
||||
"isEmpty": false,
|
||||
"isIn": [["true", "false"]]
|
||||
}
|
||||
},
|
||||
"portal_plans": {
|
||||
"defaultValue": "[\"free\", \"monthly\", \"yearly\"]"
|
||||
}
|
||||
},
|
||||
"bulk_email": {
|
||||
"bulk_email_settings": {
|
||||
"defaultValue": "{\"provider\":\"mailgun\", \"apiKey\": \"\", \"domain\": \"\", \"baseUrl\": \"\"}"
|
||||
|
|
|
@ -152,7 +152,7 @@ module.exports = {
|
|||
maxlength: 50,
|
||||
nullable: false,
|
||||
defaultTo: 'core',
|
||||
validations: {isIn: [['core', 'blog', 'theme', 'private', 'members', 'bulk_email']]}
|
||||
validations: {isIn: [['core', 'blog', 'theme', 'private', 'members', 'bulk_email', 'portal']]}
|
||||
},
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
created_by: {type: 'string', maxlength: 24, nullable: false},
|
||||
|
|
|
@ -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'),
|
||||
|
@ -98,8 +100,11 @@ const getMemberSiteData = async function (req, res) {
|
|||
url: urlUtils.urlFor('home', true),
|
||||
version: ghostVersion.safe,
|
||||
plans: membersService.config.getPublicPlans(),
|
||||
allowSelfSignup: membersService.config.getAllowSelfSignup(),
|
||||
isStripeConfigured
|
||||
allow_self_signup: membersService.config.getAllowSelfSignup(),
|
||||
is_stripe_configured: isStripeConfigured,
|
||||
portal_button: settingsCache.get('portal_button'),
|
||||
portal_name: settingsCache.get('portal_name'),
|
||||
portal_plans: settingsCache.get('portal_plans')
|
||||
};
|
||||
|
||||
// Brand is currently an experimental feature
|
||||
|
|
Loading…
Add table
Reference in a new issue