← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22097: tracker-capture: searching events in data entry widget - WIP

 

------------------------------------------------------------
revno: 22097
committer: Abyot Asalefew Gizaw <abyot@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2016-03-01 17:47:58 +0100
message:
  tracker-capture: searching events in data entry widget - WIP
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css


--
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-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2016-02-19 16:53:52 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2016-03-01 16:47:58 +0000
@@ -103,7 +103,11 @@
         {color: 'alert-default', description: 'skipped', showInStageLegend: false, showInEventLegend: true},
         {color: '', description: 'empty', showInStageLegend: true, showInEventLegend: false}
     ];
-    $scope.showLegend = false;
+ 
+    $scope.model= {};
+    $scope.model.showLegend = false;
+    $scope.model.showEventSearch = false;
+    $scope.model.eventSearchText = '';
     
     $scope.filterLegend = function(){
         if($scope.mainMenuStageSelected()){
@@ -156,8 +160,12 @@
             } 
         }
     }
-
-    $scope.model= {};
+    
+    $scope.$watch("model.eventSearchText", function(newValue, oldValue){        
+        if($scope.model.eventSearchText !== ''){
+            $scope.currentEvent = null;
+        }
+    });
             
     $scope.print = function(divName){
         $scope.printForm = true;
@@ -2075,10 +2083,6 @@
             });        
     };
 
-    $scope.toggleLegend = function () {
-        $scope.showLegend = !$scope.showLegend;
-    };
-
     $scope.getEventStyle = function (ev, skipCurrentEventStyle) {
 
         var style = EventUtils.getEventStatusColor(ev);

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2016-02-22 19:58:07 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2016-03-01 16:47:58 +0000
@@ -5,7 +5,7 @@
             {{'main_menu' | translate}}
             
             <span class="pull-right widget-link">
-                <a href ng-click="toggleLegend()" title="{{'event_color_legend'| translate}}" class="small-horizonal-spacing"><i class="fa fa-info-circle vertical-center"></i></a>
+                <a href ng-click="model.showLegend = !model.showLegend" title="{{'event_color_legend'| translate}}" class="small-horizonal-spacing"><i class="fa fa-info-circle vertical-center"></i></a>
                 <a class="small-horizonal-spacing" href ng-click="expandCollapse(dataentryWidget)">
                     <span ng-show="dataentryWidget.expand"><i class="fa fa-chevron-up vertical-center" title="{{collapseLabel}}"></i></span>
                     <span ng-show="!dataentryWidget.expand"><i class="fa fa-chevron-down vertical-center" title="{{expandLabel}}"></i></span>
@@ -14,10 +14,10 @@
             
         </div>
         <div ng-if="!useMainMenu">            
-            {{'dataentry' | translate}}            
-            <span class="pull-right widget-link">  
-               
-                <a href ng-click="toggleLegend()" title="{{'event_color_legend'| translate}}" class="small-horizonal-spacing"><i class="fa fa-info-circle vertical-center"></i></a>
+            {{'dataentry' | translate}}
+            <span class="pull-right widget-link">               
+                <a href ng-click="model.showEventSearch = !model.showEventSearch" title="{{'search'| translate}}" class="small-horizonal-spacing"><i class="fa fa-search vertical-center"></i></a>
+                <a href ng-click="model.showLegend = !model.showLegend" title="{{'event_color_legend'| translate}}" class="small-horizonal-spacing"><i class="fa fa-info-circle vertical-center"></i></a>
                 <a href ng-click="toggleEventsTableDisplay()" title="{{showEventsAsTables ? 'toggle_table_view_off' : 'toggle_table_view_on'| translate}}" ng-show="stagesCanBeShownAsTable"><span ng-if="!showEventsAsTables"><i class="fa fa-bars vertical-center"></i></span><span ng-if="showEventsAsTables"><i class="fa fa-square vertical-center"></i></span></a>
                 <a class="small-horizonal-spacing" href ng-click="expandCollapse(dataentryWidget)">
                     <span ng-show="dataentryWidget.expand"><i class="fa fa-chevron-up vertical-center" title="{{collapseLabel}}"></i></span>
@@ -36,7 +36,7 @@
                         {{stage.displayName}} ({{getStageEventCnt(stage)}})
                     </a>
                 </span>
-                <a href ng-click="toggleLegend()" title="{{'event_color_legend'| translate}}" class="small-horizonal-spacing"><i class="fa fa-info-circle vertical-center"></i></a>
+                <a href ng-click="model.showLegend = !model.showLegend" title="{{'event_color_legend'| translate}}" class="small-horizonal-spacing"><i class="fa fa-info-circle vertical-center"></i></a>
                 <a href ng-click="toggleEventsTableDisplay()" title="{{showEventsAsTables ? 'toggle_table_view_off' : 'toggle_table_view_on'| translate}}" ng-show="stagesCanBeShownAsTable"><span ng-if="!showEventsAsTables"><i class="fa fa-bars vertical-center"></i></span><span ng-if="showEventsAsTables"><i class="fa fa-square vertical-center"></i></span></a>
                 <a class="small-horizonal-spacing" href ng-click="expandCollapse(dataentryWidget)">
                     <span ng-show="dataentryWidget.expand"><i class="fa fa-chevron-up vertical-center" title="{{collapseLabel}}"></i></span>
@@ -55,7 +55,7 @@
 
         <div ng-if="dashboardReady"> 
             
-            <div ng-if="showLegend">
+            <div ng-if="model.showLegend">
                 <span class='bold'>{{'legend'| translate}}</span>
                 <table class="table table-bordered" style="width: 100%;">
                     <tr>
@@ -64,7 +64,7 @@
                         </td>
                     </tr>
                 </table>
-            </div>            
+            </div>
             <div ng-if="useMainMenu && !mainMenuStageSelected() && eventsLoaded">
                     <div class="">
                         <div ng-repeat="mainMenuStage in mainMenuStages" class="main-menu-item-container" ng-class="getMainMenuItemStyle(mainMenuStage)" ng-click="openStageFromMenu(mainMenuStage)">                            

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html	2016-02-29 14:26:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/event-layout.html	2016-03-01 16:47:58 +0000
@@ -1,6 +1,9 @@
 <div class="row">
+    <div class="col-sm-12" ng-if="allEventsSorted.length > eventPageSize && model.showEventSearch">
+        <input class="form-control" ng-model="model.eventSearchText"/>
+    </div>    
     <div ng-class="getTopLineColumnStyle(1)">
-        <div ng-if="!useMainMenu || (useMainMenu && !hideTopLineEventsForFormTypes[displayCustomForm])" ng-repeat="dhis2Event in getTopLineEventsPage()">            
+        <div ng-if="!useMainMenu || (useMainMenu && !hideTopLineEventsForFormTypes[displayCustomForm])" ng-repeat="dhis2Event in getTopLineEventsPage() | filter:model.eventSearchText">            
             <div class="event-container" ng-click="getEventPage('BACKWARD')" ng-if="$index === 0 && eventPagingStart > 0">
                 {{'previous'| translate}}
             </div>
@@ -26,7 +29,7 @@
                  details="{{'details'| translate}}"
                  content="dhis2Event"
                  template="event-details.html"  
-                 placement="right" 
+                 placement="top" 
                  ng-class="getEventStyle(dhis2Event)" 
                  ng-click="showDataEntry(dhis2Event, false)">                
                 <div class="event-container-item">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2016-03-01 15:11:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2016-03-01 16:47:58 +0000
@@ -220,7 +220,7 @@
     display: flex;
     cursor: pointer;
     opacity: 1.0;    
-    margin: 5px;
+    margin: 5px 5px 5px 0;
     padding-top: 15px;
     padding-bottom: 5px;
     padding-left: 5px;