dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38598
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19659: GIS fav/dx.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 19659 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-07-16 00:01:05 +0200
message:
GIS fav/dx.
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.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-apps/src/main/webapp/dhis-web-mapping/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2015-07-15 16:59:45 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js 2015-07-15 21:55:38 +0000
@@ -7519,14 +7519,14 @@
listeners: {
select: function() {
var id = this.getValue(),
- index = id.indexOf('#');
+ index = id.indexOf('.');
if (index !== -1) {
id = id.substr(0, index);
}
Ext.Ajax.request({
- url: gis.init.contextPath + '/api/dataElements.json?fields=legendSet[id]&paging=false&filter=id:eq:' + this.getValue(),
+ url: gis.init.contextPath + '/api/dataElements.json?fields=legendSet[id]&paging=false&filter=id:eq:' + id,
success: function(r) {
var set = Ext.decode(r.responseText).dataElements[0].legendSet;
@@ -7555,12 +7555,12 @@
dataElementDetailLevel = Ext.create('Ext.form.field.ComboBox', {
cls: 'gis-combo',
- style: 'margin-left:2px',
+ style: 'margin-left:1px',
queryMode: 'local',
editable: false,
valueField: 'id',
displayField: 'text',
- width: 65 - 2,
+ width: 65 - 1,
value: dimConf.dataElement.objectName,
onSelect: function() {
dataElementGroup.loadAvailable();
@@ -8484,21 +8484,6 @@
setWidgetGui,
dataDim;
- // TODO detecting data dimension
- if (Ext.isArray(view.dataDimensionItems) && view.dataDimensionItems.length && Ext.isObject(view.dataDimensionItems[0])) {
- var obj = view.dataDimensionItems[0];
-
- if (obj.hasOwnProperty('indicator')) {
- dataDim = dimConf.indicator.objectName;
- }
- else if (obj.hasOwnProperty('dataElement')) {
- dataDim = dimConf.dataElement.objectName;
- }
- else if (obj.hasOwnProperty('dataSet')) {
- dataDim = dimConf.dataSet.objectName;
- }
- }
-
objectNameCmpMap[dimConf.indicator.objectName] = indicator;
objectNameCmpMap[dimConf.dataElement.objectName] = dataElement;
objectNameCmpMap[dimConf.operand.objectName] = dataElement;
@@ -8515,16 +8500,16 @@
reset(true);
// Value type
- valueType.setValue(dataDim);
- valueTypeToggler(dataDim);
+ valueType.setValue(dxDim.objectName);
+ valueTypeToggler(dxDim.objectName);
- if (dataDim === dimConf.dataElement.objectName) {
- dataElementDetailLevel.setValue(dxDim.dimension);
- }
+ if (dxDim.objectName === dimConf.dataElement.objectName) {
+ dataElementDetailLevel.setValue(dxDim.dimension);
+ }
// Data
- objectNameCmpMap[dataDim].store.add(dxDim.items[0]);
- objectNameCmpMap[dataDim].setValue(dxDim.items[0].id);
+ objectNameCmpMap[dxDim.objectName].store.add(dxDim.items[0]);
+ objectNameCmpMap[dxDim.objectName].setValue(dxDim.items[0].id);
// Period
period.store.add(gis.conf.period.relativePeriodRecordsMap[peDim.items[0].id] ? gis.conf.period.relativePeriodRecordsMap[peDim.items[0].id] : peDim.items[0]);
@@ -8619,6 +8604,7 @@
if (objectNameCmpMap[vType].getValue()) {
view.columns = [{
dimension: 'dx',
+ objectName: vType,
items: [{
id: objectNameCmpMap[vType].getValue()
}]
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js 2015-07-15 16:59:45 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/core.js 2015-07-15 21:40:39 +0000
@@ -1069,13 +1069,29 @@
// operand
if (Ext.isArray(r.mapViews)) {
- for (var i = 0, view; i < r.mapViews.length; i++) {
+ for (var i = 0, view, objectName; i < r.mapViews.length; i++) {
view = r.mapViews[i];
+ // TODO, TMP
+ if (Ext.isArray(view.dataDimensionItems) && view.dataDimensionItems.length && Ext.isObject(view.dataDimensionItems[0])) {
+ var item = view.dataDimensionItems[0];
+
+ if (item.hasOwnProperty('dataElement')) {
+ objectName = 'de';
+ }
+ else if (item.hasOwnProperty('dataSet')) {
+ objectName = 'ds';
+ }
+ else {
+ objectName = 'in';
+ }
+ }
+
if (view) {
if (Ext.isArray(view.columns) && view.columns.length) {
for (var j = 0, dim; j < view.columns.length; j++) {
dim = view.columns[j];
+ dim.objectName = objectName;
if (Ext.isArray(dim.items) && dim.items.length) {
for (var k = 0, item; k < dim.items.length; k++) {
@@ -2448,7 +2464,7 @@
minSize: view.radiusLow,
maxSize: view.radiusHigh
};
-
+
layer.core.view = view;
layer.core.colorInterpolation = colors;
layer.core.applyClassification(options);
@@ -2501,7 +2517,7 @@
'de': 'dataElements',
'ds': 'dataSets'
},
- elementUrl = elementMap[view.columns[0].dimension],
+ elementUrl = elementMap[view.columns[0].objectName],
id = view.columns[0].items[0].id;
Ext.Ajax.request({
@@ -3313,6 +3329,10 @@
dimension.dimension = config.dimension;
dimension.items = config.items;
+ if (config.objectName) {
+ dimension.objectName = config.objectName;
+ }
+
return Ext.clone(dimension);
}();
};
@@ -3514,9 +3534,6 @@
layout.organisationUnitGroupSet = config.organisationUnitGroupSet;
- // TODO, TMP
- layout.dataDimensionItems = config.dataDimensionItems;
-
return layout;
}();
};