Bug 1033665 - Add to dashboard does not add multiple charts to default dashboard
Summary: Add to dashboard does not add multiple charts to default dashboard
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: UI
Version: JON 3.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ER03
: JON 3.3.0
Assignee: Mike Thompson
QA Contact: Mike Foley
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-22 14:48 UTC by Sunil Kondkar
Modified: 2014-12-11 14:01 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2014-12-11 14:01:02 UTC


Attachments (Terms of Use)
Charts Selected (79.26 KB, image/png)
2013-11-22 14:49 UTC, Sunil Kondkar
no flags Details
Default Dashboard (99.94 KB, image/png)
2013-11-22 14:50 UTC, Sunil Kondkar
no flags Details

Description Sunil Kondkar 2013-11-22 14:48:40 UTC
Description of problem:

If user selects more than one chart using <ctrl> or <shift> key on Monitoring->Metrics tab of a resource and clicks on Add button for 'Add to Dashboard', the default dashboard displays only one metric chart. 

Please refer the attached screenshots.

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

Version : 3.2.0.ER7 Build Number : e8e6401:ff0061d
Browsers used: FF17 and IE9

How reproducible:

always

Steps to Reproduce:

1. Navigate to Monitoring->Metrics tab of a resource (Ex: CPU 0 )
2. Select more than oe charts using <ctrl> or <shift> key. ( Ex: I selected all the three charts 'system Load, 'User Load' and 'Wait Load' )
3. The Total rows at the bottom right shows 'selected: 3' .
4. Click on Add button for 'Add to Dashboard'.
5. Navigate to the default dashboard.
6. The default dashboard displays only one chart.

Actual results:

Add to dashboard does not add multiple charts. Only one chart is added.

Expected results:

All the selected charts should appear on the default dashboard.

Additional info:

Comment 1 Sunil Kondkar 2013-11-22 14:49:32 UTC
Created attachment 827838 [details]
Charts Selected

Comment 2 Sunil Kondkar 2013-11-22 14:50:08 UTC
Created attachment 827839 [details]
Default Dashboard

Comment 3 Mike Foley 2013-11-22 14:59:56 UTC
TCMS testrun https://tcms.engineering.redhat.com/run/99835/ 

on ER6 the buttone was disabled...and that changed in ER7

Comment 4 Libor Zoubek 2013-11-26 13:27:10 UTC
Additionally, "Add" button should be disabled when no metric is selected. Right now, if you don't select any metric and push the button, nothing happens.

Comment 5 Mike Thompson 2013-11-26 19:33:20 UTC
This is actually a dup of BZ 988581.

Comment 7 Mike Thompson 2014-08-29 20:12:24 UTC
Additional context from the logs relevant to issue:

Root Cause :	
org.hibernate.StaleStateException:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
Detail :	

java.lang.RuntimeException:[1374788639526] javax.ejb.EJBTransactionRolledbackException:Transaction rolled back -> javax.transaction.RollbackException:ARJUNA016053: Could not commit transaction. -> javax.persistence.OptimisticLockException:org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 -> org.hibernate.StaleStateException:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
--- STACK TRACE FOLLOWS ---
[1374788639526] javax.ejb.EJBTransactionRolledbackException:Transaction rolled back -> javax.transaction.RollbackException:ARJUNA016053: Could not commit transaction. -> javax.persistence.OptimisticLockException:org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 -> org.hibernate.StaleStateException:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
   at Unknown.anonymous(Unknown Source)
   at Unknown.anonymous(Unknown Source)

Comment 8 Jay Shaughnessy 2014-09-09 17:10:29 UTC
Mike, I think we should just disable this ability and add one at a time.  Just change the button enablement, unless you really want to fix it to allow multiple.

Comment 9 Mike Thompson 2014-09-10 18:11:07 UTC
I added the ability to add one at a time. This was more difficult than it should have been because the listgrid selection policy was already set to SINGLE and yet it acts like MULTIPLE. So now I just take the last selected row if multiple rows are selected and use that to add to the dashboard.

I also fixed Libor's comment: "Add" button should be disabled when no metric is selected. It is now not possible to add if there is no selection.

Committed to Master:

commit 50f3dad8c8a813d76b22a67cb6a423c84d3d0a60
Author: Mike Thompson <mithomps@redhat.com>
Date:   Wed Sep 10 11:06:29 2014 -0700

    [Bug 1033665] Add to dashboard does not add multiple charts to default dashboard.

Comment 11 Jay Shaughnessy 2014-09-10 20:47:30 UTC

Mike, here is the cherry pick.

release/jon3.3.x commit 99fd48185da1e71fcb775493d761f3522913b23a
Author: Mike Thompson <mithomps@redhat.com>
Date:   Wed Sep 10 11:06:29 2014 -0700

    (cherry picked from commit 50f3dad8c8a813d76b22a67cb6a423c84d3d0a60)
    Signed-off-by: Jay Shaughnessy <jshaughn@redhat.com>



It looks like what made this difficult was that the relevant class, MetricsTableView, doesn't make use of any of the table action (i.e. button) support that we use pretty much everywhere for the list views deriving from Table.  Not sure why not.  If it did it could have just set SelectionPolict to SINGLE and I think we'd be good, that seems to work everywhere else.

Comment 12 Mike Thompson 2014-09-10 21:17:28 UTC
Jay, this table for the metrics view is more complicated than a regular table action as it a hierarchical listgrid with special refreshing for the both the graphs, sparkline graphs and it must remember what graphs are opened during a refresh. So it really a different beast than Table. 

Regardless, the selectionPolicy should work and when you inspect it it shows the SelectionPolicy as SINGLE (but behaves as MULTIPLE).

Comment 13 Jay Shaughnessy 2014-09-11 00:35:26 UTC
OK, cool, thanks for the explanation, I should have looked more closely.

Comment 14 Simeon Pinder 2014-09-17 02:49:26 UTC
Moving to ON_QA as available for test with the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=385149

Comment 15 Sunil Kondkar 2014-09-17 12:09:27 UTC
Verified on version : 3.3.0.ER03 build number : 4aefe39:44e33a4

Verified that 'Add' button is disabled when no metric is selected. If multiple rows are selected, then Add to dashboard adds last selected row to the default dashboard. Multiple charts are added to the default dashboard if selected and added one by one.

Comment 16 Mike Thompson 2014-09-25 19:16:04 UTC
Cleaning up needinfo flag.


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