0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added comments_enabled setting

refs https://github.com/TryGhost/Team/issues/1664

- comments are disabled by default, but can be enabled on any site
This commit is contained in:
Kevin Ansfield 2022-07-06 09:51:19 +02:00 committed by Hannah Wolfe
parent 301ae61aa9
commit b88212b603
5 changed files with 26 additions and 3 deletions

View file

@ -55,7 +55,8 @@ const EDITABLE_SETTINGS = [
'accent_color',
'editor_default_email_recipients',
'editor_default_email_recipients_filter',
'labs'
'labs',
'comments_enabled'
];
module.exports = {

View file

@ -0,0 +1,8 @@
const {addSetting} = require('../../utils');
module.exports = addSetting({
key: 'comments_enabled',
value: 'off',
type: 'string',
group: 'comments'
});

View file

@ -450,5 +450,19 @@
"defaultValue": "all",
"type": "string"
}
},
"comments": {
"comments_enabled": {
"type": "string",
"defaultValue": "off",
"validations": {
"isEmpty": false,
"isIn": [[
"off",
"all",
"paid"
]]
}
}
}
}

View file

@ -234,7 +234,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 = 69;
const allowedKeysLength = 70;
totalKeysLength.should.eql(SETTING_KEYS_BLOCKLIST.length + allowedKeysLength);
});
});

View file

@ -37,7 +37,7 @@ describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = 'c85378b0bbd7d5eeb1fff39796c30886';
const currentFixturesHash = '1d6562a1963a9b9d10d06070d537f11f';
const currentSettingsHash = '0b138cdd40e48b5b7dc4ebac2a7819a7';
const currentSettingsHash = 'd54210758b7054e2174fd34aa2320ad7';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
// If this test is failing, then it is likely a change has been made that requires a DB version bump,