mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Enabled members by default (#11190)
no-issue This removes the need for `enableDeveloperExperiments` flag for members
This commit is contained in:
parent
e33c46f3d1
commit
df8a67a9ca
4 changed files with 8 additions and 24 deletions
|
@ -1,8 +1,7 @@
|
|||
const _ = require('lodash'),
|
||||
Promise = require('bluebird'),
|
||||
debug = require('ghost-ignition').debug('services:routing:controllers:static'),
|
||||
helpers = require('../helpers'),
|
||||
config = require('../../../../server/config');
|
||||
helpers = require('../helpers');
|
||||
|
||||
function processQuery(query, locals) {
|
||||
const api = require('../../../../server/api')[locals.apiVersion];
|
||||
|
@ -18,13 +17,11 @@ function processQuery(query, locals) {
|
|||
});
|
||||
}
|
||||
|
||||
if (config.get('enableDeveloperExperiments')) {
|
||||
Object.assign(query.options, {
|
||||
context: {
|
||||
members: locals.member
|
||||
}
|
||||
});
|
||||
}
|
||||
Object.assign(query.options, {
|
||||
context: {
|
||||
members: locals.member
|
||||
}
|
||||
});
|
||||
|
||||
return api[query.controller][query.type](query.options);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ const Promise = require('bluebird');
|
|||
const url = require('url');
|
||||
const debug = require('ghost-ignition').debug('services:routing:helpers:entry-lookup');
|
||||
const routeMatch = require('path-match')();
|
||||
const config = require('../../../../server/config');
|
||||
|
||||
/**
|
||||
* @description Query API for a single entry/resource.
|
||||
|
@ -43,9 +42,7 @@ function entryLookup(postUrl, routerOptions, locals) {
|
|||
include: 'authors,tags'
|
||||
};
|
||||
|
||||
if (config.get('enableDeveloperExperiments')) {
|
||||
options.context = {member: locals.member};
|
||||
}
|
||||
options.context = {member: locals.member};
|
||||
|
||||
return (api[routerOptions.query.controller] || api[routerOptions.query.resource])
|
||||
.read(_.extend(_.pick(params, 'slug', 'id'), options))
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
*/
|
||||
const _ = require('lodash');
|
||||
const Promise = require('bluebird');
|
||||
const config = require('../../../../server/config');
|
||||
|
||||
// The default settings for a default post query
|
||||
// @TODO: get rid of this config and use v2, v3 config
|
||||
|
@ -60,9 +59,7 @@ function processQuery(query, slugParam, locals) {
|
|||
query.options[name] = _.isString(option) ? option.replace(/%s/g, slugParam) : option;
|
||||
});
|
||||
|
||||
if (config.get('enableDeveloperExperiments')) {
|
||||
query.options.context = {member: locals.member};
|
||||
}
|
||||
query.options.context = {member: locals.member};
|
||||
|
||||
return (api[query.controller] || api[query.resource])[query.type](query.options);
|
||||
}
|
||||
|
|
|
@ -3,17 +3,10 @@ const _ = require('lodash');
|
|||
const Promise = require('bluebird');
|
||||
const SafeString = require('../../frontend/services/themes/engine').SafeString;
|
||||
const common = require('../lib/common');
|
||||
const config = require('../config');
|
||||
let labs = module.exports = {};
|
||||
|
||||
labs.isSet = function isSet(flag) {
|
||||
var labsConfig = settingsCache.get('labs');
|
||||
/**
|
||||
* TODO: Uses hard-check for members prototype, removed here when added to settings
|
||||
*/
|
||||
if (flag === 'members') {
|
||||
return config.get('enableDeveloperExperiments') && labsConfig && labsConfig[flag] && labsConfig[flag] === true;
|
||||
}
|
||||
return labsConfig && labsConfig[flag] && labsConfig[flag] === true;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue