diff --git a/assets/javascripts/discourse/components/query-result.js.es6 b/assets/javascripts/discourse/components/query-result.js.es6 index 6005611..d536402 100644 --- a/assets/javascripts/discourse/components/query-result.js.es6 +++ b/assets/javascripts/discourse/components/query-result.js.es6 @@ -167,9 +167,7 @@ const QueryResultComponent = Ember.Component.extend({ downloadResultCsv() { this.downloadResult('csv'); } - }, - - parent: function() { return this; }.property() + } }); diff --git a/assets/javascripts/discourse/components/query-row-content.js.es6 b/assets/javascripts/discourse/components/query-row-content.js.es6 index 420cde1..e480d8f 100644 --- a/assets/javascripts/discourse/components/query-row-content.js.es6 +++ b/assets/javascripts/discourse/components/query-row-content.js.es6 @@ -33,8 +33,8 @@ const QueryRowContentComponent = Ember.Component.extend(bufferedRender({ buildBuffer(buffer) { const self = this; const row = this.get('row'); - const parent = self.get('parent'); - const fallback = parent.get('fallbackTemplate'); + const parentView = self.get('parentView'); + const fallback = this.get('fallbackTemplate'); const helpers = { "icon-or-image": icon_or_image_replacement, "category-link": category_badge_replacement, @@ -54,9 +54,9 @@ const QueryRowContentComponent = Ember.Component.extend(bufferedRender({ return esc(row[idx]); } - const lookupFunc = parent[`lookup${t.name.capitalize()}`]; + const lookupFunc = parentView[`lookup${t.name.capitalize()}`]; if (lookupFunc) { - ctx[t.name] = parent[`lookup${t.name.capitalize()}`](id); + ctx[t.name] = parentView[`lookup${t.name.capitalize()}`](id); } if (t.name === "category" || t.name === "badge" || t.name === "reltime") { diff --git a/assets/javascripts/discourse/templates/explorer-query-result.hbs b/assets/javascripts/discourse/templates/explorer-query-result.hbs index d5cdf9f..55486f4 100644 --- a/assets/javascripts/discourse/templates/explorer-query-result.hbs +++ b/assets/javascripts/discourse/templates/explorer-query-result.hbs @@ -22,8 +22,11 @@ - {{~#each rows as |row|}} - {{~query-row-content row=row columnTemplates=columnTemplates parent=controller}} - {{~/each}} + {{#each rows as |row|}} + {{query-row-content + row=row + fallbackTemplate=fallbackTemplate + columnTemplates=columnTemplates}} + {{/each}}