← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22251: Added scrolling feature to the audit history table.

 

------------------------------------------------------------
revno: 22251
committer: jijukjose <jijukjose@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-03-11 11:57:01 +0100
message:
  Added scrolling feature to the audit history table.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css
  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/styles/style.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/angular-forms/audit-history.html
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.controllers.js


--
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-event-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties	2016-03-01 15:11:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/i18n/i18n_app.properties	2016-03-11 10:57:01 +0000
@@ -167,4 +167,5 @@
 delete_error_audit=The event could not be deleted because it contains an auditlog.
 description=Description
 url=URL
-not_available=Not available
\ No newline at end of file
+not_available=Not available
+attribute=Attribute
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css	2016-03-08 16:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css	2016-03-11 10:57:01 +0000
@@ -466,6 +466,11 @@
     margin-left: 2px;
 }
 
+.scroll {
+    height: 400px;
+    overflow: auto;
+}
+
 .radio-display-none {
     display: none;
 }

=== 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	2016-03-09 14:50:20 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2016-03-11 10:57:01 +0000
@@ -472,4 +472,5 @@
 fill_all_category_options=Please fill all category options
 description=Description
 url=URL
-not_available=Not available
\ No newline at end of file
+not_available=Not available
+attribute=Attribute
\ No newline at end of file

=== 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-10 09:33:53 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2016-03-11 10:57:01 +0000
@@ -1921,6 +1921,11 @@
     margin-left: 5px;
 }
 
+.scroll {
+    height: 400px;
+    overflow: auto;
+}
+
 .row-with-go-button {
     margin-top: 46%;
     margin-left: 1%;

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/angular-forms/audit-history.html'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/angular-forms/audit-history.html	2016-03-08 16:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/angular-forms/audit-history.html	2016-03-11 10:57:01 +0000
@@ -1,37 +1,49 @@
 <div>
-    <div class="modal-header">
-        <h2>{{'audit_history'| translate}}</h2>
-    </div>
-
-    <div class="modal-body">
-        <span class="row">
-            <input class="form-control col-md-7" ng-model="searchText" placeholder="Search" type="search" ng-change="searchTheList()" />
-        </span>
-        </br>
-        <table class="listTable dhis2-table-striped-border">
-            <tr>
-                <th ng-if="model.type==='dataElement'" colspan="4">Data Element</th>
-                <th ng-if="model.type==='attribute'" colspan="4">Attribute</th>
-                <th colspan="4"> {{'audit_date' | translate}}</th>
-                <th colspan="4"> {{'audit_value' | translate}}</th>
-                <th colspan="4"> {{'audit_modified' | translate}}</th>
-            </tr>
-            <tbody ng-repeat="(key,values) in listInDisplay">
-            <tr ng-repeat="value in values">
-                <td ng-if="$index===0" rowspan="{{values.length}}" colspan="4">{{key}}</td>
-                <td colspan="4">{{value.created}}</td>
-                <td colspan="4">{{value.value}}</td>
-                <td colspan="4">{{value.modifiedBy}}</td>
-            </tr>
-            </tbody>
-        </table>
-        <div ng-if="itemList.length === 0">
-            {{'audit_history_unavailable'| translate}}
-        </div>
-    </div>
-
-
-    <div class="modal-footer">
-        <button type="button" class="btn btn-default" data-ng-click="close()">{{'close'| translate}}</button>
+    <div ng-if="!isListEmpty()">
+        <div class="modal-header">
+            <h2>{{'audit_history'| translate}}</h2>
+        </div>
+
+        <div class="modal-body">
+            <span class="row">
+                <input class="form-control col-md-7" ng-model="model.searchText" placeholder="Search" type="search" ng-change="searchTheList()" />
+            </span>
+            <div class="scroll">
+                <table class="listTable dhis2-table-striped-border">
+                    <tr>
+                        <th ng-if="model.type==='dataElement'" colspan="4">{{'data_element' | translate}}</th>
+                        <th ng-if="model.type==='attribute'" colspan="4">Attribute</th>
+                        <th colspan="4"> {{'audit_date' | translate}}</th>
+                        <th colspan="4"> {{'audit_value' | translate}}</th>
+                        <th colspan="4"> {{'audit_modified' | translate}}</th>
+                    </tr>
+                    <tbody ng-repeat="(key,values) in listInDisplay">
+                    <tr ng-repeat="value in values">
+                        <td ng-if="$index===0" rowspan="{{values.length}}" colspan="4">{{key}}</td>
+                        <td colspan="4">{{value.created}}</td>
+                        <td colspan="4">{{value.value}}</td>
+                        <td colspan="4">{{value.modifiedBy}}</td>
+                    </tr>
+                    </tbody>
+                </table>
+            </div>
+            <div ng-if="itemList.length === 0">
+                {{'audit_history_unavailable'| translate}}
+            </div>
+        </div>
+        <div class="modal-footer">
+            <button type="button" class="btn btn-default" data-ng-click="close()">{{'close'| translate}}</button>
+        </div>
+    </div>
+    <div ng-if="isListEmpty()">
+        <div class="modal-header">
+            <h2>{{'audit_history'| translate}}</h2>
+        </div>
+        <div class="modal-body">
+            <div class="alert alert-warning">
+                Audit history unavailable
+            </div>
+            <button type="button" class="btn btn-default" data-ng-click="close()">{{'close'| translate}}</button>
+        </div>
     </div>
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.controllers.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.controllers.js	2016-03-08 16:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.controllers.js	2016-03-11 10:57:01 +0000
@@ -52,7 +52,7 @@
     };
         })
 
-//Controller for audit history
+////Controller for audit history
 .controller('AuditHistoryController', function ($scope, $modalInstance, $modal, AuditHistoryDataService, DateUtils,
                                                     eventId, dataType, nameIdMap) {
 
@@ -69,7 +69,7 @@
     });
 
     $scope.searchTheList = function () {
-        var searchStr = $scope.searchText;
+        var searchStr = $scope.model.searchText;
         var filteredItemList = {};
         for (var item in $scope.itemList) {
             for (var index = 0; index < $scope.itemList[item].length; index++) {
@@ -85,6 +85,9 @@
         }
         $scope.listInDisplay = filteredItemList;
     }
+    $scope.isListEmpty = function() {
+        return Object.keys($scope.listInDisplay).length === 0;
+    }
 
     function isSubString(str, subStr) {
         return str.toLowerCase().indexOf(subStr.toLowerCase()) > -1;