Bug 1431688

Summary: service dialog can be submitted before entry point code on dynamic fields has completed execution
Product: Red Hat CloudForms Management Engine Reporter: Saif Ali <saali>
Component: AutomateAssignee: eclarizi
Status: CLOSED CURRENTRELEASE QA Contact: Shveta <sshveta>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: eclarizi, gblomqui, greartes, jhardy, mkanoor, myoder, obarenbo, rlsmith, simaishi, sshveta, tfitzger
Target Milestone: GAKeywords: TestOnly
Target Release: cfme-future   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: service
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1439313 1439314 (view as bug list) Environment:
Last Closed: 2018-08-07 14:31:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1439313, 1439314    
Attachments:
Description Flags
add to shopping cart enabled while refresh is working none

Description Saif Ali 2017-03-13 15:45:52 UTC
Description of problem:
We have a field on a service dialog that is marked dynamic that has entry point code that generates the name for an Azure resource based on another field on the service dialog. Occasionally the entry point code has not completed running before the user submits the service dialog. This results in a resource group being created in Azure with only part of the name it should have. The service dialog and the automation model classes and instances are attached.

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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 6 eclarizi 2017-03-28 05:19:00 UTC
Can you confirm that this is in the OPs UI? Also, can you give me the exact set of steps you're using?

I imported the given dialog and couldn't see anything that would've indicated the behavior you're seeing. I don't have all of the automate methods that are used by this dialog, but I tried an automate method with a "sleep 10" in it so that I could visibly see a fake "delay". The only thing I could think of is maybe someone typed in one of the fields that was triggering the auto-refresh and then before tabbing out of it or clicking off (which trigger the refresh), they clicked 'submit', but I tried this as well and it correctly makes the dynamic field update calls first, and then attempts to submit the dialog.

Is there a specific catalog item setup that maybe I'm missing?

Comment 8 CFME Bot 2017-03-31 17:57:41 UTC
New commit detected on ManageIQ/manageiq-ui-service/master:
https://github.com/ManageIQ/manageiq-ui-self_service/commit/7abbefddabbe70335edc73e25d4d830dfe4cc32f

commit 7abbefddabbe70335edc73e25d4d830dfe4cc32f
Author:     Erik Clarizio <eclarizi>
AuthorDate: Fri Mar 31 08:29:15 2017 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Fri Mar 31 08:34:43 2017 -0700

    Disable add to cart button when dynamic fields are processing
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1431688

 client/app/states/catalogs/details/details.html    |  2 +-
 .../app/states/catalogs/details/details.state.js   | 13 +++++
 .../states/catalogs/details/details.state.spec.js  | 68 +++++++++++++++++++++-
 3 files changed, 79 insertions(+), 4 deletions(-)

Comment 9 eclarizi 2017-03-31 18:29:39 UTC
From a previous discussion, we determined this was an SUI issue. The fix I've implemented just makes it so that the "add to cart" button is disabled while the dynamic fields are still updating.

Comment 13 Shveta 2017-10-31 19:36:16 UTC
Created attachment 1346087 [details]
add to shopping cart enabled while refresh is working

We shouldn't be able to add the catalog item to the shopping cart while it's being refreshed.

Not working in  5.9.0.4.20171024163837_ef71ea6 

Add to shopping cart is enabled while refresh is working .
Screenshot attached.

Comment 14 eclarizi 2017-11-14 08:03:16 UTC
Yeah the code got changed to use the new targeted auto refresh system and the new dialog-user ui-component and the part that was ensuring the "add to shopping cart" button gets disabled got lost in there somehow.

Comment 15 Tina Fitzgerald 2018-05-24 21:44:24 UTC
We think issue has been fixed with latest PRs. Waiting for QE to validate.

Comment 16 Shveta 2018-05-30 00:24:07 UTC
Works in master.20180525014609_98ef65d

Comment 17 Tina Fitzgerald 2018-07-09 20:16:23 UTC
Hi Shveta,

Can you test this on the latest 5.9.2.4?

Thanks,
Tina

Comment 18 Shveta 2018-07-10 16:39:50 UTC
"Add to shopping cart" button is disabled while refresh is working .
Verified in 5.10.0.3.20180705151325_ce4d2b5

Comment 19 Shveta 2018-07-10 16:42:27 UTC
Verified in 5.9.3.4.20180702181921_afd03d7