[ADF-3238] content size min error added (#3532)

* content size min error added

* clean code
This commit is contained in:
bbcodrin
2018-06-27 11:38:57 +03:00
committed by Eugenio Romano
parent f7aaafed86
commit 8cc07f5816
3 changed files with 11 additions and 5 deletions

View File

@@ -55,7 +55,8 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
this.validators = Validators.compose([
Validators.required,
Validators.pattern(/^-?(0|[1-9]\d*)?$/)
Validators.pattern(/^-?(0|[1-9]\d*)?$/),
Validators.min(0)
]);
this.from = new FormControl('', this.validators);
@@ -78,9 +79,8 @@ export class SearchNumberRangeComponent implements SearchWidget, OnInit {
map.set('TO', model.to);
const value = this.formatString(this.format, map);
const query = `${this.field}:${value}`;
this.context.queryFragments[this.id] = query;
this.context.queryFragments[this.id] = `${this.field}:${value}`;
this.context.update();
}
}