No more feature flag for Code Injection

closes #1993

- remove the feature/config flag that means code injection has to be enabled
This commit is contained in:
Hannah Wolfe 2015-04-09 17:52:41 +01:00
parent 1162b72acb
commit 7a5a9eed69
5 changed files with 3 additions and 54 deletions

View File

@ -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');
})
});

View File

@ -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;

View File

@ -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,

View File

@ -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 () {

View File

@ -44,23 +44,4 @@
</fieldset>
</form>
<hr>
<form>
<fieldset>
{{#unless codeUIFlag}}
<div class="form-group for-checkbox">
<label for="labs-codeInjectionUI">Code Injection</label>
<label class="check box" for="labs-codeInjectionUI">
{{input id="labs-codeInjectionUI" name="labs[codeInjectionUI]" type="checkbox"
checked=useCodeInjectionUI}}
<span class="input-toggle-component"></span>
<p>Enable the code injection interface</p>
</label>
<p>A settings screen which enables you to add code into your theme (work in progress)</p>
</div>
{{/unless}}
</fieldset>
</form>
</section>