Description of problem: Validate field in CloudForms Service Dialogs does not validate properly 1. If I order the service, type "1" and clear the field, Submit button stays active -> OK 2. If I order the service, type "1" and clear the field, type "a" and clear the field, Submit button stays active -> OK 3. If I order the service, type "a" and clear the field, Submit button stays inactive -> NOK Submit button should have become active when the field was cleared. Version-Release number of selected component (if applicable): Red Hat CloudForms 4.7.4 How reproducible: Always Steps to Reproduce: 1. Regular Expression - "^[0-9]*$" 2. Order the service 3. Type "a" and it will show a message that does not satisfy the regex. 4. Clear the field 5. Submit button stays inactive Actual results: Submit button stays inactive once I fill invalid regex value and delete it back. Expected results: Submit button should have become active when the validate field [not required field] was cleared. Additional info: Reference Bugzilla - https://bugzilla.redhat.com/show_bug.cgi?id=1702063
New commits detected on ManageIQ/ui-components/master: https://github.com/ManageIQ/ui-components/commit/70541f5e02974cf2707caaacd52f2fe471412626 commit 70541f5e02974cf2707caaacd52f2fe471412626 Author: Martin Hradil <mhradil> AuthorDate: Thu Jul 4 09:46:34 2019 -0400 Commit: Martin Hradil <mhradil> CommitDate: Thu Jul 4 09:46:34 2019 -0400 DialogField#changesHappened - simplify, do not convert data DialogField.changesHappened triggers field validation, then it would convert arrays to joined strings, pass the converted value to DialogUser.updateDialogField, which runs the validation again, with the changed value. We should not do any value transformation before serializing for save. https://bugzilla.redhat.com/show_bug.cgi?id=1720245 src/dialog-user/components/dialog-user/dialogField.ts | 38 +- 1 file changed, 18 insertions(+), 20 deletions(-) https://github.com/ManageIQ/ui-components/commit/f0e2cad1afd5e9ea0d269aa4ede3704ee29bc2f8 commit f0e2cad1afd5e9ea0d269aa4ede3704ee29bc2f8 Author: Martin Hradil <mhradil> AuthorDate: Thu Jul 4 12:01:32 2019 -0400 Commit: Martin Hradil <mhradil> CommitDate: Thu Jul 4 12:01:32 2019 -0400 dialogData.validateField - always expect value to validate, don't assume now the function doesn't have to guess, so it won't fall back to default_value when being passed a falsy value from validateFields Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1720245 src/dialog-user/services/dialogData.spec.ts | 26 +- src/dialog-user/services/dialogData.ts | 13 +- 2 files changed, 19 insertions(+), 20 deletions(-)
Verified in Version 5.11.0.14.20190710225033_cb17ff0