mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
Integer Directive was returning false for a blank string
this was causing the integer directive to throw an error if the user entered something in the field, then erased it.
This commit is contained in:
@@ -275,7 +275,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'JobsHelper'])
|
|||||||
if (/^\-?\d*$/.test(viewValue)) {
|
if (/^\-?\d*$/.test(viewValue)) {
|
||||||
// it is valid
|
// it is valid
|
||||||
ctrl.$setValidity('integer', true);
|
ctrl.$setValidity('integer', true);
|
||||||
if ( viewValue === '-' || viewValue === '-0' || viewValue === '' || viewValue === null) {
|
if ( viewValue === '-' || viewValue === '-0' || viewValue === null) {
|
||||||
ctrl.$setValidity('integer', false);
|
ctrl.$setValidity('integer', false);
|
||||||
return viewValue;
|
return viewValue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user