Bug 1703588

Summary: Issues found when modifying roles assigned to buttons
Product: Red Hat CloudForms Management Engine Reporter: Ryan Spagnola <rspagnol>
Component: UI - OPSAssignee: Zita Nemeckova <znemecko>
Status: CLOSED CURRENTRELEASE QA Contact: Nikhil Dhandre <ndhandre>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.10.0CC: bmidwood, dmetzger, hkataria, lavenel, mpovolny, mshriver, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.11.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.11.0.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1710497 (view as bug list) Environment:
Last Closed: 2019-12-13 15:16:07 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:    
Bug Blocks: 1704905, 1710497    
Attachments:
Description Flags
button roles none

Description Ryan Spagnola 2019-04-26 19:25:33 UTC
Created attachment 1559358 [details]
button roles

Description of problem:
Two issues have been found when modifying roles associated with buttons.

1 - when attempting to add an additional role to a button the first role is removed when saving. In order to add multiple roles you must unselect the initial first role then check all roles you want assigned.

2 - when unselecting an assigned role the option to save is not available.

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

How reproducible:
Always

Steps to Reproduce:
1. create a button with a role assigned
2. edit the button and add a role
3.

Actual results:
the first role is removed

Expected results:
new role is added in addition to original role

Additional info:
see attached video

Comment 3 CFME Bot 2019-05-09 20:41:39 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/52543b323994efe23bee48a5fe0370a26cc63216
commit 52543b323994efe23bee48a5fe0370a26cc63216
Author:     Zita Nemeckova <znemecko>
AuthorDate: Tue Apr 30 05:38:25 2019 -0400
Commit:     Zita Nemeckova <znemecko>
CommitDate: Tue Apr 30 05:38:25 2019 -0400

    Remove wrong and redundant check

    Don't check again that Role you got one line prior via find_by(:id => has a correct id. You shouldn't get a Role with wrong id. Plus it only compares against string version of selected ids so it removes already saved ones that are represented by int.

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

 app/controllers/application_controller/buttons.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)