dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30668
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15587: dashboard fixes, update to new fields filter
------------------------------------------------------------
revno: 15587
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2014-06-07 16:39:14 +0200
message:
dashboard fixes, update to new fields filter
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/Dashboard.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js
--
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-api/src/main/java/org/hisp/dhis/dashboard/Dashboard.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/Dashboard.java 2014-06-07 14:26:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dashboard/Dashboard.java 2014-06-07 14:39:14 +0000
@@ -171,7 +171,7 @@
// Getters and setters
// -------------------------------------------------------------------------
- @JsonProperty( value = "items" )
+ @JsonProperty( value = "dashboardItems" )
@JsonView( { DetailedView.class } )
@JacksonXmlElementWrapper( localName = "dashboardItems", namespace = DxfNamespaces.DXF_2_0 )
@JacksonXmlProperty( localName = "dashboardItem", namespace = DxfNamespaces.DXF_2_0 )
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js 2014-03-07 10:59:18 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/dashboard.js 2014-06-07 14:39:14 +0000
@@ -371,55 +371,55 @@
$( "#dashboard-" + dhis2.db.current() ).addClass( "currentDashboard" );
- $.getJSON( "../api/dashboards/" + id, function( data )
+ $.getJSON( "../api/dashboards/" + id + '/?fields=:all,dashboardItems[:all]', function( data )
{
$d = $( "#contentList" ).empty();
updateSharing( data );
- if( undefined !== data.items )
+ if( undefined !== data.dashboardItems )
{
- $.each( data.items, function( index, item )
+ $.each( data.dashboardItems, function( index, dashboardItem )
{
- if ( null == item || undefined === item )
+ if ( null == dashboardItem || undefined === dashboardItem )
{
return true;
}
- if ( "chart" == item.type )
- {
- $d.append( $.tmpl( dhis2.db.tmpl.chartItem, { "itemId": item.id, "id": item.chart.id, "name": item.chart.name,
- "i18n_remove": i18n_remove, "i18n_view": i18n_view_full_size, "i18n_share": i18n_share_interpretation, "i18n_click": i18n_click_to_explore_drag_to_new_position } ) )
- }
- else if ( "map" == item.type )
- {
- $d.append( $.tmpl( dhis2.db.tmpl.mapItem, { "itemId": item.id, "id": item.map.id, "name": item.map.name,
- "i18n_remove": i18n_remove, "i18n_view": i18n_view_full_size, "i18n_share": i18n_share_interpretation, "i18n_click": i18n_click_to_explore_drag_to_new_position } ) )
- }
- else if ( "reportTable" == item.type )
- {
- $d.append( $.tmpl( dhis2.db.tmpl.reportTableItem, { "itemId": item.id, "id": item.reportTable.id, "name": item.reportTable.name,
- "i18n_remove": i18n_remove, "i18n_view": i18n_view_full_size, "i18n_share": i18n_share_interpretation, "i18n_click": i18n_click_to_explore_drag_to_new_position } ) )
- }
- else if ( "users" == item.type )
- {
- dhis2.db.renderLinkItem( $d, item.id, item.users, "Users", "../dhis-web-dashboard-integration/profile.action?id=", "" );
- }
- else if ( "reportTables" == item.type )
- {
- dhis2.db.renderLinkItem( $d, item.id, item.reportTables, "Pivot tables", "../dhis-web-pivot/app/index.html?id=", "" );
- }
- else if ( "reports" == item.type )
- {
- dhis2.db.renderLinkItem( $d, item.id, item.reports, "Reports", "../dhis-web-reporting/getReportParams.action?mode=report&uid=", "" );
- }
- else if ( "resources" == item.type )
- {
- dhis2.db.renderLinkItem( $d, item.id, item.resources, "Resources", "../api/documents/", "/data" );
- }
- else if ( "messages" == item.type )
- {
- dhis2.db.renderMessagesItem( $d, item.id );
+ if ( "chart" == dashboardItem.type )
+ {
+ $d.append( $.tmpl( dhis2.db.tmpl.chartItem, { "itemId": dashboardItem.id, "id": dashboardItem.chart.id, "name": dashboardItem.chart.name,
+ "i18n_remove": i18n_remove, "i18n_view": i18n_view_full_size, "i18n_share": i18n_share_interpretation, "i18n_click": i18n_click_to_explore_drag_to_new_position } ) )
+ }
+ else if ( "map" == dashboardItem.type )
+ {
+ $d.append( $.tmpl( dhis2.db.tmpl.mapItem, { "itemId": dashboardItem.id, "id": dashboardItem.map.id, "name": dashboardItem.map.name,
+ "i18n_remove": i18n_remove, "i18n_view": i18n_view_full_size, "i18n_share": i18n_share_interpretation, "i18n_click": i18n_click_to_explore_drag_to_new_position } ) )
+ }
+ else if ( "reportTable" == dashboardItem.type )
+ {
+ $d.append( $.tmpl( dhis2.db.tmpl.reportTableItem, { "itemId": dashboardItem.id, "id": dashboardItem.reportTable.id, "name": dashboardItem.reportTable.name,
+ "i18n_remove": i18n_remove, "i18n_view": i18n_view_full_size, "i18n_share": i18n_share_interpretation, "i18n_click": i18n_click_to_explore_drag_to_new_position } ) )
+ }
+ else if ( "users" == dashboardItem.type )
+ {
+ dhis2.db.renderLinkItem( $d, dashboardItem.id, dashboardItem.users, "Users", "../dhis-web-dashboard-integration/profile.action?id=", "" );
+ }
+ else if ( "reportTables" == dashboardItem.type )
+ {
+ dhis2.db.renderLinkItem( $d, dashboardItem.id, dashboardItem.reportTables, "Pivot tables", "../dhis-web-pivot/app/index.html?id=", "" );
+ }
+ else if ( "reports" == dashboardItem.type )
+ {
+ dhis2.db.renderLinkItem( $d, dashboardItem.id, dashboardItem.reports, "Reports", "../dhis-web-reporting/getReportParams.action?mode=report&uid=", "" );
+ }
+ else if ( "resources" == dashboardItem.type )
+ {
+ dhis2.db.renderLinkItem( $d, dashboardItem.id, dashboardItem.resources, "Resources", "../api/documents/", "/data" );
+ }
+ else if ( "messages" == dashboardItem.type )
+ {
+ dhis2.db.renderMessagesItem( $d, dashboardItem.id );
}
} );
@@ -452,7 +452,7 @@
var $ul = $( "#ul-" + itemId );
- $.get( "../api/messageConversations.json?viewClass=detailed&pageSize=5", function( json )
+ $.get( "../api/messageConversations.json?fields=:all&pageSize=5", function( json )
{
$.each( json.messageConversations, function( index, message )
{