Bug 1576107 - reading a dialog element from another dialog dynamic element fails until refreshing the dynamic element that reads the other dialog element
Summary: reading a dialog element from another dialog dynamic element fails until refr...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.9.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: GA
: 5.10.0
Assignee: Roman Blanco
QA Contact: Shveta
URL:
Whiteboard:
Depends On:
Blocks: 1591425
TreeView+ depends on / blocked
 
Reported: 2018-05-08 21:10 UTC by Reartes Guillermo
Modified: 2019-02-11 13:59 UTC (History)
16 users (show)

Fixed In Version: 5.10.0.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1591425 (view as bug list)
Environment:
Last Closed: 2019-02-11 13:59:59 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
example datastore (3.42 KB, application/zip)
2018-05-08 21:10 UTC, Reartes Guillermo
no flags Details
example dialog (2.48 KB, text/x-vhdl)
2018-05-08 21:11 UTC, Reartes Guillermo
no flags Details
automate.log (5.11 KB, text/plain)
2018-05-08 21:15 UTC, Reartes Guillermo
no flags Details
pre refresh (17.20 KB, image/png)
2018-05-08 21:16 UTC, Reartes Guillermo
no flags Details
post refresh (17.56 KB, image/png)
2018-05-08 21:16 UTC, Reartes Guillermo
no flags Details
reproducer dialog screenshot (64.57 KB, image/png)
2018-05-21 15:55 UTC, Reartes Guillermo
no flags Details
CF 4.5 dialog, CORRECT (66.96 KB, image/png)
2018-06-05 15:36 UTC, Reartes Guillermo
no flags Details
CF 4.6 dialog INCORRECT / BAD / BUG (35.17 KB, image/png)
2018-06-05 15:36 UTC, Reartes Guillermo
no flags Details

Description Reartes Guillermo 2018-05-08 21:10:00 UTC
Created attachment 1433433 [details]
example datastore

Description of problem:

I found that a method called from a dynamic dialog element (like textbox / dropdown) does read nil a previous textbox element the first time.
If one hits the refresh button on the dynamic dialog element, i can at that moment read the previous textbox element correctly.


Version-Release number of selected component (if applicable):
CF 4.6 (CFME 5.9.2.4)

How reproducible:
always

Steps to Reproduce:
1. import example automate domain
2. import example service dialog
3. create a generic catalog item with the dialog service dialog provided

Actual results:

The case use would be a cmdb attribute is fetched to a textbox and that field must be read from a later dynamic dialog element. (this is working with cf 4.5 but i wont work with cf 4.6). The example provided is just a minimal test case. And combining this issue with rhbz 1574633 makes the situation is much much worse.

Expected results:
a second dialog dynamic element should be able to read the previous textbox element. (the textbox element was set to refresh the later dialog dynamic element).

Comment 2 Reartes Guillermo 2018-05-08 21:11:25 UTC
Created attachment 1433434 [details]
example dialog

Comment 3 Reartes Guillermo 2018-05-08 21:15:21 UTC
Created attachment 1433435 [details]
automate.log

pre and post refresh output for example method

Comment 4 Reartes Guillermo 2018-05-08 21:16:12 UTC
Created attachment 1433436 [details]
pre refresh

Comment 5 Reartes Guillermo 2018-05-08 21:16:36 UTC
Created attachment 1433437 [details]
post refresh

Comment 6 Reartes Guillermo 2018-05-08 21:18:47 UTC
Just to be clear:

For static_txtbox1 the Fields to refresh is set to DYNAMIC TXTBOX2.

In this example static_txtbox1 is static, but in the real case it will be dynamic.

Thanks in advance.

Comment 8 drew uhlmann 2018-05-14 12:07:11 UTC
For dynamic fields usually when the Show Refresh Button is set to true, the dialog editor immediately gives the user the opportunity to show the values on init. I'm looking into why the editor won't show the init values on load for a textbox.

Comment 9 drew uhlmann 2018-05-14 13:02:35 UTC
Our ui-components/src/dialog-editor/components/modal-field-template/text-box.html doesn't seem to have an option for loading the values on init if the show_refresh_button is set and I'd guess that it maybe should.

Comment 12 Reartes Guillermo 2018-05-21 15:55:36 UTC
Created attachment 1439682 [details]
reproducer dialog screenshot

Comment 13 Reartes Guillermo 2018-05-21 15:57:18 UTC
Regarding comment #9, i certainly cannot select load on init by using the dialog editor.

So, it looks that it might be. 
I attached a screenshot from the dynamic dialog on the dialog editor.

I hope this helps.

Cheers.

Comment 16 Shveta 2018-05-29 20:38:27 UTC
Dynamic text box does not show value without hitting refresh button.
"Load value on init " is not displayed for dynamic text box.
Not fixed in master.20180525014609_98ef65d

Comment 17 Shveta 2018-05-29 23:36:41 UTC
By this "Load value on init " is not displayed for dynamic text box. I mean values are not loaded on init .

Comment 18 drew uhlmann 2018-05-30 13:51:17 UTC
On 5.8.4.3.20180515170411_29cc195 I can set up a dynamic text box to load with the values correctly. I think this ticket was due to incorrect setup problems, and should be closed as not a bug. I'm looking into why the attached code didn't work as expected but I think this works when set up right.

Comment 19 drew uhlmann 2018-05-30 14:02:10 UTC
Okay just kidding, please disregard the previous comment.

Comment 20 drew uhlmann 2018-06-05 14:45:07 UTC
As noted to Ryan, this bug is specific to only mention text boxes, and per https://bugzilla.redhat.com/show_bug.cgi?id=1438763 the default load value for text boxes is blank. This is expected behavior.

Comment 21 drew uhlmann 2018-06-05 15:03:10 UTC
Working as designed, closing.

Comment 22 Reartes Guillermo 2018-06-05 15:31:51 UTC
Reopening.

This has nothing to do with the default value for textbox.

It is about the lack of "load values on init" so a mandatory refresh is needed.
This works in CF 4.5 and not in CF 4.6.

Comment 23 drew uhlmann 2018-06-05 15:34:49 UTC
Reartes, Ryan's first comment in the bug I linked to is that on load the text box should be blank. This isn't a bug.

Comment 24 Reartes Guillermo 2018-06-05 15:36:06 UTC
Created attachment 1447911 [details]
CF 4.5 dialog, CORRECT

Comment 25 Reartes Guillermo 2018-06-05 15:36:40 UTC
Created attachment 1447912 [details]
CF 4.6 dialog INCORRECT / BAD / BUG

Comment 26 Reartes Guillermo 2018-06-05 15:38:42 UTC
The "blank" textbox is dynamic, and it is "blank" ATM because "load values on init" is not present (and should be) on the dialog editor.

It is a bug in the dialog editor or other part of CF, but it is a bug.

Comment 27 drew uhlmann 2018-06-05 15:41:58 UTC
No. We've never had the load values on init on the editor for things that are not sorted dialog field items. Text boxes should not should load values on init option. They don't. That particular thing isn't a bug either.

Comment 28 Reartes Guillermo 2018-06-05 16:18:12 UTC
Ok.

Can you elaborate "not sorted dialog field items" a bit.

I re-checked and neither load values on init (ok to not to be, according to comment 27) nor auto-refresh can be selected on the dialog editor (4.6).

CF 4.6 has targeted refresh, so i know the refresh logic changed somehow.
But even then textbox1 was set (tried both set/unset) to refresh textbox2, the textbox2 does not auto refresh automatically.

It is required fir textbox2 to not to need a "refresh" click. In fact, in the final version the refresh will be absent.

Comment 29 drew uhlmann 2018-06-05 18:35:54 UTC
To address your comment about the auto-refresh no longer being on the editor, please see this post: https://github.com/ManageIQ/manageiq.org/pull/663/files. This is the targeted refresh change you're talking about. It still has the same functionality, we just made a bunch of improvements to the system. 

The load_values_on_init not being on the editor is covered a little here: https://github.com/ManageIQ/ui-components/pull/296. Only the dialog fields that inherit from SortedItem will show load_values as an option in the editor. Dropdowns and checkboxes are sorted. Text boxes are not. This is how it's always been.

"It is required fir textbox2 to not to need a "refresh" click." Then please open an RFE about that because this works as intended, like I said previously in comment 23. 

I'm not sure what you mean by "In fact, in the final version the refresh will be absent."

Comment 30 drew uhlmann 2018-06-06 13:49:10 UTC
This might be partially related to the issue described here: https://bugzilla.redhat.com/show_bug.cgi?id=1586157 but it's pretty hard to tell from the description of this bug.

Comment 31 drew uhlmann 2018-06-06 14:02:12 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1583704 might also be related too, but from the description of this bug I can't tell that either. Reartes, can you please check to see what happens when you submit the dialog without changing the fields at all and tell me if the values that get passed through the API call are the ones that were displayed when you submitted the dialog please?

Comment 32 drew uhlmann 2018-06-06 18:10:46 UTC
I feel like the described issue, as far as text boxes are concerned, is a dup of https://bugzilla.redhat.com/show_bug.cgi?id=1380504.

Comment 33 drew uhlmann 2018-06-06 19:16:57 UTC
I'd really like a reproducer for this so I can see exactly what's going on.

Comment 34 Dave Johnson 2018-06-06 19:22:03 UTC
Shveta, can you work with Drew and Comment 33 please, thanks!

Comment 35 Shveta 2018-06-06 19:54:46 UTC
Hi Drew , 

Please check these two appliances .
https://10.8.199.197/ - upstream master
https://10.8.198.6 - 5.8 appliance .

The issue is in 5.8 if the text box is dynamic and "show refresh button" is checked , "load values on init " checkbox also shows up as an option in the dialog settings.

where as in 5.9 if the textbox is dynamic ,show refresh button = Yes , 
"load values on init" does not display .

So it's a UI bug,  I think we have missed to add that button for dynamic text box when "show refresh button " is checked.

Comment 36 drew uhlmann 2018-06-07 12:17:00 UTC
Dan, I assigned this to you per Shveta's comment 35 because she's right, the load values thing shows up in 5.8 editor for text boxes.

Comment 39 Tina Fitzgerald 2018-06-11 18:29:32 UTC
Discussed the issue with Erik:
He said the checkbox needs to be there and that it's also missing for text area box, check box field, and radio buttons.

Comment 42 CFME Bot 2018-06-13 07:42:14 UTC
New commit detected on ManageIQ/ui-components/master:

https://github.com/ManageIQ/ui-components/commit/fbf2ac4f7b8e5955bca40a9fbcce0834c002e2b1
commit fbf2ac4f7b8e5955bca40a9fbcce0834c002e2b1
Author:     Roman Blanco <rblanco>
AuthorDate: Tue Jun 12 11:14:37 2018 -0400
Commit:     Roman Blanco <rblanco>
CommitDate: Tue Jun 12 11:14:37 2018 -0400

    Added missing checkbox to allow load dynamic dialog values on init

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

 src/dialog-editor/components/modal-field-template/check-box.html | 7 +
 src/dialog-editor/components/modal-field-template/text-area-box.html | 7 +
 src/dialog-editor/components/modal-field-template/text-box.html | 7 +
 3 files changed, 21 insertions(+)

Comment 44 Satoe Imaishi 2018-06-26 12:38:31 UTC
https://github.com/ManageIQ/manageiq/pull/17631

Comment 45 Shveta 2018-07-17 20:22:04 UTC
"Load values on init " is shown for dynamic text boxes in 5.10.0.3.20180705151325_ce4d2b5


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