Skip to content

Commit

Permalink
Merge branch '4.0-beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed May 18, 2022
2 parents 9cb7c0e + aa47216 commit e90a367
Show file tree
Hide file tree
Showing 69 changed files with 5,614 additions and 3,193 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ on:
jobs:
test:
name: Run Tests
runs-on: ubuntu-18.04
timeout-minutes: 6
runs-on: ubuntu-latest
timeout-minutes: 7

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node 12
- name: Use Node 14
uses: actions/setup-node@v2-beta
with:
node-version: 12.x
node-version: 14.x

- name: Node Modules Cache
uses: actions/cache@v2
Expand All @@ -37,15 +37,13 @@ jobs:

test-ember-try:
name: Run Tests
runs-on: ubuntu-18.04
timeout-minutes: 6
runs-on: ubuntu-latest
timeout-minutes: 7

strategy:
matrix:
ember-version:
[
ember-lts-2.8,
ember-lts-2.12,
ember-lts-2.18,
ember-lts-3.4,
ember-lts-3.8,
Expand All @@ -54,18 +52,19 @@ jobs:
ember-lts-3.20,
ember-lts-3.24,
ember-lts-3.28,
ember-production,
ember-release,
# ember-production,
ember-default-docs
]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node 12
- name: Use Node 14
uses: actions/setup-node@v2-beta
with:
node-version: 12.x
node-version: 14.x

- name: Node Modules Cache
uses: actions/cache@v2
Expand Down
66 changes: 43 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,57 @@ All notable changes to this project will be documented in this file. Dates are d

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

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

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

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

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

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

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

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

> 10 December 2021
> 11 January 2022
- Pin Node 14, try vertical-collection 3 [`#921`](https://github.com/Addepar/ember-table/pull/921)
- Use pre-built styles (#888) [`#900`](https://github.com/Addepar/ember-table/pull/900)
- Replace hasBlock usage with has-block helper [`#884`](https://github.com/Addepar/ember-table/pull/884)
- Release 4.0.0-beta.0 [`9066389`](https://github.com/Addepar/ember-table/commit/9066389bffe2e862deb268c7e3aa3ecb6f2812d9)
- Drop 2.8; re-enable release scenario [`c867161`](https://github.com/Addepar/ember-table/commit/c867161a04e154b00a12683c38f79a645f396e69)
- Drop Ember 2.12 scenario [`74f0453`](https://github.com/Addepar/ember-table/commit/74f045332a618eaf51234d30c48b2a0e1152a103)
- Release 4.0.0-beta.0 [`44a4fe8`](https://github.com/Addepar/ember-table/commit/44a4fe88dd4769409dcf150edc6a569da93a9337)
- Release 4.0.0-beta.2 [`1528f7a`](https://github.com/Addepar/ember-table/commit/1528f7a5ef1e1fa5060d915245c310d41f332931)
- Drop 2.8; re-enable release scenario [`3a934ae`](https://github.com/Addepar/ember-table/commit/3a934ae2d11b2af59624f5115e0d8f990c77e6f3)

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

> 19 January 2022
- Fix scrollLeft error on resize before element inserted [`#932`](https://github.com/Addepar/ember-table/pull/932)
- Release 3.3.1 [`d2cfe5a`](https://github.com/Addepar/ember-table/commit/d2cfe5a82b61e383bc0a1bd5da48825a3a972564)

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

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

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

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

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

> 11 February 2021
- Bump `[email protected]` (official release) [`#872`](https://github.com/Addepar/ember-table/pull/872)
- Release 3.0.0-10 [`fb973f6`](https://github.com/Addepar/ember-table/commit/fb973f62d47d06bca1495a8195f989ab35cb2495)

#### [v3.0.0-9](https://github.com/Addepar/ember-table/compare/v3.0.0-8...v3.0.0-9)

> 10 February 2021
Expand Down
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ For older platforms, the final release of Ember Table 2.x (2.2.3) supports:
```bash
ember install ember-table
```
### Using ember-table with Ember <= 3.24
Use resolutions in your package.json to pin down `ember-classy-page-object` to version `0.7.0`.
Newer versions are used to support Ember >= 3.28

## Features

Expand Down Expand Up @@ -90,9 +93,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 +116,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,14 +138,26 @@ 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}}
```

## Writing tests for Ember Table in your application

Ember Table comes with test helpers, for example:

To use these helpers, you should setup Ember Table for testing in your application's `tests/test-helper.js` file. For example:

```js
import { setupForTest as setupEmberTableForTest } from 'ember-table/test-support';

setupEmberTableForTest();
```

## Migrating from old Ember table

To support smooth migration from old version of Ember table (support only till ember 1.11), we have
Expand Down
2 changes: 1 addition & 1 deletion addon-test-support/helpers/mouse.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { triggerEvent } from 'ember-native-dom-helpers';
import { triggerEvent } from '@ember/test-helpers';

export async function mouseDown(target, x, y) {
await triggerEvent(target, 'pointerdown', {
Expand Down
12 changes: 11 additions & 1 deletion addon-test-support/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
import TablePage from './pages/ember-table';

export { TablePage };
import { setSetupRowCountForTest } from 'ember-table/components/ember-tbody/component';
import { setupTHeadForTest } from 'ember-table/components/ember-thead/component';
import { setSimpleCheckboxForTest } from 'ember-table/components/ember-td/component';

function setupForTest() {
setSetupRowCountForTest(true);
setupTHeadForTest(true);
setSimpleCheckboxForTest(true);
}

export { TablePage, setupForTest };
10 changes: 8 additions & 2 deletions addon-test-support/pages/-private/ember-table-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import PageObject, {
} from 'ember-classy-page-object';
import { findElement } from 'ember-classy-page-object/extend';

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

/**
* Page object for single table `td` cell; also used by the footer page object
Expand Down Expand Up @@ -37,7 +37,13 @@ export default PageObject.extend({
Returns the number of rows in the body.
*/
get rowCount() {
return Number(findElement(this).getAttribute('data-test-row-count'));
let element = findElement(this);
if (!element.hasAttribute('data-test-row-count')) {
throw new Error(
'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'
);
}
return Number(element.getAttribute('data-test-row-count'));
},

/**
Expand Down
10 changes: 8 additions & 2 deletions addon-test-support/pages/-private/ember-table-header.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PageObject, { alias, collection, hasClass, triggerable } from 'ember-classy-page-object';
import { findElement } from 'ember-classy-page-object/extend';
import { click } from 'ember-native-dom-helpers';
import { click } from '@ember/test-helpers';

import { mouseDown, mouseMove, mouseUp } from '../../helpers/mouse';
import { getScale } from '../../helpers/element';
Expand Down Expand Up @@ -159,7 +159,13 @@ export default {
Returns the number of rows in the header.
*/
get rowCount() {
return Number(findElement(this).getAttribute('data-test-row-count'));
let element = findElement(this);
if (!element.hasAttribute('data-test-row-count')) {
throw new Error(
'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'
);
}
return Number(element.getAttribute('data-test-row-count'));
},

rows: collection({
Expand Down
2 changes: 1 addition & 1 deletion addon/-private/column-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const TableColumnMeta = EmberObject.extend({
}
}),

isLastRendered: computed.readOnly('_node.isLastRendered'),
isLastRendered: readOnly('_node.isLastRendered'),

sortIndex: computed('_node.{tree.sorts.[],column.valuePath}', function() {
let valuePath = this.get('_node.column.valuePath');
Expand Down
8 changes: 3 additions & 5 deletions addon/-private/utils/ember.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/* globals Ember */
import { gte } from 'ember-compatibility-helpers';
import Ember from 'ember';
import { notifyPropertyChange as _notifyPropertyChange } from '@ember/object';

/* eslint-disable ember/new-module-imports */
export const notifyPropertyChange = gte('3.1.0')
? Ember.notifyPropertyChange
: Ember.propertyDidChange;
export const notifyPropertyChange = gte('3.1.0') ? _notifyPropertyChange : Ember.propertyDidChange;
3 changes: 2 additions & 1 deletion addon/components/ember-table-loading-more/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import { next, run, schedule, scheduleOnce } from '@ember/runloop';
export default Component.extend({
classNames: ['ember-table-loading-more'],

'data-test-ember-table-loading-more': true,
attributeBindings: ['dataTestEmberTableLoadingMore:data-test-ember-table-loading-more'],
dataTestEmberTableLoadingMore: true,

unwrappedApi: or('api.api', 'api'),
scrollElement: readOnly('unwrappedApi.columnTree.container'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Component from '@ember/component';
import defaultTo from '../../-private/utils/default-to';
import defaultTo from '../-private/utils/default-to';

export default Component.extend({
tagName: 'input',
Expand All @@ -11,6 +11,8 @@ export default Component.extend({
'indeterminate',
'type',
'value',
'dataTestSelectRow:data-test-select-row',
'dataTestCollapseRow:data-test-collapse-row',
],

ariaLabel: undefined,
Expand Down
4 changes: 2 additions & 2 deletions addon/components/ember-table/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import layout from './template';
export default Component.extend({
layout,
classNames: ['ember-table'],

'data-test-ember-table': true,
attributeBindings: ['dataTestEmberTable:data-test-ember-table'],
dataTestEmberTable: true,

didInsertElement() {
this._super(...arguments);
Expand Down
Loading

0 comments on commit e90a367

Please sign in to comment.