Permalink
Browse files

feat(project): ability to ignore entire association

  • Loading branch information...
VMBindraban
VMBindraban committed Aug 8, 2016
1 parent cd455c2 commit 97953f41c8d71ba6f9403e500b45d5cf13fb9abf
Showing with 22 additions and 2 deletions.
  1. +20 −1 doc/Usage.md
  2. +2 −1 src/filter.js
@@ -27,7 +27,26 @@ This is as simple as `EntityManager.getEntity('resource')`. *[More information](
If you don't use the `@type` decorator it will assume that the column is `text`.

### exclude-columns
When using an entity, you can exclude columns (comma separated) from showing up in the filter.
When using an entity, you can exclude columns (comma separated) from showing up in the filter. You can exclude entire associations or part of them.

```js
// entity result set
{
user: {
username: 'Bob',
password: 'a78dasd8907asd89a7sd&ASd98a7sd79'
},
groups : {
id : 1,
name: 'users'
},
createdAt: '2016-01-01'
}
```

```html
<filter exclude-columns="user.password, createdAt, groups"></filter>
```

### criteria
The generated criteria object. Use this object to query your application.
@@ -216,7 +216,8 @@ export class Filter extends CriteriaBuilder {
for (let column in columns) {
let columnName = (entityName) ? entityName + '.' + column : column;

if (excludeColumns.indexOf(columnName) > -1) {
// ignore entire or part of a association
if (excludeColumns.indexOf(entityName) > -1 || excludeColumns.indexOf(columnName) > -1) {
continue;
}

0 comments on commit 97953f4

Please sign in to comment.