diff --git a/src/javascripts/ng-admin/es6/lib/Utils/fieldsUtils.js b/src/javascripts/ng-admin/es6/lib/Utils/fieldsUtils.js deleted file mode 100644 index 5d29c61b..00000000 --- a/src/javascripts/ng-admin/es6/lib/Utils/fieldsUtils.js +++ /dev/null @@ -1,15 +0,0 @@ -export default { - /** - * Convert fieldsLiteral as returned by fields methods to an array of field sorted by their order - */ - fieldsLiteralToArray: function (fieldsLiteral) { - var array = Object.keys(fieldsLiteral).map(function (key) { - return fieldsLiteral[key]; - }) - .sort(function (a, b) { - return a.order() - b.order(); - }); - - return array; - } -}; diff --git a/src/javascripts/ng-admin/es6/lib/View/ListView.js b/src/javascripts/ng-admin/es6/lib/View/ListView.js index 316274af..8e9ae977 100644 --- a/src/javascripts/ng-admin/es6/lib/View/ListView.js +++ b/src/javascripts/ng-admin/es6/lib/View/ListView.js @@ -1,5 +1,4 @@ import View from './View'; -import fieldsUtils from '../Utils/fieldsUtils'; class ListView extends View { constructor(name) { @@ -11,7 +10,6 @@ class ListView extends View { this._listActions = []; this._batchActions = ['delete']; this._filters = []; - this._exportFields = []; this._sortField = 'id'; this._sortDir = 'DESC'; @@ -100,16 +98,6 @@ class ListView extends View { return this; } - exportFields() { - if (!arguments.length) { - return this._exportFields.length === 0 ? this._fields : this._exportFields; - } - var fields = fieldsUtils.fieldsLiteralToArray(arguments[0]); - - this._exportFields = fields; - - return this; - } } export default ListView; diff --git a/src/javascripts/ng-admin/es6/tests/lib/Utils/fieldsUtilsTest.js b/src/javascripts/ng-admin/es6/tests/lib/Utils/fieldsUtilsTest.js deleted file mode 100644 index 7411d312..00000000 --- a/src/javascripts/ng-admin/es6/tests/lib/Utils/fieldsUtilsTest.js +++ /dev/null @@ -1,44 +0,0 @@ -var assert = require('chai').assert; - -import fieldsUtils from "../../../lib/Utils/fieldsUtils"; -import Field from "../../../lib/Field/Field"; - -describe('fieldsUtils', function() { - describe('fieldsLiteralToArray', function() { - - it('should convert fields in literal form to array', function() { - var a = new Field('a'); - var b = new Field('b'); - var c = new Field('c'); - var fields = { - a: a, - b: b, - c: c - } - - assert.deepEqual(fieldsUtils.fieldsLiteralToArray(fields), [a, b, c]); - }); - - it('should sort array using order if specified', function() { - var a = new Field('a').order(3); - var b = new Field('b').order(2); - var c = new Field('c').order(1); - var fields = { - a: a, - b: b, - c: c, - } - - assert.deepEqual(fieldsUtils.fieldsLiteralToArray(fields), [c, b, a]); - }); - - it('should return an array if given an array', function() { - var a = new Field('a').order(3); - var b = new Field('b').order(2); - var c = new Field('c').order(1); - var fields = [a,b,c]; - - assert.deepEqual(fieldsUtils.fieldsLiteralToArray(fields), [c, b, a]); - }); - }); -});