Bug 1769960

Summary: Regex validation not working when using dialogs
Product: Red Hat CloudForms Management Engine Reporter: Tuan <tuado>
Component: AutomateAssignee: Martin Hradil <mhradil>
Status: CLOSED NOTABUG QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.10.8CC: dmetzger, gmccullo, mhradil, mkanoor, mshriver, obarenbo, tfitzger
Target Milestone: GAKeywords: Regression, TestOnly, ZStream
Target Release: 5.12.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1773626 1773627 (view as bug list) Environment:
Last Closed: 2020-06-10 12:59:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1773626, 1773627    

Description Tuan 2019-11-07 19:40:39 UTC
Description of problem:
After updating to 5.10.11. Past Regex issue is reoccurring 

"when we first load the dialog, if there is no value supplied, we don't validate it is a regex and then we don't fix it afterwards on a triggered refresh"

This seems to be a regression from: https://bugzilla.redhat.com/show_bug.cgi?id=1702064

Version-Release number of selected component (if applicable):
5.10.11

How reproducible:
Always

Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:

New logs: http://file.rdu.redhat.com/tuado/logs/tva02512539/

Comment 2 Dave Johnson 2019-11-07 21:04:40 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set the severity to Low.

Comment 14 Tina Fitzgerald 2019-11-15 19:43:34 UTC
Hi Tuan,

As Martin stated in comment 10, the customer can set the regular expression validator rule to their Automate method as a workaround until the fix is available.

Custom Automate method: /TVA/Integration/DynamicDialogs/Dialogs/regex_validation

Can you ask the customer to add the following line before the exit MIQ_OK?

Add this:
  $evm.object['validator_rule'] = 'regex'

Before this:
  exit MIQ_OK if template.blank?

This should resolve their performance issue having to execute the entire method even when the template is blank.

Let me know if you have any questions.

Thanks,
Tina

Comment 15 CFME Bot 2019-11-18 15:07:34 UTC
New commit detected on ManageIQ/ui-components/master:

https://github.com/ManageIQ/ui-components/commit/172297da2e91b9643368af568c9aae965e2ce2e6
commit 172297da2e91b9643368af568c9aae965e2ce2e6
Author:     Martin Hradil <mhradil>
AuthorDate: Fri Nov 15 07:51:00 2019 -0500
Commit:     Martin Hradil <mhradil>
CommitDate: Fri Nov 15 07:51:00 2019 -0500

    DialogUser - update validator_type during field refresh

    when validator_type is set to 'regex' on load, the field will use the current validator_rule to validate,
    but if validator_type is changed only later in a method, the field never starts to validate.

    Making sure both validator_rule and validator_type are respected during field refresh.

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1769960

 src/dialog-user/components/dialog-user/dialogUser.ts | 1 +
 1 file changed, 1 insertion(+)