← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20505: tracker-capture: empty widget labels when nothing exists for listing

 

------------------------------------------------------------
revno: 20505
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-10-05 10:58:13 +0200
message:
  tracker-capture: empty widget labels when nothing exists for listing
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-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/notes/notes.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties


--
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/activeprograms/active-programs-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js	2015-09-11 15:16:03 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js	2015-10-05 08:58:13 +0000
@@ -3,15 +3,28 @@
 trackerCapture.controller('ActiveProgramsController',
         function($scope, 
         $location,
+        $translate,
         CurrentSelection) {
     //listen for the selected items
+    $scope.emptyActiveProgramLabel = $translate.instant('no_active_program');
+    
     $scope.$on('selectedItems', function(event, args) {        
         var selections = CurrentSelection.get();
         $scope.selectedTeiId = selections.tei ? selections.tei.trackedEntityInstance : null;
         $scope.activeEnrollments =  [];        
         angular.forEach(selections.enrollments, function(en){
-            if(en.status === "ACTIVE" && selections.pr && selections.pr.id !== en.program){
-                $scope.activeEnrollments.push(en);
+            if(en.status === "ACTIVE"){
+                if( !selections.pr ){
+                    $scope.activeEnrollments.push(en);
+                }
+                if( selections.pr && selections.pr.id ){
+                    if(selections.pr.id !== en.program){
+                        $scope.activeEnrollments.push(en);
+                    }
+                    else{
+                        $scope.emptyActiveProgramLabel = $translate.instant('no_active_program_than_selected');
+                    }
+                }                
             }
         });
     });

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html	2015-09-15 16:03:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html	2015-10-05 08:58:13 +0000
@@ -9,9 +9,9 @@
             <a class="small-horizonal-spacing" href ng-click="removeWidget(activeProgramsWidget)" title="{{removeLabel}}"><i class="fa fa-times-circle"></i></a>            
         </span>        
     </div>    
-    <div ng-show="activeProgramsWidget.expand && activeEnrollments.length > 0" class="panel-body dashboard-element-container">
-        
-        <div class="row">
+    <div ng-show="activeProgramsWidget.expand" class="panel-body dashboard-widget-container">        
+        <div ng-show="activeEnrollments.length === 0" class="alert alert-warning">{{emptyActiveProgramLabel}}</div> 
+        <div class="row" ng-if="activeEnrollments.length > 0">
             <table class="table table-striped dhis2-table-hover">
                 <tr ng-repeat="activeEnrollment in activeEnrollments" ng-click="changeProgram(activeEnrollment.program)">
                     <td>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-10-02 12:05:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-10-05 08:58:13 +0000
@@ -402,14 +402,12 @@
     };
     
     $scope.stickUnstick = function(){        
-        $scope.stickyDisabled = !$scope.stickyDisabled;
-        
+        $scope.stickyDisabled = !$scope.stickyDisabled;        
         var layout = getCurrentDashboardLayout();        
         var layoutKey = $scope.selectedProgram && $scope.selectedProgram.id ? $scope.selectedProgram.id : 'DEFAULT';        
         layout[layoutKey].stickRightSide = !$scope.stickyDisabled;        
         DashboardLayoutService.saveLayout(layout, false).then(function(){
-        });
-        
+        });        
     };
     
     $scope.showHideWidgets = function(){

=== 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	2015-09-17 11:18:51 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2015-10-05 08:58:13 +0000
@@ -67,6 +67,9 @@
                                 </span>
                                 <event-paginator ng-if="stage.id === currentEvent.programStage"></event-paginator>                             
                             </span>
+                            <div ng-if="!eventsByStage[stage.id] || eventsByStage[stage.id].length < 1">
+                                <div class="alert alert-warning">{{'empty_event_list'| translate}}</div> 
+                            </div>
                         </td>                        
                     </tr>
                 </tbody>                

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html	2015-09-15 16:03:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html	2015-10-05 08:58:13 +0000
@@ -34,8 +34,7 @@
                             ng-click="clearNote()">
                         {{'clear'| translate}}
                     </button>
-                </div>
-                <div ng-show="!selectedEnrollment.notes" class="alert alert-warning">{{'empty_notes'| translate}}</div> 
+                </div>                
                 <table class="table table-striped dhis2-table-hover">
                     <tr ng-repeat="note in selectedEnrollment.notes| filter:noteSearchText">
                         <td>
@@ -52,6 +51,7 @@
                     </tr>
                 </table>
             </div>
+            <div ng-show="selectedEnrollment && !selectedEnrollment.notes" class="alert alert-warning">{{'empty_notes'| translate}}</div> 
         </div>
         <div ng-show="showMessagingDiv">
             <div class="alert alert-warning">{{'under_construction'| translate}}</div> 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound-controller.js	2015-09-15 16:03:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound-controller.js	2015-10-05 08:58:13 +0000
@@ -4,11 +4,12 @@
                 $scope,
                 $translate,
                 $log) {
-
     
     $scope.widget = $scope.$parent.$parent.biggerWidget ? $scope.$parent.$parent.biggerWidget
     : $scope.$parent.$parent.smallerWidget ? $scope.$parent.$parent.smallerWidget : null;
-    $scope.widgetTitle = $scope.widget.title;
+    $scope.widgetTitle = $scope.widget.title;    
+    $scope.emptyFeedbackListLabel = $translate.instant('empty_feedback_list');
+    $scope.emptyIndicatorListLabel = $translate.instant('empty_inidcator_list');
     
     $scope.widgetTitleLabel = $translate.instant($scope.widgetTitle);
     
@@ -53,7 +54,6 @@
         });
         
         $scope.showKeyDataSection = keyDataInEffect;
-        $scope.showTextSection = textInEffect;
-        
+        $scope.showTextSection = textInEffect;        
     });     
 });
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound.html	2015-09-15 16:03:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/rulebound/rulebound.html	2015-10-05 08:58:13 +0000
@@ -8,8 +8,8 @@
             </a>
             <a class="small-horizonal-spacing" href ng-click="removeWidget(this.widget)" title="{{removeLabel}}"><i class="fa fa-times-circle"></i></a>            
         </span>        
-    </div>    
-    <div ng-show="this.widget.expand" class="dashboard-element-container">
+    </div>        
+    <div ng-show="this.widget.expand" class="panel-body dashboard-widget-container">        
         <div class="panel-body" ng-if="showKeyDataSection">
             <div ng-repeat="(key,item) in displayKeyDataEffects" ng-show="item.ineffect"  class="info-container">
                 <div class="info-container-heading">{{item.content | trimquotes }}</div>
@@ -25,5 +25,6 @@
                 </td>
             </tr>
         </table>
+        <div ng-show="!showKeyDataSection && !showTextSection" class="alert alert-warning">{{widgetTitleLabel === "Indicators" ? emptyIndicatorListLabel : emptyFeedbackListLabel}}</div> 
     </div>
 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add-controller.js	2015-09-24 14:38:58 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add-controller.js	2015-10-05 08:58:13 +0000
@@ -562,11 +562,8 @@
     if(angular.isObject($scope.programs) && $scope.programs.length === 1){
         $scope.selectedProgramForRelative = $scope.programs[0];
         AttributesFactory.getByProgram($scope.selectedProgramForRelative).then(function(atts){
-            $scope.attributes = atts;
-            
+            $scope.attributes = atts;            
             assignInheritance();
-            
-            console.log('the tei:  ', $scope.selectedTei);
             getRules();
         });
     }

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-10-02 10:23:45 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-10-05 08:58:13 +0000
@@ -63,6 +63,7 @@
 empty_entity_list=There are no registered entities
 empty=Empty
 form_is_empty_fill_at_least_one=Form is empty, please fill at least one.
+empty_event_list=Empty event list
 total=Total
 total_number_of_pages=No. of pages
 rows_per_page=No. of rows per page
@@ -140,7 +141,9 @@
 name=Name
 dataentry=Data Entry
 indicators=Indicators
+empty_inidcator_list=No indicator to show
 feedback=Feedback
+empty_feedback_list=No feedback to show
 custom_form=Custom form
 default_form=Default form
 menu=Menu
@@ -186,6 +189,8 @@
 visits=Visits
 current_selections=Current selections
 activePrograms=Active programs
+no_active_program=No active program to show
+no_active_program_than_selected=No active program other than selected
 org_unit=Organisation unit
 org_unit_scope=Organisation unit scope
 SELECTED=Selected