Bug 1571835 - dialog with 2 dynamic dropdown that must refresh each other do not refresh in CF 4.6 (but they do in CF 4.5)
Summary: dialog with 2 dynamic dropdown that must refresh each other do not refresh in...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.9.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: GA
: 5.9.2
Assignee: Tina Fitzgerald
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-25 13:39 UTC by Reartes Guillermo
Modified: 2019-08-22 00:55 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-01 12:53:43 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:


Attachments (Terms of Use)
datastore CF 4.5 (811.19 KB, application/zip)
2018-04-25 13:40 UTC, Reartes Guillermo
no flags Details
datastore CF 4.6 (917.15 KB, application/zip)
2018-04-25 13:40 UTC, Reartes Guillermo
no flags Details
dialog for CF 4.5 (3.04 KB, text/x-vhdl)
2018-04-25 13:41 UTC, Reartes Guillermo
no flags Details
dialog for CF 4.6 (3.12 KB, text/x-vhdl)
2018-04-25 13:42 UTC, Reartes Guillermo
no flags Details
screenshot CF 4.5 working (46.86 KB, image/png)
2018-04-25 13:42 UTC, Reartes Guillermo
no flags Details
screenshot CF 4.6 not working (44.85 KB, image/png)
2018-04-25 13:43 UTC, Reartes Guillermo
no flags Details
evm.log CF 4.5 (1.09 MB, application/x-gzip)
2018-04-25 13:48 UTC, Reartes Guillermo
no flags Details
evm.log CF 4.6 (635.39 KB, application/x-gzip)
2018-04-25 13:49 UTC, Reartes Guillermo
no flags Details
automate.log CF 4.5 (203.27 KB, text/plain)
2018-04-25 13:49 UTC, Reartes Guillermo
no flags Details
automate.log CF 4.6 (473.24 KB, text/plain)
2018-04-25 13:49 UTC, Reartes Guillermo
no flags Details
Dialog import circular reference error (25.91 KB, image/png)
2018-04-27 20:46 UTC, Tina Fitzgerald
no flags Details

Description Reartes Guillermo 2018-04-25 13:39:35 UTC
Description of problem:

I found that if 2 dynamic dropdowns try to refresh each other, nothing happens.
No error, no refresh, no action is taken (nothing is shown in both evm.log and automate.log).

I created a mockup code Domain: DropdownReproducer (ignore the other domains)
This mockup tries to reproduce another more complex dialog.

I did this on a CF 4.6 appliance and on another CF 4.5 appliance.
The code was copied from CF 4.6 to CF 4.5.

/DropdownReproducer/DynamicDialog/dropdown_reproducer/dlg_net_type1
/DropdownReproducer/DynamicDialog/dropdown_reproducer/dlg_net_type2

Also i created these service dialogs:

dropdown-reproducer-2D -> Created on CF 4.6 [dialog_export_20180425_101143-CF46.yml]
dropdown-reproducer-2D -> Created on CF 4.5 [dialog_export_20180425_100951-CF45.yml]

In the example code there are 2 dropdowns:

Network Type #1 and #2.

There are 4 network types, 2 of them (management and internet cannot be repeated) and none.

In CF 4.5 this code works correctly. If one selects internet in Network Type #2 and then in Network Type #1, the internet from Network Type #2 is removed.

But on CF 4.6 absolutely nothing happens, not even a log output line (both evm.log and automate.log).



Version-Release number of selected component (if applicable):
5.9.1.2  (no refresh, no logs, no error, nothing)
5.8.2.3  (working correctly)

How reproducible:
always

Steps to Reproduce:
1. Import the domain "DropdownReproducer" (ignore the other domains in the zip or remove them from the zip before)
2. Import the service dialog, make sure to that they point to the appropriate method.
3. Create a generic catalog item using the imported dialog
4. On CF 4.6 changing Network Type #1 will do nothing.

Actual results:
no refresh happens on CF 4.6

Expected results:
refresh should happen (or at least some error)

Additional info:

Comment 2 Reartes Guillermo 2018-04-25 13:40:18 UTC
Created attachment 1426674 [details]
datastore CF 4.5

Comment 3 Reartes Guillermo 2018-04-25 13:40:46 UTC
Created attachment 1426675 [details]
datastore CF 4.6

Comment 4 Reartes Guillermo 2018-04-25 13:41:44 UTC
Created attachment 1426678 [details]
dialog for CF 4.5

Comment 5 Reartes Guillermo 2018-04-25 13:42:06 UTC
Created attachment 1426679 [details]
dialog for CF 4.6

Comment 6 Reartes Guillermo 2018-04-25 13:42:34 UTC
Created attachment 1426680 [details]
screenshot CF 4.5 working

Comment 7 Reartes Guillermo 2018-04-25 13:43:02 UTC
Created attachment 1426681 [details]
screenshot CF 4.6 not working

Comment 8 Reartes Guillermo 2018-04-25 13:48:42 UTC
Created attachment 1426683 [details]
evm.log CF 4.5

I had to compress them due to its size (11M)

Comment 9 Reartes Guillermo 2018-04-25 13:49:05 UTC
Created attachment 1426691 [details]
evm.log CF 4.6

Comment 10 Reartes Guillermo 2018-04-25 13:49:25 UTC
Created attachment 1426692 [details]
automate.log CF 4.5

Comment 11 Reartes Guillermo 2018-04-25 13:49:55 UTC
Created attachment 1426693 [details]
automate.log CF 4.6

Comment 12 William Fitzgerald 2018-04-25 18:29:36 UTC
This is a really good one to test dynamic refresh in working properly.   

I was able to reproduce this on 5.9.2.3 appliance.  Works on 5.8.3.4.

I had a problem importing the dialog for 4.6, was getting circular reference.
I deleted the value for the 'dialog_field_responders:', imported and then manually added it to the dialog.

This looks like a very simple version of the dialogs that are being used in BZ: 
https://bugzilla.redhat.com/show_bug.cgi?id=1570165

Comment 14 Tina Fitzgerald 2018-04-26 17:47:10 UTC
Thanks John, I'm looking into it now.

Comment 15 Tina Fitzgerald 2018-04-27 20:46:57 UTC
Created attachment 1427835 [details]
Dialog import circular reference error

Screen shot showing dialog import failure due to circular reference.

Comment 16 Tina Fitzgerald 2018-04-27 20:55:48 UTC
Hi Reartes,

Your 4.6 dialog is invalid, due to a circular reference. 
The attachment in comment 15 shows the UI error displayed when trying to import your dialog. You wouldn't have known that that is an issue because the dialog editor in 4.6 wont prevent you from manually creating a circular reference. 

Can we close this ticket?

Thanks,
Tina

Comment 17 Reartes Guillermo 2018-04-27 21:16:59 UTC
Hi,

The "invalid" dialog was generated with the dialog editor, so if there is something to fix on the dialog editor, i would NOT close the bug unless one can be sure that no invalid dialog (at least in relation to this issue) can be created via the dialog editor (otherwise people will keep opening BZs or Cases, etc.)

But if the dialog editor will be fixed to not to permit the circular reference error, then yes.

Just to be clear, i did not edit the dialog manually.
I am also not sure under what conditions the dialog becomes "invalid".

Thanks.

Comment 18 Tina Fitzgerald 2018-04-30 21:34:20 UTC
Hi Reartes,

The 5.9.1.2 dialog import will complain about a circular reference on import, but it will let you create a circular reference through the dialog editor.
 
The 5.9.2 dialog import will complain about a circular reference on import, and the dialog editor will NOT let you save a dialog with a circular reference. 

The dialog is considered invalid if you have the "fields to refresh" value for each item point to the other item.

For example, you have 2 fields: field1 and field2
field1 has a "fields to refresh" value of field2, and
field2 has a "fields to refresh" value of field1.

Can we close the ticket since the dialog editor has been updated to prevent the circular reference?

Thanks,
Tina

Comment 19 Reartes Guillermo 2018-05-01 12:33:34 UTC
Hi,

It looks like it can.

Thanks.

Comment 20 Tina Fitzgerald 2018-05-01 12:53:43 UTC
The circular reference check was added here: 
https://github.com/ManageIQ/manageiq/pull/16918


Note You need to log in before you can comment on or make changes to this bug.