dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20862
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9716: (PT) Gui fixes + (GIS) Legend bugs fixed.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 9716 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-02-04 21:56:45 +0100
message:
(PT) Gui fixes + (GIS) Legend bugs fixed.
modified:
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Facility.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Thematic1.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Thematic2.js
dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js
dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/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-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Facility.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Facility.js 2012-12-14 16:56:33 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Facility.js 2013-02-04 20:51:33 +0000
@@ -121,8 +121,14 @@
},
getLegendConfig: function() {
+ var orgUnit = this.view.parentOrganisationUnit,
+ orgUnitLevel = this.view.organisationUnitLevel,
+ parent = orgUnit ? orgUnit.name : '',
+ level = orgUnitLevel ? orgUnitLevel.name : '',
+ where = parent + ' / ' + level;
+
return {
- where: this.view.organisationUnitLevel.name + ' / ' + this.view.parentOrganisationUnit.name
+ where: where
};
},
@@ -194,6 +200,8 @@
child.style.clear = "left";
element.appendChild(child);
}
+
+ this.layer.legendPanel.update(element.outerHTML);
},
CLASS_NAME: "mapfish.GeoStat.Facility"
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Thematic1.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Thematic1.js 2012-12-14 16:56:33 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Thematic1.js 2013-02-04 20:51:33 +0000
@@ -110,10 +110,21 @@
},
getLegendConfig: function() {
+ var indicator = this.view.indicator,
+ dataElement = this.view.dataElement,
+ period = this.view.period,
+ orgUnit = this.view.parentOrganisationUnit,
+ orgUnitLevel = this.view.organisationUnitLevel,
+ parent = orgUnit ? orgUnit.name : '',
+ level = orgUnitLevel ? orgUnitLevel.name : '',
+ what = indicator ? indicator.name : (dataElement ? dataElement.name : ''),
+ when = period ? period.name : '',
+ where = parent + ' / ' + level;
+
return {
- what: this.view.indicator.name || this.view.dataElement.name,
- when: this.view.period.id,
- where: this.view.parentOrganisationUnit.name + ' / ' + this.view.organisationUnitLevel.name
+ what: what,
+ when: when,
+ where: where
};
},
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Thematic2.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Thematic2.js 2012-12-14 16:56:33 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/mapfish/core/GeoStat/Thematic2.js 2013-02-04 20:51:33 +0000
@@ -110,10 +110,21 @@
},
getLegendConfig: function() {
+ var indicator = this.view.indicator,
+ dataElement = this.view.dataElement,
+ period = this.view.period,
+ orgUnit = this.view.parentOrganisationUnit,
+ orgUnitLevel = this.view.organisationUnitLevel,
+ parent = orgUnit ? orgUnit.name : '',
+ level = orgUnitLevel ? orgUnitLevel.name : '',
+ what = indicator ? indicator.name : (dataElement ? dataElement.name : ''),
+ when = period ? period.name : '',
+ where = parent + ' / ' + level;
+
return {
- what: this.view.indicator.name || this.view.dataElement.name,
- when: this.view.period.id,
- where: this.view.parentOrganisationUnit.name + ' / ' + this.view.organisationUnitLevel.name
+ what: what,
+ when: when,
+ where: where
};
},
=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2013-01-31 17:38:03 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2013-02-04 14:00:34 +0000
@@ -96,7 +96,7 @@
config.filter[dim] = data[dim];
}
}();
-
+
return config;
};
@@ -897,7 +897,7 @@
pt.cmp.dimension.panels.push(this);
},
expand: function() {
- pt.util.dimension.panel.setHeight(pt.conf.layout.west_maxheight_accordion_indicator);
+ pt.util.dimension.panel.setHeight(pt.conf.layout.west_maxheight_accordion_dataelement);
pt.util.multiselect.setHeight(
[dataElementAvailable, dataElementSelected],
this,
@@ -1017,11 +1017,11 @@
pt.cmp.dimension.panels.push(this);
},
expand: function() {
- pt.util.dimension.panel.setHeight(pt.conf.layout.west_maxheight_accordion_indicator);
+ pt.util.dimension.panel.setHeight(pt.conf.layout.west_maxheight_accordion_dataset);
pt.util.multiselect.setHeight(
- [dataElementAvailable, dataElementSelected],
+ [dataSetAvailable, dataSetSelected],
this,
- pt.conf.layout.west_fill_accordion_indicator
+ pt.conf.layout.west_fill_accordion_dataset
);
}
}
@@ -1409,13 +1409,12 @@
pt.cmp.dimension.panels.push(this);
},
expand: function() {
- pt.util.dimension.panel.setHeight(600);
- //pt.util.dimension.panel.setHeight(pt.conf.layout.west_maxheight_accordion_fixedperiod + pt.conf.layout.west_maxheight_accordion_relativeperiod);
- //pt.util.multiselect.setHeight(
- //[fixedPeriodAvailable, fixedPeriodSelected],
- //this,
- //pt.conf.layout.west_fill_accordion_fixedperiod
- //);
+ pt.util.dimension.panel.setHeight(pt.conf.layout.west_maxheight_accordion_period);
+ pt.util.multiselect.setHeight(
+ [fixedPeriodAvailable, fixedPeriodSelected],
+ this,
+ pt.conf.layout.west_fill_accordion_period
+ );
}
}
});
@@ -1906,12 +1905,12 @@
availableStore.load();
}
- pt.util.dimension.panel.setHeight(pt.conf.layout.west_maxheight_accordion_indicator);
+ pt.util.dimension.panel.setHeight(pt.conf.layout.west_maxheight_accordion_dataset);
pt.util.multiselect.setHeight(
[available, selected],
this,
- pt.conf.layout.west_fill_accordion_indicator
+ pt.conf.layout.west_fill_accordion_dataset
);
}
}
@@ -1940,7 +1939,7 @@
};
accordion = Ext.create('Ext.panel.Panel', {
- bodyStyle: 'border-style:none; padding:6px;',
+ bodyStyle: 'border-style:none; padding:3px;',
layout: 'fit',
items: [
{
@@ -1994,7 +1993,8 @@
centerRegion = Ext.create('Ext.panel.Panel', {
region: 'center',
- bodyStyle: 'padding:20px',
+ bodyStyle: 'padding:3px',
+ autoScroll: true,
tbar: {
defaults: {
height: 26
=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js 2013-02-01 13:58:56 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js 2013-02-04 14:00:34 +0000
@@ -123,19 +123,21 @@
conf.layout = {
west_width: 424,
- west_fieldset_width: 410,
+ west_fieldset_width: 416,
west_width_padding: 18,
west_fill: 117,
west_fill_accordion_indicator: 77,
west_fill_accordion_dataelement: 77,
west_fill_accordion_dataset: 45,
- west_fill_accordion_fixedperiod: 77,
+ west_fill_accordion_period: 270,
+ //west_fill_accordion_fixedperiod: 77,
west_fill_accordion_organisationunit: 103,
west_maxheight_accordion_indicator: 478,
west_maxheight_accordion_dataelement: 478,
west_maxheight_accordion_dataset: 478,
- west_maxheight_accordion_relativeperiod: 423,
- west_maxheight_accordion_fixedperiod: 478,
+ west_maxheight_accordion_period: 700,
+ //west_maxheight_accordion_relativeperiod: 423,
+ //west_maxheight_accordion_fixedperiod: 478,
west_maxheight_accordion_organisationunit: 756,
west_maxheight_accordion_organisationunitgroup: 298,
west_maxheight_accordion_options: 449,
@@ -409,7 +411,8 @@
};
getParamStringFromDimensionItems = function(dimensionItems) {
- var paramString = '?';
+ var paramString = '?',
+ dim;
for (var key in dimensionItems) {
if (dimensionItems.hasOwnProperty(key)) {
@@ -417,37 +420,24 @@
paramString += 'dimension=' + key + '&';
}
else {
- paramString += 'dimension=' + key + ':' + dimensionItems[key].join(';') + '&';
+ dim = dimensionItems[key];
+ paramString += 'dimension=' + key + ':' + dim.join(';') + '&';
}
}
}
paramString = paramString.substring(0, paramString.length-1);
+ for (var key in settings.filter) {
+ if (settings.filter.hasOwnProperty(key)) {
+ dim = settings.filter[key];
+ paramString += '&filter=' + key + ':' + dim.join(';');
+ }
+ }
+
return paramString;
};
- getFilterParamStringFromSettings = function() {
- var filter = settings.filter,
- filterParamString = '';
-
- for (var key in filter) {
- if (filter.hasOwnProperty(key)) {
- filterParamString += key + ':';
-
- var a = filter[key];
-
- for (var i = 0; i < a.length; i++) {
- filterParamString += a[i] + ',';
- }
-
- filterParamString = filterParamString.substring(0, filterParamString.length-1);
- }
- }
-
- return filterParamString;
- };
-
extendResponse = function(dimensionItems) {
var response = pt.response,
headers = response.headers,
@@ -905,6 +895,7 @@
type: 'table',
columns: pt.config.cols.size + pt.config.rows.dims + 1
},
+ autoScroll: true,
bodyStyle: 'border:0 none',
defaults: {
baseCls: 'td'
@@ -929,9 +920,9 @@
Ext.data.JsonP.request({
method: 'GET',
url: pt.init.contextPath + '/api/analytics.jsonp' + paramString,
- params: {
- filter: getFilterParamStringFromSettings()
- },
+ //params: {
+ //filter: getFilterParamStringFromSettings()
+ //},
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
@@ -997,8 +988,8 @@
filter = config.filter;
- if (!(filter && Ext.isObject(filter) && pt.util.object.getLength(filter))) {
- alert('No filter items selected'); //i18n
+ if (!(filter === undefined || Ext.isObject(filter))) {
+ alert('Illegal filter type'); //i18n
return;
}