Bug 1388144 - Impossible to add Dashboard Widgets with visibility by role or by group
Summary: Impossible to add Dashboard Widgets with visibility by role or by group
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.8.0
Assignee: Martin Hradil
QA Contact: Dmitry Misharov
URL:
Whiteboard: ui:dashboard
Depends On:
Blocks: 1393073
TreeView+ depends on / blocked
 
Reported: 2016-10-24 15:06 UTC by Oleksii Tsuman
Modified: 2017-06-12 16:11 UTC (History)
7 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1393073 (view as bug list)
Environment:
Last Closed: 2017-06-12 16:11:07 UTC
Category: Bug
Cloudforms Team: Unknown
Target Upstream Version:
otsuman: automate_bug+


Attachments (Terms of Use)
screenshot (125.48 KB, image/png)
2016-10-24 15:06 UTC, Oleksii Tsuman
no flags Details

Description Oleksii Tsuman 2016-10-24 15:06:30 UTC
Created attachment 1213498 [details]
screenshot

Description of problem:
Impossible to create any widget(Reports/Charts/RSS Feeds/Menus) if you select visibility "By  Role" or "By Group'. Also If you already select "By Role" and after this change to "By Group" - select options will remain for "By Role"

Version-Release number of selected component (if applicable):
present in  5.7.0.6-alpha3.20161019140041_ea8e259 

How reproducible:


Steps to Reproduce:
1. Go to Cloud Intell - Reports
2. Open Dashboard Widgets tab
3. Create one of Reports/Charts/RSS Feeds/Menus widget with visibility "By  Role" or "By Group'

Actual results:
Impossible to create. Pop-up "A Role must be selected" occur.

Expected results:

Widget created successfully 

Additional info:
Also it is strange pop-up "Edit aborted! CFME does not support the browser's back button or access from multiple tabs or windows of the same browser. Please close any duplicate sessions before proceeding." after you press "Add" button

Comment 2 Harpreet Kataria 2016-10-30 03:40:53 UTC
Martin,

It looks like when adding a new Dashboard widget while selecting Role/Group checkbox record id is not being sent up to server with observer, i see this error in the log:

[----] I, [2016-10-29T23:32:10.882995 #10918:54a6050]  INFO -- : Started POST "/report/widget_form_field_changed" for ::1 at 2016-10-29 23:32:10 -0400
[----] I, [2016-10-29T23:32:10.897131 #10918:54a6050]  INFO -- : Processing by ReportController#widget_form_field_changed as JS
[----] I, [2016-10-29T23:32:10.897257 #10918:54a6050]  INFO -- :   Parameters: {"roles_10r19"=>"1"}
[----] F, [2016-10-29T23:32:10.906920 #10918:54a6050] FATAL -- : Error caught: [NameError] uninitialized constant Report
/home/hkataria/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:268:in `const_get'
/home/hkataria/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:268:in `block in constantize'
/home/hkataria/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:266:in `each'
/home/hkataria/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:266:in `inject'
/home/hkataria/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/inflector/methods.rb:266:in `constantize'
/home/hkataria/.rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/string/inflections.rb:66:in `constantize'
/home/hkataria/dev/manageiq/app/controllers/application_controller.rb:82:in `model'
/home/hkataria/dev/manageiq/app/controllers/application_controller.rb:637:in `report_edit_aborted'
/home/hkataria/dev/manageiq/app/controllers/application_controller.rb:652:in `load_edit'
/home/hkataria/dev/manageiq/app/controllers/report_controller/widgets.rb:126:in `widget_form_field_changed'


It works fine when editing and existing Dashboard widget. Let me know if you have question or need help recreating

Comment 4 CFME Bot 2016-11-08 16:16:46 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/427fd629f0720ce922579e6c3ca95e66ae239cf2

commit 427fd629f0720ce922579e6c3ca95e66ae239cf2
Author:     Martin Hradil <mhradil>
AuthorDate: Mon Nov 7 15:20:34 2016 +0000
Commit:     Martin Hradil <mhradil>
CommitDate: Mon Nov 7 15:20:34 2016 +0000

    Fix (nil.to_s || "new") when changing visibility type for a new widget
    
    introduced in 0517b67 (#11074), it changes the observe url for new items from `*/widget_form_field_changed/new` to `*/widget_form_field_changed` when `@widget.id` is `nil` (new item)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1388144

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

Comment 5 CFME Bot 2016-11-08 16:16:52 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/14824810146fcb892119c07d4599a73dc8aa61f5

commit 14824810146fcb892119c07d4599a73dc8aa61f5
Author:     Martin Hradil <mhradil>
AuthorDate: Mon Nov 7 14:02:44 2016 +0000
Commit:     Martin Hradil <mhradil>
CommitDate: Mon Nov 7 14:02:44 2016 +0000

    report_edit_aborted - don't assume self.class.model always works
    
    ReportController has no associated model, this `report_edit_aborted` always throws in that case
    
    Introduced in 0918751 (#10532)
    
    Fixed to assume traditional routing when no model is found.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1388144

 app/controllers/application_controller.rb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comment 6 CFME Bot 2016-11-08 17:56:22 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/8d8f1f48b568ccd8fc801d7b08c894241a1913e1

commit 8d8f1f48b568ccd8fc801d7b08c894241a1913e1
Author:     Dan Clarizio <dclarizi>
AuthorDate: Tue Nov 8 08:07:04 2016 -0800
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Tue Nov 8 12:55:29 2016 -0500

    Merge pull request #12473 from himdel/bz1388144-report-model
    
    Fix adding new dashboard widget with role/group visibility
    (cherry picked from commit 65b7b83bca714e6d9dff4e15f278d59876fb0b02)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1388144

 app/controllers/application_controller.rb    | 6 ++++--
 app/controllers/report_controller/widgets.rb | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

Comment 8 Dmitry Misharov 2017-03-02 08:59:48 UTC
Verified in 5.8.0.3.20170301174324_1e2e0c4. There are no errors when you create a widget with visibility by role or by group.


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