Bug 1641771

Summary: Copying a custom report from a custom report menu changes source report name
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: UI - OPSAssignee: Harpreet Kataria <hkataria>
Status: CLOSED ERRATA QA Contact: Parthvi Vala <pvala>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: unspecified    
Version: 5.9.4CC: dmetzger, hkataria, jprause, mpovolny, obarenbo, smallamp
Target Milestone: GAKeywords: ZStream
Target Release: 5.9.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.9.6.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1632847 Environment:
Last Closed: 2018-12-13 15:15:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On: 1632847    
Bug Blocks: 1622587    

Comment 3 Parthvi Vala 2018-10-24 09:45:39 UTC
Verified on 5.9.5.3.20181023135339_256263f. FAILED.

With the changes introduced in the PR(https://github.com/ManageIQ/manageiq-ui-classic/pull/4699), it's now possible to add and copy a report with `Add` and `Copy` roles, but copying the report replaces the original report.

Steps taken to verify this BZ:
1) Navigate to Configuration > Access Control.
2) Create role `Role-reporting` with `Add` and `Copy` roles for `Reports`.
3) Create a group `Group-reporting` with `Role-reporting` role.
4) Create a user `Test RBAC User` which is part of `Group-reporting` and Super administrator groups.
5) Login with the new user. Check the group after login, it should be `Role-reporting`.
6) Navigate to Cloud Intel > Reports.
7) Click on `Configuration`, select `Add a new Report` and add the new report.[Thus, verifying `Add` role change.]
8) Navigate to `Edit Report Menus` accordion.
9) Create a new menu `My` and a sub-menu `Reports` under it. Move the newly created report to this sub-menu. Commit and Save the new changes.
10) Refresh the browser and see if the new changes are reflected.
11) Select the newly moved report under `My / Reports` menu.
12) Click on `Configuration` and select `Copy this Report`.
13) Make some changes to the report if required and save the report.[Thus verifying `Copy` role change.]
14) Refresh the browser.
15) Observe `My / Reports` menu. The old report is replaced by the newly copied report.

Check Video attachment for better understanding.

Conclusion:
Copying a custom report from custom report menu doesn't just change the name of that report, but replaces the whole report from under the menu.


Failing this BZ.

Comment 7 CFME Bot 2018-10-25 10:11:38 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:

https://github.com/ManageIQ/manageiq-ui-classic/commit/fc669afde15b06b3c12e5bb8f6502c0cd73ef3ba
commit fc669afde15b06b3c12e5bb8f6502c0cd73ef3ba
Author:     Harpreet Kataria <hkataria>
AuthorDate: Wed Oct 24 15:00:22 2018 -0400
Commit:     Harpreet Kataria <hkataria>
CommitDate: Wed Oct 24 15:00:22 2018 -0400

    Only update report name in group reports menu when editing a report

    Only update report name for user's group menu when editing an existing report. Since report are saved by name in user's group record for menus, updating report name while copying a report was causing an issue of showing incorrect reports in user created custom folders. Newly added and copied reports by default get added into My Company/Custom folder.

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

 app/controllers/report_controller/reports/editor.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 9 CFME Bot 2018-11-05 17:28:04 UTC
New commit detected on ManageIQ/manageiq-ui-classic/gaprindashvili:

https://github.com/ManageIQ/manageiq-ui-classic/commit/0e644ab3961ab4e76c5bae2cea19c88ea302cc2b
commit 0e644ab3961ab4e76c5bae2cea19c88ea302cc2b
Author:     Milan Zázrivec <mzazrivec>
AuthorDate: Thu Oct 25 06:08:31 2018 -0400
Commit:     Milan Zázrivec <mzazrivec>
CommitDate: Thu Oct 25 06:08:31 2018 -0400

    Merge pull request #4824 from h-kataria/fix_copying_of_report

    Only update report name in group reports menu when editing a report

    (cherry picked from commit c0034b914089ccdf8eead1906283cd28e4e25ba2)

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

 app/controllers/report_controller/reports/editor.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 10 Parthvi Vala 2018-11-08 07:33:30 UTC
FIXED. Verified on 5.9.6.0.20181105224828_652732b.

Comment 12 errata-xmlrpc 2018-12-13 15:15:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:3816