Skip to content

Commit

Permalink
Fixes this-property-fallback deprecations (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanMonroe authored Feb 16, 2022
1 parent 3516236 commit 84a752a
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 38 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ The following template renders a simple table.

```
{{#ember-table as |t|}}
{{t.head columns=columns}}
{{t.head columns=this.columns}}
{{t.body rows=rows}}
{{t.body rows=this.rows}}
{{/ember-table}}
```

Expand All @@ -113,9 +113,9 @@ you like):

```
{{#ember-table as |t|}}
{{t.head columns=columns}}
{{t.head columns=this.columns}}
{{#t.body rows=rows as |b|}}
{{#t.body rows=this.rows as |b|}}
{{#b.row as |r|}}
{{#r.cell as |value column row|}}
{{component column.component value=value}}
Expand All @@ -135,11 +135,11 @@ You can also use the `ember-tfoot` component, which has the same API as

```
{{#ember-table as |t|}}
{{t.head columns=columns}}
{{t.head columns=this.columns}}
{{t.body rows=rows}}
{{t.body rows=this.rows}}
{{t.foot rows=footerRows}}
{{t.foot rows=this.footerRows}}
{{/ember-table}}
```

Expand Down
2 changes: 1 addition & 1 deletion addon/components/ember-tfoot/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import layout from './template';
<t.head @columns={{this.columns}} />
<t.body @rows={{this.rows}} />
<t.foot @rows={{footerRows}} as |f|>
<t.foot @rows={{this.footerRows}} as |f|>
<f.row />
</t.foot>
</EmberTable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ you can make fixed columns toggleable for your users.
{{#docs-demo as |demo|}}
{{#demo.example name='dynamic-fixed-columns'}}
{{docs/guides/header/fixed-columns/dynamic-example
rows=rows
rows=this.rows
columns=dynamicFixedColumns
toggleFixed=(action "toggleFixed")
}}
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/components/basic-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ module('Integration | basic', function() {
max-height: initial;
}
</style>
<div id="container" style="height: {{containerHeight}}px; overflow: auto;">
<div id="container" style="height: {{this.containerHeight}}px; overflow: auto;">
{{#ember-table as |t|}}
{{ember-thead api=t columns=columns}}
{{ember-thead api=t columns=this.columns}}
{{ember-tbody
api=t
containerSelector="#container"
rows=rows
estimateRowHeight=estimateRowHeight
rows=this.rows
estimateRowHeight=this.estimateRowHeight
renderAll=false
bufferSize=0
}}
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/components/headers/ember-thead-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ async function renderTable() {
{{#ember-thead
api=t
widthConstraint='eq-container'
columns=columns
columnKeyPath=columnKeyPath as |h|}}
columns=this.columns
columnKeyPath=this.columnKeyPath as |h|}}
{{#ember-tr api=h as |r|}}
{{ember-th api=r}}
{{/ember-tr}}
{{/ember-thead}}
{{#ember-tbody api=t rows=rows as |b|}}
{{#ember-tbody api=t rows=this.rows as |b|}}
{{#ember-tr api=b as |r|}}
{{#ember-td api=r as |cellValue|}}
{{cellValue}}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/headers/resize-handle-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module('Integration | Component | ember-th/resize-handle', function() {
isResizable: true,
});

await render(hbs`{{ember-th/resize-handle columnMeta=columnMeta}}`);
await render(hbs`{{ember-th/resize-handle columnMeta=this.columnMeta}}`);

assert.ok(resize.isPresent);

Expand Down
14 changes: 7 additions & 7 deletions tests/integration/components/headers/sort-indicator-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ module('Integration | Component | ember-th/sort-indicator', function() {
isSorted: true,
});

await render(hbs`{{ember-th/sort-indicator columnMeta=columnMeta}}`);
await render(hbs`{{ember-th/sort-indicator columnMeta=this.columnMeta}}`);

assert.ok(sort.indicator.isPresent);

// Template block usage:
await render(hbs`
{{#ember-th/sort-indicator columnMeta=columnMeta}}
{{#ember-th/sort-indicator columnMeta=this.columnMeta}}
template block text
{{/ember-th/sort-indicator}}
`);
Expand All @@ -34,13 +34,13 @@ module('Integration | Component | ember-th/sort-indicator', function() {
isSorted: false,
});

await render(hbs`{{ember-th/sort-indicator columnMeta=columnMeta}}`);
await render(hbs`{{ember-th/sort-indicator columnMeta=this.columnMeta}}`);

assert.notOk(sort.indicator.isPresent);

// Template block usage:
await render(hbs`
{{#ember-th/sort-indicator columnMeta=columnMeta}}
{{#ember-th/sort-indicator columnMeta=this.columnMeta}}
template block text
{{/ember-th/sort-indicator}}
`);
Expand All @@ -54,7 +54,7 @@ module('Integration | Component | ember-th/sort-indicator', function() {
isSortedAsc: true,
});

await render(hbs`{{ember-th/sort-indicator columnMeta=columnMeta}}`);
await render(hbs`{{ember-th/sort-indicator columnMeta=this.columnMeta}}`);
// asc sort
assert.ok(sort.indicator.isAscending);
assert.notOk(sort.indicator.isDescending);
Expand All @@ -72,7 +72,7 @@ module('Integration | Component | ember-th/sort-indicator', function() {
sortIndex: 2,
});

await render(hbs`{{ember-th/sort-indicator columnMeta=columnMeta}}`);
await render(hbs`{{ember-th/sort-indicator columnMeta=this.columnMeta}}`);

assert.equal(sort.indicator.text, '2');

Expand All @@ -86,7 +86,7 @@ module('Integration | Component | ember-th/sort-indicator', function() {
isSortable: true,
});

await render(hbs`{{ember-th/sort-indicator columnMeta=columnMeta}}`);
await render(hbs`{{ember-th/sort-indicator columnMeta=this.columnMeta}}`);

assert.ok(sort.toggle.isPresent);
assert.equal(sort.toggle.text, 'Toggle Sort');
Expand Down
31 changes: 19 additions & 12 deletions tests/integration/components/meta-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module('Integration | meta', function() {
await render(hbs`
<div style="height: 500px;">
<EmberTable data-test-main-table as |t| >
{{#ember-thead api=t columns=columns as |h|}}
{{#ember-thead api=t columns=this.columns as |h|}}
{{#ember-tr api=h as |r|}}
{{#ember-th api=r as |column columnMeta|}}
{{#if columnMeta.wasClicked}}column{{/if}}
Expand All @@ -48,7 +48,8 @@ module('Integration | meta', function() {
{{/ember-td}}
{{/ember-tr}}
{{/ember-tbody}}
{{#ember-tfoot api=t rows=footerRows as |f|}}
{{#ember-tfoot api=t rows=this.footerRows as |f|}}
{{#ember-tr api=f as |r|}}
{{#ember-td api=r as |value column row cellMeta columnMeta rowMeta|}}
{{#if columnMeta.wasClicked}}column{{/if}}
Expand Down Expand Up @@ -119,19 +120,21 @@ module('Integration | meta', function() {
await render(hbs`
<div style="height: 500px;">
<EmberTable data-test-main-table as |t| >
{{#ember-thead api=t columns=columns as |h|}}
{{#ember-thead api=t columns=this.columns as |h|}}
{{#ember-tr api=h as |r|}}
{{#ember-th api=r as |column columnMeta|}}
{{#if columnMeta.wasClicked}}column{{/if}}
clicked
{{/ember-th}}
{{/ember-tr}}
{{/ember-thead}}
{{#ember-tbody api=t rows=rows as |b|}}
{{#ember-tbody api=t rows=this.rows as |b|}}
{{#ember-tr api=b as |r|}}
{{#ember-td
api=r
onClick=(action onClick)
onClick=(action this.onClick)
as |value column row cellMeta columnMeta rowMeta|
}}
{{#if cellMeta.wasClicked}}cell{{/if}}
Expand All @@ -141,7 +144,8 @@ module('Integration | meta', function() {
{{/ember-td}}
{{/ember-tr}}
{{/ember-tbody}}
{{#ember-tfoot api=t rows=footerRows as |f|}}
{{#ember-tfoot api=t rows=this.footerRows as |f|}}
{{#ember-tr api=f as |r|}}
{{#ember-td api=r as |value column row cellMeta columnMeta rowMeta|}}
{{#if columnMeta.wasClicked}}column{{/if}}
Expand All @@ -153,19 +157,21 @@ module('Integration | meta', function() {
</div>
<div style="height: 500px;">
<EmberTable data-test-other-table as |t| >
{{#ember-thead api=t columns=columns as |h|}}
{{#ember-thead api=t columns=this.columns as |h|}}
{{#ember-tr api=h as |r|}}
{{#ember-th api=r as |column columnMeta|}}
{{#if columnMeta.wasClicked}}column{{/if}}
clicked
{{/ember-th}}
{{/ember-tr}}
{{/ember-thead}}
{{#ember-tbody api=t rows=rows as |b|}}
{{#ember-tbody api=t rows=this.rows as |b|}}
{{#ember-tr api=b as |r|}}
{{#ember-td
api=r
onClick=(action onClick)
onClick=(action this.onClick)
as |value column row cellMeta columnMeta rowMeta|
}}
{{#if cellMeta.wasClicked}}cell{{/if}}
Expand All @@ -175,7 +181,8 @@ module('Integration | meta', function() {
{{/ember-td}}
{{/ember-tr}}
{{/ember-tbody}}
{{#ember-tfoot api=t rows=footerRows as |f|}}
{{#ember-tfoot api=t rows=this.footerRows as |f|}}
{{#ember-tr api=f as |r|}}
{{#ember-td api=r as |value column row cellMeta columnMeta rowMeta|}}
{{#if columnMeta.wasClicked}}column{{/if}}
Expand Down Expand Up @@ -234,14 +241,14 @@ module('Integration | meta', function() {

await render(hbs`
<EmberTable data-test-main-table as |t| >
{{#ember-thead api=t columns=columns as |h|}}
{{#ember-thead api=t columns=this.columns as |h|}}
{{#ember-tr api=h as |r|}}
{{#ember-th api=r as |column columnMeta rowMeta|}}
{{rowMeta.index}}
{{/ember-th}}
{{/ember-tr}}
{{/ember-thead}}
{{ember-tbody api=t rows=rows}}
{{ember-tbody api=t rows=this.rows}}
</EmberTable>
`);

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/components/tree-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ module('Integration | Tree', () => {

await render(hbs`
{{#ember-table as |t|}}
{{ember-thead api=t columns=columns}}
{{#ember-tbody api=t rows=rows as |b|}}
{{ember-thead api=t columns=this.columns}}
{{#ember-tbody api=t rows=this.rows as |b|}}
{{#ember-tr api=b as |r|}}
{{#ember-td api=r as |c|}}
{{b.rowsCount}}
Expand Down

0 comments on commit 84a752a

Please sign in to comment.