FIX: Invalid use of controller in a component

This commit is contained in:
Robin Ward 2016-11-09 12:49:25 -05:00
parent 8d72e979a5
commit f9e1177981
3 changed files with 11 additions and 10 deletions

View File

@ -167,9 +167,7 @@ const QueryResultComponent = Ember.Component.extend({
downloadResultCsv() { downloadResultCsv() {
this.downloadResult('csv'); this.downloadResult('csv');
} }
}, }
parent: function() { return this; }.property()
}); });

View File

@ -33,8 +33,8 @@ const QueryRowContentComponent = Ember.Component.extend(bufferedRender({
buildBuffer(buffer) { buildBuffer(buffer) {
const self = this; const self = this;
const row = this.get('row'); const row = this.get('row');
const parent = self.get('parent'); const parentView = self.get('parentView');
const fallback = parent.get('fallbackTemplate'); const fallback = this.get('fallbackTemplate');
const helpers = { const helpers = {
"icon-or-image": icon_or_image_replacement, "icon-or-image": icon_or_image_replacement,
"category-link": category_badge_replacement, "category-link": category_badge_replacement,
@ -54,9 +54,9 @@ const QueryRowContentComponent = Ember.Component.extend(bufferedRender({
return esc(row[idx]); return esc(row[idx]);
} }
const lookupFunc = parent[`lookup${t.name.capitalize()}`]; const lookupFunc = parentView[`lookup${t.name.capitalize()}`];
if (lookupFunc) { 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") { if (t.name === "category" || t.name === "badge" || t.name === "reltime") {

View File

@ -22,8 +22,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{~#each rows as |row|}} {{#each rows as |row|}}
{{~query-row-content row=row columnTemplates=columnTemplates parent=controller}} {{query-row-content
{{~/each}} row=row
fallbackTemplate=fallbackTemplate
columnTemplates=columnTemplates}}
{{/each}}
</tbody> </tbody>
</table> </table>