← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18087: Dashboard, gis event layer fix.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 18087 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-01-21 16:22:03 +0100
message:
  Dashboard, gis event layer fix.
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.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-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js	2015-01-20 15:20:41 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/map.js	2015-01-21 15:21:09 +0000
@@ -2984,7 +2984,7 @@
                 alert(GIS.i18n.coordinates_could_not_be_loaded);
             };
 
-            if (GIS.plugin && !GIS.app) {
+            if (isJsonp) {
                 Ext.data.JsonP.request({
                     url: url,
                     disableCaching: false,
@@ -3018,7 +3018,7 @@
         };
 
         loadLegend = function (view) {
-            isJsonp = gis.plugin && gis.crossDomain,
+            var isJsonp = gis.plugin && gis.crossDomain,
                 type = isJsonp ? 'jsonp' : 'json',
                 url = gis.init.contextPath + '/api/organisationUnitGroupSets/' + view.organisationUnitGroupSet.id + '.' + type + '?fields=organisationUnitGroups[id,name,symbol]',
                 success;
@@ -5834,6 +5834,8 @@
                 if (this.layer.legendPanel) {
                     this.layer.legendPanel.update(element.outerHTML);
                 }
+
+                return element;
             },
 
             CLASS_NAME: "mapfish.GeoStat.Facility"
@@ -6929,6 +6931,7 @@
 
     execute = function (config) {
         var validateConfig,
+            extendInstance,
             createViewport,
             afterRender,
             initialize,
@@ -6959,6 +6962,39 @@
             return true;
         };
 
+        extendInstance = function(gis) {
+            var init = gis.init,
+				api = gis.api,
+                conf = gis.conf,
+                store = gis.store,
+				support = gis.support,
+				service = gis.service,
+				web = gis.web,
+                type = gis.plugin && gis.crossDomain ? 'jsonp' : 'json',
+                headerMap = {
+                    json: 'application/json',
+                    jsonp: 'application/javascript'
+                },
+                headers = {
+                    'Content-Type': headerMap[type],
+                    'Accepts': headerMap[type]
+                };
+
+            init.el = config.el;
+
+            gis.el = config.el;
+            gis.plugin = init.plugin;
+            gis.dashboard = init.dashboard;
+            gis.crossDomain = init.crossDomain;
+            gis.skipMask = init.skipMask;
+            gis.skipFade = init.skipFade;
+
+            // store
+            store.groupsByGroupSet = Ext.create('Ext.data.Store', {
+				fields: ['id', 'name', 'symbol'],
+			});
+        };
+
         createViewport = function () {
             var viewport,
                 items = [],
@@ -7158,6 +7194,7 @@
             //};
 
             gis = GIS.core.getInstance(init);
+            extendInstance(gis);
 
             // google maps
             var gm_fn = function() {
@@ -7212,14 +7249,6 @@
                 }
             }
 
-            // extend
-            gis.el = config.el;
-            gis.plugin = init.plugin;
-            gis.dashboard = init.dashboard;
-            gis.crossDomain = init.crossDomain;
-            gis.skipMask = init.skipMask;
-            gis.skipFade = init.skipFade;
-
             GIS.core.createSelectHandlers(gis, gis.layer.boundary);
             GIS.core.createSelectHandlers(gis, gis.layer.thematic1);
             GIS.core.createSelectHandlers(gis, gis.layer.thematic2);

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js	2015-01-20 19:11:15 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js	2015-01-21 15:19:10 +0000
@@ -3106,7 +3106,7 @@
 			return true;
 		};
 
-        extendInstance = function(pt) {
+        extendInstance = function(ns) {
             var init = ns.core.init,
 				api = ns.core.api,
                 conf = ns.core.conf,