caxiam/ember-tabular

Resolve ember test (ember-try issues)

Closed this issue · 3 comments

Resolve ember test (ember-try issues)

2 issues:

  • {{get}} template helper is not working in beta or canary, I have access to the 2 necessary arguments, the object and the key but putting them together does not render anything.
    • I do know that the helper is loaded because if I omit one of the necessary arguments it throws an error
  • Once the record(row) is passed to the ember-tabular-column record it is no longer accessible, unable to render {{record}} within ember-tabular-column.

Made some heavy refactors to better structure the addon, also in hopes it would naturally clear up some of the testing issues.

Currently whenever ember-try attempts to run any other scenario beyond the ember-default then we get Assertion Failed: A helper named "et.column" could not be found.
Which leaves me stumped. (1. et.column is a reference to a contextual component, 2. Its not a very helpful error)

@morgan I found a workaround, obviously we want the original syntax, but its a starting point in debugging further.

This throws the A helper named "et.column" could not be found.:

{{#ember-tabular modelName="user" as |et|}}
    {{et.column property="checked"}}
    {{#et.column property="emailAddress" as |record column|}}
        <a href="mailto:{{get record column.property}}">{{get record column.property}}</a>
    {{/et.column}}
{{/ember-tabular}}

The workaround:

{{#ember-tabular modelName="user" as |et|}}
    {{component et.column property="checked"}}
    {{#component et.column property="emailAddress" as |record column|}}
        <a href="mailto:{{get record column.property}}">{{get record column.property}}</a>
    {{/component}}
{{/ember-tabular}}

I have no idea why I have to use the component helper, but its a starting point.