← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17403: GIS ER EV sorting of attributes/data elements.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 17403 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-11-10 17:05:41 +0100
message:
  GIS ER EV sorting of attributes/data elements.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.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-event-reports/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2014-11-07 13:18:06 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2014-11-10 16:03:39 +0000
@@ -3281,12 +3281,18 @@
 		});
 
 		dataElementsByStageStore = Ext.create('Ext.data.Store', {
-			fields: [''],
+			fields: ['id', 'name', 'isAttribute'],
 			data: [],
-			sorters: [{
-				property: 'name',
-				direction: 'ASC'
-			}]
+			sorters: [
+                {
+                    property: 'isAttribute',
+                    direction: 'DESC'
+                },
+                {
+                    property: 'name',
+                    direction: 'ASC'
+                }
+            ]
 		});
 
 		organisationUnitGroupStore = Ext.create('Ext.data.Store', {
@@ -3530,6 +3536,11 @@
                         stages = program.programStages;
                         attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute');
 
+                        // mark as attribute
+                        for (var i = 0; i < attributes.length; i++) {
+                            attributes[i].isAttribute = true;
+                        }
+
                         // attributes cache
                         if (Ext.isArray(attributes) && attributes.length) {
                             attributeStorage[programId] = attributes;

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js	2014-11-07 13:18:06 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js	2014-11-10 16:03:39 +0000
@@ -2921,12 +2921,18 @@
 		});
 
 		dataElementsByStageStore = Ext.create('Ext.data.Store', {
-			fields: [''],
+			fields: ['id', 'name', 'isAttribute'],
 			data: [],
-			sorters: [{
-				property: 'name',
-				direction: 'ASC'
-			}]
+			sorters: [
+                {
+                    property: 'isAttribute',
+                    direction: 'DESC'
+                },
+                {
+                    property: 'name',
+                    direction: 'ASC'
+                }
+            ]
 		});
 
 		organisationUnitGroupStore = Ext.create('Ext.data.Store', {
@@ -3167,6 +3173,11 @@
                         stages = program.programStages;
                         attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute');
 
+                        // mark as attribute
+                        for (var i = 0; i < attributes.length; i++) {
+                            attributes[i].isAttribute = true;
+                        }
+
                         // attributes cache
                         if (Ext.isArray(attributes) && attributes.length) {
                             attributeStorage[programId] = attributes;

=== 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	2014-11-07 13:18:06 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-mapping/scripts/app.js	2014-11-10 16:03:39 +0000
@@ -4185,12 +4185,18 @@
 		});
 
 		dataElementsByStageStore = Ext.create('Ext.data.Store', {
-			fields: [''],
+			fields: ['id', 'name', 'isAttribute'],
 			data: [],
-			sorters: [{
-				property: 'name',
-				direction: 'ASC'
-			}]
+			sorters: [
+                {
+                    property: 'isAttribute',
+                    direction: 'DESC'
+                },
+                {
+                    property: 'name',
+                    direction: 'ASC'
+                }
+            ]
 		});
 
 		// components
@@ -4271,6 +4277,11 @@
                         stages = program.programStages;
                         attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute');
 
+                        // mark as attribute
+                        for (var i = 0; i < attributes.length; i++) {
+                            attributes[i].isAttribute = true;
+                        }
+
                         // attributes cache
                         if (Ext.isArray(attributes) && attributes.length) {
                             attributeStorage[programId] = attributes;