← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18979: tracker-capture: in program summary report display no data message instead of empty table

 

------------------------------------------------------------
revno: 18979
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-04-22 12:55:47 +0200
message:
  tracker-capture: in program summary report display no data message instead of empty table
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-summary-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-summary.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-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-summary-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-summary-controller.js	2015-04-20 07:30:05 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-summary-controller.js	2015-04-22 10:55:47 +0000
@@ -134,6 +134,9 @@
                             }  
                             $scope.dhis2Events[ev.trackedEntityInstance] = [ev];
                         }
+                        
+                        $scope.stagesById[ev.programStage].hasData = true;
+                        
                     }
                 });
                 $scope.reportStarted = false;

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-summary.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-summary.html	2015-04-21 08:58:56 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-summary.html	2015-04-22 10:55:47 +0000
@@ -42,60 +42,66 @@
                             <tab-heading>
                                 <span class="bold">{{stage.name}}</span>
                             </tab-heading>
-                            <table class="table table-bordered vertical-spacing">
-                                <thead>                        
-                                    <tr>
-                                        <th class="active">
-                                            {{selectedProgram.trackedEntity.name}}
-                                        </th>
-                                        <th class="active">
-                                            {{'event_date' | translate}}
-                                        </th>
-                                        <th class="active">
-                                            {{'event_orgunit_name'| translate}}
-                                        </th>
-                                        <th class="active" ng-if="prStDe.displayInReports" ng-repeat="prStDe in stage.programStageDataElements">
-                                            {{prStDe.dataElement.name}}
-                                        </th>                                        
-                                    </tr>                        
-                                </thead>
-                                <tbody ng-repeat="tei in teiList" ng-if="dhis2Events[tei.id].length > 0">
-                                    <tr ng-repeat="ev in dhis2Events[tei.id] | filter: {programStage: stage.id} | orderBy: 'eventDate'">
-                                        <td rowspan="{{dhis2Events[tei.id].length}}" ng-if="$index === 0">
-                                            <span ng-repeat="gridColumn in gridColumns" ng-if="gridColumn.displayInListNoProgram">
-                                                <span class="bold">{{gridColumn.name}}:</span> {{tei[gridColumn.id]}}<br>
-                                            </span>
-                                        </td>
-                                        <td>
-                                            {{ev.eventDate}}
-                                        </td>
-                                        <td>
-                                            {{ev.orgUnitName}}
-                                        </td>
-                                        <td ng-if="prStDe.displayInReports" ng-repeat="prStDe in stage.programStageDataElements">
-                                            {{ev[prStDe.dataElement.id]}}
-                                        </td>                                                                       
-                                    </tr>
-                                </tbody>
-                                <tbody ng-repeat="tei in teiList" ng-if="!dhis2Events[tei.id]">
-                                    <tr>
-                                        <td>
-                                            <span ng-repeat="gridColumn in gridColumns" ng-if="gridColumn.displayInListNoProgram">
-                                                <span class="bold">{{gridColumn.name}}:</span> {{tei[gridColumn.id]}}<br>
-                                            </span>
-                                        </td>
-                                        <td>
-                                            {{'no_data' | translate}}
-                                        </td>
-                                        <td>
-                                            {{'no_data' | translate}}
-                                        </td>
-                                        <td ng-if="prStDe.displayInReports" ng-repeat="prStDe in stage.programStageDataElements">
-                                            {{'no_data' | translate}}
-                                        </td>                                                                       
-                                    </tr>
-                                </tbody>
-                            </table>
+                            <div ng-if="stage.hasData">
+                                <table class="table table-bordered vertical-spacing">
+                                    <thead>                        
+                                        <tr>
+                                            <th class="active">
+                                                {{selectedProgram.trackedEntity.name}}
+                                            </th>
+                                            <th class="active">
+                                                {{'event_date' | translate}}
+                                            </th>
+                                            <th class="active">
+                                                {{'event_orgunit_name'| translate}}
+                                            </th>
+                                            <th class="active" ng-if="prStDe.displayInReports" ng-repeat="prStDe in stage.programStageDataElements">
+                                                {{prStDe.dataElement.name}}
+                                            </th>                                        
+                                        </tr>                        
+                                    </thead>
+                                    <tbody ng-repeat="tei in teiList" ng-if="dhis2Events[tei.id].length > 0">
+                                        <tr ng-repeat="ev in dhis2Events[tei.id] | filter: {programStage: stage.id} | orderBy: 'eventDate'">
+                                            <td rowspan="{{dhis2Events[tei.id].length}}" ng-if="$index === 0">
+                                                <span ng-repeat="gridColumn in gridColumns" ng-if="gridColumn.displayInListNoProgram">
+                                                    <span class="bold">{{gridColumn.name}}:</span> {{tei[gridColumn.id]}}<br>
+                                                </span>
+                                            </td>
+                                            <td>
+                                                {{ev.eventDate}}
+                                            </td>
+                                            <td>
+                                                {{ev.orgUnitName}}
+                                            </td>
+                                            <td ng-if="prStDe.displayInReports" ng-repeat="prStDe in stage.programStageDataElements">
+                                                {{ev[prStDe.dataElement.id]}}
+                                            </td>                                                                       
+                                        </tr>
+                                    </tbody>
+                                    <tbody ng-repeat="tei in teiList" ng-if="!dhis2Events[tei.id]">
+                                        <tr>
+                                            <td>
+                                                <span ng-repeat="gridColumn in gridColumns" ng-if="gridColumn.displayInListNoProgram">
+                                                    <span class="bold">{{gridColumn.name}}:</span> {{tei[gridColumn.id]}}<br>
+                                                </span>
+                                            </td>
+                                            <td>
+                                                {{'no_data' | translate}}
+                                            </td>
+                                            <td>
+                                                {{'no_data' | translate}}
+                                            </td>
+                                            <td ng-if="prStDe.displayInReports" ng-repeat="prStDe in stage.programStageDataElements">
+                                                {{'no_data' | translate}}
+                                            </td>                                                                       
+                                        </tr>
+                                    </tbody>
+                                </table>
+                            </div>
+                            <div ng-if="!stage.hasData">
+                                <div class="small-vertical-spacing alert alert-default">{{'no_data_found'| translate}}</div>
+                            </div>
+                            
                         </tab>
                     </tabset>
                 </div>