← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14435: performance improvment for event-capture

 

------------------------------------------------------------
revno: 14435
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Wed 2014-03-26 15:16:51 +0100
message:
  performance improvment for event-capture
modified:
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css
  dhis-2/dhis-web/pom.xml


--
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-event-capture/src/main/webapp/dhis-web-event-capture/index.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html	2014-03-19 10:37:49 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/index.html	2014-03-26 14:16:51 +0000
@@ -1,5 +1,6 @@
 <!DOCTYPE html>
-<html manifest="event-capture.appcache" ng-app="eventCapture">
+<!--<html manifest="event-capture.appcache" ng-app="eventCapture">-->
+<html ng-app="eventCapture">    
     <head>
         <title>Event Capture</title>
 
@@ -44,7 +45,7 @@
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.memory.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.storage.js"></script>
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.contextmenu.js"></script>
-        <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.appcache.js"></script>
+        <!--<script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.appcache.js"></script>-->
         <script type="text/javascript" src="../dhis-web-commons/ouwt/ouwt.js"></script>
         
         <script type="text/javascript" src="../dhis-web-commons/javascripts/angular/plugins/angularLocalStorage.js"></script>
@@ -96,12 +97,13 @@
                     <table>
                         <tr>
                             <td><label>{{'registering_unit'| translate}}</label></td>
-                            <td><input type="text" selected-org-unit ng-model="selectedOrgUnit.name" value="{{selectedOrgUnit.name || 'please_select'| translate}}" disabled=""></td>
+                            <td><input type="text" class="fixed-width-text" selected-org-unit ng-model="selectedOrgUnit.name" value="{{selectedOrgUnit.name || 'please_select'| translate}}" disabled=""></td>
                         </tr>
                         <tr>
                             <td><label>{{'program'| translate}}<em title="{{'required'| translate}}" class="required">*</em></label></td>
                             <td>
                                 <select id="programId" 
+                                        class="fixed-width-select"
                                         name="programId" 
                                         ng-model="pr" 
                                         ng-options="program as program.name for program in programs | orderBy: 'name'" 
@@ -246,7 +248,7 @@
                                             <!-- Visible when event is under editing - in grid -->
                                             <td class="max-column-width"
                                                 style="cursor:default;"                                                
-                                                ng-show="(currentEvent.event == dhis2Event.event) && !eventGridColumn.hide" 
+                                                ng-if="(currentEvent.event == dhis2Event.event) && !eventGridColumn.hide" 
                                                 ng-repeat="eventGridColumn in eventGridColumns">
                                                 <ng-form name="innerFormGrid">
                                                     <div ng-switch="eventGridColumn.type">
@@ -330,12 +332,12 @@
                 <!-- event grid ends -->
 
                 <!-- event update in full begins-->
-                <div ng-show="editingEventInFull">
-                    <h2>
-                        {{'update_event'| translate}}                                                 
-                    </h2>                                           
-                    <div class="bordered-div" style="width:50%;">
-                        <form name="outerForm" novalidate>
+                <form name="outerForm" novalidate>
+                    <div ng-if="editingEventInFull">
+                        <h2>
+                            {{'update_event'| translate}}                                                 
+                        </h2>                                           
+                        <div class="bordered-div" style="width:50%;">
                             <table class="dhis2-list-table-striped">                    
                                 <thead>                        
                                     <tr>
@@ -418,19 +420,19 @@
                                 </tr>
                                 </tbody>        
                             </table>                            
-                            <button ng-click="showEventList()" class="button">{{'back'| translate}}</button>  
-                        </form>    
+                            <button ng-click="showEventList()" class="button">{{'back'| translate}}</button> 
+                        </div>
                     </div>
-                </div>
+                </form>    
                 <!-- event update ends -->
 
                 <!-- event registration begins -->
-                <div ng-show="eventRegistration">
-                    <h2>
-                        {{'new_event'| translate}}                                                 
-                    </h2>   
-                    <div class="bordered-div" style="width:50%;">
-                        <form name="outerForm" novalidate>
+                <form name="outerForm" novalidate>
+                    <div ng-if="eventRegistration">
+                        <h2>
+                            {{'new_event'| translate}}                                                 
+                        </h2>   
+                        <div class="bordered-div" style="width:50%;">
                             <table class="dhis2-list-table-striped">
                              <tbody id="list"> 
                                  <tr>
@@ -517,15 +519,14 @@
                                     </tr>
                                 </tbody>        
                             </table>
-
                             <button ng-click="addEvent(true)" class="button">{{'save_and_add_new'| translate}}</button>
                             &nbsp;&nbsp;&nbsp;&nbsp;
                             <button ng-click="addEvent()" class="button">{{'save_and_close'| translate}}</button>
                             &nbsp;&nbsp;&nbsp;&nbsp;
-                            <button ng-click="showEventList(null)" class="button">{{'close'| translate}}</button>
-                        </form>
-                    </div>
-                </div>              
+                            <button ng-click="showEventList(null)" class="button">{{'close'| translate}}</button>                        
+                        </div>
+                    </div> 
+                </form>
                 <!-- event registration ends -->              
                 
             </div>           

=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2014-03-26 09:44:22 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2014-03-26 14:16:51 +0000
@@ -13,7 +13,8 @@
                 DHIS2EventFactory,                
                 orderByFilter,
                 ContextMenuSelectedItem,
-                ModalService,                
+                ModalService,
+                ColumnsDialogService,
                 DialogService) {   
    
     //selected org unit
@@ -219,7 +220,15 @@
             else{
                 $scope.hiddenGridColumns--;
             }
-        }      
+        }       
+        
+        /*var dialogOptions = {
+            headerText: 'show_hide_columns',
+            bodyText: $scope.eventGridColumns
+        };
+        
+        ColumnsDialogService.showDialog({}, dialogOptions);*/
+        
     };
     
     $scope.searchInGrid = function(gridColumn){           

=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js	2014-03-19 08:22:59 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js	2014-03-26 14:16:51 +0000
@@ -254,6 +254,59 @@
 
     }])
 
+/* Popup dialog for displaying columns show/hide */
+.service('ColumnsDialogService', ['$modal', function($modal) {
+
+    var dialogDefaults = {
+        backdrop: true,
+        keyboard: true,
+        backdropClick: true,
+        modalFade: true,
+        templateUrl: 'views/column-modal.html'
+    };
+
+    var dialogOptions = {
+        closeButtonText: 'close',
+        actionButtonText: 'ok',
+        headerText: 'dhis2_tracker',
+        bodyText: 'Perform this action?',
+        note: 'note',
+        created_by: 'created_by',
+        date: 'date'
+    };
+
+    this.showDialog = function(customDialogDefaults, customDialogOptions) {
+        if (!customDialogDefaults)
+            customDialogDefaults = {};
+        customDialogDefaults.backdropClick = false;
+        return this.show(customDialogDefaults, customDialogOptions);
+    };
+
+    this.show = function(customDialogDefaults, customDialogOptions) {
+        //Create temp objects to work with since we're in a singleton service
+        var tempDialogDefaults = {};
+        var tempDialogOptions = {};
+
+        //Map angular-ui modal custom defaults to modal defaults defined in service
+        angular.extend(tempDialogDefaults, dialogDefaults, customDialogDefaults);
+
+        //Map modal.html $scope custom properties to defaults defined in service
+        angular.extend(tempDialogOptions, dialogOptions, customDialogOptions);
+
+        if (!tempDialogDefaults.controller) {
+            tempDialogDefaults.controller = function($scope, $modalInstance) {
+                $scope.dialogOptions = tempDialogOptions;
+                $scope.dialogOptions.ok = function(result) {
+                    $modalInstance.close(result);
+                };                           
+            };
+        }
+
+        return $modal.open(tempDialogDefaults).result;
+    };
+
+}])
+
 /* Context menu for grid*/
 .service('ContextMenuSelectedItem', function(){
     this.selectedItem = '';

=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css	2014-03-19 10:37:49 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/styles/style.css	2014-03-26 14:16:51 +0000
@@ -2,8 +2,7 @@
 /* Form
 /*----------------------------------------------------------------------------*/
 
-input[type="text"] 
-{
+.fixed-width-text {
     width: 260px;
 }
 
@@ -12,8 +11,7 @@
     width: 240px;
 }
 
-select 
-{
+.fixed-width-select{
     width: 264px;
 }
 
@@ -32,6 +30,12 @@
 // App specific
 // --------------------------------------------------------------
 
+// Block level inputs
+.container-filters {
+    display: block;
+    width: 100%;    
+}
+
 .container-heading {
     color: white;
     padding: 12px;
@@ -490,7 +494,7 @@
     margin-bottom: 20px;
     background-color: #fff;
     border: 1px solid transparent;
-    
+
     -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.05);
     box-shadow: 0 1px 1px rgba(0,0,0,0.05)
 }

=== modified file 'dhis-2/dhis-web/pom.xml'
--- dhis-2/dhis-web/pom.xml	2014-03-26 09:44:22 +0000
+++ dhis-2/dhis-web/pom.xml	2014-03-26 14:16:51 +0000
@@ -26,7 +26,6 @@
     <module>dhis-web-visualizer</module>
     <module>dhis-web-pivot</module>    
     <module>dhis-web-dashboard-integration</module>
-    <module>dhis-web-event-reports</module>
     <module>dhis-web-caseentry</module>    
     <module>dhis-web-light</module>
     <module>dhis-web-mobile</module>