Bug 753958

Summary: cannot add non-summary metric graphs via resource tree context menu unless you have visited the dashboard page first
Product: [Other] RHQ Project Reporter: Mike Foley <mfoley>
Component: Core UIAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2CC: hrupp, mazz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mike Foley 2011-11-14 23:03:59 UTC
Description of problem:  cannot add non-summary metric graphs via resource tree context menu unless you have visited the dashboard page first


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

How reproducible:
mazz, myself, charles

Steps to Reproduce:
1. go to platform resource ... with the monitoring tab selected
2. right-click context menu 
3. cannot add measurements ... the sub-menus are empty
  
Actual results:
sub-menus are empty

Expected results:
sub-menus are not empty

Additional info:
<ccrouch> spinder: mfoley: what browsers did you guys use to verify https://bugzilla.redhat.com/show_bug.cgi?id=751422
<ccrouch> mazz: its still not working for mazz
<mfoley> 1 sec
<mfoley> FF
<spinder> ccrouch: checking. I'm firing up my server with top of tree now. I'll also take a look at the groups view as well. 
<mfoley> i will look now too
<ccrouch> mfoley: spinder: which versions too please
<mfoley> i am FF 3.6.17
<mfoley> i continue to see stuff on my right-click context menu
<mazz> anyone have FF 4?
<mazz> that's what I'm using
* weshay_training is now known as weshay
<mfoley> just to be clear...i see 3 options under operations:  clean yum...
<mfoley> manual autodiscovery
<mfoley> and 
<mfoley> view process list
<mfoley> 1 question about this ... about the context menu
<ccrouch> i tried ff3.6 and ie8 and seem metric
<mfoley> is it all done with smartGWT?  
<ccrouch> and see the Measureuement menu
<mfoley> or is there any custom hand-done javascript stuff ...
<mfoley> stuff that might be sensitive to different browser versions?
<mfoley> and a 2nd question
<mfoley> if it is all smartGWT ... is smartGWT supposed to be compatible with FF4?
<mfoley> under measurements ... with the monitoring tab displayed ... i am able to add graphs ...
<mfoley> is that the specific thing that mazz is trying to do?
<mazz> yes, under Measurements, I see all the metrics, but all of them have [Empty Menu] as submenus
<mazz> I have no options to add graphs
<mazz> no, there is no custom javascript
<mazz> this is smartgwt here
<mfoley> ok.  i see that stuff
<mfoley> let me think ...
* stefan_n (~stefan_n.redhat.com) has joined #jboss-on
<mfoley> even though you don't see it ... 
<mfoley> i am trying to think of a way to see if the javascript is being generated
<mfoley> poking around in firebug
<spinder> ccrouch, mazz: ok... my browser versions are off the map.  FF5 and Chrome 12.0.742.91 for linux ... but with both I see options to add graphs to both resource and groups for platforms.  
<mazz> weird
<spinder> I'm checking from windows now .. so that will probably be FF5 and Crome .. not sure and IE .. not sure. I'll get that now.
* stefan_n_ has quit (Ping timeout: 610 seconds)
<mazz> as for the group metric portlet... https://bugzilla.redhat.com/show_bug.cgi?id=753585#c5
<mazz> this works for me for "normal" groups and resources, 
<mazz> there is no way this is going to work for auto groups or auto clusters
<mfoley> ok ... seeing something slightly odd when I use IE
<mfoley> on the very same submenus
* jsanda is now known as jsanda_bbl
<mfoley> from measurements
<mfoley> for example:  "Free Memory"
<mfoley> with FF I see 2 options :  add to Dashboard, and add to Monitor View
<mfoley> but from IE
<mfoley> under Free Memory
<mfoley> I then only see 1 option 
<mfoley> argh ....I take it back
<ccrouch> mfoley: do you have the Monitoring>Graphs subtab open on the right?
<mfoley> I wasn't on the Monitoring Tab
<mfoley> right
<mfoley> if I am on the Monitoring tab ... then I see the exact same behavior with FF and IE8
<mfoley> so I continue to see correct behavior.  sorry for that almost red herring
<loleary> ips: As I thought, the plugin gen commit to the release-3.0.1 branch has broken the Brew build.
<ccrouch> mazz: ok, so ignoring the autogroup stuff for a sec
<mazz>                                 //add new menu item for adding current graphable element to view if on Monitor/Graphs tab
<mazz>                                 String currentViewPath = History.getToken();
<mazz>                                 if (currentViewPath.indexOf("Monitoring/Graphs") > -1) {
<mazz> why is THAT there?
<loleary> ips: Any objection for me bumping the dependency from 4.0.1 to 3.0.1.GA in the module's pom?
<ccrouch> mazz: when you enable a new metric do you see it appear on the summary portlet for the single resource?
<mazz> it did once I started getting values for it
<mazz> ok, I just do not get this ResourceTreeView code - buildMetricsMenu
<ips> loleary: no, but as i said, i'm not 100% sure those 2 modules will still compile
<mazz> why is it looking for dashboard portlets and iterating over them
<mfoley> mazz ... initially i was thinking this is browser issue ....  but now I am not so sure?  
<loleary> ips: They compile. 
<mazz> my list of dashboards is empty
<ips> loleary: cool
<mfoley> mazz:  from your questions/comments ... this doesn't seem like a browser-specific issue?
<mfoley> is there any way i could hit your server with my browser?
<mazz> I can get you my IP.. hold one
<mfoley> my browser (which is known to be able to display right-click context menus)?
<mazz> I see why this is happening
<mazz> I see where its creating the metric menuy
<mazz> but its not putting anything in the submen
<mazz> because my list of dashboards coming back is empty
<mazz>                 public void onSuccess(PageList<Dashboard> result) {
<mazz> result is empty... and thus this for loop in here does nothing. I don't get any of this
<mfoley> okay ... so this is not a browser issue.  phew.
* hdouglas has quit (Ping timeout: 610 seconds)
<spinder> Win 7: Chrome 14.0.835.202 m, FF 5: I see the correct behavior for adding Menus.  IE .. is hosed on my box. It loads slow .. so I can't even test that version there. 
<mazz> http://10.3.113.95:7080/coregui/CoreGUI.html#Resource/10015/Monitoring/Tables
<mazz> try that
<mazz> mfoley: ^^
<mfoley> trying now
<mfoley> i have a feeling this is not a browser issue
<mfoley> 1 min
<mazz> I don't see how it can be
<mazz> the GWT code is doing what it is showing me
<mazz> the DB query for this dashboard stuff comes back empty
<mfoley> okay.  confirmed.  
<mazz> and that's the ke
<mazz> key
<mfoley> with my browser (which is known to be able to display these submenus) ...i do not see the sub menus on mazz's server
<mfoley> as if you have no dashboards?
<mfoley> i can create a dashboard ?  and see if that changes the behavior?
<mazz> jshaughn: git blame points to you as the author of this dashboard query stuff
<spinder> mazz: is your db hosed? empty dashboard list seems quite wrong? 
<mazz> I've been seeing this since before I went away on vaca
<mazz> and I've blown away my db many times 
<mazz> go ahead mfoley
<mazz> I don't understand why its looping around dashboards
<mazz> just to put measurement submenus in my tree context
<mazz> they seem orthagonal to each other
<mfoley> okay
<mfoley> for yucks ... i created a new dashboard on your server
<mfoley> now i see the submenus
<mazz> you mean everyone creates dashboards?
<mazz> I can't be the only one that doesn't touch dashboars after blowing away my db
<mfoley> actually ... i see 4 things on the submenu (where on my server i only see 2)
<mfoley> i dont create dashboards
<mfoley> on every build
<spinder> mazz: the defaults are supposed to be built/generated on first time to view the dashboard I believe. 
<mazz> ahhhhhh... what if I never GO to the dashboard view???
<ccrouch> mfoley: mazz: i deleted the dboard you added, and if back down to two options
<mfoley> okay ... 
<ccrouch> so thats a bug
<mfoley> so let me run this up the flagpole
<mfoley> the BZ title would be...
<mfoley> "right-click context menu does not display submenus unless you go to the dashboard view first"
<spinder> mazz: browsign to a resource will take you to the Dashboard view. So you won't be able to see a resource/group without requesting the default dasboards first .
<mfoley> is that the 1 line summary statement of the BZ we are seeing?
<ccrouch> so it that right mazz?
<ccrouch> you would install a server and always go to a link
<mazz> ok, so this may be minor but - why should this even care that I have dashboards or not? for the record, I never go to the #Dashboard page. ... all my bookmarks PURPOSEFULLY avoid that page like the plague to avoid the long load time
<ccrouch> not just :7080/
<mazz> spinder: that is not correct as far as I can see
<ccrouch> sogj
<ccrouch> sigh
<mazz> I obviously go to the resource page
<ccrouch> the dashboard just loaded fine for me
<mazz> since that's where the tree is
<ccrouch> but i agree with you mazz
<mazz> I think it wants main dashboards
<mazz> not the ones that are created on the summary tabs
<mazz> ok.. so we know what the issue is then
<mazz> you need a dashboard
<mazz> I concede this is a minor issue
<mazz> but an issue nonetheless
<ccrouch> mazz: well you just need to have visted the dashboard page
<mazz> I still don't see why we even care that we have dashboards just to put submenus on the tree context menu
<mazz> right. understood.
<mfoley> what would you say the 1 line title of this new BZ is?
<ccrouch> and presumably not deleted all your dashboards
<mazz> cannot add non-summary metric graphs via resource tree context menu unless you have visited the dashboard page first
<mazz> that's what the summary is
<ccrouch> mazz: because one of the options is "Add graph to dashboard [x]"
<mazz> ok.

Comment 1 John Mazzitelli 2011-11-14 23:07:38 UTC
to replicate, this requires you to NOT visite the #Dashboard page at all. Once you do, you get a dashboard created and the problem goes away. This is why this is a minor issue - since almost always you visit the dashboard, unless you already have bookmarks to take you to other pages directly. This is what happened to me, my books marks always take me to #Reports first (since that page loads faster than the #Dashboard page)