0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Enabled members lab setting for developer experiment flag (#10132)

closes #10114
 
* Members lab enabled to be always true behind developer experiments flag

* Members lab set to true for themes behind developer experiments flag

Note: This change uses hard-coded labs value for members based on enableDeveloperExperiments flag, ideal implementation for later is to pick those value from settings.
This commit is contained in:
Rishabh Garg 2018-11-09 17:12:21 +05:30 committed by GitHub
parent f660b6a77b
commit f2b44322a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 6 deletions

View file

@ -1,11 +1,18 @@
var settingsCache = require('./settings/cache'),
_ = require('lodash'),
Promise = require('bluebird'),
SafeString = require('./themes/engine').SafeString,
common = require('../lib/common'),
labs = module.exports = {};
const settingsCache = require('./settings/cache');
const _ = require('lodash');
const Promise = require('bluebird');
const SafeString = require('./themes/engine').SafeString;
const common = require('../lib/common');
const config = require('../config');
let labs = module.exports = {};
labs.isSet = function isSet(flag) {
/**
* TODO: Uses hard-check for members prototype, removed here when added to settings
*/
if (flag === 'members' && config.get('enableDeveloperExperiments')) {
return true;
}
var labsConfig = settingsCache.get('labs');
return labsConfig && labsConfig[flag] && labsConfig[flag] === true;
};

View file

@ -60,6 +60,15 @@ themeMiddleware.updateTemplateData = function updateTemplateData(req, res, next)
labsData = _.cloneDeep(settingsCache.get('labs')),
themeData = {};
/**
* TODO: Uses hard-check for members prototype, removed here when added to settings
*/
if (config.get('enableDeveloperExperiments')) {
Object.assign(labsData, {
members: true
});
}
if (activeTheme.get()) {
themeData.posts_per_page = activeTheme.get().config('posts_per_page');
}