diff --git a/assets/javascripts/discourse/components/query-result.js.es6 b/assets/javascripts/discourse/components/query-result.js.es6 index 772adbb..0ad5a26 100644 --- a/assets/javascripts/discourse/components/query-result.js.es6 +++ b/assets/javascripts/discourse/components/query-result.js.es6 @@ -1,6 +1,7 @@ import { ajax } from 'discourse/lib/ajax'; import Badge from 'discourse/models/badge'; import { getOwner } from 'discourse-common/lib/get-owner'; +import { default as computed } from 'ember-addons/ember-computed-decorators'; function randomIdShort() { return 'xxxxxxxx'.replace(/[xy]/g, function() { @@ -29,8 +30,17 @@ const QueryResultComponent = Ember.Component.extend({ columns: Em.computed.alias('content.columns'), params: Em.computed.alias('content.params'), explainText: Em.computed.alias('content.explain'), - hasExplain: Em.computed.notEmpty('content.explain'), + + @computed('content.result_count') + resultCount: function(count) { + if (count === 250) { + return I18n.t('explorer.max_result_count', { count }); + } else { + return I18n.t('explorer.result_count', { count }); + } + }, + colCount: function() { return this.get('content.columns').length; }.property('content.columns.length'), diff --git a/assets/javascripts/discourse/templates/explorer-query-result.hbs b/assets/javascripts/discourse/templates/explorer-query-result.hbs index b9f6a33..6c1e03d 100644 --- a/assets/javascripts/discourse/templates/explorer-query-result.hbs +++ b/assets/javascripts/discourse/templates/explorer-query-result.hbs @@ -4,6 +4,7 @@