Revert "#1032 test failing"

This reverts commit 681ac605ff.
This commit is contained in:
Gerard 2019-01-25 16:21:23 +01:00
parent 681ac605ff
commit c0a987b3d4
2 changed files with 8 additions and 22 deletions

View File

@ -271,9 +271,7 @@ export default class Autocomplete extends Input {
'where',
'order',
'limit',
'params',
'searchFunction',
'paramsFunction'
'searchFunction'
]);
}
@ -304,10 +302,8 @@ ngModule.component('vnAutocomplete', {
where: '<?',
order: '@?',
limit: '<?',
params: '<?',
translateFields: '<?',
searchFunction: '&?',
paramsFunction: '&?'
searchFunction: '&?'
},
transclude: {
tplItem: '?tplItem'

View File

@ -404,19 +404,11 @@ export default class DropDown extends Component {
order,
limit: this.limit || 8
};
let params = Object.assign({}, this.params);
if (model instanceof CrudModel) {
let searchExpr = null;
let searchParams = {$search: this._search};
if (this._search != null) {
if (this.searchFunction)
searchExpr = this.searchFunction(searchParams);
if (this.paramsFunction)
Object.assign(params, this.paramsFunction(searchParams));
}
let searchExpr = this._search == null
? null
: this.searchFunction({$search: this._search});
Object.assign(filter, {
fields: this.getFields(),
@ -425,10 +417,10 @@ export default class DropDown extends Component {
});
} else if (model instanceof ArrayModel) {
if (this._search != null)
filter.where = this.searchFunction(searchParams);
filter.where = this.searchFunction({$search: this._search});
}
return this.model.applyFilter(filter, params);
return this.model.applyFilter(filter);
}
searchFunction(scope) {
@ -484,9 +476,7 @@ ngModule.component('vnDropDown', {
where: '<?',
order: '@?',
limit: '<?',
params: '<?',
searchFunction: '&?',
paramsFunction: '&?'
searchFunction: '&?'
},
transclude: {
tplItem: '?tplItem'