mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
Merge pull request #5125 from ErisDS/ci-remove-flag
No more feature flag for Code Injection
This commit is contained in:
commit
fae709b79b
@ -24,10 +24,6 @@ var FeatureController = Ember.Controller.extend(Ember.PromiseProxyMixin, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}),
|
|
||||||
|
|
||||||
codeInjectionUI: Ember.computed('config.codeInjectionUI', 'labs.codeInjectionUI', function () {
|
|
||||||
return this.get('config.codeInjectionUI') || this.get('labs.codeInjectionUI');
|
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
var SettingsController = Ember.Controller.extend({
|
var SettingsController = Ember.Controller.extend({
|
||||||
needs: ['feature'],
|
|
||||||
|
|
||||||
showGeneral: Ember.computed('session.user.name', function () {
|
showGeneral: Ember.computed('session.user.name', function () {
|
||||||
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
|
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 () {
|
showNavigation: Ember.computed('session.user.name', function () {
|
||||||
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
|
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
|
||||||
}),
|
}),
|
||||||
showCodeInjection: Ember.computed('session.user.name', 'controllers.feature.codeInjectionUI', function () {
|
showCodeInjection: Ember.computed('session.user.name', function () {
|
||||||
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') || !this.get('controllers.feature.codeInjectionUI') ? false : true;
|
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
|
||||||
}),
|
}),
|
||||||
showLabs: Ember.computed('session.user.name', function () {
|
showLabs: Ember.computed('session.user.name', function () {
|
||||||
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
|
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
|
||||||
|
@ -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: {
|
actions: {
|
||||||
onUpload: function (file) {
|
onUpload: function (file) {
|
||||||
var self = this,
|
var self = this,
|
||||||
|
@ -7,24 +7,9 @@ var SettingsCodeInjectionRoute = AuthenticatedRoute.extend(styleBody, loadingInd
|
|||||||
classNames: ['settings-view-code'],
|
classNames: ['settings-view-code'],
|
||||||
|
|
||||||
beforeModel: function () {
|
beforeModel: function () {
|
||||||
var feature = this.controllerFor('feature'),
|
|
||||||
self = this;
|
|
||||||
|
|
||||||
if (!feature) {
|
|
||||||
this.generateController('feature');
|
|
||||||
feature = this.controllerFor('feature');
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.currentUser()
|
return this.currentUser()
|
||||||
.then(this.transitionAuthor())
|
.then(this.transitionAuthor())
|
||||||
.then(this.transitionEditor())
|
.then(this.transitionEditor());
|
||||||
.then(function () {
|
|
||||||
return feature.then(function () {
|
|
||||||
if (!feature.get('codeInjectionUI')) {
|
|
||||||
return self.transitionTo('settings.general');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
model: function () {
|
model: function () {
|
||||||
|
@ -44,23 +44,4 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</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>
|
</section>
|
||||||
|
@ -11,7 +11,6 @@ function getValidKeys() {
|
|||||||
var validKeys = {
|
var validKeys = {
|
||||||
fileStorage: config.fileStorage === false ? false : true,
|
fileStorage: config.fileStorage === false ? false : true,
|
||||||
apps: config.apps === true ? true : false,
|
apps: config.apps === true ? true : false,
|
||||||
codeInjectionUI: config.codeInjectionUI === true ? true : false,
|
|
||||||
version: config.ghostVersion,
|
version: config.ghostVersion,
|
||||||
environment: process.env.NODE_ENV,
|
environment: process.env.NODE_ENV,
|
||||||
database: config.database.client,
|
database: config.database.client,
|
||||||
|
Loading…
Reference in New Issue
Block a user