mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Added ability to pass 'flags' field into new settings
refs 3b90b1f335
refs https://github.com/TryGhost/Team/issues/3011
- The "flags" property was missing from the allowed parameters in addSettings migrations utility method. Passing in "flags" is needed to complete a refed issue where we add a new "announcement" group of settings and two of these settings have a "PUBLIC" flag
This commit is contained in:
parent
a9974742cc
commit
7969399cdf
@ -6,11 +6,15 @@ const {MIGRATION_USER} = require('./constants');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a migration which will insert a new setting in settings table
|
* Creates a migration which will insert a new setting in settings table
|
||||||
* @param {object} settingSpec - setting key, value, group and type
|
* @param {object} settingSpec - setting type and group
|
||||||
*
|
* @param {string} settingSpec.key - settings key
|
||||||
|
* @param {*} settingSpec.value - settings value
|
||||||
|
* @param {'array' | 'string' | 'number' | 'boolean' | 'object'} settingSpec.type - settings type
|
||||||
|
* @param {string} settingSpec.group - settings group
|
||||||
|
* @param {'PUBLIC' | 'RO' | 'PUBLIC,RO'} [settingSpec.flags] - settings flag
|
||||||
* @returns {Object} migration object returning config/up/down properties
|
* @returns {Object} migration object returning config/up/down properties
|
||||||
*/
|
*/
|
||||||
function addSetting({key, value, type, group}) {
|
function addSetting({key, value, type, group, flags = null}) {
|
||||||
return createTransactionalMigration(
|
return createTransactionalMigration(
|
||||||
async function up(connection) {
|
async function up(connection) {
|
||||||
const settingExists = await connection('settings')
|
const settingExists = await connection('settings')
|
||||||
@ -31,6 +35,7 @@ function addSetting({key, value, type, group}) {
|
|||||||
value,
|
value,
|
||||||
group,
|
group,
|
||||||
type,
|
type,
|
||||||
|
flags,
|
||||||
created_at: now,
|
created_at: now,
|
||||||
created_by: MIGRATION_USER
|
created_by: MIGRATION_USER
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user