← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12036: Dashboard, deleting link items which become empty

 

------------------------------------------------------------
revno: 12036
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-09-11 14:52:51 +0200
message:
  Dashboard, deleting link items which become empty
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DashboardController.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DashboardController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DashboardController.java	2013-09-10 11:03:08 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DashboardController.java	2013-09-11 12:52:51 +0000
@@ -222,8 +222,14 @@
         
         if ( item.removeItemContent( contentUid ) )
         {
+            if ( item.getContentCount() == 0 )
+            {
+                dashboard.removeItem( item.getUid() ); // Remove if empty
+            }
+            
             dashboardService.updateDashboard( dashboard );
             
+            
             ContextUtils.okResponse( response, "Dashboard item content removed" );
         }        
     }