Bug 1753281

Summary: Custom buttons: deleting generic object custom button nested under another one deletes both
Product: Red Hat CloudForms Management Engine Reporter: John Dupuy <jdupuy>
Component: AutomateAssignee: Zita Nemeckova <znemecko>
Status: CLOSED WORKSFORME QA Contact: John Dupuy <jdupuy>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.11.0CC: duhlmann, gmccullo, jdupuy, mkanoor, obarenbo
Target Milestone: GA   
Target Release: 5.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-02 14:36:43 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:
Attachments:
Description Flags
All buttons deleted none

Description John Dupuy 2019-09-18 14:09:34 UTC
Created attachment 1616256 [details]
All buttons deleted

Description of problem:
Deleting a custom button that is below another custom button in the accordion tree results in both buttons being deleted. 

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

How reproducible:
100%

Steps to Reproduce:
1. Create a generic object class
2. Create a custom button under this class, name "mybutton"
3. Create another custom button under this class name "abutton"
4. Delete button called "abutton"

Actual results:
All buttons are deleted 

Expected results:
Only "abutton" should be deleted

Additional info:
See attached gif

Comment 2 John Dupuy 2019-09-18 14:13:09 UTC
Note: I am also seeing this BZ in 5.10.10

Comment 3 drew uhlmann 2019-09-24 14:14:44 UTC
So if the first button is deleted, only one gets deleted, but if you pick the second to be deleted they both are. 
This isn't a problem with the API call.

It looks like
https://github.com/ManageIQ/manageiq-ui-classic/blob/dd153fa4ed80c9e544c84765cef79b4538deac25/app/assets/javascripts/components/generic_object/generic-object-definition-toolbar.js#L57

is calling delete for multiple things.

Comment 4 drew uhlmann 2019-09-24 14:15:40 UTC
Sorry, didn't intend to link to that specific line, just that file in general.

Comment 9 John Dupuy 2020-03-02 14:37:59 UTC
I am not seeing this bug on the most recent CFME 5.11.4.1 build. Therefore I've closed this BZ as WORKSFORME.