Skip to content

Commit

Permalink
Koenig - Remove developer experiments flag requirement
Browse files Browse the repository at this point in the history
refs TryGhost#9505
- remove requirement for the `enableDeveloperExperiments` flag to be able to use Koenig
- it's now possible to enable as a standard Labs beta feature
  • Loading branch information
kevinansfield authored and ololoken committed May 16, 2018
1 parent fcaa3ee commit 29e214a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/client
3 changes: 1 addition & 2 deletions core/server/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ Post = ghostBookshelf.Model.extend({
// TODO: re-render all content and remove the version toggle for Ghost 2.0
if (mobiledoc) {
let version = 1;
let devExperimentsEnabled = config.get('enableDeveloperExperiments');
let koenigEnabled = labs.isSet('koenigEditor') === true;

let mobiledocIsCompatibleWithV1 = function mobiledocIsCompatibleWithV1(doc) {
Expand All @@ -275,7 +274,7 @@ Post = ghostBookshelf.Model.extend({
return false;
};

if ((devExperimentsEnabled && koenigEnabled) || !mobiledocIsCompatibleWithV1(mobiledoc)) {
if (koenigEnabled || !mobiledocIsCompatibleWithV1(mobiledoc)) {
version = 2;
}

Expand Down
4 changes: 0 additions & 4 deletions core/test/unit/models/post_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,6 @@ describe('Unit: models/post', function () {
});

describe('Mobiledoc conversion', function () {
let configUtils = require('../../utils/configUtils');
let labs = require('../../../server/services/labs');
let origLabs = _.cloneDeep(labs);
let events;
Expand All @@ -1906,10 +1905,7 @@ describe('Unit: models/post', function () {
});
});

afterEach(configUtils.restore);

it('uses v2 if Koenig is enabled', function () {
configUtils.set('enableDeveloperExperiments', true);
sandbox.stub(labs, 'isSet').callsFake(function (key) {
if (key === 'koenigEditor') {
return true;
Expand Down

0 comments on commit 29e214a

Please sign in to comment.