mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Added default_content_visibility_tiers
setting for default tiers visibility
refs https://github.com/TryGhost/Team/issues/1071 Default content visibility for a post can be one of `public|members|paid|tiers`, where `tiers` denotes visibility restricted to specific tiers. This change adds a new setting to store the tier ids when default content visibility is set to `tiers`. This closely matches how the visibility is stored on `posts` table as well, with `visibility` stored as `tiers` and tiers data is stored on tiers pivot table.
This commit is contained in:
parent
d41e980dba
commit
6f89ccf901
@ -0,0 +1,8 @@
|
||||
const {addSetting} = require('../../utils.js');
|
||||
|
||||
module.exports = addSetting({
|
||||
key: 'default_content_visibility_tiers',
|
||||
value: '[]',
|
||||
type: 'array',
|
||||
group: 'members'
|
||||
});
|
@ -235,6 +235,10 @@
|
||||
"defaultValue": "public",
|
||||
"type": "string"
|
||||
},
|
||||
"default_content_visibility_tiers": {
|
||||
"defaultValue": "[]",
|
||||
"type": "array"
|
||||
},
|
||||
"members_signup_access": {
|
||||
"defaultValue": "all",
|
||||
"validations": {
|
||||
|
@ -144,6 +144,11 @@ const defaultSettingsKeyTypes = [
|
||||
type: 'string',
|
||||
group: 'members'
|
||||
},
|
||||
{
|
||||
key: 'default_content_visibility_tiers',
|
||||
type: 'array',
|
||||
group: 'members'
|
||||
},
|
||||
{
|
||||
key: 'members_signup_access',
|
||||
type: 'string',
|
||||
|
@ -199,7 +199,7 @@ describe('Exporter', function () {
|
||||
|
||||
// NOTE: if default settings changed either modify the settings keys blocklist or increase allowedKeysLength
|
||||
// This is a reminder to think about the importer/exporter scenarios ;)
|
||||
const allowedKeysLength = 84;
|
||||
const allowedKeysLength = 85;
|
||||
totalKeysLength.should.eql(SETTING_KEYS_BLOCKLIST.length + allowedKeysLength);
|
||||
});
|
||||
});
|
||||
|
@ -37,7 +37,7 @@ describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = '9e4eeb5c260047fe21d1f93c523bd771';
|
||||
const currentFixturesHash = 'beb040c0376a492c2a44767fdd825a3e';
|
||||
const currentSettingsHash = 'd73b63e33153c9256bca42ebfd376779';
|
||||
const currentSettingsHash = '437d4c6da8759f5c35f11f811b86e5bc';
|
||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||
|
||||
// If this test is failing, then it is likely a change has been made that requires a DB version bump,
|
||||
|
Loading…
Reference in New Issue
Block a user