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

Move tag management from behind config/labs flags

issue #4248

- tag management is ready for release, this takes the training wheels off :)
- remove config flag
- remove labs checkbox and related code
This commit is contained in:
Hannah Wolfe 2014-12-31 12:57:00 +00:00
parent a7b405924a
commit 1f22d8c28c
6 changed files with 4 additions and 47 deletions

View file

@ -25,10 +25,6 @@ var FeatureController = Ember.Controller.extend(Ember.PromiseProxyMixin, {
return value;
}),
tagsUI: Ember.computed('config.tagsUI', 'labs.tagsUI', function () {
return this.get('config.tagsUI') || this.get('labs.tagsUI');
}),
codeInjectionUI: Ember.computed('config.codeInjectionUI', 'labs.codeInjectionUI', function () {
return this.get('config.codeInjectionUI') || this.get('labs.codeInjectionUI');
})

View file

@ -7,8 +7,8 @@ var SettingsController = Ember.Controller.extend({
showUsers: Ember.computed('session.user.name', function () {
return this.get('session.user.isAuthor') ? false : true;
}),
showTags: Ember.computed('session.user.name', 'controllers.feature.tagsUI', function () {
return this.get('session.user.isAuthor') || !this.get('controllers.feature.tagsUI') ? false : true;
showTags: Ember.computed('session.user.name', function () {
return this.get('session.user.isAuthor') ? 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;

View file

@ -22,20 +22,9 @@ var LabsController = Ember.Controller.extend(Ember.Evented, {
});
},
tagsUIFlag: Ember.computed.alias('config.tagsUI'),
codeUIFlag: Ember.computed.alias('config.codeInjectionUI'),
useTagsUI: Ember.computed('controllers.feature.tagsUI', function (key, value) {
// setter
if (arguments.length > 1) {
this.saveLabs('tagsUI', value);
}
// getter
return this.get('controllers.feature.tagsUI') || false;
}),
useCodeInjectionUI: Ember.computed('controllers.feature.tagsUI', function (key, value) {
useCodeInjectionUI: Ember.computed('controllers.feature.codeInjectionUI', function (key, value) {
// setter
if (arguments.length > 1) {
this.saveLabs('codeInjectionUI', value);

View file

@ -21,23 +21,8 @@ TagsRoute = AuthenticatedRoute.extend(CurrentUserSettings, PaginationRouteMixin,
titleToken: 'Tags',
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(function () {
return feature.then(function () {
if (!feature.get('tagsUI')) {
return self.transitionTo('settings.general');
}
});
});
.then(this.transitionAuthor());
},
model: function () {

View file

@ -47,18 +47,6 @@
<form>
<fieldset>
{{#unless tagsUIFlag}}
<div class="form-group for-checkbox">
<label for="labs-tagsUI">Tag Management</label>
<label class="checkbox" for="labs-tagsUI">
{{input id="labs-tagsUI" name="labs[tagsUI]" type="checkbox" checked=useTagsUI}}
<span class="input-toggle-component"></span>
<p>Enable the tag management interface</p>
</label>
<p>A settings screen which enables you to add, edit and delete tags (work in progress)</p>
</div>
{{/unless}}
{{#unless codeUIFlag}}
<div class="form-group for-checkbox">
<label for="labs-codeInjectionUI">Code Injection</label>

View file

@ -11,7 +11,6 @@ function getValidKeys() {
var validKeys = {
fileStorage: config.fileStorage === false ? false : true,
apps: config.apps === true ? true : false,
tagsUI: config.tagsUI === true ? true : false,
codeInjectionUI: config.codeInjectionUI === true ? true : false,
version: config.ghostVersion,
environment: process.env.NODE_ENV,