Bug 1555331

Summary: 400 Bad Request: When custom button used from infra provider object type with method and dialog both attached
Product: Red Hat CloudForms Management Engine Reporter: Yadnyawalk Tale <ytale>
Component: UI - OPSAssignee: eclarizi
Status: CLOSED CURRENTRELEASE QA Contact: Nikhil Dhandre <ndhandre>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: hkataria, lavenel, mpovolny, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: custom_button:provider
Fixed In Version: 5.10.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1590346 (view as bug list) Environment:
Last Closed: 2019-02-11 14:05:54 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: 1635797    
Bug Blocks: 1590346    
Attachments:
Description Flags
API Error: 400 Bad Request none

Description Yadnyawalk Tale 2018-03-14 13:46:34 UTC
Created attachment 1407983 [details]
API Error: 400 Bad Request

Description of problem:
This is exceptional use-case where you attach automate and dialog both feature to custom button. This is giving `400 Bad Request` API error which is blocking dialog to appear. 

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

How reproducible:
Always

Steps to Reproduce:
1. Create dialog
2. Create instance and associative method 
Use simple ruby code behind method, for example: $evm.log("info", "CUSTOM_BUTTON_EXECUTED")
3. Create custom button for provider object type
4. Attach dialog (step1) and method (step2) to custom button
5. Goto Compute > Infra > Provider > Your provider detail page 
6. Execute custom button

When you select `Provider` object type with mentioned settings you will get custom button on following display pages:
a. Summery view of Infra provider page (*400 Bad Request*)
b. Dashboard view of Indra provider page (*400 Bad Request*)
c. Summery view of Cloud provider page (working)
d. Summery view of Containers provider page (working)
e. Dashboard view of Containers provider page (working)
f. Summery view of Containers provider page (working)
g. Dashboard view of Containers provider page (working)

Here a and b are vulnerable cases, however, custom button works well without dialog.  


Actual results:
Blocking dialog to appear on infra provider object type


Expected results:
Dialog should work on infra provider

Comment 4 Yadnyawalk Tale 2018-03-14 14:03:51 UTC
*Corrections: With the word 'automate' I mean 'automate method'.

Comment 8 CFME Bot 2018-04-04 14:31:43 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/181c5e2d60fcc46e582a51ce8976e14f2d0f328e
commit 181c5e2d60fcc46e582a51ce8976e14f2d0f328e
Author:     Erik Clarizio <eclarizio>
AuthorDate: Tue Apr  3 13:59:31 2018 -0400
Commit:     Erik Clarizio <eclarizio>
CommitDate: Tue Apr  3 13:59:31 2018 -0400

    Adjust target type for InfraManager custom buttons

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

 app/services/dialog_local_service.rb | 2 +
 spec/services/dialog_local_service_spec.rb | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comment 11 Nikhil Dhandre 2018-11-01 11:24:23 UTC
tested with 5.10.0.22; Working without API error.