Skip to content

Commit

Permalink
Move tag management from behind config/labs flags
Browse files Browse the repository at this point in the history
issue TryGhost#4248

- tag management is ready for release, this takes the training wheels off :)
- remove config flag
- remove labs checkbox and related code
  • Loading branch information
ErisDS committed Jan 6, 2015
1 parent a7b4059 commit 1f22d8c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 47 deletions.
4 changes: 0 additions & 4 deletions core/client/controllers/feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
})
Expand Down
4 changes: 2 additions & 2 deletions core/client/controllers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 1 addition & 12 deletions core/client/controllers/settings/labs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 1 addition & 16 deletions core/client/routes/settings/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
12 changes: 0 additions & 12 deletions core/client/templates/settings/labs.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 0 additions & 1 deletion core/server/api/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1f22d8c

Please sign in to comment.