From 0b1497a75bb88bec79f57207ed03c920c10780ab Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Thu, 9 Apr 2015 17:52:41 +0100 Subject: [PATCH] No more feature flag for Code Injection closes #1993 - remove the feature/config flag that means code injection has to be enabled --- core/client/app/controllers/feature.js | 4 ---- core/client/app/controllers/settings.js | 5 ++--- core/client/app/controllers/settings/labs.js | 12 ------------ .../app/routes/settings/code-injection.js | 17 +---------------- core/client/app/templates/settings/labs.hbs | 19 ------------------- core/server/api/configuration.js | 1 - 6 files changed, 3 insertions(+), 55 deletions(-) diff --git a/core/client/app/controllers/feature.js b/core/client/app/controllers/feature.js index 4acc795b30..2e9c829d9a 100644 --- a/core/client/app/controllers/feature.js +++ b/core/client/app/controllers/feature.js @@ -24,10 +24,6 @@ var FeatureController = Ember.Controller.extend(Ember.PromiseProxyMixin, { } return value; - }), - - codeInjectionUI: Ember.computed('config.codeInjectionUI', 'labs.codeInjectionUI', function () { - return this.get('config.codeInjectionUI') || this.get('labs.codeInjectionUI'); }) }); diff --git a/core/client/app/controllers/settings.js b/core/client/app/controllers/settings.js index 5dbd817658..2f2bec5920 100644 --- a/core/client/app/controllers/settings.js +++ b/core/client/app/controllers/settings.js @@ -1,6 +1,5 @@ import Ember from 'ember'; var SettingsController = Ember.Controller.extend({ - needs: ['feature'], showGeneral: Ember.computed('session.user.name', function () { return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true; @@ -14,8 +13,8 @@ var SettingsController = Ember.Controller.extend({ showNavigation: Ember.computed('session.user.name', function () { return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true; }), - showCodeInjection: Ember.computed('session.user.name', 'controllers.feature.codeInjectionUI', function () { - return this.get('session.user.isAuthor') || this.get('session.user.isEditor') || !this.get('controllers.feature.codeInjectionUI') ? false : true; + showCodeInjection: Ember.computed('session.user.name', function () { + return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true; }), showLabs: Ember.computed('session.user.name', function () { return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true; diff --git a/core/client/app/controllers/settings/labs.js b/core/client/app/controllers/settings/labs.js index 8db0e4c5a8..0cfd0062bb 100644 --- a/core/client/app/controllers/settings/labs.js +++ b/core/client/app/controllers/settings/labs.js @@ -23,18 +23,6 @@ var LabsController = Ember.Controller.extend(Ember.Evented, { }); }, - codeUIFlag: Ember.computed.alias('config.codeInjectionUI'), - - useCodeInjectionUI: Ember.computed('controllers.feature.codeInjectionUI', function (key, value) { - // setter - if (arguments.length > 1) { - this.saveLabs('codeInjectionUI', value); - } - - // getter - return this.get('controllers.feature.codeInjectionUI') || false; - }), - actions: { onUpload: function (file) { var self = this, diff --git a/core/client/app/routes/settings/code-injection.js b/core/client/app/routes/settings/code-injection.js index 78bf8c798f..2d1f4f3c1d 100644 --- a/core/client/app/routes/settings/code-injection.js +++ b/core/client/app/routes/settings/code-injection.js @@ -7,24 +7,9 @@ var SettingsCodeInjectionRoute = AuthenticatedRoute.extend(styleBody, loadingInd classNames: ['settings-view-code'], beforeModel: function () { - var feature = this.controllerFor('feature'), - self = this; - - if (!feature) { - this.generateController('feature'); - feature = this.controllerFor('feature'); - } - return this.currentUser() .then(this.transitionAuthor()) - .then(this.transitionEditor()) - .then(function () { - return feature.then(function () { - if (!feature.get('codeInjectionUI')) { - return self.transitionTo('settings.general'); - } - }); - }); + .then(this.transitionEditor()); }, model: function () { diff --git a/core/client/app/templates/settings/labs.hbs b/core/client/app/templates/settings/labs.hbs index aaeea4caf4..db4719979a 100644 --- a/core/client/app/templates/settings/labs.hbs +++ b/core/client/app/templates/settings/labs.hbs @@ -44,23 +44,4 @@ -
- -
-
- {{#unless codeUIFlag}} -
- - -

A settings screen which enables you to add code into your theme (work in progress)

-
- {{/unless}} -
-
- diff --git a/core/server/api/configuration.js b/core/server/api/configuration.js index 75a203cea8..52e5e7fb5a 100644 --- a/core/server/api/configuration.js +++ b/core/server/api/configuration.js @@ -11,7 +11,6 @@ function getValidKeys() { var validKeys = { fileStorage: config.fileStorage === false ? false : true, apps: config.apps === true ? true : false, - codeInjectionUI: config.codeInjectionUI === true ? true : false, version: config.ghostVersion, environment: process.env.NODE_ENV, database: config.database.client,