Skip to content

Commit e90a367

Browse files
committed
Merge branch '4.0-beta'
2 parents 9cb7c0e + aa47216 commit e90a367

File tree

69 files changed

+5614
-3193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+5614
-3193
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ on:
66
jobs:
77
test:
88
name: Run Tests
9-
runs-on: ubuntu-18.04
10-
timeout-minutes: 6
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 7
1111

1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v2
1515

16-
- name: Use Node 12
16+
- name: Use Node 14
1717
uses: actions/setup-node@v2-beta
1818
with:
19-
node-version: 12.x
19+
node-version: 14.x
2020

2121
- name: Node Modules Cache
2222
uses: actions/cache@v2
@@ -37,15 +37,13 @@ jobs:
3737

3838
test-ember-try:
3939
name: Run Tests
40-
runs-on: ubuntu-18.04
41-
timeout-minutes: 6
40+
runs-on: ubuntu-latest
41+
timeout-minutes: 7
4242

4343
strategy:
4444
matrix:
4545
ember-version:
4646
[
47-
ember-lts-2.8,
48-
ember-lts-2.12,
4947
ember-lts-2.18,
5048
ember-lts-3.4,
5149
ember-lts-3.8,
@@ -54,18 +52,19 @@ jobs:
5452
ember-lts-3.20,
5553
ember-lts-3.24,
5654
ember-lts-3.28,
57-
ember-production,
55+
ember-release,
56+
# ember-production,
5857
ember-default-docs
5958
]
6059

6160
steps:
6261
- name: Checkout
6362
uses: actions/checkout@v2
6463

65-
- name: Use Node 12
64+
- name: Use Node 14
6665
uses: actions/setup-node@v2-beta
6766
with:
68-
node-version: 12.x
67+
node-version: 14.x
6968

7069
- name: Node Modules Cache
7170
uses: actions/cache@v2

CHANGELOG.md

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,57 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7-
#### [v3.3.1](https://github.com/Addepar/ember-table/compare/v4.0.0-beta.2...v3.3.1)
7+
#### [v4.0.0-beta.5](https://github.com/Addepar/ember-table/compare/v4.0.0-beta.4...v4.0.0-beta.5)
88

9-
- Fix scrollLeft error on resize before element inserted [`#932`](https://github.com/Addepar/ember-table/pull/932)
9+
- Bump to the latest vc pre-release [`#944`](https://github.com/Addepar/ember-table/pull/944)
1010

11-
#### [v4.0.0-beta.2](https://github.com/Addepar/ember-table/compare/v4.0.0-beta.1...v4.0.0-beta.2)
11+
#### [v4.0.0-beta.4](https://github.com/Addepar/ember-table/compare/v4.0.0-beta.3...v4.0.0-beta.4)
1212

13-
> 11 January 2022
13+
> 24 February 2022
1414
15-
- Pin Node 14, try vertical-collection 3 [`#921`](https://github.com/Addepar/ember-table/pull/921)
16-
- Use pre-built styles (#888) [`#900`](https://github.com/Addepar/ember-table/pull/900)
17-
- Replace hasBlock usage with has-block helper [`#884`](https://github.com/Addepar/ember-table/pull/884)
18-
- Spinner for infinite scroll [`#923`](https://github.com/Addepar/ember-table/pull/923)
19-
- Release 4.0.0-beta.0 [`44a4fe8`](https://github.com/Addepar/ember-table/commit/44a4fe88dd4769409dcf150edc6a569da93a9337)
20-
- Release 4.0.0-beta.2 [`1528f7a`](https://github.com/Addepar/ember-table/commit/1528f7a5ef1e1fa5060d915245c310d41f332931)
21-
- Release 3.3.0 [`3550d21`](https://github.com/Addepar/ember-table/commit/3550d21f1a48177c31161c744fd3988ae2081df9)
15+
- Add ember-try scenario for ember v4 [`#940`](https://github.com/Addepar/ember-table/pull/940)
16+
- Fixes this-property-fallback deprecations [`#938`](https://github.com/Addepar/ember-table/pull/938)
17+
- drop old guides [`#942`](https://github.com/Addepar/ember-table/pull/942)
18+
- Bump ember-test-selectors to v6 with fixed tests [`#937`](https://github.com/Addepar/ember-table/pull/937)
19+
- Fixes various small Ember Global deprecations [`#936`](https://github.com/Addepar/ember-table/pull/936)
20+
- Import and use scheduleOnce from ember/runloop [`#939`](https://github.com/Addepar/ember-table/pull/939)
21+
- Use render from ember-test-helpers [`#935`](https://github.com/Addepar/ember-table/pull/935)
22+
- Release 4.0.0-beta.4 [`307058a`](https://github.com/Addepar/ember-table/commit/307058a7a703ba2255886462dab2975983ae7cf5)
2223

23-
#### [v4.0.0-beta.1](https://github.com/Addepar/ember-table/compare/v4.0.0-beta.0...v4.0.0-beta.1)
24+
#### [v4.0.0-beta.3](https://github.com/Addepar/ember-table/compare/v4.0.0-beta.2...v4.0.0-beta.3)
2425

25-
> 22 December 2021
26+
> 20 January 2022
2627
28+
- yarn upgrade on the 4.0 branch [`#931`](https://github.com/Addepar/ember-table/pull/931)
29+
- Update test helpers for Ember 4.0 [`#929`](https://github.com/Addepar/ember-table/pull/929)
30+
- Drop compat checks which are no longer needed [`#930`](https://github.com/Addepar/ember-table/pull/930)
31+
- Move angle bracket to old deps, update link-to [`#928`](https://github.com/Addepar/ember-table/pull/928)
32+
- Bump dependencies, configure Ember for 4.0 [`#927`](https://github.com/Addepar/ember-table/pull/927)
2733
- Pin Node 14, try vertical-collection 3 [`#921`](https://github.com/Addepar/ember-table/pull/921)
2834
- Use pre-built styles (#888) [`#900`](https://github.com/Addepar/ember-table/pull/900)
2935
- Replace hasBlock usage with has-block helper [`#884`](https://github.com/Addepar/ember-table/pull/884)
30-
- deprecate property fallback lookup (no implicit this, take three) [`#924`](https://github.com/Addepar/ember-table/pull/924)
31-
- Release 4.0.0-beta.0 [`f70af8a`](https://github.com/Addepar/ember-table/commit/f70af8aa1d602b79d93e4604173abcb94054eb99)
32-
- Drop 2.8; re-enable release scenario [`3683a22`](https://github.com/Addepar/ember-table/commit/3683a220d25d218f98d5139b02450f4c12ad90b6)
33-
- Drop Ember 2.12 scenario [`04c2eba`](https://github.com/Addepar/ember-table/commit/04c2eba3fbdc41051c7d171f09094f7f1ebb480b)
36+
- Fix scrollLeft error on resize before element inserted [`#932`](https://github.com/Addepar/ember-table/pull/932)
37+
- Release 4.0.0-beta.0 [`3d2cee6`](https://github.com/Addepar/ember-table/commit/3d2cee6bb8b7818eac6643380e112ad6e534bc3d)
38+
- Release 4.0.0-beta.3 [`0cf9d35`](https://github.com/Addepar/ember-table/commit/0cf9d350ec8bac4fa44de0cdce4dc94c63a8b84b)
39+
- Release 4.0.0-beta.2 [`d21c7ca`](https://github.com/Addepar/ember-table/commit/d21c7ca50a826c52e535969aa4c922b9eec37f9f)
3440

35-
#### [v4.0.0-beta.0](https://github.com/Addepar/ember-table/compare/v3.3.0...v4.0.0-beta.0)
41+
#### [v4.0.0-beta.2](https://github.com/Addepar/ember-table/compare/v3.3.1...v4.0.0-beta.2)
3642

37-
> 10 December 2021
43+
> 11 January 2022
3844
3945
- Pin Node 14, try vertical-collection 3 [`#921`](https://github.com/Addepar/ember-table/pull/921)
4046
- Use pre-built styles (#888) [`#900`](https://github.com/Addepar/ember-table/pull/900)
4147
- Replace hasBlock usage with has-block helper [`#884`](https://github.com/Addepar/ember-table/pull/884)
42-
- Release 4.0.0-beta.0 [`9066389`](https://github.com/Addepar/ember-table/commit/9066389bffe2e862deb268c7e3aa3ecb6f2812d9)
43-
- Drop 2.8; re-enable release scenario [`c867161`](https://github.com/Addepar/ember-table/commit/c867161a04e154b00a12683c38f79a645f396e69)
44-
- Drop Ember 2.12 scenario [`74f0453`](https://github.com/Addepar/ember-table/commit/74f045332a618eaf51234d30c48b2a0e1152a103)
48+
- Release 4.0.0-beta.0 [`44a4fe8`](https://github.com/Addepar/ember-table/commit/44a4fe88dd4769409dcf150edc6a569da93a9337)
49+
- Release 4.0.0-beta.2 [`1528f7a`](https://github.com/Addepar/ember-table/commit/1528f7a5ef1e1fa5060d915245c310d41f332931)
50+
- Drop 2.8; re-enable release scenario [`3a934ae`](https://github.com/Addepar/ember-table/commit/3a934ae2d11b2af59624f5115e0d8f990c77e6f3)
51+
52+
#### [v3.3.1](https://github.com/Addepar/ember-table/compare/v3.3.0...v3.3.1)
53+
54+
> 19 January 2022
55+
56+
- Fix scrollLeft error on resize before element inserted [`#932`](https://github.com/Addepar/ember-table/pull/932)
57+
- Release 3.3.1 [`d2cfe5a`](https://github.com/Addepar/ember-table/commit/d2cfe5a82b61e383bc0a1bd5da48825a3a972564)
4558

4659
#### [v3.3.0](https://github.com/Addepar/ember-table/compare/v3.2.0...v3.3.0)
4760

@@ -126,13 +139,20 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
126139
- Release 3.0.1 [`4a59838`](https://github.com/Addepar/ember-table/commit/4a598385eb93409fd17d60a380c0602e94d741d2)
127140
- Update README.md [`94c06dc`](https://github.com/Addepar/ember-table/commit/94c06dc08308e69fb6560f8aaee0f0f8cc35f1c9)
128141

129-
#### [v3.0.0](https://github.com/Addepar/ember-table/compare/v3.0.0-9...v3.0.0)
142+
#### [v3.0.0](https://github.com/Addepar/ember-table/compare/v3.0.0-10...v3.0.0)
130143

131144
> 11 February 2021
132145
133146
- 3.0 beta [`#831`](https://github.com/Addepar/ember-table/pull/831)
134147
- Release 3.0.0 [`3b2d151`](https://github.com/Addepar/ember-table/commit/3b2d1517ce5c2e3a10c246792ae9f8067074781a)
135148

149+
#### [v3.0.0-10](https://github.com/Addepar/ember-table/compare/v3.0.0-9...v3.0.0-10)
150+
151+
> 11 February 2021
152+
153+
- Bump `vertical-collection@2.0` (official release) [`#872`](https://github.com/Addepar/ember-table/pull/872)
154+
- Release 3.0.0-10 [`fb973f6`](https://github.com/Addepar/ember-table/commit/fb973f62d47d06bca1495a8195f989ab35cb2495)
155+
136156
#### [v3.0.0-9](https://github.com/Addepar/ember-table/compare/v3.0.0-8...v3.0.0-9)
137157

138158
> 10 February 2021

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ For older platforms, the final release of Ember Table 2.x (2.2.3) supports:
2020
```bash
2121
ember install ember-table
2222
```
23+
### Using ember-table with Ember <= 3.24
24+
Use resolutions in your package.json to pin down `ember-classy-page-object` to version `0.7.0`.
25+
Newer versions are used to support Ember >= 3.28
2326

2427
## Features
2528

@@ -90,9 +93,9 @@ The following template renders a simple table.
9093

9194
```
9295
{{#ember-table as |t|}}
93-
{{t.head columns=columns}}
96+
{{t.head columns=this.columns}}
9497
95-
{{t.body rows=rows}}
98+
{{t.body rows=this.rows}}
9699
{{/ember-table}}
97100
```
98101

@@ -113,9 +116,9 @@ you like):
113116

114117
```
115118
{{#ember-table as |t|}}
116-
{{t.head columns=columns}}
119+
{{t.head columns=this.columns}}
117120
118-
{{#t.body rows=rows as |b|}}
121+
{{#t.body rows=this.rows as |b|}}
119122
{{#b.row as |r|}}
120123
{{#r.cell as |value column row|}}
121124
{{component column.component value=value}}
@@ -135,14 +138,26 @@ You can also use the `ember-tfoot` component, which has the same API as
135138

136139
```
137140
{{#ember-table as |t|}}
138-
{{t.head columns=columns}}
141+
{{t.head columns=this.columns}}
139142
140-
{{t.body rows=rows}}
143+
{{t.body rows=this.rows}}
141144
142-
{{t.foot rows=footerRows}}
145+
{{t.foot rows=this.footerRows}}
143146
{{/ember-table}}
144147
```
145148

149+
## Writing tests for Ember Table in your application
150+
151+
Ember Table comes with test helpers, for example:
152+
153+
To use these helpers, you should setup Ember Table for testing in your application's `tests/test-helper.js` file. For example:
154+
155+
```js
156+
import { setupForTest as setupEmberTableForTest } from 'ember-table/test-support';
157+
158+
setupEmberTableForTest();
159+
```
160+
146161
## Migrating from old Ember table
147162

148163
To support smooth migration from old version of Ember table (support only till ember 1.11), we have

addon-test-support/helpers/mouse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { triggerEvent } from 'ember-native-dom-helpers';
1+
import { triggerEvent } from '@ember/test-helpers';
22

33
export async function mouseDown(target, x, y) {
44
await triggerEvent(target, 'pointerdown', {

addon-test-support/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
import TablePage from './pages/ember-table';
22

3-
export { TablePage };
3+
import { setSetupRowCountForTest } from 'ember-table/components/ember-tbody/component';
4+
import { setupTHeadForTest } from 'ember-table/components/ember-thead/component';
5+
import { setSimpleCheckboxForTest } from 'ember-table/components/ember-td/component';
6+
7+
function setupForTest() {
8+
setSetupRowCountForTest(true);
9+
setupTHeadForTest(true);
10+
setSimpleCheckboxForTest(true);
11+
}
12+
13+
export { TablePage, setupForTest };

addon-test-support/pages/-private/ember-table-body.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import PageObject, {
77
} from 'ember-classy-page-object';
88
import { findElement } from 'ember-classy-page-object/extend';
99

10-
import { click } from 'ember-native-dom-helpers';
10+
import { click } from '@ember/test-helpers';
1111

1212
/**
1313
* Page object for single table `td` cell; also used by the footer page object
@@ -37,7 +37,13 @@ export default PageObject.extend({
3737
Returns the number of rows in the body.
3838
*/
3939
get rowCount() {
40-
return Number(findElement(this).getAttribute('data-test-row-count'));
40+
let element = findElement(this);
41+
if (!element.hasAttribute('data-test-row-count')) {
42+
throw new Error(
43+
'data-test-row-count attribute not found on the Ember Table tbody. Perhaps you need to run setupForTest? See https://github.com/Addepar/ember-table/blob/master/README.md'
44+
);
45+
}
46+
return Number(element.getAttribute('data-test-row-count'));
4147
},
4248

4349
/**

addon-test-support/pages/-private/ember-table-header.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PageObject, { alias, collection, hasClass, triggerable } from 'ember-classy-page-object';
22
import { findElement } from 'ember-classy-page-object/extend';
3-
import { click } from 'ember-native-dom-helpers';
3+
import { click } from '@ember/test-helpers';
44

55
import { mouseDown, mouseMove, mouseUp } from '../../helpers/mouse';
66
import { getScale } from '../../helpers/element';
@@ -159,7 +159,13 @@ export default {
159159
Returns the number of rows in the header.
160160
*/
161161
get rowCount() {
162-
return Number(findElement(this).getAttribute('data-test-row-count'));
162+
let element = findElement(this);
163+
if (!element.hasAttribute('data-test-row-count')) {
164+
throw new Error(
165+
'data-test-row-count attribute not found on the Ember Table tbody. Perhaps you need to run setupForTest? See https://github.com/Addepar/ember-table/blob/master/README.md'
166+
);
167+
}
168+
return Number(element.getAttribute('data-test-row-count'));
163169
},
164170

165171
rows: collection({

addon/-private/column-tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const TableColumnMeta = EmberObject.extend({
115115
}
116116
}),
117117

118-
isLastRendered: computed.readOnly('_node.isLastRendered'),
118+
isLastRendered: readOnly('_node.isLastRendered'),
119119

120120
sortIndex: computed('_node.{tree.sorts.[],column.valuePath}', function() {
121121
let valuePath = this.get('_node.column.valuePath');

addon/-private/utils/ember.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/* globals Ember */
21
import { gte } from 'ember-compatibility-helpers';
2+
import Ember from 'ember';
3+
import { notifyPropertyChange as _notifyPropertyChange } from '@ember/object';
34

4-
/* eslint-disable ember/new-module-imports */
5-
export const notifyPropertyChange = gte('3.1.0')
6-
? Ember.notifyPropertyChange
7-
: Ember.propertyDidChange;
5+
export const notifyPropertyChange = gte('3.1.0') ? _notifyPropertyChange : Ember.propertyDidChange;

addon/components/ember-table-loading-more/component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import { next, run, schedule, scheduleOnce } from '@ember/runloop';
3030
export default Component.extend({
3131
classNames: ['ember-table-loading-more'],
3232

33-
'data-test-ember-table-loading-more': true,
33+
attributeBindings: ['dataTestEmberTableLoadingMore:data-test-ember-table-loading-more'],
34+
dataTestEmberTableLoadingMore: true,
3435

3536
unwrappedApi: or('api.api', 'api'),
3637
scrollElement: readOnly('unwrappedApi.columnTree.container'),

addon/components/-private/simple-checkbox.js renamed to addon/components/ember-table-simple-checkbox.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Component from '@ember/component';
2-
import defaultTo from '../../-private/utils/default-to';
2+
import defaultTo from '../-private/utils/default-to';
33

44
export default Component.extend({
55
tagName: 'input',
@@ -11,6 +11,8 @@ export default Component.extend({
1111
'indeterminate',
1212
'type',
1313
'value',
14+
'dataTestSelectRow:data-test-select-row',
15+
'dataTestCollapseRow:data-test-collapse-row',
1416
],
1517

1618
ariaLabel: undefined,

addon/components/ember-table/component.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import layout from './template';
3232
export default Component.extend({
3333
layout,
3434
classNames: ['ember-table'],
35-
36-
'data-test-ember-table': true,
35+
attributeBindings: ['dataTestEmberTable:data-test-ember-table'],
36+
dataTestEmberTable: true,
3737

3838
didInsertElement() {
3939
this._super(...arguments);

0 commit comments

Comments
 (0)