From 633c175a8a3e396b0de6229ee37777882047fb12 Mon Sep 17 00:00:00 2001 From: Kane York Date: Tue, 25 Aug 2015 13:30:09 -0700 Subject: [PATCH] FIX: Badge SQL controls would never show up, needed refresh --- .../admin/controllers/admin-badges-show.js.es6 | 9 +++++++++ app/assets/javascripts/discourse/models/badge.js.es6 | 5 ----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 index a44b6a0b7..96547435d 100644 --- a/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 @@ -16,6 +16,15 @@ export default Ember.Controller.extend(BufferedContent, { showDisplayName: propertyNotEqual('name', 'displayName'), canEditDescription: Em.computed.none('buffered.translatedDescription'), + hasQuery: function() { + const bQuery = this.get('buffered.query'); + if (bQuery) { + return bQuery.trim().length > 0; + } + const mQuery = this.get('model.query'); + return mQuery && mQuery.trim().length > 0; + }.property('model.query', 'buffered.query'), + _resetSaving: function() { this.set('saving', false); this.set('savingStatus', ''); diff --git a/app/assets/javascripts/discourse/models/badge.js.es6 b/app/assets/javascripts/discourse/models/badge.js.es6 index 670a84111..fbda32fba 100644 --- a/app/assets/javascripts/discourse/models/badge.js.es6 +++ b/app/assets/javascripts/discourse/models/badge.js.es6 @@ -5,11 +5,6 @@ const Badge = RestModel.extend({ newBadge: Em.computed.none('id'), - hasQuery: function(){ - const query = this.get('query'); - return query && query.trim().length > 0; - }.property('query'), - /** @private