Bug 1705013

Summary: Validation Button for Dialogs work weird in CloudForms
Product: Red Hat CloudForms Management Engine Reporter: Khushbu Borole <kborole>
Component: UI - OPSAssignee: Martin Hradil <mhradil>
Status: CLOSED CURRENTRELEASE QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.3CC: bmidwood, hkataria, lavenel, mfeifer, mpovolny, mshriver, nansari, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.11.0.7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1717704 (view as bug list) Environment:
Last Closed: 2019-12-13 15:00:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1717704    

Description Khushbu Borole 2019-05-01 05:40:42 UTC
Description of problem:
The way to configure field validation is new and works in a weird manner. There is now a new switch indicating whether there is regex-based field validation or not, and separately a text box for the regex as before.

By default in Web UI, the new switch is halfway between Yes and No. User can turn it to Yes position, which works OK.

But if the user turns it to the No position, and saves the dialog,  it will be again halfway between Yes and No when the user opens the dialog editor next time.

The logic is not fully clear.


Version-Release number of selected component (if applicable):
Red Hat CloudForms 5.10.3

How reproducible:
Always

Steps to Reproduce:
1. Create a Dialog with text box validation button
2. Give a validation Regex expression
3. Move the button 'No'

Actual results:
it will be again halfway between Yes and No when the user opens the dialog editor next time.

Expected results:
It should be either Yes/No as per previously saved data

Comment 4 Dave Johnson 2019-05-01 08:01:41 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 9 CFME Bot 2019-05-31 12:47:35 UTC
New commit detected on ManageIQ/ui-components/master:

https://github.com/ManageIQ/ui-components/commit/3ae4ba1a82ed38e33f322dde40abefd3c2417151
commit 3ae4ba1a82ed38e33f322dde40abefd3c2417151
Author:     Martin Hradil <mhradil>
AuthorDate: Thu May 23 07:59:46 2019 -0400
Commit:     Martin Hradil <mhradil>
CommitDate: Thu May 23 07:59:46 2019 -0400

    dialog-editor-validation - chane validator_type false value from undefined to false

    to work around angular-bootstrap-switch parsing "undefined" as an indeterminate value (undecided switch)
    (https://github.com/frapontillo/angular-bootstrap-switch/issues/138)

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

 src/dialog-editor/components/validation/validation.html | 2 +-
 src/dialog-editor/components/validation/validation.ts | 8 +
 2 files changed, 9 insertions(+), 1 deletion(-)

Comment 11 Niyaz Akhtar Ansari 2019-06-14 09:58:43 UTC
I have tested this in 5.11 and same issue present in 5.11.0.8
failing this BZ. see comments https://bugzilla.redhat.com/show_bug.cgi?id=1717704#c4

Comment 12 Martin Hradil 2019-06-17 09:55:45 UTC
Just to be clear, the reason this is failed has nothing to do with the original bug.

> Steps to reproduce.
>
> 1. Create a dialog. Set regex_validation in text box ->  ^[0-9]*$ 
> 2. Save the dialog
> 3. Edit the dialog and disable the validation button of text box 
> 2. Use the dialog in a catalog.
> 3. In catalog order page

> except the format " ^[0-9]*$ " you input anything else it gives below validation error 
> --> Entered text should match the format: ^[0-9]*$


The original bug in the dialog-editor component is fixed, but a related bug is also present in the dialog-user component.