mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Improve visibility's default handling (#11183)
no issue - Moved default_content_visibility out of labs as we should be extra careful with what is exposed in the labs + it doesn't really belong there.
This commit is contained in:
parent
a3f3a56589
commit
e214838039
3 changed files with 9 additions and 5 deletions
|
@ -194,6 +194,9 @@
|
|||
"members_session_secret": {
|
||||
"defaultValue": null
|
||||
},
|
||||
"default_content_visibility": {
|
||||
"defaultValue": "public"
|
||||
},
|
||||
"members_subscription_settings": {
|
||||
"defaultValue": "{\"isPaid\":false,\"paymentProcessors\":[{\"adapter\":\"stripe\",\"config\":{\"secret_token\":\"\",\"public_token\":\"\",\"product\":{\"name\":\"Ghost Subscription\"},\"plans\":[{\"name\":\"Monthly\",\"currency\":\"usd\",\"interval\":\"month\",\"amount\":\"\"},{\"name\":\"Yearly\",\"currency\":\"usd\",\"interval\":\"year\",\"amount\":\"\"}]}}]}"
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ Post = ghostBookshelf.Model.extend({
|
|||
defaults: function defaults() {
|
||||
let visibility = 'public';
|
||||
|
||||
if (settingsCache.get('labs') && (settingsCache.get('labs').members === true) && settingsCache.get('labs').default_content_visibility) {
|
||||
visibility = settingsCache.get('labs').default_content_visibility;
|
||||
if (settingsCache.get('labs') && (settingsCache.get('labs').members === true) && settingsCache.get('default_content_visibility')) {
|
||||
visibility = settingsCache.get('default_content_visibility');
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -113,7 +113,7 @@ describe('Unit: models/settings', function () {
|
|||
|
||||
return models.Settings.populateDefaults()
|
||||
.then(() => {
|
||||
eventSpy.callCount.should.equal(78);
|
||||
eventSpy.callCount.should.equal(80);
|
||||
|
||||
eventSpy.args[1][0].should.equal('settings.db_hash.added');
|
||||
eventSpy.args[1][1].attributes.type.should.equal('core');
|
||||
|
@ -122,7 +122,8 @@ describe('Unit: models/settings', function () {
|
|||
eventSpy.args[13][1].attributes.type.should.equal('blog');
|
||||
eventSpy.args[13][1].attributes.value.should.equal('The professional publishing platform');
|
||||
|
||||
eventSpy.args[77][0].should.equal('settings.members_subscription_settings.added');
|
||||
eventSpy.args[77][0].should.equal('settings.default_content_visibility.added');
|
||||
eventSpy.args[79][0].should.equal('settings.members_subscription_settings.added');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -136,7 +137,7 @@ describe('Unit: models/settings', function () {
|
|||
|
||||
return models.Settings.populateDefaults()
|
||||
.then(() => {
|
||||
eventSpy.callCount.should.equal(76);
|
||||
eventSpy.callCount.should.equal(78);
|
||||
|
||||
eventSpy.args[13][0].should.equal('settings.logo.added');
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue