← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15337: removed searching and filtering from entity grid - these features can now be directly applied dur...

 

------------------------------------------------------------
revno: 15337
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Wed 2014-05-21 17:55:51 +0200
message:
  removed searching and filtering from entity grid - these features can now be directly applied during searching
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/dashboard.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html


--
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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json	2014-05-21 14:59:16 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/i18n/en.json	2014-05-21 15:55:51 +0000
@@ -72,6 +72,8 @@
     "boolean": "Boolean",
     "yes": "Yes",
     "no": "No",
+    "records": "Records",
+    "found": "Found",
     "move_to_selected": "Move to selected",
     "move_all_to_selected": "Move all to selected",
     "add_new": "Add New",

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-05-21 14:59:16 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-05-21 15:55:51 +0000
@@ -23,15 +23,8 @@
                     {name: 'SELECTED', id: 1}, 
                     {name: 'CHILDREN', id: 2}, 
                     {name: 'DESCENDANTS', id: 3}
-                  ];
-                  
+                  ];                  
     $scope.ouMode = $scope.ouModes[0];
-   
-    
-    //Filtering
-    $scope.reverse = false;
-    $scope.filterText = {}; 
-    $scope.currentFilter;
     
     //Paging
     $scope.rowsPerPage = 50;
@@ -193,9 +186,7 @@
                     column.show = false;
                 }                
             }
-            
-            column.showFilter =  false;
-            
+           
             if(column.type === 'date'){
                  $scope.filterText[column.id]= {start: '', end: ''};
             }
@@ -229,33 +220,7 @@
     
     $scope.closeSearch = function(){
         $scope.showSearchDiv = !$scope.showSearchDiv;
-    };   
-    
-    $scope.sortGrid = function(gridHeader){
-        
-        if ($scope.sortHeader === gridHeader.id){
-            $scope.reverse = !$scope.reverse;
-            return;
-        }
-        
-        $scope.sortHeader = gridHeader.id;
-        $scope.reverse = false;    
-    };    
-    
-    $scope.filterInGrid = function(gridColumn){
-        
-        $scope.currentFilter = gridColumn;
-        for(var i=0; i<$scope.gridColumns.length; i++){
-            
-            //toggle the selected grid column's filter
-            if($scope.gridColumns[i].id === gridColumn.id){
-                $scope.gridColumns[i].showFilter = !$scope.gridColumns[i].showFilter;
-            }            
-            else{
-                $scope.gridColumns[i].showFilter = false;
-            }
-        }
-    };   
+    };
     
     $scope.showHideColumns = function(){
         

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2014-05-21 14:59:16 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2014-05-21 15:55:51 +0000
@@ -148,6 +148,9 @@
     display: block;
 }
 
+.clear {
+    clear: both;
+}
 .inline-block {
     display: inline-block;
 }
@@ -566,11 +569,11 @@
 }
 
 .horizonal-spacing{
-    margin-left: 20px;    
+    margin-left: 10px;    
 }
 
 .vertical-spacing{
-    margin-top: 20px;    
+    margin-top: 10px;    
 }
 
 .small-horizonal-spacing{
@@ -820,11 +823,17 @@
 
 }
 
-.form-control-select2 {
+.form-control {
+    display: block;
     width: 100%;
     height: 34px;
-    padding: 6px 12px;
+    padding: 6px 6px;
+    font-size: 14px;
+    line-height: 1.0;
     color: #555;
+    margin-bottom: 5px;
+    margin-top: 5px;
+    vertical-align: middle;
     background-color: #fff;
     background-image: none;
     border: 1px solid #ccc;

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/dashboard.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/dashboard.html	2014-04-03 12:27:23 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/dashboard.html	2014-05-21 15:55:51 +0000
@@ -1,5 +1,5 @@
 <div class="container-1-1">    
-    <div class="col-sm-12">        
+    <div class="col-sm-12 vertical-spacing">        
         <button type="button" class="btn btn-default" ng-click="back()">{{'back'| translate}}</button>
         <span class="right">
             <button type="button" class="btn btn-default" ng-click="showHideWidgets()">{{'show_hide_widgets'| translate}}</button>

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html	2014-05-21 14:59:16 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/home.html	2014-05-21 15:55:51 +0000
@@ -21,15 +21,15 @@
     
     <div class="row">
         <input type="text" selected-org-unit ng-model="selectedOrgUnit.name" ng-hide=true>
-        <div class="input-group col-md-6">
+        <div class="input-group col-md-4">
             <input type="text" placeholder="{{'your_search_input_here'| translate}}" ng-model="searchText" class="form-control" ng-class="{true: 'invalid - input'} [!searchText && emptySearchText]" ng-focus="hideSearch()" ng-disabled="showRegistrationDiv">
             <span class="input-group-btn">
-                <button class="btn btn-default" type="button" title="{{'advanced_search'| translate}}" ng-click="showSearch()" ng-disabled="showRegistrationDiv"><i class="fa fa-cog"></i></button>
+                <button class="btn btn-default" style="margin-bottom: 5px; margin-top: 5px;" type="button" title="{{'advanced_search'| translate}}" ng-click="showSearch()" ng-disabled="showRegistrationDiv"><i class="fa fa-cog"></i></button>
             </span>                
         </div>        
-        <div class="col-md-6">            
+        <div class="col-md-8" style="margin-bottom: 5px; margin-top: 5px;">            
             <button type="button" 
-                    class="btn btn-default small-horizonal-spacing"
+                    class="btn btn-default"
                     ng-disabled="showRegistrationDiv || showSearchDiv"
                     ng-click="search(searchMode.freeText)">
                 {{'search'| translate}}
@@ -45,24 +45,25 @@
                 <button type="button" 
                         class="btn btn-default small-horizonal-spacing" 
                         ng-click="showRegistration()">                    
-                    {{selectedProgram.trackedEntity.name }} {{'register'| translate}}
+                   {{'register'| translate}} {{selectedProgram.trackedEntity.name }}
                 </button>
             </span>
         </div>        
     </div>
-    <div class="row" ng-if="!searchText && emptySearchText">
-        <div class="col-md-6">
-            <div class="alert alert-danger">{{'search_input_required'| translate}}</div>         
-        </div>
-    </div>
-
-    <div class="row">
-        <div class="col-md-6">
+    
+    <div class="row vertical-spacing">
+        <div class="col-md-4">
             <select class="form-control" ng-model="pr" ng-change="getProgramAttributes(pr)" ng-options="program as program.name for program in programs | orderBy: 'name'">
                 <option value="">{{'please_select_a_program'| translate}}</option>
             </select>
         </div>        
     </div>
+    
+    <div class="row vertical-spacing" ng-if="!searchText && emptySearchText">
+        <div class="col-md-4">
+            <div class="alert alert-danger">{{'search_input_required'| translate}}</div>         
+        </div>
+    </div>
 
     <!-- search begins -->
     <div class="row" ng-show="showSearchDiv">

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html	2014-05-21 14:59:16 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/search.html	2014-05-21 15:55:51 +0000
@@ -3,7 +3,7 @@
     <div class="search-container">
         <table class="dhis2-list-table-striped dhis2-table-hover">
             <tr>
-                <td>{{'org_unit_mode'| translate}} - {{selectedOuMode.name}}</td>
+                <td>{{'org_unit_mode'| translate}}</td>
                 <td>
                     <input type="radio" ng-model="ouMode.name" value="SELECTED">{{'use_selected'| translate}}<br/>
                     <input type="radio" ng-model="ouMode.name" value="CHILDREN">{{'use_immediate_children'| translate}}<br/>

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html	2014-05-20 08:20:18 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/trackedEntityList.html	2014-05-21 15:55:51 +0000
@@ -1,83 +1,48 @@
 <div id="listDiv" ng-switch="trackedEntityList">                    
     <div ng-switch-when=""></div>
-    <div ng-switch-default>
-        <h2 ng-if="trackedEntityList.rows.length > 0">
-            {{selectedProgram.trackedEntity.name || 'entity' | translate}} {{'list'| translate}}
-            <span class="pull-right">
-                <button class="btn btn-default" ng-click="showHideColumns()">
-                    {{'show_hide_columns'| translate}}
-                </button>
-            </span>
-        </h2>
-        <div class="vertical-spacing" ng-switch="trackedEntityList.rows.length">
+    <div ng-switch-default>        
+        <div ng-switch="trackedEntityList.rows.length">
             <div ng-switch-when="undefined">
                 <p>
-                    {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}                        
+                    {{'no'| translate}} {{selectedProgram.trackedEntity.name|| 'records' | translate}} {{'found'| translate}}                        
                 </p>
             </div>
             <div ng-switch-when="0">
                 <p>
-                    {{'empty'| translate}} {{selectedProgram.trackedEntity.name|| 'entity' | translate}} {{'list'| translate}}
+                    {{'no'| translate}} {{selectedProgram.trackedEntity.name|| 'records' | translate}} {{'found'| translate}} 
                 </p>
             </div>
             <div ng-switch-default>
 
+                <!-- show/hide grid colum begins-->
+                <div class="row" style="margin-right: 0;">
+                    <button class="btn btn-default pull-right" ng-click="showHideColumns()">
+                        {{'show_hide_columns'| translate}}
+                    </button>
+                </div>
+                <!-- show/hide grid colum ends-->
+
                 <!-- entity begins -->
-                <table class="listTable dhis2-table-striped-border dhis2-table-hover">                    
-                    <thead>                        
-                        <tr>
-                            <th ng-show="gridColumn.show"                                           
-                                ng-repeat="gridColumn in gridColumns">
-
-                                <!-- sort icon begins -->
-                                <span ng-hide="gridColumn.showFilter" class="bold" ng-click="sortGrid(gridColumn)">
-                                    <i ng-show="sortHeader == gridColumn.id && !reverse" class="fa fa-sort-desc"></i>
-                                    <i ng-show="sortHeader == gridColumn.id && reverse" class="fa fa-sort-asc"></i>
+                <div class="vertical-spacing">
+                    <table class="listTable dhis2-table-striped-border dhis2-table-hover">                    
+                        <thead>                        
+                            <tr>
+                                <th ng-show="gridColumn.show" ng-repeat="gridColumn in gridColumns">
                                     {{gridColumn.name}}
-                                </span>
-                                <!-- sort icon ends -->
-
-                                <!-- filter icon begins -->
-                                <span class='pull-right'>
-                                    <span ng-show="gridColumn.type !== 'date'">
-                                        <a href ng-click="filterInGrid(gridColumn)" title="{{'filter'| translate}}"><span ng-class="{true: 'filter - without - content', false: 'filter - with - content'} [filterText[gridColumn.id] == undefined || filterText[gridColumn.id] == '']"><i class="fa fa-filter"></i></span></a>
-                                    </span>
-                                    <span ng-show="gridColumn.type === 'date'">
-                                        <a href ng-click="filterInGrid(gridColumn)" title="{{'filter'| translate}}"><span ng-class="{true: 'filter - without - content', false: 'filter - with - content'} [(filterText[gridColumn.id].start == 'undefined' || filterText[gridColumn.id].start == '') && (filterText[gridColumn.id].end == 'undefined' || filterText[gridColumn.id].end == '')]"><i class="fa fa-filter"></i></span></a>
-                                    </span>                                                    
-                                </span>
-                                <!-- filter icon ends -->
-
-                                <!-- filter input field begins -->
-                                <div ng-show="gridColumn.showFilter">
-                                    <span ng-show="gridColumn.type !== 'date'">
-                                        <input type="text" ng-model="filterText[gridColumn.id]" ng-blur="filterInGrid(gridColumn)">
-                                    </span>                                                    
-                                    <span ng-show="gridColumn.type === 'date'">
-                                        <input placeholder="{{'start_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].start" data-ng-date readonly="readonly">
-                                        <span ng-hide="filterText[gridColumn.id].start == 'undefined' || filterText[gridColumn.id].start == ''">
-                                            <a href ng-click='removeStartFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
-                                        </span>
-                                        <input placeholder="{{'end_date'| translate}}" type="text" ng-model="filterText[gridColumn.id].end" data-ng-date readonly="readonly">
-                                        <span ng-hide="filterText[gridColumn.id].end == 'undefined' || filterText[gridColumn.id].end == ''">
-                                            <a href ng-click='removeEndFilterText(gridColumn.id)'><span class='black'><i class="fa fa-trash-o"></i></span></a>                                                        
-                                        </span>
-                                    </span>
-                                </div>
-                                <!-- filter input field ends -->
-                            </th>                                    
-                        </tr>                        
-                    </thead>
-                    <tbody id="list">
-                        <tr ng-repeat="trackedEntity in trackedEntityList.rows| paginate:rowsPerPage | orderBy:sortHeader:reverse | gridFilter:filterText:currentFilter" 
-                            ng-click="showDashboard(trackedEntity)">
-                            <td ng-show="gridColumn.show"                                            
-                                ng-repeat="gridColumn in gridColumns">                                                
-                                {{trackedEntity[gridColumn.id]}}                                                
-                            </td>
-                        </tr>
-                    </tbody>        
-                </table>
+                                </th>                                    
+                            </tr>                        
+                        </thead>
+                        <tbody id="list">
+                            <tr ng-repeat="trackedEntity in trackedEntityList.rows | paginate:rowsPerPage" 
+                                ng-click="showDashboard(trackedEntity)">
+                                <td ng-show="gridColumn.show"                                            
+                                    ng-repeat="gridColumn in gridColumns">                                                
+                                    {{trackedEntity[gridColumn.id]}}                                                
+                                </td>
+                            </tr>
+                        </tbody>        
+                    </table>
+                </div>
                 <paginator></paginator>
                 <!-- entity ends -->                            
             </div>