Skip to content

Commit

Permalink
Rename flattenedColumns to allColumns (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
offirgolan authored Sep 8, 2016
1 parent 6fa9d98 commit 7f43905
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions addon/classes/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ export default class Table extends Ember.Object.extend({
* @property hideableColumns
* @type {Ember.Array}
*/
hideableColumns: computed.filterBy('flattenedColumns', 'hideable', true).readOnly(),
hideableColumns: computed.filterBy('allColumns', 'hideable', true).readOnly(),

/**
* @property hiddenColumns
* @type {Ember.Array}
*/
hiddenColumns: computed.filterBy('flattenedColumns', 'hidden', true).readOnly(),
hiddenColumns: computed.filterBy('allColumns', 'hidden', true).readOnly(),

/**
* @property visibleColumns
* @type {Ember.Array}
*/
visibleColumns: computed.filterBy('flattenedColumns', 'hidden', false).readOnly(),
visibleColumns: computed.filterBy('allColumns', 'hidden', false).readOnly(),

/**
* @property visibleColumnGroups
Expand All @@ -109,10 +109,10 @@ export default class Table extends Ember.Object.extend({
}).readOnly(),

/**
* @property flattenedColumns
* @property allColumns
* @type {Ember.Array}
*/
flattenedColumns: computed('columns.[]', 'columns.@each.subColumns', function() {
allColumns: computed('columns.[]', 'columns.@each.subColumns', function() {
return emberArray(this.get('columns').reduce((arr, c) => {
let subColumns = c.get('subColumns');
if (isEmpty(subColumns)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/classes/table-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test('CP - visibleSubColumns', function(assert) {
assert.equal(table.get('visibleSubColumns.length'), 2);
});

test('CP - flattenedColumns', function(assert) {
test('CP - allColumns', function(assert) {
let table = new Table();
let col = new Column();
let group = new Column({
Expand All @@ -66,7 +66,7 @@ test('CP - flattenedColumns', function(assert) {
});

table.setColumns([col, group, group2]);
assert.equal(table.get('flattenedColumns.length'), 5);
assert.equal(table.get('allColumns.length'), 5);
});


Expand Down

0 comments on commit 7f43905

Please sign in to comment.