From 469debc6dec61026a82a93ce1cae0d32c88a0871 Mon Sep 17 00:00:00 2001 From: Dan Monroe Date: Tue, 8 Feb 2022 16:03:42 -0500 Subject: [PATCH 1/2] Fixed this-property-fallback deprecations --- README.md | 14 ++++++------- addon/components/ember-tfoot/component.js | 2 +- .../guides/header/fixed-columns/template.md | 2 +- .../docs/guides/main/legacy-usage/template.md | 8 +++---- tests/integration/components/basic-test.js | 8 +++---- .../components/headers/ember-thead-test.js | 6 +++--- .../components/headers/resize-handle-test.js | 2 +- .../components/headers/sort-indicator-test.js | 14 ++++++------- tests/integration/components/meta-test.js | 21 ++++++++++++------- tests/integration/components/tree-test.js | 4 ++-- 10 files changed, 44 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 12bc4fde4..b7eeb80c8 100644 --- a/README.md +++ b/README.md @@ -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}} ``` @@ -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}} @@ -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}} ``` diff --git a/addon/components/ember-tfoot/component.js b/addon/components/ember-tfoot/component.js index d3ba0ec40..1ba6df1e3 100644 --- a/addon/components/ember-tfoot/component.js +++ b/addon/components/ember-tfoot/component.js @@ -16,7 +16,7 @@ import layout from './template'; - + diff --git a/tests/dummy/app/pods/docs/guides/header/fixed-columns/template.md b/tests/dummy/app/pods/docs/guides/header/fixed-columns/template.md index e39518af6..567d0d1b5 100644 --- a/tests/dummy/app/pods/docs/guides/header/fixed-columns/template.md +++ b/tests/dummy/app/pods/docs/guides/header/fixed-columns/template.md @@ -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") }} diff --git a/tests/dummy/app/pods/docs/guides/main/legacy-usage/template.md b/tests/dummy/app/pods/docs/guides/main/legacy-usage/template.md index 2d2e856b6..c50c8ae63 100644 --- a/tests/dummy/app/pods/docs/guides/main/legacy-usage/template.md +++ b/tests/dummy/app/pods/docs/guides/main/legacy-usage/template.md @@ -17,14 +17,14 @@ extra features. To see the differences, check out the or the original [angle bracket invocation rfc](https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md). ```hbs -{{#ember-table data-test-ember-table=true as |t|}} - {{#t.head columns=columns as |h|}} +{{#ember-table as |t|}} + {{#t.head columns=this.columns as |h|}} {{#h.row as |r|}} {{r.cell}} {{/h.row}} {{/t.head}} - {{#t.body rows=rows as |b|}} + {{#t.body rows=this.rows as |b|}} {{#b.row as |r|}} {{#r.cell as |cellValue|}} {{cellValue}} @@ -32,7 +32,7 @@ or the original [angle bracket invocation rfc](https://github.com/emberjs/rfcs/b {{/b.row}} {{/t.body}} - {{#t.foot rows=footerRows as |f|}} + {{#t.foot rows=this.footerRows as |f|}} {{#f.row as |r|}} {{#r.cell as |cellValue|}} {{cellValue}} diff --git a/tests/integration/components/basic-test.js b/tests/integration/components/basic-test.js index 15881c44c..ec56919af 100644 --- a/tests/integration/components/basic-test.js +++ b/tests/integration/components/basic-test.js @@ -190,15 +190,15 @@ module('Integration | basic', function() { max-height: initial; } -
+
{{#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 }} diff --git a/tests/integration/components/headers/ember-thead-test.js b/tests/integration/components/headers/ember-thead-test.js index 52bd3c36b..8da996252 100644 --- a/tests/integration/components/headers/ember-thead-test.js +++ b/tests/integration/components/headers/ember-thead-test.js @@ -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}} diff --git a/tests/integration/components/headers/resize-handle-test.js b/tests/integration/components/headers/resize-handle-test.js index 7ad65aef9..8d96cd1b2 100644 --- a/tests/integration/components/headers/resize-handle-test.js +++ b/tests/integration/components/headers/resize-handle-test.js @@ -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); diff --git a/tests/integration/components/headers/sort-indicator-test.js b/tests/integration/components/headers/sort-indicator-test.js index 0c899c8be..3819981ef 100644 --- a/tests/integration/components/headers/sort-indicator-test.js +++ b/tests/integration/components/headers/sort-indicator-test.js @@ -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}} `); @@ -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}} `); @@ -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); @@ -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'); @@ -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'); diff --git a/tests/integration/components/meta-test.js b/tests/integration/components/meta-test.js index b48a88780..c2cb42a0a 100644 --- a/tests/integration/components/meta-test.js +++ b/tests/integration/components/meta-test.js @@ -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}} @@ -127,11 +128,13 @@ module('Integration | meta', function() { {{/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}} @@ -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}} @@ -161,11 +165,13 @@ module('Integration | meta', function() { {{/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}} @@ -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}} diff --git a/tests/integration/components/tree-test.js b/tests/integration/components/tree-test.js index ae84b99db..b864cb0b4 100644 --- a/tests/integration/components/tree-test.js +++ b/tests/integration/components/tree-test.js @@ -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}} From 8e19c74b29afa6c5fc1351012e60d2e6d74219da Mon Sep 17 00:00:00 2001 From: Dan Monroe Date: Tue, 15 Feb 2022 14:57:17 -0500 Subject: [PATCH 2/2] Fixed a few more references --- .../app/pods/docs/guides/main/legacy-usage/template.md | 8 ++++---- tests/integration/components/meta-test.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/dummy/app/pods/docs/guides/main/legacy-usage/template.md b/tests/dummy/app/pods/docs/guides/main/legacy-usage/template.md index c50c8ae63..2d2e856b6 100644 --- a/tests/dummy/app/pods/docs/guides/main/legacy-usage/template.md +++ b/tests/dummy/app/pods/docs/guides/main/legacy-usage/template.md @@ -17,14 +17,14 @@ extra features. To see the differences, check out the or the original [angle bracket invocation rfc](https://github.com/emberjs/rfcs/blob/master/text/0311-angle-bracket-invocation.md). ```hbs -{{#ember-table as |t|}} - {{#t.head columns=this.columns as |h|}} +{{#ember-table data-test-ember-table=true as |t|}} + {{#t.head columns=columns as |h|}} {{#h.row as |r|}} {{r.cell}} {{/h.row}} {{/t.head}} - {{#t.body rows=this.rows as |b|}} + {{#t.body rows=rows as |b|}} {{#b.row as |r|}} {{#r.cell as |cellValue|}} {{cellValue}} @@ -32,7 +32,7 @@ or the original [angle bracket invocation rfc](https://github.com/emberjs/rfcs/b {{/b.row}} {{/t.body}} - {{#t.foot rows=this.footerRows as |f|}} + {{#t.foot rows=footerRows as |f|}} {{#f.row as |r|}} {{#r.cell as |cellValue|}} {{cellValue}} diff --git a/tests/integration/components/meta-test.js b/tests/integration/components/meta-test.js index c2cb42a0a..efe9ec42b 100644 --- a/tests/integration/components/meta-test.js +++ b/tests/integration/components/meta-test.js @@ -26,7 +26,7 @@ module('Integration | meta', function() { await render(hbs`
- {{#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}} @@ -120,7 +120,7 @@ module('Integration | meta', function() { await render(hbs`
- {{#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}} @@ -157,7 +157,7 @@ module('Integration | meta', function() {
- {{#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}} @@ -241,14 +241,14 @@ module('Integration | meta', function() { await render(hbs` - {{#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}} `);