mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Wired up stripeEnabled to Koenig config (#20750)
ref PLG-109 - Added a boolean config property `stripeEnabled` to the configuration. - This property is now passed down to the Koenig Editor to manage features based on Stripe connectivity.
This commit is contained in:
parent
5ba74b0243
commit
e920888832
1 changed files with 12 additions and 1 deletions
|
@ -441,6 +441,16 @@ export default class KoenigLexicalEditor extends Component {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const checkStripeEnabled = () => {
|
||||||
|
const hasDirectKeys = !!(this.settings.stripeSecretKey && this.settings.stripePublishableKey);
|
||||||
|
const hasConnectKeys = !!(this.settings.stripeConnectSecretKey && this.settings.stripeConnectPublishableKey);
|
||||||
|
|
||||||
|
if (this.config.stripeDirect) {
|
||||||
|
return hasDirectKeys;
|
||||||
|
}
|
||||||
|
return hasDirectKeys || hasConnectKeys;
|
||||||
|
};
|
||||||
|
|
||||||
const defaultCardConfig = {
|
const defaultCardConfig = {
|
||||||
unsplash: this.settings.unsplash ? unsplashConfig.defaultHeaders : null,
|
unsplash: this.settings.unsplash ? unsplashConfig.defaultHeaders : null,
|
||||||
tenor: this.config.tenor?.googleApiKey ? this.config.tenor : null,
|
tenor: this.config.tenor?.googleApiKey ? this.config.tenor : null,
|
||||||
|
@ -461,7 +471,8 @@ export default class KoenigLexicalEditor extends Component {
|
||||||
searchLinks,
|
searchLinks,
|
||||||
siteTitle: this.settings.title,
|
siteTitle: this.settings.title,
|
||||||
siteDescription: this.settings.description,
|
siteDescription: this.settings.description,
|
||||||
siteUrl: this.config.getSiteUrl('/')
|
siteUrl: this.config.getSiteUrl('/'),
|
||||||
|
stripeEnabled: checkStripeEnabled() // returns a boolean
|
||||||
};
|
};
|
||||||
const cardConfig = Object.assign({}, defaultCardConfig, props.cardConfig, {pinturaConfig: this.pinturaConfig});
|
const cardConfig = Object.assign({}, defaultCardConfig, props.cardConfig, {pinturaConfig: this.pinturaConfig});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue